From owner-svn-src-head@freebsd.org Sun Oct 21 00:11:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7EA7FFB3D4; Sun, 21 Oct 2018 00:11:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DE7970DF4; Sun, 21 Oct 2018 00:11:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88C6B256AA; Sun, 21 Oct 2018 00:11:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L0BukC021441; Sun, 21 Oct 2018 00:11:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0BuB2021440; Sun, 21 Oct 2018 00:11:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810210011.w9L0BuB2021440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Oct 2018 00:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339508 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339508 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, 21 Oct 2018 00:11:57 -0000 Author: kib Date: Sun Oct 21 00:11:56 2018 New Revision: 339508 URL: https://svnweb.freebsd.org/changeset/base/339508 Log: Unindent vm_map_simplify_entry() after r339506. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17632 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Oct 20 23:17:24 2018 (r339507) +++ head/sys/vm/vm_map.c Sun Oct 21 00:11:56 2018 (r339508) @@ -1708,25 +1708,23 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent return; prev = entry->prev; - if (prev != &map->header) { - if (vm_map_mergeable_neighbors(prev, entry)) { - vm_map_entry_unlink(map, prev); - entry->start = prev->start; - entry->offset = prev->offset; - if (entry->prev != &map->header) - vm_map_entry_resize_free(map, entry->prev); - vm_map_merged_neighbor_dispose(map, prev); - } + if (prev != &map->header && + vm_map_mergeable_neighbors(prev, entry)) { + vm_map_entry_unlink(map, prev); + entry->start = prev->start; + entry->offset = prev->offset; + if (entry->prev != &map->header) + vm_map_entry_resize_free(map, entry->prev); + vm_map_merged_neighbor_dispose(map, prev); } next = entry->next; - if (next != &map->header) { - if (vm_map_mergeable_neighbors(entry, next)) { - vm_map_entry_unlink(map, next); - entry->end = next->end; - vm_map_entry_resize_free(map, entry); - vm_map_merged_neighbor_dispose(map, next); - } + if (next != &map->header && + vm_map_mergeable_neighbors(entry, next)) { + vm_map_entry_unlink(map, next); + entry->end = next->end; + vm_map_entry_resize_free(map, entry); + vm_map_merged_neighbor_dispose(map, next); } } /* From owner-svn-src-head@freebsd.org Sun Oct 21 00:15:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B7CDFFB68A; Sun, 21 Oct 2018 00:15:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E57C771017; Sun, 21 Oct 2018 00:15:51 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E05CC256E0; Sun, 21 Oct 2018 00:15:51 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L0Fp8b023861; Sun, 21 Oct 2018 00:15:51 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0FpD9023860; Sun, 21 Oct 2018 00:15:51 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810210015.w9L0FpD9023860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 21 Oct 2018 00:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339509 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 339509 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, 21 Oct 2018 00:15:52 -0000 Author: dteske Date: Sun Oct 21 00:15:51 2018 New Revision: 339509 URL: https://svnweb.freebsd.org/changeset/base/339509 Log: Restore the ability to prevent the user from interrupting the boot process without first entering the password stored in loader.conf(5). PR: kern/207069 Reported by: david@dcrosstech.com MFC after: 3 days Sponsored by: Smule, Inc. Modified: head/stand/forth/check-password.4th Modified: head/stand/forth/check-password.4th ============================================================================== --- head/stand/forth/check-password.4th Sun Oct 21 00:11:56 2018 (r339508) +++ head/stand/forth/check-password.4th Sun Oct 21 00:15:51 2018 (r339509) @@ -129,7 +129,7 @@ variable readlen \ input length again \ Enter was not pressed; repeat ; -only forth definitions also password-processing +only forth definitions also password-processing also support-functions : check-password ( -- ) @@ -161,6 +161,7 @@ only forth definitions also password-processing \ We should prevent the user from visiting the menu or dropping to the \ interactive loader(8) prompt, but still allow the machine to boot... + any_conf_read? if load_kernel load_modules then 0 autoboot \ Only reached if autoboot fails for any reason (including if/when From owner-svn-src-head@freebsd.org Sun Oct 21 00:20:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B7D2FFB7DF; Sun, 21 Oct 2018 00:20:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF36871213; Sun, 21 Oct 2018 00:20:45 +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 EA23B256FF; Sun, 21 Oct 2018 00:20:45 +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 w9L0KjjJ024915; Sun, 21 Oct 2018 00:20:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0KfH8024126; Sun, 21 Oct 2018 00:20:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810210020.w9L0KfH8024126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 21 Oct 2018 00:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339510 - head/lib/libc/quad X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/quad X-SVN-Commit-Revision: 339510 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, 21 Oct 2018 00:20:46 -0000 Author: emaste Date: Sun Oct 21 00:20:40 2018 New Revision: 339510 URL: https://svnweb.freebsd.org/changeset/base/339510 Log: ANSIfy libc/quad Some of these routines exist in both lib/libc/quad/ and sys/libkern/. r325988 ANSIfied sys/libkern. Update libc/quad to match. PR: 223641 Reported by: bde Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/quad/adddi3.c head/lib/libc/quad/anddi3.c head/lib/libc/quad/ashldi3.c head/lib/libc/quad/ashrdi3.c head/lib/libc/quad/cmpdi2.c head/lib/libc/quad/divdi3.c head/lib/libc/quad/fixdfdi.c head/lib/libc/quad/fixunsdfdi.c head/lib/libc/quad/floatdidf.c head/lib/libc/quad/floatdisf.c head/lib/libc/quad/floatunsdidf.c head/lib/libc/quad/iordi3.c head/lib/libc/quad/lshldi3.c head/lib/libc/quad/lshrdi3.c head/lib/libc/quad/moddi3.c head/lib/libc/quad/muldi3.c head/lib/libc/quad/negdi2.c head/lib/libc/quad/notdi2.c head/lib/libc/quad/qdivrem.c head/lib/libc/quad/subdi3.c head/lib/libc/quad/ucmpdi2.c head/lib/libc/quad/udivdi3.c head/lib/libc/quad/umoddi3.c head/lib/libc/quad/xordi3.c Modified: head/lib/libc/quad/adddi3.c ============================================================================== --- head/lib/libc/quad/adddi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/adddi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$"); * either x or y (the choice to compare with x or y is arbitrary). */ quad_t -__adddi3(a, b) - quad_t a, b; +__adddi3(quad_t a, quad_t b) { union uu aa, bb, sum; Modified: head/lib/libc/quad/anddi3.c ============================================================================== --- head/lib/libc/quad/anddi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/anddi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Return a & b, in quad. */ quad_t -__anddi3(a, b) - quad_t a, b; +__anddi3(quad_t a, quad_t b) { union uu aa, bb; Modified: head/lib/libc/quad/ashldi3.c ============================================================================== --- head/lib/libc/quad/ashldi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/ashldi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); * This is the same as logical shift left! */ quad_t -__ashldi3(a, shift) - quad_t a; - qshift_t shift; +__ashldi3(quad_t a, qshift_t shift) { union uu aa; Modified: head/lib/libc/quad/ashrdi3.c ============================================================================== --- head/lib/libc/quad/ashrdi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/ashrdi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$"); * Shift a (signed) quad value right (arithmetic shift right). */ quad_t -__ashrdi3(a, shift) - quad_t a; - qshift_t shift; +__ashrdi3(quad_t a, qshift_t shift) { union uu aa; Modified: head/lib/libc/quad/cmpdi2.c ============================================================================== --- head/lib/libc/quad/cmpdi2.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/cmpdi2.c Sun Oct 21 00:20:40 2018 (r339510) @@ -47,8 +47,7 @@ __FBSDID("$FreeBSD$"); * signed. */ int -__cmpdi2(a, b) - quad_t a, b; +__cmpdi2(quad_t a, quad_t b) { union uu aa, bb; Modified: head/lib/libc/quad/divdi3.c ============================================================================== --- head/lib/libc/quad/divdi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/divdi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); * ??? if -1/2 should produce -1 on this machine, this code is wrong */ quad_t -__divdi3(a, b) - quad_t a, b; +__divdi3(quad_t a, quad_t b) { u_quad_t ua, ub, uq; int neg; Modified: head/lib/libc/quad/fixdfdi.c ============================================================================== --- head/lib/libc/quad/fixdfdi.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/fixdfdi.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); * We clamp anything that is out of range. */ quad_t -__fixdfdi(x) - double x; +__fixdfdi(double x) { if (x < 0) if (x <= QUAD_MIN) Modified: head/lib/libc/quad/fixunsdfdi.c ============================================================================== --- head/lib/libc/quad/fixunsdfdi.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/fixunsdfdi.c Sun Oct 21 00:20:40 2018 (r339510) @@ -51,8 +51,7 @@ __FBSDID("$FreeBSD$"); * of range becomes UQUAD_MAX. */ u_quad_t -__fixunsdfdi(x) - double x; +__fixunsdfdi(double x) { double toppart; union uu t; Modified: head/lib/libc/quad/floatdidf.c ============================================================================== --- head/lib/libc/quad/floatdidf.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/floatdidf.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Convert (signed) quad to double. */ double -__floatdidf(x) - quad_t x; +__floatdidf(quad_t x) { double d; union uu u; Modified: head/lib/libc/quad/floatdisf.c ============================================================================== --- head/lib/libc/quad/floatdisf.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/floatdisf.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Convert (signed) quad to float. */ float -__floatdisf(x) - quad_t x; +__floatdisf(quad_t x) { float f; union uu u; Modified: head/lib/libc/quad/floatunsdidf.c ============================================================================== --- head/lib/libc/quad/floatunsdidf.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/floatunsdidf.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); * This is exactly like floatdidf.c except that negatives never occur. */ double -__floatunsdidf(x) - u_quad_t x; +__floatunsdidf(u_quad_t x) { double d; union uu u; Modified: head/lib/libc/quad/iordi3.c ============================================================================== --- head/lib/libc/quad/iordi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/iordi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Return a | b, in quad. */ quad_t -__iordi3(a, b) - quad_t a, b; +__iordi3(quad_t a, quad_t b) { union uu aa, bb; Modified: head/lib/libc/quad/lshldi3.c ============================================================================== --- head/lib/libc/quad/lshldi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/lshldi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); * This is the same as arithmetic shift left! */ quad_t -__lshldi3(a, shift) - quad_t a; - qshift_t shift; +__lshldi3(quad_t a, qshift_t shift) { union uu aa; Modified: head/lib/libc/quad/lshrdi3.c ============================================================================== --- head/lib/libc/quad/lshrdi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/lshrdi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$"); * Shift an (unsigned) quad value right (logical shift right). */ quad_t -__lshrdi3(a, shift) - quad_t a; - qshift_t shift; +__lshrdi3(quad_t a, qshift_t shift) { union uu aa; Modified: head/lib/libc/quad/moddi3.c ============================================================================== --- head/lib/libc/quad/moddi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/moddi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -48,8 +48,7 @@ __FBSDID("$FreeBSD$"); * If -1/2 should produce -1 on this machine, this code is wrong. */ quad_t -__moddi3(a, b) - quad_t a, b; +__moddi3(quad_t a, quad_t b) { u_quad_t ua, ub, ur; int neg; Modified: head/lib/libc/quad/muldi3.c ============================================================================== --- head/lib/libc/quad/muldi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/muldi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -101,8 +101,7 @@ __FBSDID("$FreeBSD$"); static quad_t __lmulq(u_long, u_long); quad_t -__muldi3(a, b) - quad_t a, b; +__muldi3(quad_t a, quad_t b) { union uu u, v, low, prod; u_long high, mid, udiff, vdiff; Modified: head/lib/libc/quad/negdi2.c ============================================================================== --- head/lib/libc/quad/negdi2.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/negdi2.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Return -a (or, equivalently, 0 - a), in quad. See subdi3.c. */ quad_t -__negdi2(a) - quad_t a; +__negdi2(quad_t a) { union uu aa, res; Modified: head/lib/libc/quad/notdi2.c ============================================================================== --- head/lib/libc/quad/notdi2.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/notdi2.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); * than `not'. */ quad_t -__one_cmpldi2(a) - quad_t a; +__one_cmpldi2(quad_t a) { union uu aa; Modified: head/lib/libc/quad/qdivrem.c ============================================================================== --- head/lib/libc/quad/qdivrem.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/qdivrem.c Sun Oct 21 00:20:40 2018 (r339510) @@ -82,8 +82,7 @@ shl(digit *p, int len, int sh) * leading zeros). */ u_quad_t -__qdivrem(uq, vq, arq) - u_quad_t uq, vq, *arq; +__qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) { union uu tmp; digit *u, *v, *q; Modified: head/lib/libc/quad/subdi3.c ============================================================================== --- head/lib/libc/quad/subdi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/subdi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); * from a single u_long difference x-y occurs if and only if (x-y) > x. */ quad_t -__subdi3(a, b) - quad_t a, b; +__subdi3(quad_t a, quad_t b) { union uu aa, bb, diff; Modified: head/lib/libc/quad/ucmpdi2.c ============================================================================== --- head/lib/libc/quad/ucmpdi2.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/ucmpdi2.c Sun Oct 21 00:20:40 2018 (r339510) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); * Neither a nor b are considered signed. */ int -__ucmpdi2(a, b) - u_quad_t a, b; +__ucmpdi2(u_quad_t a, u_quad_t b) { union uu aa, bb; Modified: head/lib/libc/quad/udivdi3.c ============================================================================== --- head/lib/libc/quad/udivdi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/udivdi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Divide two unsigned quads. */ u_quad_t -__udivdi3(a, b) - u_quad_t a, b; +__udivdi3(u_quad_t a, u_quad_t b) { return (__qdivrem(a, b, (u_quad_t *)0)); Modified: head/lib/libc/quad/umoddi3.c ============================================================================== --- head/lib/libc/quad/umoddi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/umoddi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Return remainder after dividing two unsigned quads. */ u_quad_t -__umoddi3(a, b) - u_quad_t a, b; +__umoddi3(u_quad_t a, u_quad_t b) { u_quad_t r; Modified: head/lib/libc/quad/xordi3.c ============================================================================== --- head/lib/libc/quad/xordi3.c Sun Oct 21 00:15:51 2018 (r339509) +++ head/lib/libc/quad/xordi3.c Sun Oct 21 00:20:40 2018 (r339510) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Return a ^ b, in quad. */ quad_t -__xordi3(a, b) - quad_t a, b; +__xordi3(quad_t a, quad_t b) { union uu aa, bb; From owner-svn-src-head@freebsd.org Sun Oct 21 00:28:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34230FFBA3E; Sun, 21 Oct 2018 00:28:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFC06715EC; Sun, 21 Oct 2018 00:28: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 BBCB425879; Sun, 21 Oct 2018 00:28: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 w9L0S0EQ029147; Sun, 21 Oct 2018 00:28:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0Rxea029138; Sun, 21 Oct 2018 00:27:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810210027.w9L0Rxea029138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 21 Oct 2018 00:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339511 - in head: . share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . share/mk tools/build/options X-SVN-Commit-Revision: 339511 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, 21 Oct 2018 00:28:01 -0000 Author: emaste Date: Sun Oct 21 00:27:59 2018 New Revision: 339511 URL: https://svnweb.freebsd.org/changeset/base/339511 Log: Introduce src.conf knob to build userland with retpoline WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland for CVE-2017-5715. Reported by: Peter Malcom Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17421 Added: head/tools/build/options/WITH_RETPOLINE (contents, props changed) Modified: head/Makefile.inc1 head/share/mk/bsd.lib.mk head/share/mk/bsd.opts.mk head/share/mk/bsd.prog.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Oct 21 00:20:40 2018 (r339510) +++ head/Makefile.inc1 Sun Oct 21 00:27:59 2018 (r339511) @@ -659,7 +659,7 @@ BSARGS= DESTDIR= \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no \ + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes BMAKE= \ @@ -680,7 +680,7 @@ TMAKE= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no # cross-tools stage # TOOLS_PREFIX set in BMAKE @@ -703,7 +703,7 @@ KTMAKE= \ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no + -DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WARNS=no MK_CTF=no # world stage WMAKEENV= ${CROSSENV} \ @@ -2383,6 +2383,7 @@ NXBMAKEARGS+= \ MK_OFED=no \ MK_OPENSSH=no \ MK_PROFILE=no \ + MK_RETPOLINE=no \ MK_SENDMAIL=no \ MK_SVNLITE=no \ MK_TESTS=no \ Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sun Oct 21 00:20:40 2018 (r339510) +++ head/share/mk/bsd.lib.mk Sun Oct 21 00:27:59 2018 (r339511) @@ -69,6 +69,12 @@ TAGS+= package=${PACKAGE:Uruntime} TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +LDFLAGS+= -Wl,-zretpolineplt +.endif + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Sun Oct 21 00:20:40 2018 (r339510) +++ head/share/mk/bsd.opts.mk Sun Oct 21 00:27:59 2018 (r339511) @@ -72,6 +72,7 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ + RETPOLINE \ STALE_STAGED __DEFAULT_DEPENDENT_OPTIONS = \ Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sun Oct 21 00:20:40 2018 (r339510) +++ head/share/mk/bsd.prog.mk Sun Oct 21 00:27:59 2018 (r339511) @@ -34,6 +34,12 @@ PROG= ${PROG_CXX} MK_DEBUG_FILES= no .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +LDFLAGS+= -Wl,-zretpolineplt +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} .else Added: head/tools/build/options/WITH_RETPOLINE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_RETPOLINE Sun Oct 21 00:27:59 2018 (r339511) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. From owner-svn-src-head@freebsd.org Sun Oct 21 00:31:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AD9FFBCCB for ; Sun, 21 Oct 2018 00:31:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA8671979 for ; Sun, 21 Oct 2018 00:31:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr1-x429.google.com with SMTP id i4-v6so2338773wrr.13 for ; Sat, 20 Oct 2018 17:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Zxk4fhnxWaE6j2tmM7qO95QiPCp3EwKm8JytDG3jxZ0=; b=kTj9al7Eav1vCcSuitIOLF5zG5obR4uf60u5s1N+bPRMlRngZuScqo6g/EFumbye9D MvJm3/Iyfh6iJosj6Tuzeo2OkpfwJBCozUdcfR1TK/yIOhGNFkQbp9k9mKNDfsWc1+H9 Rb/MATFrCgiROY+U9eiy9GwVpwnlSNgg8obeRiBBwa3DatD2lboqqb+SgUUivqGj7Tuf oa71QusU23a+VTfB+m1cyo7yhEC4pBWhdur7H7XQMA7vv7etQk8mPgxZrcLo2cPmbX9B P53Fy+nhV0fgo4RqdnlSA9PjsedXrJCSTHMIrHH4k+h13DyjGjHM1GLBvtiBJ72SbmJB W39g== 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Zxk4fhnxWaE6j2tmM7qO95QiPCp3EwKm8JytDG3jxZ0=; b=Vz69WdnhSy6z3aq7refFiszzReGk2SZV12MgRA2+M+6tIoQfvXqjzRgrfI13jJwxVR SrMlh6eFtrjwzzV3gjDH69aq/H7Ae5xD8938W0ZDhLTb5nvBE5+fGgqDHIpHyrD1j8YY XFB/X15yDVNxm3YrOUwLcgRNMQOlBam4XhxRkDtF7bwt+aJPX2DckGquYk38HEj3ZjTZ GD1akb4aTU+dQAykhCB7MR//ga7ldIIqX+F3tH0oKrSwGa4O1qFIbW70cWloj5uN/L0u fg99TmoZ4DYwLd8YimN9jc49H/QHtF/nG/z90AVCMffdY4qQIw+QrCZHRtGqeX8SJhs/ ia5w== X-Gm-Message-State: ABuFfogSEoJHYciVZ3dihk/nxg16/RSFoiAJAlsM8LI2jm+mh13M+FpD YEfAyiHWBwMB9psQQgDu8+puvw== X-Google-Smtp-Source: ACcGV63RdybzWNcSbJR/sJcVhvUf4jAy2DEBfZ+vzwIH+4SnPtlYoHr0w15ZGDR4b/zyvybD3mFuVw== X-Received: by 2002:a5d:6902:: with SMTP id t2-v6mr39370720wru.323.1540081885688; Sat, 20 Oct 2018 17:31:25 -0700 (PDT) Received: from mutt-hbsd ([185.220.102.4]) by smtp.gmail.com with ESMTPSA id u191-v6sm7037259wmd.31.2018.10.20.17.31.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 17:31:24 -0700 (PDT) Date: Sat, 20 Oct 2018 20:31:14 -0400 From: Shawn Webb To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339511 - in head: . share/mk tools/build/options Message-ID: <20181021003114.dtvjaklkcymksnj5@mutt-hbsd> References: <201810210027.w9L0Rxea029138@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="y7omgbbolddkzumk" Content-Disposition: inline In-Reply-To: <201810210027.w9L0Rxea029138@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-ALPHA7 FreeBSD 12.0-ALPHA7 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 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, 21 Oct 2018 00:31:28 -0000 --y7omgbbolddkzumk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 21, 2018 at 12:27:59AM +0000, Ed Maste wrote: > Author: emaste > Date: Sun Oct 21 00:27:59 2018 > New Revision: 339511 > URL: https://svnweb.freebsd.org/changeset/base/339511 >=20 > Log: > Introduce src.conf knob to build userland with retpoline > =20 > WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland > for CVE-2017-5715. > =20 > Reported by: Peter Malcom > Reviewed by: markj > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17421 >=20 > Added: > head/tools/build/options/WITH_RETPOLINE (contents, props changed) > Modified: > head/Makefile.inc1 > head/share/mk/bsd.lib.mk > head/share/mk/bsd.opts.mk > head/share/mk/bsd.prog.mk >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/Makefile.inc1 Sun Oct 21 00:20:40 2018 (r339510) > +++ head/Makefile.inc1 Sun Oct 21 00:27:59 2018 (r339511) > @@ -659,7 +659,7 @@ BSARGS=3D DESTDIR=3D \ > -DNO_PIC MK_PROFILE=3Dno -DNO_SHARED \ > -DNO_CPU_CFLAGS MK_WARNS=3Dno MK_CTF=3Dno \ > MK_CLANG_EXTRAS=3Dno MK_CLANG_FULL=3Dno \ > - MK_LLDB=3Dno MK_TESTS=3Dno \ > + MK_LLDB=3Dno MK_RETPOLINE=3Dno MK_TESTS=3Dno \ > MK_INCLUDES=3Dyes > =20 > BMAKE=3D \ > @@ -680,7 +680,7 @@ TMAKE=3D \ > -DNO_LINT \ > -DNO_CPU_CFLAGS MK_WARNS=3Dno MK_CTF=3Dno \ > MK_CLANG_EXTRAS=3Dno MK_CLANG_FULL=3Dno \ > - MK_LLDB=3Dno MK_TESTS=3Dno > + MK_LLDB=3Dno MK_RETPOLINE=3Dno MK_TESTS=3Dno > =20 > # cross-tools stage > # TOOLS_PREFIX set in BMAKE > @@ -703,7 +703,7 @@ KTMAKE=3D \ > SSP_CFLAGS=3D \ > MK_HTML=3Dno -DNO_LINT MK_MAN=3Dno \ > -DNO_PIC MK_PROFILE=3Dno -DNO_SHARED \ > - -DNO_CPU_CFLAGS MK_WARNS=3Dno MK_CTF=3Dno > + -DNO_CPU_CFLAGS MK_RETPOLINE=3Dno MK_WARNS=3Dno MK_CTF=3Dno > =20 > # world stage > WMAKEENV=3D ${CROSSENV} \ > @@ -2383,6 +2383,7 @@ NXBMAKEARGS+=3D \ > MK_OFED=3Dno \ > MK_OPENSSH=3Dno \ > MK_PROFILE=3Dno \ > + MK_RETPOLINE=3Dno \ > MK_SENDMAIL=3Dno \ > MK_SVNLITE=3Dno \ > MK_TESTS=3Dno \ >=20 > Modified: head/share/mk/bsd.lib.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/mk/bsd.lib.mk Sun Oct 21 00:20:40 2018 (r339510) > +++ head/share/mk/bsd.lib.mk Sun Oct 21 00:27:59 2018 (r339511) > @@ -69,6 +69,12 @@ TAGS+=3D package=3D${PACKAGE:Uruntime} > TAG_ARGS=3D -T ${TAGS:[*]:S/ /,/g} > .endif > =20 > +.if ${MK_RETPOLINE} !=3D "no" > +CFLAGS+=3D -mretpoline > +CXXFLAGS+=3D -mretpoline > +LDFLAGS+=3D -Wl,-zretpolineplt > +.endif > + > .if ${MK_DEBUG_FILES} !=3D "no" && empty(DEBUG_FLAGS:M-g) && \ > empty(DEBUG_FLAGS:M-gdwarf*) > CFLAGS+=3D ${DEBUG_FILES_CFLAGS} >=20 > Modified: head/share/mk/bsd.opts.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/mk/bsd.opts.mk Sun Oct 21 00:20:40 2018 (r339510) > +++ head/share/mk/bsd.opts.mk Sun Oct 21 00:27:59 2018 (r339511) > @@ -72,6 +72,7 @@ __DEFAULT_NO_OPTIONS =3D \ > CCACHE_BUILD \ > CTF \ > INSTALL_AS_USER \ > + RETPOLINE \ > STALE_STAGED [snip] We at HardenedBSD have had Retpoline enabled in 12 userland and kernel for a few months now. I've found it to be safe to enable by default. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --y7omgbbolddkzumk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlvLyM0ACgkQaoRlj1JF bu4h6w/+N8vmrsqCh8XiXAtk6yUvtLfNYgzHOmqzX1RBHW39w6hZIydt0qsIq/8E F42sA2LVrjr7lME4ETYd+vWi5LateM6K77ebUU7+c+BAT3SM0PRJNgsi0UFLNzTz HNGxo9VOVRKml347mGeg7EwA+zVxN82y5+XhByJCcyuKlAXN0XcFFz9Qyosay8V0 PmT1+DcL/NpgdcCBf+C82xdnz3qBwC7BVOfz01UNFxkYNqgRlOj9MDj6ZBSm9qjL 9GiKO3hJ2g6A/nUDPGkjrglZPMH9puivlaJIStyzx1j8QSQOMRsCUImfl8g/E7QR OzTdRV31vDWvNgGzjzpgfI6fFtIAi4Cf7kGUml/HJvymqyHYTCTJrmkrNJbb2SEZ hw2hXIVjWnw9oMl0fatQfuirfp8OepWmFxzd2QSVhm3Tgpjrcg6OTT++PIdHak93 ntXHR+QxofCF0UVB0v8E4bHF1Tz1MU/SVMLSR1N5PiDPPm2hk9Dgha0y7j9zGBso G6XaF5uakZ9uEBHFUBzylYnawBO442H1ILtuEQcVZX4XJmrL6TqObL09OYS07yVq DZlN660SpDlDdeWNGs2otsrfDDY2JcPZVOA/v+z1ngHXw6diI5vwjvvOkgDJt2IF v7FtHmHnmG6RUjysHvEqwOedCkriDozaFSELgi6rW1pXUOK4dWI= =qKBY -----END PGP SIGNATURE----- --y7omgbbolddkzumk-- From owner-svn-src-head@freebsd.org Sun Oct 21 00:33:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B115FFBD6A; Sun, 21 Oct 2018 00:33: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E297371B80; Sun, 21 Oct 2018 00:32:59 +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 D7A3525A16; Sun, 21 Oct 2018 00:32:59 +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 w9L0WxjP034250; Sun, 21 Oct 2018 00:32:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0Wx6g034249; Sun, 21 Oct 2018 00:32:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810210032.w9L0Wx6g034249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 21 Oct 2018 00:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339512 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 339512 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, 21 Oct 2018 00:33:00 -0000 Author: emaste Date: Sun Oct 21 00:32:59 2018 New Revision: 339512 URL: https://svnweb.freebsd.org/changeset/base/339512 Log: regen src.conf after r339477 and r339511 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Oct 21 00:27:59 2018 (r339511) +++ head/share/man/man5/src.conf.5 Sun Oct 21 00:32:59 2018 (r339512) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 18, 2018 +.Dd October 20, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -149,7 +149,7 @@ of the normal system build. The resulting system cannot build programs from source. .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. When set, it enforces these options: .Pp .Bl -item -compact @@ -171,7 +171,7 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, and objdump) as part of the bootstrap process. @@ -310,7 +310,7 @@ When set, it enforces these options: Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact @@ -366,7 +366,7 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp @@ -379,7 +379,7 @@ Set to avoid building the ARCMigrate, Rewriter and Sta the Clang C/C++ compiler. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_FULL Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -394,7 +394,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -470,7 +470,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -635,7 +635,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -699,7 +699,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC Set to build and install gcc and g++. .Pp @@ -712,7 +712,7 @@ unless an alternative compiler is provided via XCC. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. .Pp @@ -727,7 +727,7 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. .It Va WITH_GDB Set to build .Xr gdb 1 . @@ -754,7 +754,7 @@ to be used as a fallback for if a newer version is not installed. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and riscv/riscv64. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. @@ -766,7 +766,7 @@ Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff 1 @@ -794,7 +794,7 @@ Set to build the GPL'd version of the device tree comp instead of the BSD licensed one. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -809,7 +809,7 @@ Set to not build HTML docs. Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -986,7 +986,7 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD Set to build LLVM's lld linker. .Pp @@ -996,7 +996,7 @@ amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarc Set to not build the LLDB debugger. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1009,7 +1009,7 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp @@ -1019,7 +1019,7 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp @@ -1031,7 +1031,7 @@ Set to not build the tool. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_COV Set to build the .Xr llvm-cov 1 @@ -1048,7 +1048,7 @@ arm/arm, arm/armv6, arm/armv7, powerpc/powerpc, powerp Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1056,7 +1056,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1070,7 +1070,7 @@ Set to only build the required LLVM target support. This option is preferred to specific target support options. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1109,7 +1109,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_ARM Set to build LLVM target support for ARM. The @@ -1130,7 +1130,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1146,7 +1146,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1162,7 +1162,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1178,7 +1178,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1194,17 +1194,17 @@ on all other platforms. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITH_LOADER_OFW Set to build openfirmware bootloader components. .Pp @@ -1214,7 +1214,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp @@ -1349,18 +1349,17 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. -.It Va WITHOUT_MODULE_DRM -Disable creation of old drm video modules. - -.It Va WITHOUT_MODULE_DRM2 -Disable creation of old drm2 video modules. +.It Va WITH_MODULE_DRM +Enable creation of old drm video modules. +.It Va WITH_MODULE_DRM2 +Enable creation of old drm2 video modules. .It Va WITH_NAND Set to build the NAND Flash components. .It Va WITHOUT_NDIS @@ -1517,7 +1516,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1549,6 +1548,9 @@ Successive builds will not be bit-for-bit identical. .It Va WITHOUT_RESCUE Set to not build .Xr rescue 8 . +.It Va WITH_RETPOLINE +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. .It Va WITHOUT_ROUTED Set to not build .Xr routed 8 @@ -1604,7 +1606,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From owner-svn-src-head@freebsd.org Sun Oct 21 00:35:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D3DFFBE48; Sun, 21 Oct 2018 00:35:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B44571CF8; Sun, 21 Oct 2018 00:35:54 +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 8630D25A19; Sun, 21 Oct 2018 00:35:54 +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 w9L0ZsFx034434; Sun, 21 Oct 2018 00:35:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0ZsVd034433; Sun, 21 Oct 2018 00:35:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810210035.w9L0ZsVd034433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 21 Oct 2018 00:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339513 - head/share/vt/fonts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/fonts X-SVN-Commit-Revision: 339513 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, 21 Oct 2018 00:35:55 -0000 Author: emaste Date: Sun Oct 21 00:35:54 2018 New Revision: 339513 URL: https://svnweb.freebsd.org/changeset/base/339513 Log: Add some tom-thumb vt font glyphs Primarily missing glyphs used by mandoc. Added: U+2010 hyphen U+2011 non-breaking hyphen U+2012 figure dash U+2013 en dash U+2014 em dash U+2018 left single quotation mark U+2019 right single quotation mark U+2020 dagger U+2021 double dagger U+203E overline U+2122 trade mark sign U+2502 box drawings light vertical U+25A1 white square U+25CA lozenge U+25CB circle U+2660 black spade suit U+2663 black club suit U+2665 black heart suit U+2666 black diamond suit U+FFFD replacement char Sponsored by: The FreeBSD Foundation Modified: head/share/vt/fonts/tom-thumb.hex Modified: head/share/vt/fonts/tom-thumb.hex ============================================================================== --- head/share/vt/fonts/tom-thumb.hex Sun Oct 21 00:32:59 2018 (r339512) +++ head/share/vt/fonts/tom-thumb.hex Sun Oct 21 00:35:54 2018 (r339513) @@ -1,5 +1,6 @@ # $FreeBSD$ # tom-thumb by Brian Swetland and Robey Pointer +# with the addition of some characters (primarily those emitted by mandoc) # # To the extent possible under law, the person who associated CC0 with # tom-thumb has waived all copyright and related or neighboring rights @@ -207,6 +208,27 @@ 0178:A000A0404000 017D:A0E060C0E000 017E:A0E060C0E000 +2010:0000E0000000 +2011:0000E0000000 +2012:0000E0000000 +2013:0000E0000000 +2014:0000E0000000 +2018:804000000000 +2019:204000000000 +2020:40E040404000 +2021:40E040E04000 2022:000040000000 2026:00000000A000 +203E:E00000000000 20AC:60E0E0C06000 +2122:E04000E0A000 +2502:404040404000 +25A1:00E0A0E00000 +25CA:0040A0A04000 +25CB:0040A0400000 +2660:0040E040E000 +2663:0040A040E000 +2665:00A0E0E04000 +2666:000040E04000 +2713:000020A04000 +FFFD:E0A0A0A0E000 From owner-svn-src-head@freebsd.org Sun Oct 21 00:43:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D886FFC245; Sun, 21 Oct 2018 00:43:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08867722B8; Sun, 21 Oct 2018 00:43:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F302A25C19; Sun, 21 Oct 2018 00:43:28 +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 w9L0hSbq039293; Sun, 21 Oct 2018 00:43:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0hRUL039286; Sun, 21 Oct 2018 00:43:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210043.w9L0hRUL039286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 00:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339514 - in head/sys/powerpc: booke include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: booke include powerpc X-SVN-Commit-Revision: 339514 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, 21 Oct 2018 00:43:29 -0000 Author: jhibbits Date: Sun Oct 21 00:43:27 2018 New Revision: 339514 URL: https://svnweb.freebsd.org/changeset/base/339514 Log: powerpcspe: Implement SPE exception handling The Signal Processing Engine (SPE) found in Freescale e500 cores (and others) offloads IEEE-754 compliance (NaN, Inf handling, overflow, underflow) to software, most likely as a means of simplifying the APU silicon. Some software, like AbiWord, needs full IEEE-754 compliance, including NaN handling. Implement the necessary bits to enable it. Differential Revision: https://reviews.freebsd.org/D17446 Modified: head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/spe.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/spr.h head/sys/powerpc/include/trap.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/swtch32.S Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/booke/booke_machdep.c Sun Oct 21 00:43:27 2018 (r339514) @@ -189,6 +189,10 @@ extern void *int_debug; extern void *int_debug_ed; extern void *int_vec; extern void *int_vecast; +#ifdef __SPE__ +extern void *int_spe_fpdata; +extern void *int_spe_fpround; +#endif #ifdef HWPMC_HOOKS extern void *int_performance_counter; #endif @@ -258,6 +262,10 @@ ivor_setup(void) case FSL_E500v1: case FSL_E500v2: SET_TRAP(SPR_IVOR32, int_vec); +#ifdef __SPE__ + SET_TRAP(SPR_IVOR33, int_spe_fpdata); + SET_TRAP(SPR_IVOR34, int_spe_fpround); +#endif break; } Modified: head/sys/powerpc/booke/spe.c ============================================================================== --- head/sys/powerpc/booke/spe.c Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/booke/spe.c Sun Oct 21 00:43:27 2018 (r339514) @@ -40,9 +40,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include +#include +#include +#include + +void spe_handle_fpdata(struct trapframe *); +void spe_handle_fpround(struct trapframe *); +static int spe_emu_instr(uint32_t, struct fpemu *, struct fpn **, uint32_t *); + static void save_vec_int(struct thread *td) { @@ -75,7 +85,7 @@ save_vec_int(struct thread *td) __asm ( "evxor 0,0,0\n" "evaddumiaaw 0,0\n" - "evstdd 0,0(%0)" :: "b"(&pcb->pcb_vec.vr[17][0])); + "evstdd 0,0(%0)" :: "b"(&pcb->pcb_vec.spare[0])); pcb->pcb_vec.vscr = mfspr(SPR_SPEFSCR); /* @@ -113,6 +123,7 @@ enable_vec(struct thread *td) if (!(pcb->pcb_flags & PCB_VEC)) { memset(&pcb->pcb_vec, 0, sizeof pcb->pcb_vec); pcb->pcb_flags |= PCB_VEC; + pcb->pcb_vec.vscr = mfspr(SPR_SPEFSCR); } /* @@ -121,12 +132,11 @@ enable_vec(struct thread *td) */ msr = mfmsr(); mtmsr(msr | PSL_VEC); - isync(); /* Restore SPEFSCR and ACC. Use %r0 as the scratch for ACC. */ mtspr(SPR_SPEFSCR, pcb->pcb_vec.vscr); __asm __volatile("evldd 0, 0(%0); evmra 0,0\n" - :: "b"(&pcb->pcb_vec.vr[17][0])); + :: "b"(&pcb->pcb_vec.spare[0])); /* * The lower half of each register will be restored on trap return. Use @@ -180,4 +190,445 @@ save_vec_nodrop(struct thread *td) } save_vec_int(td); +} + + +#define SPE_INST_MASK 0x31f +#define EADD 0x200 +#define ESUB 0x201 +#define EABS 0x204 +#define ENABS 0x205 +#define ENEG 0x206 +#define EMUL 0x208 +#define EDIV 0x209 +#define ECMPGT 0x20c +#define ECMPLT 0x20d +#define ECMPEQ 0x20e +#define ECFUI 0x210 +#define ECFSI 0x211 +#define ECTUI 0x214 +#define ECTSI 0x215 +#define ECTUF 0x216 +#define ECTSF 0x217 +#define ECTUIZ 0x218 +#define ECTSIZ 0x21a + +#define SPE 0x4 +#define SPFP 0x6 +#define DPFP 0x7 + +#define SPE_OPC 4 +#define OPC_SHIFT 26 + +#define EVFSADD 0x280 +#define EVFSSUB 0x281 +#define EVFSABS 0x284 +#define EVFSNABS 0x285 +#define EVFSNEG 0x286 +#define EVFSMUL 0x288 +#define EVFSDIV 0x289 +#define EVFSCMPGT 0x28c +#define EVFSCMPLT 0x28d +#define EVFSCMPEQ 0x28e +#define EVFSCFUI 0x290 +#define EVFSCFSI 0x291 +#define EVFSCTUI 0x294 +#define EVFSCTSI 0x295 +#define EVFSCTUF 0x296 +#define EVFSCTSF 0x297 +#define EVFSCTUIZ 0x298 +#define EVFSCTSIZ 0x29a + +#define EFSADD 0x2c0 +#define EFSSUB 0x2c1 +#define EFSABS 0x2c4 +#define EFSNABS 0x2c5 +#define EFSNEG 0x2c6 +#define EFSMUL 0x2c8 +#define EFSDIV 0x2c9 +#define EFSCMPGT 0x2cc +#define EFSCMPLT 0x2cd +#define EFSCMPEQ 0x2ce +#define EFSCFD 0x2cf +#define EFSCFUI 0x2d0 +#define EFSCFSI 0x2d1 +#define EFSCTUI 0x2d4 +#define EFSCTSI 0x2d5 +#define EFSCTUF 0x2d6 +#define EFSCTSF 0x2d7 +#define EFSCTUIZ 0x2d8 +#define EFSCTSIZ 0x2da + +#define EFDADD 0x2e0 +#define EFDSUB 0x2e1 +#define EFDABS 0x2e4 +#define EFDNABS 0x2e5 +#define EFDNEG 0x2e6 +#define EFDMUL 0x2e8 +#define EFDDIV 0x2e9 +#define EFDCMPGT 0x2ec +#define EFDCMPLT 0x2ed +#define EFDCMPEQ 0x2ee +#define EFDCFS 0x2ef +#define EFDCFUI 0x2f0 +#define EFDCFSI 0x2f1 +#define EFDCTUI 0x2f4 +#define EFDCTSI 0x2f5 +#define EFDCTUF 0x2f6 +#define EFDCTSF 0x2f7 +#define EFDCTUIZ 0x2f8 +#define EFDCTSIZ 0x2fa + +enum { + NONE, + SINGLE, + DOUBLE, + VECTOR, +}; + +static uint32_t fpscr_to_spefscr(uint32_t fpscr) +{ + uint32_t spefscr; + + spefscr = 0; + + if (fpscr & FPSCR_VX) + spefscr |= SPEFSCR_FINV; + if (fpscr & FPSCR_OX) + spefscr |= SPEFSCR_FOVF; + if (fpscr & FPSCR_UX) + spefscr |= SPEFSCR_FUNF; + if (fpscr & FPSCR_ZX) + spefscr |= SPEFSCR_FDBZ; + if (fpscr & FPSCR_XX) + spefscr |= SPEFSCR_FX; + + return (spefscr); +} + +/* Sign is 0 for unsigned, 1 for signed. */ +static int +spe_to_int(struct fpemu *fpemu, struct fpn *fpn, uint32_t *val, int sign) +{ + uint32_t res[2]; + + res[0] = fpu_ftox(fpemu, fpn, res); + if (res[0] != UINT_MAX && res[0] != 0) + fpemu->fe_cx |= FPSCR_OX; + else if (sign == 0 && res[0] != 0) + fpemu->fe_cx |= FPSCR_UX; + else + *val = res[1]; + + return (0); +} + +/* Masked instruction */ +/* + * For compare instructions, returns 1 if success, 0 if not. For all others, + * returns -1, or -2 if no result needs recorded. + */ +static int +spe_emu_instr(uint32_t instr, struct fpemu *fpemu, + struct fpn **result, uint32_t *iresult) +{ + switch (instr & SPE_INST_MASK) { + case EABS: + case ENABS: + case ENEG: + /* Taken care of elsewhere. */ + break; + case ECTUIZ: + fpemu->fe_cx &= ~FPSCR_RN; + fpemu->fe_cx |= FP_RZ; + case ECTUI: + spe_to_int(fpemu, &fpemu->fe_f2, iresult, 0); + return (-1); + case ECTSIZ: + fpemu->fe_cx &= ~FPSCR_RN; + fpemu->fe_cx |= FP_RZ; + case ECTSI: + spe_to_int(fpemu, &fpemu->fe_f2, iresult, 1); + return (-1); + case EADD: + *result = fpu_add(fpemu); + break; + case ESUB: + *result = fpu_sub(fpemu); + break; + case EMUL: + *result = fpu_mul(fpemu); + break; + case EDIV: + *result = fpu_div(fpemu); + break; + case ECMPGT: + fpu_compare(fpemu, 0); + if (fpemu->fe_cx & FPSCR_FG) + return (1); + return (0); + case ECMPLT: + fpu_compare(fpemu, 0); + if (fpemu->fe_cx & FPSCR_FL) + return (1); + return (0); + case ECMPEQ: + fpu_compare(fpemu, 0); + if (fpemu->fe_cx & FPSCR_FE) + return (1); + return (0); + default: + printf("Unknown instruction %x\n", instr); + } + + return (-1); +} + +static int +spe_explode(struct fpemu *fe, struct fpn *fp, uint32_t type, + uint32_t hi, uint32_t lo) +{ + uint32_t s; + + fp->fp_sign = hi >> 31; + fp->fp_sticky = 0; + switch (type) { + case SINGLE: + s = fpu_stof(fp, hi); + break; + + case DOUBLE: + s = fpu_dtof(fp, hi, lo); + break; + } + + if (s == FPC_QNAN && (fp->fp_mant[0] & FP_QUIETBIT) == 0) { + /* + * Input is a signalling NaN. All operations that return + * an input NaN operand put it through a ``NaN conversion'', + * which basically just means ``turn on the quiet bit''. + * We do this here so that all NaNs internally look quiet + * (we can tell signalling ones by their class). + */ + fp->fp_mant[0] |= FP_QUIETBIT; + fe->fe_cx = FPSCR_VXSNAN; /* assert invalid operand */ + s = FPC_SNAN; + } + fp->fp_class = s; + + return (0); +} + +void +spe_handle_fpdata(struct trapframe *frame) +{ + struct fpemu fpemu; + struct fpn *result; + uint32_t instr, instr_sec_op; + uint32_t cr_shift, ra, rb, rd, src; + uint32_t high, low, res; /* For vector operations. */ + uint32_t spefscr = 0; + uint32_t ftod_res[2]; + int width; /* Single, Double, Vector, Integer */ + int err; + + err = fueword32((void *)frame->srr0, &instr); + + if (err != 0) + return; + /* Fault. */; + + if ((instr >> OPC_SHIFT) != SPE_OPC) + return; + + /* + * 'cr' field is the upper 3 bits of rd. Magically, since a) rd is 5 + * bits, b) each 'cr' field is 4 bits, and c) Only the 'GT' bit is + * modified for most compare operations, the full value of rd can be + * used as a shift value. + */ + rd = (instr >> 21) & 0x1f; + ra = (instr >> 16) & 0x1f; + rb = (instr >> 11) & 0x1f; + src = (instr >> 5) & 0x7; + cr_shift = 28 - (rd & 0x1f); + + instr_sec_op = (instr & 0x7ff); + + memset(&fpemu, 0, sizeof(fpemu)); + + width = NONE; + switch (src) { + case SPE: + save_vec_nodrop(curthread); + switch (instr_sec_op) { + case EVFSABS: + curthread->td_pcb->pcb_vec.vr[rd][0] = + curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31); + frame->fixreg[rd] = frame->fixreg[ra] & ~(1U << 31); + break; + case EVFSNABS: + curthread->td_pcb->pcb_vec.vr[rd][0] = + curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31); + frame->fixreg[rd] = frame->fixreg[ra] | (1U << 31); + break; + case EVFSNEG: + curthread->td_pcb->pcb_vec.vr[rd][0] = + curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31); + frame->fixreg[rd] = frame->fixreg[ra] ^ (1U << 31); + break; + default: + /* High word */ + spe_explode(&fpemu, &fpemu.fe_f1, SINGLE, + curthread->td_pcb->pcb_vec.vr[ra][0], 0); + spe_explode(&fpemu, &fpemu.fe_f2, SINGLE, + curthread->td_pcb->pcb_vec.vr[rb][0], 0); + high = spe_emu_instr(instr_sec_op, &fpemu, &result, + &curthread->td_pcb->pcb_vec.vr[rd][0]); + + spefscr = fpscr_to_spefscr(fpemu.fe_cx) << 16; + /* Clear the fpemu to start over on the lower bits. */ + memset(&fpemu, 0, sizeof(fpemu)); + + /* Now low word */ + spe_explode(&fpemu, &fpemu.fe_f1, SINGLE, + frame->fixreg[ra], 0); + spe_explode(&fpemu, &fpemu.fe_f2, SINGLE, + frame->fixreg[rb], 0); + spefscr |= fpscr_to_spefscr(fpemu.fe_cx); + low = spe_emu_instr(instr_sec_op, &fpemu, &result, + &frame->fixreg[rd]); + if (instr_sec_op == EVFSCMPEQ || + instr_sec_op == EVFSCMPGT || + instr_sec_op == EVFSCMPLT) { + res = (high << 3) | (low << 2) | + ((high | low) << 1) | (high & low); + width = NONE; + } else + width = VECTOR; + break; + } + enable_vec(curthread); + goto end; + + case SPFP: + switch (instr_sec_op) { + case EFSABS: + frame->fixreg[rd] = frame->fixreg[ra] & ~(1U << 31); + break; + case EFSNABS: + frame->fixreg[rd] = frame->fixreg[ra] | (1U << 31); + break; + case EFSNEG: + frame->fixreg[rd] = frame->fixreg[ra] ^ (1U << 31); + break; + case EFSCFD: + spe_explode(&fpemu, &fpemu.fe_f3, DOUBLE, + curthread->td_pcb->pcb_vec.vr[rb][0], + frame->fixreg[rb]); + result = &fpemu.fe_f3; + width = SINGLE; + break; + default: + spe_explode(&fpemu, &fpemu.fe_f1, SINGLE, + frame->fixreg[ra], 0); + spe_explode(&fpemu, &fpemu.fe_f2, SINGLE, + frame->fixreg[rb], 0); + width = SINGLE; + } + break; + case DPFP: + save_vec_nodrop(curthread); + switch (instr_sec_op) { + case EFDABS: + curthread->td_pcb->pcb_vec.vr[rd][0] = + curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31); + break; + case EFDNABS: + curthread->td_pcb->pcb_vec.vr[rd][0] = + curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31); + break; + case EFDNEG: + curthread->td_pcb->pcb_vec.vr[rd][0] = + curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31); + break; + case EFDCFS: + spe_explode(&fpemu, &fpemu.fe_f3, SINGLE, + frame->fixreg[rb], 0); + result = &fpemu.fe_f3; + width = DOUBLE; + break; + default: + spe_explode(&fpemu, &fpemu.fe_f1, DOUBLE, + curthread->td_pcb->pcb_vec.vr[ra][0], + frame->fixreg[ra]); + spe_explode(&fpemu, &fpemu.fe_f2, DOUBLE, + curthread->td_pcb->pcb_vec.vr[rb][0], + frame->fixreg[rb]); + width = DOUBLE; + } + break; + } + switch (instr_sec_op) { + case EFDCFS: + case EFSCFD: + /* Already handled. */ + break; + default: + res = spe_emu_instr(instr_sec_op, &fpemu, &result, + &frame->fixreg[rd]); + if (res != -1) + res <<= 2; + break; + } + + switch (instr_sec_op & SPE_INST_MASK) { + case ECMPEQ: + case ECMPGT: + case ECMPLT: + frame->cr &= ~(0xf << cr_shift); + frame->cr |= (res << cr_shift); + break; + case ECTUI: + case ECTUIZ: + case ECTSI: + case ECTSIZ: + break; + default: + switch (width) { + case NONE: + case VECTOR: + break; + case SINGLE: + frame->fixreg[rd] = fpu_ftos(&fpemu, result); + break; + case DOUBLE: + curthread->td_pcb->pcb_vec.vr[rd][0] = + fpu_ftod(&fpemu, result, ftod_res); + frame->fixreg[rd] = ftod_res[1]; + enable_vec(curthread); + break; + default: + panic("Unknown storage width %d", width); + break; + } + } + +end: + spefscr |= (mfspr(SPR_SPEFSCR) & ~SPEFSCR_FINVS); + mtspr(SPR_SPEFSCR, spefscr); + frame->srr0 += 4; + + return; +} + +void +spe_handle_fpround(struct trapframe *frame) +{ + + /* + * Punt fpround exceptions for now. This leaves the truncated result in + * the register. We'll deal with overflow/underflow later. + */ + return; } Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/booke/trap_subr.S Sun Oct 21 00:43:27 2018 (r339514) @@ -638,6 +638,28 @@ INTERRUPT(int_vecast) b trap_common +#ifdef __SPE__ +/***************************************************************************** + * Floating point Assist interrupt + ****************************************************************************/ +INTERRUPT(int_spe_fpdata) + STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) + FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_SPFPD) + addi %r3, %r1, CALLSIZE + bl spe_handle_fpdata + FRAME_LEAVE(SPR_SRR0, SPR_SRR1) + rfi + +INTERRUPT(int_spe_fpround) + STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) + FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_SPFPR) + addi %r3, %r1, CALLSIZE + bl spe_handle_fpround + FRAME_LEAVE(SPR_SRR0, SPR_SRR1) + rfi +#endif + + #ifdef HWPMC_HOOKS /***************************************************************************** * PMC Interrupt Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/include/spr.h Sun Oct 21 00:43:27 2018 (r339514) @@ -245,6 +245,33 @@ #define SPR_PTCR 0x1d0 /* Partition Table Control Register */ #define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ +#define SPEFSCR_SOVH 0x80000000 +#define SPEFSCR_OVH 0x40000000 +#define SPEFSCR_FGH 0x20000000 +#define SPEFSCR_FXH 0x10000000 +#define SPEFSCR_FINVH 0x08000000 +#define SPEFSCR_FDBZH 0x04000000 +#define SPEFSCR_FUNFH 0x02000000 +#define SPEFSCR_FOVFH 0x01000000 +#define SPEFSCR_FINXS 0x00200000 +#define SPEFSCR_FINVS 0x00100000 +#define SPEFSCR_FDBZS 0x00080000 +#define SPEFSCR_FUNFS 0x00040000 +#define SPEFSCR_FOVFS 0x00020000 +#define SPEFSCR_SOV 0x00008000 +#define SPEFSCR_OV 0x00004000 +#define SPEFSCR_FG 0x00002000 +#define SPEFSCR_FX 0x00001000 +#define SPEFSCR_FINV 0x00000800 +#define SPEFSCR_FDBZ 0x00000400 +#define SPEFSCR_FUNF 0x00000200 +#define SPEFSCR_FOVF 0x00000100 +#define SPEFSCR_FINXE 0x00000040 +#define SPEFSCR_FINVE 0x00000020 +#define SPEFSCR_FDBZE 0x00000010 +#define SPEFSCR_FUNFE 0x00000008 +#define SPEFSCR_FOVFE 0x00000004 +#define SPEFSCR_FRMC_M 0x00000003 #define SPR_IBAT0U 0x210 /* .6. Instruction BAT Reg 0 Upper */ #define SPR_IBAT0L 0x211 /* .6. Instruction BAT Reg 0 Lower */ #define SPR_IBAT1U 0x212 /* .6. Instruction BAT Reg 1 Upper */ Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/include/trap.h Sun Oct 21 00:43:27 2018 (r339514) @@ -100,6 +100,8 @@ #define EXC_APU 0x1300 /* Auxiliary Processing Unit */ #define EXC_DEBUG 0x2f10 /* Debug trap */ #define EXC_VECAST_E 0x2f20 /* Altivec Assist (Book-E) */ +#define EXC_SPFPD 0x2f30 /* SPE Floating-point Data */ +#define EXC_SPFPR 0x2f40 /* SPE Floating-point Round */ #define EXC_LAST 0x2f00 /* Last possible exception vector */ Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/powerpc/exec_machdep.c Sun Oct 21 00:43:27 2018 (r339514) @@ -971,6 +971,10 @@ cpu_copy_thread(struct thread *td, struct thread *td0) pcb2->pcb_context[0] = pcb2->pcb_lr; #endif pcb2->pcb_cpu.aim.usr_vsid = 0; +#ifdef __SPE__ + pcb2->pcb_vec.vscr = SPEFSCR_FINVE | SPEFSCR_FDBZE | + SPEFSCR_FUNFE | SPEFSCR_FOVFE; +#endif /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; @@ -1016,6 +1020,10 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * } td->td_pcb->pcb_flags = 0; +#ifdef __SPE__ + td->td_pcb->pcb_vec.vscr = SPEFSCR_FINVE | SPEFSCR_FDBZE | + SPEFSCR_FUNFE | SPEFSCR_FOVFE; +#endif td->td_retval[0] = (register_t)entry; td->td_retval[1] = 0; Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Sun Oct 21 00:35:54 2018 (r339513) +++ head/sys/powerpc/powerpc/swtch32.S Sun Oct 21 00:43:27 2018 (r339514) @@ -212,4 +212,8 @@ ENTRY(fork_trampoline) trapframe to simulate FRAME_SETUP does when allocating space for a frame pointer/saved LR */ +#ifdef __SPE__ + li %r3,SPEFSCR_FINVE|SPEFSCR_FDBZE|SPEFSCR_FUNFE|SPEFSCR_FOVFE + mtspr SPR_SPEFSCR, %r3 +#endif b trapexit From owner-svn-src-head@freebsd.org Sun Oct 21 00:48:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9C6FFFC4F8; Sun, 21 Oct 2018 00:48:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56F69725D7; Sun, 21 Oct 2018 00:48:39 +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 46DF625C4D; Sun, 21 Oct 2018 00:48:39 +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 w9L0mdKK039568; Sun, 21 Oct 2018 00:48:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L0mc9h039566; Sun, 21 Oct 2018 00:48:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810210048.w9L0mc9h039566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 21 Oct 2018 00:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339515 - head/usr.sbin/pwd_mkdb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/pwd_mkdb X-SVN-Commit-Revision: 339515 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, 21 Oct 2018 00:48:39 -0000 Author: emaste Date: Sun Oct 21 00:48:38 2018 New Revision: 339515 URL: https://svnweb.freebsd.org/changeset/base/339515 Log: pwd_mkdb: retire -B and -L endianness options Legacy v3 db support was retired in r333133, and it was v3 support that required the -B and -L options. The options were retained temporarily, but now that stable/12 has branched they can be removed. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Sun Oct 21 00:43:27 2018 (r339514) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Sun Oct 21 00:48:38 2018 (r339515) @@ -28,7 +28,7 @@ .\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 30, 2018 +.Dd October 20, 2018 .Dt PWD_MKDB 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd "generate the password databases" .Sh SYNOPSIS .Nm -.Op Fl BCiLNp +.Op Fl CiNp .Op Fl d Ar directory .Op Fl s Ar cachesize .Op Fl u Ar username @@ -111,15 +111,6 @@ encrypted password and the insecure version has an ast .Pp The databases are used by the C library password routines (see .Xr getpwent 3 ) . -.Pp -The following options affected the generation of legacy entries, -and are now deprecated. -.Bl -tag -width flag -.It Fl B -Store data in big-endian format. -.It Fl L -Store data in little-endian format. -.El .Pp The .Nm Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Sun Oct 21 00:43:27 2018 (r339514) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Sun Oct 21 00:48:38 2018 (r339515) @@ -123,18 +123,10 @@ main(int argc, char *argv[]) makeold = 0; username = NULL; oldfp = NULL; - while ((ch = getopt(argc, argv, "BCLNd:ips:u:v")) != -1) + while ((ch = getopt(argc, argv, "CNd:ips:u:v")) != -1) switch(ch) { - case 'B': /* big-endian output */ - warnx("endiannes options (-B/-L) are deprecated"); - openinfo.lorder = BIG_ENDIAN; - break; case 'C': /* verify only */ Cflag = 1; - break; - case 'L': /* little-endian output */ - warnx("endiannes options (-B/-L) are deprecated"); - openinfo.lorder = LITTLE_ENDIAN; break; case 'N': /* do not wait for lock */ nblock = LOCK_NB; /* will fail if locked */ From owner-svn-src-head@freebsd.org Sun Oct 21 02:24:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 322711008E03; Sun, 21 Oct 2018 02:24:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0168762EF; Sun, 21 Oct 2018 02:24:37 +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 C5707270EB; Sun, 21 Oct 2018 02:24:37 +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 w9L2Ob2m090209; Sun, 21 Oct 2018 02:24:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L2ObjQ090208; Sun, 21 Oct 2018 02:24:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210224.w9L2ObjQ090208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 02:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339518 - 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: 339518 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, 21 Oct 2018 02:24:38 -0000 Author: jhibbits Date: Sun Oct 21 02:24:37 2018 New Revision: 339518 URL: https://svnweb.freebsd.org/changeset/base/339518 Log: powerpc64/powernv:opal_pci: Fix the alignment of the TCE table The TCE table need only be aligned to the size of the table, not the size of the TCE segment. Modified: head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Sun Oct 21 02:12:26 2018 (r339517) +++ head/sys/powerpc/powernv/opal_pci.c Sun Oct 21 02:24:37 2018 (r339518) @@ -367,7 +367,7 @@ opalpci_attach(device_t dev) device_printf(dev, "Mapping 0-%#jx for DMA\n", (uintmax_t)maxmem); sc->tce = contigmalloc(tce_tbl_size, M_DEVBUF, M_NOWAIT | M_ZERO, 0, - BUS_SPACE_MAXADDR, tce_size, 0); + BUS_SPACE_MAXADDR, tce_tbl_size, 0); if (sc->tce == NULL) panic("Failed to allocate TCE memory for PHB %jd\n", (uintmax_t)sc->phb_id); From owner-svn-src-head@freebsd.org Sun Oct 21 02:28:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 733E31008F25; Sun, 21 Oct 2018 02:28:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B4B87651E; Sun, 21 Oct 2018 02:28:05 +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 10F4F270F5; Sun, 21 Oct 2018 02:28:05 +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 w9L2S4uh090440; Sun, 21 Oct 2018 02:28:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L2S4fd090439; Sun, 21 Oct 2018 02:28:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210228.w9L2S4fd090439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 02:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339520 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 339520 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, 21 Oct 2018 02:28:05 -0000 Author: jhibbits Date: Sun Oct 21 02:28:04 2018 New Revision: 339520 URL: https://svnweb.freebsd.org/changeset/base/339520 Log: powerpc64/pmap: Correct the logic for minidump KVA chunk r279252 inverted the logic in moea64_scan_init, such that instead of terminating when reaching a dead page, it terminates when reaching a live page, ostensibly preserving exactly one page of KVA. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Oct 21 02:25:56 2018 (r339519) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Oct 21 02:28:04 2018 (r339520) @@ -2882,7 +2882,7 @@ moea64_scan_init(mmu_t mmu) if (va == kmi.buffer_sva) break; pvo = moea64_pvo_find_va(kernel_pmap, va & ~ADDR_POFF); - if (pvo != NULL && !(pvo->pvo_vaddr & PVO_DEAD)) + if (pvo == NULL || (pvo->pvo_vaddr & PVO_DEAD)) break; va += PAGE_SIZE; } From owner-svn-src-head@freebsd.org Sun Oct 21 02:08:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E11AFFFD91; Sun, 21 Oct 2018 02:08:41 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B05E7755EF; Sun, 21 Oct 2018 02:08:40 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id A64EDFB93; Sun, 21 Oct 2018 02:08:40 +0000 (UTC) From: Jan Beich To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys References: <201810190037.w9J0blks031617@repo.freebsd.org> Date: Sun, 21 Oct 2018 04:08:36 +0200 In-Reply-To: <201810190037.w9J0blks031617@repo.freebsd.org> (Glen Barber's message of "Fri, 19 Oct 2018 00:37:47 +0000 (UTC)") Message-ID: 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: Sun, 21 Oct 2018 02:08:41 -0000 Glen Barber writes: > Modified: head/lib/clang/llvm.build.mk > ============================================================================== > --- head/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 (r339435) > +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 (r339436) > @@ -17,7 +17,7 @@ CFLAGS+= -I${LLVM_SRCS}/include > CFLAGS+= -DLLVM_BUILD_GLOBAL_ISEL > CFLAGS+= -D__STDC_LIMIT_MACROS > CFLAGS+= -D__STDC_CONSTANT_MACROS > -#CFLAGS+= -DNDEBUG > +CFLAGS+= -DNDEBUG Would Clang still hit asserts instead of crashing with cryptic messages? From owner-svn-src-head@freebsd.org Sun Oct 21 02:12:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC56CFFFF5B; Sun, 21 Oct 2018 02:12:27 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62ABE75A03; Sun, 21 Oct 2018 02:12:27 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D9D126F33; Sun, 21 Oct 2018 02:12:27 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L2CR3K084948; Sun, 21 Oct 2018 02:12:27 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L2CR14084947; Sun, 21 Oct 2018 02:12:27 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201810210212.w9L2CR14084947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Sun, 21 Oct 2018 02:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339517 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 339517 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, 21 Oct 2018 02:12:27 -0000 Author: jchandra Date: Sun Oct 21 02:12:26 2018 New Revision: 339517 URL: https://svnweb.freebsd.org/changeset/base/339517 Log: arm generic_timer: fix armv8 timer desc In the FDT based probe, check for "arm,armv8-timer" before "arm,armv7-timer". This gets the description right when the timer node has both entries in compatible list. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun Oct 21 02:08:57 2018 (r339516) +++ head/sys/arm/arm/generic_timer.c Sun Oct 21 02:12:26 2018 (r339517) @@ -323,11 +323,11 @@ arm_tmr_fdt_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "arm,armv7-timer")) { - device_set_desc(dev, "ARMv7 Generic Timer"); - return (BUS_PROBE_DEFAULT); - } else if (ofw_bus_is_compatible(dev, "arm,armv8-timer")) { + if (ofw_bus_is_compatible(dev, "arm,armv8-timer")) { device_set_desc(dev, "ARMv8 Generic Timer"); + return (BUS_PROBE_DEFAULT); + } else if (ofw_bus_is_compatible(dev, "arm,armv7-timer")) { + device_set_desc(dev, "ARMv7 Generic Timer"); return (BUS_PROBE_DEFAULT); } From owner-svn-src-head@freebsd.org Sun Oct 21 02:08:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FC7FFFFDA7; Sun, 21 Oct 2018 02:08:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9294756CF; Sun, 21 Oct 2018 02:08:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E350A26DA7; Sun, 21 Oct 2018 02:08:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L28vmF080089; Sun, 21 Oct 2018 02:08:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L28vVc080088; Sun, 21 Oct 2018 02:08:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210208.w9L28vVc080088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 02:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cddl/dev/dtrace/powerpc X-SVN-Commit-Revision: 339516 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, 21 Oct 2018 02:08:58 -0000 Author: jhibbits Date: Sun Oct 21 02:08:57 2018 New Revision: 339516 URL: https://svnweb.freebsd.org/changeset/base/339516 Log: powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE There seems to be a race in CI, such that dtrace_asm.S might be assembled before the genassym is completed. This causes a build failure when PSL_EE doesn't exist, and is read as 0. Get around this by explicitly specifying the bits in the mask instead. Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Sun Oct 21 00:48:38 2018 (r339515) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Sun Oct 21 02:08:57 2018 (r339516) @@ -72,7 +72,7 @@ ASENTRY_NOPROF(dtrace_interrupt_disable) rldicl %r0,%r3,48,1 rotldi %r0,%r0,16 #else - rlwinm %r0,%r3,0,~PSL_EE /* Clear EE flag */ + rlwinm %r0,%r3,0,17,15 /* Clear EE flag */ #endif mtmsr %r0 blr From owner-svn-src-head@freebsd.org Sun Oct 21 02:30:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500981008FB1; Sun, 21 Oct 2018 02:30:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 014F5766E7; Sun, 21 Oct 2018 02:30:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE66327105; Sun, 21 Oct 2018 02:30:34 +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 w9L2UYMg090727; Sun, 21 Oct 2018 02:30:34 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L2UYuK090726; Sun, 21 Oct 2018 02:30:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210230.w9L2UYuK090726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 02:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339521 - 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: 339521 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, 21 Oct 2018 02:30:35 -0000 Author: jhibbits Date: Sun Oct 21 02:30:34 2018 New Revision: 339521 URL: https://svnweb.freebsd.org/changeset/base/339521 Log: powerpc64/powernv: Add pnpinfo strings to opal device children This makes it easier to see what's left unattached as new drivers are written, and to see what drivers get attached to what nodes. Modified: head/sys/powerpc/powernv/opal_dev.c Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Sun Oct 21 02:28:04 2018 (r339520) +++ head/sys/powerpc/powernv/opal_dev.c Sun Oct 21 02:30:34 2018 (r339521) @@ -70,6 +70,9 @@ static device_method_t opaldev_methods[] = { DEVMETHOD(clock_gettime, opal_gettime), DEVMETHOD(clock_settime, opal_settime), + /* Bus interface */ + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_devinfo, opaldev_get_devinfo), DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), From owner-svn-src-head@freebsd.org Sun Oct 21 02:25:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C5B31008E7E; Sun, 21 Oct 2018 02:25:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6C5F763E9; Sun, 21 Oct 2018 02:25:56 +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 C1B69270EF; Sun, 21 Oct 2018 02:25:56 +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 w9L2PuvN090309; Sun, 21 Oct 2018 02:25:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L2PuRm090308; Sun, 21 Oct 2018 02:25:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210225.w9L2PuRm090308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 02:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339519 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 339519 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, 21 Oct 2018 02:25:57 -0000 Author: jhibbits Date: Sun Oct 21 02:25:56 2018 New Revision: 339519 URL: https://svnweb.freebsd.org/changeset/base/339519 Log: powerpc64/xics: Fix comment typo Modified: head/sys/powerpc/pseries/xics.c Modified: head/sys/powerpc/pseries/xics.c ============================================================================== --- head/sys/powerpc/pseries/xics.c Sun Oct 21 02:24:37 2018 (r339518) +++ head/sys/powerpc/pseries/xics.c Sun Oct 21 02:25:56 2018 (r339519) @@ -143,7 +143,7 @@ static driver_t xics_driver = { /* We can only pass physical addresses into OPAL. Kernel stacks are in the KVA, * not in the direct map, so we need to somehow extract the physical address. * However, pmap_kextract() takes locks, which is forbidden in a critical region - * (which PMAP_DISPATCH() operates in). The kernel is mapped into the Direct + * (which PIC_DISPATCH() operates in). The kernel is mapped into the Direct * Map (0xc000....), and the CPU implicitly drops the top two bits when doing * real address by nature that the bus width is smaller than 64-bits. Placing * cpu_xirr into the DMAP lets us take advantage of this and avoids the From owner-svn-src-head@freebsd.org Sun Oct 21 02:39:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84561102C2F7; Sun, 21 Oct 2018 02:39:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B5A76B59; Sun, 21 Oct 2018 02:39:14 +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 2F180272AB; Sun, 21 Oct 2018 02:39:14 +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 w9L2dE81095873; Sun, 21 Oct 2018 02:39:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L2dEl4095872; Sun, 21 Oct 2018 02:39:14 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810210239.w9L2dEl4095872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Oct 2018 02:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339522 - 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: 339522 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, 21 Oct 2018 02:39:14 -0000 Author: jhibbits Date: Sun Oct 21 02:39:13 2018 New Revision: 339522 URL: https://svnweb.freebsd.org/changeset/base/339522 Log: powerpc/mpc85xx: Make Freescale PCI bridge driver a subclass of ofw_pcib_pci This driver was already 99% identical to the ofw_pcib_pci driver, except for the attachment. Since ofw_pcib_pci is already a subclass of pcib, this creates a private declaration of that class, to use for the base class for this driver. At some point in the future, ofw_pcib_pci_driver should probably be exported to a header, so we're not tracking the softc struct contents, but for now, since there's only this one other driver, it's not a pressing issue. Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sun Oct 21 02:30:34 2018 (r339521) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sun Oct 21 02:39:13 2018 (r339522) @@ -63,11 +63,16 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +DECLARE_CLASS(ofw_pcib_pci_driver); + struct fsl_pcib_softc { /* * This is here so that we can use pci bridge methods, too - the * generic routines only need the dev, secbus and subbus members * filled. + * + * XXX: This should be extracted from ofw_pcib_pci.c, and shared in a + * header. */ struct pcib_softc ops_pcib_sc; phandle_t ops_node; @@ -90,89 +95,12 @@ fsl_pcib_rc_probe(device_t dev) return (BUS_PROBE_DEFAULT); } -static int -fsl_pcib_rc_attach(device_t dev) -{ - struct fsl_pcib_softc *sc; - - sc = device_get_softc(dev); - sc->ops_pcib_sc.dev = dev; - sc->ops_node = ofw_bus_get_node(dev); - - ofw_bus_setup_iinfo(sc->ops_node, &sc->ops_iinfo, - sizeof(cell_t)); - - pcib_attach_common(dev); - return (pcib_attach_child(dev)); -} - -static phandle_t -fsl_pcib_rc_get_node(device_t bridge, device_t dev) -{ - /* We have only one child, the PCI bus, so pass it our node */ - - return (ofw_bus_get_node(bridge)); -} - -static int -fsl_pcib_rc_route_interrupt(device_t bridge, device_t dev, int intpin) -{ - struct fsl_pcib_softc *sc; - struct ofw_bus_iinfo *ii; - struct ofw_pci_register reg; - cell_t pintr, mintr[2]; - int intrcells; - phandle_t iparent; - - sc = device_get_softc(bridge); - ii = &sc->ops_iinfo; - if (ii->opi_imapsz > 0) { - pintr = intpin; - - /* Fabricate imap information if this isn't an OFW device */ - bzero(®, sizeof(reg)); - reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | - (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | - (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); - - intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, - sizeof(reg), &pintr, sizeof(pintr), mintr, sizeof(mintr), - &iparent); - if (intrcells) { - /* - * If we've found a mapping, return it and don't map - * it again on higher levels - that causes problems - * in some cases, and never seems to be required. - */ - mintr[0] = ofw_bus_map_intr(dev, iparent, intrcells, - mintr); - return (mintr[0]); - } - } else if (intpin >= 1 && intpin <= 4) { - /* - * When an interrupt map is missing, we need to do the - * standard PCI swizzle and continue mapping at the parent. - */ - return (pcib_route_interrupt(bridge, dev, intpin)); - } - return (PCIB_ROUTE_INTERRUPT(device_get_parent(device_get_parent( - bridge)), bridge, intpin)); -} - static device_method_t fsl_pcib_rc_methods[] = { DEVMETHOD(device_probe, fsl_pcib_rc_probe), - DEVMETHOD(device_attach, fsl_pcib_rc_attach), - - /* pcib interface */ - DEVMETHOD(pcib_route_interrupt, fsl_pcib_rc_route_interrupt), - DEVMETHOD(pcib_request_feature, pcib_request_feature_allow), - - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_node, fsl_pcib_rc_get_node), DEVMETHOD_END }; static devclass_t fsl_pcib_rc_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_rc_driver, fsl_pcib_rc_methods, - sizeof(struct fsl_pcib_softc), pcib_driver); + sizeof(struct fsl_pcib_softc), ofw_pcib_pci_driver); DRIVER_MODULE(rcpcib, pci, fsl_pcib_rc_driver, fsl_pcib_rc_devclass, 0, 0); From owner-svn-src-head@freebsd.org Sun Oct 21 04:52:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB7E6FCBB19; Sun, 21 Oct 2018 04:52:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 910D37B580; Sun, 21 Oct 2018 04:52:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC25AFF; Sun, 21 Oct 2018 04:52:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L4qcH2067557; Sun, 21 Oct 2018 04:52:38 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L4qbTc067553; Sun, 21 Oct 2018 04:52:37 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201810210452.w9L4qbTc067553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 21 Oct 2018 04:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339523 - in head/sys: conf dev/amdgpio modules modules/amdgpio X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys: conf dev/amdgpio modules modules/amdgpio X-SVN-Commit-Revision: 339523 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, 21 Oct 2018 04:52:39 -0000 Author: gonzo Date: Sun Oct 21 04:52:37 2018 New Revision: 339523 URL: https://svnweb.freebsd.org/changeset/base/339523 Log: Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms Submitted by: Rajesh Kumar Differential Revision: https://reviews.freebsd.org/D16865 Added: head/sys/dev/amdgpio/ head/sys/dev/amdgpio/amdgpio.c (contents, props changed) head/sys/dev/amdgpio/amdgpio.h (contents, props changed) head/sys/modules/amdgpio/ head/sys/modules/amdgpio/Makefile (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Oct 21 02:39:13 2018 (r339522) +++ head/sys/conf/files.amd64 Sun Oct 21 04:52:37 2018 (r339523) @@ -208,6 +208,7 @@ dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_via.c optional agp +dev/amdgpio/amdgpio.c optional amdgpio dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdsmn/amdsmn.c optional amdsmn | amdtemp dev/amdtemp/amdtemp.c optional amdtemp Added: head/sys/dev/amdgpio/amdgpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdgpio/amdgpio.c Sun Oct 21 04:52:37 2018 (r339523) @@ -0,0 +1,468 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Advanced Micro Devices + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "gpio_if.h" +#include "amdgpio.h" + +static struct resource_spec amdgpio_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static inline uint32_t +amdgpio_read_4(struct amdgpio_softc *sc, bus_size_t off) +{ + return (bus_read_4(sc->sc_res[0], off)); +} + +static inline void +amdgpio_write_4(struct amdgpio_softc *sc, bus_size_t off, + uint32_t val) +{ + bus_write_4(sc->sc_res[0], off, val); +} + +static bool +amdgpio_is_pin_output(struct amdgpio_softc *sc, uint32_t pin) +{ + uint32_t reg, val; + bool ret; + + /* Get the current pin state */ + AMDGPIO_LOCK(sc); + + reg = AMDGPIO_PIN_REGISTER(pin); + val = amdgpio_read_4(sc, reg); + + if (val & BIT(OUTPUT_ENABLE_OFF)) + ret = true; + else + ret = false; + + AMDGPIO_UNLOCK(sc); + + return (ret); +} + +static device_t +amdgpio_get_bus(device_t dev) +{ + struct amdgpio_softc *sc; + + sc = device_get_softc(dev); + + dprintf("busdev %p\n", sc->sc_busdev); + return (sc->sc_busdev); +} + +static int +amdgpio_pin_max(device_t dev, int *maxpin) +{ + struct amdgpio_softc *sc; + + sc = device_get_softc(dev); + + *maxpin = sc->sc_npins - 1; + dprintf("npins %d maxpin %d\n", sc->sc_npins, *maxpin); + + return (0); +} + +static bool +amdgpio_valid_pin(struct amdgpio_softc *sc, int pin) +{ + dprintf("pin %d\n", pin); + if (sc->sc_res[0] == NULL) + return (false); + + if ((sc->sc_gpio_pins[pin].gp_pin == pin) && + (sc->sc_gpio_pins[pin].gp_caps != 0)) + return (true); + + return (false); +} + +static int +amdgpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct amdgpio_softc *sc; + + dprintf("pin %d\n", pin); + sc = device_get_softc(dev); + + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + /* Set a very simple name */ + snprintf(name, GPIOMAXNAME, "%s", sc->sc_gpio_pins[pin].gp_name); + name[GPIOMAXNAME - 1] = '\0'; + + dprintf("pin %d name %s\n", pin, name); + + return (0); +} + +static int +amdgpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct amdgpio_softc *sc; + + sc = device_get_softc(dev); + + dprintf("pin %d\n", pin); + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + *caps = sc->sc_gpio_pins[pin].gp_caps; + + dprintf("pin %d caps 0x%x\n", pin, *caps); + + return (0); +} + +static int +amdgpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct amdgpio_softc *sc; + + sc = device_get_softc(dev); + + + dprintf("pin %d\n", pin); + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + AMDGPIO_LOCK(sc); + + *flags = sc->sc_gpio_pins[pin].gp_flags; + + dprintf("pin %d flags 0x%x\n", pin, *flags); + + AMDGPIO_UNLOCK(sc); + + return (0); +} + +static int +amdgpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct amdgpio_softc *sc; + uint32_t reg, val, allowed; + + sc = device_get_softc(dev); + + dprintf("pin %d flags 0x%x\n", pin, flags); + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + allowed = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + + /* + * Only directtion flag allowed + */ + if (flags & ~allowed) + return (EINVAL); + + /* + * Not both directions simultaneously + */ + if ((flags & allowed) == allowed) + return (EINVAL); + + /* Set the GPIO mode and state */ + AMDGPIO_LOCK(sc); + + reg = AMDGPIO_PIN_REGISTER(pin); + val = amdgpio_read_4(sc, reg); + + if (flags & GPIO_PIN_INPUT) { + val &= ~BIT(OUTPUT_ENABLE_OFF); + sc->sc_gpio_pins[pin].gp_flags = GPIO_PIN_INPUT; + } else { + val |= BIT(OUTPUT_ENABLE_OFF); + sc->sc_gpio_pins[pin].gp_flags = GPIO_PIN_OUTPUT; + } + + amdgpio_write_4(sc, reg, val); + + dprintf("pin %d flags 0x%x val 0x%x gp_flags 0x%x\n", + pin, flags, val, sc->sc_gpio_pins[pin].gp_flags); + + AMDGPIO_UNLOCK(sc); + + return (0); +} + +static int +amdgpio_pin_get(device_t dev, uint32_t pin, unsigned int *value) +{ + struct amdgpio_softc *sc; + uint32_t reg, val; + + sc = device_get_softc(dev); + + dprintf("pin %d\n", pin); + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + *value = 0; + + AMDGPIO_LOCK(sc); + + reg = AMDGPIO_PIN_REGISTER(pin); + val = amdgpio_read_4(sc, reg); + + if (val & BIT(OUTPUT_VALUE_OFF)) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + + dprintf("pin %d value 0x%x\n", pin, *value); + + AMDGPIO_UNLOCK(sc); + + return (0); +} + +static int +amdgpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct amdgpio_softc *sc; + uint32_t reg, val; + + sc = device_get_softc(dev); + + dprintf("pin %d value 0x%x\n", pin, value); + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + if (!amdgpio_is_pin_output(sc, pin)) + return (EINVAL); + + AMDGPIO_LOCK(sc); + + reg = AMDGPIO_PIN_REGISTER(pin); + val = amdgpio_read_4(sc, reg); + + if (value == GPIO_PIN_LOW) + val &= ~BIT(OUTPUT_VALUE_OFF); + else + val |= BIT(OUTPUT_VALUE_OFF); + + amdgpio_write_4(sc, reg, val); + + dprintf("pin %d value 0x%x val 0x%x\n", pin, value, val); + + AMDGPIO_UNLOCK(sc); + + return (0); +} + +static int +amdgpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct amdgpio_softc *sc; + uint32_t reg, val; + + sc = device_get_softc(dev); + + dprintf("pin %d\n", pin); + if (!amdgpio_valid_pin(sc, pin)) + return (EINVAL); + + if (!amdgpio_is_pin_output(sc, pin)) + return (EINVAL); + + /* Toggle the pin */ + AMDGPIO_LOCK(sc); + + reg = AMDGPIO_PIN_REGISTER(pin); + val = amdgpio_read_4(sc, reg); + dprintf("pin %d value before 0x%x\n", pin, val); + val = val ^ BIT(OUTPUT_VALUE_OFF); + dprintf("pin %d value after 0x%x\n", pin, val); + amdgpio_write_4(sc, reg, val); + + AMDGPIO_UNLOCK(sc); + + return (0); +} + +static int +amdgpio_probe(device_t dev) +{ + static char *gpio_ids[] = { "AMD0030", "AMDI0030", NULL }; + + if (acpi_disabled("gpio") || + ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids) == NULL) + return (ENXIO); + + device_set_desc(dev, "AMD GPIO Controller"); + return (0); +} + +static int +amdgpio_attach(device_t dev) +{ + struct amdgpio_softc *sc; + int i, pin, bank; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_handle = acpi_get_handle(dev); + + AMDGPIO_LOCK_INIT(sc); + + sc->sc_nbanks = AMD_GPIO_NUM_PIN_BANK; + sc->sc_npins = AMD_GPIO_PINS_MAX; + sc->sc_bank_prefix = AMD_GPIO_PREFIX; + sc->sc_pin_info = kernzp_pins; + sc->sc_ngroups = nitems(kernzp_groups); + sc->sc_groups = kernzp_groups; + + if (bus_alloc_resources(dev, amdgpio_spec, sc->sc_res)) { + device_printf(dev, "could not allocate resources\n"); + goto err_rsrc; + } + + sc->sc_bst = rman_get_bustag(sc->sc_res[0]); + sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); + + /* Initialize all possible pins to be Invalid */ + for (i = 0; i < AMD_GPIO_PINS_MAX ; i++) { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "Unexposed PIN %d\n", i); + sc->sc_gpio_pins[i].gp_pin = -1; + sc->sc_gpio_pins[i].gp_caps = 0; + sc->sc_gpio_pins[i].gp_flags = 0; + } + + /* Initialize only driver exposed pins with appropriate capabilities */ + for (i = 0; i < AMD_GPIO_PINS_EXPOSED ; i++) { + pin = kernzp_pins[i].pin_num; + bank = pin/AMD_GPIO_PINS_PER_BANK; + snprintf(sc->sc_gpio_pins[pin].gp_name, GPIOMAXNAME, "%s%d_%s\n", + AMD_GPIO_PREFIX, bank, kernzp_pins[i].pin_name); + sc->sc_gpio_pins[pin].gp_pin = pin; + sc->sc_gpio_pins[pin].gp_caps = AMDGPIO_DEFAULT_CAPS; + sc->sc_gpio_pins[pin].gp_flags = (amdgpio_is_pin_output(sc, pin)? + GPIO_PIN_OUTPUT : GPIO_PIN_INPUT); + } + + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) { + device_printf(dev, "could not attach gpiobus\n"); + goto err_bus; + } + + return (0); + +err_bus: + bus_release_resources(dev, amdgpio_spec, sc->sc_res); + +err_rsrc: + AMDGPIO_LOCK_DESTROY(sc); + + return (ENXIO); +} + + +static int +amdgpio_detach(device_t dev) +{ + struct amdgpio_softc *sc; + sc = device_get_softc(dev); + + if (sc->sc_busdev) + gpiobus_detach_bus(dev); + + bus_release_resources(dev, amdgpio_spec, sc->sc_res); + + AMDGPIO_LOCK_DESTROY(sc); + + return (0); +} + +static device_method_t amdgpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, amdgpio_probe), + DEVMETHOD(device_attach, amdgpio_attach), + DEVMETHOD(device_detach, amdgpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, amdgpio_get_bus), + DEVMETHOD(gpio_pin_max, amdgpio_pin_max), + DEVMETHOD(gpio_pin_getname, amdgpio_pin_getname), + DEVMETHOD(gpio_pin_getcaps, amdgpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, amdgpio_pin_getflags), + DEVMETHOD(gpio_pin_setflags, amdgpio_pin_setflags), + DEVMETHOD(gpio_pin_get, amdgpio_pin_get), + DEVMETHOD(gpio_pin_set, amdgpio_pin_set), + DEVMETHOD(gpio_pin_toggle, amdgpio_pin_toggle), + + DEVMETHOD_END +}; + +static driver_t amdgpio_driver = { + "gpio", + amdgpio_methods, + sizeof(struct amdgpio_softc), +}; + +static devclass_t amdgpio_devclass; +DRIVER_MODULE(amdgpio, acpi, amdgpio_driver, amdgpio_devclass, 0, 0); +MODULE_DEPEND(amdgpio, acpi, 1, 1, 1); +MODULE_DEPEND(amdgpio, gpiobus, 1, 1, 1); +MODULE_VERSION(amdgpio, 1); Added: head/sys/dev/amdgpio/amdgpio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdgpio/amdgpio.h Sun Oct 21 04:52:37 2018 (r339523) @@ -0,0 +1,332 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Advanced Micro Devices + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifdef DEBUG +#define dprintf(fmt, args...) do { \ + printf("%s(): ", __func__); \ + printf(fmt,##args); \ +} while (0) +#else +#define dprintf(fmt, args...) +#endif + +#define AMD_GPIO_PREFIX "AMDGPIO" + +#define AMD_GPIO_NUM_PIN_BANK 4 +#define AMD_GPIO_PINS_PER_BANK 64 +#define AMD_GPIO_PINS_MAX 256 /* 4 banks * 64 pins */ + +/* Number of pins in each bank */ +#define AMD_GPIO_PINS_BANK0 63 +#define AMD_GPIO_PINS_BANK1 64 +#define AMD_GPIO_PINS_BANK2 56 +#define AMD_GPIO_PINS_BANK3 32 +#define AMD_GPIO_PIN_PRESENT (AMD_GPIO_PINS_BANK0 + \ + AMD_GPIO_PINS_BANK1 + \ + AMD_GPIO_PINS_BANK2 + \ + AMD_GPIO_PINS_BANK3) +#define AMDGPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +/* Register related macros */ +#define AMDGPIO_PIN_REGISTER(pin) (pin * 4) + +#define WAKE_INT_MASTER_REG 0xfc +#define EOI_MASK (1 << 29) +#define WAKE_INT_STATUS_REG0 0x2f8 +#define WAKE_INT_STATUS_REG1 0x2fc + +/* Bit definition of 32 bits of each pin register */ +#define DB_TMR_OUT_OFF 0 +#define DB_TMR_OUT_UNIT_OFF 4 +#define DB_CNTRL_OFF 5 +#define DB_TMR_LARGE_OFF 7 +#define LEVEL_TRIG_OFF 8 +#define ACTIVE_LEVEL_OFF 9 +#define INTERRUPT_ENABLE_OFF 11 +#define INTERRUPT_MASK_OFF 12 +#define WAKE_CNTRL_OFF_S0I3 13 +#define WAKE_CNTRL_OFF_S3 14 +#define WAKE_CNTRL_OFF_S4 15 +#define PIN_STS_OFF 16 +#define DRV_STRENGTH_SEL_OFF 17 +#define PULL_UP_SEL_OFF 19 +#define PULL_UP_ENABLE_OFF 20 +#define PULL_DOWN_ENABLE_OFF 21 +#define OUTPUT_VALUE_OFF 22 +#define OUTPUT_ENABLE_OFF 23 +#define SW_CNTRL_IN_OFF 24 +#define SW_CNTRL_EN_OFF 25 +#define INTERRUPT_STS_OFF 28 +#define WAKE_STS_OFF 29 + +#define DB_TMR_OUT_MASK 0xFUL +#define DB_CNTRL_MASK 0x3UL +#define ACTIVE_LEVEL_MASK 0x3UL +#define DRV_STRENGTH_SEL_MASK 0x3UL + +#define DB_TYPE_NO_DEBOUNCE 0x0UL +#define DB_TYPE_PRESERVE_LOW_GLITCH 0x1UL +#define DB_TYPE_PRESERVE_HIGH_GLITCH 0x2UL +#define DB_TYPE_REMOVE_GLITCH 0x3UL + +#define EDGE_TRIGGER 0x0UL +#define LEVEL_TRIGGER 0x1UL + +#define ACTIVE_HIGH 0x0UL +#define ACTIVE_LOW 0x1UL +#define BOTH_EDGE 0x2UL + +#define ENABLE_INTERRUPT 0x1UL +#define DISABLE_INTERRUPT 0x0UL + +#define ENABLE_INTERRUPT_MASK 0x0UL +#define DISABLE_INTERRUPT_MASK 0x1UL +#define CLR_INTR_STAT 0x1UL + +#define BIT(bit) (1 << bit) +#define GPIO_PIN_INFO(p, n) { .pin_num = (p), .pin_name = (n) } + +struct pin_info { + int pin_num; + char *pin_name; +}; + +/* Pins exposed to drivers */ +static const struct pin_info kernzp_pins[] = { + GPIO_PIN_INFO(0, "PIN_0"), + GPIO_PIN_INFO(1, "PIN_1"), + GPIO_PIN_INFO(2, "PIN_2"), + GPIO_PIN_INFO(3, "PIN_3"), + GPIO_PIN_INFO(4, "PIN_4"), + GPIO_PIN_INFO(5, "PIN_5"), + GPIO_PIN_INFO(6, "PIN_6"), + GPIO_PIN_INFO(7, "PIN_7"), + GPIO_PIN_INFO(8, "PIN_8"), + GPIO_PIN_INFO(9, "PIN_9"), + GPIO_PIN_INFO(10, "PIN_10"), + GPIO_PIN_INFO(11, "PIN_11"), + GPIO_PIN_INFO(12, "PIN_12"), + GPIO_PIN_INFO(13, "PIN_13"), + GPIO_PIN_INFO(14, "PIN_14"), + GPIO_PIN_INFO(15, "PIN_15"), + GPIO_PIN_INFO(16, "PIN_16"), + GPIO_PIN_INFO(17, "PIN_17"), + GPIO_PIN_INFO(18, "PIN_18"), + GPIO_PIN_INFO(19, "PIN_19"), + GPIO_PIN_INFO(20, "PIN_20"), + GPIO_PIN_INFO(23, "PIN_23"), + GPIO_PIN_INFO(24, "PIN_24"), + GPIO_PIN_INFO(25, "PIN_25"), + GPIO_PIN_INFO(26, "PIN_26"), + GPIO_PIN_INFO(39, "PIN_39"), + GPIO_PIN_INFO(40, "PIN_40"), + GPIO_PIN_INFO(43, "PIN_43"), + GPIO_PIN_INFO(46, "PIN_46"), + GPIO_PIN_INFO(47, "PIN_47"), + GPIO_PIN_INFO(48, "PIN_48"), + GPIO_PIN_INFO(49, "PIN_49"), + GPIO_PIN_INFO(50, "PIN_50"), + GPIO_PIN_INFO(51, "PIN_51"), + GPIO_PIN_INFO(52, "PIN_52"), + GPIO_PIN_INFO(53, "PIN_53"), + GPIO_PIN_INFO(54, "PIN_54"), + GPIO_PIN_INFO(55, "PIN_55"), + GPIO_PIN_INFO(56, "PIN_56"), + GPIO_PIN_INFO(57, "PIN_57"), + GPIO_PIN_INFO(58, "PIN_58"), + GPIO_PIN_INFO(59, "PIN_59"), + GPIO_PIN_INFO(60, "PIN_60"), + GPIO_PIN_INFO(61, "PIN_61"), + GPIO_PIN_INFO(62, "PIN_62"), + GPIO_PIN_INFO(64, "PIN_64"), + GPIO_PIN_INFO(65, "PIN_65"), + GPIO_PIN_INFO(66, "PIN_66"), + GPIO_PIN_INFO(68, "PIN_68"), + GPIO_PIN_INFO(69, "PIN_69"), + GPIO_PIN_INFO(70, "PIN_70"), + GPIO_PIN_INFO(71, "PIN_71"), + GPIO_PIN_INFO(72, "PIN_72"), + GPIO_PIN_INFO(74, "PIN_74"), + GPIO_PIN_INFO(75, "PIN_75"), + GPIO_PIN_INFO(76, "PIN_76"), + GPIO_PIN_INFO(84, "PIN_84"), + GPIO_PIN_INFO(85, "PIN_85"), + GPIO_PIN_INFO(86, "PIN_86"), + GPIO_PIN_INFO(87, "PIN_87"), + GPIO_PIN_INFO(88, "PIN_88"), + GPIO_PIN_INFO(89, "PIN_89"), + GPIO_PIN_INFO(90, "PIN_90"), + GPIO_PIN_INFO(91, "PIN_91"), + GPIO_PIN_INFO(92, "PIN_92"), + GPIO_PIN_INFO(93, "PIN_93"), + GPIO_PIN_INFO(95, "PIN_95"), + GPIO_PIN_INFO(96, "PIN_96"), + GPIO_PIN_INFO(97, "PIN_97"), + GPIO_PIN_INFO(98, "PIN_98"), + GPIO_PIN_INFO(99, "PIN_99"), + GPIO_PIN_INFO(100, "PIN_100"), + GPIO_PIN_INFO(101, "PIN_101"), + GPIO_PIN_INFO(102, "PIN_102"), + GPIO_PIN_INFO(113, "PIN_113"), + GPIO_PIN_INFO(114, "PIN_114"), + GPIO_PIN_INFO(115, "PIN_115"), + GPIO_PIN_INFO(116, "PIN_116"), + GPIO_PIN_INFO(117, "PIN_117"), + GPIO_PIN_INFO(118, "PIN_118"), + GPIO_PIN_INFO(119, "PIN_119"), + GPIO_PIN_INFO(120, "PIN_120"), + GPIO_PIN_INFO(121, "PIN_121"), + GPIO_PIN_INFO(122, "PIN_122"), + GPIO_PIN_INFO(126, "PIN_126"), + GPIO_PIN_INFO(129, "PIN_129"), + GPIO_PIN_INFO(130, "PIN_130"), + GPIO_PIN_INFO(131, "PIN_131"), + GPIO_PIN_INFO(132, "PIN_132"), + GPIO_PIN_INFO(133, "PIN_133"), + GPIO_PIN_INFO(135, "PIN_135"), + GPIO_PIN_INFO(136, "PIN_136"), + GPIO_PIN_INFO(137, "PIN_137"), + GPIO_PIN_INFO(138, "PIN_138"), + GPIO_PIN_INFO(139, "PIN_139"), + GPIO_PIN_INFO(140, "PIN_140"), + GPIO_PIN_INFO(141, "PIN_141"), + GPIO_PIN_INFO(142, "PIN_142"), + GPIO_PIN_INFO(143, "PIN_143"), + GPIO_PIN_INFO(144, "PIN_144"), + GPIO_PIN_INFO(145, "PIN_145"), + GPIO_PIN_INFO(146, "PIN_146"), + GPIO_PIN_INFO(147, "PIN_147"), + GPIO_PIN_INFO(148, "PIN_148"), + GPIO_PIN_INFO(166, "PIN_166"), + GPIO_PIN_INFO(167, "PIN_167"), + GPIO_PIN_INFO(168, "PIN_168"), + GPIO_PIN_INFO(169, "PIN_169"), + GPIO_PIN_INFO(170, "PIN_170"), + GPIO_PIN_INFO(171, "PIN_171"), + GPIO_PIN_INFO(172, "PIN_172"), + GPIO_PIN_INFO(173, "PIN_173"), + GPIO_PIN_INFO(174, "PIN_174"), + GPIO_PIN_INFO(175, "PIN_175"), + GPIO_PIN_INFO(176, "PIN_176"), + GPIO_PIN_INFO(177, "PIN_177"), +}; + +#define AMD_GPIO_PINS_EXPOSED nitems(kernzp_pins) + +static const unsigned i2c0_pins[] = {145, 146}; +static const unsigned i2c1_pins[] = {147, 148}; +static const unsigned i2c2_pins[] = {113, 114}; +static const unsigned i2c3_pins[] = {19, 20}; +static const unsigned i2c4_pins[] = {149, 150}; +static const unsigned i2c5_pins[] = {151, 152}; + +static const unsigned uart0_pins[] = {135, 136, 137, 138, 139}; +static const unsigned uart1_pins[] = {140, 141, 142, 143, 144}; + +struct amd_pingroup { + const char *name; + const unsigned *pins; + unsigned npins; +}; + +static const struct amd_pingroup kernzp_groups[] = { + { + .name = "i2c0", + .pins = i2c0_pins, + .npins = 2, + }, + { + .name = "i2c1", + .pins = i2c1_pins, + .npins = 2, + }, + { + .name = "i2c2", + .pins = i2c2_pins, + .npins = 2, + }, + { + .name = "i2c3", + .pins = i2c3_pins, + .npins = 2, + }, + { + .name = "i2c4", + .pins = i2c4_pins, + .npins = 2, + }, + { + .name = "i2c5", + .pins = i2c5_pins, + .npins = 2, + }, + { + .name = "uart0", + .pins = uart0_pins, + .npins = 5, + }, + { + .name = "uart1", + .pins = uart1_pins, + .npins = 5, + }, +}; + +/* Macros for driver mutex locking */ +#define AMDGPIO_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ + "amdgpio", MTX_SPIN) +#define AMDGPIO_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) +#define AMDGPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) +#define AMDGPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) +#define AMDGPIO_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +#define AMDGPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) + +struct amdgpio_softc { + ACPI_HANDLE sc_handle; + device_t sc_dev; + device_t sc_busdev; + const char* sc_bank_prefix; + int sc_nbanks; + int sc_npins; + int sc_ngroups; + struct mtx sc_mtx; + struct resource *sc_res[AMD_GPIO_NUM_PIN_BANK + 1]; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + struct gpio_pin sc_gpio_pins[AMD_GPIO_PINS_MAX]; + const struct pin_info *sc_pin_info; + const struct amd_pingroup *sc_groups; +}; + +struct amdgpio_sysctl { + struct amdgpio_softc *sc; + uint32_t pin; +}; Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Oct 21 02:39:13 2018 (r339522) +++ head/sys/modules/Makefile Sun Oct 21 04:52:37 2018 (r339523) @@ -34,6 +34,7 @@ SUBDIR= \ ale \ alq \ ${_amd_ecc_inject} \ + ${_amdgpio} \ ${_amdsbwd} \ ${_amdsmn} \ ${_amdtemp} \ @@ -717,6 +718,7 @@ _x86bios= x86bios .endif .if ${MACHINE_CPUARCH} == "amd64" +_amdgpio= amdgpio _ccp= ccp _efirt= efirt _iavf= iavf Added: head/sys/modules/amdgpio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/amdgpio/Makefile Sun Oct 21 04:52:37 2018 (r339523) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/amdgpio +KMOD= amdgpio +SRCS= amdgpio.c +SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h pic_if.h opt_acpi.h opt_platform.h + +.include From owner-svn-src-head@freebsd.org Sun Oct 21 07:30:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED96FD8C00; Sun, 21 Oct 2018 07:30:27 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD097FA19; Sun, 21 Oct 2018 07:30:27 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 591FA2337; Sun, 21 Oct 2018 07:30:27 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L7UR1w045086; Sun, 21 Oct 2018 07:30:27 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L7URP6045085; Sun, 21 Oct 2018 07:30:27 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201810210730.w9L7URP6045085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 21 Oct 2018 07:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339526 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 339526 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, 21 Oct 2018 07:30:28 -0000 Author: phk Date: Sun Oct 21 07:30:26 2018 New Revision: 339526 URL: https://svnweb.freebsd.org/changeset/base/339526 Log: Update example to something people less than 40 years old have heard about. Modified: head/lib/libc/sys/recv.2 Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Sun Oct 21 06:52:10 2018 (r339525) +++ head/lib/libc/sys/recv.2 Sun Oct 21 07:30:26 2018 (r339526) @@ -260,13 +260,8 @@ struct cmsghdr { }; .Ed .Pp -As an example, one could use this to learn of changes in the data-stream -in XNS/SPP, or in ISO, to obtain user-connection-request data by requesting -a -.Fn recvmsg -with no data buffer provided immediately after an -.Fn accept -system call. +As an example, the SO_TIMESTAMP socket option returns a reception +timestamp for UDP packets. .Pp With .Dv AF_UNIX From owner-svn-src-head@freebsd.org Sun Oct 21 06:33:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B48FFD77D2; Sun, 21 Oct 2018 06:33:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EF647E1C0; Sun, 21 Oct 2018 06:33:37 +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 0430A1B2F; Sun, 21 Oct 2018 06:33:37 +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 w9L6Xa8c019199; Sun, 21 Oct 2018 06:33:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L6XZlj019194; Sun, 21 Oct 2018 06:33:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810210633.w9L6XZlj019194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 21 Oct 2018 06:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339524 - in head: share/man/man5 tools/build/options X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man5 tools/build/options X-SVN-Commit-Revision: 339524 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, 21 Oct 2018 06:33:37 -0000 Author: imp Date: Sun Oct 21 06:33:35 2018 New Revision: 339524 URL: https://svnweb.freebsd.org/changeset/base/339524 Log: Add missing options. WITHOUT_LOADER_LUA is only needed since we turned it off by default on powerpc and sparc64 in r338203. Same with WITHOUT_LOADER_GEIL. WITH_NVME, WITHOUT_NVME, WITH_LOADER_FORCE_LE have been needed since they were added. Added: head/tools/build/options/WITHOUT_LOADER_LUA (contents, props changed) head/tools/build/options/WITHOUT_NVME (contents, props changed) head/tools/build/options/WITH_LOADER_FORCE_LE (contents, props changed) head/tools/build/options/WITH_LOADER_GELI (contents, props changed) head/tools/build/options/WITH_NVME (contents, props changed) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Oct 21 04:52:37 2018 (r339523) +++ head/share/man/man5/src.conf.5 Sun Oct 21 06:33:35 2018 (r339524) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 20, 2018 +.Dd October 21, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1190,11 +1190,24 @@ amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarc .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader on x86. This option is a nop on all other platforms. +.It Va WITH_LOADER_FORCE_LE +Set to force the powerpc boot loader to launch the kernel in little +endian mode. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITH_LOADER_GELI +Set to build GELI bootloader support. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. +.It Va WITHOUT_LOADER_LUA +Set to not build LUA bindings for the boot loader. +.Pp +This is a default setting on +powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. .Pp @@ -1422,6 +1435,17 @@ will not be built either if this option is set. Set to not build .Xr ntpd 8 and related programs. +.It Va WITHOUT_NVME +Set to not build nvme related tools and kernel modules. +.Pp +This is a default setting on +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +.It Va WITH_NVME +Set to build nvme related tools and kernel modules. + +.Pp +This is a default setting on +amd64/amd64, i386/i386 and powerpc/powerpc64. .It Va WITH_OFED Set to build the .Dq "OpenFabrics Enterprise Distribution" Added: head/tools/build/options/WITHOUT_LOADER_LUA ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_LUA Sun Oct 21 06:33:35 2018 (r339524) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LUA bindings for the boot loader. Added: head/tools/build/options/WITHOUT_NVME ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_NVME Sun Oct 21 06:33:35 2018 (r339524) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build nvme related tools and kernel modules. Added: head/tools/build/options/WITH_LOADER_FORCE_LE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_FORCE_LE Sun Oct 21 06:33:35 2018 (r339524) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to force the powerpc boot loader to launch the kernel in little +endian mode. Added: head/tools/build/options/WITH_LOADER_GELI ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_GELI Sun Oct 21 06:33:35 2018 (r339524) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build GELI bootloader support. Added: head/tools/build/options/WITH_NVME ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_NVME Sun Oct 21 06:33:35 2018 (r339524) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build nvme related tools and kernel modules. + From owner-svn-src-head@freebsd.org Sun Oct 21 08:29:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED862FE4733; Sun, 21 Oct 2018 08:29:37 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E87482001; Sun, 21 Oct 2018 08:29:37 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 975802CF0; Sun, 21 Oct 2018 08:29:37 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L8TbgE077784; Sun, 21 Oct 2018 08:29:37 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L8Tapm077781; Sun, 21 Oct 2018 08:29:36 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201810210829.w9L8Tapm077781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 21 Oct 2018 08:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339529 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 339529 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, 21 Oct 2018 08:29:38 -0000 Author: phk Date: Sun Oct 21 08:29:36 2018 New Revision: 339529 URL: https://svnweb.freebsd.org/changeset/base/339529 Log: Implement ECMA-48 "REP", some Linuxen have started emitting them recently. Approved by: ed Modified: head/sys/teken/gensequences head/sys/teken/sequences head/sys/teken/teken.h head/sys/teken/teken_subr.h Modified: head/sys/teken/gensequences ============================================================================== --- head/sys/teken/gensequences Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/gensequences Sun Oct 21 08:29:36 2018 (r339529) @@ -158,6 +158,7 @@ for (p in l_prefix_name) { if (l_prefix_name[p] != "teken_state_init") { print ""; + print "\tt->t_last = 0;"; print "\tteken_state_switch(t, teken_state_init);"; } print "}"; Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/sequences Sun Oct 21 08:29:36 2018 (r339529) @@ -114,3 +114,6 @@ C25VTSW Cons25 switch virtual terminal ^[ [ z r # VT52 compatibility #DECID VT52 DECID ^[ Z + +# ECMA-48 +REP Repeat last graphic char ^[ [ b n Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/teken.h Sun Oct 21 08:29:36 2018 (r339529) @@ -157,6 +157,7 @@ struct __teken { unsigned int t_utf8_left; teken_char_t t_utf8_partial; + teken_char_t t_last; unsigned int t_curscs; teken_scs_t *t_saved_curscs; Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Oct 21 07:56:58 2018 (r339528) +++ head/sys/teken/teken_subr.h Sun Oct 21 08:29:36 2018 (r339529) @@ -796,10 +796,11 @@ teken_subr_primary_device_attributes(const teken_t *t, } static void -teken_subr_do_putchar(const teken_t *t, const teken_pos_t *tp, teken_char_t c, +teken_subr_do_putchar(teken_t *t, const teken_pos_t *tp, teken_char_t c, int width) { + t->t_last = c; if (t->t_stateflags & TS_INSERT && tp->tp_col < t->t_winsize.tp_col - width) { teken_rect_t ctr; @@ -1332,3 +1333,12 @@ teken_subr_vertical_position_absolute(teken_t *t, unsi t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); } + +static void +teken_subr_repeat_last_graphic_char(teken_t *t, unsigned int rpts) +{ + + for (; t->t_last != 0 && rpts > 0; rpts--) + teken_subr_regular_character(t, t->t_last); +} + From owner-svn-src-head@freebsd.org Sun Oct 21 06:52:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5297CFD7FF2; Sun, 21 Oct 2018 06:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0942B7EA31; Sun, 21 Oct 2018 06:52:11 +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 043A51D52; Sun, 21 Oct 2018 06:52:11 +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 w9L6qAh4029243; Sun, 21 Oct 2018 06:52:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L6qAUb029242; Sun, 21 Oct 2018 06:52:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810210652.w9L6qAUb029242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 21 Oct 2018 06:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339525 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 339525 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, 21 Oct 2018 06:52:11 -0000 Author: imp Date: Sun Oct 21 06:52:10 2018 New Revision: 339525 URL: https://svnweb.freebsd.org/changeset/base/339525 Log: Use BROKEN_OPTIONS for NVME, HYPERV, CXGBETOOL and MLX5TOOL instead of __DEFAULT_YES/NO. These options simply cannot work where we were using __DEFAULT_NO. The proper thing to do in that case is to use the BROKEN_OPTIONS knob instead. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Oct 21 06:33:35 2018 (r339524) +++ head/share/mk/src.opts.mk Sun Oct 21 06:52:10 2018 (r339525) @@ -85,6 +85,7 @@ __DEFAULT_YES_OPTIONS = \ CTM \ CUSE \ CXX \ + CXGBETOOL \ DIALOG \ DICT \ DMAGENT \ @@ -111,6 +112,7 @@ __DEFAULT_YES_OPTIONS = \ GPIO \ HAST \ HTML \ + HYPERV \ ICONV \ INET \ INET6 \ @@ -140,12 +142,14 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MLX5TOOL \ NDIS \ NETCAT \ NETGRAPH \ NLS_CATALOGS \ NS_CACHING \ NTP \ + NVME \ OFED \ OPENSSL \ PAM \ @@ -365,27 +369,20 @@ BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ - ${__T} == "powerpc64" || ${__T} == "sparc64" -__DEFAULT_YES_OPTIONS+=CXGBETOOL -__DEFAULT_YES_OPTIONS+=MLX5TOOL -.else -__DEFAULT_NO_OPTIONS+=CXGBETOOL -__DEFAULT_NO_OPTIONS+=MLX5TOOL +.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ + ${__T} != "powerpc64" && ${__T} != "sparc64" +BROKEN_OPTIONS+=CXGBETOOL +BROKEN_OPTIONS+=MLX5TOOL .endif # HyperV is currently x86-only -.if ${__T} == "amd64" || ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=HYPERV -.else -__DEFAULT_NO_OPTIONS+=HYPERV +.if ${__T} != "amd64" && ${__T} != "i386" +BROKEN_OPTIONS+=HYPERV .endif # NVME is only x86 and powerpc64 -.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64" -__DEFAULT_YES_OPTIONS+=NVME -.else -__DEFAULT_NO_OPTIONS+=NVME +.if ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "powerpc64" +BROKEN_OPTIONS+=NVME .endif .include From owner-svn-src-head@freebsd.org Sun Oct 21 10:42:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FC58FEA6CC; Sun, 21 Oct 2018 10:42:16 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE98C86B98; Sun, 21 Oct 2018 10:42:15 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id D68F516853; Sun, 21 Oct 2018 10:42:15 +0000 (UTC) From: Jan Beich To: Dimitry Andric Cc: Glen Barber , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys References: <201810190037.w9J0blks031617@repo.freebsd.org> Date: Sun, 21 Oct 2018 12:42:10 +0200 Message-ID: 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: Sun, 21 Oct 2018 10:42:16 -0000 Dimitry Andric writes: > On 21 Oct 2018, at 04:08, Jan Beich wrote: > >> >> Glen Barber writes: >> >>> Modified: head/lib/clang/llvm.build.mk >>> ============================================================================== >>> --- head/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 (r339435) >>> +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 (r339436) >>> @@ -17,7 +17,7 @@ CFLAGS+= -I${LLVM_SRCS}/include >>> CFLAGS+= -DLLVM_BUILD_GLOBAL_ISEL >>> CFLAGS+= -D__STDC_LIMIT_MACROS >>> CFLAGS+= -D__STDC_CONSTANT_MACROS >>> -#CFLAGS+= -DNDEBUG >>> +CFLAGS+= -DNDEBUG >> >> Would Clang still hit asserts instead of crashing with cryptic messages? > > In llvm, assertions (and various other internal consistency checks) are > turned off by defining NDEBUG. So indeed, if something in the internal > state goes in an unexpected direction, you could get crashes or other > "interesting" effects. > > That said, the resulting executable(s) should run somewhat faster, and > be somewhat smaller. I think we have always done this for stable > branches and releases. But this commit is for -CURRENT, not -STABLE or -RELEASE. $ svn cat svn://svn.freebsd.org/base/stable/12/lib/clang/llvm.build.mk | fgrep NDEBUG ~ #CFLAGS+= -DNDEBUG $ svn cat svn://svn.freebsd.org/base/releng/11.2/lib/clang/llvm.build.mk | fgrep NDEBUG CFLAGS+= -DNDEBUG > > If users encounter such crashes, it will still write reproduction files > (self-contained .c or .cpp file and a shell script), so those can be > included in bug reports, and run on a copy of clang with assertions. > > -Dimitry From owner-svn-src-head@freebsd.org Sun Oct 21 10:46:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC1D8FEA813; Sun, 21 Oct 2018 10:46:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92F5B86E3D; Sun, 21 Oct 2018 10:46:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D75D47DB; Sun, 21 Oct 2018 10:46:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LAk0tH049488; Sun, 21 Oct 2018 10:46:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LAk0MW049487; Sun, 21 Oct 2018 10:46:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201810211046.w9LAk0MW049487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 21 Oct 2018 10:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339531 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 339531 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, 21 Oct 2018 10:46:01 -0000 Author: mjg Date: Sun Oct 21 10:46:00 2018 New Revision: 339531 URL: https://svnweb.freebsd.org/changeset/base/339531 Log: amd64: tidy up memset to have rax set earlier for small sizes Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sun Oct 21 09:36:12 2018 (r339530) +++ head/sys/amd64/amd64/support.S Sun Oct 21 10:46:00 2018 (r339531) @@ -452,11 +452,11 @@ END(memcpy_erms) */ .macro MEMSET erms PUSH_FRAME_POINTER - movq %rdi,%r9 + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx jb 1016f @@ -465,10 +465,10 @@ END(memcpy_erms) ja 1256f 1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx @@ -478,54 +478,56 @@ END(memcpy_erms) 1016: cmpb $16,%cl jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) + movq %r10,(%rdi) + movq %r10,8(%rdi) subb $16,%cl jz 1000f leaq 16(%rdi),%rdi 1008: cmpb $8,%cl jl 1004f - movq %rax,(%rdi) + movq %r10,(%rdi) subb $8,%cl jz 1000f leaq 8(%rdi),%rdi 1004: cmpb $4,%cl jl 1002f - movl %eax,(%rdi) + movl %r10d,(%rdi) subb $4,%cl jz 1000f leaq 4(%rdi),%rdi 1002: cmpb $2,%cl jl 1001f - movw %ax,(%rdi) + movw %r10w,(%rdi) subb $2,%cl jz 1000f leaq 2(%rdi),%rdi 1001: cmpb $1,%cl jl 1000f - movb %al,(%rdi) + movb %r10b,(%rdi) 1000: - movq %r9,%rax POP_FRAME_POINTER ret ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax .if \erms == 1 rep stosb + movq %r9,%rax .else shrq $3,%rcx rep stosq + movq %r9,%rax movq %rdx,%rcx andb $7,%cl jne 1004b .endif - movq %r9,%rax POP_FRAME_POINTER ret .endm From owner-svn-src-head@freebsd.org Sun Oct 21 07:32:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF72FD8D78; Sun, 21 Oct 2018 07:32:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A36C77FD50; Sun, 21 Oct 2018 07:32:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E5D424D9; Sun, 21 Oct 2018 07:32:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L7WZYW049953; Sun, 21 Oct 2018 07:32:35 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L7WZUr049952; Sun, 21 Oct 2018 07:32:35 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201810210732.w9L7WZUr049952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 21 Oct 2018 07:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339527 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 339527 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, 21 Oct 2018 07:32:36 -0000 Author: phk Date: Sun Oct 21 07:32:35 2018 New Revision: 339527 URL: https://svnweb.freebsd.org/changeset/base/339527 Log: Add Lenovo USB-C and TB3 docks Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 21 07:30:26 2018 (r339526) +++ head/sys/dev/usb/usbdevs Sun Oct 21 07:32:35 2018 (r339527) @@ -2762,6 +2762,8 @@ product LEADTEK 9531 0x2101 9531 GPS product LENOVO GIGALAN 0x304b USB 3.0 Ethernet product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet product LENOVO RTL8153 0x7205 USB 3.0 Ethernet +product LENOVO TBT3LAN 0x3069 LAN port in Thinkpad TB3 dock +product LENOVO USBCLAN 0x3062 LAN port in Thinkpad USB-C dock /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader From owner-svn-src-head@freebsd.org Sun Oct 21 12:39:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E460DFEFA7E; Sun, 21 Oct 2018 12:39:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B2138C0B4; Sun, 21 Oct 2018 12:39:01 +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 7764259BA; Sun, 21 Oct 2018 12:39:01 +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 w9LCd1kv008449; Sun, 21 Oct 2018 12:39:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LCd04b008445; Sun, 21 Oct 2018 12:39:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810211239.w9LCd04b008445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 21 Oct 2018 12:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339532 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339532 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, 21 Oct 2018 12:39:02 -0000 Author: glebius Date: Sun Oct 21 12:39:00 2018 New Revision: 339532 URL: https://svnweb.freebsd.org/changeset/base/339532 Log: Fix exiting an epoch(9) we never entered. May happen only with MAC. Modified: head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_me.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sun Oct 21 10:46:00 2018 (r339531) +++ head/sys/net/if_gif.c Sun Oct 21 12:39:00 2018 (r339532) @@ -272,6 +272,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) uint8_t proto, ecn; int error; + GIF_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -280,7 +281,6 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; - GIF_RLOCK(); sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sun Oct 21 10:46:00 2018 (r339531) +++ head/sys/net/if_gre.c Sun Oct 21 12:39:00 2018 (r339532) @@ -550,6 +550,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) uint16_t proto; len = 0; + GRE_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -558,7 +559,6 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; - GRE_RLOCK(); sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Sun Oct 21 10:46:00 2018 (r339531) +++ head/sys/net/if_me.c Sun Oct 21 12:39:00 2018 (r339532) @@ -479,13 +479,13 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) uint32_t af; int error, hlen, plen; + ME_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error != 0) goto drop; #endif error = ENETDOWN; - ME_RLOCK(); sc = ifp->if_softc; if (sc == NULL || !ME_READY(sc) || (ifp->if_flags & IFF_MONITOR) != 0 || From owner-svn-src-head@freebsd.org Sun Oct 21 11:09:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0731DFEB3A0; Sun, 21 Oct 2018 11:09:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D53D883FF; Sun, 21 Oct 2018 11:09:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A1A853CA0AE; Sun, 21 Oct 2018 22:09:13 +1100 (AEDT) Date: Sun, 21 Oct 2018 22:09:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tobias Kortkamp cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339448 - head/usr.sbin/vidcontrol In-Reply-To: <201810201659.w9KGxiT3092274@repo.freebsd.org> Message-ID: <20181021211041.O1174@besplex.bde.org> References: <201810201659.w9KGxiT3092274@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cv3rqxwi c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=HwDPOYrYWktIQlxEtXAA:9 a=N3Kl0cBnJlR3ihTS:21 a=09GM1wqjBnRupC9m:21 a=CjuIK1q_8ugA: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: Sun, 21 Oct 2018 11:09:18 -0000 On Sat, 20 Oct 2018, Tobias Kortkamp wrote: > ... > Log: > vidcontrol(1): Fix a typo in the description of -f > > While here: > - Fix markup in -c This was supposed to be consistent with nearby style, but I changed the main .Cm to .Ar so it was inconsistent with itself. There are many other misuses of .Cm in this file and probably in others. I think the only correct uses of .Cm are when there is no flags arg. stty(1) gives many examples. E.g., 'sane' in "stty sane" really is a command modifier -- it modifies the command 'stty. But here .Cm was misused for args of -c. Those really are args. > ... > Modified: head/usr.sbin/vidcontrol/vidcontrol.1 > ============================================================================== > --- head/usr.sbin/vidcontrol/vidcontrol.1 Sat Oct 20 16:52:18 2018 (r339447) > +++ head/usr.sbin/vidcontrol/vidcontrol.1 Sat Oct 20 16:59:43 2018 (r339448) > ... > @@ -109,10 +109,10 @@ below. > .It Ar foreground Op Ar background This has the reverse bug. There is no flags arg, so the args modify the command directly so should use .Cm, as for stty(1). stty.1 gets this wrong too. Most commands use flags and not many direct command modifiers. stty.1 does the opposite. It starts correctly by using .Ar for its -f arg. Then it misuses .Ar for its speed command modifier. Then it does correct things like ".It Cm ispeed Ar number". Here ispeed is a command modifier for stty and number is an arg for ispeed. vidcontrol.1 apparently uses a mixture of .Cm and .Ar to try to do something similar. It is correct for it to switch to .Ar for args of a .Cm, but often incorrect to start with .Cm. stty.1 misuses .Ar for the C struct member name c_lflag and the C struct tag name termios. These seem to be its only misuses of .Ar. > @@ -128,13 +128,13 @@ Clear the history buffer. > .It Fl c Ar setting Ns Op , Ns Ar setting ... > Change the cursor appearance. > The change is specified by a non-empty comma-separated list of > -.Cm setting Ns s . > +.Ar setting Ns s . Old versions used "... c Cm normal | blink | destructive". .Cm was incorrect here. I fixed it in the flags line but seem to have left it broken for all other instances of 'setting. Here are most of the current misuses of .Cm in vidcontrol.1: - after the [imST] flags - after the t flag, the first alternative uses the correct .Ar but the second alternative misuses .Cm. - for the normal, blink, noblock, destructive, height and base args for -c (missed in this commit). These are all 'settings', so they are more like args than command modifiers (they are the names of instances of args and distinguishing them the names of args, or distingishing names from what they name, would be too subtle). - .Cm value after '... Cm base Ns = Ns Ar value". If 'base' were a command modifier, then its 'value' would still be an arg, but 'base' should be an arg too. Then the second 'value' should not change from an arg to a command modifier. - zillions more .Cm's for args of -c should be .Ar's. ISTR spending a lot of time making these consistent. Now I think they are consistently wrong. - .Cm's for 8x8, 8x14 and 8x16. Again these are names of instances of args. They are not quite args or names of args, but they are much closer to args than they are to command modifiers. - consistently for names of instances of args for the [imSTt] flags Most or all uses of .Ar in vidcontrol.1 are correct. There are many examples where .Ar is used for the name of an instance of an arg, so the extensive use of .Cm for names of instances of args doesn't seem to be because there is a special convention for this. I wrote more than half of the latter for -c by copying bad examples. Bruce From owner-svn-src-head@freebsd.org Sun Oct 21 09:15:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BE8BFE7309; Sun, 21 Oct 2018 09:15:22 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107B483967; Sun, 21 Oct 2018 09:15:21 +0000 (UTC) (envelope-from mark@grondar.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gE9pO-0006Di-Qo; Sun, 21 Oct 2018 10:15:18 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: svn commit: r339492 - head/sys/dev/random From: Mark R V Murray In-Reply-To: <201810202109.w9KL9CRp024271@repo.freebsd.org> Date: Sun, 21 Oct 2018 10:15:18 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <5BCC0848-14E3-4B03-ABA9-6B9F585DF833@grondar.org> References: <201810202109.w9KL9CRp024271@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3445.100.39) 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, 21 Oct 2018 09:15:22 -0000 > On 20 Oct 2018, at 22:09, Conrad Meyer wrote: > > Author: cem > Date: Sat Oct 20 21:09:12 2018 > New Revision: 339492 > URL: https://svnweb.freebsd.org/changeset/base/339492 > > Log: > Fortuna: ... ... and a few others. Thanks, Conrad, for picking these up! Having code reviewed well is a good feeling :-) M -- From owner-svn-src-head@freebsd.org Sun Oct 21 07:46:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA28FD90E5; Sun, 21 Oct 2018 07:46:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 AECAD8023F; Sun, 21 Oct 2018 07:46:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9L7ksID003892; Sun, 21 Oct 2018 00:46:54 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9L7ks7R003891; Sun, 21 Oct 2018 00:46:54 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810210746.w9L7ks7R003891@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339462 - head/libexec/rc In-Reply-To: <201810201801.w9KI1mYV025953@repo.freebsd.org> To: Eugene Grosbein Date: Sun, 21 Oct 2018 00:46:54 -0700 (PDT) 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-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, 21 Oct 2018 07:46:59 -0000 > Author: eugen > Date: Sat Oct 20 18:01:48 2018 > New Revision: 339462 > URL: https://svnweb.freebsd.org/changeset/base/339462 > > Log: > Make upgrade from previous FreeBSD versions less painful > and make previously working configuration like this work again: > > gif_interfaces="gif0" > gifconfig_gif0="1.1.1.1 2.2.2.2" > ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252" > > PR: 204700 > MFC after: 1 month Are you intentionally not wanting this to make 12.0 release? > > Modified: > head/libexec/rc/network.subr > > Modified: head/libexec/rc/network.subr > ============================================================================== > --- head/libexec/rc/network.subr Sat Oct 20 18:01:15 2018 (r339461) > +++ head/libexec/rc/network.subr Sat Oct 20 18:01:48 2018 (r339462) > @@ -1393,7 +1393,7 @@ clone_up() > _list="$_list $ifn" > fi > tmpargs=$(get_if_var $ifn gifconfig_IF) > - eval ifconfig_${ifn}=\"tunnel \$tmpargs\" > + eval ifconfig_${ifn}=\"\$ifconfig_${ifn} tunnel \$tmpargs\" > done > if [ -n "${_list# }" ]; then > echo "Created clone interfaces: ${_list# }." > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Oct 21 09:36:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30953FE7AF1; Sun, 21 Oct 2018 09:36:13 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBD5B84263; Sun, 21 Oct 2018 09:36:12 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D29583C40; Sun, 21 Oct 2018 09:36:12 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9L9aCfu013521; Sun, 21 Oct 2018 09:36:12 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L9aC0s013520; Sun, 21 Oct 2018 09:36:12 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201810210936.w9L9aC0s013520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 21 Oct 2018 09:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339530 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 339530 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, 21 Oct 2018 09:36:13 -0000 Author: phk Date: Sun Oct 21 09:36:12 2018 New Revision: 339530 URL: https://svnweb.freebsd.org/changeset/base/339530 Log: Recognize LAN in Lenovo USB-C and TB3 docks Modified: head/sys/dev/usb/net/if_ure.c Modified: head/sys/dev/usb/net/if_ure.c ============================================================================== --- head/sys/dev/usb/net/if_ure.c Sun Oct 21 08:29:36 2018 (r339529) +++ head/sys/dev/usb/net/if_ure.c Sun Oct 21 09:36:12 2018 (r339530) @@ -68,6 +68,8 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN static const STRUCT_USB_HOST_ID ure_devs[] = { #define URE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } URE_DEV(LENOVO, RTL8153, 0), + URE_DEV(LENOVO, TBT3LAN, 0), + URE_DEV(LENOVO, USBCLAN, 0), URE_DEV(NVIDIA, RTL8153, 0), URE_DEV(REALTEK, RTL8152, URE_FLAG_8152), URE_DEV(REALTEK, RTL8153, 0), From owner-svn-src-head@freebsd.org Sun Oct 21 09:55:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EDEEFE846E; Sun, 21 Oct 2018 09:55:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E86784AB7; Sun, 21 Oct 2018 09:55:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 052E7472AF; Sun, 21 Oct 2018 11:55:31 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_327A302A-8CB5-457E-94EE-80BE203B84AB"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys Date: Sun, 21 Oct 2018 11:55:20 +0200 In-Reply-To: Cc: Glen Barber , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Jan Beich References: <201810190037.w9J0blks031617@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.9.1) 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, 21 Oct 2018 09:55:38 -0000 --Apple-Mail=_327A302A-8CB5-457E-94EE-80BE203B84AB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 21 Oct 2018, at 04:08, Jan Beich wrote: >=20 > Glen Barber writes: >=20 >> Modified: head/lib/clang/llvm.build.mk >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 = (r339435) >> +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 = (r339436) >> @@ -17,7 +17,7 @@ CFLAGS+=3D -I${LLVM_SRCS}/include >> CFLAGS+=3D -DLLVM_BUILD_GLOBAL_ISEL >> CFLAGS+=3D -D__STDC_LIMIT_MACROS >> CFLAGS+=3D -D__STDC_CONSTANT_MACROS >> -#CFLAGS+=3D -DNDEBUG >> +CFLAGS+=3D -DNDEBUG >=20 > Would Clang still hit asserts instead of crashing with cryptic = messages? In llvm, assertions (and various other internal consistency checks) are turned off by defining NDEBUG. So indeed, if something in the internal state goes in an unexpected direction, you could get crashes or other "interesting" effects. That said, the resulting executable(s) should run somewhat faster, and be somewhat smaller. I think we have always done this for stable branches and releases. If users encounter such crashes, it will still write reproduction files (self-contained .c or .cpp file and a shell script), so those can be included in bug reports, and run on a copy of clang with assertions. -Dimitry --Apple-Mail=_327A302A-8CB5-457E-94EE-80BE203B84AB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCW8xNCAAKCRCwXqMKLiCW oyaXAKDXEZI/4cWTB0qr543kJc1XjK6q6wCg7D8vIQthMTJMRptfRii+bIs5uDE= =NuZA -----END PGP SIGNATURE----- --Apple-Mail=_327A302A-8CB5-457E-94EE-80BE203B84AB-- From owner-svn-src-head@freebsd.org Sun Oct 21 07:56:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A7F5FD9574; Sun, 21 Oct 2018 07:56:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21EE48095B; Sun, 21 Oct 2018 07:56:59 +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 1C93F2809; Sun, 21 Oct 2018 07:56:59 +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 w9L7uw3C061066; Sun, 21 Oct 2018 07:56:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9L7uwHk061065; Sun, 21 Oct 2018 07:56:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810210756.w9L7uwHk061065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 21 Oct 2018 07:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339528 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 339528 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, 21 Oct 2018 07:56:59 -0000 Author: imp Date: Sun Oct 21 07:56:58 2018 New Revision: 339528 URL: https://svnweb.freebsd.org/changeset/base/339528 Log: Remove all the really old junk that never would be used with an OCTEON CPU. Most of them were here just to test build mips versions of things, even though many of them have never been tested on mips, let alone the Octeon. Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sun Oct 21 07:32:35 2018 (r339527) +++ head/sys/mips/conf/OCTEON1 Sun Oct 21 07:56:58 2018 (r339528) @@ -109,8 +109,6 @@ device pci # ATA controllers device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # On-board Compact Flash driver. device cf @@ -118,22 +116,8 @@ options ROOTDEVNAME=\"ufs:cf0s2a\" # Default root fil # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices -device ahd # AHA39320/29320 and onboard AIC79xx devices -device esp # AMD Am53C974 (Tekram DC-390(T)) -device hptiop # Highpoint RocketRaid 3xxx series -device isp # Qlogic family -#device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion -device mps # LSI-Logic MPT-Fusion 2 -device mpr # LSI-Logic MPT-Fusion 3 -#device ncr # NCR/Symbios Logic -device trm # Tekram DC395U/UW/F DC315U adapters -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters - # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers @@ -144,25 +128,8 @@ device pass # Passthrough device (direct ATA/SCSI ac device ses # Enclosure Services (SES and SAF-TE) # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID -#XXX it is not 64-bit clean, -scottl -#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options -device iir # Intel Integrated RAID -device ips # IBM (Adaptec) ServeRAID -device mly # Mylex AcceleRAID/eXtremeRAID -# RAID controllers -device aac # Adaptec FSA RAID -device aacp # SCSI passthrough for aac (requires CAM) -device ida # Compaq Smart RAID -device mfi # LSI MegaRAID SAS -device mlx # Mylex DAC960 family -#XXX pointer/int warnings -#device pst # Promise Supertrak SX6000 -device twe # 3ware ATA RAID - # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support device cbb # cardbus (yenta) bridge @@ -189,49 +156,17 @@ device octm #device mv88e61xxphy # Marvell 88E61XX # PCI Ethernet NICs. -device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel PRO/10GbE PF PCIE Ethernet Family device ixv # Intel PRO/10GbE VF PCIE Ethernet Family -device le # AMD Am7900 LANCE and Am79C9xx PCnet -device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support -device ae # Attansic/Atheros L2 FastEthernet -device age # Attansic/Atheros L1 Gigabit Ethernet -device alc # Atheros AR8131/AR8132 Ethernet -device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet -device dc # DEC/Intel 21143 and various workalikes -device et # Agere ET1310 10/100/Gigabit Ethernet -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet -device lge # Level 1 LXT1001 gigabit Ethernet -device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet -device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sge # Silicon Integrated Systems SiS190/191 -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') -# Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's @@ -240,14 +175,12 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NIC's device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath device ral # Ralink Technology RT2500 wireless NICs. -device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. # Pseudo devices. device loop # Network loopback @@ -279,7 +212,6 @@ device uhid # "Human Interface Devices" device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da device ums # Mouse -device urio # Diamond Rio 500 MP3 player # USB Serial devices device u3g # USB-based 3G modems (Option, Huawei, Sierra) device uark # Technologies ARK3116 based serial adapters @@ -290,14 +222,6 @@ device uplcom # Prolific PL-2303 serial adapters device uslcom # SI Labs CP2101/CP2102 serial adapters device uvisor # Visor and Palm devices device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB # USB Wireless device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs From owner-svn-src-head@freebsd.org Sun Oct 21 14:48:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B82FF4C09; Sun, 21 Oct 2018 14:48:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 872B090C7D; Sun, 21 Oct 2018 14:48:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E2856F28; Sun, 21 Oct 2018 14:48:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LEmeF9076131; Sun, 21 Oct 2018 14:48:40 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LEmeZJ076130; Sun, 21 Oct 2018 14:48:40 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211448.w9LEmeZJ076130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 14:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339536 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 339536 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, 21 Oct 2018 14:48:41 -0000 Author: ae Date: Sun Oct 21 14:48:40 2018 New Revision: 339536 URL: https://svnweb.freebsd.org/changeset/base/339536 Log: Fix grammar. Reported by: yuripv MFC after: 3 weeks Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sun Oct 21 14:40:45 2018 (r339535) +++ head/sbin/ifconfig/ifconfig.c Sun Oct 21 14:48:40 2018 (r339536) @@ -512,7 +512,7 @@ main(int argc, char *argv[]) if (argc > 0 && (strcmp(argv[0], "create") == 0 || strcmp(argv[0], "plumb") == 0)) { if (argc == 1) - errx(1, "interface %s already exist", + errx(1, "interface %s already exists", ifname); argc--, argv++; } From owner-svn-src-head@freebsd.org Sun Oct 21 14:23:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5718FF3ACB; Sun, 21 Oct 2018 14:23:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 639668F905; Sun, 21 Oct 2018 14:23:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 415C86B90; Sun, 21 Oct 2018 14:23:57 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LENvwg065024; Sun, 21 Oct 2018 14:23:57 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LENuij065022; Sun, 21 Oct 2018 14:23:56 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810211423.w9LENuij065022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sun, 21 Oct 2018 14:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339534 - in head/usr.sbin/pw: . tests X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head/usr.sbin/pw: . tests X-SVN-Commit-Revision: 339534 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, 21 Oct 2018 14:23:58 -0000 Author: yuripv Date: Sun Oct 21 14:23:56 2018 New Revision: 339534 URL: https://svnweb.freebsd.org/changeset/base/339534 Log: pw: fix the checks in boolean_str() after r326738. Add related test cases for `pw useradd -D -w`. PR: 231649 Reviewed by: eugen Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D17299 Modified: head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/tests/pw_useradd_test.sh Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Oct 21 14:19:16 2018 (r339533) +++ head/usr.sbin/pw/pw_conf.c Sun Oct 21 14:23:56 2018 (r339534) @@ -221,12 +221,14 @@ passwd_val(char const * str, int dflt) char const * boolean_str(int val) { - if (val == -1) - return "random"; - else if (val == -2) - return "none"; + if (val == P_NO) + return (boolfalse[0]); + else if (val == P_RANDOM) + return ("random"); + else if (val == P_NONE) + return ("none"); else - return val ? booltrue[0] : boolfalse[0]; + return (booltrue[0]); } char * Modified: head/usr.sbin/pw/tests/pw_useradd_test.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd_test.sh Sun Oct 21 14:19:16 2018 (r339533) +++ head/usr.sbin/pw/tests/pw_useradd_test.sh Sun Oct 21 14:23:56 2018 (r339534) @@ -421,6 +421,7 @@ user_add_with_pw_conf_body() atf_check -s exit:0 \ ${PW} useradd foo -C ${HOME}/pw.conf } + atf_test_case user_add_defaultgroup user_add_defaultgroup_body() { @@ -435,6 +436,25 @@ user_add_defaultgroup_body() ${PW} usershow foo } +atf_test_case user_add_conf_defaultpasswd +user_add_conf_defaultpasswd_body() +{ + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd -D -w no + atf_check -o inline:"defaultpasswd = \"no\"\n" \ + grep defaultpasswd ${HOME}/pw.conf + atf_check -s exit:0 ${PW} useradd -D -w none + atf_check -o inline:"defaultpasswd = \"none\"\n" \ + grep defaultpasswd ${HOME}/pw.conf + atf_check -s exit:0 ${PW} useradd -D -w random + atf_check -o inline:"defaultpasswd = \"random\"\n" \ + grep defaultpasswd ${HOME}/pw.conf + atf_check -s exit:0 ${PW} useradd -D -w yes + atf_check -o inline:"defaultpasswd = \"yes\"\n" \ + grep defaultpasswd ${HOME}/pw.conf +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -472,4 +492,6 @@ atf_init_test_cases() { atf_add_test_case user_add_w_yes atf_add_test_case user_add_with_pw_conf atf_add_test_case user_add_defaultgroup + + atf_add_test_case user_add_conf_defaultpasswd } From owner-svn-src-head@freebsd.org Sun Oct 21 15:10:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B2FFF5E1E; Sun, 21 Oct 2018 15:10:45 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 6FA1E91F4E; Sun, 21 Oct 2018 15:10:45 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w9LF056O030871 (version=TLSv1.2 cipher=AES128-SHA bits=128 verify=NOT); Sun, 21 Oct 2018 08:00:06 -0700 Subject: Re: svn commit: r339523 - in head/sys: conf dev/amdgpio modules modules/amdgpio To: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810210452.w9L4qbTc067553@repo.freebsd.org> From: Nathan Whitehorn Openpgp: preference=signencrypt Autocrypt: addr=nwhitehorn@freebsd.org; keydata= xsFNBFuARN8BEADLKYsG3l1aq/M21R59I/5EsEfvtvd15ZJ9lDHcWPuxzIfGnu2LMpe5PrFP e/Y4bcsPrlB4S3I3ooIUDvoEEsDeqgqlZod3QevOK/RjLqiqx1i/4mKnobJ++3ppyVVIccgN sUrj786OYCFCI/W+uWw7cbKewNeaL//Z/TDKlHLkssiy6qmZbNQ0ZjcMLJKUesk4eVg2TtTD HNe42ZuxbUC9iLYieO4c7kQB4qiFhagDRiObXrLzvm2MQYeAaNVRqID+mfI75TWrQ+t98iVu mHvFu461eeteq59jg6H/IL07ACxL+HzEVM+D6tPtPrz7ppr3wiZL5Cu17yu0nAx0nhJTV8ZB qza1rOVun0x65S14L41XD2HkmBDxTaRlTg8ypnkLFo8kh+MEq4k67apL/DUGcaUjKy2TVUC7 3igLO/DwQHrkWx2RrOmS3xS0TgGXVmB47nq2Zveo3fcjporQK63n2sbLkS70cfAJAJ9KHEIx u9am44iW5Ku3+mVLgQYybtcUxlk/Jw/BA5V6KUcDQMd5kTm0MyagziqMaT+57ceYxwRBK4HC DCLRpSOHV81/YzyL5vnwfHsxADm3091rd0uwr8uRCQn7wLvlcFyp/JKSFkVnE1oo7UE4QQJZ GbSJyvj7GdXu0LdghALcMj/thdb+js4D3UuCaAMecgVSscxEIQARAQABzS5OYXRoYW4gV2hp dGVob3JuIDxud2hpdGVob3JuQGljZWN1YmUud2lzYy5lZHU+wsGOBBMBCAA4FiEEPWQg+qgh ST6Avw1hOLZNlGaE6HcFAluAUl4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOLZN lGaE6HeHFw//fN2CzkiW1yedjLGEQ3uXRMgu6geRgWdtkgg/pOhn5OLSQI4R59kjvHNHHqln 1QYdxe63lsbe+7CRsTKuke3/mgsQ1h6n7cCzsoXVP3eLtWjshAz7spwUcdRRFTSbwkMzKcRn plpr+ByZDw98vnpQo10J5xYmf6if6wcEpVlazwnC5G1gHktM4X0jrlAUKSgVx7MG8o4G6af9 7MQJINAG6g6+BlBH3u5fmPunKi9qgHsZxKnTZneD2mO5u2x6p1qmqybvfvWI5UEvktPeEext JBeXXqdex+HWmAbLYznLUoBloBl+fW5Lo9VapkcGubvGC0WLr/gYuamAApwoFpa4/SBqgmHr JSsPqoDtheWt9oYzuYkYW5+tpJQoDVdG3KCOQJSYZIbNT8HyviFY32ZSn6gIn2qP/5E+rA8J +6/57XCZXPazE4FiPNbwY/OwZoi7w0yRKcdmJoSoC/GdjtQbjyeARbAaHIcudeU/bB3paGS2 rHkoW4iR5TnK/V/QJvNT4KC6Dw3m6pfBIzsF+smcyjz+MzBFQNvSOtG4kJQooKcMsThas8oX VTx+WsqNAVOeQKTOU74jlUYKm5+w5aIOJbc8jg1LlTWJus1SxYtxT9lgNwOCUhE/j6Ueq9jG V9POWg31C44akWmnK8rS4PImUBsPKwtxUNM6BhfZRbtIjQ7OwU0EW4BFQQEQAOLKFtg6us0A LA7LtvjxIskIgqFJjHw2ka/UtdJ432P9kvmBq7z4v0+m/gkxCOOG0yDi2Cv/ALJobsyb56tb U6MU0SRjTio35S2jit369B1BDC2TLNF337sUquUx0l4wkEXEBefvLRYouF8BRbkgjveg7sA4 NjsiduQx92vPJnBoaH2OWxqDbr5X6kF5cx9jPrKUJ4ZqH/raE/SSDhtow4aKO0nWbteVGck1 5W1X/S8KziPXKazxCQ8qprQRTAehsdG/bSbWD95hp3TAlEbl4N4UqqS7n4jCZunCeii2TDZH Vvx/lpFAT2ezx646p2PUmH5hpiVMgbY5uHcyahwNf+eNOO7gotnNYoieoLw4fUeTYOq+s3IN isCB4iovQcZOCYSzmwRolQRggX0tBSenR6Pgp38YjVIkWvMHhxbVifAusjvVbm/GQeA2MaCt kog53Iyfo7ri9DeNpVuRc/47BxHi8JtdyyGgLO13Ajcwc6V7KLeDmw/SXJAMssuWQlXzs8Og spNvtymBh5rq4TlxAY65L3Yv/yh0izEztOJO3Ob9y3gLrp7TeDI0EO9SyGuFXbgWY/NXlDwW HWguMgO7DWM/KxeaMYyHfnffIeQ6uhM21y42I7NV11mWwycv/XJkID3fd7GWBecakdYnYI/7 FYMDHmsUQPmSMkbqCqYcZe47ABEBAAHCwXYEGAEIACAWIQQ9ZCD6qCFJPoC/DWE4tk2UZoTo dwUCW4BFQQIbDAAKCRA4tk2UZoTod2RbEACbQ2bwJ3++bvqclErbekf7BXYja37/HxGE67q3 9xf28hen8vWGtXwq4bWmZT5H8bBqXigA4bUU4nN4X3xEDfTyqkQMuDTnnwT7Y61B4QEqhi4a q4adf/KP0l1UCg4CJ0KS931Han+VbiuUcbadu1ZX37Ef6g/hG+mt59FeXDMU0rers2Bpr8zB 8ywojAsVC92kvOHLsCQtdCsPzC+R6B1bY6/Re9slM1NBd+2k4BUVhYu8Fb8Ir37OmN0aGQzY uRczfrmR/OV5/1+g5XeYSFbq/0Q3KkFWLHfimff8lb9GRWrdvOUpYyGluv49b/G5o9lSxPwX yBfaoVi/WDDfJ/XJw9H90XK68TYxPfEQkeuLEEzg+Bz3Zeduyo2Zx4S5apLqAbv0RzduXgIG YZVPu8R4ya8nQWHeUpot17lt8SL7yFkMJaAXk27QqUAaxjqnGBLn70YMWXFGySfvjgaR1Ftu /S/HSKqH7m8aFYZftqs7ZojXNdqGHZKRrIx6hRUYuZQM8uxHDweF4jF+QIwYIUmtry5h8iti Sjt9KHjpkH3Wz5o1mk6cbFNN+wgpHplDl/iZMZjFskTAJfEsYHVSSm21zcYvvogrbqYvciMT ty65+0A8Gz9tMbcNx9ePaGoM+9jeFehrzTjdaiTiC+umSd/Y29DCW4OBMr1VfufVVKbfAQ== Message-ID: <49432512-861b-47dd-4e25-08044b0b53fa@freebsd.org> Date: Sun, 21 Oct 2018 08:00:05 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <201810210452.w9L4qbTc067553@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVYhJ99m+QdHvB49DJBDSeqwXXqMfYh9BQN5yYWECtFbfOdn0hWltl0rT5ixNYbfR3jLN8QXwpNweIq8LoNTAUlrvjxH2ToGXYI= X-Sonic-ID: C;9I2+/kHV6BG6TecbDaCztA== M;COQN/0HV6BG6TecbDaCztA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd 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, 21 Oct 2018 15:10:46 -0000 On 10/20/18 9:52 PM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Sun Oct 21 04:52:37 2018 > New Revision: 339523 > URL: https://svnweb.freebsd.org/changeset/base/339523 > > Log: > Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms > > Submitted by: Rajesh Kumar > Differential Revision: https://reviews.freebsd.org/D16865 > [...] > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Sun Oct 21 02:39:13 2018 (r339522) > +++ head/sys/modules/Makefile Sun Oct 21 04:52:37 2018 (r339523) > @@ -34,6 +34,7 @@ SUBDIR= \ > ale \ > alq \ > ${_amd_ecc_inject} \ > + ${_amdgpio} \ > ${_amdsbwd} \ > ${_amdsmn} \ > ${_amdtemp} \ > @@ -717,6 +718,7 @@ _x86bios= x86bios > .endif > > .if ${MACHINE_CPUARCH} == "amd64" > +_amdgpio= amdgpio > _ccp= ccp > _efirt= efirt > _iavf= iavf > Does this not work on 64-bit AMD processors running i386 kernels? -Nathan From owner-svn-src-head@freebsd.org Sun Oct 21 11:41:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900B3FECF3A; Sun, 21 Oct 2018 11:41:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 1124D89D0F; Sun, 21 Oct 2018 11:41:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7AC881A07DF; Sun, 21 Oct 2018 22:41:46 +1100 (AEDT) Date: Sun, 21 Oct 2018 22:41:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339481 - head/sys/dev/random In-Reply-To: <201810202015.w9KKF6Ag097561@repo.freebsd.org> Message-ID: <20181021220923.M1174@besplex.bde.org> References: <201810202015.w9KKF6Ag097561@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=nYu90UyBjzA0UZKbb94A:9 a=CjuIK1q_8ugA: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: Sun, 21 Oct 2018 11:41:50 -0000 On Sat, 20 Oct 2018, Conrad Meyer wrote: > ... > Log: > Fortuna: trivial static variable cleanup > > Remove unnecessary use of function-local static variable. 32 bytes is > small enough to live on the stack. > ... > Modified: head/sys/dev/random/fortuna.c > ============================================================================== > --- head/sys/dev/random/fortuna.c Sat Oct 20 20:12:57 2018 (r339480) > +++ head/sys/dev/random/fortuna.c Sat Oct 20 20:15:06 2018 (r339481) > @@ -333,7 +333,7 @@ random_fortuna_genblocks(uint8_t *buf, u_int blockcoun > static __inline void > random_fortuna_genrandom(uint8_t *buf, u_int bytecount) > { > - static uint8_t temp[RANDOM_BLOCKSIZE*(RANDOM_KEYS_PER_BLOCK)]; > + uint8_t temp[RANDOM_BLOCKSIZE * RANDOM_KEYS_PER_BLOCK]; > u_int blockcount; > > RANDOM_RESEED_ASSERT_LOCK_OWNED(); This now uses explicit_bzero() on the stack variable (as before, just before returning from the function). This is neither necessary nor sufficient for security. Even with the static variable, it was a reasonable optimization to keep a copy of the whole variable on the stack, or better in registers which might be spilled to the stack (this is possible because the variable is small). So to be really secure, the function must clear all stack and registers used by the function. In practice, something probably clobbers the stack and registers before any untrusted thread can read them, and the explicit_bzero() is not really needed. However, this function is explicitly bogusly inlined, so the stack and registers usually don't get clobbered immediately after the function returns. The inlining is bogus since this function is very large. The function call overhead for just the explicit_bzero() in it is as large as the possible savings from inlining it. clang likes to bogusly inline almost all static functions. If this one were not too large to inline, then clang would inline it even if it is not declared __inline, so declaring it has no good effect if the compiler is clang. Auto-inlining may open security holes by extending the lifetime of stack variables. That is another reason to not do it. I use gcc -fno-inline -fno-inline-functions-called-once to kill all auto-inlining. clang inlines even functions called more than once, and doesn't support these flags. Where was the security hole with the old static variable? I think it was mostly with the long lifetime of the variable. The global memory is actually more secure against accidental leaks by copying it out than stack memory. But even local variables have long lifetimes if you can manage to suspend the system while a critical local variable is active. I think rendezvous stuff prevents this particalar variable remaining active across suspend. Bruce From owner-svn-src-head@freebsd.org Sun Oct 21 15:09:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8F49FF5D9F; Sun, 21 Oct 2018 15:09:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8010D91D0D; Sun, 21 Oct 2018 15:09:42 +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 7B0D27282; Sun, 21 Oct 2018 15:09:42 +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 w9LF9gMr086258; Sun, 21 Oct 2018 15:09:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LF9gSi086257; Sun, 21 Oct 2018 15:09:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810211509.w9LF9gSi086257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 21 Oct 2018 15:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339538 - head/sys/dev/ncr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ncr X-SVN-Commit-Revision: 339538 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, 21 Oct 2018 15:09:43 -0000 Author: imp Date: Sun Oct 21 15:09:42 2018 New Revision: 339538 URL: https://svnweb.freebsd.org/changeset/base/339538 Log: Tag this obsolete driver. It was obsolete in 3.x when the sym driver supported all the "old" chips it did, so we should have killed it in 4, but 12 will do. It's a bit outside of the normal deprecation process, but given the extreme age, it's obsolete status for 8 major releases and the fact that I couldn't find any users who posted dmesgs with ncr0: in them after 2000 or 3.4. It may be too late for 12 (this change will be merged, but maybe not the next one to remove it), but it will be removed in 13 with the first round of other drivers tagged to be gone in 12. MFC after: 3 days Modified: head/sys/dev/ncr/ncr.c Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Sun Oct 21 15:02:06 2018 (r339537) +++ head/sys/dev/ncr/ncr.c Sun Oct 21 15:09:42 2018 (r339538) @@ -3778,6 +3778,7 @@ ncr_attach (device_t dev) ncr_timeout (np); np->lasttime=0; mtx_unlock(&np->lock); + gone_in_dev(dev, 12, "ncr(4) driver, use sym(4) instead"); return 0; } From owner-svn-src-head@freebsd.org Sun Oct 21 15:33:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53AC8FF6C8C; Sun, 21 Oct 2018 15:33:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 C0DE992C0D; Sun, 21 Oct 2018 15:33:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9LFX1w1005565; Sun, 21 Oct 2018 08:33:01 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9LFX1lq005564; Sun, 21 Oct 2018 08:33:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810211533.w9LFX1lq005564@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339498 - head/sys/crypto/chacha20 In-Reply-To: <201810202212.w9KMCrl9061919@repo.freebsd.org> To: Conrad Meyer Date: Sun, 21 Oct 2018 08:33:01 -0700 (PDT) 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-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, 21 Oct 2018 15:33:04 -0000 > Author: cem > Date: Sat Oct 20 22:12:53 2018 > New Revision: 339498 > URL: https://svnweb.freebsd.org/changeset/base/339498 > > Log: > crypto/chacha: Split header into separate _chacha.h > > Sponsored by: Dell EMC Isilon > > Added: > head/sys/crypto/chacha20/_chacha.h (contents, props changed) > Modified: > head/sys/crypto/chacha20/chacha.h > > Added: head/sys/crypto/chacha20/_chacha.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/crypto/chacha20/_chacha.h Sat Oct 20 22:12:53 2018 (r339498) > @@ -0,0 +1,12 @@ > +/* $FreeBSD$ */ > + > +#ifndef _CHACHA_H > +#define _CHACHA_H > + > +#include > + > +struct chacha_ctx { > + u_int input[16]; > +}; > + > +#endif This new file has neither a copyright or license which is out side of the project guidelines. > > Modified: head/sys/crypto/chacha20/chacha.h > ============================================================================== > --- head/sys/crypto/chacha20/chacha.h Sat Oct 20 21:49:44 2018 (r339497) > +++ head/sys/crypto/chacha20/chacha.h Sat Oct 20 22:12:53 2018 (r339498) > @@ -12,10 +12,7 @@ Public domain. > #define CHACHA_H > > #include > - > -struct chacha_ctx { > - u_int input[16]; > -}; > +#include > > #define CHACHA_MINKEYLEN 16 > #define CHACHA_NONCELEN 8 -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Oct 21 15:54:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B34FF770A; Sun, 21 Oct 2018 15:54:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADAAB937DC; Sun, 21 Oct 2018 15:54:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A88C57A9A; Sun, 21 Oct 2018 15:54:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LFscLE012304; Sun, 21 Oct 2018 15:54:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LFsc8e012303; Sun, 21 Oct 2018 15:54:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810211554.w9LFsc8e012303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 21 Oct 2018 15:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339541 - head/lib/clang X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/lib/clang X-SVN-Commit-Revision: 339541 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, 21 Oct 2018 15:54:39 -0000 Author: gjb Date: Sun Oct 21 15:54:38 2018 New Revision: 339541 URL: https://svnweb.freebsd.org/changeset/base/339541 Log: Comment -DNDEBUG in head after r339436 when head was switched from 12.0-ALPHA10 to 13.0-CURRENT. This edit was a mistake, and should have been applied to stable/12 upon branching, not head. Reported by: jbeich, dim Sponsored by: The FreeBSD Foundation Modified: head/lib/clang/llvm.build.mk Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Sun Oct 21 15:43:20 2018 (r339540) +++ head/lib/clang/llvm.build.mk Sun Oct 21 15:54:38 2018 (r339541) @@ -17,7 +17,7 @@ CFLAGS+= -I${LLVM_SRCS}/include CFLAGS+= -DLLVM_BUILD_GLOBAL_ISEL CFLAGS+= -D__STDC_LIMIT_MACROS CFLAGS+= -D__STDC_CONSTANT_MACROS -CFLAGS+= -DNDEBUG +#CFLAGS+= -DNDEBUG TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} From owner-svn-src-head@freebsd.org Sun Oct 21 15:45:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC53FFF7239; Sun, 21 Oct 2018 15:45:23 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A055E93297; Sun, 21 Oct 2018 15:45:23 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id CC3EC1BB42; Sun, 21 Oct 2018 15:45:22 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Sun, 21 Oct 2018 15:45:20 +0000 From: Glen Barber To: Dimitry Andric Cc: Jan Beich , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys Message-ID: <20181021154520.GB13668@FreeBSD.org> References: <201810190037.w9J0blks031617@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IiVenqGWf+H9Y6IX" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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, 21 Oct 2018 15:45:24 -0000 --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 21, 2018 at 11:55:20AM +0200, Dimitry Andric wrote: > On 21 Oct 2018, at 04:08, Jan Beich wrote: > >=20 > > Glen Barber writes: > >=20 > >> Modified: head/lib/clang/llvm.build.mk > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 (r339435) > >> +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 (r339436) > >> @@ -17,7 +17,7 @@ CFLAGS+=3D -I${LLVM_SRCS}/include > >> CFLAGS+=3D -DLLVM_BUILD_GLOBAL_ISEL > >> CFLAGS+=3D -D__STDC_LIMIT_MACROS > >> CFLAGS+=3D -D__STDC_CONSTANT_MACROS > >> -#CFLAGS+=3D -DNDEBUG > >> +CFLAGS+=3D -DNDEBUG > >=20 > > Would Clang still hit asserts instead of crashing with cryptic messages? >=20 > In llvm, assertions (and various other internal consistency checks) are > turned off by defining NDEBUG. So indeed, if something in the internal > state goes in an unexpected direction, you could get crashes or other > "interesting" effects. >=20 > That said, the resulting executable(s) should run somewhat faster, and > be somewhat smaller. I think we have always done this for stable > branches and releases. >=20 I think I screwed up, and changed this in the wrong branch. I'm looking into the "why", but the commit to head in this case should be reverted (I'll take care of it if it was not already done), and this particular change should be applied to stable/12 (which I will also take care of). I first want to look through our docs to understand how I messed this up. Glen --IiVenqGWf+H9Y6IX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlvMnxAACgkQAxRYpUeP 4pONshAAhk9i9Q5ywgS5r5qhNZybLbreAYTXU8gkHmuO75TzKVWaTJPJ/+IhYmTy E/CTEdSmTsaamBP15xMLYEHf9A0lWNqypVORyQS4FUqRycBz+owkzbOGzJtq86OF uT2BA/N6/i9kcbFcjHDXr1YAnhxhGO8VFw5mmNtfH6asLvB14hGQ5huQAOR1yD/F UFhbS0Fqs1iJTGyRtDtn0fLdS2OoR8suUaOMy8fl/kqKmdEJy0Tpto/Gng3xCE87 iWSOExodsGVTOo3X5NzlsoI2MXyOV0icyMV61WWKhCqXXyquunoXu7oGLCwB/j96 hkR8GvNJxoTCDwhZmSPGjoUNlfXtHv/IHVmAZuCEqD3DZxg7LnPEkh3NNM1UzGZD o84ij+9dA/fEC2FhCETgAGRzeIcv2x+MaywbiYCpzecuVO2NsNgPDZqJ7sZ+CFFo 8fD0xk5Dj2tokC2J/Ne6c24z/MyT6JJy60Vcf1gfBUBsQtIqRI4PBBXTrTESD6Ba 672yjvE2b3TgpM3tR3F7y3bgQSsB5B/rXUvXe9BnVMGvjvvN7Vyq3V6lK05a/Gt/ ATxvqajLIwkITeby8r4pdOana1X1MWUnOi/+EVNDy3/UBF1wukGrrUL3MxbGGrD1 TCv4dm/wUJvPN2YOp6PVigMdS4C9ZQiuPqvxAp3d9vrml2QvHzU= =rqtj -----END PGP SIGNATURE----- --IiVenqGWf+H9Y6IX-- From owner-svn-src-head@freebsd.org Sun Oct 21 14:19:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 165FBFF36E0; Sun, 21 Oct 2018 14:19:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B46468F46E; Sun, 21 Oct 2018 14:19:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A548E69FF; Sun, 21 Oct 2018 14:19:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LEJG2O060115; Sun, 21 Oct 2018 14:19:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LEJGej060114; Sun, 21 Oct 2018 14:19:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211419.w9LEJGej060114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 14:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339533 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 339533 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, 21 Oct 2018 14:19:17 -0000 Author: ae Date: Sun Oct 21 14:19:16 2018 New Revision: 339533 URL: https://svnweb.freebsd.org/changeset/base/339533 Log: Add sadb_x_sa2 extension to SADB_ACQUIRE requests. SADB_ACQUIRE requests are send by kernel, when security policy doesn't have corresponding security association for outbound packet. IKE daemon usually registers its handler for such messages and when the kernel asks for SA it can handle this request. Now such requests will contain additional fields that can help IKE daemon to create SA. And IKE now can create SAs using only information from SADB_ACQUIRE request, this is useful when many if_ipsec(4) interfaces are in use and IKE doesn track security policies that was installed by kernel. Obtained from: Yandex LLC MFC after: 3 weeks Sponsored by: Yandex LLC Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sun Oct 21 12:39:00 2018 (r339532) +++ head/sys/netipsec/key.c Sun Oct 21 14:19:16 2018 (r339533) @@ -6685,7 +6685,9 @@ key_acquire(const struct secasindex *saidx, struct sec /* XXX proxy address (optional) */ - /* set sadb_x_policy */ + /* + * Set sadb_x_policy. This is KAME extension to RFC2367. + */ if (sp != NULL) { m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id, sp->priority); @@ -6696,6 +6698,18 @@ key_acquire(const struct secasindex *saidx, struct sec m_cat(result, m); } + /* + * Set sadb_x_sa2 extension if saidx->reqid is not zero. + * This is FreeBSD extension to RFC2367. + */ + if (saidx->reqid != 0) { + m = key_setsadbxsa2(saidx->mode, 0, saidx->reqid); + if (m == NULL) { + error = ENOBUFS; + goto fail; + } + m_cat(result, m); + } /* XXX identity (optional) */ #if 0 if (idexttype && fqdn) { From owner-svn-src-head@freebsd.org Sun Oct 21 14:40:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A2EFF4626; Sun, 21 Oct 2018 14:40:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B5119048E; Sun, 21 Oct 2018 14:40:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 561686D47; Sun, 21 Oct 2018 14:40:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LEekKa071562; Sun, 21 Oct 2018 14:40:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LEekNc071561; Sun, 21 Oct 2018 14:40:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211440.w9LEekNc071561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 14:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339535 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 339535 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, 21 Oct 2018 14:40:46 -0000 Author: ae Date: Sun Oct 21 14:40:45 2018 New Revision: 339535 URL: https://svnweb.freebsd.org/changeset/base/339535 Log: Do not allow use `create` keyword as hostname when ifconfig(8) is invoked for already existing interface. It appeared, that ifconfig(8) assumes `create` keyword as hostname and tries to resolve it, when `ifconfig ifname create` invoked for already existing interface. This can produce some unexpected results, when hostname resolving has successfully happened. This patch adds check for such case. When an interface is already exists, and create is only one argument, return error message. But when there are some other arguments, just remove create keyword from the arguments list. Obtained from: Yandex LLC MFC after: 3 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17171 Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sun Oct 21 14:23:56 2018 (r339534) +++ head/sbin/ifconfig/ifconfig.c Sun Oct 21 14:40:45 2018 (r339535) @@ -504,6 +504,18 @@ main(int argc, char *argv[]) } #endif errx(1, "interface %s does not exist", ifname); + } else { + /* + * Do not allow use `create` command as hostname if + * address family is not specified. + */ + if (argc > 0 && (strcmp(argv[0], "create") == 0 || + strcmp(argv[0], "plumb") == 0)) { + if (argc == 1) + errx(1, "interface %s already exist", + ifname); + argc--, argv++; + } } } From owner-svn-src-head@freebsd.org Sun Oct 21 15:01:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A6CFF582A; Sun, 21 Oct 2018 15:01:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 8AA6291662; Sun, 21 Oct 2018 15:01:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9LF0xfQ005429; Sun, 21 Oct 2018 08:00:59 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9LF0xXs005428; Sun, 21 Oct 2018 08:00:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810211500.w9LF0xXs005428@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys In-Reply-To: To: Jan Beich Date: Sun, 21 Oct 2018 08:00:59 -0700 (PDT) CC: Dimitry Andric , Glen Barber , src-committers , 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-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, 21 Oct 2018 15:01:03 -0000 > Dimitry Andric writes: > > > On 21 Oct 2018, at 04:08, Jan Beich wrote: > > > >> > >> Glen Barber writes: > >> > >>> Modified: head/lib/clang/llvm.build.mk > >>> ============================================================================== > >>> --- head/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 (r339435) > >>> +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 (r339436) > >>> @@ -17,7 +17,7 @@ CFLAGS+= -I${LLVM_SRCS}/include > >>> CFLAGS+= -DLLVM_BUILD_GLOBAL_ISEL > >>> CFLAGS+= -D__STDC_LIMIT_MACROS > >>> CFLAGS+= -D__STDC_CONSTANT_MACROS > >>> -#CFLAGS+= -DNDEBUG > >>> +CFLAGS+= -DNDEBUG > >> > >> Would Clang still hit asserts instead of crashing with cryptic messages? > > > > In llvm, assertions (and various other internal consistency checks) are > > turned off by defining NDEBUG. So indeed, if something in the internal > > state goes in an unexpected direction, you could get crashes or other > > "interesting" effects. > > > > That said, the resulting executable(s) should run somewhat faster, and > > be somewhat smaller. I think we have always done this for stable > > branches and releases. > > But this commit is for -CURRENT, not -STABLE or -RELEASE. With hat RE: It looks like this should be on the list of RE@ "Stable Branch Creation" check/change list that gets done by RE@ when a stable branch is created so that it is a early commit post branch and not a head commit that is merged post branch. I have forwarded a copy of this issue to internel re@ mail and we whall deal with it for stable/12 as an RE(implicit) commit, and this should probably be reverted from ^head at your descrition. Thanks, Rod > $ svn cat svn://svn.freebsd.org/base/stable/12/lib/clang/llvm.build.mk | fgrep NDEBUG ~ > #CFLAGS+= -DNDEBUG > > $ svn cat svn://svn.freebsd.org/base/releng/11.2/lib/clang/llvm.build.mk | fgrep NDEBUG > CFLAGS+= -DNDEBUG > > > > > If users encounter such crashes, it will still write reproduction files > > (self-contained .c or .cpp file and a shell script), so those can be > > included in bug reports, and run on a copy of clang with assertions. > > > > -Dimitry -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Oct 21 15:02:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5266FF5A2C; Sun, 21 Oct 2018 15:02:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD2991995; Sun, 21 Oct 2018 15:02:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66B7D722A; Sun, 21 Oct 2018 15:02:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LF276F085623; Sun, 21 Oct 2018 15:02:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LF26iJ084793; Sun, 21 Oct 2018 15:02:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211502.w9LF26iJ084793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 15:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339537 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 339537 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, 21 Oct 2018 15:02:07 -0000 Author: ae Date: Sun Oct 21 15:02:06 2018 New Revision: 339537 URL: https://svnweb.freebsd.org/changeset/base/339537 Log: Add ifaddr_event_ext event. It is similar to ifaddr_event, but the handler receives the type of event IFADDR_EVENT_ADD/IFADDR_EVENT_DEL, and the pointer to ifaddr. Also ifaddr_event now is implemented using ifaddr_event_ext handler. MFC after: 3 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17100 Modified: head/share/man/man9/EVENTHANDLER.9 head/sys/net/if.c head/sys/net/if_var.h head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Sun Oct 21 14:48:40 2018 (r339536) +++ head/share/man/man9/EVENTHANDLER.9 Sun Oct 21 15:02:06 2018 (r339537) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd September 6, 2018 +.Dd October 21, 2018 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -298,6 +298,8 @@ Callback invoked when an change has been made to an in Callback invoked when an interfance has been removed from an interface group. .It Vt ifaddr_event Callbacks invoked when an address is set up on a network interface. +.It Vt ifaddr_event_ext +Callback invoked when an address has been added or removed from an interface. .It Vt if_clone_event Callbacks invoked when an interface is cloned. .It Vt iflladdr_event Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Oct 21 14:48:40 2018 (r339536) +++ head/sys/net/if.c Sun Oct 21 15:02:06 2018 (r339537) @@ -328,6 +328,18 @@ static MALLOC_DEFINE(M_IFNET, "ifnet", "interface inte MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); +/* + * Support for old ifaddr_event. + */ +static void +ifaddr_event_compat(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa __unused, int event __unused) +{ + + EVENTHANDLER_INVOKE(ifaddr_event, ifp); +} +EVENTHANDLER_DEFINE(ifaddr_event_ext, ifaddr_event_compat, NULL, 0); + struct ifnet * ifnet_byindex_locked(u_short idx) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Oct 21 14:48:40 2018 (r339536) +++ head/sys/net/if_var.h Sun Oct 21 15:02:06 2018 (r339537) @@ -432,6 +432,11 @@ EVENTHANDLER_DECLARE(iflladdr_event, iflladdr_event_ha /* interface address change event */ typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); +typedef void (*ifaddr_event_ext_handler_t)(void *, struct ifnet *, + struct ifaddr *, int); +EVENTHANDLER_DECLARE(ifaddr_event_ext, ifaddr_event_ext_handler_t); +#define IFADDR_EVENT_ADD 0 +#define IFADDR_EVENT_DEL 1 /* new interface arrival event */ typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Oct 21 14:48:40 2018 (r339536) +++ head/sys/netinet/in.c Sun Oct 21 15:02:06 2018 (r339537) @@ -520,7 +520,12 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne &ii->ii_allhosts); } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + /* + * Note: we don't need extra reference for ifa, since we called + * with sx lock held, and ifaddr can not be deleted in concurrent + * thread. + */ + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, ifa, IFADDR_EVENT_ADD); return (error); @@ -643,7 +648,8 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne } IF_ADDR_WUNLOCK(ifp); - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_DEL); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ return (0); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Oct 21 14:48:40 2018 (r339536) +++ head/sys/netinet6/in6.c Sun Oct 21 15:02:06 2018 (r339537) @@ -712,7 +712,8 @@ aifaddr_out: ND6_WUNLOCK(); nd6_prefix_del(pr); } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_DEL); break; } @@ -1456,7 +1457,10 @@ done: WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "Invoking IPv6 network device address event may sleep"); - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + ifa_ref(&ia->ia_ifa); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_ADD); + ifa_free(&ia->ia_ifa); return (error); } From owner-svn-src-head@freebsd.org Sun Oct 21 15:11:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F5BDFF5E3B; Sun, 21 Oct 2018 15:11:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF7F9206A; Sun, 21 Oct 2018 15:11:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B04972AE; Sun, 21 Oct 2018 15:11:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LFAxcV089699; Sun, 21 Oct 2018 15:10:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LFAxJq089697; Sun, 21 Oct 2018 15:10:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211510.w9LFAxJq089697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 15:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339539 - in head: sbin/ipfw sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 339539 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, 21 Oct 2018 15:11:00 -0000 Author: ae Date: Sun Oct 21 15:10:59 2018 New Revision: 339539 URL: https://svnweb.freebsd.org/changeset/base/339539 Log: Add IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule, that was added using "new rule format". And then, when the kernel returns rule with this flag, ipfw(8) can correctly show it. Reported by: lev MFC after: 3 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17373 Modified: head/sbin/ipfw/ipfw2.c head/sys/netinet/ip_fw.h Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Oct 21 15:09:42 2018 (r339538) +++ head/sbin/ipfw/ipfw2.c Sun Oct 21 15:10:59 2018 (r339539) @@ -2207,6 +2207,12 @@ show_static_rule(struct cmdline_opts *co, struct forma */ if (co->comment_only != 0) goto end; + + if (rule->flags & IPFW_RULE_JUSTOPTS) { + state.flags |= HAVE_PROTO | HAVE_SRCIP | HAVE_DSTIP; + goto justopts; + } + print_proto(bp, fo, &state); /* Print source */ @@ -2219,6 +2225,7 @@ show_static_rule(struct cmdline_opts *co, struct forma print_address(bp, fo, &state, dst_opcodes, nitems(dst_opcodes), O_IP_DSTPORT, HAVE_DSTIP); +justopts: /* Print the rest of options */ while (print_opcode(bp, fo, &state, -1)) ; @@ -4340,8 +4347,10 @@ chkarg: } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); - } else + } else { + rule->flags |= IPFW_RULE_JUSTOPTS; goto read_options; + } OR_BLOCK(get_proto); /* Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Sun Oct 21 15:09:42 2018 (r339538) +++ head/sys/netinet/ip_fw.h Sun Oct 21 15:10:59 2018 (r339539) @@ -615,6 +615,7 @@ struct ip_fw_rule { ipfw_insn cmd[1]; /* storage for commands */ }; #define IPFW_RULE_NOOPT 0x01 /* Has no options in body */ +#define IPFW_RULE_JUSTOPTS 0x02 /* new format of rule body */ /* Unaligned version */ From owner-svn-src-head@freebsd.org Sun Oct 21 16:04:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01BDEFF7EAC; Sun, 21 Oct 2018 16:04:18 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F60E94018; Sun, 21 Oct 2018 16:04:17 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 510AB1C24D; Sun, 21 Oct 2018 16:04:17 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Sun, 21 Oct 2018 16:04:15 +0000 From: Glen Barber To: Dimitry Andric Cc: Jan Beich , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys Message-ID: <20181021160415.GD13668@FreeBSD.org> References: <201810190037.w9J0blks031617@repo.freebsd.org> <20181021154520.GB13668@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PPYy/fEw/8QCHSq3" Content-Disposition: inline In-Reply-To: <20181021154520.GB13668@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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, 21 Oct 2018 16:04:18 -0000 --PPYy/fEw/8QCHSq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 21, 2018 at 03:45:20PM +0000, Glen Barber wrote: > On Sun, Oct 21, 2018 at 11:55:20AM +0200, Dimitry Andric wrote: > > On 21 Oct 2018, at 04:08, Jan Beich wrote: > > >=20 > > > Glen Barber writes: > > >=20 > > >> Modified: head/lib/clang/llvm.build.mk > > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=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/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 (r339435) > > >> +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 (r339436) > > >> @@ -17,7 +17,7 @@ CFLAGS+=3D -I${LLVM_SRCS}/include > > >> CFLAGS+=3D -DLLVM_BUILD_GLOBAL_ISEL > > >> CFLAGS+=3D -D__STDC_LIMIT_MACROS > > >> CFLAGS+=3D -D__STDC_CONSTANT_MACROS > > >> -#CFLAGS+=3D -DNDEBUG > > >> +CFLAGS+=3D -DNDEBUG > > >=20 > > > Would Clang still hit asserts instead of crashing with cryptic messag= es? > >=20 > > In llvm, assertions (and various other internal consistency checks) are > > turned off by defining NDEBUG. So indeed, if something in the internal > > state goes in an unexpected direction, you could get crashes or other > > "interesting" effects. > >=20 > > That said, the resulting executable(s) should run somewhat faster, and > > be somewhat smaller. I think we have always done this for stable > > branches and releases. > >=20 >=20 > I think I screwed up, and changed this in the wrong branch. I'm looking > into the "why", but the commit to head in this case should be reverted > (I'll take care of it if it was not already done), and this particular > change should be applied to stable/12 (which I will also take care of). > I first want to look through our docs to understand how I messed this > up. >=20 Ok, reverted in head as of r339541, and the commit to apply the change to stable/12 is sent to re@ for approval. Glen --PPYy/fEw/8QCHSq3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlvMo38ACgkQAxRYpUeP 4pMNJg/+PsEegAg3ctENiVnouQ3BNQaCZ+ev984qSf+THdBfR1PSZI9wimc3PryK Ma0jtZVx/q5ZhnNkTnSIRNwG8WRGuwCn3ep3r6DzkMcmD+KGdi54R0JRPOI5buH6 7iJk4mB9lMM3XikqjhuIYO79mtvxPIrZHHY0wXZpI5kxUTMIqj0vE29h1UnUj4GK o3c9jUWlOAwVS52J3oTDhFlZuyvWvkPePhAKyoXAmJndOuZLIKXsZbE6wXgK1GhX LLCJIIA4Ldw/iocNMWv2vAZdiC7yS+6ccJXUmAG5G2OX0gYAuLnbFUohUuNj87Ax 0A53SGGxzYGjnOXfToYJsZ+eT1Rcv4n3P2CFHMwAaPZjfNiys1bZ7USYYmVEszIQ 8gD6GXt7HO1BbcEux3KPtaboSN2a2jZiDnG8OYPNZnIDwGmerzcC5bh01p49SrJO ydHnqoA6rOXqc4du+p5c0DhYYrgfVWXCr7QXWZIhoN+L5LQKxWVFTrwoFiW78rmo HNiLvn2R6z1LASfJJ0ruZy/7Q/ek1et1WAhfGBUdH0OXW8q+xrH6QFp6E8c8Uy8H YS68Dp4CpK1fLYdQCpNa1A9IAzFuTma+1npwkbWTXCp9sPg8JcBCdMZhdmPVP454 XuP3+zGWXwNMTH0EZrIjl7/SPIEqvLWM4W7aG9rQv4TT+NXwzfU= =Yd9J -----END PGP SIGNATURE----- --PPYy/fEw/8QCHSq3-- From owner-svn-src-head@freebsd.org Sun Oct 21 16:29:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DBBDFF9787; Sun, 21 Oct 2018 16:29:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23A3D95264; Sun, 21 Oct 2018 16:29:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A1277FA0; Sun, 21 Oct 2018 16:29:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LGTD9J027781; Sun, 21 Oct 2018 16:29:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LGTClk027775; Sun, 21 Oct 2018 16:29:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211629.w9LGTClk027775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 16:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339542 - in head: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/conf sys/modules/ipfw_nat64 sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 339542 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, 21 Oct 2018 16:29:14 -0000 Author: ae Date: Sun Oct 21 16:29:12 2018 New Revision: 339542 URL: https://svnweb.freebsd.org/changeset/base/339542 Log: Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability to switch the output method in run-time. Also document some sysctl variables that can by changed for NAT64 module. NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use if_output directly from nat64 module. By default is used netisr based output method. Now both methods can be used, but they require different handling by rules. Obtained from: Yandex LLC MFC after: 3 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D16647 Modified: head/sbin/ipfw/ipfw.8 head/sys/conf/options head/sys/modules/ipfw_nat64/Makefile head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c head/sys/netpfil/ipfw/nat64/nat64_translate.c head/sys/netpfil/ipfw/nat64/nat64_translate.h Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sun Oct 21 15:54:38 2018 (r339541) +++ head/sbin/ipfw/ipfw.8 Sun Oct 21 16:29:12 2018 (r339542) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2018 +.Dd October 21, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -3289,9 +3289,14 @@ Make sure that ND6 neighbor solicitation (ICMPv6 type advertisement (ICMPv6 type 136) messages will not be handled by translation rules. .Pp -After translation NAT64 translator sends packets through corresponding netisr -queue. +After translation NAT64 translator by default sends packets through +corresponding netisr queue. Thus translator host should be configured as IPv4 and IPv6 router. +Also this means, that a packet is handled by firewall twice. +First time an original packet is handled and consumed by translator, +and then it is handled again as translated packet. +This behavior can be changed by sysctl variable +.Va net.inet.ip.fw.nat64_direct_output . .Pp The stateful NAT64 configuration command is the following: .Bd -ragged -offset indent @@ -3914,6 +3919,41 @@ Default is no. Controls whether bridged packets are passed to .Nm . Default is no. +.It Va net.inet.ip.fw.nat64_allow_private : No 0 +Defines how +.Nm nat64 +handles private IPv4 addresses: +.Bl -tag -width indent +.It Cm 0 +Packets with private IPv4 will not be handled by translator +.It Cm 1 +Translator will accept and process packets with private IPv4 addresses. +.El +.It Va net.inet.ip.fw.nat64_debug : No 0 +Controls debugging messages produced by +.Nm ipfw_nat64 +module. +.It Va net.inet.ip.fw.nat64_direct_output : No 0 +Controls the output method used by +.Nm ipfw_nat64 +module: +.Bl -tag -width indent +.It Cm 0 +A packet is handled by +.Nm ipfw +twice. +First time an original packet is handled by +.Nm ipfw +and consumed by +.Nm ipfw_nat64 +translator. +Then translated packet is queued via netisr to input processing again. +.It Cm 1 +A packet is handled by +.Nm ipfw +only once, and after translation it will be pushed directly to outgoing +interface. +.El .El .Sh INTERNAL DIAGNOSTICS There are some commands that may be useful to understand current state Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Oct 21 15:54:38 2018 (r339541) +++ head/sys/conf/options Sun Oct 21 16:29:12 2018 (r339542) @@ -439,7 +439,6 @@ IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h IPFIREWALL_NAT64 opt_ipfw.h -IPFIREWALL_NAT64_DIRECT_OUTPUT opt_ipfw.h IPFIREWALL_NPTV6 opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h Modified: head/sys/modules/ipfw_nat64/Makefile ============================================================================== --- head/sys/modules/ipfw_nat64/Makefile Sun Oct 21 15:54:38 2018 (r339541) +++ head/sys/modules/ipfw_nat64/Makefile Sun Oct 21 16:29:12 2018 (r339542) @@ -6,8 +6,5 @@ KMOD= ipfw_nat64 SRCS= ip_fw_nat64.c nat64_translate.c SRCS+= nat64lsn.c nat64lsn_control.c SRCS+= nat64stl.c nat64stl_control.c -SRCS+= opt_ipfw.h - -#CFLAGS+= -DIPFIREWALL_NAT64_DIRECT_OUTPUT .include Modified: head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sun Oct 21 15:54:38 2018 (r339541) +++ head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c Sun Oct 21 16:29:12 2018 (r339542) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include "ip_fw_nat64.h" +#include "nat64_translate.h" VNET_DEFINE(int, nat64_debug) = 0; VNET_DEFINE(int, nat64_allow_private) = 0; @@ -56,8 +57,26 @@ SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_debug, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_debug), 0, "Debug level for NAT64 module"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, nat64_allow_private, - CTLFLAG_VNET |CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nat64_allow_private), 0, "Allow use of non-global IPv4 addresses with NAT64"); + +static int +sysctl_direct_output(SYSCTL_HANDLER_ARGS) +{ + uint32_t value; + int error; + + value = nat64_get_output_method(); + error = sysctl_handle_32(oidp, &value, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + nat64_set_output_method(value); + return (0); +} +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, nat64_direct_output, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_direct_output, "IU", + "Use if_output directly instead of deffered netisr-based processing"); static int vnet_ipfw_nat64_init(const void *arg __unused) Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Sun Oct 21 15:54:38 2018 (r339541) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Sun Oct 21 16:29:12 2018 (r339542) @@ -25,8 +25,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_ipfw.h" - #include __FBSDID("$FreeBSD$"); @@ -71,6 +69,53 @@ __FBSDID("$FreeBSD$"); #include "ip_fw_nat64.h" #include "nat64_translate.h" + +typedef int (*nat64_output_t)(struct ifnet *, struct mbuf *, + struct sockaddr *, struct nat64_counters *, void *); +typedef int (*nat64_output_one_t)(struct mbuf *, struct nat64_counters *, + void *); + +static int nat64_find_route4(struct nhop4_basic *, struct sockaddr_in *, + struct mbuf *); +static int nat64_find_route6(struct nhop6_basic *, struct sockaddr_in6 *, + struct mbuf *); +static int nat64_output_one(struct mbuf *, struct nat64_counters *, void *); +static int nat64_output(struct ifnet *, struct mbuf *, struct sockaddr *, + struct nat64_counters *, void *); +static int nat64_direct_output_one(struct mbuf *, struct nat64_counters *, + void *); +static int nat64_direct_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct nat64_counters *, void *); + +struct nat64_methods { + nat64_output_t output; + nat64_output_one_t output_one; +}; +static const struct nat64_methods nat64_netisr = { + .output = nat64_output, + .output_one = nat64_output_one +}; +static const struct nat64_methods nat64_direct = { + .output = nat64_direct_output, + .output_one = nat64_direct_output_one +}; +VNET_DEFINE_STATIC(const struct nat64_methods *, nat64out) = &nat64_netisr; +#define V_nat64out VNET(nat64out) + +void +nat64_set_output_method(int direct) +{ + + V_nat64out = direct != 0 ? &nat64_direct: &nat64_netisr; +} + +int +nat64_get_output_method(void) +{ + + return (V_nat64out == &nat64_direct ? 1: 0); +} + static void nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa_family_t family) { @@ -80,14 +125,8 @@ nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m); } -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT -static NAT64NOINLINE int nat64_find_route4(struct nhop4_basic *, - struct sockaddr_in *, struct mbuf *); -static NAT64NOINLINE int nat64_find_route6(struct nhop6_basic *, - struct sockaddr_in6 *, struct mbuf *); - -static NAT64NOINLINE int -nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +static int +nat64_direct_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { int error; @@ -100,8 +139,9 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (error); } -static NAT64NOINLINE int -nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) +static int +nat64_direct_output_one(struct mbuf *m, struct nat64_counters *stats, + void *logdata) { struct nhop6_basic nh6; struct nhop4_basic nh4; @@ -153,8 +193,8 @@ nat64_output_one(struct mbuf *m, struct nat64_counters NAT64STAT_INC(stats, oerrors); return (error); } -#else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ -static NAT64NOINLINE int + +static int nat64_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct nat64_counters *stats, void *logdata) { @@ -185,13 +225,12 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, struct return (ret); } -static NAT64NOINLINE int +static int nat64_output_one(struct mbuf *m, struct nat64_counters *stats, void *logdata) { return (nat64_output(NULL, m, NULL, stats, logdata)); } -#endif /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ /* * Check the given IPv6 prefix and length according to RFC6052: @@ -424,12 +463,10 @@ nat64_init_ip4hdr(const struct ip6_hdr *ip6, const str ip->ip_hl = sizeof(*ip) >> 2; ip->ip_tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip->ip_len = htons(sizeof(*ip) + plen); -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip->ip_ttl = ip6->ip6_hlim - IPV6_HLIMDEC; -#else - /* Forwarding code will decrement TTL. */ ip->ip_ttl = ip6->ip6_hlim; -#endif + /* Forwarding code will decrement TTL for netisr based output. */ + if (V_nat64out == &nat64_direct) + ip->ip_ttl -= IPV6_HLIMDEC; ip->ip_sum = 0; ip->ip_p = (proto == IPPROTO_ICMPV6) ? IPPROTO_ICMP: proto; ip_fillid(ip); @@ -647,7 +684,7 @@ nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint icmp6->icmp6_cksum = in6_cksum(n, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), plen); m_freem(m); - nat64_output_one(n, stats, logdata); + V_nat64out->output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -750,7 +787,7 @@ nat64_icmp_reflect(struct mbuf *m, uint8_t type, icmp->icmp_cksum = in_cksum_skip(n, sizeof(struct ip) + plen, sizeof(struct ip)); m_freem(m); - nat64_output_one(n, stats, logdata); + V_nat64out->output_one(n, stats, logdata); return; freeit: NAT64STAT_INC(stats, dropped); @@ -1167,12 +1204,10 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_flow = htonl(ip->ip_tos << 20); ip6.ip6_vfc |= IPV6_VERSION; -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip6.ip6_hlim = ip->ip_ttl - IPTTLDEC; -#else - /* Forwarding code will decrement HLIM. */ ip6.ip6_hlim = ip->ip_ttl; -#endif + /* Forwarding code will decrement TTL for netisr based output. */ + if (V_nat64out == &nat64_direct) + ip6.ip6_hlim -= IPTTLDEC; ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; /* Convert checksums. */ @@ -1205,7 +1240,7 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s mbufq_init(&mq, 255); nat64_fragment6(&cfg->stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); while ((m = mbufq_dequeue(&mq)) != NULL) { - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) != 0) break; NAT64STAT_INC(&cfg->stats, opcnt46); @@ -1415,9 +1450,8 @@ nat64_handle_icmp6(struct mbuf *m, int hlen, uint32_t ip.ip_dst.s_addr = aaddr; ip.ip_src.s_addr = nat64_extract_ip4(cfg, &ip6i->ip6_src); /* XXX: Make fake ulp header */ -#ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT - ip6i->ip6_hlim += IPV6_HLIMDEC; /* init_ip4hdr will decrement it */ -#endif + if (V_nat64out == &nat64_direct) /* init_ip4hdr will decrement it */ + ip6i->ip6_hlim += IPV6_HLIMDEC; nat64_init_ip4hdr(ip6i, ip6f, plen, proto, &ip); m_adj(m, hlen - sizeof(struct ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); @@ -1587,7 +1621,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui m_adj(m, hlen - sizeof(ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + if (V_nat64out->output(nh.nh_ifp, m, (struct sockaddr *)&dst, &cfg->stats, logdata) == 0) NAT64STAT_INC(&cfg->stats, opcnt64); return (NAT64RETURN); Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.h ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.h Sun Oct 21 15:54:38 2018 (r339541) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.h Sun Oct 21 16:29:12 2018 (r339542) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2015-2016 Yandex LLC - * Copyright (c) 2015-2016 Andrey V. Elsukov + * Copyright (c) 2015-2018 Yandex LLC + * Copyright (c) 2015-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,6 +141,9 @@ void nat64_embed_ip4(const struct nat64_config *cfg, i struct in6_addr *ip6); in_addr_t nat64_extract_ip4(const struct nat64_config *cfg, const struct in6_addr *ip6); + +void nat64_set_output_method(int); +int nat64_get_output_method(void); #endif From owner-svn-src-head@freebsd.org Sun Oct 21 15:43:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E143FFF7171; Sun, 21 Oct 2018 15:43:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96BC09311A; Sun, 21 Oct 2018 15:43:21 +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 9184378EE; Sun, 21 Oct 2018 15:43:21 +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 w9LFhLn2006982; Sun, 21 Oct 2018 15:43:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LFhKDM006977; Sun, 21 Oct 2018 15:43:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810211543.w9LFhKDM006977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 21 Oct 2018 15:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339540 - in head/sys: conf dev/virtio/mmio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: conf dev/virtio/mmio X-SVN-Commit-Revision: 339540 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, 21 Oct 2018 15:43:22 -0000 Author: andrew Date: Sun Oct 21 15:43:20 2018 New Revision: 339540 URL: https://svnweb.freebsd.org/changeset/base/339540 Log: Split out the virtio mmio FDT attachment and add an ACPI attachment. This allows the memory mapped I/O virtio driver to attach when we boot with ACPI tables, for example in some cases with QEMU emulating arm64. MFC after: 1 month Added: head/sys/dev/virtio/mmio/virtio_mmio_acpi.c (contents, props changed) head/sys/dev/virtio/mmio/virtio_mmio_fdt.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/virtio/mmio/virtio_mmio.c head/sys/dev/virtio/mmio/virtio_mmio.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 21 15:10:59 2018 (r339539) +++ head/sys/conf/files Sun Oct 21 15:43:20 2018 (r339540) @@ -3430,8 +3430,10 @@ dev/virtio/virtqueue.c optional virtio dev/virtio/virtio_bus_if.m optional virtio dev/virtio/virtio_if.m optional virtio dev/virtio/pci/virtio_pci.c optional virtio_pci -dev/virtio/mmio/virtio_mmio.c optional virtio_mmio fdt -dev/virtio/mmio/virtio_mmio_if.m optional virtio_mmio fdt +dev/virtio/mmio/virtio_mmio.c optional virtio_mmio +dev/virtio/mmio/virtio_mmio_acpi.c optional virtio_mmio acpi +dev/virtio/mmio/virtio_mmio_fdt.c optional virtio_mmio fdt +dev/virtio/mmio/virtio_mmio_if.m optional virtio_mmio dev/virtio/network/if_vtnet.c optional vtnet dev/virtio/block/virtio_blk.c optional virtio_blk dev/virtio/balloon/virtio_balloon.c optional virtio_balloon Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Sun Oct 21 15:10:59 2018 (r339539) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Sun Oct 21 15:43:20 2018 (r339540) @@ -37,16 +37,6 @@ * This driver is heavily based on VirtIO PCI interface driver. */ -/* - * FDT example: - * virtio_block@1000 { - * compatible = "virtio,mmio"; - * reg = <0x1000 0x100>; - * interrupts = <63>; - * interrupt-parent = <&GIC>; - * }; - */ - #include __FBSDID("$FreeBSD$"); @@ -61,11 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include - #include #include #include @@ -81,25 +66,6 @@ struct vtmmio_virtqueue { int vtv_no_intr; }; -struct vtmmio_softc { - device_t dev; - device_t platform; - struct resource *res[2]; - - uint64_t vtmmio_features; - uint32_t vtmmio_flags; - - /* This "bus" will only ever have one child. */ - device_t vtmmio_child_dev; - struct virtio_feature_desc *vtmmio_child_feat_desc; - - int vtmmio_nvqs; - struct vtmmio_virtqueue *vtmmio_vqs; - void *ih; -}; - -static int vtmmio_probe(device_t); -static int vtmmio_attach(device_t); static int vtmmio_detach(device_t); static int vtmmio_suspend(device_t); static int vtmmio_resume(device_t); @@ -170,7 +136,6 @@ do { \ static device_method_t vtmmio_methods[] = { /* Device interface. */ - DEVMETHOD(device_probe, vtmmio_probe), DEVMETHOD(device_attach, vtmmio_attach), DEVMETHOD(device_detach, vtmmio_detach), DEVMETHOD(device_suspend, vtmmio_suspend), @@ -199,19 +164,10 @@ static device_method_t vtmmio_methods[] = { DEVMETHOD_END }; -static driver_t vtmmio_driver = { - "virtio_mmio", - vtmmio_methods, - sizeof(struct vtmmio_softc) -}; +DEFINE_CLASS_0(virtio_mmio, vtmmio_driver, vtmmio_methods, + sizeof(struct vtmmio_softc)); -devclass_t vtmmio_devclass; - -DRIVER_MODULE(virtio_mmio, simplebus, vtmmio_driver, vtmmio_devclass, 0, 0); -DRIVER_MODULE(virtio_mmio, ofwbus, vtmmio_driver, vtmmio_devclass, 0, 0); MODULE_VERSION(virtio_mmio, 1); -MODULE_DEPEND(virtio_mmio, simplebus, 1, 1, 1); -MODULE_DEPEND(virtio_mmio, virtio, 1, 1, 1); static int vtmmio_setup_intr(device_t dev, enum intr_type type) @@ -248,55 +204,7 @@ vtmmio_setup_intr(device_t dev, enum intr_type type) return (0); } -static int -vtmmio_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "virtio,mmio")) - return (ENXIO); - - device_set_desc(dev, "VirtIO MMIO adapter"); - return (BUS_PROBE_DEFAULT); -} - -static int -vtmmio_setup_platform(struct vtmmio_softc *sc) -{ - phandle_t platform_node; - struct fdt_ic *ic; - phandle_t xref; - phandle_t node; - - sc->platform = NULL; - - if ((node = ofw_bus_get_node(sc->dev)) == -1) - return (ENXIO); - - if (OF_searchencprop(node, "platform", &xref, - sizeof(xref)) == -1) { - return (ENXIO); - } - - platform_node = OF_node_from_xref(xref); - - SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { - if (ic->iph == platform_node) { - sc->platform = ic->dev; - break; - } - } - - if (sc->platform == NULL) { - /* No platform-specific device. Ignore it. */ - } - - return (0); -} - -static int +int vtmmio_attach(device_t dev) { struct vtmmio_softc *sc; @@ -305,8 +213,6 @@ vtmmio_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - - vtmmio_setup_platform(sc); rid = 0; sc->res[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, Modified: head/sys/dev/virtio/mmio/virtio_mmio.h ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.h Sun Oct 21 15:10:59 2018 (r339539) +++ head/sys/dev/virtio/mmio/virtio_mmio.h Sun Oct 21 15:43:20 2018 (r339540) @@ -33,6 +33,29 @@ #ifndef _VIRTIO_MMIO_H #define _VIRTIO_MMIO_H +DECLARE_CLASS(vtmmio_driver); + +struct vtmmio_virtqueue; + +struct vtmmio_softc { + device_t dev; + device_t platform; + struct resource *res[2]; + + uint64_t vtmmio_features; + uint32_t vtmmio_flags; + + /* This "bus" will only ever have one child. */ + device_t vtmmio_child_dev; + struct virtio_feature_desc *vtmmio_child_feat_desc; + + int vtmmio_nvqs; + struct vtmmio_virtqueue *vtmmio_vqs; + void *ih; +}; + +int vtmmio_attach(device_t); + #define VIRTIO_MMIO_MAGIC_VALUE 0x000 #define VIRTIO_MMIO_VERSION 0x004 #define VIRTIO_MMIO_DEVICE_ID 0x008 Added: head/sys/dev/virtio/mmio/virtio_mmio_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/mmio/virtio_mmio_acpi.c Sun Oct 21 15:43:20 2018 (r339540) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by Andrew Turner + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * VirtIO MMIO interface. + * This driver is heavily based on VirtIO PCI interface driver. + */ + +#include "opt_acpi.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int vtmmio_acpi_probe(device_t); + +static device_method_t vtmmio_acpi_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, vtmmio_acpi_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(virtio_mmio, vtmmio_acpi_driver, vtmmio_acpi_methods, + sizeof(struct vtmmio_softc), vtmmio_driver); + +static devclass_t vtmmio_acpi_devclass; + +DRIVER_MODULE(virtio_mmio, acpi, vtmmio_acpi_driver, vtmmio_acpi_devclass, 0,0); +MODULE_DEPEND(virtio_mmio, acpi, 1, 1, 1); + +static int +vtmmio_acpi_probe(device_t dev) +{ + ACPI_HANDLE h; + + if ((h = acpi_get_handle(dev)) == NULL) + return (ENXIO); + + if (!acpi_MatchHid(h, "LNRO0005")) + return (ENXIO); + + device_set_desc(dev, "VirtIO MMIO adapter"); + return (BUS_PROBE_DEFAULT); +} Added: head/sys/dev/virtio/mmio/virtio_mmio_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/mmio/virtio_mmio_fdt.c Sun Oct 21 15:43:20 2018 (r339540) @@ -0,0 +1,147 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by Andrew Turner + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * VirtIO MMIO interface. + * This driver is heavily based on VirtIO PCI interface driver. + */ + +/* + * FDT example: + * virtio_block@1000 { + * compatible = "virtio,mmio"; + * reg = <0x1000 0x100>; + * interrupts = <63>; + * interrupt-parent = <&GIC>; + * }; + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +static int vtmmio_fdt_probe(device_t); +static int vtmmio_fdt_attach(device_t); + +static device_method_t vtmmio_fdt_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, vtmmio_fdt_probe), + DEVMETHOD(device_attach, vtmmio_fdt_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(virtio_mmio, vtmmio_fdt_driver, vtmmio_fdt_methods, + sizeof(struct vtmmio_softc), vtmmio_driver); + +static devclass_t vtmmio_fdt_devclass; + +DRIVER_MODULE(virtio_mmio, simplebus, vtmmio_fdt_driver, vtmmio_fdt_devclass, + 0, 0); +DRIVER_MODULE(virtio_mmio, ofwbus, vtmmio_fdt_driver, vtmmio_fdt_devclass, 0,0); +MODULE_DEPEND(virtio_mmio, simplebus, 1, 1, 1); +MODULE_DEPEND(virtio_mmio, virtio, 1, 1, 1); + +static int +vtmmio_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "virtio,mmio")) + return (ENXIO); + + device_set_desc(dev, "VirtIO MMIO adapter"); + return (BUS_PROBE_DEFAULT); +} + +static int +vtmmio_setup_platform(device_t dev, struct vtmmio_softc *sc) +{ + phandle_t platform_node; + struct fdt_ic *ic; + phandle_t xref; + phandle_t node; + + sc->platform = NULL; + + if ((node = ofw_bus_get_node(dev)) == -1) + return (ENXIO); + + if (OF_searchencprop(node, "platform", &xref, + sizeof(xref)) == -1) { + return (ENXIO); + } + + platform_node = OF_node_from_xref(xref); + + SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { + if (ic->iph == platform_node) { + sc->platform = ic->dev; + break; + } + } + + if (sc->platform == NULL) { + /* No platform-specific device. Ignore it. */ + } + + return (0); +} + +static int +vtmmio_fdt_attach(device_t dev) +{ + struct vtmmio_softc *sc; + + sc = device_get_softc(dev); + vtmmio_setup_platform(dev, sc); + + return (vtmmio_attach(dev)); +} From owner-svn-src-head@freebsd.org Sun Oct 21 16:29:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11915FF97F6; Sun, 21 Oct 2018 16:29:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCC379538B; Sun, 21 Oct 2018 16:29:32 +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 B637D7FA1; Sun, 21 Oct 2018 16:29:32 +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 w9LGTWsu027837; Sun, 21 Oct 2018 16:29:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LGTWWD027836; Sun, 21 Oct 2018 16:29:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810211629.w9LGTWWD027836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 21 Oct 2018 16:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339543 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 339543 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, 21 Oct 2018 16:29:33 -0000 Author: imp Date: Sun Oct 21 16:29:32 2018 New Revision: 339543 URL: https://svnweb.freebsd.org/changeset/base/339543 Log: Remove stray fatm reference. Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- head/sys/conf/WITHOUT_SOURCELESS_UCODE Sun Oct 21 16:29:12 2018 (r339542) +++ head/sys/conf/WITHOUT_SOURCELESS_UCODE Sun Oct 21 16:29:32 2018 (r339543) @@ -6,7 +6,6 @@ nodevice adw nodevice bce -nodevice fatm nodevice fxp nodevice ispfw nodevice mwlfw From owner-svn-src-head@freebsd.org Sun Oct 21 16:37:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FE6DFF9BE0; Sun, 21 Oct 2018 16:37:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5447395818; Sun, 21 Oct 2018 16:37:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EBBB1015F; Sun, 21 Oct 2018 16:37:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LGbsns033060; Sun, 21 Oct 2018 16:37:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LGbsvH033059; Sun, 21 Oct 2018 16:37:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211637.w9LGbsvH033059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 16:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339544 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 339544 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, 21 Oct 2018 16:37:54 -0000 Author: ae Date: Sun Oct 21 16:37:53 2018 New Revision: 339544 URL: https://svnweb.freebsd.org/changeset/base/339544 Log: Call inet_ntop() only when its result is needed. Obtained from: Yandex LLC MFC after: 3 weeks Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn.c Sun Oct 21 16:29:32 2018 (r339543) +++ head/sys/netpfil/ipfw/nat64/nat64lsn.c Sun Oct 21 16:37:53 2018 (r339544) @@ -643,7 +643,6 @@ static NAT64NOINLINE int nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, struct nat64lsn_periodic_data *d) { - char a[INET6_ADDRSTRLEN]; struct nat64lsn_portgroup *pg; struct nat64lsn_job_item *ji; uint64_t delmask[NAT64LSN_PGPTRNMASK]; @@ -652,9 +651,13 @@ nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, delcount = 0; memset(delmask, 0, sizeof(delmask)); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); - DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", - stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + if (V_nat64_debug & DP_JQUEUE) { + char a[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); + DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", + stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + } if (!stale_nh(d->cfg, nh)) { /* Non-stale host. Inspect internals */ NAT64_LOCK(nh); @@ -1527,9 +1530,9 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i if (k++ > 1000) { DPRINTF(DP_ALL, "XXX: too long %d/%d %d/%d\n", sidx.idx, sidx.off, st->next.idx, st->next.off); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_GENERIC, "TR host %s %p on cpu %d", - a, nh, curcpu); + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)), + nh, curcpu); k = 0; } sidx = st->next; @@ -1542,10 +1545,10 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i /* No free states. Request more if we can */ if (nh->pg_used >= cfg->max_chunks) { /* Limit reached */ - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_DROPS, "PG limit reached " " for host %s (used %u, allocated %u, " - "limit %u)", a, + "limit %u)", inet_ntop(AF_INET6, + &nh->addr, a, sizeof(a)), nh->pg_used * NAT64_CHUNK_SIZE, nh->pg_allocated * NAT64_CHUNK_SIZE, cfg->max_chunks * NAT64_CHUNK_SIZE); From owner-svn-src-head@freebsd.org Sun Oct 21 16:44:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 257C8FF9EAD; Sun, 21 Oct 2018 16:44:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5CF495C15; Sun, 21 Oct 2018 16:44:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A242F102EF; Sun, 21 Oct 2018 16:44:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LGiv2f038053; Sun, 21 Oct 2018 16:44:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LGivOk038052; Sun, 21 Oct 2018 16:44:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211644.w9LGivOk038052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 16:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339545 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 339545 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, 21 Oct 2018 16:44:58 -0000 Author: ae Date: Sun Oct 21 16:44:57 2018 New Revision: 339545 URL: https://svnweb.freebsd.org/changeset/base/339545 Log: Do not decrement RST life time if keep_alive is not turned on. This allows use differen values configured by user for sysctl variable net.inet.ip.fw.dyn_rst_lifetime. Obtained from: Yandex LLC MFC after: 3 weeks Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Sun Oct 21 16:37:53 2018 (r339544) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Sun Oct 21 16:44:57 2018 (r339545) @@ -979,7 +979,8 @@ dyn_update_tcp_state(struct dyn_data *data, const stru break; default: - if (V_dyn_rst_lifetime >= V_dyn_keepalive_period) + if (V_dyn_keepalive != 0 && + V_dyn_rst_lifetime >= V_dyn_keepalive_period) V_dyn_rst_lifetime = V_dyn_keepalive_period - 1; expire = time_uptime + V_dyn_rst_lifetime; } From owner-svn-src-head@freebsd.org Sun Oct 21 16:49:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3143FFA081; Sun, 21 Oct 2018 16:49:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5524A96371; Sun, 21 Oct 2018 16:49:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502F4102F8; Sun, 21 Oct 2018 16:49:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LGnoR0039281; Sun, 21 Oct 2018 16:49:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LGno8G039280; Sun, 21 Oct 2018 16:49:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810211649.w9LGno8G039280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 21 Oct 2018 16:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339546 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339546 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, 21 Oct 2018 16:49:50 -0000 Author: imp Date: Sun Oct 21 16:49:49 2018 New Revision: 339546 URL: https://svnweb.freebsd.org/changeset/base/339546 Log: Remove stray refernce to pdq. Like the infamous twenty first of Johan Sebastian Bach's twenty children, it hasn't been seen in many years. Modified: head/sys/kern/Make.tags.inc Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Sun Oct 21 16:44:57 2018 (r339545) +++ head/sys/kern/Make.tags.inc Sun Oct 21 16:49:49 2018 (r339546) @@ -19,7 +19,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/dev/en/*.[ch] \ ${SYS}/dev/iicbus/*.[ch] \ ${SYS}/dev/isp/*.[ch] \ - ${SYS}/dev/pdq/*.[ch] \ ${SYS}/dev/ppbus/*.[ch] \ ${SYS}/dev/smbus/*.[ch] \ ${SYS}/dev/vx/*.[ch] \ @@ -78,7 +77,6 @@ COMMDIR2= ${SYS}/dev/advansys \ ${SYS}/dev/iicbus \ ${SYS}/dev/isp \ ${SYS}/dev/md \ - ${SYS}/dev/pdq \ ${SYS}/dev/ppbus \ ${SYS}/dev/smbus \ ${SYS}/dev/vx \ From owner-svn-src-head@freebsd.org Sun Oct 21 16:51:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F267FFA4E1; Sun, 21 Oct 2018 16:51:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24BB59713C; Sun, 21 Oct 2018 16:51:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE2E10452; Sun, 21 Oct 2018 16:51:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LGpaBa043856; Sun, 21 Oct 2018 16:51:36 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LGpZJr043855; Sun, 21 Oct 2018 16:51:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810211651.w9LGpZJr043855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 21 Oct 2018 16:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339547 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339547 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, 21 Oct 2018 16:51:36 -0000 Author: kp Date: Sun Oct 21 16:51:35 2018 New Revision: 339547 URL: https://svnweb.freebsd.org/changeset/base/339547 Log: vlan: Fix panic with lagg and vlan vlan_lladdr_fn() is called from taskqueue, which means there's no vnet context set. We can end up trying to send ARP messages (through the iflladdr_event event), which requires a vnet context. PR: 227654 MFC after: 3 days Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sun Oct 21 16:49:49 2018 (r339546) +++ head/sys/net/if_vlan.c Sun Oct 21 16:51:35 2018 (r339547) @@ -1302,8 +1302,13 @@ vlan_lladdr_fn(void *arg, int pending __unused) ifv = (struct ifvlan *)arg; ifp = ifv->ifv_ifp; + + CURVNET_SET(ifp->if_vnet); + /* The ifv_ifp already has the lladdr copied in. */ if_setlladdr(ifp, IF_LLADDR(ifp), ifp->if_addrlen); + + CURVNET_RESTORE(); } static int From owner-svn-src-head@freebsd.org Sun Oct 21 17:15:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C159FFB1AE; Sun, 21 Oct 2018 17:15:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C5370539; Sun, 21 Oct 2018 17:15:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 486CB107E7; Sun, 21 Oct 2018 17:15:10 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LHFAtB056692; Sun, 21 Oct 2018 17:15:10 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LHFATe056691; Sun, 21 Oct 2018 17:15:10 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810211715.w9LHFATe056691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 21 Oct 2018 17:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339548 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 339548 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, 21 Oct 2018 17:15:10 -0000 Author: vmaffione Date: Sun Oct 21 17:15:09 2018 New Revision: 339548 URL: https://svnweb.freebsd.org/changeset/base/339548 Log: man: fix vale(4) port naming The current documentation describing the syntax of a VALE port is wrong. This patch fixes it to make it consistent. Approved by: bcr, gnn (mentor) Differential Revision: https://reviews.freebsd.org/D17411 Modified: head/share/man/man4/vale.4 Modified: head/share/man/man4/vale.4 ============================================================================== --- head/share/man/man4/vale.4 Sun Oct 21 16:51:35 2018 (r339547) +++ head/share/man/man4/vale.4 Sun Oct 21 17:15:09 2018 (r339548) @@ -59,18 +59,18 @@ API. .Pp .Nm ports are named -.Pa vale[bdg:][port] +.Pa valeSSS:PPP where .Pa vale is the prefix indicating a VALE switch rather than a standard interface, -.Pa bdg +.Pa SSS indicates a specific switch (the colon is a separator), and -.Pa port +.Pa PPP indicates a port within the switch. -Bridge and port names are arbitrary strings, the only -constraint being that the full name must fit within 16 -characters. +Both SSS and PPP have the form [0-9a-zA-Z_]+ , the string cannot +exceed IFNAMSIZ characters, and PPP cannot be the name of any +existing OS network interface. .Pp See .Xr netmap 4 @@ -97,22 +97,20 @@ Set to non-zero values to enable in-kernel diagnostics Create one switch, with a traffic generator connected to one port, and a netmap-enabled tcpdump instance on another port: .Bd -literal -offset indent -tcpdump -ni vale-a:1 & -pkt-gen -i vale-a:0 -f tx & +tcpdump -ni valea:1 & +pkt-gen -i valea:0 -f tx & .Ed .Pp Create two switches, each connected to two qemu machines on different ports. .Bd -literal -offset indent -qemu -net nic -net netmap,ifname=vale-1:a ... & -qemu -net nic -net netmap,ifname=vale-1:b ... & -qemu -net nic -net netmap,ifname=vale-2:c ... & -qemu -net nic -net netmap,ifname=vale-2:d ... & +qemu -net nic -net netmap,ifname=vale1:a ... & +qemu -net nic -net netmap,ifname=vale1:b ... & +qemu -net nic -net netmap,ifname=vale2:c ... & +qemu -net nic -net netmap,ifname=vale2:d ... & .Ed .Sh SEE ALSO .Xr netmap 4 -.Pp -.Xr http://info.iet.unipi.it/~luigi/vale/ .Pp Luigi Rizzo, Giuseppe Lettieri: VALE, a switched ethernet for virtual machines, June 2012, http://info.iet.unipi.it/~luigi/vale/ From owner-svn-src-head@freebsd.org Sun Oct 21 17:55:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD621FFC502; Sun, 21 Oct 2018 17:55:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5177471FE2; Sun, 21 Oct 2018 17:55:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4673510E60; Sun, 21 Oct 2018 17:55:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LHtRB6078599; Sun, 21 Oct 2018 17:55:27 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LHtQgR078596; Sun, 21 Oct 2018 17:55:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211755.w9LHtQgR078596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 17:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339550 - in head/sys: net netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: net netinet X-SVN-Commit-Revision: 339550 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, 21 Oct 2018 17:55:28 -0000 Author: ae Date: Sun Oct 21 17:55:26 2018 New Revision: 339550 URL: https://svnweb.freebsd.org/changeset/base/339550 Log: Add KPI that can be used by tunneling interfaces to handle IP addresses appearing and disappearing on the host system. Such handling is need, because tunneling interfaces must use addresses, that are configured on the host as ingress addresses for tunnels. Otherwise the system can send spoofed packets with source address, that belongs to foreign host. The KPI uses ifaddr_event_ext event to implement addresses tracking. Tunneling interfaces register event handlers and then they are notified by the kernel, when an address disappears or appears. ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event() in the ip_encap.c MFC after: 1 month Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17134 Modified: head/sys/net/if.c head/sys/netinet/ip_encap.c head/sys/netinet/ip_encap.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Oct 21 17:38:52 2018 (r339549) +++ head/sys/net/if.c Sun Oct 21 17:55:26 2018 (r339550) @@ -328,18 +328,6 @@ static MALLOC_DEFINE(M_IFNET, "ifnet", "interface inte MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); -/* - * Support for old ifaddr_event. - */ -static void -ifaddr_event_compat(void *arg __unused, struct ifnet *ifp, - struct ifaddr *ifa __unused, int event __unused) -{ - - EVENTHANDLER_INVOKE(ifaddr_event, ifp); -} -EVENTHANDLER_DEFINE(ifaddr_event_ext, ifaddr_event_compat, NULL, 0); - struct ifnet * ifnet_byindex_locked(u_short idx) { Modified: head/sys/netinet/ip_encap.c ============================================================================== --- head/sys/netinet/ip_encap.c Sun Oct 21 17:38:52 2018 (r339549) +++ head/sys/netinet/ip_encap.c Sun Oct 21 17:55:26 2018 (r339550) @@ -100,22 +100,139 @@ struct encaptab { encap_input_t input; }; +struct srcaddrtab { + CK_LIST_ENTRY(srcaddrtab) chain; + + encap_srcaddr_t srcaddr; + void *arg; +}; + CK_LIST_HEAD(encaptab_head, encaptab); +CK_LIST_HEAD(srcaddrtab_head, srcaddrtab); #ifdef INET static struct encaptab_head ipv4_encaptab = CK_LIST_HEAD_INITIALIZER(); +static struct srcaddrtab_head ipv4_srcaddrtab = CK_LIST_HEAD_INITIALIZER(); #endif #ifdef INET6 static struct encaptab_head ipv6_encaptab = CK_LIST_HEAD_INITIALIZER(); +static struct srcaddrtab_head ipv6_srcaddrtab = CK_LIST_HEAD_INITIALIZER(); #endif -static struct mtx encapmtx; +static struct mtx encapmtx, srcaddrmtx; MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); +MTX_SYSINIT(srcaddrmtx, &srcaddrmtx, "srcaddrmtx", MTX_DEF); #define ENCAP_WLOCK() mtx_lock(&encapmtx) #define ENCAP_WUNLOCK() mtx_unlock(&encapmtx) -#define ENCAP_RLOCK() struct epoch_tracker encap_et; epoch_enter_preempt(net_epoch_preempt, &encap_et) -#define ENCAP_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &encap_et) +#define ENCAP_RLOCK_TRACKER struct epoch_tracker encap_et +#define ENCAP_RLOCK() \ + epoch_enter_preempt(net_epoch_preempt, &encap_et) +#define ENCAP_RUNLOCK() \ + epoch_exit_preempt(net_epoch_preempt, &encap_et) #define ENCAP_WAIT() epoch_wait_preempt(net_epoch_preempt) +#define SRCADDR_WLOCK() mtx_lock(&srcaddrmtx) +#define SRCADDR_WUNLOCK() mtx_unlock(&srcaddrmtx) +#define SRCADDR_RLOCK_TRACKER struct epoch_tracker srcaddr_et +#define SRCADDR_RLOCK() \ + epoch_enter_preempt(net_epoch_preempt, &srcaddr_et) +#define SRCADDR_RUNLOCK() \ + epoch_exit_preempt(net_epoch_preempt, &srcaddr_et) +#define SRCADDR_WAIT() epoch_wait_preempt(net_epoch_preempt) + +/* + * ifaddr_event_ext handler. + * + * Tunnelling interfaces may request the kernel to notify when + * some interface addresses appears or disappears. Usually tunnelling + * interface must use an address configured on the local machine as + * ingress address to be able receive datagramms and do not send + * spoofed packets. + */ +static void +srcaddr_change_event(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa, int event) +{ + SRCADDR_RLOCK_TRACKER; + struct srcaddrtab_head *head; + struct srcaddrtab *p; + + /* Support for old ifaddr_event. */ + EVENTHANDLER_INVOKE(ifaddr_event, ifp); + + switch (ifa->ifa_addr->sa_family) { +#ifdef INET + case AF_INET: + head = &ipv4_srcaddrtab; + break; +#endif +#ifdef INET6 + case AF_INET6: + head = &ipv6_srcaddrtab; + break; +#endif + default: + /* ignore event */ + return; + } + + SRCADDR_RLOCK(); + CK_LIST_FOREACH(p, head, chain) { + (*p->srcaddr)(p->arg, ifa->ifa_addr, event); + } + SRCADDR_RUNLOCK(); +} +EVENTHANDLER_DEFINE(ifaddr_event_ext, srcaddr_change_event, NULL, 0); + +static struct srcaddrtab * +encap_register_srcaddr(struct srcaddrtab_head *head, encap_srcaddr_t func, + void *arg, int mflags) +{ + struct srcaddrtab *p, *tmp; + + if (func == NULL) + return (NULL); + p = malloc(sizeof(*p), M_NETADDR, mflags); + if (p == NULL) + return (NULL); + p->srcaddr = func; + p->arg = arg; + + SRCADDR_WLOCK(); + CK_LIST_FOREACH(tmp, head, chain) { + if (func == tmp->srcaddr && arg == tmp->arg) + break; + } + if (tmp == NULL) + CK_LIST_INSERT_HEAD(head, p, chain); + SRCADDR_WUNLOCK(); + + if (tmp != NULL) { + free(p, M_NETADDR); + p = tmp; + } + return (p); +} + +static int +encap_unregister_srcaddr(struct srcaddrtab_head *head, + const struct srcaddrtab *cookie) +{ + struct srcaddrtab *p; + + SRCADDR_WLOCK(); + CK_LIST_FOREACH(p, head, chain) { + if (p == cookie) { + CK_LIST_REMOVE(p, chain); + SRCADDR_WUNLOCK(); + SRCADDR_WAIT(); + free(p, M_NETADDR); + return (0); + } + } + SRCADDR_WUNLOCK(); + return (EINVAL); +} + static struct encaptab * encap_attach(struct encaptab_head *head, const struct encap_config *cfg, void *arg, int mflags) @@ -175,6 +292,7 @@ encap_detach(struct encaptab_head *head, const struct static int encap_input(struct encaptab_head *head, struct mbuf *m, int off, int proto) { + ENCAP_RLOCK_TRACKER; struct encaptab *ep, *match; void *arg; int matchprio, ret; @@ -220,6 +338,20 @@ encap_input(struct encaptab_head *head, struct mbuf *m } #ifdef INET +const struct srcaddrtab * +ip_encap_register_srcaddr(encap_srcaddr_t func, void *arg, int mflags) +{ + + return (encap_register_srcaddr(&ipv4_srcaddrtab, func, arg, mflags)); +} + +int +ip_encap_unregister_srcaddr(const struct srcaddrtab *cookie) +{ + + return (encap_unregister_srcaddr(&ipv4_srcaddrtab, cookie)); +} + const struct encaptab * ip_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { @@ -245,6 +377,20 @@ encap4_input(struct mbuf **mp, int *offp, int proto) #endif /* INET */ #ifdef INET6 +const struct srcaddrtab * +ip6_encap_register_srcaddr(encap_srcaddr_t func, void *arg, int mflags) +{ + + return (encap_register_srcaddr(&ipv6_srcaddrtab, func, arg, mflags)); +} + +int +ip6_encap_unregister_srcaddr(const struct srcaddrtab *cookie) +{ + + return (encap_unregister_srcaddr(&ipv6_srcaddrtab, cookie)); +} + const struct encaptab * ip6_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { Modified: head/sys/netinet/ip_encap.h ============================================================================== --- head/sys/netinet/ip_encap.h Sun Oct 21 17:38:52 2018 (r339549) +++ head/sys/netinet/ip_encap.h Sun Oct 21 17:55:26 2018 (r339550) @@ -43,7 +43,8 @@ int encap6_input(struct mbuf **, int *, int); typedef int (*encap_lookup_t)(const struct mbuf *, int, int, void **); typedef int (*encap_check_t)(const struct mbuf *, int, int, void *); -typedef int (*encap_input_t)(struct mbuf *, int , int, void *); +typedef int (*encap_input_t)(struct mbuf *, int, int, void *); +typedef void (*encap_srcaddr_t)(void *, const struct sockaddr *, int); struct encap_config { int proto; /* protocol */ @@ -60,12 +61,20 @@ struct encap_config { }; struct encaptab; +struct srcaddrtab; const struct encaptab *ip_encap_attach(const struct encap_config *, void *arg, int mflags); const struct encaptab *ip6_encap_attach(const struct encap_config *, void *arg, int mflags); +const struct srcaddrtab *ip_encap_register_srcaddr(encap_srcaddr_t, + void *arg, int mflags); +const struct srcaddrtab *ip6_encap_register_srcaddr(encap_srcaddr_t, + void *arg, int mflags); + +int ip_encap_unregister_srcaddr(const struct srcaddrtab *); +int ip6_encap_unregister_srcaddr(const struct srcaddrtab *); int ip_encap_detach(const struct encaptab *); int ip6_encap_detach(const struct encaptab *); #endif From owner-svn-src-head@freebsd.org Sun Oct 21 18:06:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27471FFC8D7; Sun, 21 Oct 2018 18:06:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B984C72647; Sun, 21 Oct 2018 18:06:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A585B11044; Sun, 21 Oct 2018 18:06:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LI6Ggu083714; Sun, 21 Oct 2018 18:06:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LI6F65083710; Sun, 21 Oct 2018 18:06:15 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211806.w9LI6F65083710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 18:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339551 - in head: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 339551 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, 21 Oct 2018 18:06:17 -0000 Author: ae Date: Sun Oct 21 18:06:15 2018 New Revision: 339551 URL: https://svnweb.freebsd.org/changeset/base/339551 Log: Add handling for appearing/disappearing of ingress addresses to if_gif(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; * remove the note about ingress address from BUGS section. MFC after: 1 month Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17134 Modified: head/share/man/man4/gif.4 head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/netinet/in_gif.c head/sys/netinet6/in6_gif.c Modified: head/share/man/man4/gif.4 ============================================================================== --- head/share/man/man4/gif.4 Sun Oct 21 17:55:26 2018 (r339550) +++ head/share/man/man4/gif.4 Sun Oct 21 18:06:15 2018 (r339551) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2018 +.Dd October 21, 2018 .Dt GIF 4 .Os .Sh NAME @@ -206,15 +206,6 @@ and are picky about outer header fields. For example, you cannot usually use .Nm to talk with IPsec devices that use IPsec tunnel mode. -.Pp -The current code does not check if the ingress address -(outer source address) -configured in the -.Nm -interface makes sense. -Make sure to specify an address which belongs to your node. -Otherwise, your node will not be able to receive packets from the peer, -and it will generate packets with a spoofed source address. .Pp If the outer protocol is IPv4, .Nm Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sun Oct 21 17:55:26 2018 (r339550) +++ head/sys/net/if_gif.c Sun Oct 21 18:06:15 2018 (r339551) @@ -284,6 +284,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->gif_family == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_GIF, V_max_gif_nesting)) != 0) { @@ -674,7 +675,6 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) cmd == SIOCSIFPHYADDR_IN6 || #endif 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); } } @@ -689,6 +689,7 @@ gif_delete_tunnel(struct gif_softc *sc) sx_assert(&gif_ioctl_sx, SA_XLOCKED); if (sc->gif_family != 0) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); /* Wait until it become safe to free gif_hdr */ GIF_WAIT(); Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Sun Oct 21 17:55:26 2018 (r339550) +++ head/sys/net/if_gif.h Sun Oct 21 18:06:15 2018 (r339551) @@ -63,6 +63,7 @@ struct gif_softc { } gif_uhdr; CK_LIST_ENTRY(gif_softc) chain; + CK_LIST_ENTRY(gif_softc) srchash; }; CK_LIST_HEAD(gif_list, gif_softc); MALLOC_DECLARE(M_GIF); Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Sun Oct 21 17:55:26 2018 (r339550) +++ head/sys/netinet/in_gif.c Sun Oct 21 18:06:15 2018 (r339551) @@ -82,12 +82,16 @@ SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLA * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ VNET_DEFINE_STATIC(struct gif_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list *, ipv4_srchashtbl) = NULL; VNET_DEFINE_STATIC(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define V_ipv4_list VNET(ipv4_list) #define GIF_HASH(src, dst) (V_ipv4_hashtbl[\ in_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_SRCHASH(src) (V_ipv4_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GIF_HASH_SIZE - 1)]) #define GIF_HASH_SC(sc) GIF_HASH((sc)->gif_iphdr->ip_src.s_addr,\ (sc)->gif_iphdr->ip_dst.s_addr) static uint32_t @@ -119,7 +123,44 @@ in_gif_checkdup(const struct gif_softc *sc, in_addr_t return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in_gif_set_running(struct gif_softc *sc) +{ + + if (in_localip(sc->gif_iphdr->ip_src)) + GIF2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct gif_softc *sc; + + if (V_ipv4_srchashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &GIF_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->gif_iphdr->ip_src.s_addr != sin->sin_addr.s_addr) + continue; + in_gif_set_running(sc); + } +} + +static void in_gif_attach(struct gif_softc *sc) { @@ -127,6 +168,9 @@ in_gif_attach(struct gif_softc *sc) CK_LIST_INSERT_HEAD(&V_ipv4_list, sc, chain); else CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); + + CK_LIST_INSERT_HEAD(&GIF_SRCHASH(sc->gif_iphdr->ip_src.s_addr), + sc, srchash); } int @@ -139,6 +183,7 @@ in_gif_setopts(struct gif_softc *sc, u_int options) if ((options & GIF_IGNORE_SOURCE) != (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); sc->gif_options = options; in_gif_attach(sc); @@ -172,8 +217,10 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t error = EADDRNOTAVAIL; break; } - if (V_ipv4_hashtbl == NULL) + if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gif_hashinit(); + V_ipv4_srchashtbl = gif_hashinit(); + } error = in_gif_checkdup(sc, src->sin_addr.s_addr, dst->sin_addr.s_addr); if (error == EADDRNOTAVAIL) @@ -188,6 +235,7 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t ip->ip_dst.s_addr = dst->sin_addr.s_addr; if (sc->gif_family != 0) { /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); GIF_WAIT(); free(sc->gif_hdr, M_GIF); @@ -196,6 +244,7 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t sc->gif_family = AF_INET; sc->gif_iphdr = ip; in_gif_attach(sc); + in_gif_set_running(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -342,6 +391,7 @@ done: return (ret); } +static const struct srcaddrtab *ipv4_srcaddrtab; static struct { const struct encap_config encap; const struct encaptab *cookie; @@ -387,6 +437,9 @@ in_gif_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + + ipv4_srcaddrtab = ip_encap_register_srcaddr(in_gif_srcaddr, + NULL, M_WAITOK); for (i = 0; i < nitems(ipv4_encap_cfg); i++) ipv4_encap_cfg[i].cookie = ip_encap_attach( &ipv4_encap_cfg[i].encap, NULL, M_WAITOK); @@ -400,8 +453,11 @@ in_gif_uninit(void) if (IS_DEFAULT_VNET(curvnet)) { for (i = 0; i < nitems(ipv4_encap_cfg); i++) ip_encap_detach(ipv4_encap_cfg[i].cookie); + ip_encap_unregister_srcaddr(ipv4_srcaddrtab); } - if (V_ipv4_hashtbl != NULL) + if (V_ipv4_hashtbl != NULL) { gif_hashdestroy(V_ipv4_hashtbl); + gif_hashdestroy(V_ipv4_srchashtbl); + } } Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Sun Oct 21 17:55:26 2018 (r339550) +++ head/sys/netinet6/in6_gif.c Sun Oct 21 18:06:15 2018 (r339551) @@ -87,12 +87,16 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ VNET_DEFINE_STATIC(struct gif_list *, ipv6_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list *, ipv6_srchashtbl) = NULL; VNET_DEFINE_STATIC(struct gif_list, ipv6_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv6_hashtbl VNET(ipv6_hashtbl) +#define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define V_ipv6_list VNET(ipv6_list) #define GIF_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_SRCHASH(src) (V_ipv6_srchashtbl[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GIF_HASH_SIZE - 1)]) #define GIF_HASH_SC(sc) GIF_HASH(&(sc)->gif_ip6hdr->ip6_src,\ &(sc)->gif_ip6hdr->ip6_dst) static uint32_t @@ -125,7 +129,44 @@ in6_gif_checkdup(const struct gif_softc *sc, const str return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in6_gif_set_running(struct gif_softc *sc) +{ + + if (in6_localip(&sc->gif_ip6hdr->ip6_src)) + GIF2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in6_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, int event) +{ + const struct sockaddr_in6 *sin; + struct gif_softc *sc; + + if (V_ipv6_srchashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in6 *)sa; + CK_LIST_FOREACH(sc, &GIF_SRCHASH(&sin->sin6_addr), srchash) { + if (IN6_ARE_ADDR_EQUAL(&sc->gif_ip6hdr->ip6_src, + &sin->sin6_addr) == 0) + continue; + in6_gif_set_running(sc); + } +} + +static void in6_gif_attach(struct gif_softc *sc) { @@ -133,6 +174,9 @@ in6_gif_attach(struct gif_softc *sc) CK_LIST_INSERT_HEAD(&V_ipv6_list, sc, chain); else CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); + + CK_LIST_INSERT_HEAD(&GIF_SRCHASH(&sc->gif_ip6hdr->ip6_src), + sc, srchash); } int @@ -145,6 +189,7 @@ in6_gif_setopts(struct gif_softc *sc, u_int options) if ((options & GIF_IGNORE_SOURCE) != (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); sc->gif_options = options; in6_gif_attach(sc); @@ -187,8 +232,10 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ (error = sa6_embedscope(dst, 0)) != 0) break; - if (V_ipv6_hashtbl == NULL) + if (V_ipv6_hashtbl == NULL) { V_ipv6_hashtbl = gif_hashinit(); + V_ipv6_srchashtbl = gif_hashinit(); + } error = in6_gif_checkdup(sc, &src->sin6_addr, &dst->sin6_addr); if (error == EADDRNOTAVAIL) @@ -204,6 +251,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ ip6->ip6_vfc = IPV6_VERSION; if (sc->gif_family != 0) { /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); GIF_WAIT(); free(sc->gif_hdr, M_GIF); @@ -212,6 +260,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ sc->gif_family = AF_INET6; sc->gif_ip6hdr = ip6; in6_gif_attach(sc); + in6_gif_set_running(sc); break; case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: @@ -365,6 +414,7 @@ done: return (ret); } +static const struct srcaddrtab *ipv6_srcaddrtab; static struct { const struct encap_config encap; const struct encaptab *cookie; @@ -410,6 +460,9 @@ in6_gif_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + + ipv6_srcaddrtab = ip6_encap_register_srcaddr(in6_gif_srcaddr, + NULL, M_WAITOK); for (i = 0; i < nitems(ipv6_encap_cfg); i++) ipv6_encap_cfg[i].cookie = ip6_encap_attach( &ipv6_encap_cfg[i].encap, NULL, M_WAITOK); @@ -423,7 +476,10 @@ in6_gif_uninit(void) if (IS_DEFAULT_VNET(curvnet)) { for (i = 0; i < nitems(ipv6_encap_cfg); i++) ip6_encap_detach(ipv6_encap_cfg[i].cookie); + ip6_encap_unregister_srcaddr(ipv6_srcaddrtab); } - if (V_ipv6_hashtbl != NULL) + if (V_ipv6_hashtbl != NULL) { gif_hashdestroy(V_ipv6_hashtbl); + gif_hashdestroy(V_ipv6_srchashtbl); + } } From owner-svn-src-head@freebsd.org Sun Oct 21 18:13:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D42F5FFCC3F; Sun, 21 Oct 2018 18:13:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E50E72C49; Sun, 21 Oct 2018 18:13:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74A67111FD; Sun, 21 Oct 2018 18:13:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LIDk3K088851; Sun, 21 Oct 2018 18:13:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LIDjW1088848; Sun, 21 Oct 2018 18:13:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211813.w9LIDjW1088848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 18:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339552 - in head/sys: net netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: net netinet netinet6 X-SVN-Commit-Revision: 339552 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, 21 Oct 2018 18:13:47 -0000 Author: ae Date: Sun Oct 21 18:13:45 2018 New Revision: 339552 URL: https://svnweb.freebsd.org/changeset/base/339552 Log: Add handling for appearing/disappearing of ingress addresses to if_gre(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; MFC after: 1 month Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17214 Modified: head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/netinet/ip_gre.c head/sys/netinet6/ip6_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sun Oct 21 18:06:15 2018 (r339551) +++ head/sys/net/if_gre.c Sun Oct 21 18:13:45 2018 (r339552) @@ -326,7 +326,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) cmd == SIOCSIFPHYADDR_IN6 || #endif 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); } } @@ -342,6 +341,7 @@ gre_delete_tunnel(struct gre_softc *sc) sx_assert(&gre_ioctl_sx, SA_XLOCKED); if (sc->gre_family != 0) { CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); sc->gre_family = 0; @@ -543,6 +543,7 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) static int gre_transmit(struct ifnet *ifp, struct mbuf *m) { + GRE_RLOCK_TRACKER; struct gre_softc *sc; struct grehdr *gh; uint32_t af; @@ -562,6 +563,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->gre_family == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_GRE, V_max_gre_nesting)) != 0) { Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Sun Oct 21 18:06:15 2018 (r339551) +++ head/sys/net/if_gre.h Sun Oct 21 18:13:45 2018 (r339552) @@ -82,6 +82,7 @@ struct gre_softc { } gre_uhdr; CK_LIST_ENTRY(gre_softc) chain; + CK_LIST_ENTRY(gre_softc) srchash; }; CK_LIST_HEAD(gre_list, gre_softc); MALLOC_DECLARE(M_GRE); @@ -91,7 +92,8 @@ MALLOC_DECLARE(M_GRE); #endif #define GRE2IFP(sc) ((sc)->gre_ifp) -#define GRE_RLOCK() struct epoch_tracker gre_et; epoch_enter_preempt(net_epoch_preempt, &gre_et) +#define GRE_RLOCK_TRACKER struct epoch_tracker gre_et +#define GRE_RLOCK() epoch_enter_preempt(net_epoch_preempt, &gre_et) #define GRE_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &gre_et) #define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Sun Oct 21 18:06:15 2018 (r339551) +++ head/sys/netinet/ip_gre.c Sun Oct 21 18:13:45 2018 (r339552) @@ -75,9 +75,13 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNE &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv4_srchashtbl) = NULL; #define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_SRCHASH(src) (V_ipv4_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH((sc)->gre_oip.ip_src.s_addr,\ (sc)->gre_oip.ip_dst.s_addr) @@ -138,7 +142,44 @@ in_gre_lookup(const struct mbuf *m, int off, int proto return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in_gre_set_running(struct gre_softc *sc) +{ + + if (in_localip(sc->gre_oip.ip_src)) + GRE2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in_gre_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct gre_softc *sc; + + if (V_ipv4_srchashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &GRE_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->gre_oip.ip_src.s_addr != sin->sin_addr.s_addr) + continue; + in_gre_set_running(sc); + } +} + +static void in_gre_attach(struct gre_softc *sc) { @@ -148,6 +189,8 @@ in_gre_attach(struct gre_softc *sc) sc->gre_oip.ip_p = IPPROTO_GRE; gre_updatehdr(sc, &sc->gre_gihdr->gi_gre); CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), + sc, srchash); } void @@ -159,6 +202,7 @@ in_gre_setopts(struct gre_softc *sc, u_long cmd, uint3 /* NOTE: we are protected with gre_ioctl_sx lock */ MPASS(sc->gre_family == AF_INET); CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); if (cmd == GRESKEY) sc->gre_key = value; @@ -193,8 +237,10 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t error = EADDRNOTAVAIL; break; } - if (V_ipv4_hashtbl == NULL) + if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gre_hashinit(); + V_ipv4_srchashtbl = gre_hashinit(); + } error = in_gre_checkdup(sc, src->sin_addr.s_addr, dst->sin_addr.s_addr); if (error == EADDRNOTAVAIL) @@ -211,6 +257,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t if (sc->gre_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); /* XXX: should we notify about link state change? */ @@ -220,6 +267,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; in_gre_attach(sc); + in_gre_set_running(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -271,6 +319,7 @@ in_gre_output(struct mbuf *m, int af, int hlen) return (ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL)); } +static const struct srcaddrtab *ipv4_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config ipv4_encap_cfg = { .proto = IPPROTO_GRE, @@ -286,6 +335,8 @@ in_gre_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ipv4_srcaddrtab = ip_encap_register_srcaddr(in_gre_srcaddr, + NULL, M_WAITOK); ecookie = ip_encap_attach(&ipv4_encap_cfg, NULL, M_WAITOK); } @@ -293,8 +344,12 @@ void in_gre_uninit(void) { - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { ip_encap_detach(ecookie); - if (V_ipv4_hashtbl != NULL) + ip_encap_unregister_srcaddr(ipv4_srcaddrtab); + } + if (V_ipv4_hashtbl != NULL) { gre_hashdestroy(V_ipv4_hashtbl); + gre_hashdestroy(V_ipv4_srchashtbl); + } } Modified: head/sys/netinet6/ip6_gre.c ============================================================================== --- head/sys/netinet6/ip6_gre.c Sun Oct 21 18:06:15 2018 (r339551) +++ head/sys/netinet6/ip6_gre.c Sun Oct 21 18:13:45 2018 (r339552) @@ -66,9 +66,13 @@ SYSCTL_INT(_net_inet6_ip6, OID_AUTO, grehlim, CTLFLAG_ &VNET_NAME(ip6_gre_hlim), 0, "Default hop limit for encapsulated packets"); VNET_DEFINE_STATIC(struct gre_list *, ipv6_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv6_srchashtbl) = NULL; #define V_ipv6_hashtbl VNET(ipv6_hashtbl) +#define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define GRE_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_SRCHASH(src) (V_ipv6_srchashtbl[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH(&(sc)->gre_oip6.ip6_src,\ &(sc)->gre_oip6.ip6_dst) @@ -131,7 +135,45 @@ in6_gre_lookup(const struct mbuf *m, int off, int prot return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in6_gre_set_running(struct gre_softc *sc) +{ + + if (in6_localip(&sc->gre_oip6.ip6_src)) + GRE2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in6_gre_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in6 *sin; + struct gre_softc *sc; + + if (V_ipv6_srchashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in6 *)sa; + CK_LIST_FOREACH(sc, &GRE_SRCHASH(&sin->sin6_addr), srchash) { + if (IN6_ARE_ADDR_EQUAL(&sc->gre_oip6.ip6_src, + &sin->sin6_addr) == 0) + continue; + in6_gre_set_running(sc); + } +} + +static void in6_gre_attach(struct gre_softc *sc) { @@ -140,6 +182,7 @@ in6_gre_attach(struct gre_softc *sc) sc->gre_oip6.ip6_nxt = IPPROTO_GRE; gre_updatehdr(sc, &sc->gre_gi6hdr->gi6_gre); CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + CK_LIST_INSERT_HEAD(&GRE_SRCHASH(&sc->gre_oip6.ip6_src), sc, srchash); } void @@ -151,6 +194,7 @@ in6_gre_setopts(struct gre_softc *sc, u_long cmd, uint /* NOTE: we are protected with gre_ioctl_sx lock */ MPASS(sc->gre_family == AF_INET6); CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); if (cmd == GRESKEY) sc->gre_key = value; @@ -194,8 +238,10 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ (error = sa6_embedscope(dst, 0)) != 0) break; - if (V_ipv6_hashtbl == NULL) + if (V_ipv6_hashtbl == NULL) { V_ipv6_hashtbl = gre_hashinit(); + V_ipv6_srchashtbl = gre_hashinit(); + } error = in6_gre_checkdup(sc, &src->sin6_addr, &dst->sin6_addr); if (error == EADDRNOTAVAIL) @@ -212,6 +258,7 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ if (sc->gre_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); /* XXX: should we notify about link state change? */ @@ -221,6 +268,7 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; in6_gre_attach(sc); + in6_gre_set_running(sc); break; case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: @@ -254,6 +302,7 @@ in6_gre_output(struct mbuf *m, int af __unused, int hl return (ip6_output(m, NULL, NULL, IPV6_MINMTU, NULL, NULL, NULL)); } +static const struct srcaddrtab *ipv6_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config ipv6_encap_cfg = { .proto = IPPROTO_GRE, @@ -274,6 +323,8 @@ in6_gre_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ipv6_srcaddrtab = ip6_encap_register_srcaddr(in6_gre_srcaddr, + NULL, M_WAITOK); ecookie = ip6_encap_attach(&ipv6_encap_cfg, NULL, M_WAITOK); } @@ -281,8 +332,12 @@ void in6_gre_uninit(void) { - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { ip6_encap_detach(ecookie); - if (V_ipv6_hashtbl != NULL) + ip6_encap_unregister_srcaddr(ipv6_srcaddrtab); + } + if (V_ipv6_hashtbl != NULL) { gre_hashdestroy(V_ipv6_hashtbl); + gre_hashdestroy(V_ipv6_srchashtbl); + } } From owner-svn-src-head@freebsd.org Sun Oct 21 18:18:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B438FFCDF7; Sun, 21 Oct 2018 18:18:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 364BC72F79; Sun, 21 Oct 2018 18:18:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EB011123B; Sun, 21 Oct 2018 18:18:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LIIbGJ089219; Sun, 21 Oct 2018 18:18:37 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LIIb8p089218; Sun, 21 Oct 2018 18:18:37 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211818.w9LIIb8p089218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 18:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339553 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339553 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, 21 Oct 2018 18:18:38 -0000 Author: ae Date: Sun Oct 21 18:18:37 2018 New Revision: 339553 URL: https://svnweb.freebsd.org/changeset/base/339553 Log: Add handling for appearing/disappearing of ingress addresses to if_me(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; MFC after: 1 month Sponsored by: Yandex LLC Modified: head/sys/net/if_me.c Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Sun Oct 21 18:13:45 2018 (r339552) +++ head/sys/net/if_me.c Sun Oct 21 18:18:37 2018 (r339553) @@ -83,11 +83,13 @@ struct me_softc { struct in_addr me_dst; CK_LIST_ENTRY(me_softc) chain; + CK_LIST_ENTRY(me_softc) srchash; }; CK_LIST_HEAD(me_list, me_softc); #define ME2IFP(sc) ((sc)->me_ifp) #define ME_READY(sc) ((sc)->me_src.s_addr != 0) -#define ME_RLOCK() struct epoch_tracker me_et; epoch_enter_preempt(net_epoch_preempt, &me_et) +#define ME_RLOCK_TRACKER struct epoch_tracker me_et +#define ME_RLOCK() epoch_enter_preempt(net_epoch_preempt, &me_et) #define ME_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &me_et) #define ME_WAIT() epoch_wait_preempt(net_epoch_preempt) @@ -95,9 +97,13 @@ CK_LIST_HEAD(me_list, me_softc); #define ME_HASH_SIZE (1 << 4) #endif VNET_DEFINE_STATIC(struct me_list *, me_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct me_list *, me_srchashtbl) = NULL; #define V_me_hashtbl VNET(me_hashtbl) +#define V_me_srchashtbl VNET(me_srchashtbl) #define ME_HASH(src, dst) (V_me_hashtbl[\ me_hashval((src), (dst)) & (ME_HASH_SIZE - 1)]) +#define ME_SRCHASH(src) (V_me_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (ME_HASH_SIZE - 1)]) static struct sx me_ioctl_sx; SX_SYSINIT(me_ioctl_sx, &me_ioctl_sx, "me_ioctl"); @@ -165,8 +171,10 @@ static void vnet_me_uninit(const void *unused __unused) { - if (V_me_hashtbl != NULL) + if (V_me_hashtbl != NULL) { free(V_me_hashtbl, M_IFME); + free(V_me_srchashtbl, M_IFME); + } if_clone_detach(V_me_cloner); } VNET_SYSUNINIT(vnet_me_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, @@ -330,6 +338,43 @@ me_lookup(const struct mbuf *m, int off, int proto, vo return (0); } +/* + * Check that ingress address belongs to local host. + */ +static void +me_set_running(struct me_softc *sc) +{ + + if (in_localip(sc->me_src)) + ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + ME2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +me_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct me_softc *sc; + + if (V_me_srchashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &ME_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->me_src.s_addr != sin->sin_addr.s_addr) + continue; + me_set_running(sc); + } +} + static int me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) { @@ -337,8 +382,10 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_a sx_assert(&me_ioctl_sx, SA_XLOCKED); - if (V_me_hashtbl == NULL) + if (V_me_hashtbl == NULL) { V_me_hashtbl = me_hashinit(); + V_me_srchashtbl = me_hashinit(); + } if (sc->me_src.s_addr == src && sc->me_dst.s_addr == dst) return (0); @@ -355,8 +402,9 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_a sc->me_dst.s_addr = dst; sc->me_src.s_addr = src; CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); + CK_LIST_INSERT_HEAD(&ME_SRCHASH(src), sc, srchash); - ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + me_set_running(sc); if_link_state_change(ME2IFP(sc), LINK_STATE_UP); return (0); } @@ -368,6 +416,7 @@ me_delete_tunnel(struct me_softc *sc) sx_assert(&me_ioctl_sx, SA_XLOCKED); if (ME_READY(sc)) { CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); ME_WAIT(); sc->me_src.s_addr = 0; @@ -473,6 +522,7 @@ me_output(struct ifnet *ifp, struct mbuf *m, const str static int me_transmit(struct ifnet *ifp, struct mbuf *m) { + ME_RLOCK_TRACKER; struct mobhdr mh; struct me_softc *sc; struct ip *ip; @@ -490,6 +540,7 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) if (sc == NULL || !ME_READY(sc) || (ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_ME, V_max_me_nesting)) != 0) { m_freem(m); @@ -567,6 +618,7 @@ me_qflush(struct ifnet *ifp __unused) } +static const struct srcaddrtab *me_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config me_encap_cfg = { .proto = IPPROTO_MOBILE, @@ -583,10 +635,13 @@ memodevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: + me_srcaddrtab = ip_encap_register_srcaddr(me_srcaddr, + NULL, M_WAITOK); ecookie = ip_encap_attach(&me_encap_cfg, NULL, M_WAITOK); break; case MOD_UNLOAD: ip_encap_detach(ecookie); + ip_encap_unregister_srcaddr(me_srcaddrtab); break; default: return (EOPNOTSUPP); From owner-svn-src-head@freebsd.org Sun Oct 21 18:24:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A357FFD088; Sun, 21 Oct 2018 18:24:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE14733C7; Sun, 21 Oct 2018 18:24:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 310BE113D5; Sun, 21 Oct 2018 18:24:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LIOLJv094156; Sun, 21 Oct 2018 18:24:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LIOLuu094155; Sun, 21 Oct 2018 18:24:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211824.w9LIOLuu094155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 18:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339554 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339554 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, 21 Oct 2018 18:24:21 -0000 Author: ae Date: Sun Oct 21 18:24:20 2018 New Revision: 339554 URL: https://svnweb.freebsd.org/changeset/base/339554 Log: Rework if_ipsec(4) to use epoch(9) instead of rmlock. * use CK_LIST and FNV hash to keep chains of softc; * read access to softc is protected by epoch(); * write access is protected by ipsec_ioctl_sx. Changing of softc fields is allowed only when softc is unlinked from CK_LIST chains. * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is exclusive locked. * the plain LIST of all softc is replaced by hash table that uses ingress address of tunnels as a key. * added support for appearing/disappearing of ingress address handling. Now it is allowed configure non-local ingress IP address, and thus the problem with if_ipsec(4) configuration that happens on boot, when ingress address is not yet configured, is solved. MFC after: 1 month Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17190 Modified: head/sys/net/if_ipsec.c Modified: head/sys/net/if_ipsec.c ============================================================================== --- head/sys/net/if_ipsec.c Sun Oct 21 18:18:37 2018 (r339553) +++ head/sys/net/if_ipsec.c Sun Oct 21 18:24:20 2018 (r339554) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2016 Yandex LLC - * Copyright (c) 2016 Andrey V. Elsukov + * Copyright (c) 2016-2018 Yandex LLC + * Copyright (c) 2016-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -61,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -87,58 +87,72 @@ static const char ipsecname[] = "ipsec"; struct ipsec_softc { struct ifnet *ifp; - - struct rmlock lock; struct secpolicy *sp[IPSEC_SPCOUNT]; - uint32_t reqid; u_int family; u_int fibnum; - LIST_ENTRY(ipsec_softc) chain; - LIST_ENTRY(ipsec_softc) hash; + + CK_LIST_ENTRY(ipsec_softc) idhash; + CK_LIST_ENTRY(ipsec_softc) srchash; }; -#define IPSEC_LOCK_INIT(sc) rm_init(&(sc)->lock, "if_ipsec softc") -#define IPSEC_LOCK_DESTROY(sc) rm_destroy(&(sc)->lock) -#define IPSEC_RLOCK_TRACKER struct rm_priotracker ipsec_tracker -#define IPSEC_RLOCK(sc) rm_rlock(&(sc)->lock, &ipsec_tracker) -#define IPSEC_RUNLOCK(sc) rm_runlock(&(sc)->lock, &ipsec_tracker) -#define IPSEC_RLOCK_ASSERT(sc) rm_assert(&(sc)->lock, RA_RLOCKED) -#define IPSEC_WLOCK(sc) rm_wlock(&(sc)->lock) -#define IPSEC_WUNLOCK(sc) rm_wunlock(&(sc)->lock) -#define IPSEC_WLOCK_ASSERT(sc) rm_assert(&(sc)->lock, RA_WLOCKED) +#define IPSEC_RLOCK_TRACKER struct epoch_tracker ipsec_et +#define IPSEC_RLOCK() epoch_enter_preempt(net_epoch_preempt, &ipsec_et) +#define IPSEC_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &ipsec_et) +#define IPSEC_WAIT() epoch_wait_preempt(net_epoch_preempt) -static struct rmlock ipsec_sc_lock; -RM_SYSINIT(ipsec_sc_lock, &ipsec_sc_lock, "if_ipsec softc list"); +#ifndef IPSEC_HASH_SIZE +#define IPSEC_HASH_SIZE (1 << 5) +#endif -#define IPSEC_SC_RLOCK_TRACKER struct rm_priotracker ipsec_sc_tracker -#define IPSEC_SC_RLOCK() rm_rlock(&ipsec_sc_lock, &ipsec_sc_tracker) -#define IPSEC_SC_RUNLOCK() rm_runlock(&ipsec_sc_lock, &ipsec_sc_tracker) -#define IPSEC_SC_RLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_RLOCKED) -#define IPSEC_SC_WLOCK() rm_wlock(&ipsec_sc_lock) -#define IPSEC_SC_WUNLOCK() rm_wunlock(&ipsec_sc_lock) -#define IPSEC_SC_WLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_WLOCKED) +CK_LIST_HEAD(ipsec_iflist, ipsec_softc); +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_idhtbl) = NULL; +#define V_ipsec_idhtbl VNET(ipsec_idhtbl) -LIST_HEAD(ipsec_iflist, ipsec_softc); -VNET_DEFINE_STATIC(struct ipsec_iflist, ipsec_sc_list); -VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_sc_htbl); -VNET_DEFINE_STATIC(u_long, ipsec_sc_hmask); -#define V_ipsec_sc_list VNET(ipsec_sc_list) -#define V_ipsec_sc_htbl VNET(ipsec_sc_htbl) -#define V_ipsec_sc_hmask VNET(ipsec_sc_hmask) +#ifdef INET +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec4_srchtbl) = NULL; +#define V_ipsec4_srchtbl VNET(ipsec4_srchtbl) +static const struct srcaddrtab *ipsec4_srctab = NULL; +#endif -static uint32_t -ipsec_hash(uint32_t id) +#ifdef INET6 +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec6_srchtbl) = NULL; +#define V_ipsec6_srchtbl VNET(ipsec6_srchtbl) +static const struct srcaddrtab *ipsec6_srctab = NULL; +#endif + +static struct ipsec_iflist * +ipsec_idhash(uint32_t id) { - return (fnv_32_buf(&id, sizeof(id), FNV1_32_INIT)); + return (&V_ipsec_idhtbl[fnv_32_buf(&id, sizeof(id), + FNV1_32_INIT) & (IPSEC_HASH_SIZE - 1)]); } -#define SCHASH_NHASH_LOG2 5 -#define SCHASH_NHASH (1 << SCHASH_NHASH_LOG2) -#define SCHASH_HASHVAL(id) (ipsec_hash((id)) & V_ipsec_sc_hmask) -#define SCHASH_HASH(id) &V_ipsec_sc_htbl[SCHASH_HASHVAL(id)] +static struct ipsec_iflist * +ipsec_srchash(const struct sockaddr *sa) +{ + uint32_t hval; + switch (sa->sa_family) { +#ifdef INET + case AF_INET: + hval = fnv_32_buf( + &((const struct sockaddr_in *)sa)->sin_addr.s_addr, + sizeof(in_addr_t), FNV1_32_INIT); + return (&V_ipsec4_srchtbl[hval & (IPSEC_HASH_SIZE - 1)]); +#endif +#ifdef INET6 + case AF_INET6: + hval = fnv_32_buf( + &((const struct sockaddr_in6 *)sa)->sin6_addr, + sizeof(struct in6_addr), FNV1_32_INIT); + return (&V_ipsec6_srchtbl[hval & (IPSEC_HASH_SIZE - 1)]); +#endif + } + return (NULL); +} + /* * ipsec_ioctl_sx protects from concurrent ioctls. */ @@ -148,12 +162,14 @@ SX_SYSINIT(ipsec_ioctl_sx, &ipsec_ioctl_sx, "ipsec_ioc static int ipsec_init_reqid(struct ipsec_softc *); static int ipsec_set_tunnel(struct ipsec_softc *, struct sockaddr *, struct sockaddr *, uint32_t); -static void ipsec_delete_tunnel(struct ifnet *, int); +static void ipsec_delete_tunnel(struct ipsec_softc *); static int ipsec_set_addresses(struct ifnet *, struct sockaddr *, struct sockaddr *); -static int ipsec_set_reqid(struct ifnet *, uint32_t); +static int ipsec_set_reqid(struct ipsec_softc *, uint32_t); +static void ipsec_set_running(struct ipsec_softc *); +static void ipsec_srcaddr(void *, const struct sockaddr *, int); static int ipsec_ioctl(struct ifnet *, u_long, caddr_t); static int ipsec_transmit(struct ifnet *, struct mbuf *); static int ipsec_output(struct ifnet *, struct mbuf *, @@ -174,7 +190,6 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad sc = malloc(sizeof(*sc), M_IPSEC, M_WAITOK | M_ZERO); sc->fibnum = curthread->td_proc->p_fibnum; sc->ifp = ifp = if_alloc(IFT_TUNNEL); - IPSEC_LOCK_INIT(sc); ifp->if_softc = sc; if_initname(ifp, ipsecname, unit); @@ -188,9 +203,6 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(uint32_t)); - IPSEC_SC_WLOCK(); - LIST_INSERT_HEAD(&V_ipsec_sc_list, sc, chain); - IPSEC_SC_WUNLOCK(); return (0); } @@ -201,28 +213,48 @@ ipsec_clone_destroy(struct ifnet *ifp) sx_xlock(&ipsec_ioctl_sx); sc = ifp->if_softc; - - IPSEC_SC_WLOCK(); - ipsec_delete_tunnel(ifp, 1); - LIST_REMOVE(sc, chain); - IPSEC_SC_WUNLOCK(); - + ipsec_delete_tunnel(sc); bpfdetach(ifp); if_detach(ifp); ifp->if_softc = NULL; sx_xunlock(&ipsec_ioctl_sx); + IPSEC_WAIT(); if_free(ifp); - IPSEC_LOCK_DESTROY(sc); free(sc, M_IPSEC); } +static struct ipsec_iflist * +ipsec_hashinit(void) +{ + struct ipsec_iflist *hash; + int i; + + hash = malloc(sizeof(struct ipsec_iflist) * IPSEC_HASH_SIZE, + M_IPSEC, M_WAITOK); + for (i = 0; i < IPSEC_HASH_SIZE; i++) + CK_LIST_INIT(&hash[i]); + + return (hash); +} + static void vnet_ipsec_init(const void *unused __unused) { - LIST_INIT(&V_ipsec_sc_list); - V_ipsec_sc_htbl = hashinit(SCHASH_NHASH, M_IPSEC, &V_ipsec_sc_hmask); + V_ipsec_idhtbl = ipsec_hashinit(); +#ifdef INET + V_ipsec4_srchtbl = ipsec_hashinit(); + if (IS_DEFAULT_VNET(curvnet)) + ipsec4_srctab = ip_encap_register_srcaddr(ipsec_srcaddr, + NULL, M_WAITOK); +#endif +#ifdef INET6 + V_ipsec6_srchtbl = ipsec_hashinit(); + if (IS_DEFAULT_VNET(curvnet)) + ipsec6_srctab = ip6_encap_register_srcaddr(ipsec_srcaddr, + NULL, M_WAITOK); +#endif V_ipsec_cloner = if_clone_simple(ipsecname, ipsec_clone_create, ipsec_clone_destroy, 0); } @@ -234,7 +266,17 @@ vnet_ipsec_uninit(const void *unused __unused) { if_clone_detach(V_ipsec_cloner); - hashdestroy(V_ipsec_sc_htbl, M_IPSEC, V_ipsec_sc_hmask); + free(V_ipsec_idhtbl, M_IPSEC); +#ifdef INET + if (IS_DEFAULT_VNET(curvnet)) + ip_encap_unregister_srcaddr(ipsec4_srctab); + free(V_ipsec4_srchtbl, M_IPSEC); +#endif +#ifdef INET6 + if (IS_DEFAULT_VNET(curvnet)) + ip6_encap_unregister_srcaddr(ipsec6_srctab); + free(V_ipsec6_srchtbl, M_IPSEC); +#endif } VNET_SYSUNINIT(vnet_ipsec_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_ipsec_uninit, NULL); @@ -289,10 +331,11 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; + IPSEC_RLOCK(); sc = ifp->if_softc; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_MONITOR) != 0 || - (ifp->if_flags & IFF_UP) == 0) { + (ifp->if_flags & IFF_UP) == 0 || sc->family == 0) { m_freem(m); goto err; } @@ -327,16 +370,9 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) goto err; } - IPSEC_RLOCK(sc); - if (sc->family == 0) { - IPSEC_RUNLOCK(sc); - m_freem(m); - goto err; - } sp = ipsec_getpolicy(sc, IPSEC_DIR_OUTBOUND, af); key_addref(sp); M_SETFIB(m, sc->fibnum); - IPSEC_RUNLOCK(sc); BPF_MTAP2(ifp, &af, sizeof(af), m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -359,6 +395,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) err: if (error != 0) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + IPSEC_RUNLOCK(); return (error); } @@ -379,7 +416,7 @@ ipsec_output(struct ifnet *ifp, struct mbuf *m, const int ipsec_if_input(struct mbuf *m, struct secasvar *sav, uint32_t af) { - IPSEC_SC_RLOCK_TRACKER; + IPSEC_RLOCK_TRACKER; struct secasindex *saidx; struct ipsec_softc *sc; struct ifnet *ifp; @@ -394,13 +431,10 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u sav->sah->saidx.proto != IPPROTO_ESP) return (0); - IPSEC_SC_RLOCK(); - /* - * We only acquire SC_RLOCK() while we are doing search in - * ipsec_sc_htbl. It is safe, because removing softc or changing - * of reqid/addresses requires removing from hash table. - */ - LIST_FOREACH(sc, SCHASH_HASH(sav->sah->saidx.reqid), hash) { + IPSEC_RLOCK(); + CK_LIST_FOREACH(sc, ipsec_idhash(sav->sah->saidx.reqid), idhash) { + if (sc->family == 0) + continue; saidx = ipsec_getsaidx(sc, IPSEC_DIR_INBOUND, sav->sah->saidx.src.sa.sa_family); /* SA's reqid should match reqid in SP */ @@ -416,14 +450,14 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u break; } if (sc == NULL) { - IPSEC_SC_RUNLOCK(); + IPSEC_RUNLOCK(); /* Tunnel was not found. Nothing to do. */ return (0); } ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_UP) == 0) { - IPSEC_SC_RUNLOCK(); + IPSEC_RUNLOCK(); m_freem(m); return (ENETDOWN); } @@ -432,7 +466,6 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u * Set its ifnet as receiving interface. */ m->m_pkthdr.rcvif = ifp; - IPSEC_SC_RUNLOCK(); m_clrprotoflags(m); M_SETFIB(m, ifp->if_fib); @@ -440,17 +473,17 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); if ((ifp->if_flags & IFF_MONITOR) != 0) { + IPSEC_RUNLOCK(); m_freem(m); return (ENETDOWN); } + IPSEC_RUNLOCK(); return (0); } -/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */ -int +static int ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - IPSEC_RLOCK_TRACKER; struct ifreq *ifr = (struct ifreq*)data; struct sockaddr *dst, *src; struct ipsec_softc *sc; @@ -564,9 +597,10 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat #endif #ifdef INET6 case AF_INET6: - if (IN6_IS_ADDR_UNSPECIFIED(&satosin6(src)->sin6_addr) - || - IN6_IS_ADDR_UNSPECIFIED(&satosin6(dst)->sin6_addr)) + if (IN6_IS_ADDR_UNSPECIFIED( + &satosin6(src)->sin6_addr) || + IN6_IS_ADDR_UNSPECIFIED( + &satosin6(dst)->sin6_addr)) goto bad; /* * Check validity of the scope zone ID of the @@ -584,7 +618,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = ipsec_set_addresses(ifp, src, dst); break; case SIOCDIFPHYADDR: - ipsec_delete_tunnel(ifp, 0); + ipsec_delete_tunnel(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -592,9 +626,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: #endif - IPSEC_RLOCK(sc); if (sc->family == 0) { - IPSEC_RUNLOCK(sc); error = EADDRNOTAVAIL; break; } @@ -650,7 +682,6 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat #endif } } - IPSEC_RUNLOCK(sc); if (error != 0) break; switch (cmd) { @@ -696,7 +727,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = copyin(ifr_data_get_ptr(ifr), &reqid, sizeof(reqid)); if (error != 0) break; - error = ipsec_set_reqid(ifp, reqid); + error = ipsec_set_reqid(sc, reqid); break; default: error = EINVAL; @@ -708,6 +739,59 @@ bad: } /* + * Check that ingress address belongs to local host. + */ +static void +ipsec_set_running(struct ipsec_softc *sc) +{ + struct secasindex *saidx; + int localip; + + saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sc->family); + localip = 0; + switch (sc->family) { +#ifdef INET + case AF_INET: + localip = in_localip(saidx->src.sin.sin_addr); + break; +#endif +#ifdef INET6 + case AF_INET6: + localip = in6_localip(&saidx->src.sin6.sin6_addr); + break; +#endif + } + if (localip != 0) + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + else + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +ipsec_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + struct ipsec_softc *sc; + struct secasindex *saidx; + + MPASS(in_epoch(net_epoch_preempt)); + CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { + if (sc->family == 0) + continue; + saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sa->sa_family); + if (saidx == NULL || + key_sockaddrcmp(&saidx->src.sa, sa, 0) != 0) + continue; + ipsec_set_running(sc); + } +} + +/* * Allocate new private security policies for tunneling interface. * Each tunneling interface has following security policies for * both AF: @@ -779,8 +863,8 @@ ipsec_check_reqid(uint32_t reqid) { struct ipsec_softc *sc; - IPSEC_SC_RLOCK_ASSERT(); - LIST_FOREACH(sc, &V_ipsec_sc_list, chain) { + sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); + CK_LIST_FOREACH(sc, ipsec_idhash(reqid), idhash) { if (sc->reqid == reqid) return (EEXIST); } @@ -800,8 +884,7 @@ ipsec_init_reqid(struct ipsec_softc *sc) uint32_t reqid; int trycount; - IPSEC_SC_RLOCK_ASSERT(); - + sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); if (sc->reqid != 0) /* already initialized */ return (0); @@ -814,6 +897,7 @@ ipsec_init_reqid(struct ipsec_softc *sc) if (trycount == 0) return (EEXIST); sc->reqid = reqid; + CK_LIST_INSERT_HEAD(ipsec_idhash(reqid), sc, idhash); return (0); } @@ -824,34 +908,30 @@ ipsec_init_reqid(struct ipsec_softc *sc) * Also softc would not disappear while we hold ioctl_sx lock. */ static int -ipsec_set_reqid(struct ifnet *ifp, uint32_t reqid) +ipsec_set_reqid(struct ipsec_softc *sc, uint32_t reqid) { - IPSEC_SC_RLOCK_TRACKER; - struct ipsec_softc *sc; struct secasindex *saidx; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); - sc = ifp->if_softc; if (sc->reqid == reqid && reqid != 0) return (0); - IPSEC_SC_RLOCK(); if (reqid != 0) { /* Check that specified reqid doesn't exist */ - if (ipsec_check_reqid(reqid) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_check_reqid(reqid) != 0) return (EEXIST); + if (sc->reqid != 0) { + CK_LIST_REMOVE(sc, idhash); + IPSEC_WAIT(); } sc->reqid = reqid; + CK_LIST_INSERT_HEAD(ipsec_idhash(reqid), sc, idhash); } else { /* Generate new reqid */ - if (ipsec_init_reqid(sc) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_init_reqid(sc) != 0) return (EEXIST); - } } - IPSEC_SC_RUNLOCK(); /* Tunnel isn't fully configured, just return. */ if (sc->family == 0) @@ -871,7 +951,6 @@ static int ipsec_set_addresses(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) { - IPSEC_SC_RLOCK_TRACKER; struct ipsec_softc *sc, *tsc; struct secasindex *saidx; @@ -887,43 +966,21 @@ ipsec_set_addresses(struct ifnet *ifp, struct sockaddr return (0); /* Nothing has been changed. */ } - /* - * We cannot service IPsec tunnel when source address is - * not our own. - */ -#ifdef INET - if (src->sa_family == AF_INET && - in_localip(satosin(src)->sin_addr) == 0) - return (EADDRNOTAVAIL); -#endif -#ifdef INET6 - /* - * NOTE: IPv6 addresses are in kernel internal form with - * embedded scope zone id. - */ - if (src->sa_family == AF_INET6 && - in6_localip(&satosin6(src)->sin6_addr) == 0) - return (EADDRNOTAVAIL); -#endif /* Check that given addresses aren't already configured */ - IPSEC_SC_RLOCK(); - LIST_FOREACH(tsc, &V_ipsec_sc_list, chain) { - if (tsc == sc || tsc->family != src->sa_family) + CK_LIST_FOREACH(tsc, ipsec_srchash(src), srchash) { + if (tsc == sc) continue; + MPASS(tsc->family == src->sa_family); saidx = ipsec_getsaidx(tsc, IPSEC_DIR_OUTBOUND, tsc->family); if (key_sockaddrcmp(&saidx->src.sa, src, 0) == 0 && key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) { /* We already have tunnel with such addresses */ - IPSEC_SC_RUNLOCK(); return (EADDRNOTAVAIL); } } /* If reqid is not set, generate new one. */ - if (ipsec_init_reqid(sc) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_init_reqid(sc) != 0) return (EEXIST); - } - IPSEC_SC_RUNLOCK(); return (ipsec_set_tunnel(sc, src, dst, sc->reqid)); } @@ -932,8 +989,7 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockad struct sockaddr *dst, uint32_t reqid) { struct secpolicy *sp[IPSEC_SPCOUNT]; - struct secpolicy *oldsp[IPSEC_SPCOUNT]; - int i, f; + int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); @@ -945,58 +1001,41 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockad key_freesp(&sp[i]); return (EAGAIN); } - IPSEC_SC_WLOCK(); - if ((f = sc->family) != 0) - LIST_REMOVE(sc, hash); - IPSEC_WLOCK(sc); - for (i = 0; i < IPSEC_SPCOUNT; i++) { - oldsp[i] = sc->sp[i]; + if (sc->family != 0) + ipsec_delete_tunnel(sc); + for (i = 0; i < IPSEC_SPCOUNT; i++) sc->sp[i] = sp[i]; - } sc->family = src->sa_family; - IPSEC_WUNLOCK(sc); - LIST_INSERT_HEAD(SCHASH_HASH(sc->reqid), sc, hash); - IPSEC_SC_WUNLOCK(); + CK_LIST_INSERT_HEAD(ipsec_srchash(src), sc, srchash); } else { sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (ENOMEM); } - - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; - if (f != 0) { - key_unregister_ifnet(oldsp, IPSEC_SPCOUNT); - for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&oldsp[i]); - } + ipsec_set_running(sc); return (0); } static void -ipsec_delete_tunnel(struct ifnet *ifp, int locked) +ipsec_delete_tunnel(struct ipsec_softc *sc) { - struct ipsec_softc *sc = ifp->if_softc; - struct secpolicy *oldsp[IPSEC_SPCOUNT]; int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if (sc->family != 0) { - if (!locked) - IPSEC_SC_WLOCK(); - /* Remove from hash table */ - LIST_REMOVE(sc, hash); - IPSEC_WLOCK(sc); - for (i = 0; i < IPSEC_SPCOUNT; i++) { - oldsp[i] = sc->sp[i]; - sc->sp[i] = NULL; - } + CK_LIST_REMOVE(sc, srchash); + IPSEC_WAIT(); + + /* + * Make sure that ipsec_if_input() will not do access + * to softc's policies. + */ sc->family = 0; - IPSEC_WUNLOCK(sc); - if (!locked) - IPSEC_SC_WUNLOCK(); - key_unregister_ifnet(oldsp, IPSEC_SPCOUNT); + IPSEC_WAIT(); + + key_unregister_ifnet(sc->sp, IPSEC_SPCOUNT); for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&oldsp[i]); + key_freesp(&sc->sp[i]); } } From owner-svn-src-head@freebsd.org Sun Oct 21 18:30:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6820AFFD2E0; Sun, 21 Oct 2018 18:30:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D54D73665; Sun, 21 Oct 2018 18:30:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02CDB11402; Sun, 21 Oct 2018 18:30:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LIURaT094463; Sun, 21 Oct 2018 18:30:27 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LIURLt094462; Sun, 21 Oct 2018 18:30:27 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211830.w9LIURLt094462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 18:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339555 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339555 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, 21 Oct 2018 18:30:28 -0000 Author: ae Date: Sun Oct 21 18:30:27 2018 New Revision: 339555 URL: https://svnweb.freebsd.org/changeset/base/339555 Log: Follow the fix in r339532 (by glebius): Fix exiting an epoch(9) we never entered. May happen only with MAC. MFC after: 1 month Modified: head/sys/net/if_ipsec.c Modified: head/sys/net/if_ipsec.c ============================================================================== --- head/sys/net/if_ipsec.c Sun Oct 21 18:24:20 2018 (r339554) +++ head/sys/net/if_ipsec.c Sun Oct 21 18:30:27 2018 (r339555) @@ -323,6 +323,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) uint32_t af; int error; + IPSEC_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -331,7 +332,6 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; - IPSEC_RLOCK(); sc = ifp->if_softc; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_MONITOR) != 0 || From owner-svn-src-head@freebsd.org Sun Oct 21 18:39:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 266FCFFD4E9; Sun, 21 Oct 2018 18:39:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B349873B17; Sun, 21 Oct 2018 18:39:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8766115B8; Sun, 21 Oct 2018 18:39:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LIdY10099606; Sun, 21 Oct 2018 18:39:34 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LIdYc0099605; Sun, 21 Oct 2018 18:39:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810211839.w9LIdYc0099605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 21 Oct 2018 18:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339556 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339556 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, 21 Oct 2018 18:39:35 -0000 Author: ae Date: Sun Oct 21 18:39:34 2018 New Revision: 339556 URL: https://svnweb.freebsd.org/changeset/base/339556 Log: Include to fix the build. MFC after: 1 month Modified: head/sys/netinet/ip_encap.c Modified: head/sys/netinet/ip_encap.c ============================================================================== --- head/sys/netinet/ip_encap.c Sun Oct 21 18:30:27 2018 (r339555) +++ head/sys/netinet/ip_encap.c Sun Oct 21 18:39:34 2018 (r339556) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Sun Oct 21 20:12:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B2AAFFF2A1; Sun, 21 Oct 2018 20:12:24 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 DFB097636C; Sun, 21 Oct 2018 20:12:23 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1gEK58-000PXZ-WE; Sun, 21 Oct 2018 13:12:15 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id w9LKCEhM098180; Sun, 21 Oct 2018 13:12:14 -0700 (PDT) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Sun, 21 Oct 2018 13:12:14 -0700 From: Oleksandr Tymoshenko To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339523 - in head/sys: conf dev/amdgpio modules modules/amdgpio Message-ID: <20181021201214.GA98172@bluezbox.com> References: <201810210452.w9L4qbTc067553@repo.freebsd.org> <49432512-861b-47dd-4e25-08044b0b53fa@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49432512-861b-47dd-4e25-08044b0b53fa@freebsd.org> X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Nathan Whitehorn (nwhitehorn@freebsd.org) wrote: > > > On 10/20/18 9:52 PM, Oleksandr Tymoshenko wrote: > > Author: gonzo > > Date: Sun Oct 21 04:52:37 2018 > > New Revision: 339523 > > URL: https://s [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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, 21 Oct 2018 20:12:24 -0000 Nathan Whitehorn (nwhitehorn@freebsd.org) wrote: > > > On 10/20/18 9:52 PM, Oleksandr Tymoshenko wrote: > > Author: gonzo > > Date: Sun Oct 21 04:52:37 2018 > > New Revision: 339523 > > URL: https://svnweb.freebsd.org/changeset/base/339523 > > > > Log: > > Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms > > > > Submitted by: Rajesh Kumar > > Differential Revision: https://reviews.freebsd.org/D16865 > > > [...] > > Modified: head/sys/modules/Makefile > > ============================================================================== > > --- head/sys/modules/Makefile Sun Oct 21 02:39:13 2018 (r339522) > > +++ head/sys/modules/Makefile Sun Oct 21 04:52:37 2018 (r339523) > > @@ -34,6 +34,7 @@ SUBDIR= \ > > ale \ > > alq \ > > ${_amd_ecc_inject} \ > > + ${_amdgpio} \ > > ${_amdsbwd} \ > > ${_amdsmn} \ > > ${_amdtemp} \ > > @@ -717,6 +718,7 @@ _x86bios= x86bios > > .endif > > > > .if ${MACHINE_CPUARCH} == "amd64" > > +_amdgpio= amdgpio > > _ccp= ccp > > _efirt= efirt > > _iavf= iavf > > > > Does this not work on 64-bit AMD processors running i386 kernels? I see no reason why it wouldn't. Probably just haven't been tested. -- gonzo From owner-svn-src-head@freebsd.org Sun Oct 21 21:17:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A94E1036B09; Sun, 21 Oct 2018 21:17:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F7BD79015; Sun, 21 Oct 2018 21:17:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A54612FBC; Sun, 21 Oct 2018 21:17:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LLHgng080298; Sun, 21 Oct 2018 21:17:42 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LLHgY5080297; Sun, 21 Oct 2018 21:17:42 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810212117.w9LLHgY5080297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 21 Oct 2018 21:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339557 - head/contrib/tcpdump X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/contrib/tcpdump X-SVN-Commit-Revision: 339557 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, 21 Oct 2018 21:17:43 -0000 Author: kp Date: Sun Oct 21 21:17:42 2018 New Revision: 339557 URL: https://svnweb.freebsd.org/changeset/base/339557 Log: tcpdump: Log uid on pflog interfaces If pf logs the user id ('pass out log (user)') have tcpdump also print this. Example output: 00:00:00.000000 rule 0/0(match) [uid 1001]: pass out on vtnet0: (tos 0x0, ttl 64, id 57539, offset 0, flags [none], proto UDP (17), length 55) 172.16.2.2.18337 > 172.16.2.1.53: [bad udp cksum 0x5c58 -> 0x16e4!] 40222+ A? google.be. (27) PR: 122773 Differential Revision: https://reviews.freebsd.org/D17625 Modified: head/contrib/tcpdump/print-pflog.c Modified: head/contrib/tcpdump/print-pflog.c ============================================================================== --- head/contrib/tcpdump/print-pflog.c Sun Oct 21 18:39:34 2018 (r339556) +++ head/contrib/tcpdump/print-pflog.c Sun Oct 21 21:17:42 2018 (r339557) @@ -97,8 +97,12 @@ pflog_print(netdissect_options *ndo, const struct pflo else ND_PRINT((ndo, "rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr)); - ND_PRINT((ndo, "%s: %s %s on %s: ", - tok2str(pf_reasons, "unkn(%u)", hdr->reason), + ND_PRINT((ndo, "%s", tok2str(pf_reasons, "unkn(%u)", hdr->reason))); + + if (hdr->uid != UID_MAX) + ND_PRINT((ndo, " [uid %u]", (unsigned)hdr->uid)); + + ND_PRINT((ndo, ": %s %s on %s: ", tok2str(pf_actions, "unkn(%u)", hdr->action), tok2str(pf_directions, "unkn(%u)", hdr->dir), hdr->ifname)); From owner-svn-src-head@freebsd.org Sun Oct 21 21:29:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE9A61036FE9; Sun, 21 Oct 2018 21:29:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75C8F79764; Sun, 21 Oct 2018 21:29:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 621D413176; Sun, 21 Oct 2018 21:29:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9LLTKZb085977; Sun, 21 Oct 2018 21:29:20 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9LLTKRl085976; Sun, 21 Oct 2018 21:29:20 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810212129.w9LLTKRl085976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 21 Oct 2018 21:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339558 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339558 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, 21 Oct 2018 21:29:21 -0000 Author: eugen Date: Sun Oct 21 21:29:19 2018 New Revision: 339558 URL: https://svnweb.freebsd.org/changeset/base/339558 Log: New sysctl: net.inet.icmp.error_keeptags Currently, icmp_error() function copies FIB number from original packet into generated ICMP response but not mbuf_tags(9) chain. This prevents us from easily matching ICMP responses corresponding to tagged original packets by means of packet filter such as ipfw(8). For example, ICMP "time-exceeded in-transit" packets usually generated in response to traceroute probes lose tags attached to original packets. This change adds new sysctl net.inet.icmp.error_keeptags that defaults to 0 to avoid extra overhead when this feature not needed. Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags from original packet to generated ICMP response. PR: 215874 MFC after: 1 month Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Sun Oct 21 21:17:42 2018 (r339557) +++ head/sys/netinet/ip_icmp.c Sun Oct 21 21:29:19 2018 (r339558) @@ -158,6 +158,12 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFL &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); +VNET_DEFINE_STATIC(int, error_keeptags) = 0; +#define V_error_keeptags VNET(error_keeptags) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(error_keeptags), 0, + "ICMP error response keeps copy of mbuf_tags of original packet"); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif @@ -367,6 +373,10 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; nip->ip_off = 0; + + if (V_error_keeptags) + m_tag_copy_chain(m, n, M_NOWAIT); + icmp_reflect(m); freeit: From owner-svn-src-head@freebsd.org Mon Oct 22 00:21:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AF04FD6105; Mon, 22 Oct 2018 00:21:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C50CF7E41D; Mon, 22 Oct 2018 00:21:27 +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 BF8D914E20; Mon, 22 Oct 2018 00:21:27 +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 w9M0LRUi076236; Mon, 22 Oct 2018 00:21:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M0LRFp076234; Mon, 22 Oct 2018 00:21:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810220021.w9M0LRFp076234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 22 Oct 2018 00:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339559 - in head/sys/powerpc: booke include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: booke include X-SVN-Commit-Revision: 339559 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, 22 Oct 2018 00:21:28 -0000 Author: jhibbits Date: Mon Oct 22 00:21:27 2018 New Revision: 339559 URL: https://svnweb.freebsd.org/changeset/base/339559 Log: powerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands debugf() is unnecessary for the TLB printing functions, as they're only intended to be used from ddb. Instead, make them full DDB 'show' commands, so now it can be written as 'show tlb1' and 'show tlb0' instead of calling the function, hoping DEBUG has been defined. Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/tlb.h Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Oct 21 21:29:19 2018 (r339558) +++ head/sys/powerpc/booke/pmap.c Mon Oct 22 00:21:27 2018 (r339559) @@ -77,6 +77,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include @@ -123,6 +124,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "mmu_if.h" #define SPARSE_MAPDEV @@ -221,11 +224,13 @@ static vm_offset_t tlb1_map_base = VM_MAXUSER_ADDRESS static tlbtid_t tid_alloc(struct pmap *); static void tid_flush(tlbtid_t tid); +#ifdef DDB #ifdef __powerpc64__ static void tlb_print_entry(int, uint32_t, uint64_t, uint32_t, uint32_t); #else static void tlb_print_entry(int, uint32_t, uint32_t, uint32_t, uint32_t); #endif +#endif static void tlb1_read_entry(tlb_entry_t *, unsigned int); static void tlb1_write_entry(tlb_entry_t *, unsigned int); @@ -3783,45 +3788,6 @@ tid_alloc(pmap_t pmap) /* TLB0 handling */ /**************************************************************************/ -static void -#ifdef __powerpc64__ -tlb_print_entry(int i, uint32_t mas1, uint64_t mas2, uint32_t mas3, -#else -tlb_print_entry(int i, uint32_t mas1, uint32_t mas2, uint32_t mas3, -#endif - uint32_t mas7) -{ - int as; - char desc[3]; - tlbtid_t tid; - vm_size_t size; - unsigned int tsize; - - desc[2] = '\0'; - if (mas1 & MAS1_VALID) - desc[0] = 'V'; - else - desc[0] = ' '; - - if (mas1 & MAS1_IPROT) - desc[1] = 'P'; - else - desc[1] = ' '; - - as = (mas1 & MAS1_TS_MASK) ? 1 : 0; - tid = MAS1_GETTID(mas1); - - tsize = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; - size = 0; - if (tsize) - size = tsize2size(tsize); - - debugf("%3d: (%s) [AS=%d] " - "sz = 0x%08x tsz = %d tid = %d mas1 = 0x%08x " - "mas2(va) = 0x%"PRI0ptrX" mas3(pa) = 0x%08x mas7 = 0x%08x\n", - i, desc, as, size, tsize, tid, mas1, mas2, mas3, mas7); -} - /* Convert TLB0 va and way number to tlb0[] table index. */ static inline unsigned int tlb0_tableidx(vm_offset_t va, unsigned int way) @@ -3851,41 +3817,7 @@ tlb0_flush_entry(vm_offset_t va) CTR1(KTR_PMAP, "%s: e", __func__); } -/* Print out contents of the MAS registers for each TLB0 entry */ -void -tlb0_print_tlbentries(void) -{ - uint32_t mas0, mas1, mas3, mas7; -#ifdef __powerpc64__ - uint64_t mas2; -#else - uint32_t mas2; -#endif - int entryidx, way, idx; - debugf("TLB0 entries:\n"); - for (way = 0; way < TLB0_WAYS; way ++) - for (entryidx = 0; entryidx < TLB0_ENTRIES_PER_WAY; entryidx++) { - - mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(way); - mtspr(SPR_MAS0, mas0); - __asm __volatile("isync"); - - mas2 = entryidx << MAS2_TLB0_ENTRY_IDX_SHIFT; - mtspr(SPR_MAS2, mas2); - - __asm __volatile("isync; tlbre"); - - mas1 = mfspr(SPR_MAS1); - mas2 = mfspr(SPR_MAS2); - mas3 = mfspr(SPR_MAS3); - mas7 = mfspr(SPR_MAS7); - - idx = tlb0_tableidx(mas2, way); - tlb_print_entry(idx, mas1, mas2, mas3, mas7); - } -} - /**************************************************************************/ /* TLB1 handling */ /**************************************************************************/ @@ -4329,37 +4261,7 @@ set_mas4_defaults(void) __asm __volatile("isync"); } -/* - * Print out contents of the MAS registers for each TLB1 entry - */ -void -tlb1_print_tlbentries(void) -{ - uint32_t mas0, mas1, mas3, mas7; -#ifdef __powerpc64__ - uint64_t mas2; -#else - uint32_t mas2; -#endif - int i; - debugf("TLB1 entries:\n"); - for (i = 0; i < TLB1_ENTRIES; i++) { - - mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i); - mtspr(SPR_MAS0, mas0); - - __asm __volatile("isync; tlbre"); - - mas1 = mfspr(SPR_MAS1); - mas2 = mfspr(SPR_MAS2); - mas3 = mfspr(SPR_MAS3); - mas7 = mfspr(SPR_MAS7); - - tlb_print_entry(i, mas1, mas2, mas3, mas7); - } -} - /* * Return 0 if the physical IO range is encompassed by one of the * the TLB1 entries, otherwise return related error code. @@ -4454,3 +4356,108 @@ tid_flush(tlbtid_t tid) } mtmsr(msr); } + +#ifdef DDB +/* Print out contents of the MAS registers for each TLB0 entry */ +static void +#ifdef __powerpc64__ +tlb_print_entry(int i, uint32_t mas1, uint64_t mas2, uint32_t mas3, +#else +tlb_print_entry(int i, uint32_t mas1, uint32_t mas2, uint32_t mas3, +#endif + uint32_t mas7) +{ + int as; + char desc[3]; + tlbtid_t tid; + vm_size_t size; + unsigned int tsize; + + desc[2] = '\0'; + if (mas1 & MAS1_VALID) + desc[0] = 'V'; + else + desc[0] = ' '; + + if (mas1 & MAS1_IPROT) + desc[1] = 'P'; + else + desc[1] = ' '; + + as = (mas1 & MAS1_TS_MASK) ? 1 : 0; + tid = MAS1_GETTID(mas1); + + tsize = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; + size = 0; + if (tsize) + size = tsize2size(tsize); + + printf("%3d: (%s) [AS=%d] " + "sz = 0x%08x tsz = %d tid = %d mas1 = 0x%08x " + "mas2(va) = 0x%"PRI0ptrX" mas3(pa) = 0x%08x mas7 = 0x%08x\n", + i, desc, as, size, tsize, tid, mas1, mas2, mas3, mas7); +} + +DB_SHOW_COMMAND(tlb0, tlb0_print_tlbentries) +{ + uint32_t mas0, mas1, mas3, mas7; +#ifdef __powerpc64__ + uint64_t mas2; +#else + uint32_t mas2; +#endif + int entryidx, way, idx; + + printf("TLB0 entries:\n"); + for (way = 0; way < TLB0_WAYS; way ++) + for (entryidx = 0; entryidx < TLB0_ENTRIES_PER_WAY; entryidx++) { + + mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(way); + mtspr(SPR_MAS0, mas0); + __asm __volatile("isync"); + + mas2 = entryidx << MAS2_TLB0_ENTRY_IDX_SHIFT; + mtspr(SPR_MAS2, mas2); + + __asm __volatile("isync; tlbre"); + + mas1 = mfspr(SPR_MAS1); + mas2 = mfspr(SPR_MAS2); + mas3 = mfspr(SPR_MAS3); + mas7 = mfspr(SPR_MAS7); + + idx = tlb0_tableidx(mas2, way); + tlb_print_entry(idx, mas1, mas2, mas3, mas7); + } +} + +/* + * Print out contents of the MAS registers for each TLB1 entry + */ +DB_SHOW_COMMAND(tlb1, tlb1_print_tlbentries) +{ + uint32_t mas0, mas1, mas3, mas7; +#ifdef __powerpc64__ + uint64_t mas2; +#else + uint32_t mas2; +#endif + int i; + + printf("TLB1 entries:\n"); + for (i = 0; i < TLB1_ENTRIES; i++) { + + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i); + mtspr(SPR_MAS0, mas0); + + __asm __volatile("isync; tlbre"); + + mas1 = mfspr(SPR_MAS1); + mas2 = mfspr(SPR_MAS2); + mas3 = mfspr(SPR_MAS3); + mas7 = mfspr(SPR_MAS7); + + tlb_print_entry(i, mas1, mas2, mas3, mas7); + } +} +#endif Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Sun Oct 21 21:29:19 2018 (r339558) +++ head/sys/powerpc/include/tlb.h Mon Oct 22 00:21:27 2018 (r339559) @@ -152,12 +152,8 @@ typedef struct tlb_entry { uint32_t mas7; } tlb_entry_t; -void tlb0_print_tlbentries(void); - void tlb1_inval_entry(unsigned int); void tlb1_init(void); -void tlb1_print_entries(void); -void tlb1_print_tlbentries(void); #endif /* !LOCORE */ #elif defined(BOOKE_PPC4XX) From owner-svn-src-head@freebsd.org Mon Oct 22 00:27:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BEAFD641D; Mon, 22 Oct 2018 00:27:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7C087E7AF; Mon, 22 Oct 2018 00:27:37 +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 B47A614E74; Mon, 22 Oct 2018 00:27:37 +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 w9M0Rbul077324; Mon, 22 Oct 2018 00:27:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M0RbXD077323; Mon, 22 Oct 2018 00:27:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810220027.w9M0RbXD077323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 22 Oct 2018 00:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339560 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 339560 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, 22 Oct 2018 00:27:38 -0000 Author: jhibbits Date: Mon Oct 22 00:27:37 2018 New Revision: 339560 URL: https://svnweb.freebsd.org/changeset/base/339560 Log: powerpc: stash off srr0 in si_addr for signals si_addr is the address of the instruction executing at the time the signal was sent. Populate this field with srr0, which, though not always the case, is most often the instruction that triggered the fault. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Oct 22 00:21:27 2018 (r339559) +++ head/sys/powerpc/powerpc/trap.c Mon Oct 22 00:27:37 2018 (r339560) @@ -438,7 +438,7 @@ trap(struct trapframe *frame) ksiginfo_init_trap(&ksi); ksi.ksi_signo = sig; ksi.ksi_code = (int) ucode; /* XXX, not POSIX */ - /* ksi.ksi_addr = ? */ + ksi.ksi_addr = (void *)frame->srr0; ksi.ksi_trapno = type; trapsignal(td, &ksi); } From owner-svn-src-head@freebsd.org Mon Oct 22 01:27:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11E9EFD7607; Mon, 22 Oct 2018 01:27:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC5198038C; Mon, 22 Oct 2018 01:27:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2FA61580F; Mon, 22 Oct 2018 01:27:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9M1RBiJ008164; Mon, 22 Oct 2018 01:27:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M1RBOD008163; Mon, 22 Oct 2018 01:27:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810220127.w9M1RBOD008163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Oct 2018 01:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339561 - head/sys/crypto/chacha20 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/chacha20 X-SVN-Commit-Revision: 339561 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, 22 Oct 2018 01:27:12 -0000 Author: cem Date: Mon Oct 22 01:27:11 2018 New Revision: 339561 URL: https://svnweb.freebsd.org/changeset/base/339561 Log: Add explicit copyright text to trivial header Reported by: rgrimes Modified: head/sys/crypto/chacha20/_chacha.h Modified: head/sys/crypto/chacha20/_chacha.h ============================================================================== --- head/sys/crypto/chacha20/_chacha.h Mon Oct 22 00:27:37 2018 (r339560) +++ head/sys/crypto/chacha20/_chacha.h Mon Oct 22 01:27:11 2018 (r339561) @@ -1,4 +1,7 @@ /* $FreeBSD$ */ +/* + * Public domain. + */ #ifndef _CHACHA_H #define _CHACHA_H From owner-svn-src-head@freebsd.org Mon Oct 22 02:28:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3792DFD8713; Mon, 22 Oct 2018 02:28:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D63048176E; Mon, 22 Oct 2018 02:28:18 +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 CB66C161B0; Mon, 22 Oct 2018 02:28:18 +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 w9M2SIU3038207; Mon, 22 Oct 2018 02:28:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2SIKE038205; Mon, 22 Oct 2018 02:28:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220228.w9M2SIKE038205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339562 - in head/sys: amd64/conf i386/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 339562 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, 22 Oct 2018 02:28:19 -0000 Author: imp Date: Mon Oct 22 02:28:18 2018 New Revision: 339562 URL: https://svnweb.freebsd.org/changeset/base/339562 Log: Remove the gone_in(12) devices. We're planning on removing adv, adw, aha, aic, bt, ncv, nsp, and stg soon. They have been tagged for removal in 12. At least get them out of GENERIC. MFC after: 3 days Relnotes: yes Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Oct 22 01:27:11 2018 (r339561) +++ head/sys/amd64/conf/GENERIC Mon Oct 22 02:28:18 2018 (r339562) @@ -142,11 +142,6 @@ device mpr # LSI-Logic MPT-Fusion 3 #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') device trm # Tekram DC395U/UW/F DC315U adapters - -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters device isci # Intel C600 SAS controller device ocs_fc # Emulex FC adapters Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Oct 22 01:27:11 2018 (r339561) +++ head/sys/i386/conf/GENERIC Mon Oct 22 02:28:18 2018 (r339562) @@ -135,16 +135,6 @@ device mpr # LSI-Logic MPT-Fusion 3 #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') device trm # Tekram DC395U/UW/F DC315U adapters - -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aha # Adaptec 154x SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters - -device ncv # NCR 53C500 -device nsp # Workbit Ninja SCSI-3 -device stg # TMC 18C30/18C50 device isci # Intel C600 SAS controller # ATA/SCSI peripherals From owner-svn-src-head@freebsd.org Mon Oct 22 02:34:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 326E0FD8A57; Mon, 22 Oct 2018 02:34:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C80A581C4E; Mon, 22 Oct 2018 02:34:01 +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 BD6D516346; Mon, 22 Oct 2018 02:34:01 +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 w9M2Y19p043496; Mon, 22 Oct 2018 02:34:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2Y0Wk043492; Mon, 22 Oct 2018 02:34:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys X-SVN-Commit-Revision: 339563 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, 22 Oct 2018 02:34:02 -0000 Author: imp Date: Mon Oct 22 02:34:00 2018 New Revision: 339563 URL: https://svnweb.freebsd.org/changeset/base/339563 Log: Remove joy(4) driver. This driver was marked as gone in 12. We're at 13 now. Remove it. Data from nycbug's dmesg cache shows only one potential user, suggesting it never was used much. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D17629 Deleted: head/share/man/man4/joy.4 head/sys/dev/joy/joy.c head/sys/dev/joy/joy_isa.c head/sys/dev/joy/joyvar.h head/sys/modules/joy/Makefile head/sys/sys/joystick.h head/tools/kerneldoc/subsys/Doxyfile-dev_joy Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 22 02:28:18 2018 (r339562) +++ head/ObsoleteFiles.inc Mon Oct 22 02:34:00 2018 (r339563) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20181021: joy(4) removal +OLD_FILES+=usr/share/man/man4/joy.4.gz +OLD_FILES+=usr/include/sys/joystick.h # 20181015: Stale libcasper(3) files following r329452 OLD_LIBS+=lib/casper/libcap_sysctl.so.0 OLD_LIBS+=lib/casper/libcap_grp.so.0 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:28:18 2018 (r339562) +++ head/share/man/man4/Makefile Mon Oct 22 02:34:00 2018 (r339563) @@ -243,7 +243,6 @@ MAN= aac.4 \ ixl.4 \ jedec_dimm.4 \ jme.4 \ - joy.4 \ kbdmux.4 \ keyboard.4 \ kld.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:28:18 2018 (r339562) +++ head/sys/conf/NOTES Mon Oct 22 02:34:00 2018 (r339563) @@ -2366,12 +2366,8 @@ options SND_OLDSTEREO # Miscellaneous hardware: # # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board -# joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader -device joy # PnP aware, hints for non-PnP only -hint.joy.0.at="isa" -hint.joy.0.port="0x201" device cmx # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:28:18 2018 (r339562) +++ head/sys/conf/files Mon Oct 22 02:34:00 2018 (r339563) @@ -2311,8 +2311,6 @@ dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv ine compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jedec_dimm/jedec_dimm.c optional jedec_dimm smbus dev/jme/if_jme.c optional jme pci -dev/joy/joy.c optional joy -dev/joy/joy_isa.c optional joy isa dev/kbd/kbd.c optional atkbd | pckbd | sc | ukbd | vt dev/kbdmux/kbdmux.c optional kbdmux dev/ksyms/ksyms.c optional ksyms Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:28:18 2018 (r339562) +++ head/sys/modules/Makefile Mon Oct 22 02:34:00 2018 (r339563) @@ -208,7 +208,6 @@ SUBDIR= \ ${_ixv} \ ${_ixl} \ jme \ - joy \ kbdmux \ kgssapi \ kgssapi_krb5 \ From owner-svn-src-head@freebsd.org Mon Oct 22 02:34:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E82DFD8A84; Mon, 22 Oct 2018 02:34:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 018AE81D54; Mon, 22 Oct 2018 02:34:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F087416347; Mon, 22 Oct 2018 02:34: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 w9M2YD1L043564; Mon, 22 Oct 2018 02:34:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2YBLU043551; Mon, 22 Oct 2018 02:34:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220234.w9M2YBLU043551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339564 - in head: . share/man/man4 share/man/man4/man4.i386 share/man/man5 sys/conf sys/dev/mse sys/i386/conf sys/modules sys/modules/mse sys/sys tools/kerneldoc/subsys usr.sbin/bsdcon... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/man/man4 share/man/man4/man4.i386 share/man/man5 sys/conf sys/dev/mse sys/i386/conf sys/modules sys/modules/mse sys/sys tools/kerneldoc/subsys usr.sbin/bsdconfig/mouse usr.sbin/bsdcon... X-SVN-Commit-Revision: 339564 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, 22 Oct 2018 02:34:14 -0000 Author: imp Date: Mon Oct 22 02:34:10 2018 New Revision: 339564 URL: https://svnweb.freebsd.org/changeset/base/339564 Log: Remove mse(4) from tree Remove mse and all support for bus and inport devices from the tree. Data from nycbug's dmesg database shows the last sighting of this driver was in 4.10 on only one machine. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D17628 Deleted: head/share/man/man4/man4.i386/mse.4 head/sys/dev/mse/mse.c head/sys/dev/mse/mse_isa.c head/sys/dev/mse/msevar.h head/sys/modules/mse/Makefile head/tools/kerneldoc/subsys/Doxyfile-dev_mse Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/share/man/man4/mouse.4 head/share/man/man4/psm.4 head/share/man/man5/rc.conf.5 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/Makefile head/sys/sys/mouse.h head/usr.sbin/bsdconfig/mouse/include/messages.subr head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/moused/moused.8 head/usr.sbin/moused/moused.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 22 02:34:00 2018 (r339563) +++ head/ObsoleteFiles.inc Mon Oct 22 02:34:10 2018 (r339564) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181021: mse(4) removal +OLD_FILES+=usr/share/man/man4/mse.4.gz # 20181021: joy(4) removal OLD_FILES+=usr/share/man/man4/joy.4.gz OLD_FILES+=usr/include/sys/joystick.h Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Mon Oct 22 02:34:00 2018 (r339563) +++ head/share/man/man4/man4.i386/Makefile Mon Oct 22 02:34:10 2018 (r339564) @@ -16,7 +16,6 @@ MAN= aic.4 \ glxiic.4 \ glxsb.4 \ longrun.4 \ - mse.4 \ npx.4 \ pae.4 \ pbio.4 \ Modified: head/share/man/man4/mouse.4 ============================================================================== --- head/share/man/man4/mouse.4 Mon Oct 22 02:34:00 2018 (r339563) +++ head/share/man/man4/mouse.4 Mon Oct 22 02:34:10 2018 (r339564) @@ -36,7 +36,6 @@ .In sys/mouse.h .Sh DESCRIPTION The mouse drivers -.Xr mse 4 , .Xr psm 4 , .Xr ums 4 and @@ -360,8 +359,6 @@ command. .Bl -tag -width /dev/sysmouseXX -compact .It Pa /dev/cuau%d serial ports -.It Pa /dev/mse%d -bus and InPort mouse device .It Pa /dev/psm%d PS/2 mouse device .It Pa /dev/sysmouse @@ -371,7 +368,6 @@ USB mouse device .El .Sh SEE ALSO .Xr ioctl 2 , -.Xr mse 4 , .Xr psm 4 , .Xr sysmouse 4 , .Xr ums 4 , Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Mon Oct 22 02:34:00 2018 (r339563) +++ head/share/man/man4/psm.4 Mon Oct 22 02:34:10 2018 (r339564) @@ -806,7 +806,6 @@ At debug level 2, much more detailed information is lo .Xr syslog 3 , .Xr atkbdc 4 , .Xr mouse 4 , -.Xr mse 4 , .Xr sysmouse 4 , .Xr moused 8 , .Xr syslogd 8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Oct 22 02:34:00 2018 (r339563) +++ head/share/man/man5/rc.conf.5 Mon Oct 22 02:34:10 2018 (r339564) @@ -3256,11 +3256,9 @@ is set to this is the actual port the mouse is on. It might be .Pa /dev/cuau0 -for a COM1 serial mouse, +for a COM1 serial mouse, or .Pa /dev/psm0 -for a PS/2 mouse or -.Pa /dev/mse0 -for a bus mouse, for example. +for a PS/2 mouse, for example. .It Va moused_flags .Pq Vt str If Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Oct 22 02:34:00 2018 (r339563) +++ head/sys/conf/files.i386 Mon Oct 22 02:34:10 2018 (r339564) @@ -278,8 +278,6 @@ dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux dev/le/if_le_isa.c optional le isa -dev/mse/mse.c optional mse -dev/mse/mse_isa.c optional mse isa dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Oct 22 02:34:00 2018 (r339563) +++ head/sys/i386/conf/NOTES Mon Oct 22 02:34:10 2018 (r339564) @@ -501,14 +501,6 @@ device viadrm # VIA options DRM_DEBUG # Include debug printfs (slow) # -# mse: Logitech and ATI InPort bus mouse ports - -device mse -hint.mse.0.at="isa" -hint.mse.0.port="0x23c" -hint.mse.0.irq="5" - -# # Network interfaces: # Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:34:00 2018 (r339563) +++ head/sys/modules/Makefile Mon Oct 22 02:34:10 2018 (r339564) @@ -260,7 +260,6 @@ SUBDIR= \ mrsas \ msdosfs \ msdosfs_iconv \ - ${_mse} \ msk \ ${_mthca} \ mvs \ @@ -761,7 +760,6 @@ _cp= cp _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 -_mse= mse _ncr= ncr _ncv= ncv _nsp= nsp Modified: head/sys/sys/mouse.h ============================================================================== --- head/sys/sys/mouse.h Mon Oct 22 02:34:00 2018 (r339563) +++ head/sys/sys/mouse.h Mon Oct 22 02:34:10 2018 (r339564) @@ -141,8 +141,8 @@ typedef struct synapticshw { /* iftype */ #define MOUSE_IF_UNKNOWN (-1) #define MOUSE_IF_SERIAL 0 -#define MOUSE_IF_BUS 1 -#define MOUSE_IF_INPORT 2 +/* 1 was bus */ +/* 2 was inport */ #define MOUSE_IF_PS2 3 #define MOUSE_IF_SYSMOUSE 4 #define MOUSE_IF_USB 5 @@ -200,8 +200,8 @@ typedef struct mousemode { #define MOUSE_PROTO_LOGI 2 /* Logitech, 3 bytes */ #define MOUSE_PROTO_MM 3 /* MM series, 3 bytes */ #define MOUSE_PROTO_LOGIMOUSEMAN 4 /* Logitech MouseMan 3/4 bytes */ -#define MOUSE_PROTO_BUS 5 /* MS/Logitech bus mouse */ -#define MOUSE_PROTO_INPORT 6 /* MS/ATI InPort mouse */ +/* 5 was bus mouse */ +/* 6 was inport mosue */ #define MOUSE_PROTO_PS2 7 /* PS/2 mouse, 3 bytes */ #define MOUSE_PROTO_HITTAB 8 /* Hitachi Tablet 3 bytes */ #define MOUSE_PROTO_GLIDEPOINT 9 /* ALPS GlidePoint, 3/4 bytes */ Modified: head/usr.sbin/bsdconfig/mouse/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/mouse/include/messages.subr Mon Oct 22 02:34:00 2018 (r339563) +++ head/usr.sbin/bsdconfig/mouse/include/messages.subr Mon Oct 22 02:34:10 2018 (r339564) @@ -27,8 +27,6 @@ hline_press_enter_or_space="Press enter or space" msg_auto="Auto" msg_auto_desc="Bus mouse, PS/2 style mouse or PnP serial mouse" -msg_busmouse="BusMouse" -msg_busmouse_desc="Logitech, ATI or MS bus mouse (/dev/mse0)" msg_cancel="Cancel" msg_com1="COM1" msg_com1_desc="Serial mouse on COM1 (/dev/cuau0)" Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Mon Oct 22 02:34:00 2018 (r339563) +++ head/usr.sbin/bsdconfig/mouse/port Mon Oct 22 02:34:10 2018 (r339564) @@ -56,7 +56,6 @@ dialog_menu_main() '3 $msg_com2' '$msg_com2_desc' '4 $msg_com3' '$msg_com3_desc' '5 $msg_com4' '$msg_com4_desc' - '6 $msg_busmouse' '$msg_busmouse_desc' " # END-QUOTE local defaultitem= # Calculated below local hline= @@ -75,7 +74,6 @@ dialog_menu_main() /dev/cuau1) defaultitem="3 $msg_com2" ;; /dev/cuau2) defaultitem="4 $msg_com3" ;; /dev/cuau3) defaultitem="5 $msg_com4" ;; - /dev/mse0) defaultitem="6 $msg_busmouse" ;; esac local menu_choice @@ -136,8 +134,6 @@ case "$mtag" in moused_port_to_set="/dev/cuau2" ;; "5 $msg_com4") # Serial mouse on COM4 (/dev/cuau3) moused_port_to_set="/dev/cuau3" ;; -"6 $msg_busmouse") # Logitech, ATI or MS bus mouse (/dev/mse0) - moused_port_to_set="/dev/mse0" ;; esac if [ "$moused_port_to_set" ]; then Modified: head/usr.sbin/moused/moused.8 ============================================================================== --- head/usr.sbin/moused/moused.8 Mon Oct 22 02:34:00 2018 (r339563) +++ head/usr.sbin/moused/moused.8 Mon Oct 22 02:34:10 2018 (r339564) @@ -297,7 +297,6 @@ information are: .It Ar port Port (device file) name, i.e.\& .Pa /dev/cuau0 , -.Pa /dev/mse0 and .Pa /dev/psm0 . .It Ar if @@ -555,10 +554,7 @@ what matters. The USB mouse has a flat rectangular connector. .Pp The next thing to decide is a port to use for the given interface. -For the bus, InPort and PS/2 mice, there is little choice: -the bus and InPort mice always use -.Pa /dev/mse0 , -and the PS/2 mouse is always at +The PS/2 mouse is always at .Pa /dev/psm0 . There may be more than one serial port to which the serial mouse can be attached. @@ -713,8 +709,6 @@ the mice is combined all together. .Bl -tag -width /dev/consolectl -compact .It Pa /dev/consolectl device to control the console -.It Pa /dev/mse%d -bus and InPort mouse driver .It Pa /dev/psm%d PS/2 mouse driver .It Pa /dev/sysmouse @@ -792,7 +786,6 @@ you keep brushing over the mouse pad while typing. .Xr vidcontrol 1 , .Xr xset 1 , .Xr keyboard 4 , -.Xr mse 4 , .Xr psm 4 , .Xr screen 4 , .Xr sysmouse 4 , Modified: head/usr.sbin/moused/moused.c ============================================================================== --- head/usr.sbin/moused/moused.c Mon Oct 22 02:34:00 2018 (r339563) +++ head/usr.sbin/moused/moused.c Mon Oct 22 02:34:10 2018 (r339564) @@ -198,8 +198,6 @@ static int hscroll_movement; /* interface (the table must be ordered by MOUSE_IF_XXX in mouse.h) */ static symtab_t rifs[] = { { "serial", MOUSE_IF_SERIAL, 0 }, - { "bus", MOUSE_IF_BUS, 0 }, - { "inport", MOUSE_IF_INPORT, 0 }, { "ps/2", MOUSE_IF_PS2, 0 }, { "sysmouse", MOUSE_IF_SYSMOUSE, 0 }, { "usb", MOUSE_IF_USB, 0 }, @@ -213,8 +211,8 @@ static const char *rnames[] = { "logitech", "mmseries", "mouseman", - "busmouse", - "inportmouse", + "wasbusmouse", + "wasinportmouse", "ps/2", "mmhitab", "glidepoint", @@ -290,12 +288,8 @@ static symtab_t pnpprod[] = { /* Mitsumi Wireless Scroll Mouse */ { "MTM6401", MOUSE_PROTO_INTELLI, MOUSE_MODEL_INTELLI }, - /* MS bus */ - { "PNP0F00", MOUSE_PROTO_BUS, MOUSE_MODEL_GENERIC }, /* MS serial */ { "PNP0F01", MOUSE_PROTO_MS, MOUSE_MODEL_GENERIC }, - /* MS InPort */ - { "PNP0F02", MOUSE_PROTO_INPORT, MOUSE_MODEL_GENERIC }, /* MS PS/2 */ { "PNP0F03", MOUSE_PROTO_PS2, MOUSE_MODEL_GENERIC }, /* @@ -322,8 +316,6 @@ static symtab_t pnpprod[] = { { "PNP0F0B", MOUSE_PROTO_MS, MOUSE_MODEL_GENERIC }, /* MS serial comatible */ { "PNP0F0C", MOUSE_PROTO_MS, MOUSE_MODEL_GENERIC }, - /* MS InPort comatible */ - { "PNP0F0D", MOUSE_PROTO_INPORT, MOUSE_MODEL_GENERIC }, /* MS PS/2 comatible */ { "PNP0F0E", MOUSE_PROTO_PS2, MOUSE_MODEL_GENERIC }, /* MS BallPoint comatible */ @@ -332,8 +324,6 @@ static symtab_t pnpprod[] = { /* TI QuickPort */ { "PNP0F10", MOUSE_PROTO_XXX, MOUSE_MODEL_GENERIC }, #endif - /* MS bus comatible */ - { "PNP0F11", MOUSE_PROTO_BUS, MOUSE_MODEL_GENERIC }, /* Logitech PS/2 */ { "PNP0F12", MOUSE_PROTO_PS2, MOUSE_MODEL_GENERIC }, /* PS/2 */ @@ -342,16 +332,12 @@ static symtab_t pnpprod[] = { /* MS Kids Mouse */ { "PNP0F14", MOUSE_PROTO_XXX, MOUSE_MODEL_GENERIC }, #endif - /* Logitech bus */ - { "PNP0F15", MOUSE_PROTO_BUS, MOUSE_MODEL_GENERIC }, #if notyet /* Logitech SWIFT */ { "PNP0F16", MOUSE_PROTO_XXX, MOUSE_MODEL_GENERIC }, #endif /* Logitech serial compat */ { "PNP0F17", MOUSE_PROTO_LOGIMOUSEMAN, MOUSE_MODEL_GENERIC }, - /* Logitech bus compatible */ - { "PNP0F18", MOUSE_PROTO_BUS, MOUSE_MODEL_GENERIC }, /* Logitech PS/2 compatible */ { "PNP0F19", MOUSE_PROTO_PS2, MOUSE_MODEL_GENERIC }, #if notyet @@ -860,15 +846,6 @@ main(int argc, char *argv[]) /* the default port name */ switch(rodent.rtype) { - case MOUSE_PROTO_INPORT: - /* INPORT and BUS are the same... */ - rodent.rtype = MOUSE_PROTO_BUS; - /* FALLTHROUGH */ - case MOUSE_PROTO_BUS: - if (!rodent.portname) - rodent.portname = "/dev/mse0"; - break; - case MOUSE_PROTO_PS2: if (!rodent.portname) rodent.portname = "/dev/psm0"; @@ -1519,9 +1496,6 @@ r_identify(void) logwarnx("unknown mouse protocol (%d)", rodent.mode.protocol); return (MOUSE_PROTO_UNKNOWN); } else { - /* INPORT and BUS are the same... */ - if (rodent.mode.protocol == MOUSE_PROTO_INPORT) - rodent.mode.protocol = MOUSE_PROTO_BUS; if (rodent.mode.protocol != rodent.rtype) { /* Hmm, the driver doesn't agree with the user... */ if (rodent.rtype != MOUSE_PROTO_UNKNOWN) @@ -1559,8 +1533,6 @@ r_identify(void) } else { rodent.mode.protocol = MOUSE_PROTO_UNKNOWN; } - if (rodent.mode.protocol == MOUSE_PROTO_INPORT) - rodent.mode.protocol = MOUSE_PROTO_BUS; /* make final adjustment */ if (rodent.mode.protocol != MOUSE_PROTO_UNKNOWN) { @@ -1771,8 +1743,6 @@ r_init(void) setmousespeed(1200, rodent.baudrate, rodentcflags[rodent.rtype]); /* FALLTHROUGH */ - case MOUSE_PROTO_BUS: - case MOUSE_PROTO_INPORT: case MOUSE_PROTO_PS2: if (rodent.rate >= 0) rodent.mode.rate = rodent.rate; @@ -2160,13 +2130,6 @@ r_protocol(u_char rBuf, mousestatus_t *act) } prev_x = x; prev_y = y; - break; - - case MOUSE_PROTO_BUS: /* Bus */ - case MOUSE_PROTO_INPORT: /* InPort */ - act->button = butmapmsc[(~pBuf[0]) & MOUSE_MSC_BUTTONS]; - act->dx = (signed char)pBuf[1]; - act->dy = - (signed char)pBuf[2]; break; case MOUSE_PROTO_PS2: /* PS/2 */ From owner-svn-src-head@freebsd.org Mon Oct 22 02:34:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDE88FD8AC4; Mon, 22 Oct 2018 02:34: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8238981E8A; Mon, 22 Oct 2018 02:34: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 7D11416357; Mon, 22 Oct 2018 02:34: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 w9M2YRQa043630; Mon, 22 Oct 2018 02:34:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2YPTt043620; Mon, 22 Oct 2018 02:34:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220234.w9M2YPTt043620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf X-SVN-Commit-Revision: 339565 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, 22 Oct 2018 02:34:28 -0000 Author: imp Date: Mon Oct 22 02:34:25 2018 New Revision: 339565 URL: https://svnweb.freebsd.org/changeset/base/339565 Log: Remove aha(4) from the tree. We tagged aha as gone in 12 a while ago. Proceed with its removal. Data from nycbug's database shows the last sighting of this driver in 6, with the prior one in 4.x show its popularity had died prior to 4.x. Relnotes: yes Deleted: head/share/man/man4/aha.4 head/sys/dev/aha/aha.c head/sys/dev/aha/aha_isa.c head/sys/dev/aha/ahareg.h head/sys/modules/aha/Makefile Modified: head/share/man/man4/Makefile head/share/man/man4/adv.4 head/share/man/man4/ahc.4 head/share/man/man4/man4.i386/aic.4 head/share/man/man4/scsi.4 head/sys/conf/NOTES head/sys/conf/files head/sys/kern/Make.tags.inc head/sys/modules/Makefile head/sys/sparc64/conf/NOTES Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:34:10 2018 (r339564) +++ head/share/man/man4/Makefile Mon Oct 22 02:34:25 2018 (r339565) @@ -29,7 +29,6 @@ MAN= aac.4 \ ${_aesni.4} \ age.4 \ agp.4 \ - aha.4 \ ahc.4 \ ahci.4 \ ahd.4 \ Modified: head/share/man/man4/adv.4 ============================================================================== --- head/share/man/man4/adv.4 Mon Oct 22 02:34:10 2018 (r339564) +++ head/share/man/man4/adv.4 Mon Oct 22 02:34:25 2018 (r339565) @@ -200,7 +200,6 @@ AdvanSys ABP980UA/3980UA .El .Sh SEE ALSO .Xr adw 4 , -.Xr aha 4 , .Xr ahc 4 , .Xr cd 4 , .Xr da 4 , Modified: head/share/man/man4/ahc.4 ============================================================================== --- head/share/man/man4/ahc.4 Mon Oct 22 02:34:10 2018 (r339564) +++ head/share/man/man4/ahc.4 Mon Oct 22 02:34:25 2018 (r339565) @@ -360,7 +360,6 @@ local SCB space serves as a cache for disconnected tra more SCB space available, the less host bus traffic consumed saving and restoring SCB data. .Sh SEE ALSO -.Xr aha 4 , .Xr ahd 4 , .Xr cd 4 , .Xr da 4 , Modified: head/share/man/man4/man4.i386/aic.4 ============================================================================== --- head/share/man/man4/man4.i386/aic.4 Mon Oct 22 02:34:10 2018 (r339564) +++ head/share/man/man4/man4.i386/aic.4 Mon Oct 22 02:34:25 2018 (r339565) @@ -64,7 +64,6 @@ Creative Labs SoundBlaster SCSI host adapter (ISA) Adaptec AHA-1460, AHA-1460B, AHA-1460C, AHA-1460D (PC Card) .El .Sh SEE ALSO -.Xr aha 4 , .Xr ahc 4 , .Xr cd 4 , .Xr ch 4 , Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Mon Oct 22 02:34:10 2018 (r339564) +++ head/share/man/man4/scsi.4 Mon Oct 22 02:34:25 2018 (r339565) @@ -344,7 +344,6 @@ See for details. .Sh SEE ALSO .Xr ada 4 , -.Xr aha 4 , .Xr ahc 4 , .Xr ahci 4 , .Xr ahd 4 , Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:34:10 2018 (r339564) +++ head/sys/conf/NOTES Mon Oct 22 02:34:25 2018 (r339565) @@ -1550,7 +1550,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # # adv: All Narrow SCSI bus AdvanSys controllers. # adw: Second Generation AdvanSys controllers including the ADV940UW. -# aha: Adaptec 154x/1535/1640 # ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/ # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. @@ -1586,8 +1585,6 @@ hint.bt.0.port="0x330" device adv hint.adv.0.at="isa" device adw -device aha -hint.aha.0.at="isa" device aic hint.aic.0.at="isa" device ahc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:34:10 2018 (r339564) +++ head/sys/conf/files Mon Oct 22 02:34:25 2018 (r339565) @@ -767,8 +767,6 @@ dev/ae/if_ae.c optional ae pci dev/age/if_age.c optional age pci dev/agp/agp.c optional agp pci dev/agp/agp_if.m optional agp pci -dev/aha/aha.c optional aha -dev/aha/aha_isa.c optional aha isa dev/ahci/ahci.c optional ahci dev/ahci/ahciem.c optional ahci dev/ahci/ahci_pci.c optional ahci pci Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Mon Oct 22 02:34:10 2018 (r339564) +++ head/sys/kern/Make.tags.inc Mon Oct 22 02:34:25 2018 (r339565) @@ -12,7 +12,6 @@ SYS?= ${.CURDIR}/.. COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/sys/vnode.h \ - ${SYS}/dev/aha/*.[ch] \ ${SYS}/dev/alc/*.[ch] \ ${SYS}/dev/buslogic/*.[ch] \ ${SYS}/dev/dpt/*.[ch] \ @@ -69,7 +68,6 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/sys COMMDIR2= ${SYS}/dev/advansys \ - ${SYS}/dev/aha \ ${SYS}/dev/alc \ ${SYS}/dev/buslogic \ ${SYS}/dev/dpt \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:34:10 2018 (r339564) +++ head/sys/modules/Makefile Mon Oct 22 02:34:25 2018 (r339565) @@ -26,7 +26,6 @@ SUBDIR= \ ${_aesni} \ age \ ${_agp} \ - aha \ ahci \ ${_aic} \ aic7xxx \ Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Mon Oct 22 02:34:10 2018 (r339564) +++ head/sys/sparc64/conf/NOTES Mon Oct 22 02:34:25 2018 (r339565) @@ -119,7 +119,6 @@ nodevice snd_via8233 nodevice snd_via82c686 nodevice snd_vibes nodevice snd_uaudio -nodevice aha nodevice bt nodevice ep nodevice ex From owner-svn-src-head@freebsd.org Mon Oct 22 02:34:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D23FD8AFF; Mon, 22 Oct 2018 02:34: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91B3A81F90; Mon, 22 Oct 2018 02:34: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 8C8AB16368; Mon, 22 Oct 2018 02:34: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 w9M2YaqP043688; Mon, 22 Oct 2018 02:34:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2YZGo043684; Mon, 22 Oct 2018 02:34:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220234.w9M2YZGo043684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339566 - in head: share/man/man4/man4.i386 sys/conf sys/dev/aic sys/modules sys/modules/aic X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4/man4.i386 sys/conf sys/dev/aic sys/modules sys/modules/aic X-SVN-Commit-Revision: 339566 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, 22 Oct 2018 02:34:37 -0000 Author: imp Date: Mon Oct 22 02:34:35 2018 New Revision: 339566 URL: https://svnweb.freebsd.org/changeset/base/339566 Log: Remove aic(4) driver aic was marked to be gone in 12 a while ago. Go ahead and remove it. nycbug's dmesg database shows this was last seen in 6 and one more time in 4.x. It never was popular, and what popularity it had was over before the nycbug databse got going in 2004. Relnotes: yes Deleted: head/share/man/man4/man4.i386/aic.4 head/sys/dev/aic/aic.c head/sys/dev/aic/aic6360reg.h head/sys/dev/aic/aic_isa.c head/sys/dev/aic/aic_pccard.c head/sys/dev/aic/aicvar.h head/sys/modules/aic/Makefile Modified: head/share/man/man4/man4.i386/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.i386 head/sys/modules/Makefile Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Mon Oct 22 02:34:25 2018 (r339565) +++ head/share/man/man4/man4.i386/Makefile Mon Oct 22 02:34:35 2018 (r339566) @@ -2,8 +2,7 @@ PACKAGE=runtime-manuals -MAN= aic.4 \ - apm.4 \ +MAN= apm.4 \ ce.4 \ cp.4 \ CPU_ELAN.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:34:25 2018 (r339565) +++ head/sys/conf/NOTES Mon Oct 22 02:34:35 2018 (r339566) @@ -1553,7 +1553,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/ # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. -# aic: Adaptec 6260/6360, APA-1460 (PC Card) # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F # esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers @@ -1585,8 +1584,6 @@ hint.bt.0.port="0x330" device adv hint.adv.0.at="isa" device adw -device aic -hint.aic.0.at="isa" device ahc device ahd device esp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:34:25 2018 (r339565) +++ head/sys/conf/files Mon Oct 22 02:34:35 2018 (r339566) @@ -770,8 +770,6 @@ dev/agp/agp_if.m optional agp pci dev/ahci/ahci.c optional ahci dev/ahci/ahciem.c optional ahci dev/ahci/ahci_pci.c optional ahci pci -dev/aic/aic.c optional aic -dev/aic/aic_pccard.c optional aic pccard dev/aic7xxx/ahc_isa.c optional ahc isa dev/aic7xxx/ahc_pci.c optional ahc pci \ compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Oct 22 02:34:25 2018 (r339565) +++ head/sys/conf/files.i386 Mon Oct 22 02:34:35 2018 (r339566) @@ -161,7 +161,6 @@ dev/agp/agp_intel.c optional agp dev/agp/agp_nvidia.c optional agp dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp -dev/aic/aic_isa.c optional aic isa dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdsmn/amdsmn.c optional amdsmn | amdtemp dev/amdtemp/amdtemp.c optional amdtemp Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:34:25 2018 (r339565) +++ head/sys/modules/Makefile Mon Oct 22 02:34:35 2018 (r339566) @@ -27,7 +27,6 @@ SUBDIR= \ age \ ${_agp} \ ahci \ - ${_aic} \ aic7xxx \ alc \ ale \ @@ -747,7 +746,6 @@ _vmm= vmm # XXX some of these can move now, but are untested on other architectures. _3dfx= 3dfx _3dfx_linux= 3dfx_linux -_aic= aic _apm= apm .if ${MK_SOURCELESS_UCODE} != "no" _ce= ce From owner-svn-src-head@freebsd.org Mon Oct 22 02:34:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64DB0FD8B4C; Mon, 22 Oct 2018 02:34: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E50EB82099; Mon, 22 Oct 2018 02:34: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 E00BB16369; Mon, 22 Oct 2018 02:34: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 w9M2YmYC043751; Mon, 22 Oct 2018 02:34:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2YlhO043745; Mon, 22 Oct 2018 02:34:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220234.w9M2YlhO043745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339567 - in head: share/man/man4 sys/conf sys/dev/advansys sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/advansys sys/kern X-SVN-Commit-Revision: 339567 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, 22 Oct 2018 02:34:49 -0000 Author: imp Date: Mon Oct 22 02:34:47 2018 New Revision: 339567 URL: https://svnweb.freebsd.org/changeset/base/339567 Log: Remove adv(4) and adw(4) Remove the advanssy drivers (both adv and adw). They were tagged as gone in 12 a while qgo. The nycbug dmesg database shows this was last seen in 6 and there were only a few adv sightings then (none for adw). Relnotes: yes Deleted: head/share/man/man4/adv.4 head/share/man/man4/adw.4 head/sys/dev/advansys/adv_isa.c head/sys/dev/advansys/adv_pci.c head/sys/dev/advansys/advansys.c head/sys/dev/advansys/advansys.h head/sys/dev/advansys/advlib.c head/sys/dev/advansys/advlib.h head/sys/dev/advansys/advmcode.c head/sys/dev/advansys/advmcode.h head/sys/dev/advansys/adw_pci.c head/sys/dev/advansys/adwcam.c head/sys/dev/advansys/adwlib.c head/sys/dev/advansys/adwlib.h head/sys/dev/advansys/adwmcode.c head/sys/dev/advansys/adwmcode.h head/sys/dev/advansys/adwvar.h Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/WITHOUT_SOURCELESS_UCODE head/sys/conf/files head/sys/conf/files.i386 head/sys/conf/options head/sys/kern/Make.tags.inc Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:34:35 2018 (r339566) +++ head/share/man/man4/Makefile Mon Oct 22 02:34:47 2018 (r339567) @@ -23,8 +23,6 @@ MAN= aac.4 \ ${_acpi_wmi.4} \ ada.4 \ adm6996fc.4 \ - adv.4 \ - adw.4 \ ae.4 \ ${_aesni.4} \ age.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:34:35 2018 (r339566) +++ head/sys/conf/NOTES Mon Oct 22 02:34:47 2018 (r339567) @@ -1548,8 +1548,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # # SCSI host adapters: # -# adv: All Narrow SCSI bus AdvanSys controllers. -# adw: Second Generation AdvanSys controllers including the ADV940UW. # ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/ # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. @@ -1581,9 +1579,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) device bt hint.bt.0.at="isa" hint.bt.0.port="0x330" -device adv -hint.adv.0.at="isa" -device adw device ahc device ahd device esp @@ -1643,10 +1638,6 @@ options AHD_REG_PRETTY_PRINT # Bitmap of units to enable targetmode operations. options AHD_TMODE_ENABLE - -# The adw driver will attempt to use memory mapped I/O for all PCI -# controllers that have it configured only if this option is set. -options ADW_ALLOW_MEMIO # Options used in dev/iscsi (Software iSCSI stack) # Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- head/sys/conf/WITHOUT_SOURCELESS_UCODE Mon Oct 22 02:34:35 2018 (r339566) +++ head/sys/conf/WITHOUT_SOURCELESS_UCODE Mon Oct 22 02:34:47 2018 (r339567) @@ -4,7 +4,6 @@ # # $FreeBSD$ -nodevice adw nodevice bce nodevice fxp nodevice ispfw Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:34:35 2018 (r339566) +++ head/sys/conf/files Mon Oct 22 02:34:47 2018 (r339567) @@ -755,14 +755,6 @@ dev/acpica/acpi_throttle.c optional acpi dev/acpica/acpi_video.c optional acpi_video acpi dev/acpica/acpi_dock.c optional acpi_dock acpi dev/adlink/adlink.c optional adlink -dev/advansys/adv_pci.c optional adv pci -dev/advansys/advansys.c optional adv -dev/advansys/advlib.c optional adv -dev/advansys/advmcode.c optional adv -dev/advansys/adw_pci.c optional adw pci -dev/advansys/adwcam.c optional adw -dev/advansys/adwlib.c optional adw -dev/advansys/adwmcode.c optional adw dev/ae/if_ae.c optional ae pci dev/age/if_age.c optional age pci dev/agp/agp.c optional agp pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Oct 22 02:34:35 2018 (r339566) +++ head/sys/conf/files.i386 Mon Oct 22 02:34:47 2018 (r339567) @@ -151,7 +151,6 @@ dev/acpica/acpi_pci_link.c optional acpi pci dev/acpica/acpi_pcib.c optional acpi pci dev/acpica/acpi_pcib_acpi.c optional acpi pci dev/acpica/acpi_pcib_pci.c optional acpi pci -dev/advansys/adv_isa.c optional adv isa dev/agp/agp_ali.c optional agp dev/agp/agp_amd.c optional agp dev/agp/agp_amd64.c optional agp Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Oct 22 02:34:35 2018 (r339566) +++ head/sys/conf/options Mon Oct 22 02:34:47 2018 (r339567) @@ -42,7 +42,6 @@ AHD_DEBUG opt_aic79xx.h AHD_DEBUG_OPTS opt_aic79xx.h AHD_TMODE_ENABLE opt_aic79xx.h AHD_REG_PRETTY_PRINT opt_aic79xx.h -ADW_ALLOW_MEMIO opt_adw.h TWA_DEBUG opt_twa.h Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Mon Oct 22 02:34:35 2018 (r339566) +++ head/sys/kern/Make.tags.inc Mon Oct 22 02:34:47 2018 (r339567) @@ -10,8 +10,7 @@ SYS?= ${.CURDIR}/.. # win when there is a struct tag with the same name (e.g., vmmeter). The # better solution would be for ctags to generate "struct vmmeter" tags. -COMM= ${SYS}/dev/advansys/*.[ch] \ - ${SYS}/sys/vnode.h \ +COMM= ${SYS}/sys/vnode.h \ ${SYS}/dev/alc/*.[ch] \ ${SYS}/dev/buslogic/*.[ch] \ ${SYS}/dev/dpt/*.[ch] \ @@ -67,8 +66,7 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/vm \ ${SYS}/sys -COMMDIR2= ${SYS}/dev/advansys \ - ${SYS}/dev/alc \ +COMMDIR2= ${SYS}/dev/alc \ ${SYS}/dev/buslogic \ ${SYS}/dev/dpt \ ${SYS}/dev/en \ From owner-svn-src-head@freebsd.org Mon Oct 22 02:35:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91338FD8B88; Mon, 22 Oct 2018 02:35:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DC821B8; Mon, 22 Oct 2018 02:35:01 +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 422301636A; Mon, 22 Oct 2018 02:35:01 +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 w9M2Z1Fr043825; Mon, 22 Oct 2018 02:35:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2Z0Qa043818; Mon, 22 Oct 2018 02:35:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220235.w9M2Z0Qa043818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339568 - in head: share/man/man4 sys/conf sys/dev/buslogic sys/kern sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/buslogic sys/kern sys/sparc64/conf X-SVN-Commit-Revision: 339568 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, 22 Oct 2018 02:35:01 -0000 Author: imp Date: Mon Oct 22 02:34:59 2018 New Revision: 339568 URL: https://svnweb.freebsd.org/changeset/base/339568 Log: Remove bt(4) driver The buslogic scsi driver has been tagged as gone in 12 for some time now. Remove it. The nycbug dmesg database shows only one sighting in 6 for this driver. It was very popular in the early days of the project, but that popularity seems to have died by 2004 when the nycbug database started up. Relnotes: yes Deleted: head/sys/dev/buslogic/bt.c head/sys/dev/buslogic/bt_isa.c head/sys/dev/buslogic/bt_pci.c head/sys/dev/buslogic/btreg.h Modified: head/share/man/man4/scsi.4 head/sys/conf/NOTES head/sys/conf/files head/sys/kern/Make.tags.inc head/sys/sparc64/conf/NOTES Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Mon Oct 22 02:34:47 2018 (r339567) +++ head/share/man/man4/scsi.4 Mon Oct 22 02:34:59 2018 (r339568) @@ -348,7 +348,6 @@ for details. .Xr ahci 4 , .Xr ahd 4 , .Xr ata 4 , -.Xr bt 4 , .Xr cd 4 , .Xr ch 4 , .Xr da 4 , Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:34:47 2018 (r339567) +++ head/sys/conf/NOTES Mon Oct 22 02:34:59 2018 (r339568) @@ -1551,8 +1551,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/ # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. -# bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, -# BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F # esp: Emulex ESP, NCR 53C9x and QLogic FAS families based controllers # including the AMD Am53C974 (found on devices such as the Tekram # DC-390(T)) and the Sun ESP and FAS families of controllers @@ -1572,13 +1570,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # 53C1010-33, 53C1010-66. # trm: Tekram DC395U/UW/F DC315U adapters. -# -# Note that the order is important in order for Buslogic ISA cards to be -# probed correctly. -# -device bt -hint.bt.0.at="isa" -hint.bt.0.port="0x330" device ahc device ahd device esp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:34:47 2018 (r339567) +++ head/sys/conf/files Mon Oct 22 02:34:59 2018 (r339568) @@ -1327,9 +1327,6 @@ dev/bnxt/bnxt_hwrm.c optional bnxt iflib pci dev/bnxt/bnxt_sysctl.c optional bnxt iflib pci dev/bnxt/bnxt_txrx.c optional bnxt iflib pci dev/bnxt/if_bnxt.c optional bnxt iflib pci -dev/buslogic/bt.c optional bt -dev/buslogic/bt_isa.c optional bt isa -dev/buslogic/bt_pci.c optional bt pci dev/bwi/bwimac.c optional bwi dev/bwi/bwiphy.c optional bwi dev/bwi/bwirf.c optional bwi Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Mon Oct 22 02:34:47 2018 (r339567) +++ head/sys/kern/Make.tags.inc Mon Oct 22 02:34:59 2018 (r339568) @@ -12,7 +12,6 @@ SYS?= ${.CURDIR}/.. COMM= ${SYS}/sys/vnode.h \ ${SYS}/dev/alc/*.[ch] \ - ${SYS}/dev/buslogic/*.[ch] \ ${SYS}/dev/dpt/*.[ch] \ ${SYS}/dev/en/*.[ch] \ ${SYS}/dev/iicbus/*.[ch] \ @@ -67,7 +66,6 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/sys COMMDIR2= ${SYS}/dev/alc \ - ${SYS}/dev/buslogic \ ${SYS}/dev/dpt \ ${SYS}/dev/en \ ${SYS}/dev/iicbus \ Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Mon Oct 22 02:34:47 2018 (r339567) +++ head/sys/sparc64/conf/NOTES Mon Oct 22 02:34:59 2018 (r339568) @@ -119,7 +119,6 @@ nodevice snd_via8233 nodevice snd_via82c686 nodevice snd_vibes nodevice snd_uaudio -nodevice bt nodevice ep nodevice ex From owner-svn-src-head@freebsd.org Mon Oct 22 02:35:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B140BFD8BD0; Mon, 22 Oct 2018 02:35:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 663E6822E5; Mon, 22 Oct 2018 02:35:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 612801636B; Mon, 22 Oct 2018 02:35:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9M2ZE7U043891; Mon, 22 Oct 2018 02:35:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2ZCjp043883; Mon, 22 Oct 2018 02:35:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220235.w9M2ZCjp043883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339569 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/dpt sys/i386/conf sys/kern sys/modules sys/modules/dpt X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/dpt sys/i386/conf sys/kern sys/modules sys/modules/dpt X-SVN-Commit-Revision: 339569 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, 22 Oct 2018 02:35:15 -0000 Author: imp Date: Mon Oct 22 02:35:12 2018 New Revision: 339569 URL: https://svnweb.freebsd.org/changeset/base/339569 Log: Retire dpt(4) Marked as gone in 12 and not relevant since the early 90s. No sightings in nycbug's dmesg database. Relnotes: yes Deleted: head/share/man/man4/dpt.4 head/sys/dev/dpt/dpt.h head/sys/dev/dpt/dpt_pci.c head/sys/dev/dpt/dpt_scsi.c head/sys/modules/dpt/Makefile Modified: head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/kern/Make.tags.inc head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:34:59 2018 (r339568) +++ head/share/man/man4/Makefile Mon Oct 22 02:35:12 2018 (r339569) @@ -132,7 +132,6 @@ MAN= aac.4 \ disc.4 \ divert.4 \ ${_dpms.4} \ - dpt.4 \ ds1307.4 \ ds3231.4 \ ${_dtrace_provs} \ Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/amd64/conf/GENERIC Mon Oct 22 02:35:12 2018 (r339569) @@ -159,7 +159,6 @@ device ses # Enclosure Services (SES and SAF-TE) device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x device hptnr # Highpoint DC7280, R750 device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) @@ -1663,27 +1663,6 @@ options ISP_DEFAULT_ROLES=0 #options SYM_SETUP_MAX_LUN #-Number of LUNs supported # default:8, range:[1..64] -# The 'dpt' driver provides support for old DPT controllers (http://www.dpt.com/). -# These have hardware RAID-{0,1,5} support, and do multi-initiator I/O. -# The DPT controllers are commonly re-licensed under other brand-names - -# some controllers by Olivetti, Dec, HP, AT&T, SNI, AST, Alphatronic, NEC and -# Compaq are actually DPT controllers. -# -# See src/sys/dev/dpt for debugging and other subtle options. -# DPT_MEASURE_PERFORMANCE Enables a set of (semi)invasive metrics. Various -# instruments are enabled. The tools in -# /usr/sbin/dpt_* assume these to be enabled. -# DPT_DEBUG_xxxx These are controllable from sys/dev/dpt/dpt.h -# DPT_RESET_HBA Make "reset" actually reset the controller -# instead of fudging it. Only enable this if you -# are 100% certain you need it. - -device dpt - -# DPT options -#!CAM# options DPT_MEASURE_PERFORMANCE -options DPT_RESET_HBA - # # Compaq "CISS" RAID controllers (SmartRAID 5* series) # These controllers have a SCSI-like interface, and require the Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/conf/files Mon Oct 22 02:35:12 2018 (r339569) @@ -1537,8 +1537,6 @@ dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci dev/dme/if_dme.c optional dme -dev/dpt/dpt_pci.c optional dpt pci -dev/dpt/dpt_scsi.c optional dpt dev/drm/ati_pcigart.c optional drm dev/drm/drm_agpsupport.c optional drm dev/drm/drm_auth.c optional drm Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/conf/options Mon Oct 22 02:35:12 2018 (r339569) @@ -566,10 +566,6 @@ DRM_DEBUG opt_drm.h TI_SF_BUF_JUMBO opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h -# DPT driver debug flags -DPT_MEASURE_PERFORMANCE opt_dpt.h -DPT_RESET_HBA opt_dpt.h - # Misc debug flags. Most of these should probably be replaced with # 'DEBUG', and then let people recompile just the interesting modules # with 'make CC="cc -DDEBUG"'. Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/i386/conf/GENERIC Mon Oct 22 02:35:12 2018 (r339569) @@ -151,7 +151,6 @@ device ses # Enclosure Services (SES and SAF-TE) device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x device hptnr # Highpoint DC7280, R750 device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/kern/Make.tags.inc Mon Oct 22 02:35:12 2018 (r339569) @@ -12,7 +12,6 @@ SYS?= ${.CURDIR}/.. COMM= ${SYS}/sys/vnode.h \ ${SYS}/dev/alc/*.[ch] \ - ${SYS}/dev/dpt/*.[ch] \ ${SYS}/dev/en/*.[ch] \ ${SYS}/dev/iicbus/*.[ch] \ ${SYS}/dev/isp/*.[ch] \ @@ -66,7 +65,6 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/sys COMMDIR2= ${SYS}/dev/alc \ - ${SYS}/dev/dpt \ ${SYS}/dev/en \ ${SYS}/dev/iicbus \ ${SYS}/dev/isp \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:34:59 2018 (r339568) +++ head/sys/modules/Makefile Mon Oct 22 02:35:12 2018 (r339569) @@ -110,7 +110,6 @@ SUBDIR= \ dcons_crom \ de \ ${_dpms} \ - ${_dpt} \ ${_drm} \ ${_drm2} \ dummynet \ @@ -767,7 +766,6 @@ _stg= stg .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau .endif -_dpt= dpt _ex= ex .endif From owner-svn-src-head@freebsd.org Mon Oct 22 02:35:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6533FD8C21; Mon, 22 Oct 2018 02:35: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD7E82404; Mon, 22 Oct 2018 02:35: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 66AB51636C; Mon, 22 Oct 2018 02:35: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 w9M2ZRC9043952; Mon, 22 Oct 2018 02:35:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2ZQ6w043947; Mon, 22 Oct 2018 02:35:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220235.w9M2ZQ6w043947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv X-SVN-Commit-Revision: 339570 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, 22 Oct 2018 02:35:27 -0000 Author: imp Date: Mon Oct 22 02:35:26 2018 New Revision: 339570 URL: https://svnweb.freebsd.org/changeset/base/339570 Log: Remove ncv(4) driver ncv(4) is marked as gone in 12. Remove it. There are no sightings of it in the nycbug dmesg database. It was for an obscure SCSI card that sold mostly in Japan, and was especially popilar among pc98 hackers in the 4.x time frame.. Relnote: Yes Deleted: head/share/man/man4/ncv.4 head/sys/dev/ncv/ncr53c500.c head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/ncv/ncr53c500hw.h head/sys/dev/ncv/ncr53c500hwtab.h head/sys/dev/ncv/ncr53c500reg.h head/sys/dev/ncv/ncr53c500var.h head/sys/modules/ncv/Makefile Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:35:12 2018 (r339569) +++ head/share/man/man4/Makefile Mon Oct 22 02:35:26 2018 (r339570) @@ -305,7 +305,6 @@ MAN= aac.4 \ nand.4 \ nandsim.4 \ ncr.4 \ - ncv.4 \ ${_ndis.4} \ net80211.4 \ netdump.4 \ Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) @@ -428,11 +428,9 @@ device twa # 3ware 9000 series PATA/SATA RAID # # SCSI host adapters: # -# ncv: NCR 53C500 based SCSI host adapters. # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. # stg: TMC 18C30, 18C50 based SCSI host adapters. -device ncv device nsp device stg Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:35:12 2018 (r339569) +++ head/sys/conf/files Mon Oct 22 02:35:26 2018 (r339570) @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.c optional ctl cam/mmc/mmc_xpt.c optional scbus mmccam cam/mmc/mmc_da.c optional scbus mmccam da cam/scsi/scsi_da.c optional da -cam/scsi/scsi_low.c optional ncv | nsp | stg +cam/scsi/scsi_low.c optional nsp | stg cam/scsi/scsi_pass.c optional pass cam/scsi/scsi_pt.c optional pt cam/scsi/scsi_sa.c optional sa @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c optional nandsim nand dev/nand/nandsim_swap.c optional nandsim nand dev/nand/nfc_if.m optional nand dev/ncr/ncr.c optional ncr pci -dev/ncv/ncr53c500.c optional ncv -dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/netmap/if_ptnet.c optional netmap inet dev/netmap/netmap.c optional netmap dev/netmap/netmap_freebsd.c optional netmap Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) +++ head/sys/i386/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) @@ -659,11 +659,9 @@ device twa # 3ware 9000 series PATA/SATA RAID # # SCSI host adapters: # -# ncv: NCR 53C500 based SCSI host adapters. # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. # stg: TMC 18C30, 18C50 based SCSI host adapters. -device ncv device nsp device stg hint.stg.0.at="isa" Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:35:12 2018 (r339569) +++ head/sys/modules/Makefile Mon Oct 22 02:35:26 2018 (r339570) @@ -268,7 +268,6 @@ SUBDIR= \ ${_nandsim} \ ${_ncr} \ ${_nctgpio} \ - ${_ncv} \ ${_ndis} \ ${_netgraph} \ ${_nfe} \ @@ -757,7 +756,6 @@ _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 _ncr= ncr -_ncv= ncv _nsp= nsp _pcfclock= pcfclock _pst= pst From owner-svn-src-head@freebsd.org Mon Oct 22 02:35:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32C0FD8C6E; Mon, 22 Oct 2018 02:35:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A950B82507; Mon, 22 Oct 2018 02:35:39 +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 A45401636D; Mon, 22 Oct 2018 02:35:39 +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 w9M2ZdJW044013; Mon, 22 Oct 2018 02:35:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2Zc1l044009; Mon, 22 Oct 2018 02:35:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220235.w9M2Zc1l044009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339571 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/nsp sys/i386/conf sys/modules sys/modules/nsp X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/nsp sys/i386/conf sys/modules sys/modules/nsp X-SVN-Commit-Revision: 339571 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, 22 Oct 2018 02:35:40 -0000 Author: imp Date: Mon Oct 22 02:35:38 2018 New Revision: 339571 URL: https://svnweb.freebsd.org/changeset/base/339571 Log: Remove nsp(4) driver nsp(4) is marked as gone in 12. Remove it. There are no sightings of it in the nycbug dmesg database. It was for an obscure SCSI card that sold mostly in Japan, and was especially popilar among pc98 hackers in the 4.x time frame. It was also only enabled on i386. Relnote: Yes Deleted: head/share/man/man4/nsp.4 head/sys/dev/nsp/nsp.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/nsp/nspreg.h head/sys/dev/nsp/nspvar.h head/sys/modules/nsp/Makefile Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:35:26 2018 (r339570) +++ head/share/man/man4/Makefile Mon Oct 22 02:35:38 2018 (r339571) @@ -372,7 +372,6 @@ MAN= aac.4 \ ng_vjc.4 \ ng_vlan.4 \ nmdm.4 \ - nsp.4 \ ${_ntb.4} \ ${_ntb_hw_intel.4} \ ${_ntb_hw_plx.4} \ Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:38 2018 (r339571) @@ -428,10 +428,8 @@ device twa # 3ware 9000 series PATA/SATA RAID # # SCSI host adapters: # -# nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. # stg: TMC 18C30, 18C50 based SCSI host adapters. -device nsp device stg # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:35:26 2018 (r339570) +++ head/sys/conf/files Mon Oct 22 02:35:38 2018 (r339571) @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.c optional ctl cam/mmc/mmc_xpt.c optional scbus mmccam cam/mmc/mmc_da.c optional scbus mmccam da cam/scsi/scsi_da.c optional da -cam/scsi/scsi_low.c optional nsp | stg +cam/scsi/scsi_low.c optional stg cam/scsi/scsi_pass.c optional pass cam/scsi/scsi_pt.c optional pt cam/scsi/scsi_sa.c optional sa Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) +++ head/sys/i386/conf/NOTES Mon Oct 22 02:35:38 2018 (r339571) @@ -659,10 +659,8 @@ device twa # 3ware 9000 series PATA/SATA RAID # # SCSI host adapters: # -# nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. # stg: TMC 18C30, 18C50 based SCSI host adapters. -device nsp device stg hint.stg.0.at="isa" hint.stg.0.port="0x140" Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:35:26 2018 (r339570) +++ head/sys/modules/Makefile Mon Oct 22 02:35:38 2018 (r339571) @@ -279,7 +279,6 @@ SUBDIR= \ nfssvc \ nge \ nmdm \ - ${_nsp} \ nullfs \ ${_ntb} \ ${_nvd} \ @@ -756,7 +755,6 @@ _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 _ncr= ncr -_nsp= nsp _pcfclock= pcfclock _pst= pst _sbni= sbni From owner-svn-src-head@freebsd.org Mon Oct 22 02:35:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 350F6FD8CA9; Mon, 22 Oct 2018 02:35: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE3D982621; Mon, 22 Oct 2018 02:35:51 +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 D91E31636E; Mon, 22 Oct 2018 02:35:51 +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 w9M2ZpaS044078; Mon, 22 Oct 2018 02:35:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2Zoh8044073; Mon, 22 Oct 2018 02:35:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220235.w9M2Zoh8044073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339572 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/stg sys/i386/conf sys/modules sys/modules/stg X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/stg sys/i386/conf sys/modules sys/modules/stg X-SVN-Commit-Revision: 339572 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, 22 Oct 2018 02:35:52 -0000 Author: imp Date: Mon Oct 22 02:35:50 2018 New Revision: 339572 URL: https://svnweb.freebsd.org/changeset/base/339572 Log: Remove stg(4) driver stg(4) is marked as gone in 12. Remove it. There are no sightings of it in the nycbug dmesg database. It was for an obscure SCSI card that sold mostly in Japan, and was especially popilar among pc98 hackers in the 4.x time frame. It was also only enabled on i386. Relnote: Yes Deleted: head/share/man/man4/stg.4 head/sys/dev/stg/tmc18c30.c head/sys/dev/stg/tmc18c30.h head/sys/dev/stg/tmc18c30_isa.c head/sys/dev/stg/tmc18c30_pccard.c head/sys/dev/stg/tmc18c30_pci.c head/sys/dev/stg/tmc18c30_subr.c head/sys/dev/stg/tmc18c30reg.h head/sys/dev/stg/tmc18c30var.h head/sys/modules/stg/Makefile Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:35:38 2018 (r339571) +++ head/share/man/man4/Makefile Mon Oct 22 02:35:50 2018 (r339572) @@ -504,7 +504,6 @@ MAN= aac.4 \ sppp.4 \ ste.4 \ stf.4 \ - stg.4 \ stge.4 \ sym.4 \ syncache.4 \ Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:38 2018 (r339571) +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:50 2018 (r339572) @@ -426,13 +426,6 @@ options TWA_DEBUG # 0-10; 10 prints the most message device twa # 3ware 9000 series PATA/SATA RAID # -# SCSI host adapters: -# -# stg: TMC 18C30, 18C50 based SCSI host adapters. - -device stg - -# # Adaptec FSA RAID controllers, including integrated DELL controllers, # the Dell PERC 2/QC and the HP NetRAID-4M device aac Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:35:38 2018 (r339571) +++ head/sys/conf/files Mon Oct 22 02:35:50 2018 (r339572) @@ -113,7 +113,6 @@ cam/ctl/scsi_ctl.c optional ctl cam/mmc/mmc_xpt.c optional scbus mmccam cam/mmc/mmc_da.c optional scbus mmccam da cam/scsi/scsi_da.c optional da -cam/scsi/scsi_low.c optional stg cam/scsi/scsi_pass.c optional pass cam/scsi/scsi_pt.c optional pt cam/scsi/scsi_sa.c optional sa @@ -3137,11 +3136,6 @@ dev/spibus/spibus.c optional spibus \ dev/spibus/spigen.c optional spigen dev/spibus/spibus_if.m optional spibus dev/ste/if_ste.c optional ste pci -dev/stg/tmc18c30.c optional stg -dev/stg/tmc18c30_isa.c optional stg isa -dev/stg/tmc18c30_pccard.c optional stg pccard -dev/stg/tmc18c30_pci.c optional stg pci -dev/stg/tmc18c30_subr.c optional stg dev/stge/if_stge.c optional stge dev/sym/sym_hipd.c optional sym \ dependency "$S/dev/sym/sym_{conf,defs}.h" Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Oct 22 02:35:38 2018 (r339571) +++ head/sys/i386/conf/NOTES Mon Oct 22 02:35:50 2018 (r339572) @@ -657,16 +657,6 @@ options TWA_DEBUG # 0-10; 10 prints the most message device twa # 3ware 9000 series PATA/SATA RAID # -# SCSI host adapters: -# -# stg: TMC 18C30, 18C50 based SCSI host adapters. - -device stg -hint.stg.0.at="isa" -hint.stg.0.port="0x140" -hint.stg.0.port="11" - -# # Adaptec FSA RAID controllers, including integrated DELL controllers, # the Dell PERC 2/QC and the HP NetRAID-4M device aac Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:35:38 2018 (r339571) +++ head/sys/modules/Makefile Mon Oct 22 02:35:50 2018 (r339572) @@ -357,7 +357,6 @@ SUBDIR= \ ${_splash} \ ${_sppp} \ ste \ - ${_stg} \ stge \ ${_sym} \ ${_syscons} \ @@ -758,7 +757,6 @@ _ncr= ncr _pcfclock= pcfclock _pst= pst _sbni= sbni -_stg= stg .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau .endif From owner-svn-src-head@freebsd.org Mon Oct 22 02:36:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A28BFD8D0C; Mon, 22 Oct 2018 02:36:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B507C82753; Mon, 22 Oct 2018 02:36:07 +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 B00F51636F; Mon, 22 Oct 2018 02:36:07 +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 w9M2a7c3044142; Mon, 22 Oct 2018 02:36:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2a7ML044141; Mon, 22 Oct 2018 02:36:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220236.w9M2a7ML044141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339573 - in head/sys: cam/scsi modules modules/scsi_low X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam/scsi modules modules/scsi_low X-SVN-Commit-Revision: 339573 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, 22 Oct 2018 02:36:08 -0000 Author: imp Date: Mon Oct 22 02:36:07 2018 New Revision: 339573 URL: https://svnweb.freebsd.org/changeset/base/339573 Log: Retire scsi_low scsi_low was a common set of routines to do the SCSI bus sequencing for the ncv, nsp and stg drivers. Those have been removed, so it's no longer needed since nothing else in the tree uses it and nothing likely ever will (it's for super-low-end 8-bit parallel SCSI cards). Deleted: head/sys/cam/scsi/scsi_dvcfg.h head/sys/cam/scsi/scsi_low.c head/sys/cam/scsi/scsi_low.h head/sys/modules/scsi_low/Makefile Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:35:50 2018 (r339572) +++ head/sys/modules/Makefile Mon Oct 22 02:36:07 2018 (r339573) @@ -332,7 +332,6 @@ SUBDIR= \ ${_safe} \ ${_sbni} \ scc \ - ${_scsi_low} \ sdhci \ ${_sdhci_acpi} \ sdhci_pci \ @@ -614,7 +613,6 @@ _pccard= pccard _rdma= rdma .endif _safe= safe -_scsi_low= scsi_low _speaker= speaker _splash= splash _sppp= sppp From owner-svn-src-head@freebsd.org Mon Oct 22 02:36:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A8E0FD8D4E; Mon, 22 Oct 2018 02:36:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F2E28288F; Mon, 22 Oct 2018 02:36: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 2A16816370; Mon, 22 Oct 2018 02:36: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 w9M2aKic044209; Mon, 22 Oct 2018 02:36:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2aJw5044198; Mon, 22 Oct 2018 02:36:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220236.w9M2aJw5044198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339574 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncr sys/i386/conf sys/modules sys/modules/ncr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncr sys/i386/conf sys/modules sys/modules/ncr X-SVN-Commit-Revision: 339574 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, 22 Oct 2018 02:36:21 -0000 Author: imp Date: Mon Oct 22 02:36:18 2018 New Revision: 339574 URL: https://svnweb.freebsd.org/changeset/base/339574 Log: Remove the ncr(4) drive. This driver has been obsolete since the FreeBSD 4.x. It should have been removed then since the sym(4) driver had subsumed it. The driver was commented out of GENERIC in 2000. RelNotes: Yes Deleted: head/share/man/man4/ncr.4 head/sys/dev/ncr/locate.pl head/sys/dev/ncr/ncr.c head/sys/dev/ncr/ncrreg.h head/sys/modules/ncr/Makefile Modified: head/share/man/man4/Makefile head/share/man/man4/sym.4 head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/i386/conf/PAE head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 22 02:36:07 2018 (r339573) +++ head/share/man/man4/Makefile Mon Oct 22 02:36:18 2018 (r339574) @@ -304,7 +304,6 @@ MAN= aac.4 \ my.4 \ nand.4 \ nandsim.4 \ - ncr.4 \ ${_ndis.4} \ net80211.4 \ netdump.4 \ Modified: head/share/man/man4/sym.4 ============================================================================== --- head/share/man/man4/sym.4 Mon Oct 22 02:36:07 2018 (r339573) +++ head/share/man/man4/sym.4 Mon Oct 22 02:36:18 2018 (r339574) @@ -159,53 +159,6 @@ permanent PCI parity errors detected. This option is supplied for convenience but it is neither recommended nor supported. .Pp -The generic -.Xr ncr 4 -driver also supports SYM53C8XX based PCI SCSI controllers, -except for the SYM53C1010, which is only supported by the -.Nm -driver. -.Pp -By default, when both the -.Xr ncr 4 -and -.Nm -drivers are configured, the -.Nm -driver takes precedence over the -.Xr ncr 4 -driver. -The user can indicate a balancing of chip types between the two drivers -by defining the -.Ar SYM_SETUP_LP_PROBE_MAP -kernel configuration option as follows: -.Bl -column "0x40" -.It Em "Bit Devices to be attached by ncr instead" -.It "0x01 53C810a, 53C860" -.It "0x02 53C825a, 53C875, 53C876, 53C885, 53C895" -.It "0x04 53C895a, 53C896, 53C897, 53C1510d" -.It "0x40 53C810, 53C815, 53C825" -.El -.Pp -For example, if -.Ar SYM_SETUP_LP_PROBE_MAP -is supplied with the value 0x41, the -.Xr ncr 4 -driver will attach to 53C810, 53C815, 53C825, 53C810a, and 53C860 based -controllers, -and the -.Nm -driver will attach to all other 53C8XX based controllers. -.Pp -When only the -.Nm -driver is configured, the -.Ar SYM_SETUP_LP_PROBE_MAP -option has no effect. -Thus, in this case, the -.Nm -driver will attach all 53C8XX based controllers present in the system. -.Pp This driver offers other options that are not currently exported to the user. They are defined and documented in the @@ -342,7 +295,6 @@ The DEC KZPCA-AA is a rebadged SYM8952U. .Sh SEE ALSO .Xr cd 4 , .Xr da 4 , -.Xr ncr 4 , .Xr sa 4 , .Xr scsi 4 , .Xr camcontrol 8 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/amd64/conf/GENERIC Mon Oct 22 02:36:18 2018 (r339574) @@ -139,8 +139,7 @@ device isp # Qlogic family device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device mpr # LSI-Logic MPT-Fusion 3 -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device sym # NCR/Symbios Logic device trm # Tekram DC395U/UW/F DC315U adapters device isci # Intel C600 SAS controller device ocs_fc # Emulex FC adapters Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/conf/NOTES Mon Oct 22 02:36:18 2018 (r339574) @@ -1563,7 +1563,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # ispfw: Firmware module for Qlogic host adapters # mpt: LSI-Logic MPT/Fusion 53c1020 or 53c1030 Ultra4 # or FC9x9 Fibre Channel host adapters. -# ncr: NCR 53C810, 53C825 self-contained SCSI host adapters. # sym: Symbios/Logic 53C8XX family of PCI-SCSI I/O processors: # 53C810, 53C810A, 53C815, 53C825, 53C825A, 53C860, 53C875, # 53C876, 53C885, 53C895, 53C895A, 53C896, 53C897, 53C1510D, @@ -1592,7 +1591,6 @@ hint.isp.0.portwnn="w50000000aaaa0000" hint.isp.0.nodewnn="w50000000aaaa0001" device ispfw device mpt -device ncr device sym device trm @@ -1650,12 +1648,6 @@ options ISP_TARGET_MODE=1 # options ISP_DEFAULT_ROLES=0 -# Options used in dev/sym/ (Symbios SCSI driver). -#options SYM_SETUP_LP_PROBE_MAP #-Low Priority Probe Map (bits) - # Allows the ncr to take precedence - # 1 (1<<0) -> 810a, 860 - # 2 (1<<1) -> 825a, 875, 885, 895 - # 4 (1<<2) -> 895a, 896, 1510d #options SYM_SETUP_SCSI_DIFF #-HVD support for 825a, 875, 885 # disabled:0 (default), enabled:1 #options SYM_SETUP_PCI_PARITY #-PCI parity checking @@ -2922,11 +2914,6 @@ options MSGSSZ=16 # Size of a message segment options MSGTQL=41 # Max number of messages in system options NBUF=512 # Number of buffer headers - -options SCSI_NCR_DEBUG -options SCSI_NCR_MAX_SYNC=10000 -options SCSI_NCR_MAX_WIDE=1 -options SCSI_NCR_MYADDR=7 options SC_DEBUG_LEVEL=5 # Syscons debug level options SC_RENDER_DEBUG # syscons rendering debugging Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/conf/files Mon Oct 22 02:36:18 2018 (r339574) @@ -2509,7 +2509,6 @@ dev/nand/nandsim_ctrl.c optional nandsim nand dev/nand/nandsim_log.c optional nandsim nand dev/nand/nandsim_swap.c optional nandsim nand dev/nand/nfc_if.m optional nand -dev/ncr/ncr.c optional ncr pci dev/netmap/if_ptnet.c optional netmap inet dev/netmap/netmap.c optional netmap dev/netmap/netmap_freebsd.c optional netmap Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/conf/options Mon Oct 22 02:36:18 2018 (r339574) @@ -386,12 +386,6 @@ SYM_SETUP_PCI_PARITY opt_sym.h #-PCI parity checking SYM_SETUP_MAX_LUN opt_sym.h #-Number of LUNs supported # default:8, range:[1..64] -# Options used only in dev/ncr/* -SCSI_NCR_DEBUG opt_ncr.h -SCSI_NCR_MAX_SYNC opt_ncr.h -SCSI_NCR_MAX_WIDE opt_ncr.h -SCSI_NCR_MYADDR opt_ncr.h - # Options used only in dev/isp/* ISP_TARGET_MODE opt_isp.h ISP_FW_CRASH_DUMP opt_isp.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/i386/conf/GENERIC Mon Oct 22 02:36:18 2018 (r339574) @@ -132,8 +132,7 @@ device isp # Qlogic family device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 device mpr # LSI-Logic MPT-Fusion 3 -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device sym # NCR/Symbios Logic device trm # Tekram DC395U/UW/F DC315U adapters device isci # Intel C600 SAS controller Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/i386/conf/PAE Mon Oct 22 02:36:18 2018 (r339574) @@ -17,6 +17,5 @@ nodevice hptmv nodevice ida # The following drivers don't work with PAE enabled. -makeoptions WITHOUT_MODULES+="ncr pst" -nodevice ncr +makeoptions WITHOUT_MODULES+="pst" nodevice pst Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 22 02:36:07 2018 (r339573) +++ head/sys/modules/Makefile Mon Oct 22 02:36:18 2018 (r339574) @@ -266,7 +266,6 @@ SUBDIR= \ my \ ${_nandfs} \ ${_nandsim} \ - ${_ncr} \ ${_nctgpio} \ ${_ndis} \ ${_netgraph} \ @@ -751,7 +750,6 @@ _cp= cp _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 -_ncr= ncr _pcfclock= pcfclock _pst= pst _sbni= sbni From owner-svn-src-head@freebsd.org Mon Oct 22 02:36:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBF0FD8DAD; Mon, 22 Oct 2018 02:36:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 415E1829BD; Mon, 22 Oct 2018 02:36:32 +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 3C61C16371; Mon, 22 Oct 2018 02:36:32 +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 w9M2aWr4044266; Mon, 22 Oct 2018 02:36:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2aVaL044265; Mon, 22 Oct 2018 02:36:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220236.w9M2aVaL044265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339575 - in head/sys: conf dev/sym X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/sym X-SVN-Commit-Revision: 339575 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, 22 Oct 2018 02:36:32 -0000 Author: imp Date: Mon Oct 22 02:36:31 2018 New Revision: 339575 URL: https://svnweb.freebsd.org/changeset/base/339575 Log: Remove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not been needed for almost 20 years, and is totally useless now that ncr(4) has been removed. Relnotes: yes Modified: head/sys/conf/options head/sys/dev/sym/sym_hipd.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Oct 22 02:36:18 2018 (r339574) +++ head/sys/conf/options Mon Oct 22 02:36:31 2018 (r339575) @@ -374,11 +374,6 @@ SCSI_PT_DEFAULT_TIMEOUT opt_pt.h SES_ENABLE_PASSTHROUGH opt_ses.h # Options used in dev/sym/ (Symbios SCSI driver). -SYM_SETUP_LP_PROBE_MAP opt_sym.h #-Low Priority Probe Map (bits) - # Allows the ncr to take precedence - # 1 (1<<0) -> 810a, 860 - # 2 (1<<1) -> 825a, 875, 885, 895 - # 4 (1<<2) -> 895a, 896, 1510d SYM_SETUP_SCSI_DIFF opt_sym.h #-HVD support for 825a, 875, 885 # disabled:0 (default), enabled:1 SYM_SETUP_PCI_PARITY opt_sym.h #-PCI parity checking Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Mon Oct 22 02:36:18 2018 (r339574) +++ head/sys/dev/sym/sym_hipd.c Mon Oct 22 02:36:31 2018 (r339575) @@ -8387,8 +8387,7 @@ sym_pci_probe(device_t dev) chip = sym_find_pci_chip(dev); if (chip && sym_find_firmware(chip)) { device_set_desc(dev, chip->name); - return (chip->lp_probe_bit & SYM_SETUP_LP_PROBE_MAP)? - BUS_PROBE_LOW_PRIORITY : BUS_PROBE_DEFAULT; + return BUS_PROBE_DEFAULT; } return ENXIO; } From owner-svn-src-head@freebsd.org Mon Oct 22 02:42:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DFFEFD9516; Mon, 22 Oct 2018 02:42:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3A0183285; Mon, 22 Oct 2018 02:42:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEBA6163F7; Mon, 22 Oct 2018 02:42:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9M2gExu049057; Mon, 22 Oct 2018 02:42:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M2gE6A049056; Mon, 22 Oct 2018 02:42:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810220242.w9M2gE6A049056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 22 Oct 2018 02:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339576 - in head/sys: dev/advansys dev/aha dev/aic dev/buslogic dev/dpt dev/joy dev/mse dev/ncr dev/ncv dev/nsp dev/stg gnu/dts/include/dt-bindings/genpd modules/aha modules/aic module... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/advansys dev/aha dev/aic dev/buslogic dev/dpt dev/joy dev/mse dev/ncr dev/ncv dev/nsp dev/stg gnu/dts/include/dt-bindings/genpd modules/aha modules/aic modules/dpt modules/dtb/atmel m... X-SVN-Commit-Revision: 339576 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, 22 Oct 2018 02:42:15 -0000 Author: imp Date: Mon Oct 22 02:42:14 2018 New Revision: 339576 URL: https://svnweb.freebsd.org/changeset/base/339576 Log: Remove newly empty directories, plus a few ohters that have crept into tree over time (most my fault). Deleted: head/sys/dev/advansys/ head/sys/dev/aha/ head/sys/dev/aic/ head/sys/dev/buslogic/ head/sys/dev/dpt/ head/sys/dev/joy/ head/sys/dev/mse/ head/sys/dev/ncr/ head/sys/dev/ncv/ head/sys/dev/nsp/ head/sys/dev/stg/ head/sys/gnu/dts/include/dt-bindings/genpd/ head/sys/modules/aha/ head/sys/modules/aic/ head/sys/modules/dpt/ head/sys/modules/dtb/atmel/ head/sys/modules/joy/ head/sys/modules/mse/ head/sys/modules/ncr/ head/sys/modules/ncv/ head/sys/modules/nsp/ head/sys/modules/random_yarrow/ head/sys/modules/scsi_low/ head/sys/modules/stg/ head/sys/modules/usb/at91dci/ From owner-svn-src-head@freebsd.org Mon Oct 22 02:47:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1337FD96CA; Mon, 22 Oct 2018 02:47:20 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31C2F836FC; Mon, 22 Oct 2018 02:47:20 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot1-x32d.google.com with SMTP id c32so38526535otb.8; Sun, 21 Oct 2018 19:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tBRz2Ct1rXv7P/ZDaYN+N/Nsj4Yb0N+Xa74sJ1orUro=; b=bwiZGnqTFeL8u+xlfrUZQeilLfHj9dRm5mJ8KGfUyGmXKshLgg6i1ZvpSK0FR8sm7m DdSazuduEpTsD8+3M0qkYCL7A+qELAaFyUoxIOsOdlwfNBM0l+1eQPzK5i31b2jqF5BL xy3akWgtwpL5f+JTrtfl1h2m5ppGHs0XqlzH3cTv+phqqrnNfZLyhdDozabPtqIvkC8v J2a/4/qm87U1BD17i6keDPBp5JuygkOs9BEQZQuUeNK4KQlB08xpe/c1kEKNpxulSS35 uAcqWET+f6xZWP+sUpYuGXRnxz6sq3QOPHXRbTSP3QRzWNMSKTqNCUZ0C6cfuJoYePYQ qUuA== 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=tBRz2Ct1rXv7P/ZDaYN+N/Nsj4Yb0N+Xa74sJ1orUro=; b=Uby2wMWJTVuWn4KUI1uHLiNIC8Clre8KF4dAf9lmwcpoS4S+iITd3m8lhodVZUDdeY aKILaz4JbofVXJBQgZcBQFNgM7/Fe9XiOYG2IsPCza9xMx1nscpQAopKwxNgXD/yH6Jv 73/hypZBOmGUo7hk7CxsPjTZcMidMeQiad32hOUtVCdWpVmoUDNfnEP1cwGHDPw8Egb6 kg2vaPs+aQywU6SfoEnPeKfnVkZS2RfCOFZGGRnL5llX9cCh8VRNBXl1NnFeaEvPbV+6 StHvkETZjUThYEOFlPIHnso0CagcDRTcSyWWhIN3ZnY6EWcEqhU2CsfIbkFVn2+rKft0 ff1A== X-Gm-Message-State: ABuFfoistXRATpAyet6n/opjb72zHjl+FbwCQrJmsZpvl2F1qwjIo9xW 76DQiiOENgQw4DkPEw6jd9P+aqqwSCbaRs8UJ8qHGpl9 X-Google-Smtp-Source: ACcGV62MjRDVo4wEd4OkNwHKfh2ZYhFb62ilevczpUVX4lliLFEtvJMgHgFsj4GIlUVTkHkAxmDa/z0T19OsKCMXDtw= X-Received: by 2002:a9d:4590:: with SMTP id x16mr29487251ote.258.1540176439079; Sun, 21 Oct 2018 19:47:19 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2YPTt043620@repo.freebsd.org> In-Reply-To: <201810220234.w9M2YPTt043620@repo.freebsd.org> From: Benjamin Kaduk Date: Sun, 21 Oct 2018 21:47:08 -0500 Message-ID: Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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, 22 Oct 2018 02:47:20 -0000 On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: > Author: imp > Date: Mon Oct 22 02:34:25 2018 > New Revision: 339565 > URL: https://svnweb.freebsd.org/changeset/base/339565 > > Log: > Remove aha(4) from the tree. > > The documentation build is now failing, as there's an entity reference to the autogenerated hardware list, which does not exist anymore. Will you be able to look at those as part of your removals or does someone from the doc team need to handle it? -Ben From owner-svn-src-head@freebsd.org Mon Oct 22 02:53:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0985CFD98FC for ; Mon, 22 Oct 2018 02:53:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA5D83B1D for ; Mon, 22 Oct 2018 02:53:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x92d.google.com with SMTP id c11so2010995uan.5 for ; Sun, 21 Oct 2018 19:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/YU+ImPK6tpfp9GwnXemokvk4oY+hWcp7fs8ynJQsuM=; b=oo0qaZScacY85CTCeqKAJJgDSaqc/6O/pgNmAtYX7irI0RiKkA/0RKcX/DGJ6IF1M0 yCdYsOkIMlto6XiYYyzoZ7EeWbuJsCbzVaeakuog4BM3r9o/okdNw0c20zZLkAboJsQG 330YuOnhIxrchkSiXHcAEG8uUIAd/bqn42eHWXdHVzFgXbC2UUGHKa2BjuN0prCPuXt0 4rXr40ZsPkHkcSuNBG4YuqW573jvYNT6g9vXHfSHExcZ8D/PaUzopLfhkU9DeINFq9+S ZkIweyscEU/GjuKaF+yBDfWFoZVwEWjj+YiwAERsKJK6FTV6nlO56GvF9Yyyg23u9vzG LHIA== 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=/YU+ImPK6tpfp9GwnXemokvk4oY+hWcp7fs8ynJQsuM=; b=DFVh7HEiomL70WwF0Hy3rTGo3Fo4lycvhHttMrt4LnxRT4uCFtAWatuAAeu9VHAyRP 6B20/SNtD4ZEYcpt4pBugRl8f51s1ZtR0SlrpmTgu3vhqramwNJjzLhfInQkiCtKDPNy QMf8g9SxFXxxd0vD8p6osnVnu2I17d81IjRx+IHYnMZPVrc23ZLZ5dG0roLkmYA/+18Q Rjs0m0ryJn9D5i5k6KlWPDFWCcQq/Ft1hevnhglDljEqU56baf/7a8yBs0JRgaHzas7C zm6g4ahCOtwFpE1iterhis6s3kZpOTOiEvYnzzuCA/D10DoVSE4RMPBJy+s1az8MBTF1 W68w== X-Gm-Message-State: ABuFfogCYL0tCd1jbEOZonn5+2RqmX5RMVIeAEMrjMiN6GXJD9NYneBq U4qIUPPRs1d1XP5l+UFVQ3SV+vgZgQ7GYo48SVBDuA== X-Google-Smtp-Source: ACcGV61g08GWoEhv3C5W+phoP13o7zHIF61GJTgGk8laSwQ3eqC3jDRKTZ2Pl6UIrqvgVnRvjA2r/oWqKDc5xFkm5V4= X-Received: by 2002:ab0:14a4:: with SMTP id d33mr18322460uae.41.1540176794739; Sun, 21 Oct 2018 19:53:14 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2YPTt043620@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 21 Oct 2018 20:53:03 -0600 Message-ID: Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf To: Benjamin Kaduk Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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, 22 Oct 2018 02:53:16 -0000 On Sun, Oct 21, 2018 at 8:47 PM Benjamin Kaduk wrote: > On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: > >> Author: imp >> Date: Mon Oct 22 02:34:25 2018 >> New Revision: 339565 >> URL: https://svnweb.freebsd.org/changeset/base/339565 >> >> Log: >> Remove aha(4) from the tree. >> >> > The documentation build is now failing, as there's an entity reference to > the autogenerated > hardware list, which does not exist anymore. Will you be able to look at > those as part of your > removals or does someone from the doc team need to handle it? > I'll take a look. What exactly is failing? The only place I see aha.4 is in doc/head/share/xml/man-refs.ent but there's several other drivers that have been removed that are in there... So I'm confused and need some additional guidance. Warner From owner-svn-src-head@freebsd.org Mon Oct 22 02:56:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA84FD9AC9; Mon, 22 Oct 2018 02:56:50 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A03BC83E30; Mon, 22 Oct 2018 02:56:49 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi1-x22c.google.com with SMTP id y81-v6so31007566oia.6; Sun, 21 Oct 2018 19:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wWNC1al08n5+scfTtgfex6lKs7B/x9hM1hOSTLhHFlg=; b=tZnmm5ccHEDKWSM2Z86GiMq10/UrzMUpGgQSHIJg9/TXBylBkvmoq3Btt1IRmNXR8R ECIrCLKL7wlgOOjpQjYOJipdrl2CilqjDePjThjduPvg3ys9zDg6FDBig6CKNser7CVm ki4sMXaCK4Ps9CeofznxEkgDoay+JjOPHbU+s4A1t/ymQpYQf5XwY7AwRq4BZCV7SA2k 2G9e9L/kSQqTOIKWNQSacbOudganVbCrP9aZM+jA6g2vLCJc4L9s11jJW8NOuHI+qRZz Z2T+AFxRnbRPw3o7zCBdCFD9TG93ucHvMiO2vbONbabbjc106sBbYwAxuf3/4x5unHWF gxhQ== 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=wWNC1al08n5+scfTtgfex6lKs7B/x9hM1hOSTLhHFlg=; b=MY9bHKsd9gg9f+1di9V6gM8demaWEJkShppQaX4+N+0btJukFuseYF6e99ZpcjL6Q8 /kWLSi0W88UEGJ1HgISPzJKxvDEsjiFJ2HkFzJXxmOoerJT3wsMBmy+q7BTj1z9MXkTw ilawNhKMwKaAJdPsfWfEk95bs49wgyJf30fIp4cJFjMNqsErI1F7cjs2PGNnarJEhkuI 3eUnaM0yV4xt4daNU1R50QKgLOwFX6yBoiCEt09aKRvNOb7kj3JsTjtFyhER1nhGOamp 2DJHBMbITcoXZT4NnIxv5Q/P9kzonEsiH1upQU8G+domQ8uTVwYvwkPg8WIuzgS0xO70 lzoQ== X-Gm-Message-State: ABuFfogQem2Q9CqBSxiSapGBf5yzl1c77eOwhP85Gxy2Fjor1/Dji9WQ Oy0XjZfMhovjDjA/LAVpXrFDoSZlbLkouGpvyqNaSGNbpVE= X-Google-Smtp-Source: ACcGV62hPPR3ZwkTF3ZIuzL/QtsEVPOrxBYZo3nhrvzB9Qr/NCV+790V8LFkWKQ8PMzMiG1bLduXeqXanBdrDp0Myp0= X-Received: by 2002:aca:e704:: with SMTP id e4-v6mr24430838oih.233.1540177008963; Sun, 21 Oct 2018 19:56:48 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2YPTt043620@repo.freebsd.org> In-Reply-To: From: Benjamin Kaduk Date: Sun, 21 Oct 2018 21:56:38 -0500 Message-ID: Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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, 22 Oct 2018 02:56:50 -0000 On Sun, Oct 21, 2018 at 9:53 PM Warner Losh wrote: > > > On Sun, Oct 21, 2018 at 8:47 PM Benjamin Kaduk wrote: > >> On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: >> >>> Author: imp >>> Date: Mon Oct 22 02:34:25 2018 >>> New Revision: 339565 >>> URL: https://svnweb.freebsd.org/changeset/base/339565 >>> >>> Log: >>> Remove aha(4) from the tree. >>> >>> >> The documentation build is now failing, as there's an entity reference to >> the autogenerated >> hardware list, which does not exist anymore. Will you be able to look at >> those as part of your >> removals or does someone from the doc team need to handle it? >> > > I'll take a look. What exactly is failing? The only place I see aha.4 is > in doc/head/share/xml/man-refs.ent but there's several other drivers that > have been removed that are in there... So I'm confused and need some > additional guidance. > The build log is mailed out at (e.g.) https://lists.freebsd.org/pipermail/freebsd-doc/2018-October/031621.html Though looking slightly more closely, it seems to be complaining about the 12.0 release notes (!), which might both (1) be awkward to solve, and (2) be in re@'s territory. (I would not be surprised if it only shows errors for the first couple problems, in alphabetical order, and there are more issues lingering.) Thanks, Ben From owner-svn-src-head@freebsd.org Mon Oct 22 03:29:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 941EEFE59F2; Mon, 22 Oct 2018 03:29:55 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A062851E5; Mon, 22 Oct 2018 03:29:55 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44FC616BE9; Mon, 22 Oct 2018 03:29:55 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9M3TtSP070475; Mon, 22 Oct 2018 03:29:55 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M3Tsx4070473; Mon, 22 Oct 2018 03:29:54 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201810220329.w9M3Tsx4070473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Mon, 22 Oct 2018 03:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339577 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 339577 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, 22 Oct 2018 03:29:55 -0000 Author: bwidawsk Date: Mon Oct 22 03:29:54 2018 New Revision: 339577 URL: https://svnweb.freebsd.org/changeset/base/339577 Log: acpi: Add an interface to obtain DSM information The Device Specific Method (_DSM) is on optional object that defines device specific controls. This will be useful for our power management controller in upcoming patches. More information can be found in ACPI spec 6.2 section 9.1.1 https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf This patch had a minor modification changing ENOMEM to AE_NO_MEMORY after it got review and approval but before committing. Test Plan: Tested in my s0ix branch Reviewed by: kib Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D17121 Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Oct 22 02:42:14 2018 (r339576) +++ head/sys/dev/acpica/acpi.c Mon Oct 22 03:29:54 2018 (r339577) @@ -2570,6 +2570,98 @@ acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOU return (AE_OK); } +UINT8 +acpi_DSMQuery(ACPI_HANDLE h, uint8_t *uuid, int revision) +{ + /* + * ACPI spec 9.1.1 defines this. + * + * "Arg2: Function Index Represents a specific function whose meaning is + * specific to the UUID and Revision ID. Function indices should start + * with 1. Function number zero is a query function (see the special + * return code defined below)." + */ + ACPI_BUFFER buf; + ACPI_OBJECT *obj; + UINT8 ret = 0; + + if (!ACPI_SUCCESS(acpi_EvaluateDSM(h, uuid, revision, 0, NULL, &buf))) { + ACPI_INFO(("Failed to enumerate DSM functions\n")); + return (0); + } + + obj = (ACPI_OBJECT *)buf.Pointer; + KASSERT(obj, ("Object not allowed to be NULL\n")); + + /* + * From ACPI 6.2 spec 9.1.1: + * If Function Index = 0, a Buffer containing a function index bitfield. + * Otherwise, the return value and type depends on the UUID and revision + * ID (see below). + */ + switch (obj->Type) { + case ACPI_TYPE_BUFFER: + ret = *(uint8_t *)obj->Buffer.Pointer; + break; + case ACPI_TYPE_INTEGER: + ACPI_BIOS_WARNING((AE_INFO, + "Possibly buggy BIOS with ACPI_TYPE_INTEGER for function enumeration\n")); + ret = obj->Integer.Value & 0xFF; + break; + default: + ACPI_WARNING((AE_INFO, "Unexpected return type %u\n", obj->Type)); + }; + + AcpiOsFree(obj); + return ret; +} + +/* + * DSM may return multiple types depending on the function. It is therefore + * unsafe to use the typed evaluation. It is highly recommended that the caller + * check the type of the returned object. + */ +ACPI_STATUS +acpi_EvaluateDSM(ACPI_HANDLE handle, uint8_t *uuid, int revision, + uint64_t function, union acpi_object *package, ACPI_BUFFER *out_buf) +{ + ACPI_OBJECT arg[4]; + ACPI_OBJECT_LIST arglist; + ACPI_BUFFER buf; + ACPI_STATUS status; + + if (out_buf == NULL) + return (AE_NO_MEMORY); + + arg[0].Type = ACPI_TYPE_BUFFER; + arg[0].Buffer.Length = ACPI_UUID_LENGTH; + arg[0].Buffer.Pointer = uuid; + arg[1].Type = ACPI_TYPE_INTEGER; + arg[1].Integer.Value = revision; + arg[2].Type = ACPI_TYPE_INTEGER; + arg[2].Integer.Value = function; + if (package) { + arg[3] = *package; + } else { + arg[3].Type = ACPI_TYPE_PACKAGE; + arg[3].Package.Count = 0; + arg[3].Package.Elements = NULL; + } + + arglist.Pointer = arg; + arglist.Count = 4; + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiEvaluateObject(handle, "_DSM", &arglist, &buf); + if (ACPI_FAILURE(status)) + return (status); + + KASSERT(ACPI_SUCCESS(status), ("Unexpected status")); + + *out_buf = buf; + return (status); +} + ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, int revision, int count, uint32_t *caps_in, uint32_t *caps_out, bool query) Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon Oct 22 02:42:14 2018 (r339576) +++ head/sys/dev/acpica/acpivar.h Mon Oct 22 03:29:54 2018 (r339577) @@ -349,6 +349,10 @@ ACPI_STATUS acpi_FindIndexedResource(ACPI_BUFFER *buf, ACPI_RESOURCE **resp); ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res); +UINT8 acpi_DSMQuery(ACPI_HANDLE h, uint8_t *uuid, int revision); +ACPI_STATUS acpi_EvaluateDSM(ACPI_HANDLE handle, uint8_t *uuid, + int revision, uint64_t function, union acpi_object *package, + ACPI_BUFFER *out_buf); ACPI_STATUS acpi_EvaluateOSC(ACPI_HANDLE handle, uint8_t *uuid, int revision, int count, uint32_t *caps_in, uint32_t *caps_out, bool query); From owner-svn-src-head@freebsd.org Mon Oct 22 04:12:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F63FE82DC; Mon, 22 Oct 2018 04:12:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9D8F86D42; Mon, 22 Oct 2018 04:12:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1430173F6; Mon, 22 Oct 2018 04:12:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9M4CpmE095580; Mon, 22 Oct 2018 04:12:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M4CpwY095579; Mon, 22 Oct 2018 04:12:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810220412.w9M4CpwY095579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 22 Oct 2018 04:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339578 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 339578 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, 22 Oct 2018 04:12:52 -0000 Author: kp Date: Mon Oct 22 04:12:51 2018 New Revision: 339578 URL: https://svnweb.freebsd.org/changeset/base/339578 Log: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD MFC after: 2 weeks Modified: head/sbin/pfctl/parse.y Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Mon Oct 22 03:29:54 2018 (r339577) +++ head/sbin/pfctl/parse.y Mon Oct 22 04:12:51 2018 (r339578) @@ -5765,8 +5765,10 @@ top: return (0); if (next == quotec || c == ' ' || c == '\t') c = next; - else if (next == '\n') + else if (next == '\n') { + file->lineno++; continue; + } else lungetc(next); } else if (c == quotec) { From owner-svn-src-head@freebsd.org Mon Oct 22 06:44:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9B58FEBA66; Mon, 22 Oct 2018 06:44:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E9128B2B5; Mon, 22 Oct 2018 06:44:21 +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 53C8F18BF6; Mon, 22 Oct 2018 06:44:21 +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 w9M6iLBw072323; Mon, 22 Oct 2018 06:44:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M6iL9C072322; Mon, 22 Oct 2018 06:44:21 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201810220644.w9M6iL9C072322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 22 Oct 2018 06:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339579 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 339579 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, 22 Oct 2018 06:44:21 -0000 Author: mjg Date: Mon Oct 22 06:44:20 2018 New Revision: 339579 URL: https://svnweb.freebsd.org/changeset/base/339579 Log: amd64: finish the tail in memset with an overlapping store Instead of finding the exact size to fit in we can just shift the target by -8 + tail. Doing a blind write to a previously rep stosq'ed area comes with a penalty so do it conditionally. Sample win on EPYC when zeroing a 257 sized buffer (tail = 1) aligned to 16 bytes: before: 44782846 ops/s after: 46118614 ops/s Idea stolen from NetBSD. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Mon Oct 22 04:12:51 2018 (r339578) +++ head/sys/amd64/amd64/support.S Mon Oct 22 06:44:20 2018 (r339579) @@ -524,9 +524,12 @@ END(memcpy_erms) rep stosq movq %r9,%rax - movq %rdx,%rcx - andb $7,%cl - jne 1004b + andl $7,%edx + jnz 1f + POP_FRAME_POINTER + ret +1: + movq %r10,-8(%rdi,%rdx) .endif POP_FRAME_POINTER ret From owner-svn-src-head@freebsd.org Mon Oct 22 08:29:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90EB2FEE979; Mon, 22 Oct 2018 08:29:35 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2601F8E4B9; Mon, 22 Oct 2018 08:29:35 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by mail-it1-x129.google.com with SMTP id 74-v6so10948561itw.1; Mon, 22 Oct 2018 01:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rBuqjnM6dniZsRc8BpSsuGtdHVwaOqW0qFubU/SGdMI=; b=YoVwn4TL+YAqbvuhXeMrDjzZXTH0dRlzzheYZR8FakBP323axPCV57XxpgC/Fwsvt1 pjQpwdoGpVQC0VpAZBGFblIv+BroYUp7ERMGm8noBS9Pc0dYaY7I9PXtWuK2JG+fDj+4 2Qh1wma97sd2Y8VUZag6bLh0gU9C7PRWzFgLggbhMUJjwwniYmrohwgpTrBvfcqWR9NS QLRkaBRDHYWwYgzCfxq35n0IzJO9RvHo0C//jjrsKlKZFoF5C4v6PTG4Pj3XXOk1dM84 PwdjyI6ZuIjMKr/HICLBRw91kAsr7FwCUbQdZHl27m1ImW9vseRW3rVXpg/JQQrKjLKk nnuA== 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=rBuqjnM6dniZsRc8BpSsuGtdHVwaOqW0qFubU/SGdMI=; b=rIEOfpBftp6X5fMhElUwVuPK1zr4YyfdxcFHfTZo3bYQ6Y3KP62UGzB9v72szPj/fW Baqn9zbGRoCFyMcFbQy7kpMSCfVxyLUfiW6EmyzxgATzOHdlu9yHy+Na0oNIY8CuCBTx xfn6edri1Gs5ny+x1TWPUQobCosepTv8Nt/5EDX6FkQgYh0ApozB7YRxIi9XOSjqblxs p4UVTnQZD+sj+79HajgKcuhWGM3IROuGEwCfyh3CdiAilS6JVAzZSLvMquYAkM6IAvyF HBgrZOib1wrbdrzG1J/bP/ZjwdJBTmSu8znIZxyn0veCwaDQYakh01g+dRT+W8oB14mp SxaA== X-Gm-Message-State: ABuFfohTRU4doh+s4nWFJ9XAA84NEfKrq5VPYFNUDYgio4G+zNP9FKno 6uZQJKpwgK6Xrq1G+FDazy+uHka8VQGZx14kiIk= X-Google-Smtp-Source: ACcGV6104KJKVyHYZhsIRH44xwCz4uknuCSHz3oeLtnQ3SlbnfmmSoBwUwPKAUXI9bP4AHo6oJSdyFTQj5uANQGgbcw= X-Received: by 2002:a24:8601:: with SMTP id u1-v6mr8467665itd.177.1540196974261; Mon, 22 Oct 2018 01:29:34 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2YPTt043620@repo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Ren=C3=A9_Ladan?= Date: Mon, 22 Oct 2018 10:29:22 +0200 Message-ID: Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf To: bjkfbsd@gmail.com Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org 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: Mon, 22 Oct 2018 08:29:35 -0000 Op ma 22 okt. 2018 om 05:00 schreef Benjamin Kaduk : > On Sun, Oct 21, 2018 at 9:53 PM Warner Losh wrote: > > > > > > > On Sun, Oct 21, 2018 at 8:47 PM Benjamin Kaduk > wrote: > > > >> On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: > >> > >>> Author: imp > >>> Date: Mon Oct 22 02:34:25 2018 > >>> New Revision: 339565 > >>> URL: https://svnweb.freebsd.org/changeset/base/339565 > >>> > >>> Log: > >>> Remove aha(4) from the tree. > >>> > >>> > >> The documentation build is now failing, as there's an entity reference > to > >> the autogenerated > >> hardware list, which does not exist anymore. Will you be able to look > at > >> those as part of your > >> removals or does someone from the doc team need to handle it? > >> > > > > I'll take a look. What exactly is failing? The only place I see aha.4 i= s > > in doc/head/share/xml/man-refs.ent but there's several other drivers th= at > > have been removed that are in there... So I'm confused and need some > > additional guidance. > > > > The build log is mailed out at (e.g.) > https://lists.freebsd.org/pipermail/freebsd-doc/2018-October/031621.html > Though looking slightly more closely, it seems to be complaining about th= e > 12.0 release notes (!), which might both (1) be awkward to solve, and (2) > be in re@'s territory. > The website build (in doc/head/en_US.ISO8859-1/htdocs) does a partial CURRENT checkout: /usr/local/bin/svn co svn://svn.freebsd.org/base/head/share/man/man4 /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/svn.N0= lzOSqR so it is not specific for the 12.0-RELEASE notes, they are just part of the doc build. I guess the doc repository refers to now deleted man(4) entries. Ren=C3=A9 From owner-svn-src-head@freebsd.org Mon Oct 22 08:55:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57B24FEFC4D; Mon, 22 Oct 2018 08:55:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8368F594; Mon, 22 Oct 2018 08:55:59 +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 088411A100; Mon, 22 Oct 2018 08:55:59 +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 w9M8twtv038902; Mon, 22 Oct 2018 08:55:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M8twJM038901; Mon, 22 Oct 2018 08:55:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810220855.w9M8twJM038901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Oct 2018 08:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339581 - head/sys/dev/sound/midi X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/midi X-SVN-Commit-Revision: 339581 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, 22 Oct 2018 08:55:59 -0000 Author: hselasky Date: Mon Oct 22 08:55:58 2018 New Revision: 339581 URL: https://svnweb.freebsd.org/changeset/base/339581 Log: Fix off-by-one which can lead to panics. Found by: Peter Holm MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/midi/sequencer.c Modified: head/sys/dev/sound/midi/sequencer.c ============================================================================== --- head/sys/dev/sound/midi/sequencer.c Mon Oct 22 07:04:44 2018 (r339580) +++ head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:55:58 2018 (r339581) @@ -730,7 +730,7 @@ static int seq_fetch_mid(struct seq_softc *scp, int unit, kobj_t *md) { - if (unit > scp->midi_number || unit < 0) + if (unit >= scp->midi_number || unit < 0) return EINVAL; *md = scp->midis[unit]; From owner-svn-src-head@freebsd.org Mon Oct 22 08:58:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD481FEFD97; Mon, 22 Oct 2018 08:58:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 631828F74A; Mon, 22 Oct 2018 08:58:28 +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 5DC7E1A103; Mon, 22 Oct 2018 08:58:28 +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 w9M8wSlG039043; Mon, 22 Oct 2018 08:58:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M8wSBZ039042; Mon, 22 Oct 2018 08:58:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810220858.w9M8wSBZ039042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Oct 2018 08:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339582 - head/sys/dev/sound/midi X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/midi X-SVN-Commit-Revision: 339582 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, 22 Oct 2018 08:58:28 -0000 Author: hselasky Date: Mon Oct 22 08:58:27 2018 New Revision: 339582 URL: https://svnweb.freebsd.org/changeset/base/339582 Log: Drop sequencer mutex around uiomove() and make sure we don't move more bytes than is available, else a panic might happen. Found by: Peter Holm MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/midi/sequencer.c Modified: head/sys/dev/sound/midi/sequencer.c ============================================================================== --- head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:55:58 2018 (r339581) +++ head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:58:27 2018 (r339582) @@ -921,7 +921,9 @@ mseq_read(struct cdev *i_dev, struct uio *uio, int iof SEQ_DEBUG(8, printf("midiread: uiomove cc=%d\n", used)); MIDIQ_DEQ(scp->in_q, buf, used); + mtx_unlock(&scp->seq_lock); retval = uiomove(buf, used, uio); + mtx_lock(&scp->seq_lock); if (retval) goto err1; } @@ -996,7 +998,9 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io retval = ENXIO; goto err0; } + mtx_unlock(&scp->seq_lock); retval = uiomove(event, used, uio); + mtx_lock(&scp->seq_lock); if (retval) goto err0; @@ -1034,7 +1038,9 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io SEQ_DEBUG(2, printf("seq_write: SEQ_FULLSIZE flusing buffer.\n")); while (uio->uio_resid > 0) { - retval = uiomove(event, EV_SZ, uio); + mtx_unlock(&scp->seq_lock); + retval = uiomove(event, MIN(EV_SZ, uio->uio_resid), uio); + mtx_lock(&scp->seq_lock); if (retval) goto err0; @@ -1045,6 +1051,7 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io } retval = EINVAL; if (ev_code >= 128) { + int error; /* * Some sort of an extended event. The size is eight @@ -1054,7 +1061,13 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io SEQ_DEBUG(2, printf("seq_write: invalid level two event %x.\n", ev_code)); goto err0; } - if (uiomove((caddr_t)&event[4], 4, uio)) { + mtx_unlock(&scp->seq_lock); + if (uio->uio_resid < 4) + error = EINVAL; + else + error = uiomove((caddr_t)&event[4], 4, uio); + mtx_lock(&scp->seq_lock); + if (error) { SEQ_DEBUG(2, printf("seq_write: user memory mangled?\n")); goto err0; From owner-svn-src-head@freebsd.org Mon Oct 22 08:59:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2143FEFE27; Mon, 22 Oct 2018 08:59:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 783A28F89E; Mon, 22 Oct 2018 08:59:20 +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 731D91A105; Mon, 22 Oct 2018 08:59:20 +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 w9M8xKYc039121; Mon, 22 Oct 2018 08:59:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M8xKr2039120; Mon, 22 Oct 2018 08:59:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810220859.w9M8xKr2039120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Oct 2018 08:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339583 - head/sys/dev/sound/midi X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/midi X-SVN-Commit-Revision: 339583 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, 22 Oct 2018 08:59:20 -0000 Author: hselasky Date: Mon Oct 22 08:59:20 2018 New Revision: 339583 URL: https://svnweb.freebsd.org/changeset/base/339583 Log: The event bytes should be unsigned char. Found by: Peter Holm MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/midi/sequencer.c Modified: head/sys/dev/sound/midi/sequencer.c ============================================================================== --- head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:58:27 2018 (r339582) +++ head/sys/dev/sound/midi/sequencer.c Mon Oct 22 08:59:20 2018 (r339583) @@ -434,7 +434,7 @@ static void seq_eventthread(void *arg) { struct seq_softc *scp = arg; - char event[EV_SZ]; + u_char event[EV_SZ]; mtx_lock(&scp->seq_lock); SEQ_DEBUG(2, printf("seq_eventthread started\n")); From owner-svn-src-head@freebsd.org Mon Oct 22 09:51:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C30FF1F8A; Mon, 22 Oct 2018 09:51:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D81A71B26; Mon, 22 Oct 2018 09:51:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w9M9pWxW027936 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Oct 2018 12:51:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9M9pWxW027936 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9M9pVF9027935; Mon, 22 Oct 2018 12:51:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 22 Oct 2018 12:51:31 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339582 - head/sys/dev/sound/midi Message-ID: <20181022095131.GN5335@kib.kiev.ua> References: <201810220858.w9M8wSBZ039042@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810220858.w9M8wSBZ039042@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home 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, 22 Oct 2018 09:51:43 -0000 On Mon, Oct 22, 2018 at 08:58:28AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 22 08:58:27 2018 > New Revision: 339582 > URL: https://svnweb.freebsd.org/changeset/base/339582 > > Log: > Drop sequencer mutex around uiomove() and make sure we don't move more bytes > than is available, else a panic might happen. And why it is safe to drop the mutex ? If it is safe to drop, why do you need the mutex at all ? From owner-svn-src-head@freebsd.org Mon Oct 22 10:07:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C621FF2A48; Mon, 22 Oct 2018 10:07:40 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from mail-it1-x12c.google.com (mail-it1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFC5672453; Mon, 22 Oct 2018 10:07:39 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by mail-it1-x12c.google.com with SMTP id k206-v6so11240380ite.0; Mon, 22 Oct 2018 03:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YxQ7fKOwGcm3DjSuuxdAqKgCPNqQi4nkn5o0yERcXVc=; b=GN+997OJN/v2+F7XOl7iAj+AekxFXSXmIaX2RgkN2OWwN422Tobt68TaO+bt2BiCOK +X/sCvFPWu/ImqKUsLR3tdnsxjAwDLoG3Ua/H+FzV0dErkJOKdSJN91I/fD7btm/YtcD EntX6nbNJDLlCzq/9VGAIyoK9MGGW4v8IbTL4Rxip29pIctnNoRT4EvHm9bHMJlxaqHq lCihNUDU50yowLZD48VmnJeAdcbkJZmPPX5Y0mdd2Y5SWmefO/XF8aA2e2Pt/kugqulS y5q8CW+XeLFiYS0TIs/yweTY1G3POYPi/8YkAyDJiZlxKiDr7X7yQ8Hln+wm3nPWo9E6 MrtQ== 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=YxQ7fKOwGcm3DjSuuxdAqKgCPNqQi4nkn5o0yERcXVc=; b=MJz5/UFGjHepo1N+/Dlcl8bTrwYaEQx8K5gMvoNnj9iEUJ4ZyN7glxCScbziP1TfWl u+RBo/WpUOMEEMLD6j4X9DXd3B8iNIob+r9uA9kydWGremcPwQTx968YNNDkXJVnMIbd +veORFXSY9dTnkfndWtHSHwpVvM6KML6p3EIaNebKRgC2TOjLFLDwWOyBMDSu6RDzN7q +n6jmh+S1RRYxoaPazrn4mkV7ActciKPS5PxwnGpsBKMmlL5zwjGB3ryW1Kq1WLtAFlu ue9yA3+x7RvLRwGolDNJdbs07FBPnALn0olPY5TV4EsLsRtJEL724LhhwvdpB1KMLtFI j2TQ== X-Gm-Message-State: ABuFfogDrm3/vn5TS/26/F/OOsq+Iy6S1Uerm/mYsPiYEPq7bxJBFZ0R 5FkreHQU39hB2yRjKdn9n2i7dl8TJNb4jJ0d7+Gysc81 X-Google-Smtp-Source: ACcGV61O91Bmz1hbbuF635Olz39lO0ffpVnyVDTxZjC6jNxwQHvOzfQQkGvz/vPQk+Z7JytyFqs1nESHGhIXFXDHmfI= X-Received: by 2002:a24:55d6:: with SMTP id e205-v6mr9436716itb.150.1540202859167; Mon, 22 Oct 2018 03:07:39 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2YPTt043620@repo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Ren=C3=A9_Ladan?= Date: Mon, 22 Oct 2018 12:07:27 +0200 Message-ID: Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf To: bjkfbsd@gmail.com Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, imp@freebsd.org 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: Mon, 22 Oct 2018 10:07:40 -0000 Op ma 22 okt. 2018 om 10:29 schreef Ren=C3=A9 Ladan : > Op ma 22 okt. 2018 om 05:00 schreef Benjamin Kaduk : > >> On Sun, Oct 21, 2018 at 9:53 PM Warner Losh wrote: >> >> > >> > >> > On Sun, Oct 21, 2018 at 8:47 PM Benjamin Kaduk >> wrote: >> > >> >> On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: >> >> >> >>> Author: imp >> >>> Date: Mon Oct 22 02:34:25 2018 >> >>> New Revision: 339565 >> >>> URL: https://svnweb.freebsd.org/changeset/base/339565 >> >>> >> >>> Log: >> >>> Remove aha(4) from the tree. >> >>> >> >>> >> >> The documentation build is now failing, as there's an entity referenc= e >> to >> >> the autogenerated >> >> hardware list, which does not exist anymore. Will you be able to loo= k >> at >> >> those as part of your >> >> removals or does someone from the doc team need to handle it? >> >> >> > >> > I'll take a look. What exactly is failing? The only place I see aha.4 = is >> > in doc/head/share/xml/man-refs.ent but there's several other drivers >> that >> > have been removed that are in there... So I'm confused and need some >> > additional guidance. >> > >> >> The build log is mailed out at (e.g.) >> https://lists.freebsd.org/pipermail/freebsd-doc/2018-October/031621.html >> Though looking slightly more closely, it seems to be complaining about t= he >> 12.0 release notes (!), which might both (1) be awkward to solve, and (2= ) >> be in re@'s territory. >> > > The website build (in doc/head/en_US.ISO8859-1/htdocs) does a partial > CURRENT checkout: > > /usr/local/bin/svn co svn://svn.freebsd.org/base/head/share/man/man4 > /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/svn.= N0lzOSqR > > so it is not specific for the 12.0-RELEASE notes, they are just part of > the doc build. I guess the doc repository refers to now deleted man(4) > entries. > > The full list seems to be: /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:642: parser error : Entity 'hwlist.adv' not defined &hwlist.adv; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:644: parser error : Entity 'hwlist.adw' not defined &hwlist.adw; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:646: parser error : Entity 'hwlist.aha' not defined &hwlist.aha; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:654: parser error : Entity 'hwlist.aic' not defined &hwlist.aic; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:664: parser error : Entity 'hwlist.dpt' not defined &hwlist.dpt; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:714: parser error : Entity 'hwlist.ncr' not defined &hwlist.ncr; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:716: parser error : Entity 'hwlist.ncv' not defined &hwlist.ncv; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:718: parser error : Entity 'hwlist.nsp' not defined &hwlist.nsp; ^ /usr/freebsd/doc/head/en_US.ISO8859-1/htdocs/releases/12.0R/hardware/hardwa= re.xml:726: parser error : Entity 'hwlist.stg' not defined &hwlist.stg; ^ Ren=C3=A9 From owner-svn-src-head@freebsd.org Mon Oct 22 10:10:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE57DFF2B53; Mon, 22 Oct 2018 10:10:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83119725E9; Mon, 22 Oct 2018 10:10:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [178.17.145.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 544CD260174; Mon, 22 Oct 2018 12:10:26 +0200 (CEST) Subject: Re: svn commit: r339582 - head/sys/dev/sound/midi To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810220858.w9M8wSBZ039042@repo.freebsd.org> <20181022095131.GN5335@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Mon, 22 Oct 2018 12:09:54 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <20181022095131.GN5335@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 22 Oct 2018 10:10:28 -0000 On 10/22/18 11:51 AM, Konstantin Belousov wrote: > On Mon, Oct 22, 2018 at 08:58:28AM +0000, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Mon Oct 22 08:58:27 2018 >> New Revision: 339582 >> URL: https://svnweb.freebsd.org/changeset/base/339582 >> >> Log: >> Drop sequencer mutex around uiomove() and make sure we don't move more bytes >> than is available, else a panic might happen. > And why it is safe to drop the mutex ? > If it is safe to drop, why do you need the mutex at all ? > The seq mutex protects the queue state, which is entirely computed prior or after uiomove(). --HPS From owner-svn-src-head@freebsd.org Mon Oct 22 10:20:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E423FF2EEC; Mon, 22 Oct 2018 10:20:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8006972B29; Mon, 22 Oct 2018 10:20:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w9MAKGVZ034380 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Oct 2018 13:20:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9MAKGVZ034380 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9MAKGbH034379; Mon, 22 Oct 2018 13:20:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 22 Oct 2018 13:20:16 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339582 - head/sys/dev/sound/midi Message-ID: <20181022102016.GO5335@kib.kiev.ua> References: <201810220858.w9M8wSBZ039042@repo.freebsd.org> <20181022095131.GN5335@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home 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, 22 Oct 2018 10:20:28 -0000 On Mon, Oct 22, 2018 at 12:09:54PM +0200, Hans Petter Selasky wrote: > On 10/22/18 11:51 AM, Konstantin Belousov wrote: > > On Mon, Oct 22, 2018 at 08:58:28AM +0000, Hans Petter Selasky wrote: > >> Author: hselasky > >> Date: Mon Oct 22 08:58:27 2018 > >> New Revision: 339582 > >> URL: https://svnweb.freebsd.org/changeset/base/339582 > >> > >> Log: > >> Drop sequencer mutex around uiomove() and make sure we don't move more bytes > >> than is available, else a panic might happen. > > And why it is safe to drop the mutex ? > > If it is safe to drop, why do you need the mutex at all ? > > > > The seq mutex protects the queue state, which is entirely computed prior > or after uiomove(). Then why do you need to re-acquire the mutex after uiomove ? From owner-svn-src-head@freebsd.org Mon Oct 22 10:27:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05FB2FF32F5; Mon, 22 Oct 2018 10:27:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 633C57316B; Mon, 22 Oct 2018 10:27:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [178.17.145.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 78C75260174; Mon, 22 Oct 2018 12:27:17 +0200 (CEST) Subject: Re: svn commit: r339582 - head/sys/dev/sound/midi To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810220858.w9M8wSBZ039042@repo.freebsd.org> <20181022095131.GN5335@kib.kiev.ua> <20181022102016.GO5335@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Mon, 22 Oct 2018 12:26:46 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <20181022102016.GO5335@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 22 Oct 2018 10:27:20 -0000 On 10/22/18 12:20 PM, Konstantin Belousov wrote: > Then why do you need to re-acquire the mutex after uiomove ? Hi, Because the code is factored this way: mtx_lock(); while (uio->uio_resid > 0) { do state checks() mtx_unlock(); retval = uiomove(); mtx_lock(); } mtx_unlock(); Yes, you're right the last mtx_lock() can be optimised away. I'm leaving that to somebody else. This code typically is processing MIDI events at very slow rates like 8KBytes/s and does not need to be very fast. --HPS From owner-svn-src-head@freebsd.org Mon Oct 22 10:38:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D5B7FF3806; Mon, 22 Oct 2018 10:38:39 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3E0C736AD; Mon, 22 Oct 2018 10:38:38 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D081B1D4; Mon, 22 Oct 2018 10:38:38 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MAccjo090635; Mon, 22 Oct 2018 10:38:38 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MAccuc090633; Mon, 22 Oct 2018 10:38:38 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201810221038.w9MAccuc090633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Mon, 22 Oct 2018 10:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339584 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 339584 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, 22 Oct 2018 10:38:39 -0000 Author: slavash Date: Mon Oct 22 10:38:38 2018 New Revision: 339584 URL: https://svnweb.freebsd.org/changeset/base/339584 Log: mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation If power exceed the slot limit, or slot limit is unknown the ConnectX-6 firmware will shutdown its port. Inform the user via debug message. MFC after: 3 days Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Mon Oct 22 08:59:20 2018 (r339583) +++ head/sys/dev/mlx5/device.h Mon Oct 22 10:38:38 2018 (r339584) @@ -549,6 +549,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED = 0xc, }; struct mlx5_eqe_port_module_event { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Oct 22 08:59:20 2018 (r339583) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Oct 22 10:38:38 2018 (r339584) @@ -615,6 +615,12 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Cable is shorted"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED: + return "One or more network ports have been powered " + "down due to insufficient/unadvertised power on " + "the PCIe slot. Please refer to the card's user " + "manual for power specifications or contact " + "Mellanox support."; default: return "Unknown error type"; From owner-svn-src-head@freebsd.org Mon Oct 22 11:23:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B52FF71E9; Mon, 22 Oct 2018 11:23:52 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBA9B75099; Mon, 22 Oct 2018 11:23:51 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D10E61B9D8; Mon, 22 Oct 2018 11:23:51 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MBNpF2015988; Mon, 22 Oct 2018 11:23:51 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MBNpII015987; Mon, 22 Oct 2018 11:23:51 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201810221123.w9MBNpII015987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Mon, 22 Oct 2018 11:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339585 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 339585 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, 22 Oct 2018 11:23:52 -0000 Author: whu Date: Mon Oct 22 11:23:51 2018 New Revision: 339585 URL: https://svnweb.freebsd.org/changeset/base/339585 Log: Do not trop UDP traffic when TXCSUM_IPV6 flag is on PR: 231797 Submitted by: whu Reviewed by: dexuan Obtained from: Kevin Morse MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333&action=diff Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 22 10:38:38 2018 (r339584) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 22 11:23:51 2018 (r339585) @@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } From owner-svn-src-head@freebsd.org Mon Oct 22 11:43:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 176B2FF7FA7; Mon, 22 Oct 2018 11:43:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBD0E75E39; Mon, 22 Oct 2018 11:43:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6E571BDD9; Mon, 22 Oct 2018 11:43:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MBhh8p026065; Mon, 22 Oct 2018 11:43:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MBhh9Q026064; Mon, 22 Oct 2018 11:43:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810221143.w9MBhh9Q026064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 22 Oct 2018 11:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339586 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 339586 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, 22 Oct 2018 11:43:44 -0000 Author: bz Date: Mon Oct 22 11:43:43 2018 New Revision: 339586 URL: https://svnweb.freebsd.org/changeset/base/339586 Log: In bhyve's fbuf emulation improve the overall "usage" message and for the vga option, rather than printing the entire option string, only print vga (as we do for everything else). MFC after: 3 days Modified: head/usr.sbin/bhyve/pci_fbuf.c Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Mon Oct 22 11:23:51 2018 (r339585) +++ head/usr.sbin/bhyve/pci_fbuf.c Mon Oct 22 11:43:43 2018 (r339586) @@ -117,8 +117,9 @@ static void pci_fbuf_usage(char *opt) { - fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt); - fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n"); + fprintf(stderr, "Invalid fbuf emulation option \"%s\"\r\n", opt); + fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port" + "{,w=width}{,h=height}\r\n"); } static void @@ -268,7 +269,7 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o sc->vga_enabled = 1; sc->vga_full = 1; } else { - pci_fbuf_usage(opts); + pci_fbuf_usage(xopts); ret = -1; goto done; } From owner-svn-src-head@freebsd.org Mon Oct 22 11:58:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8918AFF8922; Mon, 22 Oct 2018 11:58:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 389C276748; Mon, 22 Oct 2018 11:58:31 +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 332621BF94; Mon, 22 Oct 2018 11:58:31 +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 w9MBwVdK031462; Mon, 22 Oct 2018 11:58:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MBwVs7031461; Mon, 22 Oct 2018 11:58:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810221158.w9MBwVs7031461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Oct 2018 11:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339587 - head/sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/serial X-SVN-Commit-Revision: 339587 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, 22 Oct 2018 11:58:31 -0000 Author: hselasky Date: Mon Oct 22 11:58:30 2018 New Revision: 339587 URL: https://svnweb.freebsd.org/changeset/base/339587 Log: Added support for formula-based arbitrary baud rates, in contrast to the current fixed values, which enables use of rates above 1 Mbps. Improved the detection of HXD chips, and the status flag handling as well. Submitted by: Gabor Simon PR: 225932 Differential revision: https://reviews.freebsd.org/D16639 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/serial/uplcom.c Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Mon Oct 22 11:43:43 2018 (r339586) +++ head/sys/dev/usb/serial/uplcom.c Mon Oct 22 11:58:30 2018 (r339587) @@ -134,12 +134,20 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RW #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 #define RSAQ_STATUS_CTS 0x80 +#define RSAQ_STATUS_OVERRUN_ERROR 0x40 +#define RSAQ_STATUS_PARITY_ERROR 0x20 +#define RSAQ_STATUS_FRAME_ERROR 0x10 +#define RSAQ_STATUS_RING 0x08 +#define RSAQ_STATUS_BREAK_ERROR 0x04 #define RSAQ_STATUS_DSR 0x02 #define RSAQ_STATUS_DCD 0x01 #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 +#define TYPE_PL2303HXD 2 +#define UPLCOM_STATE_INDEX 8 + enum { UPLCOM_BULK_DT_WR, UPLCOM_BULK_DT_RD, @@ -369,18 +377,49 @@ uplcom_attach(device_t dev) sc->sc_udev = uaa->device; - /* Determine the chip type. This algorithm is taken from Linux. */ dd = usbd_get_device_descriptor(sc->sc_udev); - if (dd->bDeviceClass == 0x02) - sc->sc_chiptype = TYPE_PL2303; - else if (dd->bMaxPacketSize == 0x40) + + switch (UGETW(dd->bcdDevice)) { + case 0x0300: sc->sc_chiptype = TYPE_PL2303HX; - else - sc->sc_chiptype = TYPE_PL2303; + /* or TA, that is HX with external crystal */ + break; + case 0x0400: + sc->sc_chiptype = TYPE_PL2303HXD; + /* or EA, that is HXD with ESD protection */ + /* or RA, that has internal voltage level converter that works only up to 1Mbaud (!) */ + break; + case 0x0500: + sc->sc_chiptype = TYPE_PL2303HXD; + /* in fact it's TB, that is HXD with external crystal */ + break; + default: + /* NOTE: I have no info about the bcdDevice for the base PL2303 (up to 1.2Mbaud, + only fixed rates) and for PL2303SA (8-pin chip, up to 115200 baud */ + /* Determine the chip type. This algorithm is taken from Linux. */ + if (dd->bDeviceClass == 0x02) + sc->sc_chiptype = TYPE_PL2303; + else if (dd->bMaxPacketSize == 0x40) + sc->sc_chiptype = TYPE_PL2303HX; + else + sc->sc_chiptype = TYPE_PL2303; + break; + } - DPRINTF("chiptype: %s\n", - (sc->sc_chiptype == TYPE_PL2303HX) ? - "2303X" : "2303"); + switch (sc->sc_chiptype) { + case TYPE_PL2303: + DPRINTF("chiptype: 2303\n"); + break; + case TYPE_PL2303HX: + DPRINTF("chiptype: 2303HX/TA\n"); + break; + case TYPE_PL2303HXD: + DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); + break; + default: + DPRINTF("chiptype: unknown %d\n", sc->sc_chiptype); + break; + } /* * USB-RSAQ1 has two interface @@ -429,13 +468,14 @@ uplcom_attach(device_t dev) goto detach; } - if (sc->sc_chiptype != TYPE_PL2303HX) { + if (sc->sc_chiptype == TYPE_PL2303) { /* HX variants seem to lock up after a clear stall request. */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); } else { + /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, @@ -554,7 +594,7 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t ch || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0)) return (EIO); - if (chiptype == TYPE_PL2303HX) + if (chiptype != TYPE_PL2303) err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0); else err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x24, 0); @@ -634,23 +674,52 @@ uplcom_cfg_set_break(struct ucom_softc *ucom, uint8_t &req, NULL, 0, 1000); } +/* + * NOTE: These baud rates are officially supported, they can be written + * directly into dwDTERate register. + * + * Free baudrate setting is not supported by the base PL2303, and on + * other models it requires writing a divisor value to dwDTERate instead + * of the raw baudrate. The formula for divisor calculation is not published + * by the vendor, so it is speculative, though the official product homepage + * refers to the Linux module source as a reference implementation. + */ static const uint32_t uplcom_rates[] = { - 75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, - 19200, 28800, 38400, 57600, 115200, /* - * Higher speeds are probably possible. PL2303X supports up to - * 6Mb and can set any rate + * Basic 'standard' speed rates, supported by all models + * NOTE: 900 and 56000 actually works as well */ - 230400, 460800, 614400, 921600, 1228800 + 75, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, + 19200, 28800, 38400, 56000, 57600, 115200, + /* + * Advanced speed rates up to 6Mbs, supported by HX/TA and HXD/TB/EA/RA + * NOTE: regardless of the spec, 256000 does not work + */ + 128000, 134400, 161280, 201600, 230400, 268800, 403200, 460800, 614400, + 806400, 921600, 1228800, 2457600, 3000000, 6000000, + /* + * Advanced speed rates up to 12, supported by HXD/TB/EA/RA + */ + 12000000 }; #define N_UPLCOM_RATES nitems(uplcom_rates) static int +uplcom_baud_supported(unsigned int speed) +{ + int i; + for (i = 0; i < N_UPLCOM_RATES; i++) { + if (uplcom_rates[i] == speed) + return 1; + } + return 0; +} + +static int uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) { struct uplcom_softc *sc = ucom->sc_parent; - uint8_t i; DPRINTF("\n"); @@ -658,26 +727,75 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termi * Check requested baud rate. * * The PL2303 can only set specific baud rates, up to 1228800 baud. - * The PL2303X can set any baud rate up to 6Mb. + * The PL2303HX can set any baud rate up to 6Mb. * The PL2303HX rev. D can set any baud rate up to 12Mb. * - * XXX: We currently cannot identify the PL2303HX rev. D, so treat - * it the same as the PL2303X. */ - if (sc->sc_chiptype != TYPE_PL2303HX) { - for (i = 0; i < N_UPLCOM_RATES; i++) { - if (uplcom_rates[i] == t->c_ospeed) + + /* accept raw divisor data, if someone wants to do the math in user domain */ + if (t->c_ospeed & 0x80000000) + return 0; + switch (sc->sc_chiptype) { + case TYPE_PL2303HXD: + if (t->c_ospeed <= 12000000) return (0); - } - } else { - if (t->c_ospeed <= 6000000) - return (0); + break; + case TYPE_PL2303HX: + if (t->c_ospeed <= 6000000) + return (0); + break; + default: + if (uplcom_baud_supported(t->c_ospeed)) + return (0); + break; } DPRINTF("uplcom_param: bad baud rate (%d)\n", t->c_ospeed); return (EIO); } +static unsigned int +uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned int baud) +{ + unsigned int baseline, mantissa, exponent; + + /* Determine the baud rate divisor. This algorithm is taken from Linux. */ + /* + * Apparently the formula is: + * baudrate = baseline / (mantissa * 4^exponent) + * where + * mantissa = buf[8:0] + * exponent = buf[11:9] + */ + if (baud == 0) + baud = 1; + baseline = 383385600; + mantissa = baseline / baud; + if (mantissa == 0) + mantissa = 1; + exponent = 0; + while (mantissa >= 512) { + if (exponent < 7) { + mantissa >>= 2; /* divide by 4 */ + exponent++; + } else { + /* Exponent is maxed. Trim mantissa and leave. This gives approx. 45.8 baud */ + mantissa = 511; + break; + } + } + + buf[3] = 0x80; + buf[2] = 0; + buf[1] = exponent << 1 | mantissa >> 8; + buf[0] = mantissa & 0xff; + + /* Calculate and return the exact baud rate. */ + baud = (baseline / mantissa) >> (exponent << 1); + DPRINTF("real baud rate will be %u\n", baud); + + return baud; +} static void uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { @@ -689,10 +807,24 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi memset(&ls, 0, sizeof(ls)); - USETDW(ls.dwDTERate, t->c_ospeed); + /* + * NOTE: If unsupported baud rates are set directly, the PL2303* uses 9600 baud. + */ + if ((t->c_ospeed & 0x80000000) || uplcom_baud_supported(t->c_ospeed)) + USETDW(ls.dwDTERate, t->c_ospeed); + else + t->c_ospeed = uplcom_encode_baud_rate_divisor((uint8_t*)&ls.dwDTERate, t->c_ospeed); if (t->c_cflag & CSTOPB) { - ls.bCharFormat = UCDC_STOP_BIT_2; + if ((t->c_cflag & CSIZE) == CS5) { + /* + * NOTE: Comply with "real" UARTs / RS232: + * use 1.5 instead of 2 stop bits with 5 data bits + */ + ls.bCharFormat = UCDC_STOP_BIT_1_5; + } else { + ls.bCharFormat = UCDC_STOP_BIT_2; + } } else { ls.bCharFormat = UCDC_STOP_BIT_1; } @@ -722,7 +854,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi break; } - DPRINTF("rate=%d fmt=%d parity=%d bits=%d\n", + DPRINTF("rate=0x%08x fmt=%d parity=%d bits=%d\n", UGETDW(ls.dwDTERate), ls.bCharFormat, ls.bParityType, ls.bDataBits); @@ -743,7 +875,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); - if (sc->sc_chiptype == TYPE_PL2303HX) + if (sc->sc_chiptype != TYPE_PL2303) USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); else USETW(req.wIndex, UPLCOM_SET_CRTSCTS); @@ -809,7 +941,6 @@ uplcom_cfg_get_status(struct ucom_softc *ucom, uint8_t DPRINTF("\n"); - /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } @@ -834,18 +965,33 @@ uplcom_intr_callback(struct usb_xfer *xfer, usb_error_ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("status = 0x%02x\n", buf[8]); + DPRINTF("status = 0x%02x\n", buf[UPLCOM_STATE_INDEX]); sc->sc_lsr = 0; sc->sc_msr = 0; - if (buf[8] & RSAQ_STATUS_CTS) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_CTS) { sc->sc_msr |= SER_CTS; } - if (buf[8] & RSAQ_STATUS_DSR) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_OVERRUN_ERROR) { + sc->sc_lsr |= ULSR_OE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_PARITY_ERROR) { + sc->sc_lsr |= ULSR_PE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_FRAME_ERROR) { + sc->sc_lsr |= ULSR_FE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_RING) { + sc->sc_msr |= SER_RI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_BREAK_ERROR) { + sc->sc_lsr |= ULSR_BI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DSR) { sc->sc_msr |= SER_DSR; } - if (buf[8] & RSAQ_STATUS_DCD) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DCD) { sc->sc_msr |= SER_DCD; } ucom_status_change(&sc->sc_ucom); From owner-svn-src-head@freebsd.org Mon Oct 22 13:25:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50ECBFFBD2F; Mon, 22 Oct 2018 13:25:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3BDB79B4D; Mon, 22 Oct 2018 13:25:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1EA11CE33; Mon, 22 Oct 2018 13:25:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MDPQr6077121; Mon, 22 Oct 2018 13:25:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MDPQs5077120; Mon, 22 Oct 2018 13:25:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810221325.w9MDPQs5077120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Oct 2018 13:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339588 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339588 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, 22 Oct 2018 13:25:27 -0000 Author: hselasky Date: Mon Oct 22 13:25:26 2018 New Revision: 339588 URL: https://svnweb.freebsd.org/changeset/base/339588 Log: Resolve deadlock between epoch(9) and various network interface SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch read lock over typical network IOCTL code paths. This is a regression issue after r334305. Reviewed by: ae (network) Differential revision: https://reviews.freebsd.org/D17647 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Oct 22 11:58:30 2018 (r339587) +++ head/sys/net/if.c Mon Oct 22 13:25:26 2018 (r339588) @@ -964,12 +964,18 @@ if_attachdomain1(struct ifnet *ifp) void if_purgeaddrs(struct ifnet *ifp) { - struct ifaddr *ifa, *next; + struct ifaddr *ifa; - NET_EPOCH_ENTER(); - CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) { - if (ifa->ifa_addr->sa_family == AF_LINK) - continue; + while (1) { + NET_EPOCH_ENTER(); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_LINK) + break; + } + NET_EPOCH_EXIT(); + + if (ifa == NULL) + break; #ifdef INET /* XXX: Ugly!! ad hoc just for INET */ if (ifa->ifa_addr->sa_family == AF_INET) { @@ -996,7 +1002,6 @@ if_purgeaddrs(struct ifnet *ifp) IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); } - NET_EPOCH_EXIT(); } /* From owner-svn-src-head@freebsd.org Mon Oct 22 13:40:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E33C6FFC4E9; Mon, 22 Oct 2018 13:40:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 992057A42F; Mon, 22 Oct 2018 13:40:50 +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 941911D00B; Mon, 22 Oct 2018 13:40:50 +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 w9MDeojR084642; Mon, 22 Oct 2018 13:40:50 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MDeoIN084624; Mon, 22 Oct 2018 13:40:50 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201810221340.w9MDeoIN084624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 22 Oct 2018 13:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339589 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 339589 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, 22 Oct 2018 13:40:51 -0000 Author: luporl Date: Mon Oct 22 13:40:50 2018 New Revision: 339589 URL: https://svnweb.freebsd.org/changeset/base/339589 Log: ppc64: limited 32-bit DMA address range Further investigation of issues with 32-bit DMA on PowerNV revealed that its window is hardcoded by OPAL (at least in skiboot version 5.4.9) and cannot be changed by the OS. Thus, now jhb suggestion of limiting the range in PCI DMA tag seems the best way to deal with it. Reviewed by: jhibbits, nwhitehorn, sbruno Approved by: jhibbits(mentor) Differential Revision: https://reviews.freebsd.org/D17601 Modified: head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Mon Oct 22 13:25:26 2018 (r339588) +++ head/sys/powerpc/powernv/opal_pci.c Mon Oct 22 13:40:50 2018 (r339589) @@ -96,6 +96,9 @@ static int opalpci_route_interrupt(device_t bus, devic static void opalpic_pic_enable(device_t dev, u_int irq, u_int vector); static void opalpic_pic_eoi(device_t dev, u_int irq); +/* Bus interface */ +static bus_dma_tag_t opalpci_get_dma_tag(device_t dev, device_t child); + /* * Commands */ @@ -119,6 +122,8 @@ static void opalpic_pic_eoi(device_t dev, u_int irq); */ #define OPAL_PCI_DEFAULT_PE 1 +#define OPAL_PCI_BUS_SPACE_LOWADDR_32BIT 0x7FFFFFFFUL + /* * Driver methods. */ @@ -142,6 +147,9 @@ static device_method_t opalpci_methods[] = { DEVMETHOD(pic_enable, opalpic_pic_enable), DEVMETHOD(pic_eoi, opalpic_pic_eoi), + /* Bus interface */ + DEVMETHOD(bus_get_dma_tag, opalpci_get_dma_tag), + DEVMETHOD_END }; @@ -424,6 +432,23 @@ opalpci_attach(device_t dev) msi_ranges[1], msi_ranges[0]); } + /* Create the parent DMA tag */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ + 1, 0, /* alignment, bounds */ + OPAL_PCI_BUS_SPACE_LOWADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR_32BIT, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->ofw_sc.sc_dmat); + if (err != 0) { + device_printf(dev, "Failed to create DMA tag\n"); + return (err); + } + /* * General OFW PCI attach */ @@ -660,4 +685,13 @@ static void opalpic_pic_eoi(device_t dev, u_int irq) opal_call(OPAL_PCI_MSI_EOI, sc->phb_id, irq); PIC_EOI(root_pic, irq); +} + +static bus_dma_tag_t +opalpci_get_dma_tag(device_t dev, device_t child) +{ + struct opalpci_softc *sc; + + sc = device_get_softc(dev); + return (sc->ofw_sc.sc_dmat); } From owner-svn-src-head@freebsd.org Mon Oct 22 14:01:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98DEFFFCF09; Mon, 22 Oct 2018 14:01:35 +0000 (UTC) (envelope-from skozlov@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EFAB7B1E4; Mon, 22 Oct 2018 14:01:35 +0000 (UTC) (envelope-from skozlov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A08B1D49B; Mon, 22 Oct 2018 14:01:35 +0000 (UTC) (envelope-from skozlov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ME1ZTd096829; Mon, 22 Oct 2018 14:01:35 GMT (envelope-from skozlov@FreeBSD.org) Received: (from skozlov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ME1ZHa096828; Mon, 22 Oct 2018 14:01:35 GMT (envelope-from skozlov@FreeBSD.org) Message-Id: <201810221401.w9ME1ZHa096828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skozlov set sender to skozlov@FreeBSD.org using -f From: "Serhii (Sergey) Kozlov" Date: Mon, 22 Oct 2018 14:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339590 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: skozlov X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 339590 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, 22 Oct 2018 14:01:35 -0000 Author: skozlov (ports committer) Date: Mon Oct 22 14:01:34 2018 New Revision: 339590 URL: https://svnweb.freebsd.org/changeset/base/339590 Log: Add myself to mentees with sbruno as mentor Approved by: sbruno (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Oct 22 13:40:50 2018 (r339589) +++ head/share/misc/committers-ports.dot Mon Oct 22 14:01:34 2018 (r339590) @@ -238,6 +238,7 @@ sergei [label="Sergei Kolobov\nsergei@FreeBSD.org\n200 shaun [label="Shaun Amott\nshaun@FreeBSD.org\n2006/06/19"] shurd [label="Stephen Hurd\nshurd@FreeBSD.org\n2014/06/14"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2005/01/08"] +skozlov [label="Sergey Kozlov\nskozlov@FreeBSD.org\n2018/09/21"] skreuzer [label="Steven Kreuzer\nskreuzer@FreeBSD.org\n2009/03/25"] sobomax[label="Maxim Sobolev\nsobomax@FreeBSD.org\n2000/05/17"] sperber[label="Armin Pirkovitsch\nsperber@FreeBSD.org\n2012/04/15"] @@ -652,6 +653,8 @@ sahil -> culot sahil -> eadler sat -> beech + +sbruno -> skozlov sem -> az sem -> anray From owner-svn-src-head@freebsd.org Mon Oct 22 14:44:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3A49FFEB08; Mon, 22 Oct 2018 14:44:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54BC87D41A; Mon, 22 Oct 2018 14:44:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F8AE1DB6C; Mon, 22 Oct 2018 14:44:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MEijWh018171; Mon, 22 Oct 2018 14:44:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MEiiaQ018169; Mon, 22 Oct 2018 14:44:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810221444.w9MEiiaQ018169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 22 Oct 2018 14:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339591 - head/sys/dev/ichwd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ichwd X-SVN-Commit-Revision: 339591 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, 22 Oct 2018 14:44:46 -0000 Author: avg Date: Mon Oct 22 14:44:44 2018 New Revision: 339591 URL: https://svnweb.freebsd.org/changeset/base/339591 Log: ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620) The change is based on public documents listed below as well as Linux changes and the code developed by Kostik. The documents: - Intel® C620 Series Chipset Platform Controller Hub Datasheet - Intel® 100 Series and Intel® C230 Series Chipset Family Platform Controller Hub (PCH) Datasheet - Volume 2 of 2 Interesting Linux commits: - https://github.com/torvalds/linux/commit/9424693035a57961a8eb09e96aab315a7096535d - https://github.com/torvalds/linux/commit/2a7a0e9bf7b32e838d873226808ab8a6c00148f7 The peculiarity of the new chipsets is that the watchdog resources are configured in PCI registers of SMBus controller and Power Management function as opposed to the LPC bridge. I took a simplistic approach of querying the resources from the respective PCI devices. ichwd is still a device on isa bus. The PCI devices are found by their slot and function defined in the datasheets as siblings of the upstream LPC bridge. There are some shortcuts and missing features. First of all, I have not implemented the functionality required to clear the no-reboot bit. That would require writing to a special PCI configuration register of a hidden / invisible PCI device after which the device would start responding to accesses to other registers. The no-reboot bit was not set on my test hardware, so I decided to leave its handling for the later time. Also, I did not try to handle the case where the watchdog resources are not configured by the hardware as well as the case where ACPI defined operational region conflicts with the watchdog resources. My test system did not have either of those problem, so, again, I decided to leave those cases until later. See this Linux commit for some details of the ACPI problem: https://github.com/torvalds/linux/commit/a7ae81952cdab56a1277bd2f9ed7284c0f575120 Finally, I have added only the PCI ID found on my test system. I think that more IDs can be added as the change gets tested. Tested on Dell PowerEdge R740. PR: 222079 Reviewed by: mav, kib MFC after: 3 weeks Relnotes: maybe Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D17585 Modified: head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Mon Oct 22 14:01:34 2018 (r339590) +++ head/sys/dev/ichwd/ichwd.c Mon Oct 22 14:44:44 2018 (r339591) @@ -289,6 +289,11 @@ static struct ichwd_device ichwd_devices[] = { { 0, NULL, 0, 0 }, }; +static struct ichwd_device ichwd_smb_devices[] = { + { DEVICEID_LEWISBURG_SMB, "Lewisburg watchdog timer", 10, 4 }, + { 0, NULL, 0, 0 }, +}; + static devclass_t ichwd_devclass; #define ichwd_read_tco_1(sc, off) \ @@ -374,7 +379,8 @@ ichwd_sts_reset(struct ichwd_softc *sc) * be done in two separate operations. */ ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); - ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); + if (sc->tco_version < 4) + ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); } /* @@ -488,6 +494,11 @@ ichwd_clear_noreboot(struct ichwd_softc *sc) if (status & ICH_PMC_NO_REBOOT) rc = EIO; break; + case 4: + /* + * TODO. This needs access to a hidden PCI device at 31:1. + */ + break; default: ichwd_verbose_printf(sc->device, "Unknown TCO Version: %d, can't set NO_REBOOT.\n", @@ -560,6 +571,36 @@ ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_d return (NULL); } +static device_t +ichwd_find_smb_dev(device_t isa, struct ichwd_device **id_p) +{ + struct ichwd_device *id; + device_t isab, smb; + uint16_t devid; + + /* + * Check if SMBus controller provides TCO configuration. + * The controller's device and function are fixed and we expect + * it to be on the same bus as ISA bridge. + */ + isab = device_get_parent(isa); + smb = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 4); + if (smb == NULL) + return (NULL); + if (pci_get_vendor(smb) != VENDORID_INTEL) + return (NULL); + devid = pci_get_device(smb); + for (id = ichwd_smb_devices; id->desc != NULL; ++id) { + if (devid == id->device) { + if (id_p != NULL) + *id_p = id; + return (smb); + } + } + + return (NULL); +} + /* * Look for an ICH LPC interface bridge. If one is found, register an * ichwd device. There can be only one. @@ -568,14 +609,18 @@ static void ichwd_identify(driver_t *driver, device_t parent) { struct ichwd_device *id_p; - device_t ich = NULL; + device_t ich, smb; device_t dev; uint32_t base_address; + uint32_t ctl; int rc; ich = ichwd_find_ich_lpc_bridge(parent, &id_p); - if (ich == NULL) - return; + if (ich == NULL) { + smb = ichwd_find_smb_dev(parent, &id_p); + if (smb == NULL) + return; + } /* good, add child to bus */ if ((dev = device_find_child(parent, driver->name, 0)) == NULL) @@ -609,6 +654,24 @@ ichwd_identify(driver_t *driver, device_t parent) "Can not set TCO v%d memory resource for PBASE\n", id_p->tco_version); break; + case 4: + /* Get TCO base address. */ + ctl = pci_read_config(smb, ICH_TCOCTL, 4); + if ((ctl & ICH_TCOCTL_TCO_BASE_EN) == 0) { + ichwd_verbose_printf(dev, + "TCO v%d decoding is not enabled\n", + id_p->tco_version); + break; + } + base_address = pci_read_config(smb, ICH_TCOBASE, 4); + rc = bus_set_resource(dev, SYS_RES_IOPORT, 0, + base_address & ICH_TCOBASE_ADDRMASK, ICH_TCOBASE_SIZE); + if (rc != 0) { + ichwd_verbose_printf(dev, + "Can not set TCO v%d I/O resource (err = %d)\n", + id_p->tco_version, rc); + } + break; default: ichwd_verbose_printf(dev, "Can not set unknown TCO v%d memory resource for unknown base address\n", @@ -626,7 +689,8 @@ ichwd_probe(device_t dev) if (isa_get_logicalid(dev) != 0) return (ENXIO); - if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL) + if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL && + ichwd_find_smb_dev(device_get_parent(dev), &id_p) == NULL) return (ENXIO); device_set_desc_copy(dev, id_p->desc); @@ -634,21 +698,71 @@ ichwd_probe(device_t dev) } static int -ichwd_attach(device_t dev) +ichwd_smb_attach(device_t dev) { struct ichwd_softc *sc; struct ichwd_device *id_p; + device_t isab, pmdev; + device_t smb; + uint32_t acpi_base; + + sc = device_get_softc(dev); + smb = ichwd_find_smb_dev(device_get_parent(dev), &id_p); + if (smb == NULL) + return (ENXIO); + + sc->ich_version = id_p->ich_version; + sc->tco_version = id_p->tco_version; + + /* Allocate TCO control I/O register space. */ + sc->tco_rid = 0; + sc->tco_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->tco_rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->tco_res == NULL) { + device_printf(dev, "unable to reserve TCO registers\n"); + return (ENXIO); + } + + /* Get ACPI base address. */ + isab = device_get_parent(device_get_parent(dev)); + pmdev = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 2); + if (pmdev == NULL) { + device_printf(dev, "unable to find Power Management device\n"); + return (ENXIO); + } + acpi_base = pci_read_config(pmdev, ICH_PMBASE, 4) & 0xffffff00; + if (acpi_base == 0) { + device_printf(dev, "ACPI base address is not set\n"); + return (ENXIO); + } + + /* Allocate SMI control I/O register space. */ + sc->smi_rid = 1; + sc->smi_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->smi_rid, + acpi_base + SMI_BASE, acpi_base + SMI_BASE + SMI_LEN - 1, SMI_LEN, + RF_ACTIVE | RF_SHAREABLE); + if (sc->smi_res == NULL) { + device_printf(dev, "unable to reserve SMI registers\n"); + return (ENXIO); + } + + return (0); +} + +static int +ichwd_lpc_attach(device_t dev) +{ + struct ichwd_softc *sc; + struct ichwd_device *id_p; device_t ich; unsigned int pmbase = 0; sc = device_get_softc(dev); - sc->device = dev; ich = ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p); - if (ich == NULL) { - device_printf(sc->device, "Can not find ICH device.\n"); - goto fail; - } + if (ich == NULL) + return (ENXIO); + sc->ich = ich; sc->ich_version = id_p->ich_version; sc->tco_version = id_p->tco_version; @@ -657,7 +771,7 @@ ichwd_attach(device_t dev) pmbase = pci_read_config(ich, ICH_PMBASE, 2) & ICH_PMBASE_MASK; if (pmbase == 0) { device_printf(dev, "ICH PMBASE register is empty\n"); - goto fail; + return (ENXIO); } /* allocate I/O register space */ @@ -667,7 +781,7 @@ ichwd_attach(device_t dev) RF_ACTIVE | RF_SHAREABLE); if (sc->smi_res == NULL) { device_printf(dev, "unable to reserve SMI registers\n"); - goto fail; + return (ENXIO); } sc->tco_rid = 1; @@ -676,7 +790,7 @@ ichwd_attach(device_t dev) RF_ACTIVE | RF_SHAREABLE); if (sc->tco_res == NULL) { device_printf(dev, "unable to reserve TCO registers\n"); - goto fail; + return (ENXIO); } sc->gcs_rid = 0; @@ -685,10 +799,24 @@ ichwd_attach(device_t dev) &sc->gcs_rid, RF_ACTIVE|RF_SHAREABLE); if (sc->gcs_res == NULL) { device_printf(dev, "unable to reserve GCS registers\n"); - goto fail; + return (ENXIO); } } + return (0); +} + +static int +ichwd_attach(device_t dev) +{ + struct ichwd_softc *sc; + + sc = device_get_softc(dev); + sc->device = dev; + + if (ichwd_lpc_attach(dev) != 0 && ichwd_smb_attach(dev) != 0) + goto fail; + if (ichwd_clear_noreboot(sc) != 0) goto fail; @@ -724,7 +852,7 @@ ichwd_attach(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, sc->smi_rid, sc->smi_res); if (sc->gcs_res != NULL) - bus_release_resource(ich, SYS_RES_MEMORY, + bus_release_resource(sc->ich, SYS_RES_MEMORY, sc->gcs_rid, sc->gcs_res); return (ENXIO); Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Mon Oct 22 14:01:34 2018 (r339590) +++ head/sys/dev/ichwd/ichwd.h Mon Oct 22 14:44:44 2018 (r339591) @@ -272,6 +272,7 @@ struct ichwd_softc { #define DEVICEID_WCPT_LP6 0x9cc6 #define DEVICEID_WCPT_LP7 0x9cc7 #define DEVICEID_WCPT_LP9 0x9cc9 +#define DEVICEID_LEWISBURG_SMB 0xa1a3 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 @@ -290,6 +291,14 @@ struct ichwd_softc { #define ICH_PMC_OFFSET 0x08 #define ICH_PMC_SIZE 0x4 #define ICH_PMC_NO_REBOOT 0x10 + +/* Lewisburg configration registers in SMBus controller. */ +#define ICH_TCOBASE 0x50 /* TCO Base Addr */ +#define ICH_TCOBASE_ADDRMASK 0xffe0 +#define ICH_TCOBASE_SIZE 32 +#define ICH_TCOCTL 0x54 /* TCO Control */ +#define ICH_TCOCTL_TCO_BASE_EN 0x0100 /* TCO Base decoding enabled */ +#define ICH_TCOCTL_TCO_BASE_LOCK 0x0001 /* TCOBASE is locked */ /* register names and locations (relative to PMBASE) */ #define SMI_BASE 0x30 /* base address for SMI registers */ From owner-svn-src-head@freebsd.org Mon Oct 22 14:59:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF7AFFF2B7; Mon, 22 Oct 2018 14:59:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C68FB7DCDC; Mon, 22 Oct 2018 14:58:59 +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 C11871DD0D; Mon, 22 Oct 2018 14:58:59 +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 w9MEwxXE023326; Mon, 22 Oct 2018 14:58:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MEwxLI023324; Mon, 22 Oct 2018 14:58:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810221458.w9MEwxLI023324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Oct 2018 14:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339592 - 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: 339592 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, 22 Oct 2018 14:59:00 -0000 Author: andrew Date: Mon Oct 22 14:58:59 2018 New Revision: 339592 URL: https://svnweb.freebsd.org/changeset/base/339592 Log: Correctly set the DAIF bits in new threads We should only unmask interrupts when creating a new thread and leave the other exceptions in teh same state as before creating the thread. Reported by: jhibbits Reviewed by: jhibbits MFC after: 1 month Sponsored by: https://reviews.freebsd.org/D17497 Modified: head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Mon Oct 22 14:44:44 2018 (r339591) +++ head/sys/arm64/arm64/vm_machdep.c Mon Oct 22 14:58:59 2018 (r339592) @@ -111,7 +111,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; - td2->td_md.md_saved_daif = 0; + td2->td_md.md_saved_daif = td1->td_md.md_saved_daif & ~DAIF_I_MASKED; } void @@ -182,7 +182,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0) /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; - td->td_md.md_saved_daif = 0; + td->td_md.md_saved_daif = td0->td_md.md_saved_daif & ~DAIF_I_MASKED; } /* Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Mon Oct 22 14:44:44 2018 (r339591) +++ head/sys/arm64/include/armreg.h Mon Oct 22 14:58:59 2018 (r339592) @@ -66,6 +66,12 @@ #define CTR_ILINE_MASK (0xf << CTR_ILINE_SHIFT) #define CTR_ILINE_SIZE(reg) (((reg) & CTR_ILINE_MASK) >> CTR_ILINE_SHIFT) +/* DAIF - Interrupt Mask Bits */ +#define DAIF_D_MASKED (1 << 9) +#define DAIF_A_MASKED (1 << 8) +#define DAIF_I_MASKED (1 << 7) +#define DAIF_F_MASKED (1 << 6) + /* DCZID_EL0 - Data Cache Zero ID register */ #define DCZID_DZP (1 << 4) /* DC ZVA prohibited if non-0 */ #define DCZID_BS_SHIFT 0 From owner-svn-src-head@freebsd.org Mon Oct 22 15:06:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB4AFFF5A6; Mon, 22 Oct 2018 15:06:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD6507E173; Mon, 22 Oct 2018 15:06:14 +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 9F1D11DEA0; Mon, 22 Oct 2018 15:06:14 +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 w9MF6Ex8028789; Mon, 22 Oct 2018 15:06:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MF6ESV028788; Mon, 22 Oct 2018 15:06:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810221506.w9MF6ESV028788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Oct 2018 15:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339593 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 339593 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, 22 Oct 2018 15:06:15 -0000 Author: andrew Date: Mon Oct 22 15:06:14 2018 New Revision: 339593 URL: https://svnweb.freebsd.org/changeset/base/339593 Log: Fix the ID_AA64ISAR0_EL1 dot product field shift. It's 44 in the documentation, use this correct value. MFC after: 3 days Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Mon Oct 22 14:58:59 2018 (r339592) +++ head/sys/arm64/include/armreg.h Mon Oct 22 15:06:14 2018 (r339593) @@ -260,7 +260,7 @@ #define ID_AA64ISAR0_SM4(x) ((x) & ID_AA64ISAR0_SM4_MASK) #define ID_AA64ISAR0_SM4_NONE (0x0ul << ID_AA64ISAR0_SM4_SHIFT) #define ID_AA64ISAR0_SM4_IMPL (0x1ul << ID_AA64ISAR0_SM4_SHIFT) -#define ID_AA64ISAR0_DP_SHIFT 48 +#define ID_AA64ISAR0_DP_SHIFT 44 #define ID_AA64ISAR0_DP_MASK (0xful << ID_AA64ISAR0_DP_SHIFT) #define ID_AA64ISAR0_DP(x) ((x) & ID_AA64ISAR0_DP_MASK) #define ID_AA64ISAR0_DP_NONE (0x0ul << ID_AA64ISAR0_DP_SHIFT) From owner-svn-src-head@freebsd.org Mon Oct 22 15:18:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD16AFFFA32; Mon, 22 Oct 2018 15:18:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24ACA7E843; Mon, 22 Oct 2018 15:18:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FA571E04D; Mon, 22 Oct 2018 15:18:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MFIo8b033767; Mon, 22 Oct 2018 15:18:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MFIou4033766; Mon, 22 Oct 2018 15:18:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810221518.w9MFIou4033766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Oct 2018 15:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339594 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 339594 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, 22 Oct 2018 15:18:50 -0000 Author: andrew Date: Mon Oct 22 15:18:49 2018 New Revision: 339594 URL: https://svnweb.freebsd.org/changeset/base/339594 Log: Stop advertising ARMv8.3 Pointer Authentication This needs firmware and kernel support before userspace can use it. Until then don't advertise it's available. MFC after: 3 days Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Mon Oct 22 15:06:14 2018 (r339593) +++ head/sys/arm64/arm64/identcpu.c Mon Oct 22 15:18:49 2018 (r339594) @@ -201,13 +201,13 @@ static struct mrs_field id_aa64isar0_fields[] = { }; static struct mrs_field id_aa64isar1_fields[] = { - MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_GPI_SHIFT), - MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_GPA_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_GPI_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_GPA_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_LRCPC_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_FCMA_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_JSCVT_SHIFT), - MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_API_SHIFT), - MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_APA_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_API_SHIFT), + MRS_FIELD(false, MRS_EXACT, ID_AA64ISAR1_APA_SHIFT), MRS_FIELD(false, MRS_LOWER, ID_AA64ISAR1_DPB_SHIFT), MRS_FIELD_END, }; From owner-svn-src-head@freebsd.org Mon Oct 22 15:24:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7704AFFFE02; Mon, 22 Oct 2018 15:24:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 F20537F30F; Mon, 22 Oct 2018 15:24:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MFOAAF010564; Mon, 22 Oct 2018 08:24:10 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MFOA3i010563; Mon, 22 Oct 2018 08:24:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221524.w9MFOA3i010563@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339543 - head/sys/conf In-Reply-To: <201810211629.w9LGTWWD027836@repo.freebsd.org> To: Warner Losh Date: Mon, 22 Oct 2018 08:24:10 -0700 (PDT) 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-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, 22 Oct 2018 15:24:19 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Sun Oct 21 16:29:32 2018 > New Revision: 339543 > URL: https://svnweb.freebsd.org/changeset/base/339543 > > Log: > Remove stray fatm reference. With Modified: > head/sys/conf/WITHOUT_SOURCELESS_UCODE > > Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE > ============================================================================== > --- head/sys/conf/WITHOUT_SOURCELESS_UCODE Sun Oct 21 16:29:12 2018 (r339542) > +++ head/sys/conf/WITHOUT_SOURCELESS_UCODE Sun Oct 21 16:29:32 2018 (r339543) > @@ -6,7 +6,6 @@ > > nodevice adw > nodevice bce > -nodevice fatm > nodevice fxp > nodevice ispfw > nodevice mwlfw > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 15:24:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E71DFFFE65; Mon, 22 Oct 2018 15:24:46 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 122F57F452; Mon, 22 Oct 2018 15:24:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MFOiTw010578; Mon, 22 Oct 2018 08:24:44 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MFOicW010577; Mon, 22 Oct 2018 08:24:44 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221524.w9MFOicW010577@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339546 - head/sys/kern In-Reply-To: <201810211649.w9LGno8G039280@repo.freebsd.org> To: Warner Losh Date: Mon, 22 Oct 2018 08:24:44 -0700 (PDT) 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-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, 22 Oct 2018 15:24:46 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Sun Oct 21 16:49:49 2018 > New Revision: 339546 > URL: https://svnweb.freebsd.org/changeset/base/339546 > > Log: > Remove stray refernce to pdq. Like the infamous twenty first of Johan > Sebastian Bach's twenty children, it hasn't been seen in many years. With Modified: > head/sys/kern/Make.tags.inc > > Modified: head/sys/kern/Make.tags.inc > ============================================================================== > --- head/sys/kern/Make.tags.inc Sun Oct 21 16:44:57 2018 (r339545) > +++ head/sys/kern/Make.tags.inc Sun Oct 21 16:49:49 2018 (r339546) > @@ -19,7 +19,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ > ${SYS}/dev/en/*.[ch] \ > ${SYS}/dev/iicbus/*.[ch] \ > ${SYS}/dev/isp/*.[ch] \ > - ${SYS}/dev/pdq/*.[ch] \ > ${SYS}/dev/ppbus/*.[ch] \ > ${SYS}/dev/smbus/*.[ch] \ > ${SYS}/dev/vx/*.[ch] \ > @@ -78,7 +77,6 @@ COMMDIR2= ${SYS}/dev/advansys \ > ${SYS}/dev/iicbus \ > ${SYS}/dev/isp \ > ${SYS}/dev/md \ > - ${SYS}/dev/pdq \ > ${SYS}/dev/ppbus \ > ${SYS}/dev/smbus \ > ${SYS}/dev/vx \ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 15:33:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13CF71008720; Mon, 22 Oct 2018 15:33:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE7A17FDDB; Mon, 22 Oct 2018 15:33:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8FB71E376; Mon, 22 Oct 2018 15:33:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MFX5xV043599; Mon, 22 Oct 2018 15:33:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MFX5E9043598; Mon, 22 Oct 2018 15:33:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810221533.w9MFX5E9043598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 22 Oct 2018 15:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339595 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 339595 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, 22 Oct 2018 15:33:06 -0000 Author: avg Date: Mon Oct 22 15:33:05 2018 New Revision: 339595 URL: https://svnweb.freebsd.org/changeset/base/339595 Log: nfsrvd_readdirplus: for some errors, do not fail the entire request Instead, a failing entry is skipped. This change consist of two logical changes. A failure to vget or lookup an entry is considered to be a result of a concurrent removal, which is the only reasonable explanation given that the filesystem is busied. So, the entry would be silently skipped. In the case of a failure to get attributes of an entry for an NFSv3 request, the entry would be silently skipped. There can be legitimate reasons for the failure, but NFSv3 does not provide any means to report the error, so we have two options: either fail the whole request or ignore the failed entry. Traditionally, the old NFS server used the latter option, so the code is reverted to it. Making the whole directory unreadable because of a single entry seems to be unpractical. Additionally, some bits of code are slightly re-arranged to account for the new control flow and to honor style(9). Reviewed by: rmacklem Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D15424 Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Oct 22 15:18:49 2018 (r339594) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Oct 22 15:33:05 2018 (r339595) @@ -2416,10 +2416,22 @@ again: } } } - if (!r) { - if (refp == NULL && - ((nd->nd_flag & ND_NFSV3) || - NFSNONZERO_ATTRBIT(&attrbits))) { + + /* + * If we failed to look up the entry, then it + * has become invalid, most likely removed. + */ + if (r != 0) { + if (needs_unbusy) + vfs_unbusy(new_mp); + goto invalid; + } + KASSERT(refp != NULL || nvp != NULL, + ("%s: undetected lookup error", __func__)); + + if (refp == NULL && + ((nd->nd_flag & ND_NFSV3) || + NFSNONZERO_ATTRBIT(&attrbits))) { r = nfsvno_getfh(nvp, &nfh, p); if (!r) r = nfsvno_getattr(nvp, nvap, nd, p, @@ -2440,17 +2452,25 @@ again: if (new_mp == mp) new_mp = nvp->v_mount; } - } - } else { - nvp = NULL; } - if (r) { + + /* + * If we failed to get attributes of the entry, + * then just skip it for NFSv3 (the traditional + * behavior in the old NFS server). + * For NFSv4 the behavior is controlled by + * RDATTRERROR: we either ignore the error or + * fail the request. + * Note that RDATTRERROR is never set for NFSv3. + */ + if (r != 0) { if (!NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_RDATTRERROR)) { - if (nvp != NULL) - vput(nvp); + vput(nvp); if (needs_unbusy != 0) vfs_unbusy(new_mp); + if ((nd->nd_flag & ND_NFSV3)) + goto invalid; nd->nd_repstat = r; break; } @@ -2519,6 +2539,7 @@ again: if (dirlen <= cnt) entrycnt++; } +invalid: cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; From owner-svn-src-head@freebsd.org Mon Oct 22 15:40:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 446511008A06; Mon, 22 Oct 2018 15:40:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 B6C1F801C0; Mon, 22 Oct 2018 15:40:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MFe3SU010700; Mon, 22 Oct 2018 08:40:03 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MFe35Q010699; Mon, 22 Oct 2018 08:40:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221540.w9MFe35Q010699@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339561 - head/sys/crypto/chacha20 In-Reply-To: <201810220127.w9M1RBOD008163@repo.freebsd.org> To: Conrad Meyer Date: Mon, 22 Oct 2018 08:40:03 -0700 (PDT) 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-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, 22 Oct 2018 15:40:06 -0000 > Author: cem > Date: Mon Oct 22 01:27:11 2018 > New Revision: 339561 > URL: https://svnweb.freebsd.org/changeset/base/339561 > > Log: > Add explicit copyright text to trivial header > > Reported by: rgrimes Thank you. > Modified: > head/sys/crypto/chacha20/_chacha.h > > Modified: head/sys/crypto/chacha20/_chacha.h > ============================================================================== > --- head/sys/crypto/chacha20/_chacha.h Mon Oct 22 00:27:37 2018 (r339560) > +++ head/sys/crypto/chacha20/_chacha.h Mon Oct 22 01:27:11 2018 (r339561) > @@ -1,4 +1,7 @@ > /* $FreeBSD$ */ > +/* > + * Public domain. > + */ > > #ifndef _CHACHA_H > #define _CHACHA_H > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 15:45:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 459B31008E96; Mon, 22 Oct 2018 15:45:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 CF53D80781; Mon, 22 Oct 2018 15:45:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MFjPAC010750; Mon, 22 Oct 2018 08:45:25 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MFjPDg010749; Mon, 22 Oct 2018 08:45:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221545.w9MFjPDg010749@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv In-Reply-To: <201810220235.w9M2ZQ6w043947@repo.freebsd.org> To: Warner Losh Date: Mon, 22 Oct 2018 08:45:25 -0700 (PDT) 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-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, 22 Oct 2018 15:45:27 -0000 > Author: imp > Date: Mon Oct 22 02:35:26 2018 > New Revision: 339570 > URL: https://svnweb.freebsd.org/changeset/base/339570 > > Log: > Remove ncv(4) driver > > ncv(4) is marked as gone in 12. Remove it. There are no sightings of > it in the nycbug dmesg database. It was for an obscure SCSI card that > sold mostly in Japan, and was especially popilar among pc98 hackers in > the 4.x time frame.. > > Relnote: Yes I would of liked to delay these until post 12.0 release production incase there are any release cycle fixes that need to be MFC'ed to fix the 12.0 release, but done is done and we shall just have to deal with that by direct commit or other means. > Deleted: > head/share/man/man4/ncv.4 > head/sys/dev/ncv/ncr53c500.c > head/sys/dev/ncv/ncr53c500_pccard.c > head/sys/dev/ncv/ncr53c500hw.h > head/sys/dev/ncv/ncr53c500hwtab.h > head/sys/dev/ncv/ncr53c500reg.h > head/sys/dev/ncv/ncr53c500var.h > head/sys/modules/ncv/Makefile > Modified: > head/share/man/man4/Makefile > head/sys/amd64/conf/NOTES > head/sys/conf/files > head/sys/i386/conf/NOTES > head/sys/modules/Makefile > > Modified: head/share/man/man4/Makefile > ============================================================================== > --- head/share/man/man4/Makefile Mon Oct 22 02:35:12 2018 (r339569) > +++ head/share/man/man4/Makefile Mon Oct 22 02:35:26 2018 (r339570) > @@ -305,7 +305,6 @@ MAN= aac.4 \ > nand.4 \ > nandsim.4 \ > ncr.4 \ > - ncv.4 \ > ${_ndis.4} \ > net80211.4 \ > netdump.4 \ > > Modified: head/sys/amd64/conf/NOTES > ============================================================================== > --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) > +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) > @@ -428,11 +428,9 @@ device twa # 3ware 9000 series PATA/SATA RAID > # > # SCSI host adapters: > # > -# ncv: NCR 53C500 based SCSI host adapters. > # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. > # stg: TMC 18C30, 18C50 based SCSI host adapters. > > -device ncv > device nsp > device stg > > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Mon Oct 22 02:35:12 2018 (r339569) > +++ head/sys/conf/files Mon Oct 22 02:35:26 2018 (r339570) > @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.c optional ctl > cam/mmc/mmc_xpt.c optional scbus mmccam > cam/mmc/mmc_da.c optional scbus mmccam da > cam/scsi/scsi_da.c optional da > -cam/scsi/scsi_low.c optional ncv | nsp | stg > +cam/scsi/scsi_low.c optional nsp | stg > cam/scsi/scsi_pass.c optional pass > cam/scsi/scsi_pt.c optional pt > cam/scsi/scsi_sa.c optional sa > @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c optional nandsim nand > dev/nand/nandsim_swap.c optional nandsim nand > dev/nand/nfc_if.m optional nand > dev/ncr/ncr.c optional ncr pci > -dev/ncv/ncr53c500.c optional ncv > -dev/ncv/ncr53c500_pccard.c optional ncv pccard > dev/netmap/if_ptnet.c optional netmap inet > dev/netmap/netmap.c optional netmap > dev/netmap/netmap_freebsd.c optional netmap > > Modified: head/sys/i386/conf/NOTES > ============================================================================== > --- head/sys/i386/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) > +++ head/sys/i386/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) > @@ -659,11 +659,9 @@ device twa # 3ware 9000 series PATA/SATA RAID > # > # SCSI host adapters: > # > -# ncv: NCR 53C500 based SCSI host adapters. > # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. > # stg: TMC 18C30, 18C50 based SCSI host adapters. > > -device ncv > device nsp > device stg > hint.stg.0.at="isa" > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Mon Oct 22 02:35:12 2018 (r339569) > +++ head/sys/modules/Makefile Mon Oct 22 02:35:26 2018 (r339570) > @@ -268,7 +268,6 @@ SUBDIR= \ > ${_nandsim} \ > ${_ncr} \ > ${_nctgpio} \ > - ${_ncv} \ > ${_ndis} \ > ${_netgraph} \ > ${_nfe} \ > @@ -757,7 +756,6 @@ _glxiic= glxiic > _glxsb= glxsb > #_ibcs2= ibcs2 > _ncr= ncr > -_ncv= ncv > _nsp= nsp > _pcfclock= pcfclock > _pst= pst > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 15:48:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 043691008FCE; Mon, 22 Oct 2018 15:48:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD11480938; Mon, 22 Oct 2018 15:48:07 +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 A67231E51E; Mon, 22 Oct 2018 15:48:07 +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 w9MFm7ZT049320; Mon, 22 Oct 2018 15:48:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MFm7P9049319; Mon, 22 Oct 2018 15:48:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810221548.w9MFm7P9049319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 22 Oct 2018 15:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339596 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339596 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, 22 Oct 2018 15:48:08 -0000 Author: glebius Date: Mon Oct 22 15:48:07 2018 New Revision: 339596 URL: https://svnweb.freebsd.org/changeset/base/339596 Log: If we lost race or were migrated during bucket allocation for the per-CPU cache, then we put new bucket on generic bucket cache. However, code didn't honor UMA_ZONE_NOBUCKETCACHE flag, so potentially we could start a cache on a zone that clearly forbids that. Fix this. Reviewed by: markj Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Oct 22 15:33:05 2018 (r339595) +++ head/sys/vm/uma_core.c Mon Oct 22 15:48:07 2018 (r339596) @@ -2410,6 +2410,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags * the current cache; when we re-acquire the critical section, we * must detect and handle migration if it has occurred. */ +zalloc_restart: critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; @@ -2551,12 +2552,18 @@ zalloc_start: * initialized bucket to make this less likely or claim * the memory directly. */ - if (cache->uc_allocbucket != NULL || - (zone->uz_flags & UMA_ZONE_NUMA && - domain != PCPU_GET(domain))) - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); - else + if (cache->uc_allocbucket == NULL && + ((zone->uz_flags & UMA_ZONE_NUMA) == 0 || + domain == PCPU_GET(domain))) { cache->uc_allocbucket = bucket; + } else if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { + critical_exit(); + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + goto zalloc_restart; + } else + LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); ZONE_UNLOCK(zone); goto zalloc_start; } From owner-svn-src-head@freebsd.org Mon Oct 22 15:49:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26B0510360C7 for ; Mon, 22 Oct 2018 15:49:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAA4B80B34 for ; Mon, 22 Oct 2018 15:49:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x930.google.com with SMTP id b3so10129571uak.3 for ; Mon, 22 Oct 2018 08:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BaEeae0v8zpaJ9zhaqYsFJBSATwxVvUBmB5izL/q0K4=; b=HRiNrR29XB//53bgFhZgZ0bYC0JmkdTzEY+IefkcZvqbgdpmg1JfVQqlQ2AK6ObeYT 3lOuJouAkh9No7xOb3R80pEoMyG6WIsrN00V0SzMUWhaJPndcjAoylZds+e3KZ1e/gRp 1N07iaScCp0yNRQ6jEgT3i5EZgoq0wY9UdAx7UyX7jIjBmDMGiw+K7qz6upLNyQ97KIR euQAKDQmWs2l84I8k2kbGU6/2yHluIfCwUolOccJD1cesS3Myf8n1Nluwc3NDeznUQqr ysWFy4mTA5WyTBWfGF960gQ0+JrMCsRSLm6K4vOO78teSk3m3RWgH4s0ihpqfZFp0U48 Jd3A== 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=BaEeae0v8zpaJ9zhaqYsFJBSATwxVvUBmB5izL/q0K4=; b=DVq+RNRM0tzAns6Dr+s60cQXsdw3vwz2o2CfYKyUdcwSzxcvGy1tw0N2z9HleJdrGT KcwBx5hye31u7S9FqSJfi5FmXO7j8k5Yfm8YeRgCS7FNRCiwDnqgbDdQjqZpfSljq4pG huoJDPVLAIKH997EG6tQ65ZnvnFWjpsjqItp9ZA8m0FciFUXZo0etjCvGxbO9H8EcyWO tz1gWrTthOn0ykhF0kRaTJpZrnFcCtZIxEmtKPX8jZNzBHUPjj6inyjSq6BRx4EL2UVw 5IXiEwHJBFy3r9GskKwsXMzX2+7er53qqKEc/T65NGb2V6NjZ1Ttcw0MhsSNEIL24o44 IsrQ== X-Gm-Message-State: ABuFfog10sLT1U98UiHJLiLxX09EHQRZ96xi5vkf6KSs29T3xL2TNhYc dt9cxhyZfGmG6yKQkaHHA+hLnAK3fmsZWZ4q+kbBiw== X-Google-Smtp-Source: ACcGV63mhHk3g7+EdaFxSZ8z1LZ+8PHG8l5umtGsX/DZikX+u9G245M34j10X+U1I4s6PD2bcR/CPjzS5fzQEKM0fwg= X-Received: by 2002:ab0:14a4:: with SMTP id d33mr19292061uae.41.1540223376866; Mon, 22 Oct 2018 08:49:36 -0700 (PDT) MIME-Version: 1.0 References: <201810220235.w9M2ZQ6w043947@repo.freebsd.org> <201810221545.w9MFjPDg010749@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201810221545.w9MFjPDg010749@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 22 Oct 2018 09:49:24 -0600 Message-ID: Subject: Re: svn commit: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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, 22 Oct 2018 15:49:38 -0000 On Mon, Oct 22, 2018 at 9:45 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: imp > > Date: Mon Oct 22 02:35:26 2018 > > New Revision: 339570 > > URL: https://svnweb.freebsd.org/changeset/base/339570 > > > > Log: > > Remove ncv(4) driver > > > > ncv(4) is marked as gone in 12. Remove it. There are no sightings of > > it in the nycbug dmesg database. It was for an obscure SCSI card that > > sold mostly in Japan, and was especially popilar among pc98 hackers in > > the 4.x time frame.. > > > > Relnote: Yes > > I would of liked to delay these until post 12.0 release production > incase there are any release cycle fixes that need to be MFC'ed to > fix the 12.0 release, but done is done and we shall just have to > deal with that by direct commit or other means. > I did these because they were marked as going away in 12, and this would allow us to MFC them if we wanted before 12.0R. Warner > > Deleted: > > head/share/man/man4/ncv.4 > > head/sys/dev/ncv/ncr53c500.c > > head/sys/dev/ncv/ncr53c500_pccard.c > > head/sys/dev/ncv/ncr53c500hw.h > > head/sys/dev/ncv/ncr53c500hwtab.h > > head/sys/dev/ncv/ncr53c500reg.h > > head/sys/dev/ncv/ncr53c500var.h > > head/sys/modules/ncv/Makefile > > Modified: > > head/share/man/man4/Makefile > > head/sys/amd64/conf/NOTES > > head/sys/conf/files > > head/sys/i386/conf/NOTES > > head/sys/modules/Makefile > > > > Modified: head/share/man/man4/Makefile > > > ============================================================================== > > --- head/share/man/man4/Makefile Mon Oct 22 02:35:12 2018 > (r339569) > > +++ head/share/man/man4/Makefile Mon Oct 22 02:35:26 2018 > (r339570) > > @@ -305,7 +305,6 @@ MAN= aac.4 \ > > nand.4 \ > > nandsim.4 \ > > ncr.4 \ > > - ncv.4 \ > > ${_ndis.4} \ > > net80211.4 \ > > netdump.4 \ > > > > Modified: head/sys/amd64/conf/NOTES > > > ============================================================================== > > --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) > > +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) > > @@ -428,11 +428,9 @@ device twa # 3ware > 9000 series PATA/SATA RAID > > # > > # SCSI host adapters: > > # > > -# ncv: NCR 53C500 based SCSI host adapters. > > # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. > > # stg: TMC 18C30, 18C50 based SCSI host adapters. > > > > -device ncv > > device nsp > > device stg > > > > > > Modified: head/sys/conf/files > > > ============================================================================== > > --- head/sys/conf/files Mon Oct 22 02:35:12 2018 (r339569) > > +++ head/sys/conf/files Mon Oct 22 02:35:26 2018 (r339570) > > @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.c optional ctl > > cam/mmc/mmc_xpt.c optional scbus mmccam > > cam/mmc/mmc_da.c optional scbus mmccam da > > cam/scsi/scsi_da.c optional da > > -cam/scsi/scsi_low.c optional ncv | nsp | stg > > +cam/scsi/scsi_low.c optional nsp | stg > > cam/scsi/scsi_pass.c optional pass > > cam/scsi/scsi_pt.c optional pt > > cam/scsi/scsi_sa.c optional sa > > @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c optional nandsim > nand > > dev/nand/nandsim_swap.c optional nandsim nand > > dev/nand/nfc_if.m optional nand > > dev/ncr/ncr.c optional ncr pci > > -dev/ncv/ncr53c500.c optional ncv > > -dev/ncv/ncr53c500_pccard.c optional ncv pccard > > dev/netmap/if_ptnet.c optional netmap inet > > dev/netmap/netmap.c optional netmap > > dev/netmap/netmap_freebsd.c optional netmap > > > > Modified: head/sys/i386/conf/NOTES > > > ============================================================================== > > --- head/sys/i386/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) > > +++ head/sys/i386/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) > > @@ -659,11 +659,9 @@ device twa # 3ware > 9000 series PATA/SATA RAID > > # > > # SCSI host adapters: > > # > > -# ncv: NCR 53C500 based SCSI host adapters. > > # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. > > # stg: TMC 18C30, 18C50 based SCSI host adapters. > > > > -device ncv > > device nsp > > device stg > > hint.stg.0.at="isa" > > > > Modified: head/sys/modules/Makefile > > > ============================================================================== > > --- head/sys/modules/Makefile Mon Oct 22 02:35:12 2018 (r339569) > > +++ head/sys/modules/Makefile Mon Oct 22 02:35:26 2018 (r339570) > > @@ -268,7 +268,6 @@ SUBDIR= \ > > ${_nandsim} \ > > ${_ncr} \ > > ${_nctgpio} \ > > - ${_ncv} \ > > ${_ndis} \ > > ${_netgraph} \ > > ${_nfe} \ > > @@ -757,7 +756,6 @@ _glxiic= glxiic > > _glxsb= glxsb > > #_ibcs2= ibcs2 > > _ncr= ncr > > -_ncv= ncv > > _nsp= nsp > > _pcfclock= pcfclock > > _pst= pst > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Mon Oct 22 15:52:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75AB51036414; Mon, 22 Oct 2018 15:52:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 E668681010; Mon, 22 Oct 2018 15:52:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MFqPvI010809; Mon, 22 Oct 2018 08:52:25 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MFqPRl010808; Mon, 22 Oct 2018 08:52:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221552.w9MFqPRl010808@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf In-Reply-To: To: Benjamin Kaduk Date: Mon, 22 Oct 2018 08:52:25 -0700 (PDT) CC: Warner Losh , src-committers , 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-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, 22 Oct 2018 15:52:28 -0000 > On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: > > > Author: imp > > Date: Mon Oct 22 02:34:25 2018 > > New Revision: 339565 > > URL: https://svnweb.freebsd.org/changeset/base/339565 > > > > Log: > > Remove aha(4) from the tree. > > > > > The documentation build is now failing, as there's an entity reference to > the autogenerated > hardware list, which does not exist anymore. Will you be able to look at > those as part of your > removals or does someone from the doc team need to handle it? Please stop deprecaton processing until: 1) We have the new documented deprication policy 2) We have crafted a step by step deprication set of procedures so issues like this can be in it. 2) Release 12.0 is shipped. Thanks, Rod Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA2DF10367CF; Mon, 22 Oct 2018 15:58:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 46D26815BB; Mon, 22 Oct 2018 15:58:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MFwkw6010872; Mon, 22 Oct 2018 08:58:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MFwkvM010871; Mon, 22 Oct 2018 08:58:46 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221558.w9MFwkvM010871@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339570 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ncv sys/i386/conf sys/modules sys/modules/ncv In-Reply-To: To: Warner Losh Date: Mon, 22 Oct 2018 08:58:46 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , 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-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, 22 Oct 2018 15:58:51 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Oct 22, 2018 at 9:45 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: imp > > > Date: Mon Oct 22 02:35:26 2018 > > > New Revision: 339570 > > > URL: https://svnweb.freebsd.org/changeset/base/339570 > > > > > > Log: > > > Remove ncv(4) driver > > > > > > ncv(4) is marked as gone in 12. Remove it. There are no sightings of > > > it in the nycbug dmesg database. It was for an obscure SCSI card that > > > sold mostly in Japan, and was especially popilar among pc98 hackers in > > > the 4.x time frame.. > > > > > > Relnote: Yes > > > > I would of liked to delay these until post 12.0 release production > > incase there are any release cycle fixes that need to be MFC'ed to > > fix the 12.0 release, but done is done and we shall just have to > > deal with that by direct commit or other means. > > > > I did these because they were marked as going away in 12, and this would > allow us to MFC them if we wanted before 12.0R. Um, ok I may need to recant some of my wanting the 3 things done before we process any more of this if infact your still wanting to get all of this deprication merged and into 12.0R I see gjb@ has fixed the doc build issue already. > Warner > > > > > Deleted: > > > head/share/man/man4/ncv.4 > > > head/sys/dev/ncv/ncr53c500.c > > > head/sys/dev/ncv/ncr53c500_pccard.c > > > head/sys/dev/ncv/ncr53c500hw.h > > > head/sys/dev/ncv/ncr53c500hwtab.h > > > head/sys/dev/ncv/ncr53c500reg.h > > > head/sys/dev/ncv/ncr53c500var.h > > > head/sys/modules/ncv/Makefile > > > Modified: > > > head/share/man/man4/Makefile > > > head/sys/amd64/conf/NOTES > > > head/sys/conf/files > > > head/sys/i386/conf/NOTES > > > head/sys/modules/Makefile > > > > > > Modified: head/share/man/man4/Makefile > > > > > ============================================================================== > > > --- head/share/man/man4/Makefile Mon Oct 22 02:35:12 2018 > > (r339569) > > > +++ head/share/man/man4/Makefile Mon Oct 22 02:35:26 2018 > > (r339570) > > > @@ -305,7 +305,6 @@ MAN= aac.4 \ > > > nand.4 \ > > > nandsim.4 \ > > > ncr.4 \ > > > - ncv.4 \ > > > ${_ndis.4} \ > > > net80211.4 \ > > > netdump.4 \ > > > > > > Modified: head/sys/amd64/conf/NOTES > > > > > ============================================================================== > > > --- head/sys/amd64/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) > > > +++ head/sys/amd64/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) > > > @@ -428,11 +428,9 @@ device twa # 3ware > > 9000 series PATA/SATA RAID > > > # > > > # SCSI host adapters: > > > # > > > -# ncv: NCR 53C500 based SCSI host adapters. > > > # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. > > > # stg: TMC 18C30, 18C50 based SCSI host adapters. > > > > > > -device ncv > > > device nsp > > > device stg > > > > > > > > > Modified: head/sys/conf/files > > > > > ============================================================================== > > > --- head/sys/conf/files Mon Oct 22 02:35:12 2018 (r339569) > > > +++ head/sys/conf/files Mon Oct 22 02:35:26 2018 (r339570) > > > @@ -113,7 +113,7 @@ cam/ctl/scsi_ctl.c optional ctl > > > cam/mmc/mmc_xpt.c optional scbus mmccam > > > cam/mmc/mmc_da.c optional scbus mmccam da > > > cam/scsi/scsi_da.c optional da > > > -cam/scsi/scsi_low.c optional ncv | nsp | stg > > > +cam/scsi/scsi_low.c optional nsp | stg > > > cam/scsi/scsi_pass.c optional pass > > > cam/scsi/scsi_pt.c optional pt > > > cam/scsi/scsi_sa.c optional sa > > > @@ -2511,8 +2511,6 @@ dev/nand/nandsim_log.c optional nandsim > > nand > > > dev/nand/nandsim_swap.c optional nandsim nand > > > dev/nand/nfc_if.m optional nand > > > dev/ncr/ncr.c optional ncr pci > > > -dev/ncv/ncr53c500.c optional ncv > > > -dev/ncv/ncr53c500_pccard.c optional ncv pccard > > > dev/netmap/if_ptnet.c optional netmap inet > > > dev/netmap/netmap.c optional netmap > > > dev/netmap/netmap_freebsd.c optional netmap > > > > > > Modified: head/sys/i386/conf/NOTES > > > > > ============================================================================== > > > --- head/sys/i386/conf/NOTES Mon Oct 22 02:35:12 2018 (r339569) > > > +++ head/sys/i386/conf/NOTES Mon Oct 22 02:35:26 2018 (r339570) > > > @@ -659,11 +659,9 @@ device twa # 3ware > > 9000 series PATA/SATA RAID > > > # > > > # SCSI host adapters: > > > # > > > -# ncv: NCR 53C500 based SCSI host adapters. > > > # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. > > > # stg: TMC 18C30, 18C50 based SCSI host adapters. > > > > > > -device ncv > > > device nsp > > > device stg > > > hint.stg.0.at="isa" > > > > > > Modified: head/sys/modules/Makefile > > > > > ============================================================================== > > > --- head/sys/modules/Makefile Mon Oct 22 02:35:12 2018 (r339569) > > > +++ head/sys/modules/Makefile Mon Oct 22 02:35:26 2018 (r339570) > > > @@ -268,7 +268,6 @@ SUBDIR= \ > > > ${_nandsim} \ > > > ${_ncr} \ > > > ${_nctgpio} \ > > > - ${_ncv} \ > > > ${_ndis} \ > > > ${_netgraph} \ > > > ${_nfe} \ > > > @@ -757,7 +756,6 @@ _glxiic= glxiic > > > _glxsb= glxsb > > > #_ibcs2= ibcs2 > > > _ncr= ncr > > > -_ncv= ncv > > > _nsp= nsp > > > _pcfclock= pcfclock > > > _pst= pst > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 16:09:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32F71036D8B; Mon, 22 Oct 2018 16:09:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89B4281E7C; Mon, 22 Oct 2018 16:09:01 +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 84C971E863; Mon, 22 Oct 2018 16:09:01 +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 w9MG91Ua059508; Mon, 22 Oct 2018 16:09:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MG91PE059507; Mon, 22 Oct 2018 16:09:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810221609.w9MG91PE059507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Oct 2018 16:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339598 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 339598 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, 22 Oct 2018 16:09:02 -0000 Author: markj Date: Mon Oct 22 16:09:01 2018 New Revision: 339598 URL: https://svnweb.freebsd.org/changeset/base/339598 Log: Fix style bugs in in6_pcblookup_lbgroup(). This should have been a part of r338470. No functional changes intended. Reported by: gallatin Reviewed by: gallatin, Johannes Lundberg MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17109 Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Oct 22 15:54:28 2018 (r339597) +++ head/sys/netinet6/in6_pcb.c Mon Oct 22 16:09:01 2018 (r339598) @@ -873,10 +873,9 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr, uint16_t fport, int lookupflags) { - struct inpcb *local_wild = NULL; + struct inpcb *local_wild; const struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; - struct inpcblbgroup *grp_local_wild; uint32_t idx; INP_HASH_LOCK_ASSERT(pcbinfo); @@ -893,33 +892,24 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, * - Load balanced group does not contain jailed sockets. * - Load balanced does not contain IPv4 mapped INET6 wild sockets. */ + local_wild = NULL; CK_LIST_FOREACH(grp, hdr, il_list) { #ifdef INET if (!(grp->il_vflag & INP_IPV6)) continue; #endif - if (grp->il_lport == lport) { - idx = 0; - int pkt_hash = INP_PCBLBGROUP_PKTHASH( - INP6_PCBHASHKEY(faddr), lport, fport); + if (grp->il_lport != lport) + continue; - idx = pkt_hash % grp->il_inpcnt; - - if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) { - return (grp->il_inp[idx]); - } else { - if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && - (lookupflags & INPLOOKUP_WILDCARD)) { - local_wild = grp->il_inp[idx]; - grp_local_wild = grp; - } - } - } + idx = INP_PCBLBGROUP_PKTHASH(INP6_PCBHASHKEY(faddr), lport, + fport) % grp->il_inpcnt; + if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) + return (grp->il_inp[idx]); + if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && + (lookupflags & INPLOOKUP_WILDCARD) != 0) + local_wild = grp->il_inp[idx]; } - if (local_wild != NULL) { - return (local_wild); - } - return (NULL); + return (local_wild); } #ifdef PCBGROUP From owner-svn-src-head@freebsd.org Mon Oct 22 16:16:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5F03103726E; Mon, 22 Oct 2018 16:16:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A85D82505; Mon, 22 Oct 2018 16:16:43 +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 615E51E9FA; Mon, 22 Oct 2018 16:16:43 +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 w9MGGhJF065010; Mon, 22 Oct 2018 16:16:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MGGgOe065009; Mon, 22 Oct 2018 16:16:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810221616.w9MGGgOe065009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Oct 2018 16:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339599 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 339599 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, 22 Oct 2018 16:16:43 -0000 Author: markj Date: Mon Oct 22 16:16:42 2018 New Revision: 339599 URL: https://svnweb.freebsd.org/changeset/base/339599 Log: Don't import 0 into vmem quantum caches. vmem uses UMA cache zones to implement the quantum cache. Since uma_zalloc() returns 0 (NULL) to signal an allocation failure, UMA should not be used to cache resource 0. Fix this by ensuring that 0 is never cached in UMA in the first place, and by modifying vmem_alloc() to fall back to a search of the free lists if the cache is depleted, rather than blocking in qc_import(). Reported by and discussed with: Brett Gutstein Reviewed by: alc MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17483 Modified: head/sys/kern/subr_vmem.c head/sys/sys/vmem.h Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Mon Oct 22 16:09:01 2018 (r339598) +++ head/sys/kern/subr_vmem.c Mon Oct 22 16:16:42 2018 (r339599) @@ -504,6 +504,9 @@ bt_insfree(vmem_t *vm, bt_t *bt) /* * Import from the arena into the quantum cache in UMA. + * + * We use VMEM_ADDR_QCACHE_MIN instead of 0: uma_zalloc() returns 0 to indicate + * failure, so UMA can't be used to cache a resource with value 0. */ static int qc_import(void *arg, void **store, int cnt, int domain, int flags) @@ -512,19 +515,16 @@ qc_import(void *arg, void **store, int cnt, int domain vmem_addr_t addr; int i; + KASSERT((flags & M_WAITOK) == 0, ("blocking allocation")); + qc = arg; - if ((flags & VMEM_FITMASK) == 0) - flags |= M_BESTFIT; for (i = 0; i < cnt; i++) { if (vmem_xalloc(qc->qc_vmem, qc->qc_size, 0, 0, 0, - VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags, &addr) != 0) + VMEM_ADDR_QCACHE_MIN, VMEM_ADDR_MAX, flags, &addr) != 0) break; store[i] = (void *)addr; - /* Only guarantee one allocation. */ - flags &= ~M_WAITOK; - flags |= M_NOWAIT; } - return i; + return (i); } /* @@ -1123,15 +1123,20 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vm WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_alloc"); if (size <= vm->vm_qcache_max) { + /* + * Resource 0 cannot be cached, so avoid a blocking allocation + * in qc_import() and give the vmem_xalloc() call below a chance + * to return 0. + */ qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; - *addrp = (vmem_addr_t)uma_zalloc(qc->qc_cache, flags); - if (*addrp == 0) - return (ENOMEM); - return (0); + *addrp = (vmem_addr_t)uma_zalloc(qc->qc_cache, + (flags & ~M_WAITOK) | M_NOWAIT); + if (__predict_true(*addrp != 0)) + return (0); } - return vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, - flags, addrp); + return (vmem_xalloc(vm, size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, + flags, addrp)); } int @@ -1263,7 +1268,8 @@ vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t si qcache_t *qc; MPASS(size > 0); - if (size <= vm->vm_qcache_max) { + if (size <= vm->vm_qcache_max && + __predict_true(addr >= VMEM_ADDR_QCACHE_MIN)) { qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; uma_zfree(qc->qc_cache, (void *)addr); } else Modified: head/sys/sys/vmem.h ============================================================================== --- head/sys/sys/vmem.h Mon Oct 22 16:09:01 2018 (r339598) +++ head/sys/sys/vmem.h Mon Oct 22 16:16:42 2018 (r339599) @@ -41,8 +41,9 @@ typedef struct vmem vmem_t; typedef uintptr_t vmem_addr_t; typedef size_t vmem_size_t; -#define VMEM_ADDR_MIN 0 -#define VMEM_ADDR_MAX (~(vmem_addr_t)0) +#define VMEM_ADDR_MIN 0 +#define VMEM_ADDR_QCACHE_MIN 1 +#define VMEM_ADDR_MAX (~(vmem_addr_t)0) typedef int (vmem_import_t)(void *, vmem_size_t, int, vmem_addr_t *); typedef void (vmem_release_t)(void *, vmem_addr_t, vmem_size_t); From owner-svn-src-head@freebsd.org Mon Oct 22 16:21:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 442B2103756E; Mon, 22 Oct 2018 16:21:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E562E828DE; Mon, 22 Oct 2018 16:21:50 +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 E01B91EB56; Mon, 22 Oct 2018 16:21:50 +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 w9MGLomM068938; Mon, 22 Oct 2018 16:21:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MGLoxJ068909; Mon, 22 Oct 2018 16:21:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810221621.w9MGLoxJ068909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Oct 2018 16:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339600 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339600 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, 22 Oct 2018 16:21:51 -0000 Author: hselasky Date: Mon Oct 22 16:21:50 2018 New Revision: 339600 URL: https://svnweb.freebsd.org/changeset/base/339600 Log: Make sure returned value is checked and assert a valid refcount. While at it fix a print: Unsigned types cannot be negative. Reviewed by: kib, mjg Differential revision: https://reviews.freebsd.org/D17616 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/sys/refcount.h Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Mon Oct 22 16:16:42 2018 (r339599) +++ head/sys/sys/refcount.h Mon Oct 22 16:21:50 2018 (r339600) @@ -62,7 +62,7 @@ refcount_release(volatile u_int *count) atomic_thread_fence_rel(); old = atomic_fetchadd_int(count, -1); - KASSERT(old > 0, ("negative refcount %p", count)); + KASSERT(old > 0, ("refcount %p is zero", count)); if (old > 1) return (0); @@ -77,15 +77,19 @@ refcount_release(volatile u_int *count) } /* + * This functions returns non-zero if the refcount was + * incremented. Else zero is returned. + * * A temporary hack until refcount_* APIs are sorted out. */ -static __inline int +static __inline __result_use_check int refcount_acquire_if_not_zero(volatile u_int *count) { u_int old; old = *count; for (;;) { + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); if (old == 0) return (0); if (atomic_fcmpset_int(count, &old, old + 1)) @@ -93,13 +97,14 @@ refcount_acquire_if_not_zero(volatile u_int *count) } } -static __inline int +static __inline __result_use_check int refcount_release_if_not_last(volatile u_int *count) { u_int old; old = *count; for (;;) { + KASSERT(old > 0, ("refcount %p is zero", count)); if (old == 1) return (0); if (atomic_fcmpset_int(count, &old, old - 1)) From owner-svn-src-head@freebsd.org Mon Oct 22 16:45:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29B2B103867E for ; Mon, 22 Oct 2018 16:45:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B26AE84212 for ; Mon, 22 Oct 2018 16:45:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe30.google.com with SMTP id y195so14276142vsc.7 for ; Mon, 22 Oct 2018 09:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xpbW7y8SrXrl2+p1+5pwHavvSd7XMPJf5mvXOWAN7Oc=; b=BrWga0xaGEkYNG50RZT/MoYqJGYfyvMkktloEtrLzdzqQoNpPsua0JrAM1CqzMDWm9 DsEzu3vsRq2mW/1ZLuLZekUHKoOL0qPpnf/DthwxXsZui2nACG4J2N7VGaGUkRjn1pEX Vud8bQk+bxCIv6m+vYxW174O/xD4M04QEBICnKpfv+3qSG+5uwsL58ZJXGpnSV2ZA3+x WqiCnRMojVLvWmFaWXGUAsKLLpoaiioIrViOgJ0njDSgc+5H9aOWk2PhIMvTh9nA+kSD npl5ZcjTfyFrLjKBKyNcfHMGIeDZtbLCjr/bXvR1HELRhU9fqjeEYKbm8FUhLeBEJndo JWfA== 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=xpbW7y8SrXrl2+p1+5pwHavvSd7XMPJf5mvXOWAN7Oc=; b=EgVAtHtSCrWf0faYvljxGexlNRkLL/YosCK79I/HJjU+2QgakEJLED5tQx/it8pl5N xXkr2PgeU23sAfWyLDt4zTNrTlBtUFxMyr7dKTfCVNlPTuZvfyefaD95B2JdNC8WdnsE /83tNwEJbeSxZB2LRbOD2RpCmLVH7J+uZVZ5bFGqFQsm7HmDZApCDa2dJjolM1eNK2Ha tJzHZX4gykiQ7d+CEt2sy08GkvK6okIuRThVJwIQAdGkIaHNwf5H8DtF1iQV4OvOtkEt AWpecKarAhs6Io87MV62Qge02d/wWh2SYilCOK7oeZ8/mUpYgUzCWczcDe40MuEwUm7d qHsA== X-Gm-Message-State: ABuFfoj+/9+cNvta9iUuJT4leWKNW5O/bDuyfmDhRd6rdIt5mmpq9AXW 11dGNGlEY6x1X5m31vuTZe3tQtgX0Xhxqwg0uCA2nw== X-Google-Smtp-Source: ACcGV60mxqzJss7ZvfASnOQkZyTrOBgBU9jTpY7GPflvbdjPQY95Y6dM90mmIyTDPaAW76P+nGRatqUK+YA6YRoBIxI= X-Received: by 2002:a67:4988:: with SMTP id d8mr18998472vsg.41.1540226742838; Mon, 22 Oct 2018 09:45:42 -0700 (PDT) MIME-Version: 1.0 References: <201810221552.w9MFqPRl010808@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201810221552.w9MFqPRl010808@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 22 Oct 2018 10:45:30 -0600 Message-ID: Subject: Re: svn commit: r339565 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/kern sys/modules sys/modules/aha sys/sparc64/conf To: "Rodney W. Grimes" Cc: Benjamin Kaduk , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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, 22 Oct 2018 16:45:44 -0000 On Mon, Oct 22, 2018 at 9:52 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Sun, Oct 21, 2018 at 9:35 PM Warner Losh wrote: > > > > > Author: imp > > > Date: Mon Oct 22 02:34:25 2018 > > > New Revision: 339565 > > > URL: https://svnweb.freebsd.org/changeset/base/339565 > > > > > > Log: > > > Remove aha(4) from the tree. > > > > > > > > The documentation build is now failing, as there's an entity reference to > > the autogenerated > > hardware list, which does not exist anymore. Will you be able to look at > > those as part of your > > removals or does someone from the doc team need to handle it? > > Please stop deprecaton processing until: > 1) We have the new documented deprication policy > 2) We have crafted a step by step deprication set > of procedures so issues like this can be in it. > 2) Release 12.0 is shipped. > These drivers have already been litigated and were previously tagged, pursuant to community discussions, to be removed in 12. This is following the process, such as we have. Committing these changes now means that we could, if we wanted, MFC the changes. They were done carefully so they could all be MFC'd or they could be MFC'd one at a time. ncr(4) was also done w/o discussions today because it was deprecated in 1999, but its removal was overlooked until now. The bottom line is that these were properly removed in a time that was also proper to keep all our options open. I'm not going to stop the other deprecation activities. We're establishing a process that's working well and we'll continue to use it. There were some bumps with the NIC stuff which we've learned from and will incorporate into further rounds (next up: other SCSI drivers with no users, and some long-broken sound cards and PC Card (not CardBus)). While it would be nice to write a generic policy, that's hard to get right w/o experience. So Brooks and I are going to proceed with what we're doing (but plan no further removals until after 12.0 is out) so we can develop that experience. It's been a community discussion process so far, and will continue to be one. Once we have a couple of successful rounds of deprecation, we can look to formalizing the process that's working. There will be no more removals before 12.0R since we're too early in the process for all the others. Warner From owner-svn-src-head@freebsd.org Mon Oct 22 17:04:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E591C10394E9; Mon, 22 Oct 2018 17:04:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD12853EA; Mon, 22 Oct 2018 17:04:05 +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 7C98B1F227; Mon, 22 Oct 2018 17:04:05 +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 w9MH45tu091441; Mon, 22 Oct 2018 17:04:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MH45a7091439; Mon, 22 Oct 2018 17:04:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810221704.w9MH45a7091439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Oct 2018 17:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339601 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339601 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, 22 Oct 2018 17:04:06 -0000 Author: markj Date: Mon Oct 22 17:04:04 2018 New Revision: 339601 URL: https://svnweb.freebsd.org/changeset/base/339601 Log: Swap in processes unless there's a global memory shortage. On NUMA systems, we would not swap in processes unless all domains had some free pages. This is too conservative in general. Instead, permit swapins so long as at least one domain has free pages, and add a kernel stack NUMA policy which ensures that we will try to allocate kernel stack pages from any domain. Reported and tested by: pho, Jan Bramkamp Reviewed by: alc, kib Discussed with: jeff MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17304 Modified: head/sys/vm/vm_glue.c head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Mon Oct 22 16:21:50 2018 (r339600) +++ head/sys/vm/vm_glue.c Mon Oct 22 17:04:04 2018 (r339601) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -298,7 +299,7 @@ vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset struct kstack_cache_entry *kstack_cache; static int kstack_cache_size = 128; -static int kstacks; +static int kstacks, kstack_domain_iter; static struct mtx kstack_cache_mtx; MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); @@ -367,6 +368,17 @@ vm_thread_new(struct thread *td, int pages) printf("vm_thread_new: kstack allocation failed\n"); vm_object_deallocate(ksobj); return (0); + } + + /* + * Ensure that kstack objects can draw pages from any memory + * domain. Otherwise a local memory shortage can block a process + * swap-in. + */ + if (vm_ndomains > 1) { + ksobj->domain.dr_policy = DOMAINSET_RR(); + ksobj->domain.dr_iter = atomic_fetchadd_int(&kstack_domain_iter, + 1); } atomic_add_int(&kstacks, 1); Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Mon Oct 22 16:21:50 2018 (r339600) +++ head/sys/vm/vm_swapout.c Mon Oct 22 17:04:04 2018 (r339601) @@ -742,7 +742,8 @@ swapper_selector(bool wkilled_only) /* * Limit swapper to swap in one non-WKILLED process in MAXSLP/2 * interval, assuming that there is: - * - no memory shortage; + * - there exists at least one domain that is not suffering from a shortage of + * free memory; * - no parallel swap-ins; * - no other swap-ins in the current SWAPIN_INTERVAL. */ @@ -750,7 +751,7 @@ static bool swapper_wkilled_only(void) { - return (vm_page_count_min() || swap_inprogress > 0 || + return (vm_page_count_min_set(&all_domains) || swap_inprogress > 0 || (u_int)(ticks - last_swapin) < SWAPIN_INTERVAL); } From owner-svn-src-head@freebsd.org Mon Oct 22 17:16:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A2DF1039FE5; Mon, 22 Oct 2018 17:16:05 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79F94861CA; Mon, 22 Oct 2018 17:16:04 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.226.217.244]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MQ2Wx-1gImfx0ncR-005Gwl; Mon, 22 Oct 2018 19:15:54 +0200 Received: from thor.intern.walstatt.dynvpn.de ([92.226.217.244]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MQ2Wx-1gImfx0ncR-005Gwl; Mon, 22 Oct 2018 19:15:54 +0200 Date: Mon, 22 Oct 2018 19:15:20 +0200 From: "O. Hartmann" To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339601 - head/sys/vm Message-ID: <20181022191547.2b827e74@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201810221704.w9MH45a7091439@repo.freebsd.org> References: <201810221704.w9MH45a7091439@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:XALTT/Y/epgIbqIHCJWJfi4//JjE/O83IO+FJUwgAin5pvGIwYU 6FRNpoIov6EVJjz3sO0baD3eVO9D/kfXOEN+m6Mz8El5PBjj8oi4cfCJbt0lScmbJnR02aD Nm4Xv8Ai317Fub+mldfAe50L8zTqWFldTRcXy9cuyZwUURrGjmo4AJAQR9nbm7cBuN23eZL 3GMe+E4W49JUgylFqNR1w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:x8vrxnJuu+c=:+ucJ2P5phfnioDCSiJgv8K n8jCf1sA4wwbOdHAoS2UenoHc+WdOO+0IXIm+JcnhFCoP2XUxwTVYYtFOZVXjvG7h8efoBbQq fWJ4/ZCm8rakT9sxf+ynzAmN2SCs4gUt7XshJWFYDOBTUrqikGXvGynI3KdEkSCggYx/4ohWI j+t9yTgnhmdGxhOUhw8MRpcqMDDKBJkYudxoJizKMY+Pr+knNPi21D5bK/PGn4ti+iELPeGR5 9tSv1bV20a3CQgkIn8VYTdjwUKUPjL5XhcCW9LZE2YRptvZzBv75dD9ZEx/c2XWXOoRz88IRl RlPLaxZyAOoeI9n0boAdhDFrYe3tnPxTF1tbFhCclhDLqEL0bylRUe5tyqMPskG0jAKE+jNxB vtsAmXKOjW7ULRDQObRh3HLSf+ZSjk9HmMXkx5cRZ3BkKba+Cn8rn3EcVmJnBwo3mu0K9bLnE XN8c4bwMxp13ffj7ftXGCMOvUQK1Qp/0AC8UnUHFcc0cKGGbqVW2Fj5fqEKfVh0Mhz2wnB5hA l1aZmu2V1ACFKL+pUv0JOVhLSLdLEzhoOMSCtdQAbL7yAbRaPrKJAPKz+HtYgqflFCV2teHcB K3gOg11RZ7+ic826rYNv/oe+6/fsfMvH6TR5aCpgwfQwiqUGAYjLLKhLkMCezfg7p05dnL9Xl EcRMftepYxkPQ8iMVJ4KTLWQayL1EAbVOSG7E7aSifQKNgq6l0eAJXTW84MnuQgMBIltujIax 8Za4acWE0bp2BfLhzrJ3ggS6mrh/vICzep1XW1HGqgw3gsYfKnkZi9bEVrxVdtFsrliw8IdvK RznAybbQ+vmrzFHM5KBRntO/ubz3cVXwF2ZKvJRYQawYaXY5Yo= 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, 22 Oct 2018 17:16:05 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIE1v biwgMjIgT2N0IDIwMTggMTc6MDQ6MDUgKzAwMDAgKFVUQykNCk1hcmsgSm9obnN0b24gPG1hcmtq QEZyZWVCU0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjogbWFya2oNCj4gRGF0ZTogTW9uIE9j dCAyMiAxNzowNDowNCAyMDE4DQo+IE5ldyBSZXZpc2lvbjogMzM5NjAxDQo+IFVSTDogaHR0cHM6 Ly9zdm53ZWIuZnJlZWJzZC5vcmcvY2hhbmdlc2V0L2Jhc2UvMzM5NjAxDQo+IA0KPiBMb2c6DQo+ ICAgU3dhcCBpbiBwcm9jZXNzZXMgdW5sZXNzIHRoZXJlJ3MgYSBnbG9iYWwgbWVtb3J5IHNob3J0 YWdlLg0KPiAgIA0KPiAgIE9uIE5VTUEgc3lzdGVtcywgd2Ugd291bGQgbm90IHN3YXAgaW4gcHJv Y2Vzc2VzIHVubGVzcyBhbGwgZG9tYWlucw0KPiAgIGhhZCBzb21lIGZyZWUgcGFnZXMuICBUaGlz IGlzIHRvbyBjb25zZXJ2YXRpdmUgaW4gZ2VuZXJhbC4gIEluc3RlYWQsDQo+ICAgcGVybWl0IHN3 YXBpbnMgc28gbG9uZyBhcyBhdCBsZWFzdCBvbmUgZG9tYWluIGhhcyBmcmVlIHBhZ2VzLCBhbmQg YWRkDQo+ICAgYSBrZXJuZWwgc3RhY2sgTlVNQSBwb2xpY3kgd2hpY2ggZW5zdXJlcyB0aGF0IHdl IHdpbGwgdHJ5IHRvIGFsbG9jYXRlDQo+ICAga2VybmVsIHN0YWNrIHBhZ2VzIGZyb20gYW55IGRv bWFpbi4NCj4gICANCj4gICBSZXBvcnRlZCBhbmQgdGVzdGVkIGJ5OglwaG8sIEphbiBCcmFta2Ft cCA8Y3Jlc3RAYnVsdG1hbm4uZXU+DQo+ICAgUmV2aWV3ZWQgYnk6CWFsYywga2liDQo+ICAgRGlz Y3Vzc2VkIHdpdGg6CWplZmYNCj4gICBNRkMgYWZ0ZXI6CTMgZGF5cw0KPiAgIFNwb25zb3JlZCBi eToJVGhlIEZyZWVCU0QgRm91bmRhdGlvbg0KPiAgIERpZmZlcmVudGlhbCBSZXZpc2lvbjoJaHR0 cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0QxNzMwNA0KPiANCj4gTW9kaWZpZWQ6DQo+ICAgaGVh ZC9zeXMvdm0vdm1fZ2x1ZS5jDQo+ICAgaGVhZC9zeXMvdm0vdm1fc3dhcG91dC5jDQo+IA0KPiBN b2RpZmllZDogaGVhZC9zeXMvdm0vdm1fZ2x1ZS5jDQo+ID09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0K PiAtLS0gaGVhZC9zeXMvdm0vdm1fZ2x1ZS5jCU1vbiBPY3QgMjIgMTY6MjE6NTAgMjAxOAkocjMz OTYwMCkNCj4gKysrIGhlYWQvc3lzL3ZtL3ZtX2dsdWUuYwlNb24gT2N0IDIyIDE3OjA0OjA0IDIw MTgJKHIzMzk2MDEpDQo+IEBAIC02OCw2ICs2OCw3IEBAIF9fRkJTRElEKCIkRnJlZUJTRCQiKTsN Cj4gIA0KPiAgI2luY2x1ZGUgPHN5cy9wYXJhbS5oPg0KPiAgI2luY2x1ZGUgPHN5cy9zeXN0bS5o Pg0KPiArI2luY2x1ZGUgPHN5cy9kb21haW5zZXQuaD4NCj4gICNpbmNsdWRlIDxzeXMvbGltaXRz Lmg+DQo+ICAjaW5jbHVkZSA8c3lzL2xvY2suaD4NCj4gICNpbmNsdWRlIDxzeXMvbWFsbG9jLmg+ DQo+IEBAIC0yOTgsNyArMjk5LDcgQEAgdm1fc3luY19pY2FjaGUodm1fbWFwX3QgbWFwLCB2bV9v ZmZzZXRfdCB2YSwgdm1fb2Zmc2V0DQo+ICANCj4gIHN0cnVjdCBrc3RhY2tfY2FjaGVfZW50cnkg KmtzdGFja19jYWNoZTsNCj4gIHN0YXRpYyBpbnQga3N0YWNrX2NhY2hlX3NpemUgPSAxMjg7DQo+ IC1zdGF0aWMgaW50IGtzdGFja3M7DQo+ICtzdGF0aWMgaW50IGtzdGFja3MsIGtzdGFja19kb21h aW5faXRlcjsNCj4gIHN0YXRpYyBzdHJ1Y3QgbXR4IGtzdGFja19jYWNoZV9tdHg7DQo+ICBNVFhf U1lTSU5JVChrc3RhY2tfY2FjaGUsICZrc3RhY2tfY2FjaGVfbXR4LCAia3N0a2NoIiwgTVRYX0RF Rik7DQo+ICANCj4gQEAgLTM2Nyw2ICszNjgsMTcgQEAgdm1fdGhyZWFkX25ldyhzdHJ1Y3QgdGhy ZWFkICp0ZCwgaW50IHBhZ2VzKQ0KPiAgCQlwcmludGYoInZtX3RocmVhZF9uZXc6IGtzdGFjayBh bGxvY2F0aW9uIGZhaWxlZFxuIik7DQo+ICAJCXZtX29iamVjdF9kZWFsbG9jYXRlKGtzb2JqKTsN Cj4gIAkJcmV0dXJuICgwKTsNCj4gKwl9DQo+ICsNCj4gKwkvKg0KPiArCSAqIEVuc3VyZSB0aGF0 IGtzdGFjayBvYmplY3RzIGNhbiBkcmF3IHBhZ2VzIGZyb20gYW55IG1lbW9yeQ0KPiArCSAqIGRv bWFpbi4gIE90aGVyd2lzZSBhIGxvY2FsIG1lbW9yeSBzaG9ydGFnZSBjYW4gYmxvY2sgYSBwcm9j ZXNzDQo+ICsJICogc3dhcC1pbi4NCj4gKwkgKi8NCj4gKwlpZiAodm1fbmRvbWFpbnMgPiAxKSB7 DQo+ICsJCWtzb2JqLT5kb21haW4uZHJfcG9saWN5ID0gRE9NQUlOU0VUX1JSKCk7DQo+ICsJCWtz b2JqLT5kb21haW4uZHJfaXRlciA9IGF0b21pY19mZXRjaGFkZF9pbnQoJmtzdGFja19kb21haW5f aXRlciwNCj4gKwkJICAgIDEpOw0KPiAgCX0NCj4gIA0KPiAgCWF0b21pY19hZGRfaW50KCZrc3Rh Y2tzLCAxKTsNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy92bS92bV9zd2Fwb3V0LmMNCj4gPT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy92bS92bV9zd2Fwb3V0LmMJTW9uIE9j dCAyMiAxNjoyMTo1MCAyMDE4CShyMzM5NjAwKQ0KPiArKysgaGVhZC9zeXMvdm0vdm1fc3dhcG91 dC5jCU1vbiBPY3QgMjIgMTc6MDQ6MDQgMjAxOAkocjMzOTYwMSkNCj4gQEAgLTc0Miw3ICs3NDIs OCBAQCBzd2FwcGVyX3NlbGVjdG9yKGJvb2wgd2tpbGxlZF9vbmx5KQ0KPiAgLyoNCj4gICAqIExp bWl0IHN3YXBwZXIgdG8gc3dhcCBpbiBvbmUgbm9uLVdLSUxMRUQgcHJvY2VzcyBpbiBNQVhTTFAv Mg0KPiAgICogaW50ZXJ2YWwsIGFzc3VtaW5nIHRoYXQgdGhlcmUgaXM6DQo+IC0gKiAtIG5vIG1l bW9yeSBzaG9ydGFnZTsNCj4gKyAqIC0gdGhlcmUgZXhpc3RzIGF0IGxlYXN0IG9uZSBkb21haW4g dGhhdCBpcyBub3Qgc3VmZmVyaW5nIGZyb20gYSBzaG9ydGFnZSBvZg0KPiArICogICBmcmVlIG1l bW9yeTsNCj4gICAqIC0gbm8gcGFyYWxsZWwgc3dhcC1pbnM7DQo+ICAgKiAtIG5vIG90aGVyIHN3 YXAtaW5zIGluIHRoZSBjdXJyZW50IFNXQVBJTl9JTlRFUlZBTC4NCj4gICAqLw0KPiBAQCAtNzUw LDcgKzc1MSw3IEBAIHN0YXRpYyBib29sDQo+ICBzd2FwcGVyX3draWxsZWRfb25seSh2b2lkKQ0K PiAgew0KPiAgDQo+IC0JcmV0dXJuICh2bV9wYWdlX2NvdW50X21pbigpIHx8IHN3YXBfaW5wcm9n cmVzcyA+IDAgfHwNCj4gKwlyZXR1cm4gKHZtX3BhZ2VfY291bnRfbWluX3NldCgmYWxsX2RvbWFp bnMpIHx8IHN3YXBfaW5wcm9ncmVzcyA+IDAgfHwNCj4gIAkgICAgKHVfaW50KSh0aWNrcyAtIGxh c3Rfc3dhcGluKSA8IFNXQVBJTl9JTlRFUlZBTCk7DQo+ICB9DQo+ICANCj4gX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVi c2Qub3JnIG1haWxpbmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4v bGlzdGluZm8vc3ZuLXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRv ICJzdm4tc3JjLWhlYWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNClRoaXMgY29tbWl0IGJy ZWFrcyBDVVJSRU5UIGJ1aWxka2VybmVsOg0KWy4uLl0NCi0gLS0tIHZtX2dsdWUubyAtLS0NCi91 c3Ivc3JjL3N5cy92bS92bV9nbHVlLmM6MzgwOjE3OiBlcnJvcjogbm8gbWVtYmVyIG5hbWVkICdk cl9pdGVyJyBpbiAnc3RydWN0DQpkb21haW5zZXRfcmVmJw0KDQoNCktpbmQgcmVnYXJkcywNCg0K b2gNCg0KLSAtLSANCk8uIEhhcnRtYW5uDQoNCkljaCB3aWRlcnNwcmVjaGUgZGVyIE51dHp1bmcg b2RlciDDnGJlcm1pdHRsdW5nIG1laW5lciBEYXRlbiBmw7xyDQpXZXJiZXp3ZWNrZSBvZGVyIGbD vHIgZGllIE1hcmt0LSBvZGVyIE1laW51bmdzZm9yc2NodW5nICjCpyAyOCBBYnMuIDQgQkRTRyku DQotLS0tLUJFR0lOIFBHUCBTSUdOQVRVUkUtLS0tLQ0KDQppTFVFQVJNS0FCMFdJUVFaVlpNekF0 d0MyVC84NlRyUzUyOGZ5RmhZbEFVQ1c4NEZ3d0FLQ1JEUzUyOGZ5RmhZDQpsTVlHQWY5aCt2ZjhB STlKTEdWVWhVd3dibHQ4R2pBdnJxUkFjRHcxUTZORy9JNXhYOG5wWDRPclhtcmx6bXBmDQo4Vlo3 bjlmbm5sWkFEN2UzLzZNdmdrZk5NalBHQWY5NlhURkFpVE1TWFRwUTg0TjVnMkcwM0w1a0FaYU1h UktTDQowbVZpWkpsZ1FualFhb1Y3MDg5TTBodHRid1hoejNvcUdXK0wwWm9aTDVPNVJnOW1ESy9Z DQo9MFBISw0KLS0tLS1FTkQgUEdQIFNJR05BVFVSRS0tLS0tDQo= From owner-svn-src-head@freebsd.org Mon Oct 22 17:17:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48D0E104D115; Mon, 22 Oct 2018 17:17:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3571863E0; Mon, 22 Oct 2018 17:17:30 +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 EE5E31F3D9; Mon, 22 Oct 2018 17:17:30 +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 w9MHHUMC096498; Mon, 22 Oct 2018 17:17:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MHHUaa096497; Mon, 22 Oct 2018 17:17:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810221717.w9MHHUaa096497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Oct 2018 17:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339602 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339602 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, 22 Oct 2018 17:17:31 -0000 Author: markj Date: Mon Oct 22 17:17:30 2018 New Revision: 339602 URL: https://svnweb.freebsd.org/changeset/base/339602 Log: Avoid a redundancy in a comment updated by r339601. Reported by: alc X-MFC with: r339601 Modified: head/sys/vm/vm_swapout.c Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Mon Oct 22 17:04:04 2018 (r339601) +++ head/sys/vm/vm_swapout.c Mon Oct 22 17:17:30 2018 (r339602) @@ -742,8 +742,7 @@ swapper_selector(bool wkilled_only) /* * Limit swapper to swap in one non-WKILLED process in MAXSLP/2 * interval, assuming that there is: - * - there exists at least one domain that is not suffering from a shortage of - * free memory; + * - at least one domain that is not suffering from a shortage of free memory; * - no parallel swap-ins; * - no other swap-ins in the current SWAPIN_INTERVAL. */ From owner-svn-src-head@freebsd.org Mon Oct 22 17:19:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7732B104D2BF; Mon, 22 Oct 2018 17:19:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D72E8665B; Mon, 22 Oct 2018 17:19:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 242191F3DC; Mon, 22 Oct 2018 17:19:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MHJmqg096629; Mon, 22 Oct 2018 17:19:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MHJmTm096628; Mon, 22 Oct 2018 17:19:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810221719.w9MHJmTm096628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Oct 2018 17:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339603 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339603 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, 22 Oct 2018 17:19:49 -0000 Author: markj Date: Mon Oct 22 17:19:48 2018 New Revision: 339603 URL: https://svnweb.freebsd.org/changeset/base/339603 Log: Fix the build after r339601. I committed some patches out of order and didn't build-test one of them. Reported by: Jenkins, O. Hartmann X-MFC with: r339601 Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Mon Oct 22 17:17:30 2018 (r339602) +++ head/sys/vm/vm_glue.c Mon Oct 22 17:19:48 2018 (r339603) @@ -377,8 +377,8 @@ vm_thread_new(struct thread *td, int pages) */ if (vm_ndomains > 1) { ksobj->domain.dr_policy = DOMAINSET_RR(); - ksobj->domain.dr_iter = atomic_fetchadd_int(&kstack_domain_iter, - 1); + ksobj->domain.dr_iterator = + atomic_fetchadd_int(&kstack_domain_iter, 1); } atomic_add_int(&kstacks, 1); From owner-svn-src-head@freebsd.org Mon Oct 22 17:22:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E9F6104D701; Mon, 22 Oct 2018 17:22:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 328B186BBB; Mon, 22 Oct 2018 17:22:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd32.google.com with SMTP id y10-v6so27501299ioa.10; Mon, 22 Oct 2018 10:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=a6gB0Jv62Bio9eZSm+l1ipWob1Ddr56PrEl0Ou2I6zs=; b=Wk890Gktv//+gX48eXDfCFLrp0n6HcGETgg6QrLXtpxkUgGFsKS5n0AIk5ZfnUNWs1 b2p+hH021HLO/MyF71oafLtep54vksCBqkg4fMep19c/yYVLmv0MDHpklf0vkB/sRbBg +jR8YklACCp9Ww/d4QTjwufNZw3EyN8/H+qLWnbNJX23xTst3FkEPeeBrSkQMlq+YHka 6r1fSiOD8jMAc2d7eNAMbzha2JWUiNmNZZOziATqOwhkwjOHz5/gZicCEgKKJi/gLvob aWUN2tpfE3Gw3piml33dYrPZC7qft57vMBIYpEMXlth/1573EAU2usbelhJn1nqqiPru lf/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=a6gB0Jv62Bio9eZSm+l1ipWob1Ddr56PrEl0Ou2I6zs=; b=OOpMYR15TDD6rBkSd35xpZKo73a39B8cZjjpAsC2hftjMnIRutWmcr8MxTJ9XwRtz+ RUxQdIISE0aIaCD5uFSI9C8/acBktcRsPplI9x0SswCwUoYIBYjLEjc32XcaT7O1tin2 v+onz65FoRNKVF1g+PX0EwZTJal0jy5dhKa7B60GaEVnDspZviQap147XzmCBByYdGWc W4w6aoBVYU516Tfju5rgu+2O2hRzcDUEBo6wMp0tB5WuoeSfcIPO8q/GcP/Cz7hi6DvD jrIJ82smQ1m5l8j3tbD+XBwfyqkfoKtin9FYNhh8sXrgvtfPaZVNtgrukpAx5dBJMXxG 4Q1A== X-Gm-Message-State: AGRZ1gLPqtLL8aqes3aWS11eJ68AHocbQHyiQRZbYkMA0NBt03NyI+Sf VTw+++4DOrFnecUfqEhbvc9RWVeE X-Google-Smtp-Source: AJdET5f4FKharzfSgZnPwPC2E90pFLNdkOqnwlJh1AWppjGCIzvkw163MBhtHMV18ylFvBmpTLZB0A== X-Received: by 2002:a6b:17c6:: with SMTP id 189-v6mr8982664iox.226.1540228953454; Mon, 22 Oct 2018 10:22:33 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-199.dsl.bell.ca. [67.71.176.199]) by smtp.gmail.com with ESMTPSA id q25-v6sm10316297ioi.41.2018.10.22.10.22.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 10:22:32 -0700 (PDT) Sender: Mark Johnston Date: Mon, 22 Oct 2018 13:22:30 -0400 From: Mark Johnston To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339601 - head/sys/vm Message-ID: <20181022172230.GC46828@raichu> References: <201810221704.w9MH45a7091439@repo.freebsd.org> <20181022191547.2b827e74@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181022191547.2b827e74@thor.intern.walstatt.dynvpn.de> User-Agent: Mutt/1.10.1 (2018-07-13) 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, 22 Oct 2018 17:22:34 -0000 On Mon, Oct 22, 2018 at 07:15:20PM +0200, O. Hartmann wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Am Mon, 22 Oct 2018 17:04:05 +0000 (UTC) > Mark Johnston schrieb: > > > Author: markj > > Date: Mon Oct 22 17:04:04 2018 > > New Revision: 339601 > > URL: https://svnweb.freebsd.org/changeset/base/339601 > > > > Log: > > Swap in processes unless there's a global memory shortage. > > > > On NUMA systems, we would not swap in processes unless all domains > > had some free pages. This is too conservative in general. Instead, > > permit swapins so long as at least one domain has free pages, and add > > a kernel stack NUMA policy which ensures that we will try to allocate > > kernel stack pages from any domain. > > > > Reported and tested by: pho, Jan Bramkamp > > Reviewed by: alc, kib > > Discussed with: jeff > > MFC after: 3 days > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D17304 > > > > Modified: > > head/sys/vm/vm_glue.c > > head/sys/vm/vm_swapout.c > > > This commit breaks CURRENT buildkernel: > [...] > - --- vm_glue.o --- > /usr/src/sys/vm/vm_glue.c:380:17: error: no member named 'dr_iter' in 'struct > domainset_ref' Fixed, sorry for the breakage. From owner-svn-src-head@freebsd.org Mon Oct 22 17:42:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5806D104E0A5; Mon, 22 Oct 2018 17:42:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6358835A; Mon, 22 Oct 2018 17:42:58 +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 083DB1F94F; Mon, 22 Oct 2018 17:42:58 +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 w9MHgv3R012008; Mon, 22 Oct 2018 17:42:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MHgveo012007; Mon, 22 Oct 2018 17:42:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810221742.w9MHgveo012007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Oct 2018 17:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339605 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339605 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, 22 Oct 2018 17:42:58 -0000 Author: cem Date: Mon Oct 22 17:42:57 2018 New Revision: 339605 URL: https://svnweb.freebsd.org/changeset/base/339605 Log: Conditionalize kern.tty_info_kstacks feature on STACKS option Fix tinderbox (mips XLPN32) after r339471. Reported by: tinderbox X-MFC-With: r339471 Sponsored by: Dell EMC Isilon Modified: head/sys/kern/tty_info.c Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Mon Oct 22 17:27:36 2018 (r339604) +++ head/sys/kern/tty_info.c Mon Oct 22 17:42:57 2018 (r339605) @@ -236,10 +236,12 @@ sbuf_tty_drain(void *a, const char *d, int len) return (-ENXIO); } +#ifdef STACK static bool tty_info_kstacks = false; SYSCTL_BOOL(_kern, OID_AUTO, tty_info_kstacks, CTLFLAG_RWTUN, &tty_info_kstacks, 0, "Enable printing kernel stack(9) traces on ^T (tty info)"); +#endif /* * Report on state of foreground process group. @@ -248,13 +250,16 @@ void tty_info(struct tty *tp) { struct timeval rtime, utime, stime; +#ifdef STACK struct stack stack; + int sterr; +#endif struct proc *p, *ppick; struct thread *td, *tdpick; const char *stateprefix, *state; struct sbuf sb; long rss; - int load, pctcpu, sterr; + int load, pctcpu; pid_t pid; char comm[MAXCOMLEN + 1]; struct rusage ru; @@ -329,6 +334,7 @@ tty_info(struct tty *tp) else state = "unknown"; 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)) @@ -338,6 +344,7 @@ tty_info(struct tty *tp) sterr = 0; } } +#endif thread_unlock(td); if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) rss = 0; @@ -359,8 +366,10 @@ tty_info(struct tty *tp) (long)stime.tv_sec, stime.tv_usec / 10000, pctcpu / 100, rss); +#ifdef STACK if (tty_info_kstacks && sterr == 0) stack_sbuf_print_flags(&sb, &stack, M_NOWAIT); +#endif out: sbuf_finish(&sb); From owner-svn-src-head@freebsd.org Mon Oct 22 18:29:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9211710531DF; Mon, 22 Oct 2018 18:29:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45121899D5; Mon, 22 Oct 2018 18:29:17 +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 3F66620246; Mon, 22 Oct 2018 18:29:17 +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 w9MITH6x033510; Mon, 22 Oct 2018 18:29:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MITDKv033488; Mon, 22 Oct 2018 18:29:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810221829.w9MITDKv033488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Oct 2018 18:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339606 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/gen_html sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekabl... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/gen_html sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekable_format sys/contrib/zstd... X-SVN-Commit-Revision: 339606 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, 22 Oct 2018 18:29:18 -0000 Author: cem Date: Mon Oct 22 18:29:12 2018 New Revision: 339606 URL: https://svnweb.freebsd.org/changeset/base/339606 Log: Update to Zstandard 1.3.7 Relnotes: yes Sponsored by: Dell EMC Isilon Added: head/sys/contrib/zstd/doc/images/cdict_v136.png (contents, props changed) head/sys/contrib/zstd/doc/images/zstd_cdict_v1_3_5.png (contents, props changed) head/sys/contrib/zstd/lib/common/debug.c (contents, props changed) head/sys/contrib/zstd/lib/common/debug.h (contents, props changed) head/sys/contrib/zstd/lib/compress/hist.c (contents, props changed) head/sys/contrib/zstd/lib/compress/hist.h (contents, props changed) head/sys/contrib/zstd/lib/dictBuilder/cover.h (contents, props changed) head/sys/contrib/zstd/lib/dictBuilder/fastcover.c (contents, props changed) head/sys/contrib/zstd/programs/zstdgrep.1 (contents, props changed) head/sys/contrib/zstd/programs/zstdgrep.1.md head/sys/contrib/zstd/programs/zstdless.1 (contents, props changed) head/sys/contrib/zstd/programs/zstdless.1.md head/sys/contrib/zstd/tests/libzstd_partial_builds.sh (contents, props changed) head/sys/contrib/zstd/tests/rateLimiter.py (contents, props changed) Deleted: head/sys/contrib/zstd/circle.yml head/sys/contrib/zstd/tests/namespaceTest.c Modified: head/lib/libzstd/Makefile head/sys/conf/files head/sys/conf/files.sparc64 head/sys/contrib/zstd/.gitattributes head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/NEWS head/sys/contrib/zstd/README.md head/sys/contrib/zstd/TESTING.md head/sys/contrib/zstd/appveyor.yml head/sys/contrib/zstd/contrib/gen_html/Makefile head/sys/contrib/zstd/contrib/meson/meson.build head/sys/contrib/zstd/contrib/pzstd/Makefile head/sys/contrib/zstd/contrib/pzstd/Options.cpp head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/lib/BUCK head/sys/contrib/zstd/lib/Makefile head/sys/contrib/zstd/lib/README.md head/sys/contrib/zstd/lib/common/bitstream.h head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/cpu.h head/sys/contrib/zstd/lib/common/entropy_common.c head/sys/contrib/zstd/lib/common/fse.h head/sys/contrib/zstd/lib/common/fse_decompress.c head/sys/contrib/zstd/lib/common/huf.h head/sys/contrib/zstd/lib/common/mem.h head/sys/contrib/zstd/lib/common/pool.c head/sys/contrib/zstd/lib/common/pool.h head/sys/contrib/zstd/lib/common/xxhash.c head/sys/contrib/zstd/lib/common/zstd_common.c head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/fse_compress.c head/sys/contrib/zstd/lib/compress/huf_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_double_fast.h head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.h head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_lazy.h head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_ldm.h head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstd_opt.h head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/huf_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/divsufsort.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/dictBuilder/zdict.h head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c head/sys/contrib/zstd/lib/legacy/zstd_v01.c head/sys/contrib/zstd/lib/legacy/zstd_v02.c head/sys/contrib/zstd/lib/legacy/zstd_v03.c head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/README.md head/sys/contrib/zstd/programs/bench.c head/sys/contrib/zstd/programs/bench.h head/sys/contrib/zstd/programs/datagen.c head/sys/contrib/zstd/programs/dibio.c head/sys/contrib/zstd/programs/dibio.h head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/platform.h head/sys/contrib/zstd/programs/util.h head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/tests/.gitignore head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/README.md head/sys/contrib/zstd/tests/decodecorpus.c head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzz/fuzz.h head/sys/contrib/zstd/tests/fuzz/fuzz.py head/sys/contrib/zstd/tests/fuzz/regression_driver.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.c head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/gzip/Makefile head/sys/contrib/zstd/tests/legacy.c head/sys/contrib/zstd/tests/longmatch.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/poolTests.c head/sys/contrib/zstd/tests/roundTripCrash.c head/sys/contrib/zstd/tests/symbols.c head/sys/contrib/zstd/tests/test-zstd-versions.py head/sys/contrib/zstd/tests/zstreamtest.c head/sys/contrib/zstd/zlibWrapper/examples/minigzip.c head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/sys/contrib/zstd/zlibWrapper/gzguts.h head/sys/contrib/zstd/zlibWrapper/gzlib.c head/sys/contrib/zstd/zlibWrapper/gzwrite.c Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Mon Oct 22 17:42:57 2018 (r339605) +++ head/lib/libzstd/Makefile Mon Oct 22 18:29:12 2018 (r339606) @@ -24,7 +24,10 @@ SRCS= entropy_common.c \ zstd_lazy.c \ zstd_ldm.c \ zstd_opt.c \ - zstd_double_fast.c + zstd_double_fast.c \ + debug.c \ + hist.c \ + fastcover.c WARNS= 2 INCS= zstd.h CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/conf/files Mon Oct 22 18:29:12 2018 (r339606) @@ -645,6 +645,7 @@ contrib/zstd/lib/common/error_private.c optional zstd contrib/zstd/lib/common/xxhash.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/hist.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_double_fast.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_fast.c optional zstdio compile-with ${ZSTD_C} Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/conf/files.sparc64 Mon Oct 22 18:29:12 2018 (r339606) @@ -149,3 +149,6 @@ sparc64/sparc64/uio_machdep.c standard sparc64/sparc64/upa.c optional creator sparc64/sparc64/vm_machdep.c standard sparc64/sparc64/zeus.c standard + +# Zstd +contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C} Modified: head/sys/contrib/zstd/.gitattributes ============================================================================== --- head/sys/contrib/zstd/.gitattributes Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/.gitattributes Mon Oct 22 18:29:12 2018 (r339606) @@ -19,6 +19,3 @@ # Windows *.bat text eol=crlf *.cmd text eol=crlf - -# .travis.yml merging -.travis.yml merge=ours Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/Makefile Mon Oct 22 18:29:12 2018 (r339606) @@ -23,20 +23,19 @@ else EXT = endif +## default: Build lib-release and zstd-release .PHONY: default default: lib-release zstd-release .PHONY: all -all: | allmost examples manual contrib +all: allmost examples manual contrib .PHONY: allmost -allmost: allzstd - $(MAKE) -C $(ZWRAPDIR) all +allmost: allzstd zlibwrapper -#skip zwrapper, can't build that on alternate architectures without the proper zlib installed +# skip zwrapper, can't build that on alternate architectures without the proper zlib installed .PHONY: allzstd -allzstd: - $(MAKE) -C $(ZSTDDIR) all +allzstd: lib $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -45,58 +44,62 @@ all32: $(MAKE) -C $(PRGDIR) zstd32 $(MAKE) -C $(TESTDIR) all32 -.PHONY: lib -lib: +.PHONY: lib lib-release libzstd.a +lib lib-release : @$(MAKE) -C $(ZSTDDIR) $@ -.PHONY: lib-release -lib-release: - @$(MAKE) -C $(ZSTDDIR) - -.PHONY: zstd -zstd: +.PHONY: zstd zstd-release +zstd zstd-release: @$(MAKE) -C $(PRGDIR) $@ cp $(PRGDIR)/zstd$(EXT) . -.PHONY: zstd-release -zstd-release: - @$(MAKE) -C $(PRGDIR) - cp $(PRGDIR)/zstd$(EXT) . - .PHONY: zstdmt zstdmt: @$(MAKE) -C $(PRGDIR) $@ cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) .PHONY: zlibwrapper -zlibwrapper: - $(MAKE) -C $(ZWRAPDIR) test +zlibwrapper: lib + $(MAKE) -C $(ZWRAPDIR) all +## test: run long-duration tests .PHONY: test +test: MOREFLAGS += -g -DDEBUGLEVEL=1 -Werror test: - $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS+="-g -DZSTD_DEBUG=1" + MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants $(MAKE) -C $(TESTDIR) $@ +## shortest: same as `make check` .PHONY: shortest shortest: $(MAKE) -C $(TESTDIR) $@ +## check: run basic tests for `zstd` cli .PHONY: check check: shortest +## examples: build all examples in `/examples` directory .PHONY: examples -examples: +examples: lib CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all +## manual: generate API documentation in html format .PHONY: manual manual: $(MAKE) -C contrib/gen_html $@ +## man: generate man page +.PHONY: man +man: + $(MAKE) -C programs $@ + +## contrib: build all supported projects in `/contrib` directory .PHONY: contrib contrib: lib $(MAKE) -C contrib/pzstd all $(MAKE) -C contrib/seekable_format/examples all $(MAKE) -C contrib/adaptive-compression all + $(MAKE) -C contrib/largeNbDicts all .PHONY: cleanTabs cleanTabs: @@ -113,21 +116,39 @@ clean: @$(MAKE) -C contrib/pzstd $@ > $(VOID) @$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) @$(MAKE) -C contrib/adaptive-compression $@ > $(VOID) + @$(MAKE) -C contrib/largeNbDicts $@ > $(VOID) @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* @$(RM) -r lz4 @echo Cleaning completed #------------------------------------------------------------------------------ -# make install is validated only for Linux, OSX, Hurd and some BSD targets +# make install is validated only for Linux, macOS, Hurd and some BSD targets #------------------------------------------------------------------------------ -ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku)) HOST_OS = POSIX -CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release +EGREP = egrep --color=never + +# Print a two column output of targets and their description. To add a target description, put a +# comment in the Makefile with the format "## : ". For example: +# +## list: Print all targets and their descriptions (if provided) .PHONY: list list: - @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + @TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \ + | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \ + | $(EGREP) -v -e '^[^[:alnum:]]' | sort); \ + { \ + printf "Target Name\tDescription\n"; \ + printf "%0.s-" {1..16}; printf "\t"; printf "%0.s-" {1..40}; printf "\n"; \ + for target in $$TARGETS; do \ + line=$$($(EGREP) "^##[[:space:]]+$$target:" $(lastword $(MAKEFILE_LIST))); \ + description=$$(echo $$line | awk '{i=index($$0,":"); print substr($$0,i+1)}' | xargs); \ + printf "$$target\t$$description\n"; \ + done \ + } | column -t -s $$'\t' .PHONY: install clangtest armtest usan asan uasan install: @@ -183,6 +204,7 @@ armfuzz: clean CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest aarch64fuzz: clean + ld -v CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest ppcfuzz: clean @@ -206,7 +228,7 @@ gcc6test: clean clangtest: clean clang -v - $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + $(MAKE) all CXX=clang++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" armtest: clean $(MAKE) -C $(TESTDIR) datagen # use native, faster @@ -295,6 +317,9 @@ gcc6install: apt-add-repo gcc7install: apt-add-repo APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-7 gcc-7-multilib" $(MAKE) apt-install +gcc8install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-8 gcc-8-multilib" $(MAKE) apt-install + gpp6install: apt-add-repo APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install @@ -326,23 +351,23 @@ cmakebuild: c90build: clean $(CC) -v - CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` + CFLAGS="-std=c90 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean $(CC) -v - CFLAGS="-std=gnu90" $(MAKE) allmost + CFLAGS="-std=gnu90 -Werror" $(MAKE) allmost c99build: clean $(CC) -v - CFLAGS="-std=c99" $(MAKE) allmost + CFLAGS="-std=c99 -Werror" $(MAKE) allmost gnu99build: clean $(CC) -v - CFLAGS="-std=gnu99" $(MAKE) allmost + CFLAGS="-std=gnu99 -Werror" $(MAKE) allmost c11build: clean $(CC) -v - CFLAGS="-std=c11" $(MAKE) allmost + CFLAGS="-std=c11 -Werror" $(MAKE) allmost bmix64build: clean $(CC) -v @@ -356,7 +381,10 @@ bmi32build: clean $(CC) -v CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test -staticAnalyze: clean +# static analyzer test uses clang's scan-build +# does not analyze zlibWrapper, due to detected issues in zlib source code +staticAnalyze: SCANBUILD ?= scan-build +staticAnalyze: $(CC) -v - CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all + CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) allzstd examples contrib endif Modified: head/sys/contrib/zstd/NEWS ============================================================================== --- head/sys/contrib/zstd/NEWS Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/NEWS Mon Oct 22 18:29:12 2018 (r339606) @@ -1,3 +1,39 @@ +v1.3.7 +perf: slightly better decompression speed on clang (depending on hardware target) +fix : performance of dictionary compression for small input < 4 KB at levels 9 and 10 +build: no longer build backtrace by default in release mode; restrict further automatic mode +build: control backtrace support through build macro BACKTRACE +misc: added man pages for zstdless and zstdgrep, by @samrussell + +v1.3.6 +perf: much faster dictionary builder, by @jenniferliu +perf: faster dictionary compression on small data when using multiple contexts, by @felixhandte +perf: faster dictionary decompression when using a very large number of dictionaries simultaneously +cli : fix : does no longer overwrite destination when source does not exist (#1082) +cli : new command --adapt, for automatic compression level adaptation +api : fix : block api can be streamed with > 4 GB, reported by @catid +api : reduced ZSTD_DDict size by 2 KB +api : minimum negative compression level is defined, and can be queried using ZSTD_minCLevel(). +build: support Haiku target, by @korli +build: Read Legacy format is limited to v0.5+ by default. Can be changed at compile time with macro ZSTD_LEGACY_SUPPORT. +doc : zstd_compression_format.md updated to match wording in IETF RFC 8478 +misc: tests/paramgrill, a parameter optimizer, by @GeorgeLu97 + +v1.3.5 +perf: much faster dictionary compression, by @felixhandte +perf: small quality improvement for dictionary generation, by @terrelln +perf: slightly improved high compression levels (notably level 19) +mem : automatic memory release for long duration contexts +cli : fix : overlapLog can be manually set +cli : fix : decoding invalid lz4 frames +api : fix : performance degradation for dictionary compression when using advanced API, by @terrelln +api : change : clarify ZSTD_CCtx_reset() vs ZSTD_CCtx_resetParameters(), by @terrelln +build: select custom libzstd scope through control macros, by @GeorgeLu97 +build: OpenBSD patch, by @bket +build: make and make all are compatible with -j +doc : clarify zstd_compression_format.md, updated for IETF RFC process +misc: pzstd compatible with reproducible compilation, by @lamby + v1.3.4 perf: faster speed (especially decoding speed) on recent cpus (haswell+) perf: much better performance associating --long with multi-threading, by @terrelln Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/README.md Mon Oct 22 18:29:12 2018 (r339606) @@ -4,7 +4,7 @@ __Zstandard__, or `zstd` as short version, is a fast l targeting real-time compression scenarios at zlib-level and better compression ratios. It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy). -The project is provided as an open-source BSD-licensed **C** library, +The project is provided as an open-source dual [BSD](LICENSE) and [GPLv2](COPYING) licensed **C** library, and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files. Should your project require another programming language, a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages). @@ -120,6 +120,8 @@ Other available options include: A `cmake` project generator is provided within `build/cmake`. It can generate Makefiles or other build scripts to create `zstd` binary, and `libzstd` dynamic and static libraries. + +By default, `CMAKE_BUILD_TYPE` is set to `Release`. #### Meson Modified: head/sys/contrib/zstd/TESTING.md ============================================================================== --- head/sys/contrib/zstd/TESTING.md Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/TESTING.md Mon Oct 22 18:29:12 2018 (r339606) @@ -41,4 +41,4 @@ They consist of the following tests: - `pzstd` with asan and tsan, as well as in 32-bits mode - Testing `zstd` with legacy mode off - Testing `zbuff` (old streaming API) -- Entire test suite and make install on OS X +- Entire test suite and make install on macOS Modified: head/sys/contrib/zstd/appveyor.yml ============================================================================== --- head/sys/contrib/zstd/appveyor.yml Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/appveyor.yml Mon Oct 22 18:29:12 2018 (r339606) @@ -181,15 +181,15 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allzstd" + SCRIPT: "CPPFLAGS=-DDEBUGLEVEL=2 CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allzstd" + SCRIPT: "CFLAGS=-Werror make -j allzstd" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" + SCRIPT: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd" - COMPILER: "visual" HOST: "visual" Modified: head/sys/contrib/zstd/contrib/gen_html/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/gen_html/Makefile Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/gen_html/Makefile Mon Oct 22 18:29:12 2018 (r339606) @@ -10,7 +10,7 @@ CXXFLAGS ?= -O3 CXXFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment CXXFLAGS += $(MOREFLAGS) -FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) +FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) ZSTDAPI = ../../lib/zstd.h ZSTDMANUAL = ../../doc/zstd_manual.html Modified: head/sys/contrib/zstd/contrib/meson/meson.build ============================================================================== --- head/sys/contrib/zstd/contrib/meson/meson.build Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/meson/meson.build Mon Oct 22 18:29:12 2018 (r339606) @@ -18,6 +18,7 @@ libzstd_srcs = [ join_paths(common_dir, 'error_private.c'), join_paths(common_dir, 'xxhash.c'), join_paths(compress_dir, 'fse_compress.c'), + join_paths(compress_dir, 'hist.c'), join_paths(compress_dir, 'huf_compress.c'), join_paths(compress_dir, 'zstd_compress.c'), join_paths(compress_dir, 'zstd_fast.c'), @@ -130,6 +131,7 @@ test('fuzzer', fuzzer) if target_machine.system() != 'windows' paramgrill = executable('paramgrill', datagen_c, join_paths(tests_dir, 'paramgrill.c'), + join_paths(programs_dir, 'bench.c'), include_directories: test_includes, link_with: libzstd, dependencies: libm) Modified: head/sys/contrib/zstd/contrib/pzstd/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/Makefile Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/pzstd/Makefile Mon Oct 22 18:29:12 2018 (r339606) @@ -42,7 +42,7 @@ PZSTD_LDFLAGS = EXTRA_FLAGS = ALL_CFLAGS = $(EXTRA_FLAGS) $(CPPFLAGS) $(PZSTD_CPPFLAGS) $(CFLAGS) $(PZSTD_CFLAGS) ALL_CXXFLAGS = $(EXTRA_FLAGS) $(CPPFLAGS) $(PZSTD_CPPFLAGS) $(CXXFLAGS) $(PZSTD_CXXFLAGS) -ALL_LDFLAGS = $(EXTRA_FLAGS) $(LDFLAGS) $(PZSTD_LDFLAGS) +ALL_LDFLAGS = $(EXTRA_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(PZSTD_LDFLAGS) # gtest libraries need to go before "-lpthread" because they depend on it. @@ -50,7 +50,7 @@ GTEST_LIB = -L googletest/build/googlemock/gtest LIBS = # Compilation commands -LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -lpthread -o $@ +LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -pthread -o $@ CC_COMMAND = $(CC) $(DEPFLAGS) $(ALL_CFLAGS) -c $< -o $@ CXX_COMMAND = $(CXX) $(DEPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@ Modified: head/sys/contrib/zstd/contrib/pzstd/Options.cpp ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/Options.cpp Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/pzstd/Options.cpp Mon Oct 22 18:29:12 2018 (r339606) @@ -18,17 +18,6 @@ #include #include -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || \ - defined(__CYGWIN__) -#include /* _isatty */ -#define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream)) -#elif defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || (defined(__APPLE__) && defined(__MACH__)) || \ - defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) /* https://sourceforge.net/p/predef/wiki/OperatingSystems/ */ -#include /* isatty */ -#define IS_CONSOLE(stdStream) isatty(fileno(stdStream)) -#else -#define IS_CONSOLE(stdStream) 0 -#endif namespace pzstd { @@ -85,7 +74,7 @@ void usage() { std::fprintf(stderr, "Usage:\n"); std::fprintf(stderr, " pzstd [args] [FILE(s)]\n"); std::fprintf(stderr, "Parallel ZSTD options:\n"); - std::fprintf(stderr, " -p, --processes # : number of threads to use for (de)compression (default:%d)\n", defaultNumThreads()); + std::fprintf(stderr, " -p, --processes # : number of threads to use for (de)compression (default:)\n"); std::fprintf(stderr, "ZSTD options:\n"); std::fprintf(stderr, " -# : # compression level (1-%d, default:%d)\n", kMaxNonUltraCompressionLevel, kDefaultCompressionLevel); Modified: head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp Mon Oct 22 18:29:12 2018 (r339606) @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). */ +#include "platform.h" /* Large Files support, SET_BINARY_MODE */ #include "Pzstd.h" #include "SkippableFrame.h" #include "utils/FileSystem.h" @@ -21,14 +22,6 @@ #include #include -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) -# include /* _O_BINARY */ -# include /* _setmode, _isatty */ -# define SET_BINARY_MODE(file) { if (_setmode(_fileno(file), _O_BINARY) == -1) perror("Cannot set _O_BINARY"); } -#else -# include /* isatty */ -# define SET_BINARY_MODE(file) -#endif namespace pzstd { Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile Mon Oct 22 18:29:12 2018 (r339606) @@ -9,19 +9,25 @@ # This Makefile presumes libzstd is built, using `make` in / or /lib/ -LDFLAGS += ../../../lib/libzstd.a +ZSTDLIB_PATH = ../../../lib +ZSTDLIB_NAME = libzstd.a +ZSTDLIB = $(ZSTDLIB_PATH)/$(ZSTDLIB_NAME) + CPPFLAGS += -I../ -I../../../lib -I../../../lib/common CFLAGS ?= -O3 CFLAGS += -g -SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c +SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c $(ZSTDLIB) .PHONY: default all clean test default: all all: seekable_compression seekable_decompression parallel_processing + +$(ZSTDLIB): + make -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME) seekable_compression : seekable_compression.c $(SEEKABLE_OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c Mon Oct 22 18:29:12 2018 (r339606) @@ -101,7 +101,7 @@ static void compressFile_orDie(const char* fname, cons free(buffOut); } -static const char* createOutFilename_orDie(const char* filename) +static char* createOutFilename_orDie(const char* filename) { size_t const inL = strlen(filename); size_t const outL = inL + 5; @@ -109,7 +109,7 @@ static const char* createOutFilename_orDie(const char* memset(outSpace, 0, outL); strcat(outSpace, filename); strcat(outSpace, ".zst"); - return (const char*)outSpace; + return (char*)outSpace; } int main(int argc, const char** argv) { @@ -124,8 +124,9 @@ int main(int argc, const char** argv) { { const char* const inFileName = argv[1]; unsigned const frameSize = (unsigned)atoi(argv[2]); - const char* const outFileName = createOutFilename_orDie(inFileName); + char* const outFileName = createOutFilename_orDie(inFileName); compressFile_orDie(inFileName, outFileName, 5, frameSize); + free(outFileName); } return 0; Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c Mon Oct 22 18:29:12 2018 (r339606) @@ -84,7 +84,7 @@ static void fseek_orDie(FILE* file, long int offset, i } -static void decompressFile_orDie(const char* fname, unsigned startOffset, unsigned endOffset) +static void decompressFile_orDie(const char* fname, off_t startOffset, off_t endOffset) { FILE* const fin = fopen_orDie(fname, "rb"); FILE* const fout = stdout; @@ -129,8 +129,8 @@ int main(int argc, const char** argv) { const char* const inFilename = argv[1]; - unsigned const startOffset = (unsigned) atoi(argv[2]); - unsigned const endOffset = (unsigned) atoi(argv[3]); + off_t const startOffset = atoll(argv[2]); + off_t const endOffset = atoll(argv[3]); decompressFile_orDie(inFilename, startOffset, endOffset); } Modified: head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h Mon Oct 22 18:29:12 2018 (r339606) @@ -6,8 +6,10 @@ extern "C" { #endif #include +#include "zstd.h" /* ZSTDLIB_API */ -static const unsigned ZSTD_seekTableFooterSize = 9; + +#define ZSTD_seekTableFooterSize 9 #define ZSTD_SEEKABLE_MAGICNUMBER 0x8F92EAB1 Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Mon Oct 22 18:29:12 2018 (r339606) @@ -24,7 +24,7 @@ #endif /* ************************************************************ -* Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW +* Avoid fseek()'s 2GiB barrier with MSVC, macOS, *BSD, MinGW ***************************************************************/ #if defined(_MSC_VER) && _MSC_VER >= 1400 # define LONG_SEEK _fseeki64 @@ -56,6 +56,7 @@ #include /* malloc, free */ #include /* FILE* */ +#include #define XXH_STATIC_LINKING_ONLY #define XXH_NAMESPACE ZSTD_ @@ -88,7 +89,7 @@ static int ZSTD_seekable_read_FILE(void* opaque, void* return 0; } -static int ZSTD_seekable_seek_FILE(void* opaque, S64 offset, int origin) +static int ZSTD_seekable_seek_FILE(void* opaque, long long offset, int origin) { int const ret = LONG_SEEK((FILE*)opaque, offset, origin); if (ret) return ret; @@ -110,9 +111,9 @@ static int ZSTD_seekable_read_buff(void* opaque, void* return 0; } -static int ZSTD_seekable_seek_buff(void* opaque, S64 offset, int origin) +static int ZSTD_seekable_seek_buff(void* opaque, long long offset, int origin) { - buffWrapper_t* buff = (buffWrapper_t*) opaque; + buffWrapper_t* const buff = (buffWrapper_t*) opaque; unsigned long long newOffset; switch (origin) { case SEEK_SET: @@ -124,6 +125,8 @@ static int ZSTD_seekable_seek_buff(void* opaque, S64 o case SEEK_END: newOffset = (unsigned long long)buff->size - offset; break; + default: + assert(0); /* not possible */ } if (newOffset > buff->size) { return -1; @@ -197,7 +200,7 @@ size_t ZSTD_seekable_free(ZSTD_seekable* zs) * Performs a binary search to find the last frame with a decompressed offset * <= pos * @return : the frame's index */ -U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, U64 pos) +U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, unsigned long long pos) { U32 lo = 0; U32 hi = zs->seekTable.tableLen; @@ -222,13 +225,13 @@ U32 ZSTD_seekable_getNumFrames(ZSTD_seekable* const zs return zs->seekTable.tableLen; } -U64 ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) +unsigned long long ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) { if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; return zs->seekTable.entries[frameIndex].cOffset; } -U64 ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) +unsigned long long ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) { if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; return zs->seekTable.entries[frameIndex].dOffset; @@ -294,7 +297,6 @@ static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekabl { /* Allocate an extra entry at the end so that we can do size * computations on the last element without special case */ seekEntry_t* entries = (seekEntry_t*)malloc(sizeof(seekEntry_t) * (numFrames + 1)); - const BYTE* tableBase = zs->inBuff + ZSTD_skippableHeaderSize; U32 idx = 0; U32 pos = 8; @@ -311,8 +313,8 @@ static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekabl /* compute cumulative positions */ for (; idx < numFrames; idx++) { if (pos + sizePerEntry > SEEKABLE_BUFF_SIZE) { - U32 const toRead = MIN(remaining, SEEKABLE_BUFF_SIZE); U32 const offset = SEEKABLE_BUFF_SIZE - pos; + U32 const toRead = MIN(remaining, SEEKABLE_BUFF_SIZE - offset); memmove(zs->inBuff, zs->inBuff + pos, offset); /* move any data we haven't read yet */ CHECK_IO(src.read(src.opaque, zs->inBuff+offset, toRead)); remaining -= toRead; @@ -372,7 +374,7 @@ size_t ZSTD_seekable_initAdvanced(ZSTD_seekable* zs, Z return 0; } -size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t len, U64 offset) +size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t len, unsigned long long offset) { U32 targetFrame = ZSTD_seekable_offsetToFrameIndex(zs, offset); do { Added: head/sys/contrib/zstd/doc/images/cdict_v136.png ============================================================================== Binary file. No diff available. Added: head/sys/contrib/zstd/doc/images/zstd_cdict_v1_3_5.png ============================================================================== Binary file. No diff available. Modified: head/sys/contrib/zstd/doc/zstd_compression_format.md ============================================================================== --- head/sys/contrib/zstd/doc/zstd_compression_format.md Mon Oct 22 17:42:57 2018 (r339605) +++ head/sys/contrib/zstd/doc/zstd_compression_format.md Mon Oct 22 18:29:12 2018 (r339606) @@ -16,7 +16,7 @@ Distribution of this document is unlimited. ### Version -0.2.6 (19/08/17) +0.3.0 (25/09/18) Introduction @@ -27,6 +27,8 @@ that is independent of CPU type, operating system, file system and character set, suitable for file compression, pipe and streaming compression, using the [Zstandard algorithm](http://www.zstandard.org). +The text of the specification assumes a basic background in programming +at the level of bits and other primitive data representations. The data can be produced or consumed, even for an arbitrarily long sequentially presented input data stream, @@ -39,11 +41,6 @@ for detection of data corruption. The data format defined by this specification does not attempt to allow random access to compressed data. -This specification is intended for use by implementers of software -to compress data into Zstandard format and/or decompress data from Zstandard format. -The text of the specification assumes a basic background in programming -at the level of bits and other primitive data representations. - Unless otherwise indicated below, a compliant compressor must produce data sets that conform to the specifications presented here. @@ -57,6 +54,12 @@ Whenever it does not support a parameter defined in th it must produce a non-ambiguous error code and associated error message explaining which parameter is unsupported. +This specification is intended for use by implementers of software +to compress data into Zstandard format and/or decompress data from Zstandard format. +The Zstandard format is supported by an open source reference implementation, +written in portable C, and available at : https://github.com/facebook/zstd . + + ### Overall conventions In this document: - square brackets i.e. `[` and `]` are used to indicate optional fields or parameters. @@ -69,7 +72,7 @@ A frame is completely independent, has a defined begin and a set of parameters which tells the decoder how to decompress it. A frame encapsulates one or multiple __blocks__. -Each block can be compressed or not, +Each block contains arbitrary content, which is described by its header, and has a guaranteed maximum content size, which depends on frame parameters. Unlike frames, each block depends on previous blocks for proper decoding. However, each block can be decompressed without waiting for its successor, @@ -92,14 +95,14 @@ Overview Frames ------ Zstandard compressed data is made of one or more __frames__. -Each frame is independent and can be decompressed indepedently of other frames. +Each frame is independent and can be decompressed independently of other frames. The decompressed content of multiple concatenated frames is the concatenation of each frame decompressed content. There are two frame formats defined by Zstandard: Zstandard frames and Skippable frames. Zstandard frames contain compressed data, while -skippable frames contain no data and can be used for metadata. +skippable frames contain custom user metadata. ## Zstandard frames The structure of a single Zstandard frame is following: @@ -112,6 +115,11 @@ __`Magic_Number`__ 4 Bytes, __little-endian__ format. Value : 0xFD2FB528 +Note: This value was selected to be less probable to find at the beginning of some random file. +It avoids trivial patterns (0x00, 0xFF, repeated bytes, increasing bytes, etc.), +contains byte values outside of ASCII range, +and doesn't map into UTF8 space. +It reduces the chances that a text file represent this value by accident. __`Frame_Header`__ @@ -171,8 +179,8 @@ according to the following table: |`FCS_Field_Size`| 0 or 1 | 2 | 4 | 8 | When `Flag_Value` is `0`, `FCS_Field_Size` depends on `Single_Segment_flag` : -if `Single_Segment_flag` is set, `Field_Size` is 1. -Otherwise, `Field_Size` is 0 : `Frame_Content_Size` is not provided. +if `Single_Segment_flag` is set, `FCS_Field_Size` is 1. +Otherwise, `FCS_Field_Size` is 0 : `Frame_Content_Size` is not provided. __`Single_Segment_flag`__ @@ -196,10 +204,10 @@ depending on local limitations. __`Unused_bit`__ -The value of this bit should be set to zero. -A decoder compliant with this specification version shall not interpret it. -It might be used in a future version, -to signal a property which is not mandatory to properly decode the frame. +A decoder compliant with this specification version shall not interpret this bit. +It might be used in any future version, +to signal a property which is transparent to properly decode the frame. +An encoder compliant with this specification version must set this bit to zero. __`Reserved_bit`__ @@ -218,11 +226,11 @@ __`Dictionary_ID_flag`__ This is a 2-bits flag (`= FHD & 3`), telling if a dictionary ID is provided within the header. -It also specifies the size of this field as `Field_Size`. +It also specifies the size of this field as `DID_Field_Size`. -|`Flag_Value`| 0 | 1 | 2 | 3 | -| ---------- | --- | --- | --- | --- | -|`Field_Size`| 0 | 1 | 2 | 4 | +|`Flag_Value` | 0 | 1 | 2 | 3 | +| -------------- | --- | --- | --- | --- | +|`DID_Field_Size`| 0 | 1 | 2 | 4 | #### `Window_Descriptor` @@ -249,6 +257,9 @@ Window_Size = windowBase + windowAdd; The minimum `Window_Size` is 1 KB. The maximum `Window_Size` is `(1<<41) + 7*(1<<38)` bytes, which is 3.75 TB. +In general, larger `Window_Size` tend to improve compression ratio, +but at the cost of memory usage. + To properly decode compressed data, a decoder will need to allocate a buffer of at least `Window_Size` bytes. @@ -257,8 +268,8 @@ a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range. For improved interoperability, -decoders are recommended to be compatible with `Window_Size <= 8 MB`, -and encoders are recommended to not request more than 8 MB. +it's recommended for decoders to support `Window_Size` of up to 8 MB, +and it's recommended for encoders to not generate frame requiring `Window_Size` larger than 8 MB. It's merely a recommendation though, decoders are free to support larger or lower limits, depending on local limitations. @@ -268,9 +279,10 @@ depending on local limitations. This is a variable size field, which contains the ID of the dictionary required to properly decode the frame. `Dictionary_ID` field is optional. When it's not present, -it's up to the decoder to make sure it uses the correct dictionary. +it's up to the decoder to know which dictionary to use. -Field size depends on `Dictionary_ID_flag`. +`Dictionary_ID` field size is provided by `DID_Field_Size`. +`DID_Field_Size` is directly derived from value of `Dictionary_ID_flag`. 1 byte can represent an ID 0-255. 2 bytes can represent an ID 0-65535. 4 bytes can represent an ID 0-4294967295. @@ -280,13 +292,21 @@ It's allowed to represent a small ID (for example `13` with a large 4-bytes dictionary ID, even if it is less efficient. _Reserved ranges :_ -If the frame is going to be distributed in a private environment, -any dictionary ID can be used. -However, for public distribution of compressed frames using a dictionary, -the following ranges are reserved and shall not be used : +Within private environments, any `Dictionary_ID` can be used. + +However, for frames and dictionaries distributed in public space, +`Dictionary_ID` must be attributed carefully. +Rules for public environment are not yet decided, +but the following ranges are reserved for some future registrar : - low range : `<= 32767` - high range : `>= (1 << 31)` +Outside of these ranges, any value of `Dictionary_ID` +which is both `>= 32768` and `< (1<<31)` can be used freely, +even in public environment. + + + #### `Frame_Content_Size` This is the original (uncompressed) size. This information is optional. @@ -359,22 +379,23 @@ There are 4 block types : - `Reserved` - this is not a block. This value cannot be used with current version of this specification. + If such a value is present, it is considered corrupted data. __`Block_Size`__ The upper 21 bits of `Block_Header` represent the `Block_Size`. +`Block_Size` is the size of the block excluding the header. +A block can contain any number of bytes (even zero), up to +`Block_Maximum_Decompressed_Size`, which is the smallest of: +- Window_Size +- 128 KB -Block sizes must respect a few rules : -- For `Compressed_Block`, `Block_Size` is always strictly less than decompressed size. -- Block decompressed size is always <= `Window_Size` -- Block decompressed size is always <= 128 KB. +A `Compressed_Block` has the extra restriction that `Block_Size` is always +strictly less than the decompressed size. +If this condition cannot be respected, +the block must be sent uncompressed instead (`Raw_Block`). -A block can contain any number of bytes (even empty), -up to `Block_Maximum_Decompressed_Size`, which is the smallest of : -- `Window_Size` -- 128 KB - Compressed Blocks ----------------- To decompress a compressed block, the compressed size must be provided @@ -390,11 +411,17 @@ data in [Sequence Execution](#sequence-execution) #### Prerequisites To decode a compressed block, the following elements are necessary : - Previous decoded data, up to a distance of `Window_Size`, - or all previously decoded data when `Single_Segment_flag` is set. + or beginning of the Frame, whichever is smaller. - List of "recent offsets" from previous `Compressed_Block`. -- Decoding tables of previous `Compressed_Block` for each symbol type - (literals, literals lengths, match lengths, offsets). +- The previous Huffman tree, required by `Treeless_Literals_Block` type +- Previous FSE decoding tables, required by `Repeat_Mode` + for each symbol type (literals lengths, match lengths, offsets) +Note that decoding tables aren't always from the previous `Compressed_Block`. + +- Every decoding table can come from a dictionary. +- The Huffman tree comes from the previous `Compressed_Literals_Block`. + Literals Section ---------------- All literals are regrouped in the first part of the block. @@ -405,11 +432,11 @@ Literals can be stored uncompressed or compressed usin When compressed, an optional tree description can be present, followed by 1 or 4 streams. -| `Literals_Section_Header` | [`Huffman_Tree_Description`] | Stream1 | [Stream2] | [Stream3] | [Stream4] | -| ------------------------- | ---------------------------- | ------- | --------- | --------- | --------- | +| `Literals_Section_Header` | [`Huffman_Tree_Description`] | [jumpTable] | Stream1 | [Stream2] | [Stream3] | [Stream4] | +| ------------------------- | ---------------------------- | ----------- | ------- | --------- | --------- | --------- | -#### `Literals_Section_Header` +### `Literals_Section_Header` Header is in charge of describing how literals are packed. It's a byte-aligned variable-size bitfield, ranging from 1 to 5 bytes, @@ -460,18 +487,21 @@ For values spanning several bytes, convention is __lit __`Size_Format` for `Raw_Literals_Block` and `RLE_Literals_Block`__ : -- Value ?0 : `Size_Format` uses 1 bit. +`Size_Format` uses 1 _or_ 2 bits. +Its value is : `Size_Format = (Literals_Section_Header[0]>>2) & 3` + +- `Size_Format` == 00 or 10 : `Size_Format` uses 1 bit. `Regenerated_Size` uses 5 bits (0-31). - `Literals_Section_Header` has 1 byte. - `Regenerated_Size = Header[0]>>3` -- Value 01 : `Size_Format` uses 2 bits. + `Literals_Section_Header` uses 1 byte. + `Regenerated_Size = Literals_Section_Header[0]>>3` +- `Size_Format` == 01 : `Size_Format` uses 2 bits. `Regenerated_Size` uses 12 bits (0-4095). - `Literals_Section_Header` has 2 bytes. - `Regenerated_Size = (Header[0]>>4) + (Header[1]<<4)` -- Value 11 : `Size_Format` uses 2 bits. + `Literals_Section_Header` uses 2 bytes. + `Regenerated_Size = (Literals_Section_Header[0]>>4) + (Literals_Section_Header[1]<<4)` +- `Size_Format` == 11 : `Size_Format` uses 2 bits. `Regenerated_Size` uses 20 bits (0-1048575). - `Literals_Section_Header` has 3 bytes. - `Regenerated_Size = (Header[0]>>4) + (Header[1]<<4) + (Header[2]<<12)` + `Literals_Section_Header` uses 3 bytes. + `Regenerated_Size = (Literals_Section_Header[0]>>4) + (Literals_Section_Header[1]<<4) + (Literals_Section_Header[2]<<12)` Only Stream1 is present for these cases. Note : it's allowed to represent a short value (for example `13`) @@ -479,66 +509,74 @@ using a long format, even if it's less efficient. __`Size_Format` for `Compressed_Literals_Block` and `Treeless_Literals_Block`__ : -- Value 00 : _A single stream_. +`Size_Format` always uses 2 bits. + +- `Size_Format` == 00 : _A single stream_. Both `Regenerated_Size` and `Compressed_Size` use 10 bits (0-1023). - `Literals_Section_Header` has 3 bytes. -- Value 01 : 4 streams. + `Literals_Section_Header` uses 3 bytes. +- `Size_Format` == 01 : 4 streams. Both `Regenerated_Size` and `Compressed_Size` use 10 bits (0-1023). - `Literals_Section_Header` has 3 bytes. -- Value 10 : 4 streams. + `Literals_Section_Header` uses 3 bytes. +- `Size_Format` == 10 : 4 streams. Both `Regenerated_Size` and `Compressed_Size` use 14 bits (0-16383). - `Literals_Section_Header` has 4 bytes. -- Value 11 : 4 streams. + `Literals_Section_Header` uses 4 bytes. +- `Size_Format` == 11 : 4 streams. Both `Regenerated_Size` and `Compressed_Size` use 18 bits (0-262143). - `Literals_Section_Header` has 5 bytes. + `Literals_Section_Header` uses 5 bytes. Both `Compressed_Size` and `Regenerated_Size` fields follow __little-endian__ convention. Note: `Compressed_Size` __includes__ the size of the Huffman Tree description _when_ it is present. -### Raw Literals Block +#### Raw Literals Block The data in Stream1 is `Regenerated_Size` bytes long, it contains the raw literals data to be used during [Sequence Execution]. -### RLE Literals Block +#### RLE Literals Block Stream1 consists of a single byte which should be repeated `Regenerated_Size` times to generate the decoded literals. -### Compressed Literals Block and Treeless Literals Block +#### Compressed Literals Block and Treeless Literals Block Both of these modes contain Huffman encoded data. -`Treeless_Literals_Block` does not have a `Huffman_Tree_Description`. -#### `Huffman_Tree_Description` +For `Treeless_Literals_Block`, +the Huffman table comes from previously compressed literals block, +or from a dictionary. + + +### `Huffman_Tree_Description` This section is only present when `Literals_Block_Type` type is `Compressed_Literals_Block` (`2`). The format of the Huffman tree description can be found at [Huffman Tree description](#huffman-tree-description). The size of `Huffman_Tree_Description` is determined during decoding process, it must be used to determine where streams begin. `Total_Streams_Size = Compressed_Size - Huffman_Tree_Description_Size`. -For `Treeless_Literals_Block`, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 22 18:40:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95B591053820; Mon, 22 Oct 2018 18:40:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD908A063; Mon, 22 Oct 2018 18:40:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA71203EB; Mon, 22 Oct 2018 18:40:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MIeMt1038727; Mon, 22 Oct 2018 18:40:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MIeM20038726; Mon, 22 Oct 2018 18:40:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810221840.w9MIeM20038726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Oct 2018 18:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339607 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339607 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, 22 Oct 2018 18:40:22 -0000 Author: emaste Date: Mon Oct 22 18:40:21 2018 New Revision: 339607 URL: https://svnweb.freebsd.org/changeset/base/339607 Log: Makefile.inc1: clean up stale dependency hacks Our dependency tracking cannot directly cope with certain source tree changes, particularly with respect to removing or moving source files or replacing generated files. We have a collection of ad-hoc workarounds to handle these cases. As there is a (small) build-time cost inherent in these workarounds, we do not want to keep them indefinitely. Thus, remove workarounds from 2017. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Oct 22 18:29:12 2018 (r339606) +++ head/Makefile.inc1 Mon Oct 22 18:40:21 2018 (r339607) @@ -903,40 +903,18 @@ _sanity_check: .PHONY .MAKE _cleanobj_fast_depend_hack: .PHONY # Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls -# 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs # 20180404 r332048 sigreturn # 20180405 r332080 shmat # 20180406 r332119 setlogin # 20180411 r332443 exect # 20180525 r334224 vadvise # 20180604 r334626 brk sbrk -.for f in brk exect fstat fstatat fstatfs getdirentries getfsstat sbrk setlogin shmat sigreturn statfs vadvise +.for f in brk exect sbrk setlogin shmat sigreturn vadvise @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ egrep -qw '${f}\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ echo "Removing stale dependencies for ${f} syscall wrappers"; \ rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ - fi -.endfor -# 20170607 remove stale dependencies for utimens* wrappers removed in r319663 -.for f in futimens utimensat - @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ - egrep -q '/${f}.c' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo "Removing stale dependencies for ${f} syscall wrappers"; \ - rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ - fi -.endfor -# 20170523 remove stale generated asm files for functions which are no longer -# syscalls after r302092 (pipe) and r318736 (others) -.for f in getdents lstat mknod pipe stat - @if [ -e "${OBJTOP}/lib/libc/${f}.s" ] || \ - [ -e "${OBJTOP}/lib/libc/${f}.S" ] ; then \ - echo "Removing stale generated ${f} syscall files"; \ - rm -f ${OBJTOP}/lib/libc/${f}.* \ - ${OBJTOP}/lib/libc/.depend.${f}.* \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/${f}.*} \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor # 20181013 r339348 bcopy reimplemented as .c From owner-svn-src-head@freebsd.org Mon Oct 22 18:41:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 845EA10539E7; Mon, 22 Oct 2018 18:41:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 355908AA58; Mon, 22 Oct 2018 18:41:23 +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 2CBFF2140D; Mon, 22 Oct 2018 18:41:23 +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 w9MIfN4j041039; Mon, 22 Oct 2018 18:41:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MIfNFk041038; Mon, 22 Oct 2018 18:41:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810221841.w9MIfNFk041038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Oct 2018 18:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339608 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 339608 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, 22 Oct 2018 18:41:23 -0000 Author: emaste Date: Mon Oct 22 18:41:22 2018 New Revision: 339608 URL: https://svnweb.freebsd.org/changeset/base/339608 Log: arch.7: first appeared in FreeBSD 11.1 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Mon Oct 22 18:40:21 2018 (r339607) +++ head/share/man/man7/arch.7 Mon Oct 22 18:41:22 2018 (r339608) @@ -458,4 +458,4 @@ Like An .Nm manual page appeared in -.Fx 12 . +.Fx 11.1 . From owner-svn-src-head@freebsd.org Mon Oct 22 18:55:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7625105611A; Mon, 22 Oct 2018 18:55:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 62AD98CAF7; Mon, 22 Oct 2018 18:55:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MItbud012280; Mon, 22 Oct 2018 11:55:37 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MItbm3012279; Mon, 22 Oct 2018 11:55:37 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221855.w9MItbm3012279@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339608 - head/share/man/man7 In-Reply-To: <201810221841.w9MIfNFk041038@repo.freebsd.org> To: Ed Maste Date: Mon, 22 Oct 2018 11:55:37 -0700 (PDT) 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-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, 22 Oct 2018 18:55:40 -0000 > Author: emaste > Date: Mon Oct 22 18:41:22 2018 > New Revision: 339608 > URL: https://svnweb.freebsd.org/changeset/base/339608 > > Log: > arch.7: first appeared in FreeBSD 11.1 MFC? > Modified: > head/share/man/man7/arch.7 > > Modified: head/share/man/man7/arch.7 > ============================================================================== > --- head/share/man/man7/arch.7 Mon Oct 22 18:40:21 2018 (r339607) > +++ head/share/man/man7/arch.7 Mon Oct 22 18:41:22 2018 (r339608) > @@ -458,4 +458,4 @@ Like > An > .Nm > manual page appeared in > -.Fx 12 . > +.Fx 11.1 . > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 18:56:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFAD10561B8; Mon, 22 Oct 2018 18:56:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 E8E0C8CC73; Mon, 22 Oct 2018 18:56:46 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MIuj8Y012298; Mon, 22 Oct 2018 11:56:45 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MIujYw012297; Mon, 22 Oct 2018 11:56:45 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810221856.w9MIujYw012297@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339606 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/gen_html sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekabl... In-Reply-To: <201810221829.w9MITDKv033488@repo.freebsd.org> To: Conrad Meyer Date: Mon, 22 Oct 2018 11:56:45 -0700 (PDT) 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-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, 22 Oct 2018 18:56:48 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: cem > Date: Mon Oct 22 18:29:12 2018 > New Revision: 339606 > URL: https://svnweb.freebsd.org/changeset/base/339606 > > Log: > Update to Zstandard 1.3.7 > > Relnotes: yes > Sponsored by: Dell EMC Isilon MFC after: 1+month? > Added: > head/sys/contrib/zstd/doc/images/cdict_v136.png (contents, props changed) > head/sys/contrib/zstd/doc/images/zstd_cdict_v1_3_5.png (contents, props changed) > head/sys/contrib/zstd/lib/common/debug.c (contents, props changed) > head/sys/contrib/zstd/lib/common/debug.h (contents, props changed) > head/sys/contrib/zstd/lib/compress/hist.c (contents, props changed) > head/sys/contrib/zstd/lib/compress/hist.h (contents, props changed) > head/sys/contrib/zstd/lib/dictBuilder/cover.h (contents, props changed) > head/sys/contrib/zstd/lib/dictBuilder/fastcover.c (contents, props changed) > head/sys/contrib/zstd/programs/zstdgrep.1 (contents, props changed) > head/sys/contrib/zstd/programs/zstdgrep.1.md > head/sys/contrib/zstd/programs/zstdless.1 (contents, props changed) > head/sys/contrib/zstd/programs/zstdless.1.md > head/sys/contrib/zstd/tests/libzstd_partial_builds.sh (contents, props changed) > head/sys/contrib/zstd/tests/rateLimiter.py (contents, props changed) > Deleted: > head/sys/contrib/zstd/circle.yml > head/sys/contrib/zstd/tests/namespaceTest.c > Modified: > head/lib/libzstd/Makefile > head/sys/conf/files > head/sys/conf/files.sparc64 > head/sys/contrib/zstd/.gitattributes > head/sys/contrib/zstd/Makefile > head/sys/contrib/zstd/NEWS > head/sys/contrib/zstd/README.md > head/sys/contrib/zstd/TESTING.md > head/sys/contrib/zstd/appveyor.yml > head/sys/contrib/zstd/contrib/gen_html/Makefile > head/sys/contrib/zstd/contrib/meson/meson.build > head/sys/contrib/zstd/contrib/pzstd/Makefile > head/sys/contrib/zstd/contrib/pzstd/Options.cpp > head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp > head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile > head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c > head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c > head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h > head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c > head/sys/contrib/zstd/doc/zstd_compression_format.md > head/sys/contrib/zstd/doc/zstd_manual.html > head/sys/contrib/zstd/lib/BUCK > head/sys/contrib/zstd/lib/Makefile > head/sys/contrib/zstd/lib/README.md > head/sys/contrib/zstd/lib/common/bitstream.h > head/sys/contrib/zstd/lib/common/compiler.h > head/sys/contrib/zstd/lib/common/cpu.h > head/sys/contrib/zstd/lib/common/entropy_common.c > head/sys/contrib/zstd/lib/common/fse.h > head/sys/contrib/zstd/lib/common/fse_decompress.c > head/sys/contrib/zstd/lib/common/huf.h > head/sys/contrib/zstd/lib/common/mem.h > head/sys/contrib/zstd/lib/common/pool.c > head/sys/contrib/zstd/lib/common/pool.h > head/sys/contrib/zstd/lib/common/xxhash.c > head/sys/contrib/zstd/lib/common/zstd_common.c > head/sys/contrib/zstd/lib/common/zstd_internal.h > head/sys/contrib/zstd/lib/compress/fse_compress.c > head/sys/contrib/zstd/lib/compress/huf_compress.c > head/sys/contrib/zstd/lib/compress/zstd_compress.c > head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h > head/sys/contrib/zstd/lib/compress/zstd_double_fast.c > head/sys/contrib/zstd/lib/compress/zstd_double_fast.h > head/sys/contrib/zstd/lib/compress/zstd_fast.c > head/sys/contrib/zstd/lib/compress/zstd_fast.h > head/sys/contrib/zstd/lib/compress/zstd_lazy.c > head/sys/contrib/zstd/lib/compress/zstd_lazy.h > head/sys/contrib/zstd/lib/compress/zstd_ldm.c > head/sys/contrib/zstd/lib/compress/zstd_ldm.h > head/sys/contrib/zstd/lib/compress/zstd_opt.c > head/sys/contrib/zstd/lib/compress/zstd_opt.h > head/sys/contrib/zstd/lib/compress/zstdmt_compress.c > head/sys/contrib/zstd/lib/compress/zstdmt_compress.h > head/sys/contrib/zstd/lib/decompress/huf_decompress.c > head/sys/contrib/zstd/lib/decompress/zstd_decompress.c > head/sys/contrib/zstd/lib/dictBuilder/cover.c > head/sys/contrib/zstd/lib/dictBuilder/divsufsort.c > head/sys/contrib/zstd/lib/dictBuilder/zdict.c > head/sys/contrib/zstd/lib/dictBuilder/zdict.h > head/sys/contrib/zstd/lib/freebsd/zstd_kmalloc.c > head/sys/contrib/zstd/lib/legacy/zstd_v01.c > head/sys/contrib/zstd/lib/legacy/zstd_v02.c > head/sys/contrib/zstd/lib/legacy/zstd_v03.c > head/sys/contrib/zstd/lib/legacy/zstd_v04.c > head/sys/contrib/zstd/lib/legacy/zstd_v05.c > head/sys/contrib/zstd/lib/legacy/zstd_v06.c > head/sys/contrib/zstd/lib/legacy/zstd_v07.c > head/sys/contrib/zstd/lib/zstd.h > head/sys/contrib/zstd/programs/Makefile > head/sys/contrib/zstd/programs/README.md > head/sys/contrib/zstd/programs/bench.c > head/sys/contrib/zstd/programs/bench.h > head/sys/contrib/zstd/programs/datagen.c > head/sys/contrib/zstd/programs/dibio.c > head/sys/contrib/zstd/programs/dibio.h > head/sys/contrib/zstd/programs/fileio.c > head/sys/contrib/zstd/programs/fileio.h > head/sys/contrib/zstd/programs/platform.h > head/sys/contrib/zstd/programs/util.h > head/sys/contrib/zstd/programs/zstd.1 > head/sys/contrib/zstd/programs/zstd.1.md > head/sys/contrib/zstd/programs/zstdcli.c > head/sys/contrib/zstd/tests/.gitignore > head/sys/contrib/zstd/tests/Makefile > head/sys/contrib/zstd/tests/README.md > head/sys/contrib/zstd/tests/decodecorpus.c > head/sys/contrib/zstd/tests/fullbench.c > head/sys/contrib/zstd/tests/fuzz/fuzz.h > head/sys/contrib/zstd/tests/fuzz/fuzz.py > head/sys/contrib/zstd/tests/fuzz/regression_driver.c > head/sys/contrib/zstd/tests/fuzz/zstd_helpers.c > head/sys/contrib/zstd/tests/fuzzer.c > head/sys/contrib/zstd/tests/gzip/Makefile > head/sys/contrib/zstd/tests/legacy.c > head/sys/contrib/zstd/tests/longmatch.c > head/sys/contrib/zstd/tests/paramgrill.c > head/sys/contrib/zstd/tests/playTests.sh > head/sys/contrib/zstd/tests/poolTests.c > head/sys/contrib/zstd/tests/roundTripCrash.c > head/sys/contrib/zstd/tests/symbols.c > head/sys/contrib/zstd/tests/test-zstd-versions.py > head/sys/contrib/zstd/tests/zstreamtest.c > head/sys/contrib/zstd/zlibWrapper/examples/minigzip.c > head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c > head/sys/contrib/zstd/zlibWrapper/gzguts.h > head/sys/contrib/zstd/zlibWrapper/gzlib.c > head/sys/contrib/zstd/zlibWrapper/gzwrite.c > > Modified: head/lib/libzstd/Makefile > ============================================================================== > --- head/lib/libzstd/Makefile Mon Oct 22 17:42:57 2018 (r339605) > +++ head/lib/libzstd/Makefile Mon Oct 22 18:29:12 2018 (r339606) > @@ -24,7 +24,10 @@ SRCS= entropy_common.c \ > zstd_lazy.c \ > zstd_ldm.c \ > zstd_opt.c \ > - zstd_double_fast.c > + zstd_double_fast.c \ > + debug.c \ > + hist.c \ > + fastcover.c > WARNS= 2 > INCS= zstd.h > CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/conf/files Mon Oct 22 18:29:12 2018 (r339606) > @@ -645,6 +645,7 @@ contrib/zstd/lib/common/error_private.c optional zstd > contrib/zstd/lib/common/xxhash.c optional zstdio compile-with ${ZSTD_C} > contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} > contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} > +contrib/zstd/lib/compress/hist.c optional zstdio compile-with ${ZSTD_C} > contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} > contrib/zstd/lib/compress/zstd_double_fast.c optional zstdio compile-with ${ZSTD_C} > contrib/zstd/lib/compress/zstd_fast.c optional zstdio compile-with ${ZSTD_C} > > Modified: head/sys/conf/files.sparc64 > ============================================================================== > --- head/sys/conf/files.sparc64 Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/conf/files.sparc64 Mon Oct 22 18:29:12 2018 (r339606) > @@ -149,3 +149,6 @@ sparc64/sparc64/uio_machdep.c standard > sparc64/sparc64/upa.c optional creator > sparc64/sparc64/vm_machdep.c standard > sparc64/sparc64/zeus.c standard > + > +# Zstd > +contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C} > > Modified: head/sys/contrib/zstd/.gitattributes > ============================================================================== > --- head/sys/contrib/zstd/.gitattributes Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/.gitattributes Mon Oct 22 18:29:12 2018 (r339606) > @@ -19,6 +19,3 @@ > # Windows > *.bat text eol=crlf > *.cmd text eol=crlf > - > -# .travis.yml merging > -.travis.yml merge=ours > > Modified: head/sys/contrib/zstd/Makefile > ============================================================================== > --- head/sys/contrib/zstd/Makefile Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/Makefile Mon Oct 22 18:29:12 2018 (r339606) > @@ -23,20 +23,19 @@ else > EXT = > endif > > +## default: Build lib-release and zstd-release > .PHONY: default > default: lib-release zstd-release > > .PHONY: all > -all: | allmost examples manual contrib > +all: allmost examples manual contrib > > .PHONY: allmost > -allmost: allzstd > - $(MAKE) -C $(ZWRAPDIR) all > +allmost: allzstd zlibwrapper > > -#skip zwrapper, can't build that on alternate architectures without the proper zlib installed > +# skip zwrapper, can't build that on alternate architectures without the proper zlib installed > .PHONY: allzstd > -allzstd: > - $(MAKE) -C $(ZSTDDIR) all > +allzstd: lib > $(MAKE) -C $(PRGDIR) all > $(MAKE) -C $(TESTDIR) all > > @@ -45,58 +44,62 @@ all32: > $(MAKE) -C $(PRGDIR) zstd32 > $(MAKE) -C $(TESTDIR) all32 > > -.PHONY: lib > -lib: > +.PHONY: lib lib-release libzstd.a > +lib lib-release : > @$(MAKE) -C $(ZSTDDIR) $@ > > -.PHONY: lib-release > -lib-release: > - @$(MAKE) -C $(ZSTDDIR) > - > -.PHONY: zstd > -zstd: > +.PHONY: zstd zstd-release > +zstd zstd-release: > @$(MAKE) -C $(PRGDIR) $@ > cp $(PRGDIR)/zstd$(EXT) . > > -.PHONY: zstd-release > -zstd-release: > - @$(MAKE) -C $(PRGDIR) > - cp $(PRGDIR)/zstd$(EXT) . > - > .PHONY: zstdmt > zstdmt: > @$(MAKE) -C $(PRGDIR) $@ > cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) > > .PHONY: zlibwrapper > -zlibwrapper: > - $(MAKE) -C $(ZWRAPDIR) test > +zlibwrapper: lib > + $(MAKE) -C $(ZWRAPDIR) all > > +## test: run long-duration tests > .PHONY: test > +test: MOREFLAGS += -g -DDEBUGLEVEL=1 -Werror > test: > - $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS+="-g -DZSTD_DEBUG=1" > + MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants > $(MAKE) -C $(TESTDIR) $@ > > +## shortest: same as `make check` > .PHONY: shortest > shortest: > $(MAKE) -C $(TESTDIR) $@ > > +## check: run basic tests for `zstd` cli > .PHONY: check > check: shortest > > +## examples: build all examples in `/examples` directory > .PHONY: examples > -examples: > +examples: lib > CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all > > +## manual: generate API documentation in html format > .PHONY: manual > manual: > $(MAKE) -C contrib/gen_html $@ > > +## man: generate man page > +.PHONY: man > +man: > + $(MAKE) -C programs $@ > + > +## contrib: build all supported projects in `/contrib` directory > .PHONY: contrib > contrib: lib > $(MAKE) -C contrib/pzstd all > $(MAKE) -C contrib/seekable_format/examples all > $(MAKE) -C contrib/adaptive-compression all > + $(MAKE) -C contrib/largeNbDicts all > > .PHONY: cleanTabs > cleanTabs: > @@ -113,21 +116,39 @@ clean: > @$(MAKE) -C contrib/pzstd $@ > $(VOID) > @$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) > @$(MAKE) -C contrib/adaptive-compression $@ > $(VOID) > + @$(MAKE) -C contrib/largeNbDicts $@ > $(VOID) > @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* > @$(RM) -r lz4 > @echo Cleaning completed > > #------------------------------------------------------------------------------ > -# make install is validated only for Linux, OSX, Hurd and some BSD targets > +# make install is validated only for Linux, macOS, Hurd and some BSD targets > #------------------------------------------------------------------------------ > -ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) > +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku)) > > HOST_OS = POSIX > -CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON > +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release > > +EGREP = egrep --color=never > + > +# Print a two column output of targets and their description. To add a target description, put a > +# comment in the Makefile with the format "## : ". For example: > +# > +## list: Print all targets and their descriptions (if provided) > .PHONY: list > list: > - @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs > + @TARGETS=$$($(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null \ > + | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \ > + | $(EGREP) -v -e '^[^[:alnum:]]' | sort); \ > + { \ > + printf "Target Name\tDescription\n"; \ > + printf "%0.s-" {1..16}; printf "\t"; printf "%0.s-" {1..40}; printf "\n"; \ > + for target in $$TARGETS; do \ > + line=$$($(EGREP) "^##[[:space:]]+$$target:" $(lastword $(MAKEFILE_LIST))); \ > + description=$$(echo $$line | awk '{i=index($$0,":"); print substr($$0,i+1)}' | xargs); \ > + printf "$$target\t$$description\n"; \ > + done \ > + } | column -t -s $$'\t' > > .PHONY: install clangtest armtest usan asan uasan > install: > @@ -183,6 +204,7 @@ armfuzz: clean > CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest > > aarch64fuzz: clean > + ld -v > CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest > > ppcfuzz: clean > @@ -206,7 +228,7 @@ gcc6test: clean > > clangtest: clean > clang -v > - $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" > + $(MAKE) all CXX=clang++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" > > armtest: clean > $(MAKE) -C $(TESTDIR) datagen # use native, faster > @@ -295,6 +317,9 @@ gcc6install: apt-add-repo > gcc7install: apt-add-repo > APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-7 gcc-7-multilib" $(MAKE) apt-install > > +gcc8install: apt-add-repo > + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-8 gcc-8-multilib" $(MAKE) apt-install > + > gpp6install: apt-add-repo > APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install > > @@ -326,23 +351,23 @@ cmakebuild: > > c90build: clean > $(CC) -v > - CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` > + CFLAGS="-std=c90 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` > > gnu90build: clean > $(CC) -v > - CFLAGS="-std=gnu90" $(MAKE) allmost > + CFLAGS="-std=gnu90 -Werror" $(MAKE) allmost > > c99build: clean > $(CC) -v > - CFLAGS="-std=c99" $(MAKE) allmost > + CFLAGS="-std=c99 -Werror" $(MAKE) allmost > > gnu99build: clean > $(CC) -v > - CFLAGS="-std=gnu99" $(MAKE) allmost > + CFLAGS="-std=gnu99 -Werror" $(MAKE) allmost > > c11build: clean > $(CC) -v > - CFLAGS="-std=c11" $(MAKE) allmost > + CFLAGS="-std=c11 -Werror" $(MAKE) allmost > > bmix64build: clean > $(CC) -v > @@ -356,7 +381,10 @@ bmi32build: clean > $(CC) -v > CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test > > -staticAnalyze: clean > +# static analyzer test uses clang's scan-build > +# does not analyze zlibWrapper, due to detected issues in zlib source code > +staticAnalyze: SCANBUILD ?= scan-build > +staticAnalyze: > $(CC) -v > - CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all > + CC=$(CC) CPPFLAGS=-g $(SCANBUILD) --status-bugs -v $(MAKE) allzstd examples contrib > endif > > Modified: head/sys/contrib/zstd/NEWS > ============================================================================== > --- head/sys/contrib/zstd/NEWS Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/NEWS Mon Oct 22 18:29:12 2018 (r339606) > @@ -1,3 +1,39 @@ > +v1.3.7 > +perf: slightly better decompression speed on clang (depending on hardware target) > +fix : performance of dictionary compression for small input < 4 KB at levels 9 and 10 > +build: no longer build backtrace by default in release mode; restrict further automatic mode > +build: control backtrace support through build macro BACKTRACE > +misc: added man pages for zstdless and zstdgrep, by @samrussell > + > +v1.3.6 > +perf: much faster dictionary builder, by @jenniferliu > +perf: faster dictionary compression on small data when using multiple contexts, by @felixhandte > +perf: faster dictionary decompression when using a very large number of dictionaries simultaneously > +cli : fix : does no longer overwrite destination when source does not exist (#1082) > +cli : new command --adapt, for automatic compression level adaptation > +api : fix : block api can be streamed with > 4 GB, reported by @catid > +api : reduced ZSTD_DDict size by 2 KB > +api : minimum negative compression level is defined, and can be queried using ZSTD_minCLevel(). > +build: support Haiku target, by @korli > +build: Read Legacy format is limited to v0.5+ by default. Can be changed at compile time with macro ZSTD_LEGACY_SUPPORT. > +doc : zstd_compression_format.md updated to match wording in IETF RFC 8478 > +misc: tests/paramgrill, a parameter optimizer, by @GeorgeLu97 > + > +v1.3.5 > +perf: much faster dictionary compression, by @felixhandte > +perf: small quality improvement for dictionary generation, by @terrelln > +perf: slightly improved high compression levels (notably level 19) > +mem : automatic memory release for long duration contexts > +cli : fix : overlapLog can be manually set > +cli : fix : decoding invalid lz4 frames > +api : fix : performance degradation for dictionary compression when using advanced API, by @terrelln > +api : change : clarify ZSTD_CCtx_reset() vs ZSTD_CCtx_resetParameters(), by @terrelln > +build: select custom libzstd scope through control macros, by @GeorgeLu97 > +build: OpenBSD patch, by @bket > +build: make and make all are compatible with -j > +doc : clarify zstd_compression_format.md, updated for IETF RFC process > +misc: pzstd compatible with reproducible compilation, by @lamby > + > v1.3.4 > perf: faster speed (especially decoding speed) on recent cpus (haswell+) > perf: much better performance associating --long with multi-threading, by @terrelln > > Modified: head/sys/contrib/zstd/README.md > ============================================================================== > --- head/sys/contrib/zstd/README.md Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/README.md Mon Oct 22 18:29:12 2018 (r339606) > @@ -4,7 +4,7 @@ __Zstandard__, or `zstd` as short version, is a fast l > targeting real-time compression scenarios at zlib-level and better compression ratios. > It's backed by a very fast entropy stage, provided by [Huff0 and FSE library](https://github.com/Cyan4973/FiniteStateEntropy). > > -The project is provided as an open-source BSD-licensed **C** library, > +The project is provided as an open-source dual [BSD](LICENSE) and [GPLv2](COPYING) licensed **C** library, > and a command line utility producing and decoding `.zst`, `.gz`, `.xz` and `.lz4` files. > Should your project require another programming language, > a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages). > @@ -120,6 +120,8 @@ Other available options include: > A `cmake` project generator is provided within `build/cmake`. > It can generate Makefiles or other build scripts > to create `zstd` binary, and `libzstd` dynamic and static libraries. > + > +By default, `CMAKE_BUILD_TYPE` is set to `Release`. > > #### Meson > > > Modified: head/sys/contrib/zstd/TESTING.md > ============================================================================== > --- head/sys/contrib/zstd/TESTING.md Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/TESTING.md Mon Oct 22 18:29:12 2018 (r339606) > @@ -41,4 +41,4 @@ They consist of the following tests: > - `pzstd` with asan and tsan, as well as in 32-bits mode > - Testing `zstd` with legacy mode off > - Testing `zbuff` (old streaming API) > -- Entire test suite and make install on OS X > +- Entire test suite and make install on macOS > > Modified: head/sys/contrib/zstd/appveyor.yml > ============================================================================== > --- head/sys/contrib/zstd/appveyor.yml Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/appveyor.yml Mon Oct 22 18:29:12 2018 (r339606) > @@ -181,15 +181,15 @@ > - COMPILER: "gcc" > HOST: "mingw" > PLATFORM: "x64" > - SCRIPT: "make allzstd" > + SCRIPT: "CPPFLAGS=-DDEBUGLEVEL=2 CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2" > - COMPILER: "gcc" > HOST: "mingw" > PLATFORM: "x86" > - SCRIPT: "make allzstd" > + SCRIPT: "CFLAGS=-Werror make -j allzstd" > - COMPILER: "clang" > HOST: "mingw" > PLATFORM: "x64" > - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" > + SCRIPT: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd" > > - COMPILER: "visual" > HOST: "visual" > > Modified: head/sys/contrib/zstd/contrib/gen_html/Makefile > ============================================================================== > --- head/sys/contrib/zstd/contrib/gen_html/Makefile Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/gen_html/Makefile Mon Oct 22 18:29:12 2018 (r339606) > @@ -10,7 +10,7 @@ > CXXFLAGS ?= -O3 > CXXFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment > CXXFLAGS += $(MOREFLAGS) > -FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) > +FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) > > ZSTDAPI = ../../lib/zstd.h > ZSTDMANUAL = ../../doc/zstd_manual.html > > Modified: head/sys/contrib/zstd/contrib/meson/meson.build > ============================================================================== > --- head/sys/contrib/zstd/contrib/meson/meson.build Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/meson/meson.build Mon Oct 22 18:29:12 2018 (r339606) > @@ -18,6 +18,7 @@ libzstd_srcs = [ > join_paths(common_dir, 'error_private.c'), > join_paths(common_dir, 'xxhash.c'), > join_paths(compress_dir, 'fse_compress.c'), > + join_paths(compress_dir, 'hist.c'), > join_paths(compress_dir, 'huf_compress.c'), > join_paths(compress_dir, 'zstd_compress.c'), > join_paths(compress_dir, 'zstd_fast.c'), > @@ -130,6 +131,7 @@ test('fuzzer', fuzzer) > if target_machine.system() != 'windows' > paramgrill = executable('paramgrill', > datagen_c, join_paths(tests_dir, 'paramgrill.c'), > + join_paths(programs_dir, 'bench.c'), > include_directories: test_includes, > link_with: libzstd, > dependencies: libm) > > Modified: head/sys/contrib/zstd/contrib/pzstd/Makefile > ============================================================================== > --- head/sys/contrib/zstd/contrib/pzstd/Makefile Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/pzstd/Makefile Mon Oct 22 18:29:12 2018 (r339606) > @@ -42,7 +42,7 @@ PZSTD_LDFLAGS = > EXTRA_FLAGS = > ALL_CFLAGS = $(EXTRA_FLAGS) $(CPPFLAGS) $(PZSTD_CPPFLAGS) $(CFLAGS) $(PZSTD_CFLAGS) > ALL_CXXFLAGS = $(EXTRA_FLAGS) $(CPPFLAGS) $(PZSTD_CPPFLAGS) $(CXXFLAGS) $(PZSTD_CXXFLAGS) > -ALL_LDFLAGS = $(EXTRA_FLAGS) $(LDFLAGS) $(PZSTD_LDFLAGS) > +ALL_LDFLAGS = $(EXTRA_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(PZSTD_LDFLAGS) > > > # gtest libraries need to go before "-lpthread" because they depend on it. > @@ -50,7 +50,7 @@ GTEST_LIB = -L googletest/build/googlemock/gtest > LIBS = > > # Compilation commands > -LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -lpthread -o $@ > +LD_COMMAND = $(CXX) $^ $(ALL_LDFLAGS) $(LIBS) -pthread -o $@ > CC_COMMAND = $(CC) $(DEPFLAGS) $(ALL_CFLAGS) -c $< -o $@ > CXX_COMMAND = $(CXX) $(DEPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@ > > > Modified: head/sys/contrib/zstd/contrib/pzstd/Options.cpp > ============================================================================== > --- head/sys/contrib/zstd/contrib/pzstd/Options.cpp Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/pzstd/Options.cpp Mon Oct 22 18:29:12 2018 (r339606) > @@ -18,17 +18,6 @@ > #include > #include > > -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || \ > - defined(__CYGWIN__) > -#include /* _isatty */ > -#define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream)) > -#elif defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || (defined(__APPLE__) && defined(__MACH__)) || \ > - defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) /* https://sourceforge.net/p/predef/wiki/OperatingSystems/ */ > -#include /* isatty */ > -#define IS_CONSOLE(stdStream) isatty(fileno(stdStream)) > -#else > -#define IS_CONSOLE(stdStream) 0 > -#endif > > namespace pzstd { > > @@ -85,7 +74,7 @@ void usage() { > std::fprintf(stderr, "Usage:\n"); > std::fprintf(stderr, " pzstd [args] [FILE(s)]\n"); > std::fprintf(stderr, "Parallel ZSTD options:\n"); > - std::fprintf(stderr, " -p, --processes # : number of threads to use for (de)compression (default:%d)\n", defaultNumThreads()); > + std::fprintf(stderr, " -p, --processes # : number of threads to use for (de)compression (default:)\n"); > > std::fprintf(stderr, "ZSTD options:\n"); > std::fprintf(stderr, " -# : # compression level (1-%d, default:%d)\n", kMaxNonUltraCompressionLevel, kDefaultCompressionLevel); > > Modified: head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp > ============================================================================== > --- head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp Mon Oct 22 18:29:12 2018 (r339606) > @@ -6,6 +6,7 @@ > * LICENSE file in the root directory of this source tree) and the GPLv2 (found > * in the COPYING file in the root directory of this source tree). > */ > +#include "platform.h" /* Large Files support, SET_BINARY_MODE */ > #include "Pzstd.h" > #include "SkippableFrame.h" > #include "utils/FileSystem.h" > @@ -21,14 +22,6 @@ > #include > #include > > -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) > -# include /* _O_BINARY */ > -# include /* _setmode, _isatty */ > -# define SET_BINARY_MODE(file) { if (_setmode(_fileno(file), _O_BINARY) == -1) perror("Cannot set _O_BINARY"); } > -#else > -# include /* isatty */ > -# define SET_BINARY_MODE(file) > -#endif > > namespace pzstd { > > > Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile > ============================================================================== > --- head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile Mon Oct 22 18:29:12 2018 (r339606) > @@ -9,19 +9,25 @@ > > # This Makefile presumes libzstd is built, using `make` in / or /lib/ > > -LDFLAGS += ../../../lib/libzstd.a > +ZSTDLIB_PATH = ../../../lib > +ZSTDLIB_NAME = libzstd.a > +ZSTDLIB = $(ZSTDLIB_PATH)/$(ZSTDLIB_NAME) > + > CPPFLAGS += -I../ -I../../../lib -I../../../lib/common > > CFLAGS ?= -O3 > CFLAGS += -g > > -SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c > +SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c $(ZSTDLIB) > > .PHONY: default all clean test > > default: all > > all: seekable_compression seekable_decompression parallel_processing > + > +$(ZSTDLIB): > + make -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME) > > seekable_compression : seekable_compression.c $(SEEKABLE_OBJS) > $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ > > Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c > ============================================================================== > --- head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c Mon Oct 22 18:29:12 2018 (r339606) > @@ -101,7 +101,7 @@ static void compressFile_orDie(const char* fname, cons > free(buffOut); > } > > -static const char* createOutFilename_orDie(const char* filename) > +static char* createOutFilename_orDie(const char* filename) > { > size_t const inL = strlen(filename); > size_t const outL = inL + 5; > @@ -109,7 +109,7 @@ static const char* createOutFilename_orDie(const char* > memset(outSpace, 0, outL); > strcat(outSpace, filename); > strcat(outSpace, ".zst"); > - return (const char*)outSpace; > + return (char*)outSpace; > } > > int main(int argc, const char** argv) { > @@ -124,8 +124,9 @@ int main(int argc, const char** argv) { > { const char* const inFileName = argv[1]; > unsigned const frameSize = (unsigned)atoi(argv[2]); > > - const char* const outFileName = createOutFilename_orDie(inFileName); > + char* const outFileName = createOutFilename_orDie(inFileName); > compressFile_orDie(inFileName, outFileName, 5, frameSize); > + free(outFileName); > } > > return 0; > > Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c > ============================================================================== > --- head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c Mon Oct 22 18:29:12 2018 (r339606) > @@ -84,7 +84,7 @@ static void fseek_orDie(FILE* file, long int offset, i > } > > > -static void decompressFile_orDie(const char* fname, unsigned startOffset, unsigned endOffset) > +static void decompressFile_orDie(const char* fname, off_t startOffset, off_t endOffset) > { > FILE* const fin = fopen_orDie(fname, "rb"); > FILE* const fout = stdout; > @@ -129,8 +129,8 @@ int main(int argc, const char** argv) > > { > const char* const inFilename = argv[1]; > - unsigned const startOffset = (unsigned) atoi(argv[2]); > - unsigned const endOffset = (unsigned) atoi(argv[3]); > + off_t const startOffset = atoll(argv[2]); > + off_t const endOffset = atoll(argv[3]); > decompressFile_orDie(inFilename, startOffset, endOffset); > } > > > Modified: head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h > ============================================================================== > --- head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h Mon Oct 22 18:29:12 2018 (r339606) > @@ -6,8 +6,10 @@ extern "C" { > #endif > > #include > +#include "zstd.h" /* ZSTDLIB_API */ > > -static const unsigned ZSTD_seekTableFooterSize = 9; > + > +#define ZSTD_seekTableFooterSize 9 > > #define ZSTD_SEEKABLE_MAGICNUMBER 0x8F92EAB1 > > > Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c > ============================================================================== > --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Mon Oct 22 18:29:12 2018 (r339606) > @@ -24,7 +24,7 @@ > #endif > > /* ************************************************************ > -* Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW > +* Avoid fseek()'s 2GiB barrier with MSVC, macOS, *BSD, MinGW > ***************************************************************/ > #if defined(_MSC_VER) && _MSC_VER >= 1400 > # define LONG_SEEK _fseeki64 > @@ -56,6 +56,7 @@ > > #include /* malloc, free */ > #include /* FILE* */ > +#include > > #define XXH_STATIC_LINKING_ONLY > #define XXH_NAMESPACE ZSTD_ > @@ -88,7 +89,7 @@ static int ZSTD_seekable_read_FILE(void* opaque, void* > return 0; > } > > -static int ZSTD_seekable_seek_FILE(void* opaque, S64 offset, int origin) > +static int ZSTD_seekable_seek_FILE(void* opaque, long long offset, int origin) > { > int const ret = LONG_SEEK((FILE*)opaque, offset, origin); > if (ret) return ret; > @@ -110,9 +111,9 @@ static int ZSTD_seekable_read_buff(void* opaque, void* > return 0; > } > > -static int ZSTD_seekable_seek_buff(void* opaque, S64 offset, int origin) > +static int ZSTD_seekable_seek_buff(void* opaque, long long offset, int origin) > { > - buffWrapper_t* buff = (buffWrapper_t*) opaque; > + buffWrapper_t* const buff = (buffWrapper_t*) opaque; > unsigned long long newOffset; > switch (origin) { > case SEEK_SET: > @@ -124,6 +125,8 @@ static int ZSTD_seekable_seek_buff(void* opaque, S64 o > case SEEK_END: > newOffset = (unsigned long long)buff->size - offset; > break; > + default: > + assert(0); /* not possible */ > } > if (newOffset > buff->size) { > return -1; > @@ -197,7 +200,7 @@ size_t ZSTD_seekable_free(ZSTD_seekable* zs) > * Performs a binary search to find the last frame with a decompressed offset > * <= pos > * @return : the frame's index */ > -U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, U64 pos) > +U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, unsigned long long pos) > { > U32 lo = 0; > U32 hi = zs->seekTable.tableLen; > @@ -222,13 +225,13 @@ U32 ZSTD_seekable_getNumFrames(ZSTD_seekable* const zs > return zs->seekTable.tableLen; > } > > -U64 ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) > +unsigned long long ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) > { > if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; > return zs->seekTable.entries[frameIndex].cOffset; > } > > -U64 ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) > +unsigned long long ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) > { > if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; > return zs->seekTable.entries[frameIndex].dOffset; > @@ -294,7 +297,6 @@ static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekabl > { /* Allocate an extra entry at the end so that we can do size > * computations on the last element without special case */ > seekEntry_t* entries = (seekEntry_t*)malloc(sizeof(seekEntry_t) * (numFrames + 1)); > - const BYTE* tableBase = zs->inBuff + ZSTD_skippableHeaderSize; > > U32 idx = 0; > U32 pos = 8; > @@ -311,8 +313,8 @@ static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekabl > /* compute cumulative positions */ > for (; idx < numFrames; idx++) { > if (pos + sizePerEntry > SEEKABLE_BUFF_SIZE) { > - U32 const toRead = MIN(remaining, SEEKABLE_BUFF_SIZE); > U32 const offset = SEEKABLE_BUFF_SIZE - pos; > + U32 const toRead = MIN(remaining, SEEKABLE_BUFF_SIZE - offset); > memmove(zs->inBuff, zs->inBuff + pos, offset); /* move any data we haven't read yet */ > CHECK_IO(src.read(src.opaque, zs->inBuff+offset, toRead)); > remaining -= toRead; > @@ -372,7 +374,7 @@ size_t ZSTD_seekable_initAdvanced(ZSTD_seekable* zs, Z > return 0; > } > > -size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t len, U64 offset) > +size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t len, unsigned long long offset) > { > U32 targetFrame = ZSTD_seekable_offsetToFrameIndex(zs, offset); > do { > > Added: head/sys/contrib/zstd/doc/images/cdict_v136.png > ============================================================================== > Binary file. No diff available. > > Added: head/sys/contrib/zstd/doc/images/zstd_cdict_v1_3_5.png > ============================================================================== > Binary file. No diff available. > > Modified: head/sys/contrib/zstd/doc/zstd_compression_format.md > ============================================================================== > --- head/sys/contrib/zstd/doc/zstd_compression_format.md Mon Oct 22 17:42:57 2018 (r339605) > +++ head/sys/contrib/zstd/doc/zstd_compression_format.md Mon Oct 22 18:29:12 2018 (r339606) > @@ -16,7 +16,7 @@ Distribution of this document is unlimited. > > ### Version > > -0.2.6 (19/08/17) > +0.3.0 (25/09/18) > > > Introduction > @@ -27,6 +27,8 @@ that is independent of CPU type, operating system, > file system and character set, suitable for > file compression, pipe and streaming compression, > using the [Zstandard algorithm](http://www.zstandard.org). > +The text of the specification assumes a basic background in programming > +at the level of bits and other primitive data representations. > > The data can be produced or consumed, > even for an arbitrarily long sequentially presented input data stream, > @@ -39,11 +41,6 @@ for detection of data corruption. > The data format defined by this specification > does not attempt to allow random access to compressed data. > > -This specification is intended for use by implementers of software > -to compress data into Zstandard format and/or decompress data from Zstandard format. > -The text of the specification assumes a basic background in programming > -at the level of bits and other primitive data representations. > - > Unless otherwise indicated below, > a compliant compressor must produce data sets > that conform to the specifications presented here. > @@ -57,6 +54,12 @@ Whenever it does not support a parameter defined in th > it must produce a non-ambiguous error code and associated error message > explaining which parameter is unsupported. > > +This specification is intended for use by implementers of software > +to compress data into Zstandard format and/or decompress data from Zstandard format. > +The Zstandard format is supported by an open source reference implementation, > +written in portable C, and available at : https://github.com/facebook/zstd . > + > + > ### Overall conventions > In this document: > - square brackets i.e. `[` and `]` are used to indicate optional fields or parameters. > @@ -69,7 +72,7 @@ A frame is completely independent, has a defined begin > and a set of parameters which tells the decoder how to decompress it. > > A frame encapsulates one or multiple __blocks__. > -Each block can be compressed or not, > +Each block contains arbitrary content, which is described by its header, > and has a guaranteed maximum content size, which depends on frame parameters. > Unlike frames, each block depends on previous blocks for proper decoding. > However, each block can be decompressed without waiting for its successor, > @@ -92,14 +95,14 @@ Overview > Frames > ------ > Zstandard compressed data is made of one or more __frames__. > -Each frame is independent and can be decompressed indepedently of other frames. > +Each frame is independent and can be decompressed independently of other frames. > The decompressed content of multiple concatenated frames is the concatenation of > each frame decompressed content. > > There are two frame formats defined by Zstandard: > Zstandard frames and Skippable frames. > Zstandard frames contain compressed data, while > -skippable frames contain no data and can be used for metadata. > +skippable frames contain custom user metadata. > > ## Zstandard frames > The structure of a single Zstandard frame is following: > @@ -112,6 +115,11 @@ __`Magic_Number`__ > > 4 Bytes, __little-endian__ format. > Value : 0xFD2FB528 > +Note: This value was selected to be less probable to find at the beginning of some random file. > +It avoids trivial patterns (0x00, 0xFF, repeated bytes, increasing bytes, etc.), > +contains byte values outside of ASCII range, > +and doesn't map into UTF8 space. > +It reduces the chances that a text file represent this value by accident. > > __`Frame_Header`__ > > @@ -171,8 +179,8 @@ according to the following table: > |`FCS_Field_Size`| 0 or 1 | 2 | 4 | 8 | > > When `Flag_Value` is `0`, `FCS_Field_Size` depends on `Single_Segment_flag` : > -if `Single_Segment_flag` is set, `Field_Size` is 1. > -Otherwise, `Field_Size` is 0 : `Frame_Content_Size` is not provided. > +if `Single_Segment_flag` is set, `FCS_Field_Size` is 1. > +Otherwise, `FCS_Field_Size` is 0 : `Frame_Content_Size` is not provided. > > __`Single_Segment_flag`__ > > @@ -196,10 +204,10 @@ depending on local limitations. > > __`Unused_bit`__ > > -The value of this bit should be set to zero. > -A decoder compliant with this specification version shall not interpret it. > -It might be used in a future version, > -to signal a property which is not mandatory to properly decode the frame. > +A decoder compliant with this specification version shall not interpret this bit. > +It might be used in any future version, > +to signal a property which is transparent to properly decode the frame. > +An encoder compliant with this specification version must set this bit to zero. > > __`Reserved_bit`__ > > @@ -218,11 +226,11 @@ __`Dictionary_ID_flag`__ > > This is a 2-bits flag (`= FHD & 3`), > telling if a dictionary ID is provided within the header. > -It also specifies the size of this field as `Field_Size`. > +It also specifies the size of this field as `DID_Field_Size`. > > -|`Flag_Value`| 0 | 1 | 2 | 3 | > -| ---------- | --- | --- | --- | --- | > -|`Field_Size`| 0 | 1 | 2 | 4 | > +|`Flag_Value` | 0 | 1 | 2 | 3 | > +| -------------- | --- | --- | --- | --- | > +|`DID_Field_Size`| 0 | 1 | 2 | 4 | > > #### `Window_Descriptor` > > @@ -249,6 +257,9 @@ Window_Size = windowBase + windowAdd; > The minimum `Window_Size` is 1 KB. > The maximum `Window_Size` is `(1<<41) + 7*(1<<38)` bytes, which is 3.75 TB. > > +In general, larger `Window_Size` tend to improve compression ratio, > +but at the cost of memory usage. > + > To properly decode compressed data, > a decoder will need to allocate a buffer of at least `Window_Size` bytes. > > @@ -257,8 +268,8 @@ a decoder is allowed to reject a compressed frame > which requests a memory size beyond decoder's authorized range. > > For improved interoperability, > -decoders are recommended to be compatible with `Window_Size <= 8 MB`, > -and encoders are recommended to not request more than 8 MB. > +it's recommended for decoders to support `Window_Size` of up to 8 MB, > +and it's recommended for encoders to not generate frame requiring `Window_Size` larger than 8 MB. > It's merely a recommendation though, > decoders are free to support larger or lower limits, > depending on local limitations. > @@ -268,9 +279,10 @@ depending on local limitations. > This is a variable size field, which contains > the ID of the dictionary required to properly decode the frame. > `Dictionary_ID` field is optional. When it's not present, > -it's up to the decoder to make sure it uses the correct dictionary. > +it's up to the decoder to know which dictionary to use. > > -Field size depends on `Dictionary_ID_flag`. > +`Dictionary_ID` field size is provided by `DID_Field_Size`. > +`DID_Field_Size` is directly derived from value of `Dictionary_ID_flag`. > 1 byte can represent an ID 0-255. > 2 bytes can represent an ID 0-65535. > 4 bytes can represent an ID 0-4294967295. > @@ -280,13 +292,21 @@ It's allowed to represent a small ID (for example `13` > with a large 4-bytes dictionary ID, even if it is less efficient. > > _Reserved ranges :_ > -If the frame is going to be distributed in a private environment, > -any dictionary ID can be used. > -However, for public distribution of compressed frames using a dictionary, > -the following ranges are reserved and shall not be used : > +Within private environments, any `Dictionary_ID` can be used. > + > +However, for frames and dictionaries distributed in public space, > +`Dictionary_ID` must be attributed carefully. > +Rules for public environment are not yet decided, > +but the following ranges are reserved for some future registrar : > - low range : `<= 32767` > - high range : `>= (1 << 31)` > > +Outside of these ranges, any value of `Dictionary_ID` > +which is both `>= 32768` and `< (1<<31)` can be used freely, > +even in public environment. > + > + > + > #### `Frame_Content_Size` > > This is the original (uncompressed) size. This information is optional. > @@ -359,22 +379,23 @@ There are 4 block types : > > - `Reserved` - this is not a block. > This value cannot be used with current version of this specification. > + If such a value is present, it is considered corrupted data. > > __`Block_Size`__ > > The upper 21 bits of `Block_Header` represent the `Block_Size`. > +`Block_Size` is the size of the block excluding the header. > +A block can contain any number of bytes (even zero), up to > +`Block_Maximum_Decompressed_Size`, which is the smallest of: > +- Window_Size > +- 128 KB > > -Block sizes must respect a few rules : > -- For `Compressed_Block`, `Block_Size` is always strictly less than decompressed size. > -- Block decompressed size is always <= `Window_Size` > -- Block decompressed size is always <= 128 KB. > +A `Compressed_Block` has the extra restriction that `Block_Size` is always > +strictly less than the decompressed size. > +If this condition cannot be respected, > +the block must be sent uncompressed instead (`Raw_Block`). > > -A block can contain any number of bytes (even empty), > -up to `Block_Maximum_Decompressed_Size`, which is the smallest of : > -- `Window_Size` > -- 128 KB > > - > Compressed Blocks > ----------------- > To decompress a compressed block, the compressed size must be provided > @@ -390,11 +411,17 @@ data in [Sequence Execution](#sequence-execution) > #### Prerequisites > To decode a compressed block, the following elements are necessary : > - Previous decoded data, up to a distance of `Window_Size`, > - or all previously decoded data when `Single_Segment_flag` is set. > + or beginning of the Frame, whichever is smaller. > - List of "recent offsets" from previous `Compressed_Block`. > -- Decoding tables of previous `Compressed_Block` for each symbol type > - (literals, literals lengths, match lengths, offsets). > +- The previous Huffman tree, required by `Treeless_Literals_Block` type > +- Previous FSE decoding tables, required by `Repeat_Mode` > + for each symbol type (literals lengths, match lengths, offsets) > > +Note that decoding tables aren't always from the previous `Compressed_Block`. > + > +- Every decoding table can come from a dictionary. > +- The Huffman tree comes from the previous `Compressed_Literals_Block`. > + > Literals Section > ---------------- > All literals are regrouped in the first part of the block. > @@ -405,11 +432,11 @@ Literals can be stored uncompressed or compressed usin > When compressed, an optional tree description can be present, > followed by 1 or 4 streams. > > -| `Literals_Section_Header` | [`Huffman_Tree_Description`] | Stream1 | [Stream2] | [Stream3] | [Stream4] | > -| ------------------------- | ---------------------------- | ------- | --------- | --------- | --------- | > +| `Literals_Section_Header` | [`Huffman_Tree_Description`] | [jumpTable] | Stream1 | [Stream2] | [Stream3] | [Stream4] | > +| ------------------------- | ---------------------------- | ----------- | ------- | --------- | --------- | --------- | > > > -#### `Literals_Section_Header` > +### `Literals_Section_Header` > > Header is in charge of describing how literals are packed. > It's a byte-aligned variable-size bitfield, ranging from 1 to 5 bytes, > @@ -460,18 +487,21 @@ For values spanning several bytes, convention is __lit > > __`Size_Format` for `Raw_Literals_Block` and `RLE_Literals_Block`__ : > > -- Value ?0 : `Size_Format` uses 1 bit. > +`Size_Format` uses 1 _or_ 2 bits. > +Its value is : `Size_Format = (Literals_Section_Header[0]>>2) & 3` > + > +- `Size_Format` == 00 or 10 : `Size_Format` uses 1 bit. > `Regenerated_Size` uses 5 bits (0-31). > - `Literals_Section_Header` has 1 byte. > - `Regenerated_Size = Header[0]>>3` > -- Value 01 : `Size_Format` uses 2 bits. > + `Literals_Section_Header` uses 1 byte. > + `Regenerated_Size = Literals_Section_Header[0]>>3` > +- `Size_Format` == 01 : `Size_Format` uses 2 bits. > `Regenerated_Size` uses 12 bits (0-4095). > - `Literals_Section_Header` has 2 bytes. > - `Regenerated_Size = (Header[0]>>4) + (Header[1]<<4)` > -- Value 11 : `Size_Format` uses 2 bits. > + `Literals_Section_Header` uses 2 bytes. > + `Regenerated_Size = (Literals_Section_Header[0]>>4) + (Literals_Section_Header[1]<<4)` > +- `Size_Format` == 11 : `Size_Format` uses 2 bits. > `Regenerated_Size` uses 20 bits (0-1048575). > - `Literals_Section_Header` has 3 bytes. > - `Regenerated_Size = (Header[0]>>4) + (Header[1]<<4) + (Header[2]<<12)` > + `Literals_Section_Header` uses 3 bytes. > + `Regenerated_Size = (Literals_Section_Header[0]>>4) + (Literals_Section_Header[1]<<4) + (Literals_Section_Header[2]<<12)` > > Only Stream1 is present for these cases. > Note : it's allowed to represent a short value (for example `13`) > @@ -479,66 +509,74 @@ using a long format, even if it's less efficient. > > __`Size_Format` for `Compressed_Literals_Block` and `Treeless_Literals_Block`__ : > > -- Value 00 : _A single stream_. > +`Size_Format` always uses 2 bits. > + > +- `Size_Format` == 00 : _A single stream_. > Both `Regenerated_Size` and `Compressed_Size` use 10 bits (0-1023). > - `Literals_Section_Header` has 3 bytes. > -- Value 01 : 4 streams. > + `Literals_Section_Header` uses 3 bytes. > +- `Size_Format` == 01 : 4 streams. > Both `Regenerated_Size` and `Compressed_Size` use 10 bits (0-1023). > - `Literals_Section_Header` has 3 bytes. > -- Value 10 : 4 streams. > + `Literals_Section_Header` uses 3 bytes. > +- `Size_Format` == 10 : 4 streams. > Both `Regenerated_Size` and `Compressed_Size` use 14 bits (0-16383). > - `Literals_Section_Header` has 4 bytes. > -- Value 11 : 4 streams. > + `Literals_Section_Header` uses 4 bytes. > +- `Size_Format` == 11 : 4 streams. > Both `Regenerated_Size` and `Compressed_Size` use 18 bits (0-262143). > - `Literals_Section_Header` has 5 bytes. > + `Literals_Section_Header` uses 5 bytes. > > Both `Compressed_Size` and `Regenerated_Size` fields follow __little-endian__ convention. > Note: `Compressed_Size` __includes__ the size of the Huffman Tree description > _when_ it is present. > > -### Raw Literals Block > +#### Raw Literals Block > The data in Stream1 is `Regenerated_Size` bytes long, > it contains the raw literals data to be used during [Sequence Execution]. > > -### RLE Literals Block > +#### RLE Literals Block > Stream1 consists of a single byte which should be repeated `Regenerated_Size` times > to generate the decoded literals. > > -### Compressed Literals Block and Treeless Literals Block > +#### Compressed Literals Block and Treeless Literals Block > Both of these modes contain Huffman encoded data. > -`Treeless_Literals_Block` does not have a `Huffman_Tree_Description`. > > -#### `Huffman_Tree_Description` > +For `Treeless_Literals_Block`, > +the Huffman table comes from previously compressed literals block, > +or from a dictionary. > + > + > +### `Huffman_Tree_Description` > This section is only present when `Literals_Block_Type` type is `Compressed_Literals_Block` (`2`). > The format of the Huffman tree description can be found at [Huffman Tree description](#huffman-tree-description). > The size of `Huffman_Tree_Description` is determined during decoding process, > it must be used to determine where streams begin. > `Total_Streams_Size = Compressed_Size - Huffman_Tree_Description_Size`. > > -For `Treeless_Literals_Block`, > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 19:39:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B88105E944; Mon, 22 Oct 2018 19:39:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F5AF8EEB2; Mon, 22 Oct 2018 19:39:21 +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 5A37824C2C; Mon, 22 Oct 2018 19:39:21 +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 w9MJdLrf071018; Mon, 22 Oct 2018 19:39:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MJdKiW071014; Mon, 22 Oct 2018 19:39:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810221939.w9MJdKiW071014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Oct 2018 19:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339609 - in head/release: amd64 i386 powerpc sparc64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/release: amd64 i386 powerpc sparc64 X-SVN-Commit-Revision: 339609 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, 22 Oct 2018 19:39:21 -0000 Author: emaste Date: Mon Oct 22 19:39:20 2018 New Revision: 339609 URL: https://svnweb.freebsd.org/changeset/base/339609 Log: release: set -e to exit on error in iso image scripts Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D17651 Modified: head/release/amd64/mkisoimages.sh head/release/i386/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/sparc64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Mon Oct 22 18:41:22 2018 (r339608) +++ head/release/amd64/mkisoimages.sh Mon Oct 22 19:39:20 2018 (r339609) @@ -23,6 +23,8 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. +set -e + if [ -z $ETDUMP ]; then ETDUMP=etdump fi Modified: head/release/i386/mkisoimages.sh ============================================================================== --- head/release/i386/mkisoimages.sh Mon Oct 22 18:41:22 2018 (r339608) +++ head/release/i386/mkisoimages.sh Mon Oct 22 19:39:20 2018 (r339609) @@ -23,6 +23,8 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. +set -e + if [ "$1" = "-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Mon Oct 22 18:41:22 2018 (r339608) +++ head/release/powerpc/mkisoimages.sh Mon Oct 22 19:39:20 2018 (r339609) @@ -23,6 +23,7 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. +set -e if [ "$1" = "-b" ]; then bootable=1 Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Mon Oct 22 18:41:22 2018 (r339608) +++ head/release/sparc64/mkisoimages.sh Mon Oct 22 19:39:20 2018 (r339609) @@ -22,6 +22,8 @@ # resulting ISO image, base-bits-dir contains the image contents and # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. +set -e + if [ $# -lt 3 ]; then echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]" > /dev/stderr exit 1 From owner-svn-src-head@freebsd.org Mon Oct 22 20:13:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63743106C15E; Mon, 22 Oct 2018 20:13: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17DE270BCC; Mon, 22 Oct 2018 20:13: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 12BFF252B9; Mon, 22 Oct 2018 20:13: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 w9MKDq1k091550; Mon, 22 Oct 2018 20:13:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MKDqUX091544; Mon, 22 Oct 2018 20:13:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810222013.w9MKDqUX091544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Oct 2018 20:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339616 - in head: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica X-SVN-Commit-Revision: 339616 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, 22 Oct 2018 20:13:53 -0000 Author: markj Date: Mon Oct 22 20:13:51 2018 New Revision: 339616 URL: https://svnweb.freebsd.org/changeset/base/339616 Log: Make it possible to disable NUMA support with a tunable. This provides a chicken switch for anyone negatively impacted by enabling NUMA in the amd64 GENERIC kernel configuration. With NUMA disabled at boot-time, information about the NUMA topology is not exposed to the rest of the kernel, and all of physical memory is viewed as coming from a single domain. This method still has some performance overhead relative to disabling NUMA support at compile time. PR: 231460 Reviewed by: alc, gallatin, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17439 Modified: head/share/man/man4/numa.4 head/sys/arm64/arm64/mp_machdep.c head/sys/kern/kern_cpuset.c head/sys/vm/vm_phys.c head/sys/x86/acpica/srat.c Modified: head/share/man/man4/numa.4 ============================================================================== --- head/share/man/man4/numa.4 Mon Oct 22 20:00:43 2018 (r339615) +++ head/share/man/man4/numa.4 Mon Oct 22 20:13:51 2018 (r339616) @@ -24,18 +24,16 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2018 +.Dd October 22, 2018 .Dt NUMA 4 .Os .Sh NAME .Nm NUMA .Nd Non-Uniform Memory Access .Sh SYNOPSIS -.Cd options SMP -.Cd options MAXMEMDOM=16 +.Cd options MAXMEMDOM +.Cd options NUMA .Pp -.In sys/cpuset.h -.In sys/bus.h .Sh DESCRIPTION Non-Uniform Memory Access is a computer architecture design which involves unequal costs between processors, memory and IO devices @@ -47,14 +45,26 @@ architecture, the latency to access specific memory or depends upon which processor the memory or device is attached to. Accessing memory local to a processor is faster than accessing memory that is connected to one of the other processors. +.Fx +implements NUMA-aware memory allocation policies. +By default it attempts to ensure that allocations are balanced across +each domain. +Users may override the default domain selection policy using +.Xr cpuset 1 . .Pp .Nm -is enabled when the +support is enabled when the .Cd NUMA -option is used in a kernel configuration -file and the +option is specified in the kernel configuration file. +Each platform defines the .Cd MAXMEMDOM -option is set to a value greater than 1. +constant, which specifies the maximum number of supported NUMA domains. +This constant may be specified in the kernel configuration file. +.Nm +support can be disabled at boot time by setting the +.Va vm.numa.disabled +tunable to 1. +Other values for this tunable are currently ignored. .Pp Thread and process .Nm @@ -128,7 +138,7 @@ tool first appeared in .Fx 11.0 and were removed in .Fx 12.0 . -Current implementation appeared in +The current implementation appeared in .Fx 12.0 . .Pp .Sh AUTHORS Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon Oct 22 20:00:43 2018 (r339615) +++ head/sys/arm64/arm64/mp_machdep.c Mon Oct 22 20:13:51 2018 (r339616) @@ -576,11 +576,12 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size return (FALSE); /* Try to read the numa node of this cpu */ - if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) { - __pcpu[id].pc_domain = domain; - if (domain < MAXMEMDOM) - CPU_SET(id, &cpuset_domain[domain]); - } + if (vm_ndomains == 1 || + OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0) + domain = 0; + __pcpu[id].pc_domain = domain; + if (domain < MAXMEMDOM) + CPU_SET(id, &cpuset_domain[domain]); return (TRUE); } Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Oct 22 20:00:43 2018 (r339615) +++ head/sys/kern/kern_cpuset.c Mon Oct 22 20:13:51 2018 (r339616) @@ -458,6 +458,12 @@ _domainset_create(struct domainset *domain, struct dom struct domainset *ndomain; int i, j, max; + KASSERT(domain->ds_cnt <= vm_ndomains, + ("invalid domain count in domainset %p", domain)); + KASSERT(domain->ds_policy != DOMAINSET_POLICY_PREFER || + domain->ds_prefer < vm_ndomains, + ("invalid preferred domain in domains %p", domain)); + mtx_lock_spin(&cpuset_lock); LIST_FOREACH(ndomain, &cpuset_domains, ds_link) if (domainset_equal(ndomain, domain)) Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Mon Oct 22 20:00:43 2018 (r339615) +++ head/sys/vm/vm_phys.c Mon Oct 22 20:13:51 2018 (r339616) @@ -597,11 +597,22 @@ vm_phys_register_domains(int ndomains, struct mem_affi int *locality) { #ifdef NUMA - int i; + int d, i; - vm_ndomains = ndomains; - mem_affinity = affinity; - mem_locality = locality; + /* + * For now the only override value that we support is 1, which + * effectively disables NUMA-awareness in the allocators. + */ + d = 0; + TUNABLE_INT_FETCH("vm.numa.disabled", &d); + if (d) + ndomains = 1; + + if (ndomains > 1) { + vm_ndomains = ndomains; + mem_affinity = affinity; + mem_locality = locality; + } for (i = 0; i < vm_ndomains; i++) DOMAINSET_SET(i, &all_domains); Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Mon Oct 22 20:00:43 2018 (r339615) +++ head/sys/x86/acpica/srat.c Mon Oct 22 20:13:51 2018 (r339616) @@ -535,11 +535,7 @@ srat_set_cpus(void *dummy) if (!cpu->enabled) panic("SRAT: CPU with APIC ID %u is not known", pc->pc_apic_id); -#ifdef NUMA - pc->pc_domain = cpu->domain; -#else - pc->pc_domain = 0; -#endif + pc->pc_domain = vm_ndomains > 1 ? cpu->domain : 0; CPU_SET(i, &cpuset_domain[pc->pc_domain]); if (bootverbose) printf("SRAT: CPU %u has memory domain %d\n", i, @@ -564,7 +560,7 @@ acpi_map_pxm_to_vm_domainid(int pxm) for (i = 0; i < ndomain; i++) { if (domain_pxm[i] == pxm) - return (i); + return (vm_ndomains > 1 ? i : 0); } return (-1); From owner-svn-src-head@freebsd.org Mon Oct 22 20:22:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 045E8106C6EA; Mon, 22 Oct 2018 20:22:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE12171285; Mon, 22 Oct 2018 20:22:33 +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 8EE782546C; Mon, 22 Oct 2018 20:22:33 +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 w9MKMXfv096580; Mon, 22 Oct 2018 20:22:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MKMXln096579; Mon, 22 Oct 2018 20:22:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810222022.w9MKMXln096579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 22 Oct 2018 20:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339617 - head/sys/contrib/zstd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd X-SVN-Commit-Revision: 339617 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, 22 Oct 2018 20:22:34 -0000 Author: cem Date: Mon Oct 22 20:22:33 2018 New Revision: 339617 URL: https://svnweb.freebsd.org/changeset/base/339617 Log: Retroactively vendor 1.3.3, 1.3.4, and 1.3.7 imports "svn merge --record-only svn+ssh://repo.freebsd.org/base/vendor/zstd/dist" Reported by: jhb, markj Sponsored by: Dell EMC Isilon Modified: Directory Properties: head/sys/contrib/zstd/ (props changed) From owner-svn-src-head@freebsd.org Mon Oct 22 20:36:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6080F106D6AD; Mon, 22 Oct 2018 20:36:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 D7121726D3; Mon, 22 Oct 2018 20:36:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MKaPB4013185; Mon, 22 Oct 2018 13:36:25 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MKaPYv013184; Mon, 22 Oct 2018 13:36:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810222036.w9MKaPYv013184@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339616 - in head: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica In-Reply-To: <201810222013.w9MKDqUX091544@repo.freebsd.org> To: Mark Johnston Date: Mon, 22 Oct 2018 13:36:25 -0700 (PDT) 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-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, 22 Oct 2018 20:36:27 -0000 > Author: markj > Date: Mon Oct 22 20:13:51 2018 > New Revision: 339616 > URL: https://svnweb.freebsd.org/changeset/base/339616 > > Log: > Make it possible to disable NUMA support with a tunable. > > This provides a chicken switch for anyone negatively impacted by > enabling NUMA in the amd64 GENERIC kernel configuration. With > NUMA disabled at boot-time, information about the NUMA topology > is not exposed to the rest of the kernel, and all of physical > memory is viewed as coming from a single domain. > > This method still has some performance overhead relative to disabling > NUMA support at compile time. > > PR: 231460 > Reviewed by: alc, gallatin, kib > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17439 Thank you Mark. > Modified: > head/share/man/man4/numa.4 > head/sys/arm64/arm64/mp_machdep.c > head/sys/kern/kern_cpuset.c > head/sys/vm/vm_phys.c > head/sys/x86/acpica/srat.c > > Modified: head/share/man/man4/numa.4 > ============================================================================== > --- head/share/man/man4/numa.4 Mon Oct 22 20:00:43 2018 (r339615) > +++ head/share/man/man4/numa.4 Mon Oct 22 20:13:51 2018 (r339616) > @@ -24,18 +24,16 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 10, 2018 > +.Dd October 22, 2018 > .Dt NUMA 4 > .Os > .Sh NAME > .Nm NUMA > .Nd Non-Uniform Memory Access > .Sh SYNOPSIS > -.Cd options SMP > -.Cd options MAXMEMDOM=16 > +.Cd options MAXMEMDOM > +.Cd options NUMA > .Pp > -.In sys/cpuset.h > -.In sys/bus.h > .Sh DESCRIPTION > Non-Uniform Memory Access is a computer architecture design which > involves unequal costs between processors, memory and IO devices > @@ -47,14 +45,26 @@ architecture, the latency to access specific memory or > depends upon which processor the memory or device is attached to. > Accessing memory local to a processor is faster than accessing memory > that is connected to one of the other processors. > +.Fx > +implements NUMA-aware memory allocation policies. > +By default it attempts to ensure that allocations are balanced across > +each domain. > +Users may override the default domain selection policy using > +.Xr cpuset 1 . > .Pp > .Nm > -is enabled when the > +support is enabled when the > .Cd NUMA > -option is used in a kernel configuration > -file and the > +option is specified in the kernel configuration file. > +Each platform defines the > .Cd MAXMEMDOM > -option is set to a value greater than 1. > +constant, which specifies the maximum number of supported NUMA domains. > +This constant may be specified in the kernel configuration file. > +.Nm > +support can be disabled at boot time by setting the > +.Va vm.numa.disabled > +tunable to 1. > +Other values for this tunable are currently ignored. > .Pp > Thread and process > .Nm > @@ -128,7 +138,7 @@ tool first appeared in > .Fx 11.0 > and were removed in > .Fx 12.0 . > -Current implementation appeared in > +The current implementation appeared in > .Fx 12.0 . > .Pp > .Sh AUTHORS > > Modified: head/sys/arm64/arm64/mp_machdep.c > ============================================================================== > --- head/sys/arm64/arm64/mp_machdep.c Mon Oct 22 20:00:43 2018 (r339615) > +++ head/sys/arm64/arm64/mp_machdep.c Mon Oct 22 20:13:51 2018 (r339616) > @@ -576,11 +576,12 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size > return (FALSE); > > /* Try to read the numa node of this cpu */ > - if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) { > - __pcpu[id].pc_domain = domain; > - if (domain < MAXMEMDOM) > - CPU_SET(id, &cpuset_domain[domain]); > - } > + if (vm_ndomains == 1 || > + OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0) > + domain = 0; > + __pcpu[id].pc_domain = domain; > + if (domain < MAXMEMDOM) > + CPU_SET(id, &cpuset_domain[domain]); > > return (TRUE); > } > > Modified: head/sys/kern/kern_cpuset.c > ============================================================================== > --- head/sys/kern/kern_cpuset.c Mon Oct 22 20:00:43 2018 (r339615) > +++ head/sys/kern/kern_cpuset.c Mon Oct 22 20:13:51 2018 (r339616) > @@ -458,6 +458,12 @@ _domainset_create(struct domainset *domain, struct dom > struct domainset *ndomain; > int i, j, max; > > + KASSERT(domain->ds_cnt <= vm_ndomains, > + ("invalid domain count in domainset %p", domain)); > + KASSERT(domain->ds_policy != DOMAINSET_POLICY_PREFER || > + domain->ds_prefer < vm_ndomains, > + ("invalid preferred domain in domains %p", domain)); > + > mtx_lock_spin(&cpuset_lock); > LIST_FOREACH(ndomain, &cpuset_domains, ds_link) > if (domainset_equal(ndomain, domain)) > > Modified: head/sys/vm/vm_phys.c > ============================================================================== > --- head/sys/vm/vm_phys.c Mon Oct 22 20:00:43 2018 (r339615) > +++ head/sys/vm/vm_phys.c Mon Oct 22 20:13:51 2018 (r339616) > @@ -597,11 +597,22 @@ vm_phys_register_domains(int ndomains, struct mem_affi > int *locality) > { > #ifdef NUMA > - int i; > + int d, i; > > - vm_ndomains = ndomains; > - mem_affinity = affinity; > - mem_locality = locality; > + /* > + * For now the only override value that we support is 1, which > + * effectively disables NUMA-awareness in the allocators. > + */ > + d = 0; > + TUNABLE_INT_FETCH("vm.numa.disabled", &d); > + if (d) > + ndomains = 1; > + > + if (ndomains > 1) { > + vm_ndomains = ndomains; > + mem_affinity = affinity; > + mem_locality = locality; > + } > > for (i = 0; i < vm_ndomains; i++) > DOMAINSET_SET(i, &all_domains); > > Modified: head/sys/x86/acpica/srat.c > ============================================================================== > --- head/sys/x86/acpica/srat.c Mon Oct 22 20:00:43 2018 (r339615) > +++ head/sys/x86/acpica/srat.c Mon Oct 22 20:13:51 2018 (r339616) > @@ -535,11 +535,7 @@ srat_set_cpus(void *dummy) > if (!cpu->enabled) > panic("SRAT: CPU with APIC ID %u is not known", > pc->pc_apic_id); > -#ifdef NUMA > - pc->pc_domain = cpu->domain; > -#else > - pc->pc_domain = 0; > -#endif > + pc->pc_domain = vm_ndomains > 1 ? cpu->domain : 0; > CPU_SET(i, &cpuset_domain[pc->pc_domain]); > if (bootverbose) > printf("SRAT: CPU %u has memory domain %d\n", i, > @@ -564,7 +560,7 @@ acpi_map_pxm_to_vm_domainid(int pxm) > > for (i = 0; i < ndomain; i++) { > if (domain_pxm[i] == pxm) > - return (i); > + return (vm_ndomains > 1 ? i : 0); > } > > return (-1); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 20:55:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E3FFD6283; Mon, 22 Oct 2018 20:55:36 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD3A73488; Mon, 22 Oct 2018 20:55:36 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 359F825972; Mon, 22 Oct 2018 20:55:36 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MKtZon013628; Mon, 22 Oct 2018 20:55:35 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MKtZPt013627; Mon, 22 Oct 2018 20:55:35 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201810222055.w9MKtZPt013627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Mon, 22 Oct 2018 20:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339618 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, 22 Oct 2018 20:55:36 -0000 Author: tijl Date: Mon Oct 22 20:55:35 2018 New Revision: 339618 URL: https://svnweb.freebsd.org/changeset/base/339618 Log: Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod. Currently the compiler picks up the definition in machine/cpufunc.h. Add compiler memory barriers to read* and write*. The Linux x86 implementation of these functions uses inline asm with "memory" clobber. The Linux x86 implementation of read_relaxed* and write_relaxed* uses the same inline asm without "memory" clobber. Implement ioread* and iowrite* in terms of read* and write* so they also have memory barriers. Qualify the addr parameter in write* as volatile. Like Linux, define macros with the same name as the inline functions. Only define 64-bit versions on 64-bit architectures because generally 32-bit architectures can't do atomic 64-bit loads and stores. Regroup the functions a bit and add brief comments explaining what they do: - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian - read*, write*: atomic, with barriers, little-endian Add a comment that says our implementation of ioread* and iowrite* only handles MMIO and does not support port IO. Reviewed by: hselasky MFC after: 3 days Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 20:22:33 2018 (r339617) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 20:55:35 2018 (r339618) @@ -38,153 +38,309 @@ #include #include +/* + * XXX This is all x86 specific. It should be bus space access. + */ + +/* Access MMIO registers atomically without barriers and byte swapping. */ + +static inline uint8_t +__raw_readb(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define __raw_readb(addr) __raw_readb(addr) + +static inline void +__raw_writeb(uint8_t v, volatile void *addr) +{ + *(volatile uint8_t *)addr = v; +} +#define __raw_writeb(v, addr) __raw_writeb(v, addr) + +static inline uint16_t +__raw_readw(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define __raw_readw(addr) __raw_readw(addr) + +static inline void +__raw_writew(uint16_t v, volatile void *addr) +{ + *(volatile uint16_t *)addr = v; +} +#define __raw_writew(v, addr) __raw_writew(v, addr) + static inline uint32_t __raw_readl(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (*(const volatile uint32_t *)addr); } +#define __raw_readl(addr) __raw_readl(addr) static inline void -__raw_writel(uint32_t b, volatile void *addr) +__raw_writel(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + *(volatile uint32_t *)addr = v; } +#define __raw_writel(v, addr) __raw_writel(v, addr) +#ifdef __LP64__ static inline uint64_t __raw_readq(const volatile void *addr) { - return *(const volatile uint64_t *)addr; + return (*(const volatile uint64_t *)addr); } +#define __raw_readq(addr) __raw_readq(addr) static inline void -__raw_writeq(uint64_t b, volatile void *addr) +__raw_writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + *(volatile uint64_t *)addr = v; } +#define __raw_writeq(v, addr) __raw_writeq(v, addr) +#endif -/* - * XXX This is all x86 specific. It should be bus space access. - */ #define mmiowb() barrier() -#undef writel +/* Access little-endian MMIO registers atomically with memory barriers. */ + +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + uint8_t v; + + __compiler_membar(); + v = *(const volatile uint8_t *)addr; + __compiler_membar(); + return (v); +} +#define readb(addr) readb(addr) + +#undef writeb static inline void -writel(uint32_t b, void *addr) +writeb(uint8_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint8_t *)addr = v; + __compiler_membar(); } +#define writeb(v, addr) writeb(v, addr) -#undef writel_relaxed +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + uint16_t v; + + __compiler_membar(); + v = *(const volatile uint16_t *)addr; + __compiler_membar(); + return (v); +} +#define readw(addr) readw(addr) + +#undef writew static inline void -writel_relaxed(uint32_t b, void *addr) +writew(uint16_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint16_t *)addr = v; + __compiler_membar(); } +#define writew(v, addr) writew(v, addr) +#undef readl +static inline uint32_t +readl(const volatile void *addr) +{ + uint32_t v; + + __compiler_membar(); + v = *(const volatile uint32_t *)addr; + __compiler_membar(); + return (v); +} +#define readl(addr) readl(addr) + +#undef writel +static inline void +writel(uint32_t v, volatile void *addr) +{ + __compiler_membar(); + *(volatile uint32_t *)addr = v; + __compiler_membar(); +} +#define writel(v, addr) writel(v, addr) + +#undef readq #undef writeq +#ifdef __LP64__ +static inline uint64_t +readq(const volatile void *addr) +{ + uint64_t v; + + __compiler_membar(); + v = *(const volatile uint64_t *)addr; + __compiler_membar(); + return (v); +} +#define readq(addr) readq(addr) + static inline void -writeq(uint64_t b, void *addr) +writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + __compiler_membar(); + *(volatile uint64_t *)addr = v; + __compiler_membar(); } +#define writeq(v, addr) writeq(v, addr) +#endif -#undef writeb +/* Access little-endian MMIO registers atomically without memory barriers. */ + +#undef readb_relaxed +static inline uint8_t +readb_relaxed(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define readb_relaxed(addr) readb_relaxed(addr) + +#undef writeb_relaxed static inline void -writeb(uint8_t b, void *addr) +writeb_relaxed(uint8_t v, volatile void *addr) { - *(volatile uint8_t *)addr = b; + *(volatile uint8_t *)addr = v; } +#define writeb_relaxed(v, addr) writeb_relaxed(v, addr) -#undef writew +#undef readw_relaxed +static inline uint16_t +readw_relaxed(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define readw_relaxed(addr) readw_relaxed(addr) + +#undef writew_relaxed static inline void -writew(uint16_t b, void *addr) +writew_relaxed(uint16_t v, volatile void *addr) { - *(volatile uint16_t *)addr = b; + *(volatile uint16_t *)addr = v; } +#define writew_relaxed(v, addr) writew_relaxed(v, addr) +#undef readl_relaxed +static inline uint32_t +readl_relaxed(const volatile void *addr) +{ + return (*(const volatile uint32_t *)addr); +} +#define readl_relaxed(addr) readl_relaxed(addr) + +#undef writel_relaxed +static inline void +writel_relaxed(uint32_t v, volatile void *addr) +{ + *(volatile uint32_t *)addr = v; +} +#define writel_relaxed(v, addr) writel_relaxed(v, addr) + +#undef readq_relaxed +#undef writeq_relaxed +#ifdef __LP64__ +static inline uint64_t +readq_relaxed(const volatile void *addr) +{ + return (*(const volatile uint64_t *)addr); +} +#define readq_relaxed(addr) readq_relaxed(addr) + +static inline void +writeq_relaxed(uint64_t v, volatile void *addr) +{ + *(volatile uint64_t *)addr = v; +} +#define writeq_relaxed(v, addr) writeq_relaxed(v, addr) +#endif + +/* XXX On Linux ioread and iowrite handle both MMIO and port IO. */ + #undef ioread8 static inline uint8_t ioread8(const volatile void *addr) { - return *(const volatile uint8_t *)addr; + return (readb(addr)); } +#define ioread8(addr) ioread8(addr) #undef ioread16 static inline uint16_t ioread16(const volatile void *addr) { - return *(const volatile uint16_t *)addr; + return (readw(addr)); } +#define ioread16(addr) ioread16(addr) #undef ioread16be static inline uint16_t ioread16be(const volatile void *addr) { - return be16toh(*(const volatile uint16_t *)addr); + return (bswap16(readw(addr))); } +#define ioread16be(addr) ioread16be(addr) #undef ioread32 static inline uint32_t ioread32(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (readl(addr)); } +#define ioread32(addr) ioread32(addr) #undef ioread32be static inline uint32_t ioread32be(const volatile void *addr) { - return be32toh(*(const volatile uint32_t *)addr); + return (bswap32(readl(addr))); } +#define ioread32be(addr) ioread32be(addr) #undef iowrite8 static inline void iowrite8(uint8_t v, volatile void *addr) { - *(volatile uint8_t *)addr = v; + writeb(v, addr); } +#define iowrite8(v, addr) iowrite8(v, addr) #undef iowrite16 static inline void iowrite16(uint16_t v, volatile void *addr) { - *(volatile uint16_t *)addr = v; + writew(v, addr); } +#define iowrite16 iowrite16 #undef iowrite32 static inline void iowrite32(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = v; + writel(v, addr); } +#define iowrite32(v, addr) iowrite32(v, addr) #undef iowrite32be static inline void iowrite32be(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = htobe32(v); + writel(bswap32(v), addr); } - -#undef readb -static inline uint8_t -readb(const volatile void *addr) -{ - return *(const volatile uint8_t *)addr; -} - -#undef readw -static inline uint16_t -readw(const volatile void *addr) -{ - return *(const volatile uint16_t *)addr; -} - -#undef readl -static inline uint32_t -readl(const volatile void *addr) -{ - return *(const volatile uint32_t *)addr; -} +#define iowrite32be(v, addr) iowrite32be(v, addr) #if defined(__i386__) || defined(__amd64__) static inline void From owner-svn-src-head@freebsd.org Mon Oct 22 21:17:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AF7AFD6F83; Mon, 22 Oct 2018 21:17:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4BC674466; Mon, 22 Oct 2018 21:17:36 +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 BF25525CA6; Mon, 22 Oct 2018 21:17:36 +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 w9MLHapa024098; Mon, 22 Oct 2018 21:17:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MLHaCn024096; Mon, 22 Oct 2018 21:17:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810222117.w9MLHaCn024096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Oct 2018 21:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339619 - in head/sys: netinet sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: netinet sys X-SVN-Commit-Revision: 339619 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, 22 Oct 2018 21:17:37 -0000 Author: jhb Date: Mon Oct 22 21:17:36 2018 New Revision: 339619 URL: https://svnweb.freebsd.org/changeset/base/339619 Log: A couple of style fixes in recent TCP changes. - Add a blank line before a block comment to match other block comments in the same function. - Sort the prototype for sbsndptr_adv and fix whitespace between return type and function name. Reviewed by: gallatin, bz Differential Revision: https://reviews.freebsd.org/D17474 Modified: head/sys/netinet/tcp_output.c head/sys/sys/sockbuf.h Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Oct 22 20:55:35 2018 (r339618) +++ head/sys/netinet/tcp_output.c Mon Oct 22 21:17:36 2018 (r339619) @@ -895,6 +895,7 @@ send: len = max_len; } } + /* * Prevent the last segment from being * fractional unless the send sockbuf can be Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Mon Oct 22 20:55:35 2018 (r339618) +++ head/sys/sys/sockbuf.h Mon Oct 22 21:17:36 2018 (r339619) @@ -165,10 +165,9 @@ int sbreserve_locked(struct sockbuf *sb, u_long cc, st struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +void sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len); struct mbuf * sbsndptr_noadv(struct sockbuf *sb, u_int off, u_int *moff); -void - sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len); struct mbuf * sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); int sbwait(struct sockbuf *sb); From owner-svn-src-head@freebsd.org Mon Oct 22 21:25:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B403BFD74E7; Mon, 22 Oct 2018 21:25:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A07474CB5; Mon, 22 Oct 2018 21:25:29 +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 4C56A25E7E; Mon, 22 Oct 2018 21:25:29 +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 w9MLPT1p029048; Mon, 22 Oct 2018 21:25:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MLPSUc029046; Mon, 22 Oct 2018 21:25:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810222125.w9MLPSUc029046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Oct 2018 21:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339620 - head/usr.bin/ktrdump X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/ktrdump X-SVN-Commit-Revision: 339620 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, 22 Oct 2018 21:25:29 -0000 Author: jhb Date: Mon Oct 22 21:25:28 2018 New Revision: 339620 URL: https://svnweb.freebsd.org/changeset/base/339620 Log: Add a "live" mode to ktrdump. Support a "live" mode in ktrdump enabled via the -l flag. In this mode, ktrdump polls the kernel's trace buffer periodically (currently hardcoded as a 50 millisecond interval) and dumps any newly added entries. Fancier logic for the timeout (e.g. a command line option or some kind of backoff based on the time since the last entry) can be added later as the need arises. While here, fix some bugs from when this was Capsicum-ized: - Use caph_limit_stream() for the output stream so that isatty() works and the output can be line-buffered (especially useful for live mode). - Use caph_limit_stderr() to permit error messages to be displayed if an error occurs after cap_enter(). Reviewed by: kib, 0mp (manpage) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D17315 Modified: head/usr.bin/ktrdump/ktrdump.8 head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.8 ============================================================================== --- head/usr.bin/ktrdump/ktrdump.8 Mon Oct 22 21:17:36 2018 (r339619) +++ head/usr.bin/ktrdump/ktrdump.8 Mon Oct 22 21:25:28 2018 (r339620) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2015 +.Dd October 22, 2018 .Dt KTRDUMP 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print kernel ktr trace buffer .Sh SYNOPSIS .Nm -.Op Fl cfqrtH +.Op Fl cflqrtH .Op Fl i Ar ktrfile .Op Fl M Ar core .Op Fl N Ar system @@ -47,6 +47,9 @@ The following options are available: .Bl -tag -width ".Fl i Ar ktrfile" .It Fl c Print the CPU number that each entry was logged from. +.It Fl l +Poll the kernel ktr trace buffer periodically dumping any new events after +each poll. .It Fl f Print the file and line number that each entry was logged from. .It Fl q Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Mon Oct 22 21:17:36 2018 (r339619) +++ head/usr.bin/ktrdump/ktrdump.c Mon Oct 22 21:25:28 2018 (r339620) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define SBUFLEN 128 #define USAGE \ - "usage: ktrdump [-cfqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" + "usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" static void usage(void); @@ -65,6 +65,7 @@ static struct nlist nl[] = { static int cflag; static int fflag; +static int lflag; static int Mflag; static int Nflag; static int qflag; @@ -111,7 +112,7 @@ main(int ac, char **av) * Parse commandline arguments. */ out = stdout; - while ((c = getopt(ac, av, "cfqrtHe:i:m:M:N:o:")) != -1) + while ((c = getopt(ac, av, "cflqrtHe:i:m:M:N:o:")) != -1) switch (c) { case 'c': cflag = 1; @@ -136,6 +137,9 @@ main(int ac, char **av) err(1, "unable to limit rights for %s", optarg); break; + case 'l': + lflag = 1; + break; case 'M': case 'm': if (strlcpy(corefile, optarg, sizeof(corefile)) @@ -169,9 +173,10 @@ main(int ac, char **av) if (ac != 0) usage(); - cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE); - if (cap_rights_limit(fileno(out), &rights) < 0 && errno != ENOSYS) + if (caph_limit_stream(fileno(out), CAPH_WRITE) < 0) err(1, "unable to limit rights for %s", outfile); + if (caph_limit_stderr() < 0) + err(1, "unable to limit rights for stderr"); /* * Open our execfile and corefile, resolve needed symbols and read in @@ -258,15 +263,29 @@ main(int ac, char **av) fprintf(out, "\n"); } + tlast = -1; /* * Now tear through the trace buffer. + * + * In "live" mode, find the oldest entry (first non-NULL entry + * after index2) and walk forward. Otherwise, start with the + * most recent entry and walk backwards. */ if (!iflag) { - i = index - 1; - if (i < 0) - i = entries - 1; + if (lflag) { + i = index2 + 1 % entries; + while (buf[i].ktr_desc == NULL && i != index) { + i++; + if (i == entries) + i = 0; + } + } else { + i = index - 1; + if (i < 0) + i = entries - 1; + } } - tlast = -1; +dump_entries: for (;;) { if (buf[i].ktr_desc == NULL) break; @@ -338,14 +357,40 @@ next: if ((c = *p++) == '\0') * 'index2' were in flux while the KTR buffer was * being copied to userspace we don't dump them. */ - if (i == index2) - break; - if (--i < 0) - i = entries - 1; + if (lflag) { + if (++i == entries) + i = 0; + if (i == index) + break; + } else { + if (i == index2) + break; + if (--i < 0) + i = entries - 1; + } } else { if (++i == entries) break; } + } + + /* + * In "live" mode, poll 'ktr_idx' periodically and dump any + * new entries since our last pass through the ring. + */ + if (lflag && !iflag) { + while (index == index2) { + usleep(50 * 1000); + if (kvm_read(kd, nl[2].n_value, &index2, + sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + } + i = index; + index = index2; + if (kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 || + kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + goto dump_entries; } return (0); From owner-svn-src-head@freebsd.org Mon Oct 22 21:50:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63F65FD85F9; Mon, 22 Oct 2018 21:50:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14B9D75FEC; Mon, 22 Oct 2018 21:50:44 +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 0FC9926201; Mon, 22 Oct 2018 21:50:44 +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 w9MLohRa042339; Mon, 22 Oct 2018 21:50:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MLohu4042246; Mon, 22 Oct 2018 21:50:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810222150.w9MLohu4042246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Oct 2018 21:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339622 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 339622 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, 22 Oct 2018 21:50:44 -0000 Author: brooks Date: Mon Oct 22 21:50:43 2018 New Revision: 339622 URL: https://svnweb.freebsd.org/changeset/base/339622 Log: Remove __restrict qualifiers from syscalls.master. The restruct qualifier is intended to aid code generation in the compiler, but the only access to storage through these pointers is via structs using copyin/copyout and the like which can not be written in C or C++ and thus the compiler gains nothing from the qualifiers. As such, the qualifiers add no value in current usage. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17574 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Oct 22 21:26:37 2018 (r339621) +++ head/sys/compat/freebsd32/syscalls.master Mon Oct 22 21:50:43 2018 (r339622) @@ -1051,8 +1051,8 @@ 540 AUE_CHFLAGSAT NOPROTO { int chflagsat(int fd, const char *path, \ u_long flags, int atflag); } 541 AUE_ACCEPT NOPROTO { int accept4(int s, \ - struct sockaddr * __restrict name, \ - __socklen_t * __restrict anamelen, \ + struct sockaddr *name, \ + __socklen_t *anamelen, \ int flags); } 542 AUE_PIPE NOPROTO { int pipe2(int *fildes, int flags); } 543 AUE_AIO_MLOCK STD { int freebsd32_aio_mlock( \ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Oct 22 21:26:37 2018 (r339621) +++ head/sys/kern/syscalls.master Mon Oct 22 21:50:43 2018 (r339622) @@ -144,23 +144,23 @@ _Out_writes_bytes_(len) caddr_t buf, \ size_t len, int flags, \ _Out_writes_bytes_opt_(*fromlenaddr) \ - struct sockaddr * __restrict from, \ + struct sockaddr *from, \ _Inout_opt_ \ - __socklen_t * __restrict fromlenaddr); } + __socklen_t *fromlenaddr); } 30 AUE_ACCEPT STD { int accept(int s, \ _Out_writes_bytes_opt_(*anamelen) \ - struct sockaddr * __restrict name, \ + struct sockaddr *name, \ _Inout_opt_ \ - __socklen_t * __restrict anamelen); } + __socklen_t *anamelen); } 31 AUE_GETPEERNAME STD { int getpeername(int fdes, \ _Out_writes_bytes_(*alen) \ - struct sockaddr * __restrict asa, \ + struct sockaddr *asa, \ _Inout_opt_ \ - __socklen_t * __restrict alen); } + __socklen_t *alen); } 32 AUE_GETSOCKNAME STD { int getsockname(int fdes, \ _Out_writes_bytes_(*alen) \ - struct sockaddr * __restrict asa, \ - _Inout_ __socklen_t * __restrict alen); } + struct sockaddr *asa, \ + _Inout_ __socklen_t *alen); } 33 AUE_ACCESS STD { int access(_In_z_ char *path, int amode); } 34 AUE_CHFLAGS STD { int chflags(_In_z_ const char *path, \ u_long flags); } @@ -1273,9 +1273,9 @@ u_long flags, int atflag); } 541 AUE_ACCEPT STD { int accept4(int s, \ _Out_writes_bytes_opt_(*anamelen) \ - struct sockaddr * __restrict name, \ + struct sockaddr *name, \ _Inout_opt_ \ - __socklen_t * __restrict anamelen, \ + __socklen_t *anamelen, \ int flags); } 542 AUE_PIPE STD { int pipe2(_Out_writes_(2) int *fildes, \ int flags); } From owner-svn-src-head@freebsd.org Mon Oct 22 21:52:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A29F2FD8707; Mon, 22 Oct 2018 21:52:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59AFD762A8; Mon, 22 Oct 2018 21:52:00 +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 54B992637C; Mon, 22 Oct 2018 21:52:00 +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 w9MLq0VN044661; Mon, 22 Oct 2018 21:52:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MLq0Em044660; Mon, 22 Oct 2018 21:52:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810222152.w9MLq0Em044660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Oct 2018 21:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339623 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339623 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, 22 Oct 2018 21:52:00 -0000 Author: brooks Date: Mon Oct 22 21:51:59 2018 New Revision: 339623 URL: https://svnweb.freebsd.org/changeset/base/339623 Log: Regen after r339622. Note: changes to freebsd32 syscalls.master impacted no generated files. Modified: head/sys/sys/sysproto.h Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Oct 22 21:50:43 2018 (r339622) +++ head/sys/sys/sysproto.h Mon Oct 22 21:51:59 2018 (r339623) @@ -135,23 +135,23 @@ struct recvfrom_args { char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char from_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict from; char from_r_[PADR_(struct sockaddr *__restrict)]; - char fromlenaddr_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict fromlenaddr; char fromlenaddr_r_[PADR_(__socklen_t *__restrict)]; + char from_l_[PADL_(struct sockaddr *)]; struct sockaddr * from; char from_r_[PADR_(struct sockaddr *)]; + char fromlenaddr_l_[PADL_(__socklen_t *)]; __socklen_t * fromlenaddr; char fromlenaddr_r_[PADR_(__socklen_t *)]; }; struct accept_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char name_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict name; char name_r_[PADR_(struct sockaddr *__restrict)]; - char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)]; + char name_l_[PADL_(struct sockaddr *)]; struct sockaddr * name; char name_r_[PADR_(struct sockaddr *)]; + char anamelen_l_[PADL_(__socklen_t *)]; __socklen_t * anamelen; char anamelen_r_[PADR_(__socklen_t *)]; }; struct getpeername_args { char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)]; - char asa_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict asa; char asa_r_[PADR_(struct sockaddr *__restrict)]; - char alen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict alen; char alen_r_[PADR_(__socklen_t *__restrict)]; + char asa_l_[PADL_(struct sockaddr *)]; struct sockaddr * asa; char asa_r_[PADR_(struct sockaddr *)]; + char alen_l_[PADL_(__socklen_t *)]; __socklen_t * alen; char alen_r_[PADR_(__socklen_t *)]; }; struct getsockname_args { char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)]; - char asa_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict asa; char asa_r_[PADR_(struct sockaddr *__restrict)]; - char alen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict alen; char alen_r_[PADR_(__socklen_t *__restrict)]; + char asa_l_[PADL_(struct sockaddr *)]; struct sockaddr * asa; char asa_r_[PADR_(struct sockaddr *)]; + char alen_l_[PADL_(__socklen_t *)]; __socklen_t * alen; char alen_r_[PADR_(__socklen_t *)]; }; struct access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -1662,8 +1662,8 @@ struct chflagsat_args { }; struct accept4_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char name_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict name; char name_r_[PADR_(struct sockaddr *__restrict)]; - char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)]; + char name_l_[PADL_(struct sockaddr *)]; struct sockaddr * name; char name_r_[PADR_(struct sockaddr *)]; + char anamelen_l_[PADL_(__socklen_t *)]; __socklen_t * anamelen; char anamelen_r_[PADR_(__socklen_t *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct pipe2_args { From owner-svn-src-head@freebsd.org Mon Oct 22 22:13:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63FADFD925D; Mon, 22 Oct 2018 22:13:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14FAA77119; Mon, 22 Oct 2018 22:13:01 +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 0E327266D5; Mon, 22 Oct 2018 22:13:01 +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 w9MMD0rw054992; Mon, 22 Oct 2018 22:13:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MMD0P2054991; Mon, 22 Oct 2018 22:13:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810222213.w9MMD0P2054991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Oct 2018 22:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339624 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339624 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, 22 Oct 2018 22:13:01 -0000 Author: brooks Date: Mon Oct 22 22:13:00 2018 New Revision: 339624 URL: https://svnweb.freebsd.org/changeset/base/339624 Log: Remove the need for backslashes in syscalls.master. Join non-special lines together until we hit a line containing a '}' character. This allows the function declaration body to be split across multiple lines without backslash continuation characters. Continue to join lines ending with backslashes to allow gradual migration and to support out-of-tree syscall vectors Reviewed by: emaste, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17488 Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Oct 22 21:51:59 2018 (r339623) +++ head/sys/kern/makesyscalls.sh Mon Oct 22 22:13:00 2018 (r339624) @@ -68,13 +68,33 @@ if [ -n "$2" ]; then fi sed -e ' -:join + # FreeBSD ID, includes, comments, and blank lines + /.*\$FreeBSD/b done_joining + /^[#;]/b done_joining + /^$/b done_joining + + # Join lines ending in backslash +:joining /\\$/{a\ N s/\\\n// - b join + b joining } + + # OBSOL, etc lines without function signatures + /^[0-9][^{]*$/b done_joining + + # Join incomplete signatures. The { must appear on the first line + # and the } must appear on the last line (modulo lines joined by + # backslashes). + /^[^}]*$/{a\ + + N + s/\n// + b joining + } +:done_joining 2,${ /^#/!s/\([{}()*,]\)/ \1 /g } From owner-svn-src-head@freebsd.org Mon Oct 22 22:24:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0764FD960C; Mon, 22 Oct 2018 22:24:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E91F77678; Mon, 22 Oct 2018 22:24:34 +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 795FE2688E; Mon, 22 Oct 2018 22:24:34 +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 w9MMOYKi060171; Mon, 22 Oct 2018 22:24:34 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MMOWtJ060163; Mon, 22 Oct 2018 22:24:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810222224.w9MMOWtJ060163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Oct 2018 22:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339625 - in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: arm/include arm64/include mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Commit-Revision: 339625 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, 22 Oct 2018 22:24:35 -0000 Author: brooks Date: Mon Oct 22 22:24:32 2018 New Revision: 339625 URL: https://svnweb.freebsd.org/changeset/base/339625 Log: Consolidate identical ELF auxargs type defintions. All platforms except powerpc use the same values and powerpc shares a majority of them. Go ahead and declare AT_NOTELF, AT_UID, and AT_EUID in favor of the unused AT_DCACHEBSIZE, AT_ICACHEBSIZE, and AT_UCACHEBSIZE for powerpc. Reviewed by: jhb, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17397 Modified: head/sys/arm/include/elf.h head/sys/arm64/include/elf.h head/sys/mips/include/elf.h head/sys/powerpc/include/elf.h head/sys/riscv/include/elf.h head/sys/sparc64/include/elf.h head/sys/sys/elf_common.h head/sys/x86/include/elf.h Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/arm/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -61,39 +61,7 @@ __ElfType(Auxinfo); * Relocation types. */ -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - #define R_ARM_COUNT 33 /* Count of defined relocation types. */ - /* Define "machine" characteristics */ #define ELF_TARG_CLASS ELFCLASS32 Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/arm64/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -68,37 +68,6 @@ __ElfType(Auxinfo); #define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH)) -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 64 #define ELF_TARG_CLASS ELFCLASS64 Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/mips/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -121,37 +121,6 @@ typedef struct { /* Auxiliary vector entry on initial __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - #define ET_DYN_LOAD_ADDR 0x0120000 /* Modified: head/sys/powerpc/include/elf.h ============================================================================== --- head/sys/powerpc/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/powerpc/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -90,35 +90,6 @@ typedef struct { /* Auxiliary vector entry on initial __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for PowerPC). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_DCACHEBSIZE 10 /* Data cache block size for the processor. */ -#define AT_ICACHEBSIZE 11 /* Instruction cache block size for the uP. */ -#define AT_UCACHEBSIZE 12 /* Cache block size, or `0' if cache not unified. */ -#define AT_EXECPATH 13 /* Path to the executable. */ -#define AT_CANARY 14 /* Canary for SSP */ -#define AT_CANARYLEN 15 /* Length of the canary. */ -#define AT_OSRELDATE 16 /* OSRELDATE. */ -#define AT_NCPUS 17 /* Number of CPUs. */ -#define AT_PAGESIZES 18 /* Pagesizes. */ -#define AT_PAGESIZESLEN 19 /* Number of pagesizes. */ -#define AT_STACKPROT 21 /* Initial stack protection. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* * Relocation types. */ Modified: head/sys/riscv/include/elf.h ============================================================================== --- head/sys/riscv/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/riscv/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -65,37 +65,6 @@ __ElfType(Auxinfo); #define ELF_MACHINE_OK(x) ((x) == (ELF_ARCH)) -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* Define "machine" characteristics */ #define ELF_TARG_CLASS ELFCLASS64 #define ELF_TARG_DATA ELFDATA2LSB Modified: head/sys/sparc64/include/elf.h ============================================================================== --- head/sys/sparc64/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/sparc64/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -69,37 +69,6 @@ typedef struct { /* Auxiliary vector entry on initial __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 #define ELF_TARG_CLASS ELFCLASS32 Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/sys/elf_common.h Mon Oct 22 22:24:32 2018 (r339625) @@ -880,6 +880,50 @@ typedef struct { #define ELFCOMPRESS_LOPROC 0x70000000 /* Processor-specific */ #define ELFCOMPRESS_HIPROC 0x7fffffff +/* Values for a_type. */ +#define AT_NULL 0 /* Terminates the vector. */ +#define AT_IGNORE 1 /* Ignored entry. */ +#define AT_EXECFD 2 /* File descriptor of program to load. */ +#define AT_PHDR 3 /* Program header of program already loaded. */ +#define AT_PHENT 4 /* Size of each program header entry. */ +#define AT_PHNUM 5 /* Number of program header entries. */ +#define AT_PAGESZ 6 /* Page size in bytes. */ +#define AT_BASE 7 /* Interpreter's base address. */ +#define AT_FLAGS 8 /* Flags. */ +#define AT_ENTRY 9 /* Where interpreter should transfer control. */ +#define AT_NOTELF 10 /* Program is not ELF ?? */ +#define AT_UID 11 /* Real uid. */ +#define AT_EUID 12 /* Effective uid. */ +#ifndef __powerpc__ +#define AT_GID 13 /* Real gid. */ +#define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP. */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ +#else /* defined(__powerpc__) */ +#define AT_EXECPATH 13 +#define AT_CANARY 14 +#define AT_CANARYLEN 15 +#define AT_OSRELDATE 16 +#define AT_NCPUS 17 +#define AT_PAGESIZES 18 +#define AT_PAGESIZESLEN 19 +#define AT_STACKPROT 21 +#endif /* defined(__powerpc__) */ +#define AT_TIMEKEEP 22 /* Pointer to timehands. */ +#ifndef __powerpc__ +#define AT_STACKPROT 23 /* Initial stack protection. */ +#endif +#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ +#define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ + +#define AT_COUNT 27 /* Count of defined aux entry types. */ + /* * Relocation types. * Modified: head/sys/x86/include/elf.h ============================================================================== --- head/sys/x86/include/elf.h Mon Oct 22 22:13:00 2018 (r339624) +++ head/sys/x86/include/elf.h Mon Oct 22 22:24:32 2018 (r339625) @@ -77,37 +77,6 @@ typedef struct { __ElfType(Auxinfo); -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP. */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ - /* * Relocation types. */ @@ -164,37 +133,6 @@ typedef struct { /* Auxiliary vector entry on initial } Elf64_Auxinfo; __ElfType(Auxinfo); - -/* Values for a_type. */ -#define AT_NULL 0 /* Terminates the vector. */ -#define AT_IGNORE 1 /* Ignored entry. */ -#define AT_EXECFD 2 /* File descriptor of program to load. */ -#define AT_PHDR 3 /* Program header of program already loaded. */ -#define AT_PHENT 4 /* Size of each program header entry. */ -#define AT_PHNUM 5 /* Number of program header entries. */ -#define AT_PAGESZ 6 /* Page size in bytes. */ -#define AT_BASE 7 /* Interpreter's base address. */ -#define AT_FLAGS 8 /* Flags (unused for i386). */ -#define AT_ENTRY 9 /* Where interpreter should transfer control. */ -#define AT_NOTELF 10 /* Program is not ELF ?? */ -#define AT_UID 11 /* Real uid. */ -#define AT_EUID 12 /* Effective uid. */ -#define AT_GID 13 /* Real gid. */ -#define AT_EGID 14 /* Effective gid. */ -#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_CANARY 16 /* Canary for SSP */ -#define AT_CANARYLEN 17 /* Length of the canary. */ -#define AT_OSRELDATE 18 /* OSRELDATE. */ -#define AT_NCPUS 19 /* Number of CPUs. */ -#define AT_PAGESIZES 20 /* Pagesizes. */ -#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_TIMEKEEP 22 /* Pointer to timehands. */ -#define AT_STACKPROT 23 /* Initial stack protection. */ -#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ -#define AT_HWCAP 25 /* CPU feature flags. */ -#define AT_HWCAP2 26 /* CPU feature flags 2. */ - -#define AT_COUNT 27 /* Count of defined aux entry types. */ /* * Relocation types. From owner-svn-src-head@freebsd.org Mon Oct 22 23:02:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F173FE8164; Mon, 22 Oct 2018 23:02:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5548B78611; Mon, 22 Oct 2018 23:02:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id C96E910AFD2; Mon, 22 Oct 2018 19:02:23 -0400 (EDT) Subject: Re: svn commit: r339617 - head/sys/contrib/zstd To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810222022.w9MKMXln096579@repo.freebsd.org> From: John Baldwin Message-ID: Date: Mon, 22 Oct 2018 16:02:22 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201810222022.w9MKMXln096579@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 22 Oct 2018 19:02:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean 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, 22 Oct 2018 23:02:25 -0000 On 10/22/18 1:22 PM, Conrad Meyer wrote: > Author: cem > Date: Mon Oct 22 20:22:33 2018 > New Revision: 339617 > URL: https://svnweb.freebsd.org/changeset/base/339617 > > Log: > Retroactively vendor 1.3.3, 1.3.4, and 1.3.7 imports > > "svn merge --record-only svn+ssh://repo.freebsd.org/base/vendor/zstd/dist" > > Reported by: jhb, markj > Sponsored by: Dell EMC Isilon Thanks! -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 22 23:06:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADF60FE8291; Mon, 22 Oct 2018 23:06:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63CA2787FB; Mon, 22 Oct 2018 23:06:24 +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 5E6C726F0B; Mon, 22 Oct 2018 23:06:24 +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 w9MN6OvM080383; Mon, 22 Oct 2018 23:06:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MN6Oiu080382; Mon, 22 Oct 2018 23:06:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810222306.w9MN6Oiu080382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 22 Oct 2018 23:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339626 - 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: 339626 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, 22 Oct 2018 23:06:24 -0000 Author: np Date: Mon Oct 22 23:06:23 2018 New Revision: 339626 URL: https://svnweb.freebsd.org/changeset/base/339626 Log: cxgbe(4): Use automatic cidx updates with ofld and ctrl queues. The bits that explicitly request cidx updates do not work reliably with all possible WRs that can be sent over the queue. The F_FW_WR_EQUIQ requests that still remain may also have to be replaced with explicit credit flush WRs in the future. MFC after: 2 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 22 22:24:32 2018 (r339625) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 22 23:06:23 2018 (r339626) @@ -2089,12 +2089,13 @@ drain_wrq_wr_list(struct adapter *sc, struct sge_wrq * if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { + /* + * XXX: This is not 100% reliable with some + * types of WRs. But this is a very unusual + * situation for an ofld/ctrl queue anyway. + */ dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; } dbdiff += n; @@ -2644,12 +2645,13 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { + /* + * XXX: This is not 100% reliable with some + * types of WRs. But this is a very unusual + * situation for an ofld/ctrl queue anyway. + */ dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | F_FW_WR_EQUEQ); - eq->equeqidx = pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = pidx; } ring_eq_db(wrq->adapter, eq, ndesc); @@ -3584,6 +3586,23 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_ } #endif +/* + * Returns a reasonable automatic cidx flush threshold for a given queue size. + */ +static u_int +qsize_to_fthresh(int qsize) +{ + u_int fthresh; + + while (!powerof2(qsize)) + qsize++; + fthresh = ilog2(qsize); + if (fthresh > X_CIDXFLUSHTHRESH_128) + fthresh = X_CIDXFLUSHTHRESH_128; + + return (fthresh); +} + static int ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) { @@ -3607,7 +3626,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | - V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); @@ -3689,12 +3708,13 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, c.alloc_to_len16 = htonl(F_FW_EQ_OFLD_CMD_ALLOC | F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c)); c.fetchszm_to_iqid = - htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_OFLD_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); @@ -3732,8 +3752,9 @@ alloc_eq(struct adapter *sc, struct vi_info *vi, struc if (rc) return (rc); - eq->pidx = eq->cidx = 0; - eq->equeqidx = eq->dbidx = 0; + eq->pidx = eq->cidx = eq->dbidx = 0; + /* Note that equeqidx is not used with sge_wrq (OFLD/CTRL) queues. */ + eq->equeqidx = 0; eq->doorbells = sc->doorbells; switch (eq->flags & EQ_TYPEMASK) { From owner-svn-src-head@freebsd.org Mon Oct 22 23:33:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6371DFE8DD6; Mon, 22 Oct 2018 23:33:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6007981D; Mon, 22 Oct 2018 23:33:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F37D2273EF; Mon, 22 Oct 2018 23:33:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MNXmiL095453; Mon, 22 Oct 2018 23:33:48 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MNXmVe095451; Mon, 22 Oct 2018 23:33:48 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810222333.w9MNXmVe095451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 22 Oct 2018 23:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339627 - head/sbin/pfctl/tests/files X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl/tests/files X-SVN-Commit-Revision: 339627 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, 22 Oct 2018 23:33:49 -0000 Author: kp Date: Mon Oct 22 23:33:48 2018 New Revision: 339627 URL: https://svnweb.freebsd.org/changeset/base/339627 Log: pf tests: Fix incorrect test for PR 231323 Fix r339466. The test result file did not list the rdr rule. Additionally, the route-to rule needs a redirection address. X-MFC-with: 339466 Modified: head/sbin/pfctl/tests/files/pf1005.in head/sbin/pfctl/tests/files/pf1005.ok Modified: head/sbin/pfctl/tests/files/pf1005.in ============================================================================== --- head/sbin/pfctl/tests/files/pf1005.in Mon Oct 22 23:06:23 2018 (r339626) +++ head/sbin/pfctl/tests/files/pf1005.in Mon Oct 22 23:33:48 2018 (r339627) @@ -1,3 +1,3 @@ rdr on em0 proto tcp from any to any -> 1.1.1.1 port 2121 -pass out log quick on lo0 route-to lo0 from any to any -pass in log quick on lo0 route-to (lo0 localhost) from any to any +pass out log quick on lo0 route-to (lo0 localhost) inet from any to any +pass in log quick on lo0 route-to (lo0 localhost) inet6 from any to any Modified: head/sbin/pfctl/tests/files/pf1005.ok ============================================================================== --- head/sbin/pfctl/tests/files/pf1005.ok Mon Oct 22 23:06:23 2018 (r339626) +++ head/sbin/pfctl/tests/files/pf1005.ok Mon Oct 22 23:33:48 2018 (r339627) @@ -1,2 +1,3 @@ -pass out log quick on lo0 route-to (lo0 ?) all flags S/SA keep state +rdr on em0 inet proto tcp all -> 1.1.1.1 port 2121 +pass out log quick on lo0 route-to (lo0 127.0.0.1) inet all flags S/SA keep state pass in log quick on lo0 route-to (lo0 ::1) inet6 all flags S/SA keep state From owner-svn-src-head@freebsd.org Mon Oct 22 23:36:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F254FE8E82; Mon, 22 Oct 2018 23:36:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 225B579988; Mon, 22 Oct 2018 23:36:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9MNa925014744; Mon, 22 Oct 2018 16:36:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9MNa9Zm014743; Mon, 22 Oct 2018 16:36:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810222336.w9MNa9Zm014743@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339626 - head/sys/dev/cxgbe In-Reply-To: <201810222306.w9MN6Oiu080382@repo.freebsd.org> To: Navdeep Parhar Date: Mon, 22 Oct 2018 16:36:09 -0700 (PDT) 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-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, 22 Oct 2018 23:36:13 -0000 > Author: np > Date: Mon Oct 22 23:06:23 2018 > New Revision: 339626 > URL: https://svnweb.freebsd.org/changeset/base/339626 > > Log: > cxgbe(4): Use automatic cidx updates with ofld and ctrl queues. > > The bits that explicitly request cidx updates do not work reliably with > all possible WRs that can be sent over the queue. The F_FW_WR_EQUIQ > requests that still remain may also have to be replaced with explicit > credit flush WRs in the future. > > MFC after: 2 days Please note in your RFA to re@ your reasons for requesting early merge to a frozen stable branch. I see good reason for this to be approved as it would be good to get this in the next snapshot, but it usually would be rejected if there is not a reason given. (There is a normal 3 day minimum on MFC after to a frozen branch) Thanks, Rod Sponsored by: Chelsio Communications > > Modified: > head/sys/dev/cxgbe/t4_sge.c > > Modified: head/sys/dev/cxgbe/t4_sge.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 22 22:24:32 2018 (r339625) > +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 22 23:06:23 2018 (r339626) > @@ -2089,12 +2089,13 @@ drain_wrq_wr_list(struct adapter *sc, struct sge_wrq * > > if (available < eq->sidx / 4 && > atomic_cmpset_int(&eq->equiq, 0, 1)) { > + /* > + * XXX: This is not 100% reliable with some > + * types of WRs. But this is a very unusual > + * situation for an ofld/ctrl queue anyway. > + */ > dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | > F_FW_WR_EQUEQ); > - eq->equeqidx = eq->pidx; > - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { > - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); > - eq->equeqidx = eq->pidx; > } > > dbdiff += n; > @@ -2644,12 +2645,13 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq > available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; > if (available < eq->sidx / 4 && > atomic_cmpset_int(&eq->equiq, 0, 1)) { > + /* > + * XXX: This is not 100% reliable with some > + * types of WRs. But this is a very unusual > + * situation for an ofld/ctrl queue anyway. > + */ > dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | > F_FW_WR_EQUEQ); > - eq->equeqidx = pidx; > - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { > - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); > - eq->equeqidx = pidx; > } > > ring_eq_db(wrq->adapter, eq, ndesc); > @@ -3584,6 +3586,23 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_ > } > #endif > > +/* > + * Returns a reasonable automatic cidx flush threshold for a given queue size. > + */ > +static u_int > +qsize_to_fthresh(int qsize) > +{ > + u_int fthresh; > + > + while (!powerof2(qsize)) > + qsize++; > + fthresh = ilog2(qsize); > + if (fthresh > X_CIDXFLUSHTHRESH_128) > + fthresh = X_CIDXFLUSHTHRESH_128; > + > + return (fthresh); > +} > + > static int > ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) > { > @@ -3607,7 +3626,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) > c.dcaen_to_eqsize = > htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | > V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | > - V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | > + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | > V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); > c.eqaddr = htobe64(eq->ba); > > @@ -3689,12 +3708,13 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, > c.alloc_to_len16 = htonl(F_FW_EQ_OFLD_CMD_ALLOC | > F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c)); > c.fetchszm_to_iqid = > - htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | > + htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | > V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) | > F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid)); > c.dcaen_to_eqsize = > htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) | > V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) | > + V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | > V_FW_EQ_OFLD_CMD_EQSIZE(qsize)); > c.eqaddr = htobe64(eq->ba); > > @@ -3732,8 +3752,9 @@ alloc_eq(struct adapter *sc, struct vi_info *vi, struc > if (rc) > return (rc); > > - eq->pidx = eq->cidx = 0; > - eq->equeqidx = eq->dbidx = 0; > + eq->pidx = eq->cidx = eq->dbidx = 0; > + /* Note that equeqidx is not used with sge_wrq (OFLD/CTRL) queues. */ > + eq->equeqidx = 0; > eq->doorbells = sc->doorbells; > > switch (eq->flags & EQ_TYPEMASK) { > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Oct 22 23:58:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB06AFE9B15; Mon, 22 Oct 2018 23:58:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8247D7A7C9; Mon, 22 Oct 2018 23:58:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D3CE27760; Mon, 22 Oct 2018 23:58:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MNw0aS006869; Mon, 22 Oct 2018 23:58:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MNw0Yq006867; Mon, 22 Oct 2018 23:58:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810222358.w9MNw0Yq006867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 22 Oct 2018 23:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339628 - 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: 339628 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, 22 Oct 2018 23:58:01 -0000 Author: np Date: Mon Oct 22 23:57:59 2018 New Revision: 339628 URL: https://svnweb.freebsd.org/changeset/base/339628 Log: cxgbe(4): improve the accuracy of various TSO limits reported to the kernel. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Oct 22 23:33:48 2018 (r339627) +++ head/sys/dev/cxgbe/adapter.h Mon Oct 22 23:57:59 2018 (r339628) @@ -113,6 +113,7 @@ enum { SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ TX_SGL_SEGS = 39, TX_SGL_SEGS_TSO = 38, + TX_SGL_SEGS_EO_TSO = 30, /* XXX: lower for IPv6. */ TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Oct 22 23:33:48 2018 (r339627) +++ head/sys/dev/cxgbe/t4_main.c Mon Oct 22 23:57:59 2018 (r339628) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #ifdef RSS #include #endif +#include +#include #if defined(__i386__) || defined(__amd64__) #include #include @@ -1535,9 +1537,13 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6; - ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); - ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS; - ifp->if_hw_tsomaxsegsize = 65536; + ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO; +#ifdef RATELIMIT + if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO; +#endif + ifp->if_hw_tsomaxsegsize = 0; ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP From owner-svn-src-head@freebsd.org Tue Oct 23 00:51:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF5FFEAE19; Tue, 23 Oct 2018 00:51:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48A6C7C165; Tue, 23 Oct 2018 00:51:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 172FD1D67B; Tue, 23 Oct 2018 00:51:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [169.254.84.164] (unknown [IPv6:2601:647:4780:2b90:81f2:183d:1ba5:9b61]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 7B4C015597; Tue, 23 Oct 2018 02:51:31 +0200 (CEST) From: "Kristof Provost" To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339554 - head/sys/net Date: Mon, 22 Oct 2018 17:51:28 -0700 X-Mailer: MailMate (2.0BETAr6123) Message-ID: <6FD6264C-06D6-40F4-8EED-B4B1AD950214@FreeBSD.org> In-Reply-To: <201810211824.w9LIOLuu094155@repo.freebsd.org> References: <201810211824.w9LIOLuu094155@repo.freebsd.org> MIME-Version: 1.0 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: Tue, 23 Oct 2018 00:51:35 -0000 On 21 Oct 2018, at 11:24, Andrey V. Elsukov wrote: > Author: ae > Date: Sun Oct 21 18:24:20 2018 > New Revision: 339554 > URL: https://svnweb.freebsd.org/changeset/base/339554 > > Log: > Rework if_ipsec(4) to use epoch(9) instead of rmlock. > > * use CK_LIST and FNV hash to keep chains of softc; > * read access to softc is protected by epoch(); > * write access is protected by ipsec_ioctl_sx. Changing of softc > fields > is allowed only when softc is unlinked from CK_LIST chains. > * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is > exclusive locked. > * the plain LIST of all softc is replaced by hash table that uses > ingress > address of tunnels as a key. > * added support for appearing/disappearing of ingress address > handling. > Now it is allowed configure non-local ingress IP address, and thus > the > problem with if_ipsec(4) configuration that happens on boot, when > ingress address is not yet configured, is solved. > > MFC after: 1 month > Sponsored by: Yandex LLC > Differential Revision: https://reviews.freebsd.org/D17190 > This panics during the pf tests. To reproduce: pkg install scapy kldload pf cd /usr/tests/sys/netpfil kyua test Fatal trap 9: general protection fault while in kernel mode cpuid = 3; apic id = 03 instruction pointer = 0x20:0xffffffff80ca7260 stack pointer = 0x28:0xfffffe00954c4650 frame pointer = 0x28:0xfffffe00954c4660 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 3204 (jail) [ thread pid 3204 tid 101409 ] Stopped at ipsec_srcaddr+0x40: cmpl $0,ll+0xb(%rbx) db> bt Tracing pid 3204 tid 101409 td 0xfffff80084239580 ipsec_srcaddr() at ipsec_srcaddr+0x40/frame 0xfffffe00954c4660 srcaddr_change_event() at srcaddr_change_event+0x14d/frame 0xfffffe00954c46c0 in_difaddr_ioctl() at in_difaddr_ioctl+0x41f/frame 0xfffffe00954c4720 in_ifscrub_all() at in_ifscrub_all+0x13d/frame 0xfffffe00954c47a0 ip_destroy() at ip_destroy+0xbd/frame 0xfffffe00954c47c0 vnet_destroy() at vnet_destroy+0x124/frame 0xfffffe00954c47f0 prison_deref() at prison_deref+0x29d/frame 0xfffffe00954c4830 sys_jail_remove() at sys_jail_remove+0x28a/frame 0xfffffe00954c4880 amd64_syscall() at amd64_syscall+0x278/frame 0xfffffe00954c49b0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00954c49b0 --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x8003131ba, rsp = 0x7fffffffe828, rbp = 0x7fffffffe8b0 --- At that point %rbx is 0xdeadc0dedeadc0de, so presumably we’re trying to dereference something that’s been freed already. kgdb agrees. The softc has been freed: #0 __curthread () at ./machine/pcpu.h:230 #1 doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:366 #2 0xffffffff804645db in db_dump (dummy=, dummy2=, dummy3=, dummy4=) at /usr/src/sys/ddb/db_command.c:574 #3 0xffffffff804643a9 in db_command (last_cmdp=, cmd_table=, dopager=) at /usr/src/sys/ddb/db_command.c:481 #4 0xffffffff80464124 in db_command_loop () at /usr/src/sys/ddb/db_command.c:534 #5 0xffffffff8046733f in db_trap (type=, code=) at /usr/src/sys/ddb/db_main.c:252 #6 0xffffffff80be5987 in kdb_trap (type=9, code=0, tf=0xfffffe00954c4590) at /usr/src/sys/kern/subr_kdb.c:693 #7 0xffffffff81072f51 in trap_fatal (frame=0xfffffe00954c4590, eva=0) at /usr/src/sys/amd64/amd64/trap.c:921 #8 0xffffffff8107244d in trap (frame=0xfffffe00954c4590) at /usr/src/sys/amd64/amd64/trap.c:217 #9 #10 ipsec_srcaddr (arg=, sa=0xfffff80023591298, event=) at /usr/src/sys/net/if_ipsec.c:784 #11 0xffffffff80d2de7d in srcaddr_change_event (arg=, ifp=0xfffff80057864800, ifa=0xfffff80023591200, event=1) at /usr/src/sys/netinet/ip_encap.c:181 #12 0xffffffff80d1ec4f in in_difaddr_ioctl (cmd=2149607705, data=, ifp=0xfffff80057864800, td=) at /usr/src/sys/netinet/in.c:651 #13 0xffffffff80d1f4cd in in_control (cmd=2149607705, ifp=, td=0xffffffff81b98600 , so=, data=) at /usr/src/sys/netinet/in.c:250 #14 in_ifscrub_all () at /usr/src/sys/netinet/in.c:935 #15 0xffffffff80d32dfd in ip_destroy (unused=) at /usr/src/sys/netinet/ip_input.c:398 #16 0xffffffff80ccd734 in vnet_sysuninit () at /usr/src/sys/net/vnet.c:597 #17 vnet_destroy (vnet=0xfffff80005d9c0c0) at /usr/src/sys/net/vnet.c:284 #18 0xffffffff80b64c0d in prison_deref (pr=0xffffffff81b0cc30 , flags=23) at /usr/src/sys/kern/kern_jail.c:2634 #19 0xffffffff80b6620a in sys_jail_remove (td=, uap=) at /usr/src/sys/kern/kern_jail.c:2257 #20 0xffffffff81073b28 in syscallenter (td=0xfffff80084239580) at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:135 #21 amd64_syscall (td=0xfffff80084239580, traced=0) at /usr/src/sys/amd64/amd64/trap.c:1154 #22 #23 0x00000008003131ba in ?? () Backtrace stopped: Cannot access memory at address 0x7fffffffe828 (kgdb) fr 10 #10 ipsec_srcaddr (arg=, sa=0xfffff80023591298, event=) at /usr/src/sys/net/if_ipsec.c:784 784 if (sc->family == 0) (kgdb) p sc $1 = (struct ipsec_softc *) 0xdeadc0dedeadc0de (kgdb) Best regards, Kristof From owner-svn-src-head@freebsd.org Tue Oct 23 01:56:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25DE5FF2998; Tue, 23 Oct 2018 01:56:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0A98817E0; Tue, 23 Oct 2018 01:56:52 +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 CB992F77; Tue, 23 Oct 2018 01:56:52 +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 w9N1uqRp069018; Tue, 23 Oct 2018 01:56:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N1uqeo069016; Tue, 23 Oct 2018 01:56:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810230156.w9N1uqeo069016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Oct 2018 01:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339632 - head/sys/dev/dpaa X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/dpaa X-SVN-Commit-Revision: 339632 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, 23 Oct 2018 01:56:53 -0000 Author: jhibbits Date: Tue Oct 23 01:56:52 2018 New Revision: 339632 URL: https://svnweb.freebsd.org/changeset/base/339632 Log: dpaa: Mark BMan and QMan as earlier driver modules The BMan softc must exist when dtsec devices are created, else a NULL pointer is dereferenced. QMan likely as well. Until now, we have relied on order within the fdt parsing to attach correctly, but this obviously is not foolproof. Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached explicitly before dtsec devices. Modified: head/sys/dev/dpaa/bman_fdt.c head/sys/dev/dpaa/qman_fdt.c Modified: head/sys/dev/dpaa/bman_fdt.c ============================================================================== --- head/sys/dev/dpaa/bman_fdt.c Tue Oct 23 01:42:43 2018 (r339631) +++ head/sys/dev/dpaa/bman_fdt.c Tue Oct 23 01:56:52 2018 (r339632) @@ -68,7 +68,8 @@ static driver_t bman_driver = { }; static devclass_t bman_devclass; -DRIVER_MODULE(bman, simplebus, bman_driver, bman_devclass, 0, 0); +EARLY_DRIVER_MODULE(bman, simplebus, bman_driver, bman_devclass, 0, 0, + BUS_PASS_SUPPORTDEV); static int bman_fdt_probe(device_t dev) Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Tue Oct 23 01:42:43 2018 (r339631) +++ head/sys/dev/dpaa/qman_fdt.c Tue Oct 23 01:56:52 2018 (r339632) @@ -68,7 +68,8 @@ static driver_t qman_driver = { }; static devclass_t qman_devclass; -DRIVER_MODULE(qman, simplebus, qman_driver, qman_devclass, 0, 0); +EARLY_DRIVER_MODULE(qman, simplebus, qman_driver, qman_devclass, 0, 0, + BUS_PASS_SUPPORTDEV); static int qman_fdt_probe(device_t dev) From owner-svn-src-head@freebsd.org Tue Oct 23 04:17:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71DF71008A6D; Tue, 23 Oct 2018 04:17:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25064885DD; Tue, 23 Oct 2018 04:17:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id E50C71EAC7; Tue, 23 Oct 2018 04:17:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [192.168.0.27] (unknown [IPv6:2601:647:4780:2b90:81f2:183d:1ba5:9b61]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 723DA15890; Tue, 23 Oct 2018 06:17:43 +0200 (CEST) From: "Kristof Provost" To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339554 - head/sys/net Date: Mon, 22 Oct 2018 21:17:39 -0700 X-Mailer: MailMate (2.0BETAr6123) Message-ID: <5375183F-6F8B-4457-9CCD-511E214B5B16@FreeBSD.org> In-Reply-To: <6FD6264C-06D6-40F4-8EED-B4B1AD950214@FreeBSD.org> References: <201810211824.w9LIOLuu094155@repo.freebsd.org> <6FD6264C-06D6-40F4-8EED-B4B1AD950214@FreeBSD.org> MIME-Version: 1.0 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: Tue, 23 Oct 2018 04:17:47 -0000 On 22 Oct 2018, at 17:51, Kristof Provost wrote: > On 21 Oct 2018, at 11:24, Andrey V. Elsukov wrote: >> Author: ae >> Date: Sun Oct 21 18:24:20 2018 >> New Revision: 339554 >> URL: https://svnweb.freebsd.org/changeset/base/339554 >> >> Log: >> Rework if_ipsec(4) to use epoch(9) instead of rmlock. >> >> * use CK_LIST and FNV hash to keep chains of softc; >> * read access to softc is protected by epoch(); >> * write access is protected by ipsec_ioctl_sx. Changing of softc >> fields >> is allowed only when softc is unlinked from CK_LIST chains. >> * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is >> exclusive locked. >> * the plain LIST of all softc is replaced by hash table that uses >> ingress >> address of tunnels as a key. >> * added support for appearing/disappearing of ingress address >> handling. >> Now it is allowed configure non-local ingress IP address, and >> thus the >> problem with if_ipsec(4) configuration that happens on boot, when >> ingress address is not yet configured, is solved. >> >> MFC after: 1 month >> Sponsored by: Yandex LLC >> Differential Revision: https://reviews.freebsd.org/D17190 >> > This panics during the pf tests. I think I understand what’s happening here. With this patch I see a different panic: diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index 91b11a455b3..146cb59aaaa 100644 --- a/sys/net/if_ipsec.c +++ b/sys/net/if_ipsec.c @@ -134,6 +134,9 @@ ipsec_srchash(const struct sockaddr *sa) { uint32_t hval; + KASSERT(V_ipsec4_srchtbl, ("NULL")); + KASSERT(V_ipsec6_srchtbl, ("NULL (v6)")); + switch (sa->sa_family) { #ifdef INET case AF_INET: @@ -265,17 +274,22 @@ static void vnet_ipsec_uninit(const void *unused __unused) { if_clone_detach(V_ipsec_cloner); free(V_ipsec_idhtbl, M_IPSEC); #ifdef INET if (IS_DEFAULT_VNET(curvnet)) ip_encap_unregister_srcaddr(ipsec4_srctab); free(V_ipsec4_srchtbl, M_IPSEC); + V_ipsec4_srchtbl = NULL; + #endif #ifdef INET6 if (IS_DEFAULT_VNET(curvnet)) ip6_encap_unregister_srcaddr(ipsec6_srctab); free(V_ipsec6_srchtbl, M_IPSEC); + V_ipsec4_srchtbl = NULL; #endif } VNET_SYSUNINIT(vnet_ipsec_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, That trips the KASSERT() in ipsec_srchash(). Basically, the problem is that the V_ipsec4_srchtbl table gets freed in vnet_ipsec_uninit(), and later we get a srcaddr_change_event(), which tries to iterate the list (in ipsec_srcaddr()). Obviously iterating a freed list doesn’t go well for us (hence the 0xdeadc0dedeadc0de softc). That also explains why this happens during the pf tests, even though they don’t actually use IPSec. I’m not quite sure how to best fix this though. I suppose we could set V_ipsec4_srchtbl to NULL (well, copy the pointer first, set it to NULL and then free it so we don’t add a race condition) and then check for NULL in ipsec_srcaddr(). It feels like the srcaddr_change_event needs to be per-vnet, so we can unregister before we free V_ipsec4_srchtbl. Best regards, Kristof From owner-svn-src-head@freebsd.org Tue Oct 23 04:31:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 829E7103627F; Tue, 23 Oct 2018 04:31:51 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 0A6E188D84; Tue, 23 Oct 2018 04:31:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w9N4VgJ5025780 (version=TLSv1.2 cipher=AES128-SHA bits=128 verify=NOT); Mon, 22 Oct 2018 21:31:43 -0700 Subject: Re: svn commit: r339523 - in head/sys: conf dev/amdgpio modules modules/amdgpio To: Oleksandr Tymoshenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810210452.w9L4qbTc067553@repo.freebsd.org> <49432512-861b-47dd-4e25-08044b0b53fa@freebsd.org> <20181021201214.GA98172@bluezbox.com> From: Nathan Whitehorn Openpgp: preference=signencrypt Autocrypt: addr=nwhitehorn@freebsd.org; keydata= xsFNBFuARN8BEADLKYsG3l1aq/M21R59I/5EsEfvtvd15ZJ9lDHcWPuxzIfGnu2LMpe5PrFP e/Y4bcsPrlB4S3I3ooIUDvoEEsDeqgqlZod3QevOK/RjLqiqx1i/4mKnobJ++3ppyVVIccgN sUrj786OYCFCI/W+uWw7cbKewNeaL//Z/TDKlHLkssiy6qmZbNQ0ZjcMLJKUesk4eVg2TtTD HNe42ZuxbUC9iLYieO4c7kQB4qiFhagDRiObXrLzvm2MQYeAaNVRqID+mfI75TWrQ+t98iVu mHvFu461eeteq59jg6H/IL07ACxL+HzEVM+D6tPtPrz7ppr3wiZL5Cu17yu0nAx0nhJTV8ZB qza1rOVun0x65S14L41XD2HkmBDxTaRlTg8ypnkLFo8kh+MEq4k67apL/DUGcaUjKy2TVUC7 3igLO/DwQHrkWx2RrOmS3xS0TgGXVmB47nq2Zveo3fcjporQK63n2sbLkS70cfAJAJ9KHEIx u9am44iW5Ku3+mVLgQYybtcUxlk/Jw/BA5V6KUcDQMd5kTm0MyagziqMaT+57ceYxwRBK4HC DCLRpSOHV81/YzyL5vnwfHsxADm3091rd0uwr8uRCQn7wLvlcFyp/JKSFkVnE1oo7UE4QQJZ GbSJyvj7GdXu0LdghALcMj/thdb+js4D3UuCaAMecgVSscxEIQARAQABzS5OYXRoYW4gV2hp dGVob3JuIDxud2hpdGVob3JuQGljZWN1YmUud2lzYy5lZHU+wsGOBBMBCAA4FiEEPWQg+qgh ST6Avw1hOLZNlGaE6HcFAluAUl4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOLZN lGaE6HeHFw//fN2CzkiW1yedjLGEQ3uXRMgu6geRgWdtkgg/pOhn5OLSQI4R59kjvHNHHqln 1QYdxe63lsbe+7CRsTKuke3/mgsQ1h6n7cCzsoXVP3eLtWjshAz7spwUcdRRFTSbwkMzKcRn plpr+ByZDw98vnpQo10J5xYmf6if6wcEpVlazwnC5G1gHktM4X0jrlAUKSgVx7MG8o4G6af9 7MQJINAG6g6+BlBH3u5fmPunKi9qgHsZxKnTZneD2mO5u2x6p1qmqybvfvWI5UEvktPeEext JBeXXqdex+HWmAbLYznLUoBloBl+fW5Lo9VapkcGubvGC0WLr/gYuamAApwoFpa4/SBqgmHr JSsPqoDtheWt9oYzuYkYW5+tpJQoDVdG3KCOQJSYZIbNT8HyviFY32ZSn6gIn2qP/5E+rA8J +6/57XCZXPazE4FiPNbwY/OwZoi7w0yRKcdmJoSoC/GdjtQbjyeARbAaHIcudeU/bB3paGS2 rHkoW4iR5TnK/V/QJvNT4KC6Dw3m6pfBIzsF+smcyjz+MzBFQNvSOtG4kJQooKcMsThas8oX VTx+WsqNAVOeQKTOU74jlUYKm5+w5aIOJbc8jg1LlTWJus1SxYtxT9lgNwOCUhE/j6Ueq9jG V9POWg31C44akWmnK8rS4PImUBsPKwtxUNM6BhfZRbtIjQ7OwU0EW4BFQQEQAOLKFtg6us0A LA7LtvjxIskIgqFJjHw2ka/UtdJ432P9kvmBq7z4v0+m/gkxCOOG0yDi2Cv/ALJobsyb56tb U6MU0SRjTio35S2jit369B1BDC2TLNF337sUquUx0l4wkEXEBefvLRYouF8BRbkgjveg7sA4 NjsiduQx92vPJnBoaH2OWxqDbr5X6kF5cx9jPrKUJ4ZqH/raE/SSDhtow4aKO0nWbteVGck1 5W1X/S8KziPXKazxCQ8qprQRTAehsdG/bSbWD95hp3TAlEbl4N4UqqS7n4jCZunCeii2TDZH Vvx/lpFAT2ezx646p2PUmH5hpiVMgbY5uHcyahwNf+eNOO7gotnNYoieoLw4fUeTYOq+s3IN isCB4iovQcZOCYSzmwRolQRggX0tBSenR6Pgp38YjVIkWvMHhxbVifAusjvVbm/GQeA2MaCt kog53Iyfo7ri9DeNpVuRc/47BxHi8JtdyyGgLO13Ajcwc6V7KLeDmw/SXJAMssuWQlXzs8Og spNvtymBh5rq4TlxAY65L3Yv/yh0izEztOJO3Ob9y3gLrp7TeDI0EO9SyGuFXbgWY/NXlDwW HWguMgO7DWM/KxeaMYyHfnffIeQ6uhM21y42I7NV11mWwycv/XJkID3fd7GWBecakdYnYI/7 FYMDHmsUQPmSMkbqCqYcZe47ABEBAAHCwXYEGAEIACAWIQQ9ZCD6qCFJPoC/DWE4tk2UZoTo dwUCW4BFQQIbDAAKCRA4tk2UZoTod2RbEACbQ2bwJ3++bvqclErbekf7BXYja37/HxGE67q3 9xf28hen8vWGtXwq4bWmZT5H8bBqXigA4bUU4nN4X3xEDfTyqkQMuDTnnwT7Y61B4QEqhi4a q4adf/KP0l1UCg4CJ0KS931Han+VbiuUcbadu1ZX37Ef6g/hG+mt59FeXDMU0rers2Bpr8zB 8ywojAsVC92kvOHLsCQtdCsPzC+R6B1bY6/Re9slM1NBd+2k4BUVhYu8Fb8Ir37OmN0aGQzY uRczfrmR/OV5/1+g5XeYSFbq/0Q3KkFWLHfimff8lb9GRWrdvOUpYyGluv49b/G5o9lSxPwX yBfaoVi/WDDfJ/XJw9H90XK68TYxPfEQkeuLEEzg+Bz3Zeduyo2Zx4S5apLqAbv0RzduXgIG YZVPu8R4ya8nQWHeUpot17lt8SL7yFkMJaAXk27QqUAaxjqnGBLn70YMWXFGySfvjgaR1Ftu /S/HSKqH7m8aFYZftqs7ZojXNdqGHZKRrIx6hRUYuZQM8uxHDweF4jF+QIwYIUmtry5h8iti Sjt9KHjpkH3Wz5o1mk6cbFNN+wgpHplDl/iZMZjFskTAJfEsYHVSSm21zcYvvogrbqYvciMT ty65+0A8Gz9tMbcNx9ePaGoM+9jeFehrzTjdaiTiC+umSd/Y29DCW4OBMr1VfufVVKbfAQ== Message-ID: Date: Mon, 22 Oct 2018 21:31:41 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181021201214.GA98172@bluezbox.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbv89VbhpbGnXrlXTQsnzo5pN8qcX92vlB9PRhIarcHQpVr0wJmTV13t+IhlM/SKQcuhH6OGG+AVSmplmFDHQQMbKFhkN54Tlo= X-Sonic-ID: C;9C+CinzW6BGH7OcbDaCztA== M;anbtinzW6BGH7OcbDaCztA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd 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, 23 Oct 2018 04:31:51 -0000 On 10/21/18 1:12 PM, Oleksandr Tymoshenko wrote: > Nathan Whitehorn (nwhitehorn@freebsd.org) wrote: >> >> On 10/20/18 9:52 PM, Oleksandr Tymoshenko wrote: >>> Author: gonzo >>> Date: Sun Oct 21 04:52:37 2018 >>> New Revision: 339523 >>> URL: https://svnweb.freebsd.org/changeset/base/339523 >>> >>> Log: >>> Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms >>> >>> Submitted by: Rajesh Kumar >>> Differential Revision: https://reviews.freebsd.org/D16865 >>> >> [...] >>> Modified: head/sys/modules/Makefile >>> ============================================================================== >>> --- head/sys/modules/Makefile Sun Oct 21 02:39:13 2018 (r339522) >>> +++ head/sys/modules/Makefile Sun Oct 21 04:52:37 2018 (r339523) >>> @@ -34,6 +34,7 @@ SUBDIR= \ >>> ale \ >>> alq \ >>> ${_amd_ecc_inject} \ >>> + ${_amdgpio} \ >>> ${_amdsbwd} \ >>> ${_amdsmn} \ >>> ${_amdtemp} \ >>> @@ -717,6 +718,7 @@ _x86bios= x86bios >>> .endif >>> >>> .if ${MACHINE_CPUARCH} == "amd64" >>> +_amdgpio= amdgpio >>> _ccp= ccp >>> _efirt= efirt >>> _iavf= iavf >>> >> Does this not work on 64-bit AMD processors running i386 kernels? > I see no reason why it wouldn't. Probably just haven't been tested. > It might be nice if we just added it to all architectures where it conceivably applies. Essentially all of our code is more portable than the platforms on which it is tested, so there doesn't seem to be a good reason to limit such things. -Nathan From owner-svn-src-head@freebsd.org Tue Oct 23 04:37:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC9A1036421; Tue, 23 Oct 2018 04:37:30 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 418DC89014; Tue, 23 Oct 2018 04:37:30 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 216142BDF; Tue, 23 Oct 2018 04:37:30 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N4bUBF050791; Tue, 23 Oct 2018 04:37:30 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N4bTxf050789; Tue, 23 Oct 2018 04:37:29 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201810230437.w9N4bTxf050789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 23 Oct 2018 04:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339634 - in head/sys: kern net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys: kern net X-SVN-Commit-Revision: 339634 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, 23 Oct 2018 04:37:30 -0000 Author: erj Date: Tue Oct 23 04:37:29 2018 New Revision: 339634 URL: https://svnweb.freebsd.org/changeset/base/339634 Log: iflib: drain enqueued tasks before detaching from taskqgroup The taskqgroup_detach function does not check if task is already enqueued when detaching it. This may lead to kernel panic if enqueued task starts after context state lock is destroyed. Ensure that the already enqueued admin tasks are executed before detaching them. The issue was discovered during validation of D16429. Unloading of if_ixlv followed by immediate removal of VFs with iovctl -D may lead to panic on NODEBUG kernel. As well, check if iflib is in detach before enqueueing new admin or iov tasks, to prevent new tasks from executing while the taskqgroup tasks are being drained. Submitted by: Krzysztof Galazka Reviewed by: shurd@, erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D17404 Modified: head/sys/kern/subr_gtaskqueue.c head/sys/net/iflib.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Tue Oct 23 03:30:14 2018 (r339633) +++ head/sys/kern/subr_gtaskqueue.c Tue Oct 23 04:37:29 2018 (r339634) @@ -812,6 +812,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr qgroup->tqg_queue[i].tgc_cnt--; LIST_REMOVE(gtask, gt_list); mtx_unlock(&qgroup->tqg_lock); + gtaskqueue_drain(gtask->gt_taskqueue, >ask->gt_task); gtask->gt_taskqueue = NULL; } Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Oct 23 03:30:14 2018 (r339633) +++ head/sys/net/iflib.c Tue Oct 23 04:37:29 2018 (r339634) @@ -2279,8 +2279,8 @@ iflib_timer(void *arg) STATE_LOCK(ctx); if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); - iflib_admin_intr_deferred(ctx); STATE_UNLOCK(ctx); + iflib_admin_intr_deferred(ctx); } static void @@ -2802,8 +2802,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) err: STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; - iflib_admin_intr_deferred(ctx); STATE_UNLOCK(ctx); + iflib_admin_intr_deferred(ctx); return (false); } @@ -5973,7 +5973,10 @@ iflib_admin_intr_deferred(if_ctx_t ctx) { #ifdef INVARIANTS struct grouptask *gtask; - +#endif + if (iflib_in_detach(ctx)) + return; +#ifdef INVARIANTS gtask = &ctx->ifc_admin_task; MPASS(gtask != NULL && gtask->gt_taskqueue != NULL); #endif @@ -5984,6 +5987,8 @@ iflib_admin_intr_deferred(if_ctx_t ctx) void iflib_iov_intr_deferred(if_ctx_t ctx) { + if (iflib_in_detach(ctx)) + return; GROUPTASK_ENQUEUE(&ctx->ifc_vflr_task); } From owner-svn-src-head@freebsd.org Tue Oct 23 06:31:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3696103930C; Tue, 23 Oct 2018 06:31:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 954E08C28E; Tue, 23 Oct 2018 06:31:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9051D4295; Tue, 23 Oct 2018 06:31:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N6VKk7008500; Tue, 23 Oct 2018 06:31:20 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N6VKDE008499; Tue, 23 Oct 2018 06:31:20 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810230631.w9N6VKDE008499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 23 Oct 2018 06:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339635 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 339635 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, 23 Oct 2018 06:31:21 -0000 Author: arichardson Date: Tue Oct 23 06:31:19 2018 New Revision: 339635 URL: https://svnweb.freebsd.org/changeset/base/339635 Log: Fix regex for extracting SHM_* values for libsysdecode There was an additional + after the {6} which is apparently ignored by the FreeBSD regex implementation but was giving me an error when compiling on MacOS. While changing this also make sure that tables.h is not created if mktables fails. The current rule would create a partial tables.h which causes following incremental builds to use that broken file and fail with an unrelated compilation error or even succeed even though they shouldn't. Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D17069 Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/mktables Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Tue Oct 23 04:37:29 2018 (r339634) +++ head/lib/libsysdecode/Makefile Tue Oct 23 06:31:19 2018 (r339635) @@ -107,7 +107,7 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ sysdecode_mask.3 sysdecode_wait4_options.3 \ sysdecode_mask.3 sysdecode_wait6_options.3 -CLEANFILES= ioctl.c tables.h +CLEANFILES= ioctl.c ioctl.c.tmp tables.h tables.h.tmp .if defined(COMPAT_32BIT) CPP+= -m32 @@ -124,7 +124,8 @@ CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h tables.h: mktables - sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET} + sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}.tmp && \ + mv -f ${.TARGET}.tmp ${.TARGET} # mkioctls runs find(1) for headers so needs to rebuild every time. This used # to be a hack only done in buildworld. Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Tue Oct 23 04:37:29 2018 (r339634) +++ head/lib/libsysdecode/mktables Tue Oct 23 06:31:19 2018 (r339635) @@ -123,7 +123,7 @@ gen_table "rlimit" "RLIMIT_[A-Z]+[[:space:]]+ gen_table "rusage" "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" "sys/resource.h" gen_table "schedpolicy" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" gen_table "sendfileflags" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" -gen_table "shmatflags" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" +gen_table "shmatflags" "SHM_[A-Z]+[[:space:]]+[0-9]{6}" "sys/shm.h" gen_table "shutdownhow" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" gen_table "sigbuscode" "BUS_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" gen_table "sigchldcode" "CLD_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" From owner-svn-src-head@freebsd.org Tue Oct 23 06:31:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB9BA1039331; Tue, 23 Oct 2018 06:31:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 940768C358; Tue, 23 Oct 2018 06:31:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3285429C; Tue, 23 Oct 2018 06:31:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N6VQi2008556; Tue, 23 Oct 2018 06:31:26 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N6VPR4008554; Tue, 23 Oct 2018 06:31:25 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810230631.w9N6VPR4008554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 23 Oct 2018 06:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339636 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 339636 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, 23 Oct 2018 06:31:29 -0000 Author: arichardson Date: Tue Oct 23 06:31:25 2018 New Revision: 339636 URL: https://svnweb.freebsd.org/changeset/base/339636 Log: Only compute the X_COMPILER_*/X_LINKER_* variables when needed When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line. This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD in bsd.linker.mk) which causes it to call ${XCC} --version and ${XLD} --version (plus various awk+sed+echo calls) in every subdirectory. For incremental builds and stages that only walk the source tree this is often the majority of the time spent in that directory. By only computing the value of the X_COMPILER_*/X_LINKER_* variables if _WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls to once per build stage instead of once per recursive make. With this change (and no changes to the sources) the `make includes` stage now takes 28 seconds at -j1 instead of 86 seconds. Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17046 Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 23 06:31:19 2018 (r339635) +++ head/Makefile.inc1 Tue Oct 23 06:31:25 2018 (r339636) @@ -103,8 +103,11 @@ MK_GCC_BOOTSTRAP= no # here since we will always have the right make, unlike in src/Makefile # Don't include bsd.linker.mk yet until XBINUTILS is handled (after src.opts.mk) _NO_INCLUDE_LINKERMK= t +# We also want the X_COMPILER* variables if we are using an external toolchain. +_WANT_TOOLCHAIN_CROSS_VARS= t .include "share/mk/bsd.compiler.mk" .undef _NO_INCLUDE_LINKERMK +.undef _WANT_TOOLCHAIN_CROSS_VARS # src.opts.mk depends on COMPILER_FEATURES .include "share/mk/src.opts.mk" @@ -205,7 +208,10 @@ X${BINUTIL}?= ${${BINUTIL}} MK_LLD_BOOTSTRAP= no .endif +# We also want the X_LINKER* variables if we are using an external toolchain. +_WANT_TOOLCHAIN_CROSS_VARS= t .include "share/mk/bsd.linker.mk" +.undef _WANT_TOOLCHAIN_CROSS_VARS # Begin WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Oct 23 06:31:19 2018 (r339635) +++ head/share/mk/bsd.compiler.mk Tue Oct 23 06:31:25 2018 (r339636) @@ -116,7 +116,16 @@ ccache-print-options: .PHONY .endif # exists(${CCACHE_BIN}) .endif # ${MK_CCACHE_BUILD} == "yes" -.for cc X_ in CC $${_empty_var_} XCC X_ +_cc_vars=CC $${_empty_var_} +.if !empty(_WANT_TOOLCHAIN_CROSS_VARS) +# Only the toplevel makefile needs to compute the X_COMPILER_* variables. +# Skipping the computation of the unused X_COMPILER_* in the subdirectory +# makefiles can save a noticeable amount of time when walking the whole source +# tree (e.g. during make includes, etc.). +_cc_vars+=XCC X_ +.endif + +.for cc X_ in ${_cc_vars} .if ${cc} == "CC" || !empty(XCC) # Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. # The value is only used/exported for the same environment that impacts Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Tue Oct 23 06:31:19 2018 (r339635) +++ head/share/mk/bsd.linker.mk Tue Oct 23 06:31:25 2018 (r339636) @@ -26,7 +26,13 @@ .if !target(____) ____: -.for ld X_ in LD $${_empty_var_} XLD X_ +_ld_vars=LD $${_empty_var_} +.if !empty(_WANT_TOOLCHAIN_CROSS_VARS) +# Only the toplevel makefile needs to compute the X_LINKER_* variables. +_ld_vars+=XLD X_ +.endif + +.for ld X_ in ${_ld_vars} .if ${ld} == "LD" || !empty(XLD) # Try to import LINKER_TYPE and LINKER_VERSION from parent make. # The value is only used/exported for the same environment that impacts From owner-svn-src-head@freebsd.org Tue Oct 23 06:31:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A16551039351; Tue, 23 Oct 2018 06:31:32 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4BB8C4DC; Tue, 23 Oct 2018 06:31:31 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9105442A3; Tue, 23 Oct 2018 06:31:31 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N6VVc7008610; Tue, 23 Oct 2018 06:31:31 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N6VVSC008609; Tue, 23 Oct 2018 06:31:31 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810230631.w9N6VVSC008609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 23 Oct 2018 06:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339637 - head/lib/ncurses/ncurses X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/ncurses/ncurses X-SVN-Commit-Revision: 339637 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, 23 Oct 2018 06:31:32 -0000 Author: arichardson Date: Tue Oct 23 06:31:31 2018 New Revision: 339637 URL: https://svnweb.freebsd.org/changeset/base/339637 Log: Fix ncurses fallback.c build with a strict build shell The script uses shift three times and when building with a strict /bin/sh shifting without any arguments will cause the script to fail. In this case the target will fail and we write an empty output file. When doing a NO_CLEAN build after this will mean fallback.c is up to date and clang will happily compile the empty input file which leads to strange build errors later. Fixed by passing three empty arguments to MkFallback.sh and only creating fallback.c if MKfallback.sh succeeds. Aproved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D16867 Modified: head/lib/ncurses/ncurses/Makefile Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Tue Oct 23 06:31:25 2018 (r339636) +++ head/lib/ncurses/ncurses/Makefile Tue Oct 23 06:31:31 2018 (r339637) @@ -350,7 +350,8 @@ expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c fallback.c: MKfallback.sh - sh ${NCURSES_DIR}/ncurses/tinfo/MKfallback.sh > fallback.c + sh -e ${NCURSES_DIR}/ncurses/tinfo/MKfallback.sh "" "" "" > ${.TARGET}.tmp && \ + mv -f ${.TARGET}.tmp ${.TARGET} # Generated headers nomacros.h: MKlib_gen.sh curses.h From owner-svn-src-head@freebsd.org Tue Oct 23 08:25:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC2BC10709A2; Tue, 23 Oct 2018 08:25:29 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::609]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2217026C; Tue, 23 Oct 2018 08:25:29 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback16o.mail.yandex.net (mxback16o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::67]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 9249178394A; Tue, 23 Oct 2018 11:25:25 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback16o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ttUBVkvQn1-PPxaLwL1; Tue, 23 Oct 2018 11:25:25 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1540283125; bh=dHBZiWAoJ72gZNAUIDO0GeEtrRfg09HLjP6JXvhm7JE=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=GZ5UB/rCpPyP8v7u2vJlR3w03rnJqjQApJ6dLBNvpNmj2PDVivmv/02uh5nYr/1mb NgnXtCdbwqtu2zvv57CdbLHNvHjXXTTLrJFLZq0PnYatXWTYfLg2bAV50FxIb7JrEF BvMeOSPXwPeIyixpjZnEUvOGCu81gAwm42mLiudA= Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id DK01cvNy5r-PORqrxwC; Tue, 23 Oct 2018 11:25:24 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1540283124; bh=dHBZiWAoJ72gZNAUIDO0GeEtrRfg09HLjP6JXvhm7JE=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=fFqzBvcHkeoFKtAqDHScOPLd1/YQMVXkcUW2clMHlOe2kVJbBcq17OrSuJfg9FpJE nNbCcWSJOY3/pg+LobZvwkaV9Wtl08VKnmyg5G0ebJ51hbeB5Stm/0f7WJZNWU9aBp /xznrUmXVLIn6Bo+jREQVhaPdtE9oU2Qi9ZU3bNw= Authentication-Results: smtp4p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r339554 - head/sys/net To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810211824.w9LIOLuu094155@repo.freebsd.org> <6FD6264C-06D6-40F4-8EED-B4B1AD950214@FreeBSD.org> <5375183F-6F8B-4457-9CCD-511E214B5B16@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Tue, 23 Oct 2018 11:23:44 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5375183F-6F8B-4457-9CCD-511E214B5B16@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MPiglBC6YO0Si1x3RODbhNcqNJM6lUdNm" 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, 23 Oct 2018 08:25:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MPiglBC6YO0Si1x3RODbhNcqNJM6lUdNm Content-Type: multipart/mixed; boundary="qOefYdRaF5EQOchxqqA03uUxSvtuFxlz0"; protected-headers="v1" From: "Andrey V. Elsukov" To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r339554 - head/sys/net References: <201810211824.w9LIOLuu094155@repo.freebsd.org> <6FD6264C-06D6-40F4-8EED-B4B1AD950214@FreeBSD.org> <5375183F-6F8B-4457-9CCD-511E214B5B16@FreeBSD.org> In-Reply-To: <5375183F-6F8B-4457-9CCD-511E214B5B16@FreeBSD.org> --qOefYdRaF5EQOchxqqA03uUxSvtuFxlz0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 23.10.2018 07:17, Kristof Provost wrote: > I think I understand what=E2=80=99s happening here. >=20 > With this patch I see a different panic: >=20 > |diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index > 91b11a455b3..146cb59aaaa 100644 --- a/sys/net/if_ipsec.c +++ > b/sys/net/if_ipsec.c @@ -134,6 +134,9 @@ ipsec_srchash(const struct > sockaddr *sa) { uint32_t hval; + KASSERT(V_ipsec4_srchtbl, ("NULL")); += > KASSERT(V_ipsec6_srchtbl, ("NULL (v6)")); + switch (sa->sa_family) { > #ifdef INET case AF_INET: @@ -265,17 +274,22 @@ static void > vnet_ipsec_uninit(const void *unused __unused) { > if_clone_detach(V_ipsec_cloner); free(V_ipsec_idhtbl, M_IPSEC); #ifdef > INET if (IS_DEFAULT_VNET(curvnet)) > ip_encap_unregister_srcaddr(ipsec4_srctab); free(V_ipsec4_srchtbl, > M_IPSEC); + V_ipsec4_srchtbl =3D NULL; + #endif #ifdef INET6 if > (IS_DEFAULT_VNET(curvnet)) ip6_encap_unregister_srcaddr(ipsec6_srctab);= > free(V_ipsec6_srchtbl, M_IPSEC); + V_ipsec4_srchtbl =3D NULL; #endif } > VNET_SYSUNINIT(vnet_ipsec_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, > SI_ORDER_ANY, | >=20 > That trips the KASSERT() in ipsec_srchash(). Basically, the problem is > that the V_ipsec4_srchtbl table gets freed in vnet_ipsec_uninit(), and > later we get a srcaddr_change_event(), which tries to iterate the list > (in ipsec_srcaddr()). Obviously iterating a freed list doesn=E2=80=99t = go well > for us (hence the 0xdeadc0dedeadc0de softc). >=20 > That also explains why this happens during the pf tests, even though > they don=E2=80=99t actually use IPSec. >=20 > I=E2=80=99m not quite sure how to best fix this though. I suppose we co= uld set > V_ipsec4_srchtbl to NULL (well, copy the pointer first, set it to NULL > and then free it so we don=E2=80=99t add a race condition) and then che= ck for > NULL in ipsec_srcaddr(). > It feels like the srcaddr_change_event needs to be per-vnet, so we can > unregister before we free V_ipsec4_srchtbl. I think the better fix would be adding IPSEC_WAIT() to vnet_ipsec_uninit() before doing free(). I'll try your test scenario and try to fix it. Thanks! --=20 WBR, Andrey V. Elsukov --qOefYdRaF5EQOchxqqA03uUxSvtuFxlz0-- --MPiglBC6YO0Si1x3RODbhNcqNJM6lUdNm 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/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlvO2pAACgkQAcXqBBDI oXpVOwf/b75QSWSdpyBOaeSrLAZJRLU8wf5G2dcdPVl4ihrmwz9gQ7sW+PSle7R6 OHnAf2qAvAQj4fpnQUmfI5bNDYck0/BJ4ujz2cqFZGKfcLA0VwPHWt0jsWNPzhSZ DkGyjCQi6I6dwSOVLs3Ojsvz1YlvLHF5/JERUa2otWVII2IJ6m5ixEiaBLrHM9BE 0cbR1hvmlfGh3a6MoKJRM0hVtFLZSudB90cHVzoa9TjXV3Lbwve+0AjDjQPwf+Bz UFd+5SJs2RWib/JBvgSnfsXqtZQcSNzsiznTCtALViJ34nWCVi5tjCfm9dW3EBxV ZhjrJIW24qeQD0wOMd3tOLkpmJRj+w== =gSoz -----END PGP SIGNATURE----- --MPiglBC6YO0Si1x3RODbhNcqNJM6lUdNm-- From owner-svn-src-head@freebsd.org Tue Oct 23 08:55:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83CFB1071675; Tue, 23 Oct 2018 08:55:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31FF271065; Tue, 23 Oct 2018 08:55:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2984B5AD9; Tue, 23 Oct 2018 08:55:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N8tHr4083385; Tue, 23 Oct 2018 08:55:17 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N8tGlX083381; Tue, 23 Oct 2018 08:55:16 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810230855.w9N8tGlX083381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 23 Oct 2018 08:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339639 - in head/sys: conf dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: conf dev/netmap net X-SVN-Commit-Revision: 339639 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, 23 Oct 2018 08:55:17 -0000 Author: vmaffione Date: Tue Oct 23 08:55:16 2018 New Revision: 339639 URL: https://svnweb.freebsd.org/changeset/base/339639 Log: netmap: align codebase to the current upstream (sha 8374e1a7e6941) Changelist: - Move large parts of VALE code to a new file and header netmap_bdg.[ch]. This is useful to reuse the code within upcoming projects. - Improvements and bug fixes to pipes and monitors. - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to handle differences between FreeBSD and Linux. - Introduce some new helper functions to handle more host rings and fake rings (netmap_all_rings(), netmap_real_rings(), ...) - Added new sysctl to enable/disable hw checksum in emulated netmap mode. - nm_inject: add support for NS_MOREFRAG Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D17364 Added: head/sys/dev/netmap/netmap_bdg.c (contents, props changed) head/sys/dev/netmap/netmap_bdg.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_vale.c head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 23 07:24:03 2018 (r339638) +++ head/sys/conf/files Tue Oct 23 08:55:16 2018 (r339639) @@ -2522,6 +2522,7 @@ dev/netmap/netmap_pipe.c optional netmap dev/netmap/netmap_pt.c optional netmap dev/netmap/netmap_vale.c optional netmap dev/netmap/netmap_legacy.c optional netmap +dev/netmap/netmap_bdg.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nfsmb/nfsmb.c optional nfsmb pci dev/nge/if_nge.c optional nge Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Oct 23 07:24:03 2018 (r339638) +++ head/sys/dev/netmap/netmap.c Tue Oct 23 08:55:16 2018 (r339639) @@ -521,6 +521,9 @@ int netmap_generic_txqdisc = 1; int netmap_generic_ringsize = 1024; int netmap_generic_rings = 1; +/* Non-zero to enable checksum offloading in NIC drivers */ +int netmap_generic_hwcsum = 0; + /* Non-zero if ptnet devices are allowed to use virtio-net headers. */ int ptnet_vnet_hdr = 1; @@ -549,6 +552,9 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &ne SYSCTL_INT(_dev_netmap, OID_AUTO, admode, CTLFLAG_RW, &netmap_admode, 0, "Adapter mode. 0 selects the best option available," "1 forces native adapter, 2 forces emulated adapter"); +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_hwcsum, CTLFLAG_RW, &netmap_generic_hwcsum, + 0, "Hardware checksums. 0 to disable checksum generation by the NIC (default)," + "1 to enable checksum generation by the NIC"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_mit, CTLFLAG_RW, &netmap_generic_mit, 0, "RX notification interval in nanoseconds"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, @@ -827,8 +833,8 @@ netmap_krings_create(struct netmap_adapter *na, u_int } /* account for the (possibly fake) host rings */ - n[NR_TX] = na->num_tx_rings + 1; - n[NR_RX] = na->num_rx_rings + 1; + n[NR_TX] = netmap_all_rings(na, NR_TX); + n[NR_RX] = netmap_all_rings(na, NR_RX); len = (n[NR_TX] + n[NR_RX]) * (sizeof(struct netmap_kring) + sizeof(struct netmap_kring *)) @@ -930,11 +936,14 @@ netmap_krings_delete(struct netmap_adapter *na) void netmap_hw_krings_delete(struct netmap_adapter *na) { - struct mbq *q = &na->rx_rings[na->num_rx_rings]->rx_queue; + u_int lim = netmap_real_rings(na, NR_RX), i; - ND("destroy sw mbq with len %d", mbq_len(q)); - mbq_purge(q); - mbq_safe_fini(q); + for (i = nma_get_nrings(na, NR_RX); i < lim; i++) { + struct mbq *q = &NMR(na, NR_RX)[i]->rx_queue; + ND("destroy sw mbq with len %d", mbq_len(q)); + mbq_purge(q); + mbq_safe_fini(q); + } netmap_krings_delete(na); } @@ -1535,7 +1544,7 @@ netmap_get_na(struct nmreq_header *hdr, goto out; /* try to see if this is a bridge port */ - error = netmap_get_bdg_na(hdr, na, nmd, create); + error = netmap_get_vale_na(hdr, na, nmd, create); if (error) goto out; @@ -1827,7 +1836,7 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint3 } priv->np_qfirst[t] = (nr_mode == NR_REG_SW ? nma_get_nrings(na, t) : 0); - priv->np_qlast[t] = nma_get_nrings(na, t) + 1; + priv->np_qlast[t] = netmap_all_rings(na, t); ND("%s: %s %d %d", nr_mode == NR_REG_SW ? "SW" : "NIC+SW", nm_txrx2str(t), priv->np_qfirst[t], priv->np_qlast[t]); @@ -2543,7 +2552,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c NMG_LOCK(); hdr->nr_reqtype = NETMAP_REQ_REGISTER; hdr->nr_body = (uintptr_t)®req; - error = netmap_get_bdg_na(hdr, &na, NULL, 0); + error = netmap_get_vale_na(hdr, &na, NULL, 0); hdr->nr_reqtype = NETMAP_REQ_PORT_HDR_SET; hdr->nr_body = (uintptr_t)req; if (na && !error) { @@ -3336,6 +3345,12 @@ netmap_attach_common(struct netmap_adapter *na) } na->pdev = na; /* make sure netmap_mem_map() is called */ #endif /* __FreeBSD__ */ + if (na->na_flags & NAF_HOST_RINGS) { + if (na->num_host_rx_rings == 0) + na->num_host_rx_rings = 1; + if (na->num_host_tx_rings == 0) + na->num_host_tx_rings = 1; + } if (na->nm_krings_create == NULL) { /* we assume that we have been called by a driver, * since other port types all provide their own @@ -3357,7 +3372,7 @@ netmap_attach_common(struct netmap_adapter *na) /* no special nm_bdg_attach callback. On VALE * attach, we need to interpose a bwrap */ - na->nm_bdg_attach = netmap_bwrap_attach; + na->nm_bdg_attach = netmap_default_bdg_attach; #endif return 0; @@ -3399,10 +3414,10 @@ out: static void netmap_hw_dtor(struct netmap_adapter *na) { - if (nm_iszombie(na) || na->ifp == NULL) + if (na->ifp == NULL) return; - WNA(na->ifp) = NULL; + NM_DETACH_NA(na->ifp); } @@ -3426,10 +3441,10 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s } if (arg == NULL || arg->ifp == NULL) - goto fail; + return EINVAL; ifp = arg->ifp; - if (NA(ifp) && !NM_NA_VALID(ifp)) { + if (NM_NA_CLASH(ifp)) { /* If NA(ifp) is not null but there is no valid netmap * adapter it means that someone else is using the same * pointer (e.g. ax25_ptr on linux). This happens for @@ -3456,28 +3471,8 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s NM_ATTACH_NA(ifp, &hwna->up); -#ifdef linux - if (ifp->netdev_ops) { - /* prepare a clone of the netdev ops */ -#ifndef NETMAP_LINUX_HAVE_NETDEV_OPS - hwna->nm_ndo.ndo_start_xmit = ifp->netdev_ops; -#else - hwna->nm_ndo = *ifp->netdev_ops; -#endif /* NETMAP_LINUX_HAVE_NETDEV_OPS */ - } - hwna->nm_ndo.ndo_start_xmit = linux_netmap_start_xmit; - hwna->nm_ndo.ndo_change_mtu = linux_netmap_change_mtu; - if (ifp->ethtool_ops) { - hwna->nm_eto = *ifp->ethtool_ops; - } - hwna->nm_eto.set_ringparam = linux_netmap_set_ringparam; -#ifdef NETMAP_LINUX_HAVE_SET_CHANNELS - hwna->nm_eto.set_channels = linux_netmap_set_channels; -#endif /* NETMAP_LINUX_HAVE_SET_CHANNELS */ - if (arg->nm_config == NULL) { - hwna->up.nm_config = netmap_linux_config; - } -#endif /* linux */ + nm_os_onattach(ifp); + if (arg->nm_dtor == NULL) { hwna->up.nm_dtor = netmap_hw_dtor; } @@ -3545,7 +3540,10 @@ netmap_hw_krings_create(struct netmap_adapter *na) int ret = netmap_krings_create(na, 0); if (ret == 0) { /* initialize the mbq for the sw rx ring */ - mbq_safe_init(&na->rx_rings[na->num_rx_rings]->rx_queue); + u_int lim = netmap_real_rings(na, NR_RX), i; + for (i = na->num_rx_rings; i < lim; i++) { + mbq_safe_init(&NMR(na, NR_RX)[i]->rx_queue); + } ND("initialized sw rx queue %d", na->num_rx_rings); } return ret; @@ -3608,8 +3606,14 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) unsigned int txr; struct mbq *q; int busy; + u_int i; - kring = na->rx_rings[na->num_rx_rings]; + i = MBUF_TXQ(m); + if (i >= na->num_host_rx_rings) { + i = i % na->num_host_rx_rings; + } + kring = NMR(na, NR_RX)[nma_get_nrings(na, NR_RX) + i]; + // XXX [Linux] we do not need this lock // if we follow the down/configure/up protocol -gl // mtx_lock(&na->core_lock); @@ -3639,8 +3643,15 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) goto done; } - if (nm_os_mbuf_has_offld(m)) { - RD(1, "%s drop mbuf that needs offloadings", na->name); + if (!netmap_generic_hwcsum) { + if (nm_os_mbuf_has_csum_offld(m)) { + RD(1, "%s drop mbuf that needs checksum offload", na->name); + goto done; + } + } + + if (nm_os_mbuf_has_seg_offld(m)) { + RD(1, "%s drop mbuf that needs generic segmentation offload", na->name); goto done; } @@ -3843,6 +3854,40 @@ netmap_rx_irq(struct ifnet *ifp, u_int q, u_int *work_ } return netmap_common_irq(na, q, work_done); +} + +/* set/clear native flags and if_transmit/netdev_ops */ +void +nm_set_native_flags(struct netmap_adapter *na) +{ + struct ifnet *ifp = na->ifp; + + /* We do the setup for intercepting packets only if we are the + * first user of this adapapter. */ + if (na->active_fds > 0) { + return; + } + + na->na_flags |= NAF_NETMAP_ON; + nm_os_onenter(ifp); + nm_update_hostrings_mode(na); +} + +void +nm_clear_native_flags(struct netmap_adapter *na) +{ + struct ifnet *ifp = na->ifp; + + /* We undo the setup for intercepting packets only if we are the + * last user of this adapapter. */ + if (na->active_fds > 0) { + return; + } + + nm_update_hostrings_mode(na); + nm_os_onexit(ifp); + + na->na_flags &= ~NAF_NETMAP_ON; } Added: head/sys/dev/netmap/netmap_bdg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/netmap_bdg.c Tue Oct 23 08:55:16 2018 (r339639) @@ -0,0 +1,1827 @@ +/* + * Copyright (C) 2013-2016 Universita` di Pisa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +/* + * This module implements the VALE switch for netmap + +--- VALE SWITCH --- + +NMG_LOCK() serializes all modifications to switches and ports. +A switch cannot be deleted until all ports are gone. + +For each switch, an SX lock (RWlock on linux) protects +deletion of ports. When configuring or deleting a new port, the +lock is acquired in exclusive mode (after holding NMG_LOCK). +When forwarding, the lock is acquired in shared mode (without NMG_LOCK). +The lock is held throughout the entire forwarding cycle, +during which the thread may incur in a page fault. +Hence it is important that sleepable shared locks are used. + +On the rx ring, the per-port lock is grabbed initially to reserve +a number of slot in the ring, then the lock is released, +packets are copied from source to destination, and then +the lock is acquired again and the receive ring is updated. +(A similar thing is done on the tx ring for NIC and host stack +ports attached to the switch) + + */ + +/* + * OS-specific code that is used only within this file. + * Other OS-specific code that must be accessed by drivers + * is present in netmap_kern.h + */ + +#if defined(__FreeBSD__) +#include /* prerequisite */ +__FBSDID("$FreeBSD$"); + +#include +#include +#include /* defines used in kernel.h */ +#include /* types used in module initialization */ +#include /* cdevsw struct, UID, GID */ +#include +#include /* struct socket */ +#include +#include +#include +#include /* sockaddrs */ +#include +#include +#include +#include +#include /* BIOCIMMEDIATE */ +#include /* bus_dmamap_* */ +#include +#include +#include + + +#elif defined(linux) + +#include "bsd_glue.h" + +#elif defined(__APPLE__) + +#warning OSX support is only partial +#include "osx_glue.h" + +#elif defined(_WIN32) +#include "win_glue.h" + +#else + +#error Unsupported platform + +#endif /* unsupported */ + +/* + * common headers + */ + +#include +#include +#include + +#include + +const char* +netmap_bdg_name(struct netmap_vp_adapter *vp) +{ + struct nm_bridge *b = vp->na_bdg; + if (b == NULL) + return NULL; + return b->bdg_basename; +} + + +#ifndef CONFIG_NET_NS +/* + * XXX in principle nm_bridges could be created dynamically + * Right now we have a static array and deletions are protected + * by an exclusive lock. + */ +static struct nm_bridge *nm_bridges; +#endif /* !CONFIG_NET_NS */ + + +static int +nm_is_id_char(const char c) +{ + return (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + (c == '_'); +} + +/* Validate the name of a VALE bridge port and return the + * position of the ":" character. */ +static int +nm_vale_name_validate(const char *name) +{ + int colon_pos = -1; + int i; + + if (!name || strlen(name) < strlen(NM_BDG_NAME)) { + return -1; + } + + for (i = 0; i < NM_BDG_IFNAMSIZ && name[i]; i++) { + if (name[i] == ':') { + colon_pos = i; + break; + } else if (!nm_is_id_char(name[i])) { + return -1; + } + } + + if (strlen(name) - colon_pos > IFNAMSIZ) { + /* interface name too long */ + return -1; + } + + return colon_pos; +} + +/* + * locate a bridge among the existing ones. + * MUST BE CALLED WITH NMG_LOCK() + * + * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. + * We assume that this is called with a name of at least NM_NAME chars. + */ +struct nm_bridge * +nm_find_bridge(const char *name, int create, struct netmap_bdg_ops *ops) +{ + int i, namelen; + struct nm_bridge *b = NULL, *bridges; + u_int num_bridges; + + NMG_LOCK_ASSERT(); + + netmap_bns_getbridges(&bridges, &num_bridges); + + namelen = nm_vale_name_validate(name); + if (namelen < 0) { + D("invalid bridge name %s", name ? name : NULL); + return NULL; + } + + /* lookup the name, remember empty slot if there is one */ + for (i = 0; i < num_bridges; i++) { + struct nm_bridge *x = bridges + i; + + if ((x->bdg_flags & NM_BDG_ACTIVE) + x->bdg_active_ports == 0) { + if (create && b == NULL) + b = x; /* record empty slot */ + } else if (x->bdg_namelen != namelen) { + continue; + } else if (strncmp(name, x->bdg_basename, namelen) == 0) { + ND("found '%.*s' at %d", namelen, name, i); + b = x; + break; + } + } + if (i == num_bridges && b) { /* name not found, can create entry */ + /* initialize the bridge */ + ND("create new bridge %s with ports %d", b->bdg_basename, + b->bdg_active_ports); + b->ht = nm_os_malloc(sizeof(struct nm_hash_ent) * NM_BDG_HASH); + if (b->ht == NULL) { + D("failed to allocate hash table"); + return NULL; + } + strncpy(b->bdg_basename, name, namelen); + b->bdg_namelen = namelen; + b->bdg_active_ports = 0; + for (i = 0; i < NM_BDG_MAXPORTS; i++) + b->bdg_port_index[i] = i; + /* set the default function */ + b->bdg_ops = ops; + b->private_data = b->ht; + b->bdg_flags = 0; + NM_BNS_GET(b); + } + return b; +} + + +int +netmap_bdg_free(struct nm_bridge *b) +{ + if ((b->bdg_flags & NM_BDG_ACTIVE) + b->bdg_active_ports != 0) { + return EBUSY; + } + + ND("marking bridge %s as free", b->bdg_basename); + nm_os_free(b->ht); + b->bdg_ops = NULL; + b->bdg_flags = 0; + NM_BNS_PUT(b); + return 0; +} + + +/* remove from bridge b the ports in slots hw and sw + * (sw can be -1 if not needed) + */ +void +netmap_bdg_detach_common(struct nm_bridge *b, int hw, int sw) +{ + int s_hw = hw, s_sw = sw; + int i, lim =b->bdg_active_ports; + uint32_t *tmp = b->tmp_bdg_port_index; + + /* + New algorithm: + make a copy of bdg_port_index; + lookup NA(ifp)->bdg_port and SWNA(ifp)->bdg_port + in the array of bdg_port_index, replacing them with + entries from the bottom of the array; + decrement bdg_active_ports; + acquire BDG_WLOCK() and copy back the array. + */ + + if (netmap_verbose) + D("detach %d and %d (lim %d)", hw, sw, lim); + /* make a copy of the list of active ports, update it, + * and then copy back within BDG_WLOCK(). + */ + memcpy(b->tmp_bdg_port_index, b->bdg_port_index, sizeof(b->tmp_bdg_port_index)); + for (i = 0; (hw >= 0 || sw >= 0) && i < lim; ) { + if (hw >= 0 && tmp[i] == hw) { + ND("detach hw %d at %d", hw, i); + lim--; /* point to last active port */ + tmp[i] = tmp[lim]; /* swap with i */ + tmp[lim] = hw; /* now this is inactive */ + hw = -1; + } else if (sw >= 0 && tmp[i] == sw) { + ND("detach sw %d at %d", sw, i); + lim--; + tmp[i] = tmp[lim]; + tmp[lim] = sw; + sw = -1; + } else { + i++; + } + } + if (hw >= 0 || sw >= 0) { + D("XXX delete failed hw %d sw %d, should panic...", hw, sw); + } + + BDG_WLOCK(b); + if (b->bdg_ops->dtor) + b->bdg_ops->dtor(b->bdg_ports[s_hw]); + b->bdg_ports[s_hw] = NULL; + if (s_sw >= 0) { + b->bdg_ports[s_sw] = NULL; + } + memcpy(b->bdg_port_index, b->tmp_bdg_port_index, sizeof(b->tmp_bdg_port_index)); + b->bdg_active_ports = lim; + BDG_WUNLOCK(b); + + ND("now %d active ports", lim); + netmap_bdg_free(b); +} + + +/* nm_bdg_ctl callback for VALE ports */ +int +netmap_vp_bdg_ctl(struct nmreq_header *hdr, struct netmap_adapter *na) +{ + struct netmap_vp_adapter *vpna = (struct netmap_vp_adapter *)na; + struct nm_bridge *b = vpna->na_bdg; + + if (hdr->nr_reqtype == NETMAP_REQ_VALE_ATTACH) { + return 0; /* nothing to do */ + } + if (b) { + netmap_set_all_rings(na, 0 /* disable */); + netmap_bdg_detach_common(b, vpna->bdg_port, -1); + vpna->na_bdg = NULL; + netmap_set_all_rings(na, 1 /* enable */); + } + /* I have took reference just for attach */ + netmap_adapter_put(na); + return 0; +} + +int +netmap_default_bdg_attach(const char *name, struct netmap_adapter *na, + struct nm_bridge *b) +{ + return NM_NEED_BWRAP; +} + +/* Try to get a reference to a netmap adapter attached to a VALE switch. + * If the adapter is found (or is created), this function returns 0, a + * non NULL pointer is returned into *na, and the caller holds a + * reference to the adapter. + * If an adapter is not found, then no reference is grabbed and the + * function returns an error code, or 0 if there is just a VALE prefix + * mismatch. Therefore the caller holds a reference when + * (*na != NULL && return == 0). + */ +int +netmap_get_bdg_na(struct nmreq_header *hdr, struct netmap_adapter **na, + struct netmap_mem_d *nmd, int create, struct netmap_bdg_ops *ops) +{ + char *nr_name = hdr->nr_name; + const char *ifname; + struct ifnet *ifp = NULL; + int error = 0; + struct netmap_vp_adapter *vpna, *hostna = NULL; + struct nm_bridge *b; + uint32_t i, j; + uint32_t cand = NM_BDG_NOPORT, cand2 = NM_BDG_NOPORT; + int needed; + + *na = NULL; /* default return value */ + + /* first try to see if this is a bridge port. */ + NMG_LOCK_ASSERT(); + if (strncmp(nr_name, ops->name, strlen(ops->name) - 1)) { + return 0; /* no error, but no VALE prefix */ + } + + b = nm_find_bridge(nr_name, create, ops); + if (b == NULL) { + ND("no bridges available for '%s'", nr_name); + return (create ? ENOMEM : ENXIO); + } + if (strlen(nr_name) < b->bdg_namelen) /* impossible */ + panic("x"); + + /* Now we are sure that name starts with the bridge's name, + * lookup the port in the bridge. We need to scan the entire + * list. It is not important to hold a WLOCK on the bridge + * during the search because NMG_LOCK already guarantees + * that there are no other possible writers. + */ + + /* lookup in the local list of ports */ + for (j = 0; j < b->bdg_active_ports; j++) { + i = b->bdg_port_index[j]; + vpna = b->bdg_ports[i]; + ND("checking %s", vpna->up.name); + if (!strcmp(vpna->up.name, nr_name)) { + netmap_adapter_get(&vpna->up); + ND("found existing if %s refs %d", nr_name) + *na = &vpna->up; + return 0; + } + } + /* not found, should we create it? */ + if (!create) + return ENXIO; + /* yes we should, see if we have space to attach entries */ + needed = 2; /* in some cases we only need 1 */ + if (b->bdg_active_ports + needed >= NM_BDG_MAXPORTS) { + D("bridge full %d, cannot create new port", b->bdg_active_ports); + return ENOMEM; + } + /* record the next two ports available, but do not allocate yet */ + cand = b->bdg_port_index[b->bdg_active_ports]; + cand2 = b->bdg_port_index[b->bdg_active_ports + 1]; + ND("+++ bridge %s port %s used %d avail %d %d", + b->bdg_basename, ifname, b->bdg_active_ports, cand, cand2); + + /* + * try see if there is a matching NIC with this name + * (after the bridge's name) + */ + ifname = nr_name + b->bdg_namelen + 1; + ifp = ifunit_ref(ifname); + if (!ifp) { + /* Create an ephemeral virtual port. + * This block contains all the ephemeral-specific logic. + */ + + if (hdr->nr_reqtype != NETMAP_REQ_REGISTER) { + error = EINVAL; + goto out; + } + + /* bdg_netmap_attach creates a struct netmap_adapter */ + error = b->bdg_ops->vp_create(hdr, NULL, nmd, &vpna); + if (error) { + D("error %d", error); + goto out; + } + /* shortcut - we can skip get_hw_na(), + * ownership check and nm_bdg_attach() + */ + + } else { + struct netmap_adapter *hw; + + /* the vale:nic syntax is only valid for some commands */ + switch (hdr->nr_reqtype) { + case NETMAP_REQ_VALE_ATTACH: + case NETMAP_REQ_VALE_DETACH: + case NETMAP_REQ_VALE_POLLING_ENABLE: + case NETMAP_REQ_VALE_POLLING_DISABLE: + break; /* ok */ + default: + error = EINVAL; + goto out; + } + + error = netmap_get_hw_na(ifp, nmd, &hw); + if (error || hw == NULL) + goto out; + + /* host adapter might not be created */ + error = hw->nm_bdg_attach(nr_name, hw, b); + if (error == NM_NEED_BWRAP) { + error = b->bdg_ops->bwrap_attach(nr_name, hw); + } + if (error) + goto out; + vpna = hw->na_vp; + hostna = hw->na_hostvp; + if (hdr->nr_reqtype == NETMAP_REQ_VALE_ATTACH) { + /* Check if we need to skip the host rings. */ + struct nmreq_vale_attach *areq = + (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body; + if (areq->reg.nr_mode != NR_REG_NIC_SW) { + hostna = NULL; + } + } + } + + BDG_WLOCK(b); + vpna->bdg_port = cand; + ND("NIC %p to bridge port %d", vpna, cand); + /* bind the port to the bridge (virtual ports are not active) */ + b->bdg_ports[cand] = vpna; + vpna->na_bdg = b; + b->bdg_active_ports++; + if (hostna != NULL) { + /* also bind the host stack to the bridge */ + b->bdg_ports[cand2] = hostna; + hostna->bdg_port = cand2; + hostna->na_bdg = b; + b->bdg_active_ports++; + ND("host %p to bridge port %d", hostna, cand2); + } + ND("if %s refs %d", ifname, vpna->up.na_refcount); + BDG_WUNLOCK(b); + *na = &vpna->up; + netmap_adapter_get(*na); + +out: + if (ifp) + if_rele(ifp); + + return error; +} + +/* Process NETMAP_REQ_VALE_ATTACH. + */ +int +nm_bdg_ctl_attach(struct nmreq_header *hdr, void *auth_token) +{ + struct nmreq_vale_attach *req = + (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body; + struct netmap_vp_adapter * vpna; + struct netmap_adapter *na = NULL; + struct netmap_mem_d *nmd = NULL; + struct nm_bridge *b = NULL; + int error; + + NMG_LOCK(); + /* permission check for modified bridges */ + b = nm_find_bridge(hdr->nr_name, 0 /* don't create */, NULL); + if (b && !nm_bdg_valid_auth_token(b, auth_token)) { + error = EACCES; + goto unlock_exit; + } + + if (req->reg.nr_mem_id) { + nmd = netmap_mem_find(req->reg.nr_mem_id); + if (nmd == NULL) { + error = EINVAL; + goto unlock_exit; + } + } + + /* check for existing one */ + error = netmap_get_vale_na(hdr, &na, nmd, 0); + if (na) { + error = EBUSY; + goto unref_exit; + } + error = netmap_get_vale_na(hdr, &na, + nmd, 1 /* create if not exists */); + if (error) { /* no device */ + goto unlock_exit; + } + + if (na == NULL) { /* VALE prefix missing */ + error = EINVAL; + goto unlock_exit; + } + + if (NETMAP_OWNED_BY_ANY(na)) { + error = EBUSY; + goto unref_exit; + } + + if (na->nm_bdg_ctl) { + /* nop for VALE ports. The bwrap needs to put the hwna + * in netmap mode (see netmap_bwrap_bdg_ctl) + */ + error = na->nm_bdg_ctl(hdr, na); + if (error) + goto unref_exit; + ND("registered %s to netmap-mode", na->name); + } + vpna = (struct netmap_vp_adapter *)na; + req->port_index = vpna->bdg_port; + NMG_UNLOCK(); + return 0; + +unref_exit: + netmap_adapter_put(na); +unlock_exit: + NMG_UNLOCK(); + return error; +} + +static inline int +nm_is_bwrap(struct netmap_adapter *na) +{ + return na->nm_register == netmap_bwrap_reg; +} + +/* Process NETMAP_REQ_VALE_DETACH. + */ +int +nm_bdg_ctl_detach(struct nmreq_header *hdr, void *auth_token) +{ + struct nmreq_vale_detach *nmreq_det = (void *)(uintptr_t)hdr->nr_body; + struct netmap_vp_adapter *vpna; + struct netmap_adapter *na; + struct nm_bridge *b = NULL; + int error; + + NMG_LOCK(); + /* permission check for modified bridges */ + b = nm_find_bridge(hdr->nr_name, 0 /* don't create */, NULL); + if (b && !nm_bdg_valid_auth_token(b, auth_token)) { + error = EACCES; + goto unlock_exit; + } + + error = netmap_get_vale_na(hdr, &na, NULL, 0 /* don't create */); + if (error) { /* no device, or another bridge or user owns the device */ + goto unlock_exit; + } + + if (na == NULL) { /* VALE prefix missing */ + error = EINVAL; + goto unlock_exit; + } else if (nm_is_bwrap(na) && + ((struct netmap_bwrap_adapter *)na)->na_polling_state) { + /* Don't detach a NIC with polling */ + error = EBUSY; + goto unref_exit; + } + + vpna = (struct netmap_vp_adapter *)na; + if (na->na_vp != vpna) { + /* trying to detach first attach of VALE persistent port attached + * to 2 bridges + */ + error = EBUSY; + goto unref_exit; + } + nmreq_det->port_index = vpna->bdg_port; + + if (na->nm_bdg_ctl) { + /* remove the port from bridge. The bwrap + * also needs to put the hwna in normal mode + */ + error = na->nm_bdg_ctl(hdr, na); + } + +unref_exit: + netmap_adapter_put(na); +unlock_exit: + NMG_UNLOCK(); + return error; + +} + +struct nm_bdg_polling_state; +struct +nm_bdg_kthread { + struct nm_kctx *nmk; + u_int qfirst; + u_int qlast; + struct nm_bdg_polling_state *bps; +}; + +struct nm_bdg_polling_state { + bool configured; + bool stopped; + struct netmap_bwrap_adapter *bna; + uint32_t mode; + u_int qfirst; + u_int qlast; + u_int cpu_from; + u_int ncpus; + struct nm_bdg_kthread *kthreads; +}; + +static void +netmap_bwrap_polling(void *data, int is_kthread) +{ + struct nm_bdg_kthread *nbk = data; + struct netmap_bwrap_adapter *bna; + u_int qfirst, qlast, i; + struct netmap_kring **kring0, *kring; + + if (!nbk) + return; + qfirst = nbk->qfirst; + qlast = nbk->qlast; + bna = nbk->bps->bna; + kring0 = NMR(bna->hwna, NR_RX); + + for (i = qfirst; i < qlast; i++) { + kring = kring0[i]; + kring->nm_notify(kring, 0); + } +} + +static int +nm_bdg_create_kthreads(struct nm_bdg_polling_state *bps) +{ + struct nm_kctx_cfg kcfg; + int i, j; + + bps->kthreads = nm_os_malloc(sizeof(struct nm_bdg_kthread) * bps->ncpus); + if (bps->kthreads == NULL) + return ENOMEM; + + bzero(&kcfg, sizeof(kcfg)); + kcfg.worker_fn = netmap_bwrap_polling; + kcfg.use_kthread = 1; + for (i = 0; i < bps->ncpus; i++) { + struct nm_bdg_kthread *t = bps->kthreads + i; + int all = (bps->ncpus == 1 && + bps->mode == NETMAP_POLLING_MODE_SINGLE_CPU); + int affinity = bps->cpu_from + i; + + t->bps = bps; + t->qfirst = all ? bps->qfirst /* must be 0 */: affinity; + t->qlast = all ? bps->qlast : t->qfirst + 1; + D("kthread %d a:%u qf:%u ql:%u", i, affinity, t->qfirst, + t->qlast); + + kcfg.type = i; + kcfg.worker_private = t; + t->nmk = nm_os_kctx_create(&kcfg, NULL); + if (t->nmk == NULL) { + goto cleanup; + } + nm_os_kctx_worker_setaff(t->nmk, affinity); + } + return 0; + +cleanup: + for (j = 0; j < i; j++) { + struct nm_bdg_kthread *t = bps->kthreads + i; + nm_os_kctx_destroy(t->nmk); + } + nm_os_free(bps->kthreads); + return EFAULT; +} + +/* A variant of ptnetmap_start_kthreads() */ +static int +nm_bdg_polling_start_kthreads(struct nm_bdg_polling_state *bps) +{ + int error, i, j; + + if (!bps) { + D("polling is not configured"); + return EFAULT; + } + bps->stopped = false; + + for (i = 0; i < bps->ncpus; i++) { + struct nm_bdg_kthread *t = bps->kthreads + i; + error = nm_os_kctx_worker_start(t->nmk); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Oct 23 09:23:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D643107261E; Tue, 23 Oct 2018 09:23:24 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::600]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A409072459; Tue, 23 Oct 2018 09:23:23 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward100o.mail.yandex.net (Yandex) with ESMTP id E6EBA2A20D4F; Tue, 23 Oct 2018 12:22:00 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 7wGAzBMxi9-M0riAj03; Tue, 23 Oct 2018 12:22:00 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1540286520; bh=WsKcp1BtD+6RyxHyxb9f51cJ8GFh6+1BoISlEtJsnqI=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=V+iCFpJ+CaU6KE5lcncKYUA0BiLjkcaKk0aC7/+4oZAlt2iRNBq6GrPXQ/rpf+wGv fvBygj2egmLaqf36qN6aAs5vIHbVev+4b/qAxeSUb14nwulRo9CGkk4WxS5rl9USeY x+qYVO4Iuffm16gVNQJtttLOBfOMAzypRbUcIkLo= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TGTL59o6rL-LxD878qU; Tue, 23 Oct 2018 12:21:59 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1540286519; bh=WsKcp1BtD+6RyxHyxb9f51cJ8GFh6+1BoISlEtJsnqI=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=SIi73MnS1lyWdKwKURxaZybm3uCsDmSrbrTn4ZhjU3EwfmjOjYgzk3NjvgVIVqhmr NSeSWchbf9lN5G0180x8CgJdHff9YLWb3EFtTTtWA+f1rWadDXfjgIg0F/OshOC8Al UkmqpsMuVIUZiqjxHBR0sIcbjNhD/qqV5/+w+bRg= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r339634 - in head/sys: kern net To: Eric Joyner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810230437.w9N4bTxf050789@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <6536ef10-5749-144d-dbd9-91addd2f38e4@yandex.ru> Date: Tue, 23 Oct 2018 12:20:19 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201810230437.w9N4bTxf050789@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg" 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, 23 Oct 2018 09:23:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg Content-Type: multipart/mixed; boundary="PeJZkjwDB9ds7P29gjielr2Tyss0Br2vC"; protected-headers="v1" From: "Andrey V. Elsukov" To: Eric Joyner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <6536ef10-5749-144d-dbd9-91addd2f38e4@yandex.ru> Subject: Re: svn commit: r339634 - in head/sys: kern net References: <201810230437.w9N4bTxf050789@repo.freebsd.org> In-Reply-To: <201810230437.w9N4bTxf050789@repo.freebsd.org> --PeJZkjwDB9ds7P29gjielr2Tyss0Br2vC Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 23.10.2018 07:37, Eric Joyner wrote: > Author: erj > Date: Tue Oct 23 04:37:29 2018 > New Revision: 339634 > URL: https://svnweb.freebsd.org/changeset/base/339634 >=20 > Log: > iflib: drain enqueued tasks before detaching from taskqgroup > =20 > The taskqgroup_detach function does not check if task is already enqu= eued when > detaching it. This may lead to kernel panic if enqueued task starts a= fter > context state lock is destroyed. Ensure that the already enqueued adm= in tasks > are executed before detaching them. > =20 > The issue was discovered during validation of D16429. Unloading of if= _ixlv > followed by immediate removal of VFs with iovctl -D may lead to panic= on > NODEBUG kernel. > =20 > As well, check if iflib is in detach before enqueueing new admin or i= ov > tasks, to prevent new tasks from executing while the taskqgroup tasks= > are being drained. > =20 > Submitted by: Krzysztof Galazka > Reviewed by: shurd@, erj@ > Sponsored by: Intel Corporation > Differential Revision: https://reviews.freebsd.org/D17404 Hi, with this revision my system panics at boot. Reverting only this revision helps. % pciconf -l | grep ^em em0@pci0:0:25:0: class=3D0x020000 card=3D0x20088086 chip=3D0x15028086 rev= =3D0x04 hdr=3D0x00 <6>lo0: link state changed to UP panic: mtx_lock() by idle thread 0xfffff800035eb000 on sleep mutex em0 @ /home/devel/freebsd/base/head/sys/net/iflib.c:2084 cpuid =3D 2 time =3D 1540283649 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0077964610 vpanic() at vpanic+0x1a3/frame 0xfffffe0077964670 panic() at panic+0x43/frame 0xfffffe00779646d0 __mtx_lock_flags() at __mtx_lock_flags+0x15a/frame 0xfffffe0077964720 iflib_admin_intr_deferred() at iflib_admin_intr_deferred+0x2a/frame 0xfffffe0077964750 em_intr() at em_intr+0x72/frame 0xfffffe0077964780 iflib_fast_intr_ctx() at iflib_fast_intr_ctx+0x21/frame 0xfffffe00779647a= 0 intr_event_handle() at intr_event_handle+0xbb/frame 0xfffffe00779647f0 intr_execute_handlers() at intr_execute_handlers+0x58/frame 0xfffffe0077964820 lapic_handle_intr() at lapic_handle_intr+0x5f/frame 0xfffffe0077964840 Xapic_isr1() at Xapic_isr1+0xd9/frame 0xfffffe0077964840 --- interrupt, rip =3D 0xffffffff811dfab6, rsp =3D 0xfffffe0077964910, rb= p =3D 0xfffffe0077964910 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe0077964910 acpi_cpu_idle() at acpi_cpu_idle+0x23d/frame 0xfffffe0077964960 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe0077964980 cpu_idle() at cpu_idle+0xa7/frame 0xfffffe00779649a0 sched_idletd() at sched_idletd+0x517/frame 0xfffffe0077964a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0077964ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0077964ab0 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- KDB: enter: panic __curthread () at ./machine/pcpu.h:230 230 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" (OFFSETOF_CURTHREAD)); (kgdb) #0 __curthread () at ./machine/pcpu.h:230 #1 doadump (textdump=3D1) at /home/devel/freebsd/base/head/sys/kern/kern_shutdown.c:366 #2 0xffffffff8046586c in db_fncall_generic (addr=3D, rv=3D, nargs=3D, args=3D= ) at /home/devel/freebsd/base/head/sys/ddb/db_command.c:609 #3 db_fncall (dummy1=3D, dummy2=3D, dummy3=3D, dummy4=3D) at /home/devel/freebsd/base/head/sys/ddb/db_command.c:657 #4 0xffffffff804653a9 in db_command (last_cmdp=3D, cmd_table=3D, dopager=3D) at /home/devel/freebsd/base/head/sys/ddb/db_command.c:481 #5 0xffffffff80465124 in db_command_loop () at /home/devel/freebsd/base/head/sys/ddb/db_command.c:534 #6 0xffffffff8046833f in db_trap (type=3D, code=3D) at /home/devel/freebsd/base/head/sys/ddb/db_main.c:252 #7 0xffffffff80be69a7 in kdb_trap (type=3D3, code=3D0, tf=3D0xfffffe0077= 964540) at /home/devel/freebsd/base/head/sys/kern/subr_kdb.c:693 #8 0xffffffff81073be6 in trap (frame=3D0xfffffe0077964540) at /home/devel/freebsd/base/head/sys/amd64/amd64/trap.c:619 #9 #10 kdb_enter (why=3D0xffffffff81309de7 "panic", msg=3D) at /home/devel/freebsd/base/head/sys/kern/subr_kdb.c:479 #11 0xffffffff80b9e670 in vpanic (fmt=3D, ap=3D0xfffffe00779646b0) at /home/devel/freebsd/base/head/sys/kern/kern_shutdown.c:861 #12 0xffffffff80b9e413 in panic ( fmt=3D0xffffffff81e8e1a8 "g\344,\201\377\377\377\377") at /home/devel/freebsd/base/head/sys/kern/kern_shutdown.c:799 #13 0xffffffff80b7d85a in __mtx_lock_flags (c=3D0xfffff800039cc598, opts=3D, file=3D0xffffffff8134fa4e "/home/devel/freebsd/base/head/sys/net/iflib.c", line=3D2084) at /home/devel/freebsd/base/head/sys/kern/kern_mutex.c:2= 40 #14 0xffffffff80cb968a in iflib_in_detach (ctx=3D0xfffff800039cc400) at /home/devel/freebsd/base/head/sys/net/iflib.c:2084 #15 iflib_admin_intr_deferred (ctx=3D0xfffff800039cc400) at /home/devel/freebsd/base/head/sys/net/iflib.c:5977 #16 0xffffffff805d7382 in em_intr (arg=3D0xfffffe0000665000) at /home/devel/freebsd/base/head/sys/dev/e1000/if_em.c:1361 #17 0xffffffff80cb8831 in iflib_fast_intr_ctx (arg=3D) at /home/devel/freebsd/base/head/sys/net/iflib.c:1549 #18 0xffffffff80b60f8b in intr_event_handle (ie=3D0xfffff80003980700, frame=3D0xfffffe0077964850) at /home/devel/freebsd/base/head/sys/kern/kern_intr.c:1225 #19 0xffffffff811e3208 in intr_execute_handlers (isrc=3D0xfffff8000396af0= 0, frame=3D0xfffffe0077964850) at /home/devel/freebsd/base/head/sys/x86/x86/intr_machdep.c:358 #20 0xffffffff811e929f in lapic_handle_intr (vector=3D, frame=3D0xfffffe0077964850) at /home/devel/freebsd/base/head/sys/x86/x86/local_apic.c:1293 #21 #22 acpi_cpu_c1 () at /home/devel/freebsd/base/head/sys/x86/x86/cpu_machdep.c:140 #23 0xffffffff80489cad in acpi_cpu_idle (sbt=3D) at /home/devel/freebsd/base/head/sys/dev/acpica/acpi_cpu.c:1187 #24 0xffffffff811e00cf in cpu_idle_acpi (sbt=3D1792802261) at /home/devel/freebsd/base/head/sys/x86/x86/cpu_machdep.c:433 #25 0xffffffff811e0187 in cpu_idle (busy=3D0) at /home/devel/freebsd/base/head/sys/x86/x86/cpu_machdep.c:581 #26 0xffffffff80bce5c7 in sched_idletd (dummy=3D) at /home/devel/freebsd/base/head/sys/kern/sched_ule.c:2829 #27 0xffffffff80b5e574 in fork_exit ( callout=3D0xffffffff80bce0b0 , arg=3D0x0, frame=3D0xfffffe0077964ac0) at /home/devel/freebsd/base/head/sys/kern/kern_fork.c:1057 #28 (kgdb) --=20 WBR, Andrey V. Elsukov --PeJZkjwDB9ds7P29gjielr2Tyss0Br2vC-- --fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg 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/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlvO59MACgkQAcXqBBDI oXoElggAhtfF6OfDdjTPM8XmpNqB/G+GknoBjbEDzJtIcS7y2zqw3wO4+VB6CELj jL1e6AAs53BD5qHn0emO0bjfFi92+fbgk7P7/txFfdNDlYWjnasOxbeSmX1ZStk3 6jMj53eK7HDnfJhZnuTM9JOBndvxXWK/QQl37u4P1cIkcvxIU1dZcgkhCMBHYxov SZhBckTrg+SLmU5X2hp+gi412yMYdOHoHaHzwLfDnpyOCtc7uj5AkFZpfOIV/icK Fu7pSWcLg11HwgvEKBq3/8IPzI2m9lUSSg+HzE39lNeWI0b+j1e5XzZoa0bMP2wd LESHY2A71E3D5+xedXaNWqiHZr5jxw== =e8jM -----END PGP SIGNATURE----- --fuupesl9eOG2kZuZpK35X7y4hoNR1UUVg-- From owner-svn-src-head@freebsd.org Tue Oct 23 09:43:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FBA11072FFF; Tue, 23 Oct 2018 09:43:45 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 3D85C7319A; Tue, 23 Oct 2018 09:43:45 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 5479FD00B9F; Tue, 23 Oct 2018 05:43:39 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.15.2/8.15.2) with ESMTPS id w9N9hb0T023494 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Oct 2018 11:43:38 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.15.2/8.15.2/Submit) id w9N9hbg9023493; Tue, 23 Oct 2018 11:43:37 +0200 (CEST) (envelope-from pho) Date: Tue, 23 Oct 2018 11:43:37 +0200 From: Peter Holm To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339634 - in head/sys: kern net Message-ID: <20181023094337.GA23352@x2.osted.lan> References: <201810230437.w9N4bTxf050789@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810230437.w9N4bTxf050789@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-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: Tue, 23 Oct 2018 09:43:46 -0000 On Tue, Oct 23, 2018 at 04:37:29AM +0000, Eric Joyner wrote: > Author: erj > Date: Tue Oct 23 04:37:29 2018 > New Revision: 339634 > URL: https://svnweb.freebsd.org/changeset/base/339634 > > Log: > iflib: drain enqueued tasks before detaching from taskqgroup > > The taskqgroup_detach function does not check if task is already enqueued when > detaching it. This may lead to kernel panic if enqueued task starts after > context state lock is destroyed. Ensure that the already enqueued admin tasks > are executed before detaching them. > > The issue was discovered during validation of D16429. Unloading of if_ixlv > followed by immediate removal of VFs with iovctl -D may lead to panic on > NODEBUG kernel. > > As well, check if iflib is in detach before enqueueing new admin or iov > tasks, to prevent new tasks from executing while the taskqgroup tasks > are being drained. > > Submitted by: Krzysztof Galazka > Reviewed by: shurd@, erj@ > Sponsored by: Intel Corporation > Differential Revision: https://reviews.freebsd.org/D17404 > > Modified: > head/sys/kern/subr_gtaskqueue.c > head/sys/net/iflib.c > > Modified: head/sys/kern/subr_gtaskqueue.c > ============================================================================== > --- head/sys/kern/subr_gtaskqueue.c Tue Oct 23 03:30:14 2018 (r339633) This commit seems to trigger: panic: mtx_lock() by idle thread 0xfffff808400e5000 on sleep mutex igb0 @ ../../../net/iflib.c:2084 cpuid = 6 time = 1540287664 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0078778620 vpanic() at vpanic+0x1a3/frame 0xfffffe0078778680 panic() at panic+0x43/frame 0xfffffe00787786e0 __mtx_lock_flags() at __mtx_lock_flags+0x15a/frame 0xfffffe0078778730 iflib_admin_intr_deferred() at iflib_admin_intr_deferred+0x2a/frame 0xfffffe0078778760 em_msix_link() at em_msix_link+0x84/frame 0xfffffe0078778790 iflib_fast_intr_ctx() at iflib_fast_intr_ctx+0x21/frame 0xfffffe00787787b0 intr_event_handle() at intr_event_handle+0xbb/frame 0xfffffe0078778800 intr_execute_handlers() at intr_execute_handlers+0x58/frame 0xfffffe0078778830 lapic_handle_intr() at lapic_handle_intr+0x5f/frame 0xfffffe0078778850 Xapic_isr1() at Xapic_isr1+0xd9/frame 0xfffffe0078778850 --- interrupt, rip = 0xffffffff80489d11, rsp = 0xfffffe0078778920, rbp = 0xfffffe0078778960 --- acpi_cpu_idle() at acpi_cpu_idle+0x2a1/frame 0xfffffe0078778960 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe0078778980 cpu_idle() at cpu_idle+0xa7/frame 0xfffffe00787789a0 sched_idletd() at sched_idletd+0x517/frame 0xfffffe0078778a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0078778ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0078778ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 11 tid 100009 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> x/s version version: FreeBSD 13.0-CURRENT r339634 PHO-GENERIC\012 db> - Peter From owner-svn-src-head@freebsd.org Tue Oct 23 12:50:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CBEFD6B30; Tue, 23 Oct 2018 12:50:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F89A7A45B; Tue, 23 Oct 2018 12:50:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 559F810129; Tue, 23 Oct 2018 12:50:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NCoT3A005993; Tue, 23 Oct 2018 12:50:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NCoTRZ005992; Tue, 23 Oct 2018 12:50:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810231250.w9NCoTRZ005992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 23 Oct 2018 12:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339642 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339642 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, 23 Oct 2018 12:50:29 -0000 Author: ae Date: Tue Oct 23 12:50:28 2018 New Revision: 339642 URL: https://svnweb.freebsd.org/changeset/base/339642 Log: Remove softc from idhash when interface is destroyed. MFC after: 20 days Modified: head/sys/net/if_ipsec.c Modified: head/sys/net/if_ipsec.c ============================================================================== --- head/sys/net/if_ipsec.c Tue Oct 23 11:34:15 2018 (r339641) +++ head/sys/net/if_ipsec.c Tue Oct 23 12:50:28 2018 (r339642) @@ -214,6 +214,12 @@ ipsec_clone_destroy(struct ifnet *ifp) sx_xlock(&ipsec_ioctl_sx); sc = ifp->if_softc; ipsec_delete_tunnel(sc); + /* + * Delete softc from idhash on interface destroy, since + * ipsec_delete_tunnel() keeps reqid unchanged. + */ + if (sc->reqid != 0) + CK_LIST_REMOVE(sc, idhash); bpfdetach(ifp); if_detach(ifp); ifp->if_softc = NULL; @@ -1025,13 +1031,11 @@ ipsec_delete_tunnel(struct ipsec_softc *sc) sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if (sc->family != 0) { CK_LIST_REMOVE(sc, srchash); - IPSEC_WAIT(); - + sc->family = 0; /* * Make sure that ipsec_if_input() will not do access * to softc's policies. */ - sc->family = 0; IPSEC_WAIT(); key_unregister_ifnet(sc->sp, IPSEC_SPCOUNT); From owner-svn-src-head@freebsd.org Tue Oct 23 12:53:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FE75FD6D8B; Tue, 23 Oct 2018 12:53:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEC3B7A932; Tue, 23 Oct 2018 12:53:09 +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 C61D7102C0; Tue, 23 Oct 2018 12:53:09 +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 w9NCr9Cd010690; Tue, 23 Oct 2018 12:53:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NCr9T6010689; Tue, 23 Oct 2018 12:53:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810231253.w9NCr9T6010689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 23 Oct 2018 12:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339643 - head/sys/dev/ipw X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/ipw X-SVN-Commit-Revision: 339643 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, 23 Oct 2018 12:53:10 -0000 Author: glebius Date: Tue Oct 23 12:53:09 2018 New Revision: 339643 URL: https://svnweb.freebsd.org/changeset/base/339643 Log: Fix ipw_start(), where logic was reverted in r287197. PR: 232554 Submitted by: gl00my@mail.ru Modified: head/sys/dev/ipw/if_ipw.c Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Tue Oct 23 12:50:28 2018 (r339642) +++ head/sys/dev/ipw/if_ipw.c Tue Oct 23 12:53:09 2018 (r339643) @@ -1732,7 +1732,7 @@ ipw_start(struct ipw_softc *sc) IPW_LOCK_ASSERT(sc); - while (sc->txfree < 1 + IPW_MAX_NSEG && + while (sc->txfree >= 1 + IPW_MAX_NSEG && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (ipw_tx_start(sc, m, ni) != 0) { From owner-svn-src-head@freebsd.org Tue Oct 23 13:00:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6979FD7175; Tue, 23 Oct 2018 13:00:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B69E7AE39; Tue, 23 Oct 2018 13:00:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67FEE102C9; Tue, 23 Oct 2018 13:00:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ND0CF8011157; Tue, 23 Oct 2018 13:00:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ND0Cvg011156; Tue, 23 Oct 2018 13:00:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810231300.w9ND0Cvg011156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Oct 2018 13:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339645 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339645 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, 23 Oct 2018 13:00:13 -0000 Author: emaste Date: Tue Oct 23 13:00:11 2018 New Revision: 339645 URL: https://svnweb.freebsd.org/changeset/base/339645 Log: sort {delete,check}-old* output It is more convenient to review old libraries, files, and directories in order. Sort check-* after checking for existence of files for efficiency, and because /usr/lib/debug entries are added while iterating over the list. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17649 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 23 12:54:17 2018 (r339644) +++ head/Makefile.inc1 Tue Oct 23 13:00:11 2018 (r339645) @@ -2779,7 +2779,7 @@ delete-old-files: .PHONY @exec 3<&0; \ cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ + -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | sort | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ @@ -2795,7 +2795,7 @@ delete-old-files: .PHONY done # Remove catpages without corresponding manpages. @exec 3<&0; \ - find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \ + find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | sort | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ while read catpage; do \ read manpage; \ @@ -2819,7 +2819,7 @@ check-old-files: .PHONY echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ fi; \ done; \ - done + done | sort # Check for catpages without corresponding manpages. @find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ @@ -2828,7 +2828,7 @@ check-old-files: .PHONY if [ ! -e "$${manpage}" ]; then \ echo $${catpage}; \ fi; \ - done + done | sort delete-old-libs: .PHONY @echo ">>> Removing old libraries" @@ -2836,7 +2836,7 @@ delete-old-libs: .PHONY @exec 3<&0; \ cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_LIBS | xargs -n1 | \ + -V OLD_LIBS | xargs -n1 | sort | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ @@ -2866,7 +2866,7 @@ check-old-libs: .PHONY echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \ fi; \ done; \ - done + done | sort delete-old-dirs: .PHONY @echo ">>> Removing old directories" @@ -2891,7 +2891,7 @@ check-old-dirs: .PHONY @echo ">>> Checking for old directories" @cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_DIRS | xargs -n1 | \ + -V OLD_DIRS | xargs -n1 | sort -r | \ while read dir; do \ if [ -d "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir}"; \ From owner-svn-src-head@freebsd.org Tue Oct 23 13:03:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FCDFFD73E4; Tue, 23 Oct 2018 13:03:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6FDE7B2EF; Tue, 23 Oct 2018 13:03:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1DA11045D; Tue, 23 Oct 2018 13:03:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ND336k016373; Tue, 23 Oct 2018 13:03:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ND33C1016372; Tue, 23 Oct 2018 13:03:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810231303.w9ND33C1016372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 23 Oct 2018 13:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339646 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339646 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, 23 Oct 2018 13:03:04 -0000 Author: ae Date: Tue Oct 23 13:03:03 2018 New Revision: 339646 URL: https://svnweb.freebsd.org/changeset/base/339646 Log: Add the check that current VNET is ready and access to srchash is allowed. ipsec_srcaddr() callback can be called during VNET teardown, since ingress address checking subsystem isn't VNET specific. And thus callback can make access to already freed memory. To prevent this, use V_ipsec_idhtbl pointer as indicator of VNET readiness. And make epoch_wait() after resetting it to NULL in vnet_ipsec_uninit() to be sure that ipsec_srcaddr() is finished its work. Reported by: kp MFC after: 20 days Modified: head/sys/net/if_ipsec.c Modified: head/sys/net/if_ipsec.c ============================================================================== --- head/sys/net/if_ipsec.c Tue Oct 23 13:00:11 2018 (r339645) +++ head/sys/net/if_ipsec.c Tue Oct 23 13:03:03 2018 (r339646) @@ -273,6 +273,13 @@ vnet_ipsec_uninit(const void *unused __unused) if_clone_detach(V_ipsec_cloner); free(V_ipsec_idhtbl, M_IPSEC); + /* + * Use V_ipsec_idhtbl pointer as indicator that VNET is going to be + * destroyed, it is used by ipsec_srcaddr() callback. + */ + V_ipsec_idhtbl = NULL; + IPSEC_WAIT(); + #ifdef INET if (IS_DEFAULT_VNET(curvnet)) ip_encap_unregister_srcaddr(ipsec4_srctab); @@ -784,6 +791,10 @@ ipsec_srcaddr(void *arg __unused, const struct sockadd { struct ipsec_softc *sc; struct secasindex *saidx; + + /* Check that VNET is ready */ + if (V_ipsec_idhtbl == NULL) + return; MPASS(in_epoch(net_epoch_preempt)); CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { From owner-svn-src-head@freebsd.org Tue Oct 23 13:03:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 709FFFD7436; Tue, 23 Oct 2018 13:03:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 253637B424; Tue, 23 Oct 2018 13:03:25 +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 2018A10460; Tue, 23 Oct 2018 13:03:25 +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 w9ND3Pxk016432; Tue, 23 Oct 2018 13:03:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ND3Ptj016431; Tue, 23 Oct 2018 13:03:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810231303.w9ND3Ptj016431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Oct 2018 13:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339647 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 339647 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, 23 Oct 2018 13:03:25 -0000 Author: emaste Date: Tue Oct 23 13:03:24 2018 New Revision: 339647 URL: https://svnweb.freebsd.org/changeset/base/339647 Log: arch.7: update final ia64 release to 10.4 No more 10.x releases are planned. Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Tue Oct 23 13:03:03 2018 (r339646) +++ head/share/man/man7/arch.7 Tue Oct 23 13:03:24 2018 (r339647) @@ -97,7 +97,7 @@ architectures, the final release. .It armeb Ta 8.0 Ta 11.x .It armv6 Ta 10.0 .It armv7 Ta 12.0 -.It ia64 Ta 5.0 Ta 10.x +.It ia64 Ta 5.0 Ta 10.4 .It i386 Ta 1.0 .It mips Ta 8.0 .It mipsel Ta 9.0 From owner-svn-src-head@freebsd.org Tue Oct 23 13:07:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4491DFD767A; Tue, 23 Oct 2018 13:07:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E79A17B712; Tue, 23 Oct 2018 13:07:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E029510465; Tue, 23 Oct 2018 13:07:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ND743N016776; Tue, 23 Oct 2018 13:07:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ND7408016772; Tue, 23 Oct 2018 13:07:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810231307.w9ND7408016772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Oct 2018 13:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339648 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 339648 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, 23 Oct 2018 13:07:05 -0000 Author: emaste Date: Tue Oct 23 13:07:03 2018 New Revision: 339648 URL: https://svnweb.freebsd.org/changeset/base/339648 Log: ar: report errno on warning/error Previously ar would report an error like "ar: fatal: Write error" without including additional errno information. Change warnings and errors to include archive_errno() so that the user may have some idea of the reason for the failure. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17650 Modified: head/usr.bin/ar/acpyacc.y head/usr.bin/ar/ar.h head/usr.bin/ar/read.c head/usr.bin/ar/write.c Modified: head/usr.bin/ar/acpyacc.y ============================================================================== --- head/usr.bin/ar/acpyacc.y Tue Oct 23 13:03:24 2018 (r339647) +++ head/usr.bin/ar/acpyacc.y Tue Oct 23 13:07:03 2018 (r339648) @@ -254,7 +254,8 @@ arscp_open(char *fname) archive_read_support_format_ar(a); AC(archive_read_open_filename(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); AC(archive_read_close(a)); AC(archive_read_free(a)); if (r != ARCHIVE_OK) Modified: head/usr.bin/ar/ar.h ============================================================================== --- head/usr.bin/ar/ar.h Tue Oct 23 13:03:24 2018 (r339647) +++ head/usr.bin/ar/ar.h Tue Oct 23 13:07:03 2018 (r339648) @@ -52,10 +52,10 @@ /* * Convenient wrapper for general libarchive error handling. */ -#define AC(CALL) do { \ - if ((CALL)) \ - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", \ - archive_error_string(a)); \ +#define AC(CALL) do { \ + if ((CALL)) \ + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", \ + archive_error_string(a)); \ } while (0) /* Modified: head/usr.bin/ar/read.c ============================================================================== --- head/usr.bin/ar/read.c Tue Oct 23 13:03:24 2018 (r339647) +++ head/usr.bin/ar/read.c Tue Oct 23 13:07:03 2018 (r339648) @@ -96,7 +96,8 @@ read_archive(struct bsdar *bsdar, char mode) r = archive_read_next_header(a, &entry); if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_EOF || r == ARCHIVE_FATAL) break; if (r == ARCHIVE_RETRY) { @@ -151,7 +152,7 @@ read_archive(struct bsdar *bsdar, char mode) if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) { (void)fprintf(stdout, "\n"); - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } @@ -205,7 +206,7 @@ read_archive(struct bsdar *bsdar, char mode) } if (r) - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } } Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Tue Oct 23 13:03:24 2018 (r339647) +++ head/usr.bin/ar/write.c Tue Oct 23 13:07:03 2018 (r339648) @@ -291,12 +291,13 @@ read_objs(struct bsdar *bsdar, const char *archive, in for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_FATAL) - bsdar_errc(bsdar, EX_DATAERR, 0, "%s", + bsdar_errc(bsdar, EX_DATAERR, archive_errno(a), "%s", archive_error_string(a)); if (r == ARCHIVE_EOF) break; if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_RETRY) { bsdar_warnc(bsdar, 0, "Retrying..."); continue; @@ -341,7 +342,7 @@ read_objs(struct bsdar *bsdar, const char *archive, in bsdar_errc(bsdar, EX_SOFTWARE, errno, "malloc failed"); if (archive_read_data(a, buff, size) != (ssize_t)size) { - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); free(buff); continue; @@ -594,7 +595,7 @@ write_data(struct bsdar *bsdar, struct archive *a, con while (s > 0) { written = archive_write_data(a, buf, s); if (written < 0) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", archive_error_string(a)); buf = (const char *)buf + written; s -= written; From owner-svn-src-head@freebsd.org Tue Oct 23 13:11:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E024FD794A; Tue, 23 Oct 2018 13:11:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 003247BB60; Tue, 23 Oct 2018 13:11:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF488105DF; Tue, 23 Oct 2018 13:11:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NDBkSL020760; Tue, 23 Oct 2018 13:11:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NDBknc020756; Tue, 23 Oct 2018 13:11:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810231311.w9NDBknc020756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 23 Oct 2018 13:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339649 - in head/sys: net netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: net netinet netinet6 X-SVN-Commit-Revision: 339649 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, 23 Oct 2018 13:11:47 -0000 Author: ae Date: Tue Oct 23 13:11:45 2018 New Revision: 339649 URL: https://svnweb.freebsd.org/changeset/base/339649 Log: Add the check that current VNET is ready and access to srchash is allowed. This change is similar to r339646. The callback that checks for appearing and disappearing of tunnel ingress address can be called during VNET teardown. To prevent access to already freed memory, add check to the callback and epoch_wait() call to be sure that callback has finished its work. MFC after: 20 days Modified: head/sys/net/if_me.c head/sys/netinet/in_gif.c head/sys/netinet/ip_gre.c head/sys/netinet6/in6_gif.c head/sys/netinet6/ip6_gre.c Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Tue Oct 23 13:07:03 2018 (r339648) +++ head/sys/net/if_me.c Tue Oct 23 13:11:45 2018 (r339649) @@ -161,6 +161,7 @@ me_hashinit(void) static void vnet_me_init(const void *unused __unused) { + V_me_cloner = if_clone_simple(mename, me_clone_create, me_clone_destroy, 0); } @@ -173,6 +174,8 @@ vnet_me_uninit(const void *unused __unused) if (V_me_hashtbl != NULL) { free(V_me_hashtbl, M_IFME); + V_me_hashtbl = NULL; + ME_WAIT(); free(V_me_srchashtbl, M_IFME); } if_clone_detach(V_me_cloner); @@ -363,7 +366,8 @@ me_srcaddr(void *arg __unused, const struct sockaddr * const struct sockaddr_in *sin; struct me_softc *sc; - if (V_me_srchashtbl == NULL) + /* Check that VNET is ready */ + if (V_me_hashtbl == NULL) return; MPASS(in_epoch(net_epoch_preempt)); Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Tue Oct 23 13:07:03 2018 (r339648) +++ head/sys/netinet/in_gif.c Tue Oct 23 13:11:45 2018 (r339649) @@ -148,7 +148,8 @@ in_gif_srcaddr(void *arg __unused, const struct sockad const struct sockaddr_in *sin; struct gif_softc *sc; - if (V_ipv4_srchashtbl == NULL) + /* Check that VNET is ready */ + if (V_ipv4_hashtbl == NULL) return; MPASS(in_epoch(net_epoch_preempt)); @@ -457,6 +458,8 @@ in_gif_uninit(void) } if (V_ipv4_hashtbl != NULL) { gif_hashdestroy(V_ipv4_hashtbl); + V_ipv4_hashtbl = NULL; + GIF_WAIT(); gif_hashdestroy(V_ipv4_srchashtbl); } } Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Tue Oct 23 13:07:03 2018 (r339648) +++ head/sys/netinet/ip_gre.c Tue Oct 23 13:11:45 2018 (r339649) @@ -167,7 +167,8 @@ in_gre_srcaddr(void *arg __unused, const struct sockad const struct sockaddr_in *sin; struct gre_softc *sc; - if (V_ipv4_srchashtbl == NULL) + /* Check that VNET is ready */ + if (V_ipv4_hashtbl == NULL) return; MPASS(in_epoch(net_epoch_preempt)); @@ -350,6 +351,8 @@ in_gre_uninit(void) } if (V_ipv4_hashtbl != NULL) { gre_hashdestroy(V_ipv4_hashtbl); + V_ipv4_hashtbl = NULL; + GRE_WAIT(); gre_hashdestroy(V_ipv4_srchashtbl); } } Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Tue Oct 23 13:07:03 2018 (r339648) +++ head/sys/netinet6/in6_gif.c Tue Oct 23 13:11:45 2018 (r339649) @@ -153,7 +153,8 @@ in6_gif_srcaddr(void *arg __unused, const struct socka const struct sockaddr_in6 *sin; struct gif_softc *sc; - if (V_ipv6_srchashtbl == NULL) + /* Check that VNET is ready */ + if (V_ipv6_hashtbl == NULL) return; MPASS(in_epoch(net_epoch_preempt)); @@ -480,6 +481,8 @@ in6_gif_uninit(void) } if (V_ipv6_hashtbl != NULL) { gif_hashdestroy(V_ipv6_hashtbl); + V_ipv6_hashtbl = NULL; + GIF_WAIT(); gif_hashdestroy(V_ipv6_srchashtbl); } } Modified: head/sys/netinet6/ip6_gre.c ============================================================================== --- head/sys/netinet6/ip6_gre.c Tue Oct 23 13:07:03 2018 (r339648) +++ head/sys/netinet6/ip6_gre.c Tue Oct 23 13:11:45 2018 (r339649) @@ -160,7 +160,8 @@ in6_gre_srcaddr(void *arg __unused, const struct socka const struct sockaddr_in6 *sin; struct gre_softc *sc; - if (V_ipv6_srchashtbl == NULL) + /* Check that VNET is ready */ + if (V_ipv6_hashtbl == NULL) return; MPASS(in_epoch(net_epoch_preempt)); @@ -338,6 +339,8 @@ in6_gre_uninit(void) } if (V_ipv6_hashtbl != NULL) { gre_hashdestroy(V_ipv6_hashtbl); + V_ipv6_hashtbl = NULL; + GRE_WAIT(); gre_hashdestroy(V_ipv6_srchashtbl); } } From owner-svn-src-head@freebsd.org Tue Oct 23 13:38:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2001FD847E; Tue, 23 Oct 2018 13:38: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652A07CB35; Tue, 23 Oct 2018 13:38: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 421B610969; Tue, 23 Oct 2018 13:38: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 w9NDcegp031910; Tue, 23 Oct 2018 13:38:40 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NDceNX031909; Tue, 23 Oct 2018 13:38:40 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201810231338.w9NDceNX031909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 23 Oct 2018 13:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339651 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 339651 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, 23 Oct 2018 13:38:41 -0000 Author: tsoome Date: Tue Oct 23 13:38:39 2018 New Revision: 339651 URL: https://svnweb.freebsd.org/changeset/base/339651 Log: libsa: re-send ACK for older data packets in tftp In current tftp code we drop out-of-order packets; however, we should play nice and re-send ACK for older data packets we are receiving. This will hopefully stop server repeating those packets we already have received. Note we do not answer duplicates from "previous" session (that is, session with different port number), those will eventually time out. Differential Revision: https://reviews.freebsd.org/D17087 Modified: head/stand/libsa/tftp.c Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Tue Oct 23 13:12:42 2018 (r339650) +++ head/stand/libsa/tftp.c Tue Oct 23 13:38:39 2018 (r339651) @@ -163,7 +163,7 @@ tftp_senderr(struct tftp_handle *h, u_short errcode, c } static void -tftp_sendack(struct tftp_handle *h) +tftp_sendack(struct tftp_handle *h, u_short block) { struct { u_char header[HEADER_SIZE]; @@ -173,7 +173,7 @@ tftp_sendack(struct tftp_handle *h) wbuf.t.th_opcode = htons((u_short) ACK); wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons((u_short) h->currblock); + wbuf.t.th_block = htons(block); wtail += 2; sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); @@ -205,9 +205,17 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, case DATA: { int got; + if (htons(t->th_block) < (u_short) d->xid) { + /* + * Apparently our ACK was missed, re-send. + */ + tftp_sendack(h, htons(t->th_block)); + free(ptr); + return (-1); + } if (htons(t->th_block) != (u_short) d->xid) { /* - * Expected block? + * Packet from the future, drop this. */ free(ptr); return (-1); @@ -219,7 +227,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, struct udphdr *uh; uh = (struct udphdr *) t - 1; d->destport = uh->uh_sport; - } /* else check uh_sport has not changed??? */ + } got = len - (t->th_data - (char *)t); *pkt = ptr; *payload = t; @@ -364,7 +372,7 @@ tftp_makereq(struct tftp_handle *h) h->islastblock = 0; if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ - tftp_sendack(h); + tftp_sendack(h, h->currblock); } return (0); } From owner-svn-src-head@freebsd.org Tue Oct 23 13:49:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4BDDFD8C1D; Tue, 23 Oct 2018 13:49: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99FC17D560; Tue, 23 Oct 2018 13:49: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 94D8C10B06; Tue, 23 Oct 2018 13:49: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 w9NDnrX9037465; Tue, 23 Oct 2018 13:49:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NDnrol037464; Tue, 23 Oct 2018 13:49:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810231349.w9NDnrol037464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 23 Oct 2018 13:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339653 - head/usr.bin/ldd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/ldd X-SVN-Commit-Revision: 339653 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, 23 Oct 2018 13:49:54 -0000 Author: markj Date: Tue Oct 23 13:49:53 2018 New Revision: 339653 URL: https://svnweb.freebsd.org/changeset/base/339653 Log: Add an IMPLEMENTATION NOTES section to ldd.1. PR: 231926 Reviewed by: emaste MFC after: 1 month Modified: head/usr.bin/ldd/ldd.1 Modified: head/usr.bin/ldd/ldd.1 ============================================================================== --- head/usr.bin/ldd/ldd.1 Tue Oct 23 13:44:33 2018 (r339652) +++ head/usr.bin/ldd/ldd.1 Tue Oct 23 13:49:53 2018 (r339653) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd May 15, 2008 +.Dd October 23, 2018 .Dt LDD 1 .Os .Sh NAME @@ -57,6 +57,14 @@ option displays a verbose listing of the dynamic linki encoded in the executable. See the source code and include files for the definitive meaning of all the fields. +.Sh IMPLEMENTATION NOTES +.Nm +lists the dependencies of an executable by setting +.Xr rtld 1 +environment variables and running the executable in a child process. +If the executable is corrupt or invalid, +.Nm +may therefore fail without providing any diagnostic error messages. .Sh EXAMPLES The following is an example of a shell pipeline which uses the .Fl f @@ -67,6 +75,7 @@ which link against libc.so.6: .Sh SEE ALSO .Xr ld 1 , .Xr nm 1 , +.Xr readelf 1 , .Xr rtld 1 .Sh HISTORY A From owner-svn-src-head@freebsd.org Tue Oct 23 13:54:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ABDAFD91EA; Tue, 23 Oct 2018 13:54:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E45AB7DDA6; Tue, 23 Oct 2018 13:54:54 +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 DB1EA10CAD; Tue, 23 Oct 2018 13:54:54 +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 w9NDssxh042236; Tue, 23 Oct 2018 13:54:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NDssQC042235; Tue, 23 Oct 2018 13:54:54 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810231354.w9NDssQC042235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 23 Oct 2018 13:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339654 - head/contrib/jemalloc/src X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/contrib/jemalloc/src X-SVN-Commit-Revision: 339654 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, 23 Oct 2018 13:54:55 -0000 Author: trasz Date: Tue Oct 23 13:54:54 2018 New Revision: 339654 URL: https://svnweb.freebsd.org/changeset/base/339654 Log: Pick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream: Disable runtime detection of lazy purging support on FreeBSD. The check doesn't seem to serve any purpose here, and this shaves off three syscalls on binary startup. Discussed by: jasone MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/contrib/jemalloc/src/pages.c Modified: head/contrib/jemalloc/src/pages.c ============================================================================== --- head/contrib/jemalloc/src/pages.c Tue Oct 23 13:49:53 2018 (r339653) +++ head/contrib/jemalloc/src/pages.c Tue Oct 23 13:54:54 2018 (r339654) @@ -588,6 +588,11 @@ pages_boot(void) { init_thp_state(); +#ifdef __FreeBSD__ + /* + * FreeBSD doesn't need the check; madvise(2) is known to work. + */ +#else /* Detect lazy purge runtime support. */ if (pages_can_purge_lazy) { bool committed = false; @@ -601,6 +606,7 @@ pages_boot(void) { } os_pages_unmap(madv_free_page, PAGE); } +#endif return false; } From owner-svn-src-head@freebsd.org Tue Oct 23 14:11:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7163AFD9625; Tue, 23 Oct 2018 14:11:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 261227E5F1; Tue, 23 Oct 2018 14:11:36 +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 2110B10F8F; Tue, 23 Oct 2018 14:11:36 +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 w9NEBacx051201; Tue, 23 Oct 2018 14:11:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NEBaIl051200; Tue, 23 Oct 2018 14:11:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810231411.w9NEBaIl051200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 23 Oct 2018 14:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339655 - head/contrib/jemalloc/src X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/contrib/jemalloc/src X-SVN-Commit-Revision: 339655 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, 23 Oct 2018 14:11:36 -0000 Author: trasz Date: Tue Oct 23 14:11:35 2018 New Revision: 339655 URL: https://svnweb.freebsd.org/changeset/base/339655 Log: Pick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream: Rework the way jemalloc uses mmap(2) on FreeBSD. This makes it directly use MAP_EXCL and MAP_ALIGNED() instead of weird workarounds involving mapping at random places and then unmapping parts of them. Discussed with: jasone MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/contrib/jemalloc/src/pages.c Modified: head/contrib/jemalloc/src/pages.c ============================================================================== --- head/contrib/jemalloc/src/pages.c Tue Oct 23 13:54:54 2018 (r339654) +++ head/contrib/jemalloc/src/pages.c Tue Oct 23 14:11:35 2018 (r339655) @@ -180,6 +180,31 @@ pages_map(void *addr, size_t size, size_t alignment, b assert(alignment >= PAGE); assert(ALIGNMENT_ADDR2BASE(addr, alignment) == addr); +#if defined(__FreeBSD__) && defined(MAP_EXCL) + /* + * FreeBSD has mechanisms both to mmap at specific address without + * touching existing mappings, and to mmap with specific alignment. + */ + { + int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT; + int flags = mmap_flags; + + if (addr != NULL) { + flags |= MAP_FIXED | MAP_EXCL; + } else { + unsigned alignment_bits = ffs_zu(alignment); + assert(alignment_bits > 1); + flags |= MAP_ALIGNED(alignment_bits - 1); + } + + void *ret = mmap(addr, size, prot, flags, -1, 0); + if (ret == MAP_FAILED) { + ret = NULL; + } + + return ret; + } +#endif /* * Ideally, there would be a way to specify alignment to mmap() (like * NetBSD has), but in the absence of such a feature, we have to work From owner-svn-src-head@freebsd.org Tue Oct 23 14:16:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C46FD982D; Tue, 23 Oct 2018 14:16:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFE4F7E834; Tue, 23 Oct 2018 14:16:02 +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 A6DDB10FDC; Tue, 23 Oct 2018 14:16:02 +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 w9NEG2Ym052354; Tue, 23 Oct 2018 14:16:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NEG2Sj052353; Tue, 23 Oct 2018 14:16:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201810231416.w9NEG2Sj052353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 23 Oct 2018 14:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339656 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 339656 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, 23 Oct 2018 14:16:03 -0000 Author: cy Date: Tue Oct 23 14:16:02 2018 New Revision: 339656 URL: https://svnweb.freebsd.org/changeset/base/339656 Log: Follow up on r331936. gets_s(3) will also fail in the same way that gets(3) does. This was missed in r331936. Reported by: emaste@ MFC after: 3 days Modified: head/lib/libc/stdio/fgets.3 Modified: head/lib/libc/stdio/fgets.3 ============================================================================== --- head/lib/libc/stdio/fgets.3 Tue Oct 23 14:11:35 2018 (r339655) +++ head/lib/libc/stdio/fgets.3 Tue Oct 23 14:16:02 2018 (r339656) @@ -140,6 +140,8 @@ or .Pp The function .Fn gets +and +.Fn gets_s may also fail and set .Va errno for any of the errors specified for the routine From owner-svn-src-head@freebsd.org Tue Oct 23 14:38:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C154AFE51E2; Tue, 23 Oct 2018 14:38:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74DC67FC4F; Tue, 23 Oct 2018 14:38:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BAB811374; Tue, 23 Oct 2018 14:38:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NEc9jJ063032; Tue, 23 Oct 2018 14:38:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NEc9Vw063031; Tue, 23 Oct 2018 14:38:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810231438.w9NEc9Vw063031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 23 Oct 2018 14:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339657 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 339657 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, 23 Oct 2018 14:38:09 -0000 Author: gjb Date: Tue Oct 23 14:38:08 2018 New Revision: 339657 URL: https://svnweb.freebsd.org/changeset/base/339657 Log: Add debug.witness.trace=0 back to the installer sysctl.conf(5), incorrectly removed from head when it should have been removed from stable/12 post-branch. Reported by: bdrewery Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Oct 23 14:16:02 2018 (r339656) +++ head/release/Makefile Tue Oct 23 14:38:08 2018 (r339657) @@ -210,6 +210,7 @@ disc1: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc @@ -237,6 +238,7 @@ bootonly: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc @@ -261,6 +263,7 @@ dvd: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc From owner-svn-src-head@freebsd.org Tue Oct 23 14:44:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19CB6FE55FF; Tue, 23 Oct 2018 14:44:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2EBA80228; Tue, 23 Oct 2018 14:44:32 +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 BDCC511512; Tue, 23 Oct 2018 14:44:32 +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 w9NEiWtn067771; Tue, 23 Oct 2018 14:44:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NEiWA5067770; Tue, 23 Oct 2018 14:44:32 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201810231444.w9NEiWA5067770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 23 Oct 2018 14:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339658 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 339658 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, 23 Oct 2018 14:44:33 -0000 Author: tsoome Date: Tue Oct 23 14:44:32 2018 New Revision: 339658 URL: https://svnweb.freebsd.org/changeset/base/339658 Log: loader: biosdisk interface should be able to cope with 4k sectors The 4kn support in current bios specific biosdisk.c is broken, as the code is only implementing the support for the 512B sector size. This work is building the support for custom size sectors, we still do assume the requested data to be multiple of 512B blocks and we only do address the biosdisk.c interface here. For reference, see also: https://www.illumos.org/issues/8303 https://www.illumos.org/rb/r/547 As the GELI is moved above biosdisk "layer", the GELI should just work Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D11174 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Tue Oct 23 14:38:08 2018 (r339657) +++ head/stand/i386/libi386/biosdisk.c Tue Oct 23 14:44:32 2018 (r339658) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -255,10 +256,11 @@ bd_int13probe(struct bdinfo *bd) * Sector size must be a multiple of 512 bytes. * An alternate test would be to check power of 2, * powerof2(params.sector_size). + * 4K is largest read buffer we can use at this time. */ - if (params.sector_size % BIOSDISK_SECSIZE) - bd->bd_sectorsize = BIOSDISK_SECSIZE; - else + if (params.sector_size >= 512 && + params.sector_size <= 4096 && + (params.sector_size % BIOSDISK_SECSIZE) == 0) bd->bd_sectorsize = params.sector_size; total = bd->bd_sectorsize * params.sectors; @@ -448,16 +450,29 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - uint64_t disk_blocks; - int blks, rc; + uint64_t disk_blocks, offset; + size_t blks, blkoff, bsize, rest; + caddr_t bbuf; + int rc; - if (size % BD(dev).bd_sectorsize) { - panic("bd_strategy: %d bytes I/O not multiple of block size", - size); + /* + * First make sure the IO size is a multiple of 512 bytes. While we do + * process partial reads below, the strategy mechanism is built + * assuming IO is a multiple of 512B blocks. If the request is not + * a multiple of 512B blocks, it has to be some sort of bug. + */ + if (size == 0 || (size % BIOSDISK_SECSIZE) != 0) { + printf("bd_strategy: %d bytes I/O not multiple of %d\n", + size, BIOSDISK_SECSIZE); + return (EIO); } DEBUG("open_disk %p", dev); + offset = dblk * BIOSDISK_SECSIZE; + dblk = offset / BD(dev).bd_sectorsize; + blkoff = offset % BD(dev).bd_sectorsize; + /* * Check the value of the size argument. We do have quite small * heap (64MB), but we do not know good upper limit, so we check against @@ -465,11 +480,14 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * while translating block count to bytes. */ if (size > INT_MAX) { - DEBUG("too large read: %zu bytes", size); + DEBUG("too large I/O: %zu bytes", size); return (EIO); } blks = size / BD(dev).bd_sectorsize; + if (blks == 0 || (size % BD(dev).bd_sectorsize) != 0) + blks++; + if (dblk > dblk + blks) return (EIO); @@ -498,36 +516,75 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (dblk + blks >= dev->d_offset + disk_blocks) { blks = dev->d_offset + disk_blocks - dblk; size = blks * BD(dev).bd_sectorsize; - DEBUG("short read %d", blks); + DEBUG("short I/O %d", blks); } - switch (rw & F_MASK) { - case F_READ: - DEBUG("read %d from %lld to %p", blks, dblk, buf); + if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize == 0) + panic("BUG: Real mode buffer is too small\n"); - if (blks && (rc = bd_io(dev, dblk, blks, buf, BD_RD))) { - /* Filter out floppy controller errors */ - if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { - printf("read %d from %lld to %p, error: 0x%x\n", - blks, dblk, buf, rc); + bbuf = PTOV(V86_IO_BUFFER); + rest = size; + + while (blks > 0) { + int x = min(blks, V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize); + + switch (rw & F_MASK) { + case F_READ: + DEBUG("read %d from %lld to %p", x, dblk, buf); + bsize = BD(dev).bd_sectorsize * x - blkoff; + if (rest < bsize) + bsize = rest; + + if ((rc = bd_io(dev, dblk, x, bbuf, BD_RD)) != 0) + return (EIO); + + bcopy(bbuf + blkoff, buf, bsize); + break; + case F_WRITE : + DEBUG("write %d from %lld to %p", x, dblk, buf); + if (blkoff != 0) { + /* + * We got offset to sector, read 1 sector to + * bbuf. + */ + x = 1; + bsize = BD(dev).bd_sectorsize - blkoff; + bsize = min(bsize, rest); + rc = bd_io(dev, dblk, x, bbuf, BD_RD); + } else if (rest < BD(dev).bd_sectorsize) { + /* + * The remaining block is not full + * sector. Read 1 sector to bbuf. + */ + x = 1; + bsize = rest; + rc = bd_io(dev, dblk, x, bbuf, BD_RD); + } else { + /* We can write full sector(s). */ + bsize = BD(dev).bd_sectorsize * x; } - return (EIO); - } - break; - case F_WRITE : - DEBUG("write %d from %lld to %p", blks, dblk, buf); + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + bcopy(buf, bbuf + blkoff, bsize); + if ((rc = bd_io(dev, dblk, x, bbuf, BD_WR)) != 0) + return (EIO); - if (blks && bd_io(dev, dblk, blks, buf, BD_WR)) { - DEBUG("write error"); - return (EIO); + break; + default: + /* DO NOTHING */ + return (EROFS); } - break; - default: - /* DO NOTHING */ - return (EROFS); + + blkoff = 0; + buf += bsize; + rest -= bsize; + blks -= x; + dblk += x; } - if (rsize) + if (rsize != NULL) *rsize = size; return (0); } @@ -604,21 +661,16 @@ bd_io_workaround(struct disk_devdesc *dev) bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD); } - static int bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int dowrite) { - u_int x, sec, result, resid, retry, maxfer; - caddr_t p, xp, bbuf; - + int result, retry; + /* Just in case some idiot actually tries to read/write -1 blocks... */ if (blks < 0) return (-1); - resid = blks; - p = dest; - /* * Workaround for a problem with some HP ProLiant BIOS failing to work * out the boot disk after installation. hrs and kuriyama discovered @@ -627,91 +679,49 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks * the bios. The problem is alleviated by doing an extra read before * the buggy read. It is not immediately known whether other models * are similarly affected. + * Loop retrying the operation a couple of times. The BIOS + * may also retry. */ if (dowrite == BD_RD && dblk >= 0x100000000) bd_io_workaround(dev); + for (retry = 0; retry < 3; retry++) { + /* if retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0; + v86.edx = BD(dev).bd_unit; + v86int(); + } - /* Decide whether we have to bounce */ - if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && - (VTOP(dest) >> 16) != - (VTOP(dest + blks * BD(dev).bd_sectorsize) >> 16))) { + if (BD(dev).bd_flags & BD_MODEEDD1) + result = bd_edd_io(dev, dblk, blks, dest, dowrite); + else + result = bd_chs_io(dev, dblk, blks, dest, dowrite); - /* - * There is a 64k physical boundary somewhere in the - * destination buffer, or the destination buffer is above - * first 1MB of physical memory so we have to arrange a - * suitable bounce buffer. Allocate a buffer twice as large - * as we need to. Use the bottom half unless there is a break - * there, in which case we use the top half. - */ - x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; - x = min(x, (unsigned)blks); - bbuf = PTOV(V86_IO_BUFFER); - maxfer = x; /* limit transfers to bounce region size */ - } else { - bbuf = NULL; - maxfer = 0; + if (result == 0) + break; } - - while (resid > 0) { - /* - * Play it safe and don't cross track boundaries. - * (XXX this is probably unnecessary) - */ - sec = dblk % BD(dev).bd_sec; /* offset into track */ - x = min(BD(dev).bd_sec - sec, resid); - if (maxfer > 0) - x = min(x, maxfer); /* fit bounce buffer */ - /* where do we transfer to? */ - xp = bbuf == NULL ? p : bbuf; - - /* - * Put your Data In, Put your Data out, - * Put your Data In, and shake it all about - */ - if (dowrite == BD_WR && bbuf != NULL) - bcopy(p, bbuf, x * BD(dev).bd_sectorsize); - - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; - v86.edx = BD(dev).bd_unit; - v86int(); - } - - if (BD(dev).bd_flags & BD_MODEEDD1) - result = bd_edd_io(dev, dblk, x, xp, dowrite); - else - result = bd_chs_io(dev, dblk, x, xp, dowrite); - if (result == 0) - break; + /* + * 0x20 - Controller failure. This is common error when the + * media is not present. + */ + if (result != 0 && result != 0x20) { + if (dowrite == BD_WR) { + printf("%s%d: Write %d sector(s) from %p (0x%x) " + "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, + dev->dd.d_unit, blks, dest, VTOP(dest), dblk, + result); + } else { + printf("%s%d: Read %d sector(s) from %lld to %p " + "(0x%x): 0x%x\n", dev->dd.d_dev->dv_name, + dev->dd.d_unit, blks, dblk, dest, VTOP(dest), + result); } - - if (dowrite == BD_WR) - DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, - p, VTOP(p), dblk, result ? "failed" : "ok"); - else - DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, - dblk, p, VTOP(p), result ? "failed" : "ok"); - if (result) { - return (result); - } - if (dowrite == BD_RD && bbuf != NULL) - bcopy(bbuf, p, x * BD(dev).bd_sectorsize); - p += (x * BD(dev).bd_sectorsize); - dblk += x; - resid -= x; } - return (0); + return (result); } /* From owner-svn-src-head@freebsd.org Tue Oct 23 15:34:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 620BCFE9FD1; Tue, 23 Oct 2018 15:34:44 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BC78238F; Tue, 23 Oct 2018 15:34:44 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 112D111D52; Tue, 23 Oct 2018 15:34:44 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NFYhiL093535; Tue, 23 Oct 2018 15:34:43 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NFYhhj093530; Tue, 23 Oct 2018 15:34:43 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810231534.w9NFYhhj093530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 23 Oct 2018 15:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339659 - in head: share/man/man4 tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: share/man/man4 tools/tools/netmap X-SVN-Commit-Revision: 339659 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, 23 Oct 2018 15:34:44 -0000 Author: vmaffione Date: Tue Oct 23 15:34:43 2018 New Revision: 339659 URL: https://svnweb.freebsd.org/changeset/base/339659 Log: netmap: add man page for the bridge program Added bridge(8). Also, minor fixes to the netmap "bridge" application: - indentation fixes and code cleanup - better usage description - better processing of netmap flags Reviewed by: 0mp Approved by: gnn (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17664 Added: head/tools/tools/netmap/bridge.8 (contents, props changed) Modified: head/share/man/man4/netmap.4 head/tools/tools/netmap/bridge.c head/tools/tools/netmap/pkt-gen.8 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Tue Oct 23 14:44:32 2018 (r339658) +++ head/share/man/man4/netmap.4 Tue Oct 23 15:34:43 2018 (r339659) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2017 +.Dd October 23, 2018 .Dt NETMAP 4 .Os .Sh NAME @@ -1073,6 +1073,9 @@ Other clients attached to the same switch can now communicate with the network card or the host. .Sh SEE ALSO +.Xr pkt-gen 8 , +.Xr bridge 8 +.Pp .Pa http://info.iet.unipi.it/~luigi/netmap/ .Pp Luigi Rizzo, Revisiting network I/O APIs: the netmap framework, Added: head/tools/tools/netmap/bridge.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netmap/bridge.8 Tue Oct 23 15:34:43 2018 (r339659) @@ -0,0 +1,82 @@ +.\" Copyright (c) 2016 Luigi Rizzo, Universita` di Pisa +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 23, 2018 +.Dt BRIDGE 8 +.Os +.Sh NAME +.Nm bridge +.Nd netmap client to bridge two netmap ports +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "bridge" +.It Nm +.Op Fl i Ar port +.Op Fl b Ar batch size +.Op Fl w Ar wait-link +.Op Fl v +.Op Fl c +.El +.Ek +.Sh DESCRIPTION +.Nm +is a simple netmap application that bridges packets between two netmap ports. +If the two netmap ports use the same netmap memory region +.Nm +forwards packets without copying the packets payload (zero-copy mode), unless +explicitly prevented by the +.Fl c +flag. +.Bl -tag -width Ds +.It Fl i Ar port +Name of the netmap port. +It can be supplied up to two times to identify the ports that must be bridged. +Any netmap port type (physical interface, VALE switch, pipe, monitor port...) +can be used. +If the option is supplied only once, then it must be for a physical interface and, in that case, +.Nm +will bridge the port and the host stack. +.It Fl b Ar batch-size +Maximum number of packets to send in one operation. +.It Fl w Ar wait-link +indicates the number of seconds to wait before transmitting. +It defaults to 2, and may be useful when talking to physical +ports to let link negotiation complete before starting transmission. +.It Fl v +Enable verbose mode +.It Fl c +Disable zero-copy mode. +.El +.Sh SEE ALSO +.Xr netmap 4 , +.Xr pkt-gen 8 +.Sh AUTHORS +.An -nosplit +.Nm +has been written by +.An Luigi Rizzo +and +.An Matteo Landi +at the Universita` di Pisa, Italy. Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Tue Oct 23 14:44:32 2018 (r339658) +++ head/tools/tools/netmap/bridge.c Tue Oct 23 15:34:43 2018 (r339659) @@ -34,18 +34,18 @@ sigint_h(int sig) int pkt_queued(struct nm_desc *d, int tx) { - u_int i, tot = 0; + u_int i, tot = 0; - if (tx) { - for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { - tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); - } - } else { - for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { - tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); - } - } - return tot; + if (tx) { + for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { + tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); + } + } else { + for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { + tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); + } + } + return tot; } /* @@ -76,13 +76,13 @@ process_rings(struct netmap_ring *rxring, struct netma /* swap packets */ if (ts->buf_idx < 2 || rs->buf_idx < 2) { - D("wrong index rx[%d] = %d -> tx[%d] = %d", + RD(5, "wrong index rx[%d] = %d -> tx[%d] = %d", j, rs->buf_idx, k, ts->buf_idx); sleep(2); } /* copy the packet length. */ - if (rs->len > 2048) { - D("wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); + if (rs->len > rxring->nr_buf_size) { + RD(5, "wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); rs->len = 0; } else if (verbose > 1) { D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); @@ -95,6 +95,8 @@ process_rings(struct netmap_ring *rxring, struct netma /* report the buffer change. */ ts->flags |= NS_BUF_CHANGED; rs->flags |= NS_BUF_CHANGED; + /* copy the NS_MOREFRAG */ + rs->flags = (rs->flags & ~NS_MOREFRAG) | (ts->flags & NS_MOREFRAG); } else { char *rxbuf = NETMAP_BUF(rxring, rs->buf_idx); char *txbuf = NETMAP_BUF(txring, ts->buf_idx); @@ -117,7 +119,7 @@ move(struct nm_desc *src, struct nm_desc *dst, u_int l { struct netmap_ring *txring, *rxring; u_int m = 0, si = src->first_rx_ring, di = dst->first_tx_ring; - const char *msg = (src->req.nr_ringid & NETMAP_SW_RING) ? + const char *msg = (src->req.nr_flags == NR_REG_SW) ? "host->net" : "net->host"; while (si <= src->last_rx_ring && di <= dst->last_tx_ring) { @@ -143,7 +145,20 @@ static void usage(void) { fprintf(stderr, - "usage: bridge [-v] [-i ifa] [-i ifb] [-b burst] [-w wait_time] [ifa [ifb [burst]]]\n"); + "netmap bridge program: forward packets between two " + "network interfaces\n" + " usage(1): bridge [-v] [-i ifa] [-i ifb] [-b burst] " + "[-w wait_time] [-L]\n" + " usage(2): bridge [-v] [-w wait_time] [-L] " + "[ifa [ifb [burst]]]\n" + "\n" + " ifa and ifb are specified using the nm_open() syntax.\n" + " When ifb is missing (or is equal to ifa), bridge will\n" + " forward between between ifa and the host stack if -L\n" + " is not specified, otherwise loopback traffic on ifa.\n" + "\n" + " example: bridge -w 10 -i netmap:eth3 -i netmap:eth1\n" + ); exit(1); } @@ -163,14 +178,16 @@ main(int argc, char **argv) struct nm_desc *pa = NULL, *pb = NULL; char *ifa = NULL, *ifb = NULL; char ifabuf[64] = { 0 }; + int loopback = 0; - fprintf(stderr, "%s built %s %s\n", - argv[0], __DATE__, __TIME__); + fprintf(stderr, "%s built %s %s\n\n", argv[0], __DATE__, __TIME__); - while ( (ch = getopt(argc, argv, "b:ci:vw:")) != -1) { + while ((ch = getopt(argc, argv, "hb:ci:vw:L")) != -1) { switch (ch) { default: D("bad option %c %s", ch, optarg); + /* fallthrough */ + case 'h': usage(); break; case 'b': /* burst */ @@ -194,6 +211,9 @@ main(int argc, char **argv) case 'w': wait_link = atoi(optarg); break; + case 'L': + loopback = 1; + break; } } @@ -222,9 +242,13 @@ main(int argc, char **argv) wait_link = 4; } if (!strcmp(ifa, ifb)) { - D("same interface, endpoint 0 goes to host"); - snprintf(ifabuf, sizeof(ifabuf) - 1, "%s^", ifa); - ifa = ifabuf; + if (!loopback) { + D("same interface, endpoint 0 goes to host"); + snprintf(ifabuf, sizeof(ifabuf) - 1, "%s^", ifa); + ifa = ifabuf; + } else { + D("same interface, loopbacking traffic"); + } } else { /* two different interfaces. Take all rings on if1 */ } @@ -243,7 +267,7 @@ main(int argc, char **argv) zerocopy = zerocopy && (pa->mem == pb->mem); D("------- zerocopy %ssupported", zerocopy ? "" : "NOT "); - /* setup poll(2) variables. */ + /* setup poll(2) array */ memset(pollfd, 0, sizeof(pollfd)); pollfd[0].fd = pa->fd; pollfd[1].fd = pb->fd; @@ -263,18 +287,16 @@ main(int argc, char **argv) n0 = pkt_queued(pa, 0); n1 = pkt_queued(pb, 0); #if defined(_WIN32) || defined(BUSYWAIT) - if (n0){ + if (n0) { ioctl(pollfd[1].fd, NIOCTXSYNC, NULL); pollfd[1].revents = POLLOUT; - } - else { + } else { ioctl(pollfd[0].fd, NIOCRXSYNC, NULL); } - if (n1){ + if (n1) { ioctl(pollfd[0].fd, NIOCTXSYNC, NULL); pollfd[0].revents = POLLOUT; - } - else { + } else { ioctl(pollfd[1].fd, NIOCRXSYNC, NULL); } ret = 1; @@ -287,8 +309,10 @@ main(int argc, char **argv) pollfd[0].events |= POLLOUT; else pollfd[1].events |= POLLIN; + + /* poll() also cause kernel to txsync/rxsync the NICs */ ret = poll(pollfd, 2, 2500); -#endif //defined(_WIN32) || defined(BUSYWAIT) +#endif /* defined(_WIN32) || defined(BUSYWAIT) */ if (ret <= 0 || verbose) D("poll %s [0] ev %x %x rx %d@%d tx %d," " [1] ev %x %x rx %d@%d tx %d", @@ -316,18 +340,15 @@ main(int argc, char **argv) D("error on fd1, rx [%d,%d,%d)", rx->head, rx->cur, rx->tail); } - if (pollfd[0].revents & POLLOUT) { + if (pollfd[0].revents & POLLOUT) move(pb, pa, burst); - // XXX we don't need the ioctl */ - // ioctl(me[0].fd, NIOCTXSYNC, NULL); - } - if (pollfd[1].revents & POLLOUT) { + + if (pollfd[1].revents & POLLOUT) move(pa, pb, burst); - // XXX we don't need the ioctl */ - // ioctl(me[1].fd, NIOCTXSYNC, NULL); - } + + /* We don't need ioctl(NIOCTXSYNC) on the two file descriptors here, + * kernel will txsync on next poll(). */ } - D("exiting"); nm_close(pb); nm_close(pa); Modified: head/tools/tools/netmap/pkt-gen.8 ============================================================================== --- head/tools/tools/netmap/pkt-gen.8 Tue Oct 23 14:44:32 2018 (r339658) +++ head/tools/tools/netmap/pkt-gen.8 Tue Oct 23 15:34:43 2018 (r339659) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2016 +.Dd October 23, 2018 .Dt PKT-GEN 8 .Os .Sh NAME @@ -170,10 +170,9 @@ packets to be received by the target host. .Dl .Nm -i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 -.Sh FILES -.Xr netmap 4 .Sh SEE ALSO -.Xr netmap 4 +.Xr netmap 4 , +.Xr bridge 8 .Sh AUTHORS This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . From owner-svn-src-head@freebsd.org Tue Oct 23 15:41:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 034D9FEA402; Tue, 23 Oct 2018 15:41:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A74882B4F; Tue, 23 Oct 2018 15:41:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id EynwgpYFY1jEDEynxgcn48; Tue, 23 Oct 2018 09:41:14 -0600 X-Authority-Analysis: v=2.3 cv=W/aMqiek c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=smKx5t2vBNcA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=DSHT9BU3AAAA:8 a=WUIPhXQWiyYIYI8gKDUA:9 a=jklPvFAKvOX8gjHU:21 a=y1gyoRiRoFa-LYvn:21 a=QEXdDO2ut3YA:10 a=K18A3tn0-rEuzAXC8TkA:9 a=yny1GjbhH21OAmSn:21 a=sfqfZOwAzBG0_j6c:21 a=osFmxWBz9zXBFo9r:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=8ljxv5-TN0tg3ptMfEC3:22 Received: from [10.168.101.253] (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 067AD431; Tue, 23 Oct 2018 08:41:11 -0700 (PDT) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r339658 - head/stand/i386/libi386 Date: Tue, 23 Oct 2018 08:41:14 -0700 To: Toomas Soome , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <20181023154112.067AD431@spqr.komquats.com> X-CMAE-Envelope: MS4wfPa3JlKXyxzOwPuA7zbj9Vi1Qjk4mnymd6uC7ECUOewQvpk4pgAnmowzx1qAqTedXtX0nQuE1FLgW/ZuP3RLen7Lnmbsu9jDgixJ7dbND+lWNchkrbVt aq9CLVcKLaJmkZmFAf5H1EORclR7YYqy4rBV/XB7vpaNYcFag7nkFv8wafjSsB6O9AIhaMlZ/1xJWHyliqL0q5p2SGDJvk/L9R+LSaPXWUDuCHFkWslR/W// OOYsbZ81d1ie0rIjlDd8g4lSfxgufsL2ezoelDvf1uA= 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, 23 Oct 2018 15:41:22 -0000 Thank you Toomas. --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Also, this old phone only supports top post. Apologies. Cy Schubert or The need of the many outweighs the greed of the few. --- -----Original Message----- From: Toomas Soome Sent: 23/10/2018 07:44 To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: svn commit: r339658 - head/stand/i386/libi386 Author: tsoome Date: Tue Oct 23 14:44:32 2018 New Revision: 339658 URL: https://svnweb.freebsd.org/changeset/base/339658 Log: loader: biosdisk interface should be able to cope with 4k sectors =20 The 4kn support in current bios specific biosdisk.c is broken, as the cod= e is only implementing the support for the 512B sector size. =20 This work is building the support for custom size sectors, we still do as= sume the requested data to be multiple of 512B blocks and we only do address t= he biosdisk.c interface here. =20 For reference, see also: https://www.illumos.org/issues/8303 https://www.illumos.org/rb/r/547 =20 As the GELI is moved above biosdisk "layer", the GELI should just work =20 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D11174 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.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/stand/i386/libi386/biosdisk.c Tue Oct 23 14:38:08 2018 (r339657) +++ head/stand/i386/libi386/biosdisk.c Tue Oct 23 14:44:32 2018 (r339658) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include =20 #include #include @@ -255,10 +256,11 @@ bd_int13probe(struct bdinfo *bd) * Sector size must be a multiple of 512 bytes. * An alternate test would be to check power of 2, * powerof2(params.sector_size). + * 4K is largest read buffer we can use at this time. */ - if (params.sector_size % BIOSDISK_SECSIZE) - bd->bd_sectorsize =3D BIOSDISK_SECSIZE; - else + if (params.sector_size >=3D 512 && + params.sector_size <=3D 4096 && + (params.sector_size % BIOSDISK_SECSIZE) =3D=3D 0) bd->bd_sectorsize =3D params.sector_size; =20 total =3D bd->bd_sectorsize * params.sectors; @@ -448,16 +450,29 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, = s char *buf, size_t *rsize) { struct disk_devdesc *dev =3D (struct disk_devdesc *)devdata; - uint64_t disk_blocks; - int blks, rc; + uint64_t disk_blocks, offset; + size_t blks, blkoff, bsize, rest; + caddr_t bbuf; + int rc; =20 - if (size % BD(dev).bd_sectorsize) { - panic("bd_strategy: %d bytes I/O not multiple of block size", - size); + /* + * First make sure the IO size is a multiple of 512 bytes. While we do + * process partial reads below, the strategy mechanism is built + * assuming IO is a multiple of 512B blocks. If the request is not + * a multiple of 512B blocks, it has to be some sort of bug. + */ + if (size =3D=3D 0 || (size % BIOSDISK_SECSIZE) !=3D 0) { + printf("bd_strategy: %d bytes I/O not multiple of %d\n", + size, BIOSDISK_SECSIZE); + return (EIO); } =20 DEBUG("open_disk %p", dev); =20 + offset =3D dblk * BIOSDISK_SECSIZE; + dblk =3D offset / BD(dev).bd_sectorsize; + blkoff =3D offset % BD(dev).bd_sectorsize; + /* * Check the value of the size argument. We do have quite small * heap (64MB), but we do not know good upper limit, so we check against @@ -465,11 +480,14 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, = s * while translating block count to bytes. */ if (size > INT_MAX) { - DEBUG("too large read: %zu bytes", size); + DEBUG("too large I/O: %zu bytes", size); return (EIO); } =20 blks =3D size / BD(dev).bd_sectorsize; + if (blks =3D=3D 0 || (size % BD(dev).bd_sectorsize) !=3D 0) + blks++; + if (dblk > dblk + blks) return (EIO); =20 @@ -498,36 +516,75 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, = s if (dblk + blks >=3D dev->d_offset + disk_blocks) { blks =3D dev->d_offset + disk_blocks - dblk; size =3D blks * BD(dev).bd_sectorsize; - DEBUG("short read %d", blks); + DEBUG("short I/O %d", blks); } =20 - switch (rw & F_MASK) { - case F_READ: - DEBUG("read %d from %lld to %p", blks, dblk, buf); + if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize =3D=3D 0) + panic("BUG: Real mode buffer is too small\n"); =20 - if (blks && (rc =3D bd_io(dev, dblk, blks, buf, BD_RD))) { - /* Filter out floppy controller errors */ - if (BD(dev).bd_flags !=3D BD_FLOPPY || rc !=3D 0x20) { - printf("read %d from %lld to %p, error: 0x%x\n", - blks, dblk, buf, rc); + bbuf =3D PTOV(V86_IO_BUFFER); + rest =3D size; + + while (blks > 0) { + int x =3D min(blks, V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize); + + switch (rw & F_MASK) { + case F_READ: + DEBUG("read %d from %lld to %p", x, dblk, buf); + bsize =3D BD(dev).bd_sectorsize * x - blkoff; + if (rest < bsize) + bsize =3D rest; + + if ((rc =3D bd_io(dev, dblk, x, bbuf, BD_RD)) !=3D 0) + return (EIO); + + bcopy(bbuf + blkoff, buf, bsize); + break; + case F_WRITE : + DEBUG("write %d from %lld to %p", x, dblk, buf); + if (blkoff !=3D 0) { + /* + * We got offset to sector, read 1 sector to + * bbuf. + */ + x =3D 1; + bsize =3D BD(dev).bd_sectorsize - blkoff; + bsize =3D min(bsize, rest); + rc =3D bd_io(dev, dblk, x, bbuf, BD_RD); + } else if (rest < BD(dev).bd_sectorsize) { + /* + * The remaining block is not full + * sector. Read 1 sector to bbuf. + */ + x =3D 1; + bsize =3D rest; + rc =3D bd_io(dev, dblk, x, bbuf, BD_RD); + } else { + /* We can write full sector(s). */ + bsize =3D BD(dev).bd_sectorsize * x; } - return (EIO); - } - break; - case F_WRITE : - DEBUG("write %d from %lld to %p", blks, dblk, buf); + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + bcopy(buf, bbuf + blkoff, bsize); + if ((rc =3D bd_io(dev, dblk, x, bbuf, BD_WR)) !=3D 0) + return (EIO); =20 - if (blks && bd_io(dev, dblk, blks, buf, BD_WR)) { - DEBUG("write error"); - return (EIO); + break; + default: + /* DO NOTHING */ + return (EROFS); } - break; - default: - /* DO NOTHING */ - return (EROFS); + + blkoff =3D 0; + buf +=3D bsize; + rest -=3D bsize; + blks -=3D x; + dblk +=3D x; } =20 - if (rsize) + if (rsize !=3D NULL) *rsize =3D size; return (0); } @@ -604,21 +661,16 @@ bd_io_workaround(struct disk_devdesc *dev) bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD); } =20 - static int bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int dowrite) { - u_int x, sec, result, resid, retry, maxfer; - caddr_t p, xp, bbuf; - =20 + int result, retry; + /* Just in case some idiot actually tries to read/write -1 blocks... */ if (blks < 0) return (-1); =20 - resid =3D blks; - p =3D dest; - /* * Workaround for a problem with some HP ProLiant BIOS failing to work * out the boot disk after installation. hrs and kuriyama discovered @@ -627,91 +679,49 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blk= s * the bios. The problem is alleviated by doing an extra read before * the buggy read. It is not immediately known whether other models * are similarly affected. + * Loop retrying the operation a couple of times. The BIOS + * may also retry. */ if (dowrite =3D=3D BD_RD && dblk >=3D 0x100000000) bd_io_workaround(dev); + for (retry =3D 0; retry < 3; retry++) { + /* if retrying, reset the drive */ + if (retry > 0) { + v86.ctl =3D V86_FLAGS; + v86.addr =3D 0x13; + v86.eax =3D 0; + v86.edx =3D BD(dev).bd_unit; + v86int(); + } =20 - /* Decide whether we have to bounce */ - if (VTOP(dest) >> 20 !=3D 0 || (BD(dev).bd_unit < 0x80 && - (VTOP(dest) >> 16) !=3D - (VTOP(dest + blks * BD(dev).bd_sectorsize) >> 16))) { + if (BD(dev).bd_flags & BD_MODEEDD1) + result =3D bd_edd_io(dev, dblk, blks, dest, dowrite); + else + result =3D bd_chs_io(dev, dblk, blks, dest, dowrite); =20 - /*=20 - * There is a 64k physical boundary somewhere in the - * destination buffer, or the destination buffer is above - * first 1MB of physical memory so we have to arrange a - * suitable bounce buffer. Allocate a buffer twice as large - * as we need to. Use the bottom half unless there is a break - * there, in which case we use the top half. - */ - x =3D V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; - x =3D min(x, (unsigned)blks); - bbuf =3D PTOV(V86_IO_BUFFER); - maxfer =3D x; /* limit transfers to bounce region size */ - } else { - bbuf =3D NULL; - maxfer =3D 0; + if (result =3D=3D 0) + break; } - =20 - while (resid > 0) { - /* - * Play it safe and don't cross track boundaries. - * (XXX this is probably unnecessary) - */ - sec =3D dblk % BD(dev).bd_sec; /* offset into track */ - x =3D min(BD(dev).bd_sec - sec, resid); - if (maxfer > 0) - x =3D min(x, maxfer); /* fit bounce buffer */ =20 - /* where do we transfer to? */ - xp =3D bbuf =3D=3D NULL ? p : bbuf; - - /* - * Put your Data In, Put your Data out, - * Put your Data In, and shake it all about=20 - */ - if (dowrite =3D=3D BD_WR && bbuf !=3D NULL) - bcopy(p, bbuf, x * BD(dev).bd_sectorsize); - - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry =3D 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl =3D V86_FLAGS; - v86.addr =3D 0x13; - v86.eax =3D 0; - v86.edx =3D BD(dev).bd_unit; - v86int(); - } - - if (BD(dev).bd_flags & BD_MODEEDD1) - result =3D bd_edd_io(dev, dblk, x, xp, dowrite); - else - result =3D bd_chs_io(dev, dblk, x, xp, dowrite); - if (result =3D=3D 0) - break; + /* + * 0x20 - Controller failure. This is common error when the + * media is not present. + */ + if (result !=3D 0 && result !=3D 0x20) { + if (dowrite =3D=3D BD_WR) { + printf("%s%d: Write %d sector(s) from %p (0x%x) " + "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, + dev->dd.d_unit, blks, dest, VTOP(dest), dblk, + result); + } else { + printf("%s%d: Read %d sector(s) from %lld to %p " + "(0x%x): 0x%x\n", dev->dd.d_dev->dv_name, + dev->dd.d_unit, blks, dblk, dest, VTOP(dest), + result); } - - if (dowrite =3D=3D BD_WR) - DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, - p, VTOP(p), dblk, result ? "failed" : "ok"); - else - DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, - dblk, p, VTOP(p), result ? "failed" : "ok"); - if (result) { - return (result); - } - if (dowrite =3D=3D BD_RD && bbuf !=3D NULL) - bcopy(bbuf, p, x * BD(dev).bd_sectorsize); - p +=3D (x * BD(dev).bd_sectorsize); - dblk +=3D x; - resid -=3D x; } =20 - return (0); + return (result); } =20 /* From owner-svn-src-head@freebsd.org Tue Oct 23 16:36:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6475FEBB3B; Tue, 23 Oct 2018 16:36:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A2F58492D; Tue, 23 Oct 2018 16:36:00 +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 3F6B112785; Tue, 23 Oct 2018 16:36:00 +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 w9NGa0hq025623; Tue, 23 Oct 2018 16:36:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NGZwQh025611; Tue, 23 Oct 2018 16:35:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810231635.w9NGZwQh025611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 23 Oct 2018 16:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339661 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 339661 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, 23 Oct 2018 16:36:01 -0000 Author: markj Date: Tue Oct 23 16:35:58 2018 New Revision: 339661 URL: https://svnweb.freebsd.org/changeset/base/339661 Log: Refactor domainset iterators for use by malloc(9) and UMA. Before this change we had two flavours of vm_domainset iterators: "page" and "malloc". The latter was only used for kmem_*() and hard-coded its behaviour based on kernel_object's policy. Moreover, its use contained a race similar to that fixed by r338755 since the kernel_object's iterator was being run without the object lock. In some cases it is useful to be able to explicitly specify a policy (domainset) or policy+iterator (domainset_ref) when performing memory allocations. To that end, refactor the vm_dominset_* KPI to permit this, and get rid of the "malloc" domainset_iter KPI in the process. Reviewed by: jeff (previous version) Tested by: pho (part of a larger patch) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17417 Modified: head/sys/sys/_domainset.h head/sys/vm/vm_domainset.c head/sys/vm/vm_domainset.h head/sys/vm/vm_glue.c head/sys/vm/vm_kern.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c Modified: head/sys/sys/_domainset.h ============================================================================== --- head/sys/sys/_domainset.h Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/sys/_domainset.h Tue Oct 23 16:35:58 2018 (r339661) @@ -54,7 +54,7 @@ typedef struct _domainset domainset_t; struct domainset; struct domainset_ref { struct domainset * volatile dr_policy; - unsigned int dr_iterator; + unsigned int dr_iter; }; #endif /* !_SYS__DOMAINSET_H_ */ Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/vm/vm_domainset.c Tue Oct 23 16:35:58 2018 (r339661) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -62,26 +63,13 @@ static int vm_domainset_default_stride = 64; * Determine which policy is to be used for this allocation. */ static void -vm_domainset_iter_init(struct vm_domainset_iter *di, struct vm_object *obj, - vm_pindex_t pindex) +vm_domainset_iter_init(struct vm_domainset_iter *di, struct domainset *ds, + int *iter, struct vm_object *obj, vm_pindex_t pindex) { - struct domainset *domain; - struct thread *td; - /* - * object policy takes precedence over thread policy. The policies - * are immutable and unsynchronized. Updates can race but pointer - * loads are assumed to be atomic. - */ - if (obj != NULL && (domain = obj->domain.dr_policy) != NULL) { - di->di_domain = domain; - di->di_iter = &obj->domain.dr_iterator; - } else { - td = curthread; - di->di_domain = td->td_domain.dr_policy; - di->di_iter = &td->td_domain.dr_iterator; - } - di->di_policy = di->di_domain->ds_policy; + di->di_domain = ds; + di->di_iter = iter; + di->di_policy = ds->ds_policy; if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) { #if VM_NRESERVLEVEL > 0 if (vm_object_reserv(obj)) { @@ -211,33 +199,39 @@ void vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj, vm_pindex_t pindex, int *domain, int *req) { + struct domainset_ref *dr; - vm_domainset_iter_init(di, obj, pindex); + /* + * Object policy takes precedence over thread policy. The policies + * are immutable and unsynchronized. Updates can race but pointer + * loads are assumed to be atomic. + */ + if (obj != NULL && obj->domain.dr_policy != NULL) + dr = &obj->domain; + else + dr = &curthread->td_domain; + vm_domainset_iter_init(di, dr->dr_policy, &dr->dr_iter, obj, pindex); di->di_flags = *req; *req = (di->di_flags & ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) | VM_ALLOC_NOWAIT; vm_domainset_iter_first(di, domain); if (vm_page_count_min_domain(*domain)) - vm_domainset_iter_page(di, domain, req); + vm_domainset_iter_page(di, obj, domain); } int -vm_domainset_iter_page(struct vm_domainset_iter *di, int *domain, int *req) +vm_domainset_iter_page(struct vm_domainset_iter *di, struct vm_object *obj, + int *domain) { - /* - * If we exhausted all options with NOWAIT and did a WAITFAIL it - * is time to return an error to the caller. - */ - if ((*req & VM_ALLOC_WAITFAIL) != 0) - return (ENOMEM); - /* If there are more domains to visit we run the iterator. */ while (--di->di_n != 0) { vm_domainset_iter_next(di, domain); if (!di->di_minskip || !vm_page_count_min_domain(*domain)) return (0); } + + /* If we skipped domains below min restart the search. */ if (di->di_minskip) { di->di_minskip = false; vm_domainset_iter_first(di, domain); @@ -248,34 +242,53 @@ vm_domainset_iter_page(struct vm_domainset_iter *di, i if ((di->di_flags & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) == 0) return (ENOMEM); - /* - * We have visited all domains with non-blocking allocations, try - * from the beginning with a blocking allocation. - */ + /* Wait for one of the domains to accumulate some free pages. */ + if (obj != NULL) + VM_OBJECT_WUNLOCK(obj); + vm_wait_doms(&di->di_domain->ds_mask); + if (obj != NULL) + VM_OBJECT_WLOCK(obj); + if ((di->di_flags & VM_ALLOC_WAITFAIL) != 0) + return (ENOMEM); + + /* Restart the search. */ vm_domainset_iter_first(di, domain); - *req = di->di_flags; return (0); } - -void -vm_domainset_iter_malloc_init(struct vm_domainset_iter *di, - struct vm_object *obj, int *domain, int *flags) +static void +_vm_domainset_iter_policy_init(struct vm_domainset_iter *di, int *domain, + int *flags) { - vm_domainset_iter_init(di, obj, 0); - if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) - di->di_policy = DOMAINSET_POLICY_ROUNDROBIN; di->di_flags = *flags; *flags = (di->di_flags & ~M_WAITOK) | M_NOWAIT; vm_domainset_iter_first(di, domain); if (vm_page_count_min_domain(*domain)) - vm_domainset_iter_malloc(di, domain, flags); + vm_domainset_iter_policy(di, domain); } +void +vm_domainset_iter_policy_init(struct vm_domainset_iter *di, + struct domainset *ds, int *domain, int *flags) +{ + + vm_domainset_iter_init(di, ds, &curthread->td_domain.dr_iter, NULL, 0); + _vm_domainset_iter_policy_init(di, domain, flags); +} + +void +vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *di, + struct domainset_ref *dr, int *domain, int *flags) +{ + + vm_domainset_iter_init(di, dr->dr_policy, &dr->dr_iter, NULL, 0); + _vm_domainset_iter_policy_init(di, domain, flags); +} + int -vm_domainset_iter_malloc(struct vm_domainset_iter *di, int *domain, int *flags) +vm_domainset_iter_policy(struct vm_domainset_iter *di, int *domain) { /* If there are more domains to visit we run the iterator. */ @@ -296,45 +309,46 @@ vm_domainset_iter_malloc(struct vm_domainset_iter *di, if ((di->di_flags & M_WAITOK) == 0) return (ENOMEM); - /* - * We have visited all domains with non-blocking allocations, try - * from the beginning with a blocking allocation. - */ + /* Wait for one of the domains to accumulate some free pages. */ + vm_wait_doms(&di->di_domain->ds_mask); + + /* Restart the search. */ vm_domainset_iter_first(di, domain); - *flags = di->di_flags; return (0); } #else /* !NUMA */ + int -vm_domainset_iter_page(struct vm_domainset_iter *di, int *domain, int *flags) +vm_domainset_iter_page(struct vm_domainset_iter *di, struct vm_object *obj, + int *domain) { return (EJUSTRETURN); } void -vm_domainset_iter_page_init(struct vm_domainset_iter *di, - struct vm_object *obj, vm_pindex_t pindex, int *domain, int *flags) +vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj, + vm_pindex_t pindex, int *domain, int *flags) { *domain = 0; } int -vm_domainset_iter_malloc(struct vm_domainset_iter *di, int *domain, int *flags) +vm_domainset_iter_policy(struct vm_domainset_iter *di, int *domain) { return (EJUSTRETURN); } void -vm_domainset_iter_malloc_init(struct vm_domainset_iter *di, - struct vm_object *obj, int *domain, int *flags) +vm_domainset_iter_policy_init(struct vm_domainset_iter *di, + struct domainset *ds, int *domain, int *flags) { *domain = 0; } -#endif +#endif /* NUMA */ Modified: head/sys/vm/vm_domainset.h ============================================================================== --- head/sys/vm/vm_domainset.h Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/vm/vm_domainset.h Tue Oct 23 16:35:58 2018 (r339661) @@ -40,12 +40,15 @@ struct vm_domainset_iter { bool di_minskip; }; -int vm_domainset_iter_page(struct vm_domainset_iter *, int *, int *); +int vm_domainset_iter_page(struct vm_domainset_iter *, struct vm_object *, + int *); void vm_domainset_iter_page_init(struct vm_domainset_iter *, struct vm_object *, vm_pindex_t, int *, int *); -int vm_domainset_iter_malloc(struct vm_domainset_iter *, int *, int *); -void vm_domainset_iter_malloc_init(struct vm_domainset_iter *, - struct vm_object *, int *, int *); +int vm_domainset_iter_policy(struct vm_domainset_iter *, int *); +void vm_domainset_iter_policy_init(struct vm_domainset_iter *, + struct domainset *, int *, int *); +void vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *, + struct domainset_ref *, int *, int *); void vm_wait_doms(const domainset_t *); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/vm/vm_glue.c Tue Oct 23 16:35:58 2018 (r339661) @@ -377,7 +377,7 @@ vm_thread_new(struct thread *td, int pages) */ if (vm_ndomains > 1) { ksobj->domain.dr_policy = DOMAINSET_RR(); - ksobj->domain.dr_iterator = + ksobj->domain.dr_iter = atomic_fetchadd_int(&kstack_domain_iter, 1); } Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/vm/vm_kern.c Tue Oct 23 16:35:58 2018 (r339661) @@ -235,13 +235,13 @@ kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t vm_offset_t addr; int domain; - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); do { addr = kmem_alloc_attr_domain(domain, size, flags, low, high, memattr); if (addr != 0) break; - } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + } while (vm_domainset_iter_policy(&di, &domain) == 0); return (addr); } @@ -319,13 +319,13 @@ kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_ vm_offset_t addr; int domain; - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); do { addr = kmem_alloc_contig_domain(domain, size, flags, low, high, alignment, boundary, memattr); if (addr != 0) break; - } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + } while (vm_domainset_iter_policy(&di, &domain) == 0); return (addr); } @@ -406,12 +406,12 @@ kmem_malloc(vm_size_t size, int flags) vm_offset_t addr; int domain; - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); do { addr = kmem_malloc_domain(domain, size, flags); if (addr != 0) break; - } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + } while (vm_domainset_iter_policy(&di, &domain) == 0); return (addr); } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/vm/vm_object.c Tue Oct 23 16:35:58 2018 (r339661) @@ -274,6 +274,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, panic("_vm_object_allocate: type %d is undefined", type); } object->size = size; + object->domain.dr_policy = NULL; object->generation = 1; object->ref_count = 1; object->memattr = VM_MEMATTR_DEFAULT; Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Oct 23 16:24:26 2018 (r339660) +++ head/sys/vm/vm_page.c Tue Oct 23 16:35:58 2018 (r339661) @@ -1753,7 +1753,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi mpred); if (m != NULL) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, object, &domain) == 0); return (m); } @@ -1990,7 +1990,7 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p npages, low, high, alignment, boundary, memattr); if (m != NULL) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, object, &domain) == 0); return (m); } @@ -2191,7 +2191,7 @@ vm_page_alloc_freelist(int freelist, int req) m = vm_page_alloc_freelist_domain(domain, freelist, req); if (m != NULL) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); return (m); } @@ -2830,7 +2830,7 @@ vm_page_reclaim_contig(int req, u_long npages, vm_padd high, alignment, boundary); if (ret) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); return (ret); } From owner-svn-src-head@freebsd.org Tue Oct 23 17:06:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C59BFECB97; Tue, 23 Oct 2018 17:06:37 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02DDB85D0E; Tue, 23 Oct 2018 17:06:37 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3E712C71; Tue, 23 Oct 2018 17:06:36 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NH6a2q041113; Tue, 23 Oct 2018 17:06:36 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NH6a1q041111; Tue, 23 Oct 2018 17:06:36 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201810231706.w9NH6a1q041111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 23 Oct 2018 17:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339662 - in head/sys: kern net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys: kern net X-SVN-Commit-Revision: 339662 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, 23 Oct 2018 17:06:37 -0000 Author: erj Date: Tue Oct 23 17:06:36 2018 New Revision: 339662 URL: https://svnweb.freebsd.org/changeset/base/339662 Log: Revert r339634. That commit is causing kernel panics in em(4), so this will be reverted until those are fixed. Reported by: ae@, pho@, et al Sponsored by: Intel Corporation Modified: head/sys/kern/subr_gtaskqueue.c head/sys/net/iflib.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Tue Oct 23 16:35:58 2018 (r339661) +++ head/sys/kern/subr_gtaskqueue.c Tue Oct 23 17:06:36 2018 (r339662) @@ -812,7 +812,6 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr qgroup->tqg_queue[i].tgc_cnt--; LIST_REMOVE(gtask, gt_list); mtx_unlock(&qgroup->tqg_lock); - gtaskqueue_drain(gtask->gt_taskqueue, >ask->gt_task); gtask->gt_taskqueue = NULL; } Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Oct 23 16:35:58 2018 (r339661) +++ head/sys/net/iflib.c Tue Oct 23 17:06:36 2018 (r339662) @@ -2279,8 +2279,8 @@ iflib_timer(void *arg) STATE_LOCK(ctx); if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); - STATE_UNLOCK(ctx); iflib_admin_intr_deferred(ctx); + STATE_UNLOCK(ctx); } static void @@ -2802,8 +2802,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) err: STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; - STATE_UNLOCK(ctx); iflib_admin_intr_deferred(ctx); + STATE_UNLOCK(ctx); return (false); } @@ -5973,10 +5973,7 @@ iflib_admin_intr_deferred(if_ctx_t ctx) { #ifdef INVARIANTS struct grouptask *gtask; -#endif - if (iflib_in_detach(ctx)) - return; -#ifdef INVARIANTS + gtask = &ctx->ifc_admin_task; MPASS(gtask != NULL && gtask->gt_taskqueue != NULL); #endif @@ -5987,8 +5984,6 @@ iflib_admin_intr_deferred(if_ctx_t ctx) void iflib_iov_intr_deferred(if_ctx_t ctx) { - if (iflib_in_detach(ctx)) - return; GROUPTASK_ENQUEUE(&ctx->ifc_vflr_task); } From owner-svn-src-head@freebsd.org Tue Oct 23 17:53:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5225AFEE10B; Tue, 23 Oct 2018 17:53:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0130D88829; Tue, 23 Oct 2018 17:53:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEBF0134BA; Tue, 23 Oct 2018 17:53:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NHrZRH067857; Tue, 23 Oct 2018 17:53:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NHrZht067856; Tue, 23 Oct 2018 17:53:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810231753.w9NHrZht067856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 23 Oct 2018 17:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339663 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 339663 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, 23 Oct 2018 17:53:36 -0000 Author: kib Date: Tue Oct 23 17:53:35 2018 New Revision: 339663 URL: https://svnweb.freebsd.org/changeset/base/339663 Log: Initializer error variable in nvdimm_spa_uio(). Several code paths might result in returning uninitialized value. Reported by: coverity through cem CID: 1396315 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/nvdimm/nvdimm_spa.c Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Tue Oct 23 17:06:36 2018 (r339662) +++ head/sys/dev/nvdimm/nvdimm_spa.c Tue Oct 23 17:53:35 2018 (r339663) @@ -157,6 +157,7 @@ nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *ui vm_memattr_t mattr; int error, n; + error = 0; if (spa->spa_kva == NULL) { mattr = nvdimm_spa_memattr(spa); vm_page_initfake(&m, 0, mattr); From owner-svn-src-head@freebsd.org Tue Oct 23 18:07:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04759FEE6D6; Tue, 23 Oct 2018 18:07: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD71C890EA; Tue, 23 Oct 2018 18:07:16 +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 A854913665; Tue, 23 Oct 2018 18:07:16 +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 w9NI7GdF073686; Tue, 23 Oct 2018 18:07:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NI7Gxw073684; Tue, 23 Oct 2018 18:07:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810231807.w9NI7Gxw073684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 23 Oct 2018 18:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339664 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339664 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, 23 Oct 2018 18:07:17 -0000 Author: markj Date: Tue Oct 23 18:07:16 2018 New Revision: 339664 URL: https://svnweb.freebsd.org/changeset/base/339664 Log: Initialize static domainsets regardless of whether an SRAT is present. Reported by: yuripv X-MFC with: r339452 Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_init.c head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Tue Oct 23 17:53:35 2018 (r339663) +++ head/sys/vm/vm_init.c Tue Oct 23 18:07:16 2018 (r339664) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -115,6 +116,11 @@ SYSINIT(vm_mem, SI_SUB_VM, SI_ORDER_FIRST, vm_mem_init static void vm_mem_init(void *dummy) { + + /* + * Initialize static domainsets, used by various allocators. + */ + domainset_init(); /* * Initializes resident memory structures. From here on, all physical Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Tue Oct 23 17:53:35 2018 (r339663) +++ head/sys/vm/vm_phys.c Tue Oct 23 18:07:16 2018 (r339664) @@ -616,8 +616,6 @@ vm_phys_register_domains(int ndomains, struct mem_affi for (i = 0; i < vm_ndomains; i++) DOMAINSET_SET(i, &all_domains); - - domainset_init(); #else (void)ndomains; (void)affinity; From owner-svn-src-head@freebsd.org Tue Oct 23 18:07:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B62FEE72C; Tue, 23 Oct 2018 18:07:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 865478920D; Tue, 23 Oct 2018 18:07:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80F3F13666; Tue, 23 Oct 2018 18:07:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NI7cr3073745; Tue, 23 Oct 2018 18:07:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NI7cQM073744; Tue, 23 Oct 2018 18:07:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810231807.w9NI7cQM073744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 23 Oct 2018 18:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339665 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 339665 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, 23 Oct 2018 18:07:39 -0000 Author: jhb Date: Tue Oct 23 18:07:37 2018 New Revision: 339665 URL: https://svnweb.freebsd.org/changeset/base/339665 Log: Add sha224 to the authctx union. MFC after: 2 months Sponsored by: Chelsio Communications Modified: head/sys/opencrypto/xform_auth.h Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Tue Oct 23 18:07:16 2018 (r339664) +++ head/sys/opencrypto/xform_auth.h Tue Oct 23 18:07:37 2018 (r339665) @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -89,6 +90,7 @@ union authctx { MD5_CTX md5ctx; SHA1_CTX sha1ctx; RMD160_CTX rmd160ctx; + SHA224_CTX sha224ctx; SHA256_CTX sha256ctx; SHA384_CTX sha384ctx; SHA512_CTX sha512ctx; From owner-svn-src-head@freebsd.org Tue Oct 23 18:31:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0023CFF08A9; Tue, 23 Oct 2018 18:31:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAFF68A681; Tue, 23 Oct 2018 18:31:39 +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 8C5F113A3F; Tue, 23 Oct 2018 18:31:39 +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 w9NIVdFl086679; Tue, 23 Oct 2018 18:31:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NIVdIa086677; Tue, 23 Oct 2018 18:31:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810231831.w9NIVdIa086677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 23 Oct 2018 18:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339666 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 339666 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, 23 Oct 2018 18:31:40 -0000 Author: jhb Date: Tue Oct 23 18:31:39 2018 New Revision: 339666 URL: https://svnweb.freebsd.org/changeset/base/339666 Log: Support the SHA224 HMAC algorithm in ccr(4). MFC after: 2 months Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Tue Oct 23 18:07:37 2018 (r339665) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Tue Oct 23 18:31:39 2018 (r339666) @@ -1667,6 +1667,7 @@ ccr_attach(device_t dev) ccr_sysctls(sc); crypto_register(cid, CRYPTO_SHA1_HMAC, 0, 0); + crypto_register(cid, CRYPTO_SHA2_224_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_256_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_384_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_512_HMAC, 0, 0); @@ -1717,6 +1718,10 @@ ccr_copy_partial_hash(void *dst, int cri_alg, union au for (i = 0; i < SHA1_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha1ctx.h.b32[i]); break; + case CRYPTO_SHA2_224_HMAC: + for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) + u32[i] = htobe32(auth_ctx->sha224ctx.state[i]); + break; case CRYPTO_SHA2_256_HMAC: for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha256ctx.state[i]); @@ -1897,6 +1902,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st for (c = cri; c != NULL; c = c->cri_next) { switch (c->cri_alg) { case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: case CRYPTO_SHA2_384_HMAC: case CRYPTO_SHA2_512_HMAC: @@ -1912,6 +1918,12 @@ ccr_newsession(device_t dev, crypto_session_t cses, st auth_mode = CHCR_SCMD_AUTH_MODE_SHA1; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_160; partial_digest_len = SHA1_HASH_LEN; + break; + case CRYPTO_SHA2_224_HMAC: + auth_hash = &auth_hash_hmac_sha2_224; + auth_mode = CHCR_SCMD_AUTH_MODE_SHA224; + mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; + partial_digest_len = SHA2_256_HASH_LEN; break; case CRYPTO_SHA2_256_HMAC: auth_hash = &auth_hash_hmac_sha2_256; From owner-svn-src-head@freebsd.org Tue Oct 23 18:32:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58CB0FF0B6D; Tue, 23 Oct 2018 18:32:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3EC8AA88; Tue, 23 Oct 2018 18:32:56 +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 0938A13B88; Tue, 23 Oct 2018 18:32:56 +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 w9NIWtHv089908; Tue, 23 Oct 2018 18:32:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NIWtET089907; Tue, 23 Oct 2018 18:32:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810231832.w9NIWtET089907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 23 Oct 2018 18:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339667 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 339667 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, 23 Oct 2018 18:32:56 -0000 Author: np Date: Tue Oct 23 18:32:55 2018 New Revision: 339667 URL: https://svnweb.freebsd.org/changeset/base/339667 Log: cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field. Submitted By: Lily Wang @ Netapp MFC after: 1 week Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Oct 23 18:31:39 2018 (r339666) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Oct 23 18:32:55 2018 (r339667) @@ -2540,6 +2540,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_ goto out; } ep = alloc_ep(sizeof(*ep), GFP_KERNEL); + cm_id->provider_data = ep; init_timer(&ep->timer); ep->plen = conn_param->private_data_len; From owner-svn-src-head@freebsd.org Tue Oct 23 19:55:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14DF3FFA3F4; Tue, 23 Oct 2018 19:55:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEAD08D7D8; Tue, 23 Oct 2018 19:55:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 9EFBF249CF; Tue, 23 Oct 2018 19:55:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2607:fb90:361f:4639:5848:3ec9:2b09:ec] (unknown [IPv6:2607:fb90:361f:4639:5848:3ec9:2b09:ec]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 76FDE1AC4E; Tue, 23 Oct 2018 21:55:11 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r339646 - head/sys/net From: Kristof Provost X-Mailer: iPhone Mail (16A404) In-Reply-To: <201810231303.w9ND33C1016372@repo.freebsd.org> Date: Tue, 23 Oct 2018 12:55:03 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <01551B73-DD94-4F44-A0CB-276480B603A1@FreeBSD.org> References: <201810231303.w9ND33C1016372@repo.freebsd.org> To: "Andrey V. Elsukov" 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, 23 Oct 2018 19:55:14 -0000 > On 23 Oct 2018, at 06:03, Andrey V. Elsukov wrote: > > Author: ae > Date: Tue Oct 23 13:03:03 2018 > New Revision: 339646 > URL: https://svnweb.freebsd.org/changeset/base/339646 > > Log: > Add the check that current VNET is ready and access to srchash is > allowed. > > ipsec_srcaddr() callback can be called during VNET teardown, since > ingress address checking subsystem isn't VNET specific. And thus > callback can make access to already freed memory. To prevent this, > use V_ipsec_idhtbl pointer as indicator of VNET readiness. And make > epoch_wait() after resetting it to NULL in vnet_ipsec_uninit() to > be sure that ipsec_srcaddr() is finished its work. > > Reported by: kp > MFC after: 20 days > Thanks for the fix. Kristof From owner-svn-src-head@freebsd.org Tue Oct 23 20:45:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90BA6FFC56B; Tue, 23 Oct 2018 20:45:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36FEE8FB59; Tue, 23 Oct 2018 20:45:47 +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 2C3F91517A; Tue, 23 Oct 2018 20:45:47 +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 w9NKjlfN056725; Tue, 23 Oct 2018 20:45:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NKjlxQ056724; Tue, 23 Oct 2018 20:45:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810232045.w9NKjlxQ056724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 23 Oct 2018 20:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339668 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339668 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, 23 Oct 2018 20:45:47 -0000 Author: imp Date: Tue Oct 23 20:45:46 2018 New Revision: 339668 URL: https://svnweb.freebsd.org/changeset/base/339668 Log: For the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until some ports can be updated. Modified: head/sys/sys/mouse.h Modified: head/sys/sys/mouse.h ============================================================================== --- head/sys/sys/mouse.h Tue Oct 23 18:32:55 2018 (r339667) +++ head/sys/sys/mouse.h Tue Oct 23 20:45:46 2018 (r339668) @@ -190,7 +190,7 @@ typedef struct mousemode { * GlidePoint, IntelliMouse, Thinking Mouse, MouseRemote, Kidspad, * VersaPad * Bus mouse protocols: - * bus, InPort + * bus, InPort -- both of these are now obsolete and will be remvoed soon. * PS/2 mouse protocol: * PS/2 */ @@ -200,8 +200,8 @@ typedef struct mousemode { #define MOUSE_PROTO_LOGI 2 /* Logitech, 3 bytes */ #define MOUSE_PROTO_MM 3 /* MM series, 3 bytes */ #define MOUSE_PROTO_LOGIMOUSEMAN 4 /* Logitech MouseMan 3/4 bytes */ -/* 5 was bus mouse */ -/* 6 was inport mosue */ +#define MOUSE_PROTO_BUS 5 /* bus mouse -- obsolete */ +#define MOUSE_PROTO_INPORT 6 /* inport mosue -- obsolete */ #define MOUSE_PROTO_PS2 7 /* PS/2 mouse, 3 bytes */ #define MOUSE_PROTO_HITTAB 8 /* Hitachi Tablet 3 bytes */ #define MOUSE_PROTO_GLIDEPOINT 9 /* ALPS GlidePoint, 3/4 bytes */ From owner-svn-src-head@freebsd.org Tue Oct 23 21:10:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DFF7FFCEF1; Tue, 23 Oct 2018 21:10:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01E837074C; Tue, 23 Oct 2018 21:10:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0D81154BF; Tue, 23 Oct 2018 21:10:07 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NLA76R066954; Tue, 23 Oct 2018 21:10:07 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NLA64C066948; Tue, 23 Oct 2018 21:10:06 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201810232110.w9NLA64C066948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 23 Oct 2018 21:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339671 - in head: sbin/fsck_ffs sbin/newfs sys/sys sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/fsck_ffs sbin/newfs sys/sys sys/ufs/ffs X-SVN-Commit-Revision: 339671 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, 23 Oct 2018 21:10:08 -0000 Author: mckusick Date: Tue Oct 23 21:10:06 2018 New Revision: 339671 URL: https://svnweb.freebsd.org/changeset/base/339671 Log: Continuing efforts to provide hardening of FFS, this change adds a check hash to the superblock. If a check hash fails when an attempt is made to mount a filesystem, the mount fails with EINVAL (Invalid argument). This avoids a class of filesystem panics related to corrupted superblocks. The hash is done using crc32c. Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily used in embedded systems with small memories and low-powered processors which need as light-weight a filesystem as possible. Reviewed by: kib Tested by: Peter Holm Sponsored by: Netflix Modified: head/sbin/fsck_ffs/main.c head/sbin/newfs/mkfs.c head/sys/sys/param.h head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Tue Oct 23 21:09:37 2018 (r339670) +++ head/sbin/fsck_ffs/main.c Tue Oct 23 21:10:06 2018 (r339671) @@ -460,11 +460,13 @@ checkfilesys(char *filesys) if ((sblock.fs_metackhash & CK_CYLGRP) == 0 && reply("ADD CYLINDER GROUP CHECK-HASH PROTECTION") != 0) ckhashadd |= CK_CYLGRP; -#ifdef notyet if ((sblock.fs_metackhash & CK_SUPERBLOCK) == 0 && getosreldate() >= P_OSREL_CK_SUPERBLOCK && - reply("ADD SUPERBLOCK CHECK-HASH PROTECTION") != 0) - ckhashadd |= CK_SUPERBLOCK; + reply("ADD SUPERBLOCK CHECK-HASH PROTECTION") != 0) { + sblock.fs_metackhash |= CK_SUPERBLOCK; + sbdirty(); + } +#ifdef notyet if ((sblock.fs_metackhash & CK_INODE) == 0 && getosreldate() >= P_OSREL_CK_INODE && reply("ADD INODE CHECK-HASH PROTECTION") != 0) Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Tue Oct 23 21:09:37 2018 (r339670) +++ head/sbin/newfs/mkfs.c Tue Oct 23 21:10:06 2018 (r339671) @@ -496,7 +496,9 @@ restart: if (Oflag > 1) { sblock.fs_flags |= FS_METACKHASH; if (getosreldate() >= P_OSREL_CK_CYLGRP) - sblock.fs_metackhash = CK_CYLGRP; + sblock.fs_metackhash |= CK_CYLGRP; + if (getosreldate() >= P_OSREL_CK_SUPERBLOCK) + sblock.fs_metackhash |= CK_SUPERBLOCK; } /* Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Oct 23 21:09:37 2018 (r339670) +++ head/sys/sys/param.h Tue Oct 23 21:10:06 2018 (r339671) @@ -88,6 +88,7 @@ #define P_OSREL_WRFSBASE 1200041 #define P_OSREL_CK_CYLGRP 1200046 #define P_OSREL_VMTOTAL64 1200054 +#define P_OSREL_CK_SUPERBLOCK 1300000 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Tue Oct 23 21:09:37 2018 (r339670) +++ head/sys/ufs/ffs/ffs_subr.c Tue Oct 23 21:10:06 2018 (r339671) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +uint32_t calculate_crc32c(uint32_t, const void *, size_t); struct malloc_type; #define UFS_MALLOC(size, type, flags) malloc(size) #define UFS_FREE(ptr, type) free(ptr) @@ -142,6 +143,7 @@ ffs_load_inode(struct buf *bp, struct inode *ip, struc static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int (*)(void *, off_t, void **, int)); +static uint32_t calc_sbhash(struct fs *); /* * Read a superblock from the devfd device. @@ -252,7 +254,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo int (*readfunc)(void *devfd, off_t loc, void **bufp, int size)) { struct fs *fs; - int error; + int error, res; + uint32_t ckhash; error = (*readfunc)(devfd, sblockloc, (void **)fsp, SBLOCKSIZE); if (error != 0) @@ -267,7 +270,26 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo fs->fs_ncg >= 1 && fs->fs_bsize >= MINBSIZE && fs->fs_bsize <= MAXBSIZE && - fs->fs_bsize >= roundup(sizeof(struct fs), DEV_BSIZE)) { + fs->fs_bsize >= roundup(sizeof(struct fs), DEV_BSIZE) && + fs->fs_sbsize <= SBLOCKSIZE) { + if (fs->fs_ckhash != (ckhash = calc_sbhash(fs))) { +#ifdef _KERNEL + res = uprintf("Superblock check-hash failed: recorded " + "check-hash 0x%x != computed check-hash 0x%x\n", + fs->fs_ckhash, ckhash); +#else + res = 0; +#endif + /* + * Print check-hash failure if no controlling terminal + * in kernel or always if in user-mode (libufs). + */ + if (res == 0) + printf("Superblock check-hash failed: recorded " + "check-hash 0x%x != computed check-hash " + "0x%x\n", fs->fs_ckhash, ckhash); + return (EINVAL); + } /* Have to set for old filesystems that predate this field */ fs->fs_sblockactualloc = sblockloc; /* Not yet any summary information */ @@ -313,9 +335,46 @@ ffs_sbput(void *devfd, struct fs *fs, off_t loc, } fs->fs_fmod = 0; fs->fs_time = UFS_TIME; + fs->fs_ckhash = calc_sbhash(fs); if ((error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize)) != 0) return (error); return (0); +} + +/* + * Calculate the check-hash for a superblock. + */ +static uint32_t +calc_sbhash(struct fs *fs) +{ + uint32_t ckhash, save_ckhash; + + /* + * A filesystem that was using a superblock ckhash may be moved + * to an older kernel that does not support ckhashes. The + * older kernel will clear the FS_METACKHASH flag indicating + * that it does not update hashes. When the disk is moved back + * to a kernel capable of ckhashes it disables them on mount: + * + * if ((fs->fs_flags & FS_METACKHASH) == 0) + * fs->fs_metackhash = 0; + * + * This leaves (fs->fs_metackhash & CK_SUPERBLOCK) == 0) with an + * old stale value in the fs->fs_ckhash field. Thus the need to + * just accept what is there. + */ + if ((fs->fs_metackhash & CK_SUPERBLOCK) == 0) + return (fs->fs_ckhash); + + save_ckhash = fs->fs_ckhash; + fs->fs_ckhash = 0; + /* + * If newly read from disk, the caller is responsible for + * verifying that fs->fs_sbsize <= SBLOCKSIZE. + */ + ckhash = calculate_crc32c(~0L, (void *)fs, fs->fs_sbsize); + fs->fs_ckhash = save_ckhash; + return (ckhash); } /* Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Oct 23 21:09:37 2018 (r339670) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Oct 23 21:10:06 2018 (r339671) @@ -814,7 +814,7 @@ ffs_mountfs(devvp, mp, td) if ((fs->fs_flags & FS_METACKHASH) == 0) fs->fs_metackhash = 0; /* none of these types of check-hashes are maintained by this kernel */ - fs->fs_metackhash &= ~(CK_SUPERBLOCK | CK_INODE | CK_INDIR | CK_DIR); + fs->fs_metackhash &= ~(CK_INODE | CK_INDIR | CK_DIR); /* no support for any undefined flags */ fs->fs_flags &= FS_SUPPORTED; fs->fs_flags &= ~FS_UNCLEAN; Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Tue Oct 23 21:09:37 2018 (r339670) +++ head/sys/ufs/ffs/fs.h Tue Oct 23 21:10:06 2018 (r339671) @@ -364,7 +364,8 @@ struct fs { int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ - int32_t fs_sparecon32[22]; /* reserved for future constants */ + int32_t fs_sparecon32[21]; /* reserved for future constants */ + u_int32_t fs_ckhash; /* if CK_SUPERBLOCK, its check-hash */ u_int32_t fs_metackhash; /* metadata check-hash, see CK_ below */ int32_t fs_flags; /* see FS_ flags below */ int32_t fs_contigsumsize; /* size of cluster summary array */ From owner-svn-src-head@freebsd.org Tue Oct 23 21:43:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FD7DFFE297; Tue, 23 Oct 2018 21:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33F5671FDA; Tue, 23 Oct 2018 21:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EC9515B72; Tue, 23 Oct 2018 21:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NLhhRd087228; Tue, 23 Oct 2018 21:43:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NLhfeK087221; Tue, 23 Oct 2018 21:43:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810232143.w9NLhfeK087221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 23 Oct 2018 21:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339672 - in head/sys: fs/nfsclient kern sys tools X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: fs/nfsclient kern sys tools X-SVN-Commit-Revision: 339672 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, 23 Oct 2018 21:43:43 -0000 Author: kib Date: Tue Oct 23 21:43:41 2018 New Revision: 339672 URL: https://svnweb.freebsd.org/changeset/base/339672 Log: Only call sigdeferstop() for NFS. Use bypass to catch any NFS VOP dispatch and route it through the wrapper which does sigdeferstop() and then dispatches original VOP. NFS does not need a bypass below it, which is not supported. The vop offset in the vop_vector is added since otherwise it is impossible to get vop_op_t from the internal table, and I did not wanted to create the layered fs only to wrap NFS VOPs. VFS_OP()s wrap is straightforward. Requested and reviewed by: mjg (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17658 Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/kern/vfs_default.c head/sys/kern/vfs_init.c head/sys/kern/vfs_mount.c head/sys/sys/mount.h head/sys/sys/vnode.h head/sys/tools/vnode_if.awk Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Oct 23 21:43:41 2018 (r339672) @@ -147,7 +147,8 @@ static vop_set_text_t nfs_set_text; /* * Global vfs data structures for nfs */ -struct vop_vector newnfs_vnodeops = { + +static struct vop_vector newnfs_vnodeops_nosig = { .vop_default = &default_vnodeops, .vop_access = nfs_access, .vop_advlock = nfs_advlock, @@ -182,7 +183,19 @@ struct vop_vector newnfs_vnodeops = { .vop_set_text = nfs_set_text, }; -struct vop_vector newnfs_fifoops = { +static int +nfs_vnodeops_bypass(struct vop_generic_args *a) +{ + + return (vop_sigdefer(&newnfs_vnodeops_nosig, a)); +} + +struct vop_vector newnfs_vnodeops = { + .vop_default = &default_vnodeops, + .vop_bypass = nfs_vnodeops_bypass, +}; + +static struct vop_vector newnfs_fifoops_nosig = { .vop_default = &fifo_specops, .vop_access = nfsspec_access, .vop_close = nfsfifo_close, @@ -195,6 +208,18 @@ struct vop_vector newnfs_fifoops = { .vop_reclaim = ncl_reclaim, .vop_setattr = nfs_setattr, .vop_write = nfsfifo_write, +}; + +static int +nfs_fifoops_bypass(struct vop_generic_args *a) +{ + + return (vop_sigdefer(&newnfs_fifoops_nosig, a)); +} + +struct vop_vector newnfs_fifoops = { + .vop_default = &default_vnodeops, + .vop_bypass = nfs_fifoops_bypass, }; static int nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/kern/vfs_default.c Tue Oct 23 21:43:41 2018 (r339672) @@ -1322,4 +1322,37 @@ vfs_stdsysctl(mp, op, req) return (EOPNOTSUPP); } -/* end of vfs default ops */ +static vop_bypass_t * +bp_by_off(struct vop_vector *vop, struct vop_generic_args *a) +{ + + return (*(vop_bypass_t **)((char *)vop + a->a_desc->vdesc_vop_offset)); +} + +int +vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a) +{ + vop_bypass_t *bp; + int prev_stops, rc; + + for (; vop != NULL; vop = vop->vop_default) { + bp = bp_by_off(vop, a); + if (bp != NULL) + break; + + /* + * Bypass is not really supported. It is done for + * fallback to unimplemented vops in the default + * vector. + */ + bp = vop->vop_bypass; + if (bp != NULL) + break; + } + MPASS(bp != NULL); + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = bp(a); + sigallowstop(prev_stops); + return (rc); +} Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/kern/vfs_init.c Tue Oct 23 21:43:41 2018 (r339672) @@ -165,7 +165,199 @@ vfs_byname_kld(const char *fstype, struct thread *td, return (vfsp); } +static int +vfs_mount_sigdefer(struct mount *mp) +{ + int prev_stops, rc; + TSRAW(curthread, TS_ENTER, "VFS_MOUNT", mp->mnt_vfc->vfc_name); + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_mount)(mp); + sigallowstop(prev_stops); + TSRAW(curthread, TS_EXIT, "VFS_MOUNT", mp->mnt_vfc->vfc_name); + return (rc); +} + +static int +vfs_unmount_sigdefer(struct mount *mp, int mntflags) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_unmount)(mp, mntflags); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_root_sigdefer(struct mount *mp, int flags, struct vnode **vpp) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_root)(mp, flags, vpp); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_quotactl_sigdefer(struct mount *mp, int cmd, uid_t uid, void *arg) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_quotactl)(mp, cmd, uid, arg); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_statfs_sigdefer(struct mount *mp, struct statfs *sbp) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_statfs)(mp, sbp); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_sync_sigdefer(struct mount *mp, int waitfor) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_sync)(mp, waitfor); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_vget_sigdefer(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_vget)(mp, ino, flags, vpp); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_fhtovp_sigdefer(struct mount *mp, struct fid *fidp, int flags, + struct vnode **vpp) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_fhtovp)(mp, fidp, flags, vpp); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_checkexp_sigdefer(struct mount *mp, struct sockaddr *nam, int *exflg, + struct ucred **credp, int *numsecflavors, int **secflavors) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_checkexp)(mp, nam, exflg, credp, + numsecflavors, secflavors); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_extattrctl_sigdefer(struct mount *mp, int cmd, struct vnode *filename_vp, + int attrnamespace, const char *attrname) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_extattrctl)(mp, cmd, + filename_vp, attrnamespace, attrname); + sigallowstop(prev_stops); + return (rc); +} + +static int +vfs_sysctl_sigdefer(struct mount *mp, fsctlop_t op, struct sysctl_req *req) +{ + int prev_stops, rc; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_sysctl)(mp, op, req); + sigallowstop(prev_stops); + return (rc); +} + +static void +vfs_susp_clean_sigdefer(struct mount *mp) +{ + int prev_stops; + + if (*mp->mnt_vfc->vfc_vfsops_sd->vfs_susp_clean == NULL) + return; + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + (*mp->mnt_vfc->vfc_vfsops_sd->vfs_susp_clean)(mp); + sigallowstop(prev_stops); +} + +static void +vfs_reclaim_lowervp_sigdefer(struct mount *mp, struct vnode *vp) +{ + int prev_stops; + + if (*mp->mnt_vfc->vfc_vfsops_sd->vfs_reclaim_lowervp == NULL) + return; + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + (*mp->mnt_vfc->vfc_vfsops_sd->vfs_reclaim_lowervp)(mp, vp); + sigallowstop(prev_stops); +} + +static void +vfs_unlink_lowervp_sigdefer(struct mount *mp, struct vnode *vp) +{ + int prev_stops; + + if (*mp->mnt_vfc->vfc_vfsops_sd->vfs_unlink_lowervp == NULL) + return; + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + (*(mp)->mnt_vfc->vfc_vfsops_sd->vfs_unlink_lowervp)(mp, vp); + sigallowstop(prev_stops); +} + +static void +vfs_purge_sigdefer(struct mount *mp) +{ + int prev_stops; + + prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT); + (*mp->mnt_vfc->vfc_vfsops_sd->vfs_purge)(mp); + sigallowstop(prev_stops); +} + +static struct vfsops vfsops_sigdefer = { + .vfs_mount = vfs_mount_sigdefer, + .vfs_unmount = vfs_unmount_sigdefer, + .vfs_root = vfs_root_sigdefer, + .vfs_quotactl = vfs_quotactl_sigdefer, + .vfs_statfs = vfs_statfs_sigdefer, + .vfs_sync = vfs_sync_sigdefer, + .vfs_vget = vfs_vget_sigdefer, + .vfs_fhtovp = vfs_fhtovp_sigdefer, + .vfs_checkexp = vfs_checkexp_sigdefer, + .vfs_extattrctl = vfs_extattrctl_sigdefer, + .vfs_sysctl = vfs_sysctl_sigdefer, + .vfs_susp_clean = vfs_susp_clean_sigdefer, + .vfs_reclaim_lowervp = vfs_reclaim_lowervp_sigdefer, + .vfs_unlink_lowervp = vfs_unlink_lowervp_sigdefer, + .vfs_purge = vfs_purge_sigdefer, + +}; + /* Register a new filesystem type in the global table */ static int vfs_register(struct vfsconf *vfc) @@ -278,13 +470,21 @@ vfs_register(struct vfsconf *vfc) if (vfsops->vfs_sysctl == NULL) vfsops->vfs_sysctl = vfs_stdsysctl; + if ((vfc->vfc_flags & VFCF_SBDRY) != 0) { + vfc->vfc_vfsops_sd = vfc->vfc_vfsops; + vfc->vfc_vfsops = &vfsops_sigdefer; + } + if (vfc->vfc_flags & VFCF_JAIL) prison_add_vfs(vfc); /* * Call init function for this VFS... */ - (*(vfc->vfc_vfsops->vfs_init))(vfc); + if ((vfc->vfc_flags & VFCF_SBDRY) != 0) + vfc->vfc_vfsops_sd->vfs_init(vfc); + else + vfc->vfc_vfsops->vfs_init(vfc); vfsconf_unlock(); /* @@ -329,12 +529,18 @@ vfs_unregister(struct vfsconf *vfc) vfsconf_unlock(); return (EBUSY); } - if (vfc->vfc_vfsops->vfs_uninit != NULL) { - error = (*vfc->vfc_vfsops->vfs_uninit)(vfsp); - if (error != 0) { - vfsconf_unlock(); - return (error); - } + error = 0; + if ((vfc->vfc_flags & VFCF_SBDRY) != 0) { + if (vfc->vfc_vfsops_sd->vfs_uninit != NULL) + error = vfc->vfc_vfsops_sd->vfs_uninit(vfsp); + } else { + if (vfc->vfc_vfsops->vfs_uninit != NULL) { + error = vfc->vfc_vfsops->vfs_uninit(vfsp); + } + if (error != 0) { + vfsconf_unlock(); + return (error); + } } TAILQ_REMOVE(&vfsconf, vfsp, vfc_list); maxtypenum = VFS_GENERIC; Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/kern/vfs_mount.c Tue Oct 23 21:43:41 2018 (r339672) @@ -808,7 +808,8 @@ sys_mount(struct thread *td, struct mount_args *uap) free(fstype, M_TEMP); if (vfsp == NULL) return (ENOENT); - if (vfsp->vfc_vfsops->vfs_cmount == NULL) + if (vfsp->vfc_vfsops->vfs_cmount == NULL || ((vfsp->vfc_flags & + VFCF_SBDRY) != 0 && (vfsp->vfc_vfsops_sd->vfs_cmount == NULL))) return (EOPNOTSUPP); ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); @@ -817,8 +818,9 @@ sys_mount(struct thread *td, struct mount_args *uap) ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); ma = mount_argb(ma, !(flags & MNT_NOEXEC), "noexec"); - error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, flags); - return (error); + if ((vfsp->vfc_flags & VFCF_SBDRY) != 0) + return (vfsp->vfc_vfsops_sd->vfs_cmount(ma, uap->data, flags)); + return (vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, flags)); } /* Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/sys/mount.h Tue Oct 23 21:43:41 2018 (r339672) @@ -513,6 +513,7 @@ struct vfsconf { u_int vfc_version; /* ABI version number */ char vfc_name[MFSNAMELEN]; /* filesystem type name */ struct vfsops *vfc_vfsops; /* filesystem operations vector */ + struct vfsops *vfc_vfsops_sd; /* ... signal-deferred */ int vfc_typenum; /* historic filesystem type number */ int vfc_refcount; /* number mounted of this type */ int vfc_flags; /* permanent flags */ @@ -694,139 +695,96 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_PROLOGUE(MP) do { \ - struct mount *mp__; \ - int _prev_stops; \ - \ - mp__ = (MP); \ - _prev_stops = sigdeferstop((mp__ != NULL && \ - (mp__->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0) ? \ - SIGDEFERSTOP_SILENT : SIGDEFERSTOP_NOP); - -#define VFS_EPILOGUE(MP) \ - sigallowstop(_prev_stops); \ -} while (0) - #define VFS_MOUNT(MP) ({ \ int _rc; \ \ TSRAW(curthread, TS_ENTER, "VFS_MOUNT", (MP)->mnt_vfc->vfc_name);\ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ - VFS_EPILOGUE(MP); \ TSRAW(curthread, TS_EXIT, "VFS_MOUNT", (MP)->mnt_vfc->vfc_name);\ _rc; }) #define VFS_UNMOUNT(MP, FORCE) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_ROOT(MP, FLAGS, VPP) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_QUOTACTL(MP, C, U, A) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_STATFS(MP, SBP) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = __vfs_statfs((MP), (SBP)); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_SYNC(MP, WAIT) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ SEC); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_SYSCTL(MP, OP, REQ) ({ \ int _rc; \ \ - VFS_PROLOGUE(MP); \ _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ - VFS_EPILOGUE(MP); \ _rc; }) #define VFS_SUSP_CLEAN(MP) do { \ if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ - VFS_PROLOGUE(MP); \ (*(MP)->mnt_op->vfs_susp_clean)(MP); \ - VFS_EPILOGUE(MP); \ } \ } while (0) #define VFS_RECLAIM_LOWERVP(MP, VP) do { \ if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ - VFS_PROLOGUE(MP); \ (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ - VFS_EPILOGUE(MP); \ } \ } while (0) #define VFS_UNLINK_LOWERVP(MP, VP) do { \ if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ - VFS_PROLOGUE(MP); \ (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ - VFS_EPILOGUE(MP); \ } \ } while (0) #define VFS_PURGE(MP) do { \ if (*(MP)->mnt_op->vfs_purge != NULL) { \ - VFS_PROLOGUE(MP); \ (*(MP)->mnt_op->vfs_purge)(MP); \ - VFS_EPILOGUE(MP); \ } \ } while (0) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/sys/vnode.h Tue Oct 23 21:43:41 2018 (r339672) @@ -484,6 +484,7 @@ typedef int vop_bypass_t(struct vop_generic_args *); struct vnodeop_desc { char *vdesc_name; /* a readable name for debugging */ int vdesc_flags; /* VDESC_* flags */ + int vdesc_vop_offset; vop_bypass_t *vdesc_call; /* Function to call */ /* @@ -785,6 +786,7 @@ void vop_rmdir_post(void *a, int rc); void vop_setattr_post(void *a, int rc); void vop_setextattr_post(void *a, int rc); void vop_symlink_post(void *a, int rc); +int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); #ifdef DEBUG_VFS_LOCKS void vop_strategy_pre(void *a); Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Tue Oct 23 21:10:06 2018 (r339671) +++ head/sys/tools/vnode_if.awk Tue Oct 23 21:43:41 2018 (r339672) @@ -181,6 +181,7 @@ if (cfile) { "struct vnodeop_desc vop_default_desc = {\n" \ " \"default\",\n" \ " 0,\n" \ + " 0,\n" \ " (vop_bypass_t *)vop_panic,\n" \ " NULL,\n" \ " VDESC_NO_OFFSET,\n" \ @@ -366,12 +367,10 @@ while ((getline < srcfile) > 0) { add_debug_code(name, args[i], "Entry", "\t"); printc("\tKTR_START" ctrstr); add_pre(name); - printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") - printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc("\tSDT_PROBE3(vfs, vop, " name ", return, a->a_" args[0] ", a, rc);\n"); printc("\tif (rc == 0) {"); for (i = 0; i < numargs; ++i) @@ -402,6 +401,8 @@ while ((getline < srcfile) > 0) { releflags = "0"; printc("\t" releflags vppwillrele ","); + # index in struct vop_vector + printc("\t__offsetof(struct vop_vector, " name "),"); # function to call printc("\t(vop_bypass_t *)" uname "_AP,"); # vp offsets From owner-svn-src-head@freebsd.org Tue Oct 23 23:11:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F641008F68; Tue, 23 Oct 2018 23:11:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EA5575807; Tue, 23 Oct 2018 23:11:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99A43168FD; Tue, 23 Oct 2018 23:11:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NNBcHL031784; Tue, 23 Oct 2018 23:11:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NNBc4n031783; Tue, 23 Oct 2018 23:11:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810232311.w9NNBc4n031783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 23 Oct 2018 23:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339673 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 339673 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, 23 Oct 2018 23:11:38 -0000 Author: kib Date: Tue Oct 23 23:11:38 2018 New Revision: 339673 URL: https://svnweb.freebsd.org/changeset/base/339673 Log: Fix stand/ build after r339671. ffs_subr.c requires calculate_crc32c() from libkern. Unfortunately we cannot just add libkern/crc32.c to libstand because crc32.o is already compiled from contrib/zlib/crc32.c. Use the include trick to rename the source. Note that libstand also provides crc32.c which seems to be unused. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17677 Added: head/stand/libsa/crc32_libkern.c (contents, props changed) Modified: head/stand/libsa/Makefile Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Tue Oct 23 21:43:41 2018 (r339672) +++ head/stand/libsa/Makefile Tue Oct 23 23:11:38 2018 (r339673) @@ -155,9 +155,9 @@ SRCS+=ffs_subr.c ffs_tables.c CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 -# explicit_bzero +# explicit_bzero and calculate_crc32c .PATH: ${SYSDIR}/libkern -SRCS+= explicit_bzero.c +SRCS+= explicit_bzero.c crc32_libkern.c # Maybe GELI .if ${MK_LOADER_GELI} == "yes" Added: head/stand/libsa/crc32_libkern.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/libsa/crc32_libkern.c Tue Oct 23 23:11:38 2018 (r339673) @@ -0,0 +1,3 @@ +/* $FreeBSD$ */ + +#include "../../sys/libkern/crc32.c" From owner-svn-src-head@freebsd.org Tue Oct 23 23:15:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE06D1036527; Tue, 23 Oct 2018 23:15:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 855D37609C; Tue, 23 Oct 2018 23:15:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 806FA16A44; Tue, 23 Oct 2018 23:15:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NNFi7i033385; Tue, 23 Oct 2018 23:15:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NNFiKV033384; Tue, 23 Oct 2018 23:15:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810232315.w9NNFiKV033384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 23 Oct 2018 23:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339674 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 339674 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, 23 Oct 2018 23:15:45 -0000 Author: kp Date: Tue Oct 23 23:15:44 2018 New Revision: 339674 URL: https://svnweb.freebsd.org/changeset/base/339674 Log: pf: ifp can never be NULL in pfi_ifaddr_event() There's no point in the NULL check for ifp, because we'll already have dereferenced it by then. Moreover, the event will always have a valid ifp. Replace the late check with an early assertion. CID: 1357338 Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Tue Oct 23 23:11:38 2018 (r339673) +++ head/sys/netpfil/pf/pf_if.c Tue Oct 23 23:15:44 2018 (r339674) @@ -904,6 +904,9 @@ pfi_detach_group_event(void *arg __unused, struct ifg_ static void pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp) { + + KASSERT(ifp, ("ifp == NULL")); + if (ifp->if_pf_kif == NULL) return; @@ -912,7 +915,7 @@ pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp return; } PF_RULES_WLOCK(); - if (ifp && ifp->if_pf_kif) { + if (ifp->if_pf_kif) { V_pfi_update++; pfi_kif_update(ifp->if_pf_kif); } From owner-svn-src-head@freebsd.org Wed Oct 24 00:17:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A14E1038CA7; Wed, 24 Oct 2018 00:17:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E01FA786C4; Wed, 24 Oct 2018 00:17:19 +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 CC837173F6; Wed, 24 Oct 2018 00:17:19 +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 w9O0HJS1064008; Wed, 24 Oct 2018 00:17:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9O0HJ7Z064007; Wed, 24 Oct 2018 00:17:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810240017.w9O0HJ7Z064007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Oct 2018 00:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339675 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 339675 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, 24 Oct 2018 00:17:20 -0000 Author: markj Date: Wed Oct 24 00:17:19 2018 New Revision: 339675 URL: https://svnweb.freebsd.org/changeset/base/339675 Log: Fix comments. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/libcasper/libcasper.c Modified: head/lib/libcasper/libcasper/libcasper.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper.c Tue Oct 23 23:15:44 2018 (r339674) +++ head/lib/libcasper/libcasper/libcasper.c Wed Oct 24 00:17:19 2018 (r339675) @@ -100,12 +100,12 @@ cap_init(void) pid = pdfork(&pfd, 0); if (pid == 0) { - /* Parent. */ + /* Child. */ close(sock[0]); casper_main_loop(sock[1]); /* NOTREACHED. */ } else if (pid > 0) { - /* Child. */ + /* Parent. */ close(sock[1]); chan = cap_wrap(sock[0], 0); if (chan == NULL) { From owner-svn-src-head@freebsd.org Wed Oct 24 00:19:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57A2D1038E1E; Wed, 24 Oct 2018 00:19:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC40788E7; Wed, 24 Oct 2018 00:19:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045F9173F7; Wed, 24 Oct 2018 00:19:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9O0JiE2064138; Wed, 24 Oct 2018 00:19:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9O0JiXg064137; Wed, 24 Oct 2018 00:19:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810240019.w9O0JiXg064137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 24 Oct 2018 00:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339676 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 339676 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, 24 Oct 2018 00:19:45 -0000 Author: kp Date: Wed Oct 24 00:19:44 2018 New Revision: 339676 URL: https://svnweb.freebsd.org/changeset/base/339676 Log: pf: Fix copy/paste error in IPv6 address rewriting We checked the destination address, but replaced the source address. This was fixed in OpenBSD as part of their NAT rework, which we don't want to import right now. CID: 1009561 MFC after: 3 weeks Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Oct 24 00:17:19 2018 (r339675) +++ head/sys/netpfil/pf/pf.c Wed Oct 24 00:19:44 2018 (r339676) @@ -3429,7 +3429,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (PF_ANEQ(daddr, &nk->addr[pd->didx], AF_INET6)) - PF_ACPY(saddr, &nk->addr[pd->didx], af); + PF_ACPY(daddr, &nk->addr[pd->didx], af); break; #endif /* INET */ } From owner-svn-src-head@freebsd.org Wed Oct 24 02:02:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D88107026D; Wed, 24 Oct 2018 02:02: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8A727C47C; Wed, 24 Oct 2018 02:02:37 +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 A39EC18582; Wed, 24 Oct 2018 02:02:37 +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 w9O22bhd020101; Wed, 24 Oct 2018 02:02:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9O22bsR020100; Wed, 24 Oct 2018 02:02:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810240202.w9O22bsR020100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 24 Oct 2018 02:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339677 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 339677 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, 24 Oct 2018 02:02:38 -0000 Author: kevans Date: Wed Oct 24 02:02:37 2018 New Revision: 339677 URL: https://svnweb.freebsd.org/changeset/base/339677 Log: lualoader: unload upon kernel change if a kernel was previously loaded In the majority of cases, a kernel is not loaded before we hit the menu. However, if a password is set, we'll trigger autoboot and have loadelf'd beforehand. We also need to take into account one dropping to the loader prompt and twiddling with things manually; if they try to toggle through kernels, we'll assume they mean it. Reported by: trasz MFC after: 3 days Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Wed Oct 24 00:19:44 2018 (r339676) +++ head/stand/lua/menu.lua Wed Oct 24 02:02:37 2018 (r339677) @@ -312,6 +312,9 @@ menu.welcome = { #all_choices .. ")" end, func = function(_, choice, _) + if loader.getenv("kernelname") ~= nil then + loader.perform("unload") + end config.selectKernel(choice) end, alias = {"k", "K"}, From owner-svn-src-head@freebsd.org Wed Oct 24 03:14:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B4F81071771; Wed, 24 Oct 2018 03:14:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBAF87E202; Wed, 24 Oct 2018 03:14: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 B30BD19152; Wed, 24 Oct 2018 03:14: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 w9O3EAfl056701; Wed, 24 Oct 2018 03:14:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9O3EAAF056700; Wed, 24 Oct 2018 03:14:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810240314.w9O3EAAF056700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 24 Oct 2018 03:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339678 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 339678 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, 24 Oct 2018 03:14:11 -0000 Author: kevans Date: Wed Oct 24 03:14:10 2018 New Revision: 339678 URL: https://svnweb.freebsd.org/changeset/base/339678 Log: menu.lua: Abort autoboot sequence on failed command Currently, a timeout in the menu autoboot sequence would effectively do nothing. We would return from the autoboot handling, then begin processing the menu without redrawing it. This change makes the behavior a little more friendly. Returning the user to the menu can't have any good effects, so abort the autoboot sequence and drop to the loader prompt. MFC after: 3 days Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Wed Oct 24 02:02:37 2018 (r339677) +++ head/stand/lua/menu.lua Wed Oct 24 03:14:10 2018 (r339678) @@ -373,7 +373,9 @@ function menu.process(menudef, keypress) break elseif key == core.KEY_ENTER then core.boot() - -- Should not return + -- Should not return. If it does, escape menu handling + -- and drop to loader prompt. + return false end key = string.char(key) @@ -404,6 +406,7 @@ function menu.process(menudef, keypress) end function menu.run() + local autoboot_key local delay = loader.getenv("autoboot_delay") if delay ~= nil and delay:lower() == "no" then @@ -419,8 +422,17 @@ function menu.run() menu.draw(menu.default) - local autoboot_key = menu.autoboot(delay) + if delay ~= nil then + autoboot_key = menu.autoboot(delay) + -- autoboot_key should return the key pressed. It will only + -- return nil if we hit the timeout and executed the timeout + -- command. Bail out. + if autoboot_key == nil then + return + end + end + menu.process(menu.default, autoboot_key) drawn_menu = nil @@ -429,11 +441,6 @@ function menu.run() end function menu.autoboot(delay) - -- If we've specified a nil delay, we can do nothing but assume that - -- we aren't supposed to be autobooting. - if delay == nil then - return nil - end local x = loader.getenv("loader_menu_timeout_x") or 4 local y = loader.getenv("loader_menu_timeout_y") or 23 local endtime = loader.time() + delay @@ -467,6 +474,7 @@ function menu.autoboot(delay) local cmd = loader.getenv("menu_timeout_command") or "boot" cli_execute_unparsed(cmd) + return nil end -- CLI commands From owner-svn-src-head@freebsd.org Wed Oct 24 13:11:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30292107AAE1; Wed, 24 Oct 2018 13:11:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B224288F6F; Wed, 24 Oct 2018 13:11:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB9DB249AA; Wed, 24 Oct 2018 10:42:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OAgZP6087393; Wed, 24 Oct 2018 10:42:35 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OAgZeP087392; Wed, 24 Oct 2018 10:42:35 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810241042.w9OAgZeP087392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 24 Oct 2018 10:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339682 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 339682 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, 24 Oct 2018 13:11:11 -0000 Author: bz Date: Wed Oct 24 10:42:35 2018 New Revision: 339682 URL: https://svnweb.freebsd.org/changeset/base/339682 Log: rip6_input() inp validation after epoch(9) After r335924 rip6_input() needs inp validation to avoid working on FREED inps. Apply the relevant bits from r335497,r335501 (rip_input() change) to the IPv6 counterpart. PR: 232194 Reviewed by: rgrimes, ae (,hps) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17594 Modified: head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Wed Oct 24 08:45:33 2018 (r339681) +++ head/sys/netinet6/raw_ip6.c Wed Oct 24 10:42:35 2018 (r339682) @@ -187,6 +187,45 @@ rip6_input(struct mbuf **mp, int *offp, int proto) if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr) && !IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src)) continue; + if (last != NULL) { + struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); + +#if defined(IPSEC) || defined(IPSEC_SUPPORT) + /* + * Check AH/ESP integrity. + */ + if (IPSEC_ENABLED(ipv6)) { + if (n != NULL && + IPSEC_CHECK_POLICY(ipv6, n, last) != 0) { + m_freem(n); + /* Do not inject data into pcb. */ + n = NULL; + } + } +#endif /* IPSEC */ + if (n) { + if (last->inp_flags & INP_CONTROLOPTS || + last->inp_socket->so_options & SO_TIMESTAMP) + ip6_savecontrol(last, n, &opts); + /* strip intermediate headers */ + m_adj(n, *offp); + if (sbappendaddr(&last->inp_socket->so_rcv, + (struct sockaddr *)&fromsa, + n, opts) == 0) { + m_freem(n); + if (opts) + m_freem(opts); + RIP6STAT_INC(rip6s_fullsock); + } else + sorwakeup(last->inp_socket); + opts = NULL; + } + INP_RUNLOCK(last); + last = NULL; + } + INP_RLOCK(in6p); + if (__predict_false(in6p->inp_flags2 & INP_FREED)) + goto skip_2; if (jailed_without_vnet(in6p->inp_cred)) { /* * Allow raw socket in jail to receive multicast; @@ -196,16 +235,14 @@ rip6_input(struct mbuf **mp, int *offp, int proto) if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && prison_check_ip6(in6p->inp_cred, &ip6->ip6_dst) != 0) - continue; + goto skip_2; } - INP_RLOCK(in6p); if (in6p->in6p_cksum != -1) { RIP6STAT_INC(rip6s_isum); if (in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { - INP_RUNLOCK(in6p); RIP6STAT_INC(rip6s_badsum); - continue; + goto skip_2; } } /* @@ -251,46 +288,13 @@ rip6_input(struct mbuf **mp, int *offp, int proto) } if (blocked != MCAST_PASS) { IP6STAT_INC(ip6s_notmember); - INP_RUNLOCK(in6p); - continue; + goto skip_2; } } - if (last != NULL) { - struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); - -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - /* - * Check AH/ESP integrity. - */ - if (IPSEC_ENABLED(ipv6)) { - if (n != NULL && - IPSEC_CHECK_POLICY(ipv6, n, last) != 0) { - m_freem(n); - /* Do not inject data into pcb. */ - n = NULL; - } - } -#endif /* IPSEC */ - if (n) { - if (last->inp_flags & INP_CONTROLOPTS || - last->inp_socket->so_options & SO_TIMESTAMP) - ip6_savecontrol(last, n, &opts); - /* strip intermediate headers */ - m_adj(n, *offp); - if (sbappendaddr(&last->inp_socket->so_rcv, - (struct sockaddr *)&fromsa, - n, opts) == 0) { - m_freem(n); - if (opts) - m_freem(opts); - RIP6STAT_INC(rip6s_fullsock); - } else - sorwakeup(last->inp_socket); - opts = NULL; - } - INP_RUNLOCK(last); - } last = in6p; + continue; +skip_2: + INP_RUNLOCK(in6p); } INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); #if defined(IPSEC) || defined(IPSEC_SUPPORT) From owner-svn-src-head@freebsd.org Wed Oct 24 13:31:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D0CFD87F4; Wed, 24 Oct 2018 13:31:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 192FD8D3B4; Wed, 24 Oct 2018 13:31:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783AA1FE9B; Wed, 24 Oct 2018 08:45:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9O8jYm8026117; Wed, 24 Oct 2018 08:45:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9O8jXxs026113; Wed, 24 Oct 2018 08:45:33 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810240845.w9O8jXxs026113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 24 Oct 2018 08:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339681 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 339681 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, 24 Oct 2018 13:31:18 -0000 Author: bz Date: Wed Oct 24 08:45:33 2018 New Revision: 339681 URL: https://svnweb.freebsd.org/changeset/base/339681 Log: Allow the bhyve VNC server to listen on IPv6 for incoming connections. Alternatively to IPv4 address:port this will allow to listen on IPv6 link-local (incl. scope), a specific address, or ::. Addresses have to be given in RFC2732 format so that [::]:port parsing will work. This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve. PR: 232018 Submitted by: Dave Rush (northwoodlogic.free gmail.com) (original) Reviewed by: Dave Rush (updated verison) MFC after: 3 days Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/pci_fbuf.c head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Wed Oct 24 05:15:46 2018 (r339680) +++ head/usr.sbin/bhyve/Makefile Wed Oct 24 08:45:33 2018 (r339681) @@ -73,6 +73,12 @@ SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread z util sbuf cam +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+=-DINET6 +.endif .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL .else Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Wed Oct 24 05:15:46 2018 (r339680) +++ head/usr.sbin/bhyve/bhyve.8 Wed Oct 24 08:45:33 2018 (r339681) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 23, 2018 +.Dd October 24, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -369,14 +369,15 @@ Framebuffer devices: .Bl -tag -width 10n .It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc .Bl -tag -width 8n -.It Ar IP:port +.It Ar IPv4:port No or Ar [IPv6%zone]:port An .Ar IP address and a .Ar port VNC should listen on. The default is to listen on localhost IPv4 address and default VNC port 5900. -Listening on an IPv6 address is not supported. +An IPv6 address must be enclosed in square brackets and may contain an +optional zone identifer. .It Ar width No and Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. @@ -582,6 +583,20 @@ bhyve -c 2 -m 4G -w -H \\ -s 4,ahci-hd,disk.img \\ -s 5,virtio-net,tap0 \\ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\ + -s 30,xhci,tablet \\ + -s 31,lpc -l com1,stdio \\ + -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ + uefivm +.Ed +.Pp +Run a UEFI virtual machine with a VNC display that is bound to all IPv6 +addresses on port 5900. +.Bd -literal -offset indent +bhyve -c 2 -m 4G -w -H \\ + -s 0,hostbridge \\ + -s 4,ahci-hd,disk.img \\ + -s 5,virtio-net,tap0 \\ + -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\ -s 30,xhci,tablet \\ -s 31,lpc -l com1,stdio \\ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Wed Oct 24 05:15:46 2018 (r339680) +++ head/usr.sbin/bhyve/pci_fbuf.c Wed Oct 24 08:45:33 2018 (r339681) @@ -251,13 +251,33 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o xopts, config)); if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) { - /* parse host-ip:port */ - tmpstr = strsep(&config, ":"); - if (!config) - sc->rfb_port = atoi(tmpstr); - else { - sc->rfb_port = atoi(config); + /* + * IPv4 -- host-ip:port + * IPv6 -- [host-ip%zone]:port + * XXX for now port is mandatory. + */ + tmpstr = strsep(&config, "]"); + if (config) { + if (tmpstr[0] == '[') + tmpstr++; sc->rfb_host = tmpstr; + if (config[0] == ':') + config++; + else { + pci_fbuf_usage(xopts); + ret = -1; + goto done; + } + sc->rfb_port = atoi(config); + } else { + config = tmpstr; + tmpstr = strsep(&config, ":"); + if (!config) + sc->rfb_port = atoi(tmpstr); + else { + sc->rfb_port = atoi(config); + sc->rfb_host = tmpstr; + } } } else if (!strcmp(xopts, "vga")) { if (!strcmp(config, "off")) { Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Wed Oct 24 05:15:46 2018 (r339680) +++ head/usr.sbin/bhyve/rfb.c Wed Oct 24 08:45:33 2018 (r339681) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -960,8 +961,11 @@ sse42_supported(void) int rfb_init(char *hostname, int port, int wait, char *password) { + int e; + char servname[6]; struct rfb_softc *rc; - struct sockaddr_in sin; + struct addrinfo *ai; + struct addrinfo hints; int on = 1; #ifndef WITHOUT_CAPSICUM cap_rights_t rights; @@ -978,29 +982,43 @@ rfb_init(char *hostname, int port, int wait, char *pas rc->password = password; - rc->sfd = socket(AF_INET, SOCK_STREAM, 0); + snprintf(servname, sizeof(servname), "%d", port ? port : 5900); + + if (!hostname || strlen(hostname) == 0) +#if defined(INET) + hostname = "127.0.0.1"; +#elif defined(INET6) + hostname = "[::1]"; +#endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE; + + if ((e = getaddrinfo(hostname, servname, &hints, &ai)) != 0) { + fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(e)); + return(-1); + } + + rc->sfd = socket(ai->ai_family, ai->ai_socktype, 0); if (rc->sfd < 0) { perror("socket"); + freeaddrinfo(ai); return (-1); } setsockopt(rc->sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_port = port ? htons(port) : htons(5900); - if (hostname && strlen(hostname) > 0) - inet_pton(AF_INET, hostname, &(sin.sin_addr)); - else - sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - - if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + if (bind(rc->sfd, ai->ai_addr, ai->ai_addrlen) < 0) { perror("bind"); + freeaddrinfo(ai); return (-1); } if (listen(rc->sfd, 1) < 0) { perror("listen"); + freeaddrinfo(ai); return (-1); } @@ -1028,5 +1046,6 @@ rfb_init(char *hostname, int port, int wait, char *pas pthread_mutex_unlock(&rc->mtx); } + freeaddrinfo(ai); return (0); } From owner-svn-src-head@freebsd.org Wed Oct 24 14:07:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948CDFEA302; Wed, 24 Oct 2018 14:07:45 +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 E197B92AB1; Wed, 24 Oct 2018 14:07:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id FHokguZc11jEDFHolgfpkG; Wed, 24 Oct 2018 05:59:21 -0600 X-Authority-Analysis: v=2.3 cv=W/aMqiek c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=smKx5t2vBNcA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=4hgoUNwhWjAHleHZidAA: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 F2633A1; Wed, 24 Oct 2018 04:59:16 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w9OBxG1V013537; Wed, 24 Oct 2018 04:59:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w9OBxFWg013534; Wed, 24 Oct 2018 04:59:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201810241159.w9OBxFWg013534@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339672 - in head/sys: fs/nfsclient kern sys tools In-Reply-To: Message from Konstantin Belousov of "Tue, 23 Oct 2018 21:43:41 -0000." <201810232143.w9NLhfeK087221@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Oct 2018 04:59:15 -0700 X-CMAE-Envelope: MS4wfIFZToWwnMFjDyFxQ5/e2evnajG9RWIwbGPvOa2dK/Vjti21C/+rwGHr2GrMjm1HBVBZkEQPSO/ghhJJKMspRNK/xr2PzrZoQWFxCd1da+NwHoE0igwI /NaXj+AKXPUN/TKsKTYVxaMhiqEm6V2QH9hGtvXiFEUJ6Q5i/SNfyfClwwCfv+67bQmqRPBVJqBS5TBKXGnwYNKoiOMHpOCrdDvwrjIz63TOYgA6b2LcErzg WjidP0BZxbfrf6NHEP4fuefzdWtJs5IicHG5Zc0Qhks83IGi8wpbzX51sOMd5Jq4 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, 24 Oct 2018 14:07:45 -0000 In message <201810232143.w9NLhfeK087221@repo.freebsd.org>, Konstantin Belousov writes: > Author: kib > Date: Tue Oct 23 21:43:41 2018 > New Revision: 339672 > URL: https://svnweb.freebsd.org/changeset/base/339672 > > Log: > Only call sigdeferstop() for NFS. > > Use bypass to catch any NFS VOP dispatch and route it through the > wrapper which does sigdeferstop() and then dispatches original > VOP. NFS does not need a bypass below it, which is not supported. > > The vop offset in the vop_vector is added since otherwise it is > impossible to get vop_op_t from the internal table, and I did not > wanted to create the layered fs only to wrap NFS VOPs. > > VFS_OP()s wrap is straightforward. > > Requested and reviewed by: mjg (previous version) > Tested by: pho > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D17658 > > Modified: > head/sys/fs/nfsclient/nfs_clvnops.c > head/sys/kern/vfs_default.c > head/sys/kern/vfs_init.c > head/sys/kern/vfs_mount.c > head/sys/sys/mount.h > head/sys/sys/vnode.h > head/sys/tools/vnode_if.awk > Unfortunately this broke amd(8). -- 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 Wed Oct 24 14:10:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F419FEA604; Wed, 24 Oct 2018 14:10:12 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2F0C92EEB; Wed, 24 Oct 2018 14:10:11 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id F33928D4A12D; Wed, 24 Oct 2018 14:10:02 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1C193D1F851; Wed, 24 Oct 2018 14:10:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id OFMlSz-BiayK; Wed, 24 Oct 2018 14:10:00 +0000 (UTC) Received: from [10.9.4.164] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D7F1CD1F813; Wed, 24 Oct 2018 14:09:59 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Eric Joyner" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339338 - in head/sys: amd64/conf conf dev/ixl modules modules/iavf modules/ixl modules/ixlv net Date: Wed, 24 Oct 2018 14:09:58 +0000 X-Mailer: MailMate (2.0BETAr6123) Message-ID: In-Reply-To: <201810122240.w9CMesr3018070@repo.freebsd.org> References: <201810122240.w9CMesr3018070@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed 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, 24 Oct 2018 14:10:12 -0000 On 12 Oct 2018, at 22:40, Eric Joyner wrote: > Author: erj > Date: Fri Oct 12 22:40:54 2018 > New Revision: 339338 > URL: https://svnweb.freebsd.org/changeset/base/339338 > > Log: > ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9) > > Finishes the conversion of the 40Gb Intel Ethernet drivers to > iflib(9) for > FreeBSD 12.0, and fixes numerous bugs in both ixl(4) and iavf(4). > > This commit also re-adds the VF driver to GENERIC since it now > compiles and > functions. > > The VF driver name was changed from ixlv(4) to iavf(4) because the > VF driver is > now intended to be used with future products, not just with > Fortville/Fort Park > VFs. > > A man page update that documents these drivers is forthcoming in a > separate > commit. > > Reviewed by: sbruno@, kbowling@ > Tested by: jeffrey.e.pieper@intel.com Trying to compile a kernel with RSS enabled (as universe does): 10 -------------------------------------------------------------- 11 >>> stage 3.1: building everything 12 -------------------------------------------------------------- 13 /tank/users/bz/head.svn/sys/dev/ixl/if_iavf.c:1952:26: error: no member named 'num_queues' in 'struct ixl_vsi' 14 que_id = que_id % vsi->num_queues; 15 ~~~ ^ 16 1 error generated. 17 --- if_iavf.o --- 18 *** [if_iavf.o] Error code 1 From owner-svn-src-head@freebsd.org Wed Oct 24 14:12:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF886FEAB50; Wed, 24 Oct 2018 14:12:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (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 1DC9693664; Wed, 24 Oct 2018 14:12:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id FJtcgM6D1wyxUFJtdg9lr0; Wed, 24 Oct 2018 08:12:30 -0600 X-Authority-Analysis: v=2.3 cv=NPJhBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=smKx5t2vBNcA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=kOF2avBKLIyz2135TMcA:9 a=CjuIK1q_8ugA:10 a=RdyI0T4chQwA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 1E0894F3; Wed, 24 Oct 2018 07:12:27 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w9OECQqm003967; Wed, 24 Oct 2018 07:12:26 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w9OECQtJ003964; Wed, 24 Oct 2018 07:12:26 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201810241412.w9OECQtJ003964@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339672 - in head/sys: fs/nfsclient kern sys tools In-Reply-To: Message from Cy Schubert of "Wed, 24 Oct 2018 04:59:15 -0700." <201810241159.w9OBxFWg013534@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Oct 2018 07:12:26 -0700 X-CMAE-Envelope: MS4wfJr2t7ukBFZHflhd9bXibfGq0zq5rxbHlx1Sjr3uTagJYSfRL78ejOUXPljUW0gMW/bwryrjB7GyPsJIrB2DwIhLA8pSHpZjVxCqLMzVt5PEhkAzlTEk VfkOqrR7yoK/+HV4bMtwIJOBUU9k21VGKA74Z3O9ClzJ3NWekjlAbTi+KkemEl6AZ8+f6Bac0cN7V25gk93lYyoDkJv8xyFCq2ajKObXlrFxH5O5wlGjEdgr Zo6ZKT9oZf60X/JcfA+RPrVUv4b2K5FWM8rOF4oj6e5Hf9lnqPgwcLJvrgmlse40 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, 24 Oct 2018 14:12:33 -0000 In message <201810241159.w9OBxFWg013534@slippy.cwsent.com>, Cy Schubert writes: > In message <201810232143.w9NLhfeK087221@repo.freebsd.org>, Konstantin > Belousov > writes: > > Author: kib > > Date: Tue Oct 23 21:43:41 2018 > > New Revision: 339672 > > URL: https://svnweb.freebsd.org/changeset/base/339672 > > > > Log: > > Only call sigdeferstop() for NFS. > > > > Use bypass to catch any NFS VOP dispatch and route it through the > > wrapper which does sigdeferstop() and then dispatches original > > VOP. NFS does not need a bypass below it, which is not supported. > > > > The vop offset in the vop_vector is added since otherwise it is > > impossible to get vop_op_t from the internal table, and I did not > > wanted to create the layered fs only to wrap NFS VOPs. > > > > VFS_OP()s wrap is straightforward. > > > > Requested and reviewed by: mjg (previous version) > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D17658 > > > > Modified: > > head/sys/fs/nfsclient/nfs_clvnops.c > > head/sys/kern/vfs_default.c > > head/sys/kern/vfs_init.c > > head/sys/kern/vfs_mount.c > > head/sys/sys/mount.h > > head/sys/sys/vnode.h > > head/sys/tools/vnode_if.awk > > > > Unfortunately this broke amd(8). -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > > > -- > 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 Wed Oct 24 14:14:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9CC0FEAF11; Wed, 24 Oct 2018 14:14:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B30793A83; Wed, 24 Oct 2018 14:14:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 661DF2B6B3; Wed, 24 Oct 2018 14:14:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OEEoTc094688; Wed, 24 Oct 2018 14:14:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OEEobS094687; Wed, 24 Oct 2018 14:14:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810241414.w9OEEobS094687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 24 Oct 2018 14:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339683 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 339683 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, 24 Oct 2018 14:14:50 -0000 Author: bz Date: Wed Oct 24 14:14:49 2018 New Revision: 339683 URL: https://svnweb.freebsd.org/changeset/base/339683 Log: Remove redundant redeclaration of netmap_vp_reg(). This should unbreak sparc64 and powerpc LINT builds. Modified: head/sys/dev/netmap/netmap_bdg.h Modified: head/sys/dev/netmap/netmap_bdg.h ============================================================================== --- head/sys/dev/netmap/netmap_bdg.h Wed Oct 24 10:42:35 2018 (r339682) +++ head/sys/dev/netmap/netmap_bdg.h Wed Oct 24 14:14:49 2018 (r339683) @@ -141,7 +141,6 @@ struct nm_bridge *nm_find_bridge(const char *name, int int netmap_bdg_free(struct nm_bridge *b); void netmap_bdg_detach_common(struct nm_bridge *b, int hw, int sw); int netmap_vp_bdg_ctl(struct nmreq_header *hdr, struct netmap_adapter *na); -int netmap_vp_reg(struct netmap_adapter *na, int onoff); int netmap_bwrap_reg(struct netmap_adapter *, int onoff); int netmap_vp_reg(struct netmap_adapter *na, int onoff); int netmap_vp_rxsync(struct netmap_kring *kring, int flags); From owner-svn-src-head@freebsd.org Wed Oct 24 14:19:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CAB4FEB6A5; Wed, 24 Oct 2018 14:19:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 73F19941A2; Wed, 24 Oct 2018 14:19:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id FK0UgpyAiWppDFK0VgrOKY; Wed, 24 Oct 2018 08:19:36 -0600 X-Authority-Analysis: v=2.3 cv=YIcrNiOx c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=smKx5t2vBNcA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=RKh-o5I4eIHy5pChRCEA:9 a=CjuIK1q_8ugA:10 a=RdyI0T4chQwA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 025AB52B; Wed, 24 Oct 2018 07:19:33 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w9OEJXio004104; Wed, 24 Oct 2018 07:19:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w9OEJXWa004101; Wed, 24 Oct 2018 07:19:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201810241419.w9OEJXWa004101@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339672 - in head/sys: fs/nfsclient kern sys tools In-Reply-To: Message from Cy Schubert of "Wed, 24 Oct 2018 04:59:15 -0700." <201810241159.w9OBxFWg013534@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Oct 2018 07:19:33 -0700 X-CMAE-Envelope: MS4wfFv3ABgzw1/dFU2OU664KSncZBVY4mFSo4lvpO51/g3Mq02KJUWJVr2M6MhwT97blJGW08KMLoNMw7JVFanYZBKpl/Hd1J2wmV7DyLm7HWz6hWE/t4dn IOghif6zvRX8pxCOEp5Chs0y4KGOAHors9EyrB9qBNAYcQImOm8987XFTImVFB/FnQvUpiHzpXaibKguWLASxK/7Ib+DkLYb2IWxVgMrj1MYkKTgbtO1th4/ gatGHx4vocHk4GLyeeiNO2rn8mu/YH460gGkwyZ2P88jvwVLAoxw9uAP6JMPXdmK 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, 24 Oct 2018 14:19:39 -0000 In message <201810241159.w9OBxFWg013534@slippy.cwsent.com>, Cy Schubert writes: > In message <201810232143.w9NLhfeK087221@repo.freebsd.org>, Konstantin > Belousov > writes: > > Author: kib > > Date: Tue Oct 23 21:43:41 2018 > > New Revision: 339672 > > URL: https://svnweb.freebsd.org/changeset/base/339672 > > > > Log: > > Only call sigdeferstop() for NFS. > > > > Use bypass to catch any NFS VOP dispatch and route it through the > > wrapper which does sigdeferstop() and then dispatches original > > VOP. NFS does not need a bypass below it, which is not supported. > > > > The vop offset in the vop_vector is added since otherwise it is > > impossible to get vop_op_t from the internal table, and I did not > > wanted to create the layered fs only to wrap NFS VOPs. > > > > VFS_OP()s wrap is straightforward. > > > > Requested and reviewed by: mjg (previous version) > > Tested by: pho > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D17658 > > > > Modified: > > head/sys/fs/nfsclient/nfs_clvnops.c > > head/sys/kern/vfs_default.c > > head/sys/kern/vfs_init.c > > head/sys/kern/vfs_mount.c > > head/sys/sys/mount.h > > head/sys/sys/vnode.h > > head/sys/tools/vnode_if.awk > > > > Unfortunately this broke amd(8). I should have included this. Oct 24 00:34:13 slippy amd[2741]: '/home': mount: Operation not supported Oct 24 00:34:13 slippy amd[2742]: '/vol': mount: Operation not supported Oct 24 00:34:13 slippy amd[2743]: '/net': mount: Operation not supported Oct 24 00:34:14 slippy amd[2742]: '/vol': mount: Operation not supported Oct 24 00:34:14 slippy amd[2741]: '/home': mount: Operation not supported Oct 24 00:34:14 slippy amd[2742]: amfs_toplvl_mount: amfs_mount failed: Operation not supported -- 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 Wed Oct 24 14:44:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E98FED008; Wed, 24 Oct 2018 14:44:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv33p00im-asmtp001.me.com (pv33p00im-asmtp001.me.com [17.142.194.250]) (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 3989C95C5F; Wed, 24 Oct 2018 14:44:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.pv33p00im-asmtp001.me.com by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) id <0PH300O0079SFE00@pv33p00im-asmtp001.me.com>; Wed, 24 Oct 2018 05:33:31 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPSA id <0PH3004IW8RK7L00@pv33p00im-asmtp001.me.com>; Wed, 24 Oct 2018 05:33:23 +0000 (GMT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810240050 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-24_03:,, signatures=0 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: svn commit: r339673 - head/stand/libsa From: Toomas Soome In-reply-to: <201810232311.w9NNBc4n031783@repo.freebsd.org> Date: Wed, 24 Oct 2018 08:33:19 +0300 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> References: <201810232311.w9NNBc4n031783@repo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.100.39) 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, 24 Oct 2018 14:44:35 -0000 > On 24 Oct 2018, at 02:11, Konstantin Belousov wrote: >=20 > Author: kib > Date: Tue Oct 23 23:11:38 2018 > New Revision: 339673 > URL: https://svnweb.freebsd.org/changeset/base/339673 >=20 > Log: > Fix stand/ build after r339671. >=20 > ffs_subr.c requires calculate_crc32c() from libkern. Unfortunately = we > cannot just add libkern/crc32.c to libstand because crc32.o is = already > compiled from contrib/zlib/crc32.c. Use the include trick to rename > the source. >=20 > Note that libstand also provides crc32.c which seems to be unused. It is used by part.c, by the GPT functions. However, if we have = non-optional compile case for crc32, it is not hard to update part.c and = drop the unused instance. rgds, toomas >=20 > Reviewed by: imp > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D17677 >=20 > Added: > head/stand/libsa/crc32_libkern.c (contents, props changed) > Modified: > head/stand/libsa/Makefile >=20 > Modified: head/stand/libsa/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/stand/libsa/Makefile Tue Oct 23 21:43:41 2018 = (r339672) > +++ head/stand/libsa/Makefile Tue Oct 23 23:11:38 2018 = (r339673) > @@ -155,9 +155,9 @@ SRCS+=3Dffs_subr.c ffs_tables.c >=20 > CFLAGS.bzipfs.c+=3D -I${SRCTOP}/contrib/bzip2 >=20 > -# explicit_bzero > +# explicit_bzero and calculate_crc32c > .PATH: ${SYSDIR}/libkern > -SRCS+=3D explicit_bzero.c > +SRCS+=3D explicit_bzero.c crc32_libkern.c >=20 > # Maybe GELI > .if ${MK_LOADER_GELI} =3D=3D "yes" >=20 > Added: head/stand/libsa/crc32_libkern.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/stand/libsa/crc32_libkern.c Tue Oct 23 23:11:38 2018 = (r339673) > @@ -0,0 +1,3 @@ > +/* $FreeBSD$ */ > + > +#include "../../sys/libkern/crc32.c" >=20 From owner-svn-src-head@freebsd.org Wed Oct 24 14:52:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71A1EFED539 for ; Wed, 24 Oct 2018 14:52:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC8F962FF for ; Wed, 24 Oct 2018 14:52:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe33.google.com with SMTP id e126so3335572vsc.9 for ; Wed, 24 Oct 2018 07:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U9bwDUvVVHpqMxCMFLDrNRlABwzDmpwTiFvO8fWTAZE=; b=ooU8SiD8oQgDzdt3bDqr3IPNsl9ON4fdEbv4RahU5aQQkFu5w0TqXeR43U4taS5s6u RnrZJkAjX3TrEneEyta/S+IzprvlPOaMxbu09RH7FPMhe6wMwDcKgM76Ghgyi1nzeWEq 63bmr6C1l2HRm6NePLL1Kof7ZkqdjHgzqJm6hjzK4QejZNlt19TLWRxfQecbb/EtOxA7 Z2XUV2fVhuuItpoO1AOCeCaByFr03OA7Yqac6EJF+u1V2Ju9DhplIbo8wQ8S/myPOP/1 ILMb5OoHN3hfkN8AypRYh4q79SqKTMqZWbfrsZgng07X11jlJLQuKSCHJG4SoJ7uOYs6 ID0g== 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=U9bwDUvVVHpqMxCMFLDrNRlABwzDmpwTiFvO8fWTAZE=; b=jwKv3dWaDjJoz4qBRztJMGXgG6p8kE8mrXC0oyzQjgalBJrf9uMsFezOhowYQQtzUg w6N5g50J7WaZUgmtYdR+/USes4Pdgv9+MODlPqhQPmzgafsj1Rq80TsaAtEXZTTeKZea PeHrXMKY1rXI0o3NWS6LXp+r0PYNi6IPHTMZBUETJYOlikVGxQp3X8Vdf2xfvmLX4Jwf bF5ecFog8dkZaglANuC7UnwdOnpacP21JheSxeWL2N5UtHFUA1BCXEU0Y+NvnpSPSyt5 KYkwBOrmU8CR1Wr6oLzXoTsP7cCIIfTGNeFZQSjkiflH/PT/dQwtpe8aSwakm2RWPK/C bLbQ== X-Gm-Message-State: AGRZ1gKPwbAom8O62NSDtEfNeNIAnfUnFCT6R0dB2zasHXtaUzulvTlB aRG9VvygVhz700oRW/YDhWlclMb8u/mnMO/7zcSKpTJh X-Google-Smtp-Source: AJdET5fedc1PJbkJEUOI+5roevN5DMGMN9bL1gmpUmnvaeO6cy0x6zwF7ZSaCT33MZjHOdUQ3X+djkMjPYeWqhOxVig= X-Received: by 2002:a67:2704:: with SMTP id n4mr1301220vsn.209.1540392738203; Wed, 24 Oct 2018 07:52:18 -0700 (PDT) MIME-Version: 1.0 References: <201810232311.w9NNBc4n031783@repo.freebsd.org> <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> In-Reply-To: <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> From: Warner Losh Date: Wed, 24 Oct 2018 08:52:06 -0600 Message-ID: Subject: Re: svn commit: r339673 - head/stand/libsa To: Toomas Soome Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: Wed, 24 Oct 2018 14:52:19 -0000 On Wed, Oct 24, 2018 at 8:44 AM Toomas Soome wrote: > > > > On 24 Oct 2018, at 02:11, Konstantin Belousov wrote: > > > > Author: kib > > Date: Tue Oct 23 23:11:38 2018 > > New Revision: 339673 > > URL: https://svnweb.freebsd.org/changeset/base/339673 > > > > Log: > > Fix stand/ build after r339671. > > > > ffs_subr.c requires calculate_crc32c() from libkern. Unfortunately we > > cannot just add libkern/crc32.c to libstand because crc32.o is already > > compiled from contrib/zlib/crc32.c. Use the include trick to rename > > the source. > > > > Note that libstand also provides crc32.c which seems to be unused. > > It is used by part.c, by the GPT functions. However, if we have > non-optional compile case for crc32, it is not hard to update part.c and > drop the unused instance. > I need to go through all users to make sure that we can collapse down some of this insanity... Warner > rgds, > toomas > > > > > Reviewed by: imp > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D17677 > > > > Added: > > head/stand/libsa/crc32_libkern.c (contents, props changed) > > Modified: > > head/stand/libsa/Makefile > > > > Modified: head/stand/libsa/Makefile > > > ============================================================================== > > --- head/stand/libsa/Makefile Tue Oct 23 21:43:41 2018 (r339672) > > +++ head/stand/libsa/Makefile Tue Oct 23 23:11:38 2018 (r339673) > > @@ -155,9 +155,9 @@ SRCS+=ffs_subr.c ffs_tables.c > > > > CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 > > > > -# explicit_bzero > > +# explicit_bzero and calculate_crc32c > > .PATH: ${SYSDIR}/libkern > > -SRCS+= explicit_bzero.c > > +SRCS+= explicit_bzero.c crc32_libkern.c > > > > # Maybe GELI > > .if ${MK_LOADER_GELI} == "yes" > > > > Added: head/stand/libsa/crc32_libkern.c > > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/stand/libsa/crc32_libkern.c Tue Oct 23 23:11:38 2018 > (r339673) > > @@ -0,0 +1,3 @@ > > +/* $FreeBSD$ */ > > + > > +#include "../../sys/libkern/crc32.c" > > > > > From owner-svn-src-head@freebsd.org Wed Oct 24 14:57:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48788FED84C; Wed, 24 Oct 2018 14:57:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79EF9672E; Wed, 24 Oct 2018 14:57:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w9OEunEA088629 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 24 Oct 2018 17:56:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9OEunEA088629 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9OEun6W088628; Wed, 24 Oct 2018 17:56:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 24 Oct 2018 17:56:49 +0300 From: Konstantin Belousov To: Cy Schubert Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339672 - in head/sys: fs/nfsclient kern sys tools Message-ID: <20181024145649.GC5335@kib.kiev.ua> References: <201810241159.w9OBxFWg013534@slippy.cwsent.com> <201810241419.w9OEJXWa004101@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810241419.w9OEJXWa004101@slippy.cwsent.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home 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, 24 Oct 2018 14:57:05 -0000 On Wed, Oct 24, 2018 at 07:19:33AM -0700, Cy Schubert wrote: > In message <201810241159.w9OBxFWg013534@slippy.cwsent.com>, Cy Schubert > writes: > > In message <201810232143.w9NLhfeK087221@repo.freebsd.org>, Konstantin > > Belousov > > writes: > > > Author: kib > > > Date: Tue Oct 23 21:43:41 2018 > > > New Revision: 339672 > > > URL: https://svnweb.freebsd.org/changeset/base/339672 > > > > > > Log: > > > Only call sigdeferstop() for NFS. > > > > > > Use bypass to catch any NFS VOP dispatch and route it through the > > > wrapper which does sigdeferstop() and then dispatches original > > > VOP. NFS does not need a bypass below it, which is not supported. > > > > > > The vop offset in the vop_vector is added since otherwise it is > > > impossible to get vop_op_t from the internal table, and I did not > > > wanted to create the layered fs only to wrap NFS VOPs. > > > > > > VFS_OP()s wrap is straightforward. > > > > > > Requested and reviewed by: mjg (previous version) > > > Tested by: pho > > > Sponsored by: The FreeBSD Foundation > > > Differential revision: https://reviews.freebsd.org/D17658 > > > > > > Modified: > > > head/sys/fs/nfsclient/nfs_clvnops.c > > > head/sys/kern/vfs_default.c > > > head/sys/kern/vfs_init.c > > > head/sys/kern/vfs_mount.c > > > head/sys/sys/mount.h > > > head/sys/sys/vnode.h > > > head/sys/tools/vnode_if.awk > > > > > > > Unfortunately this broke amd(8). > > I should have included this. > > Oct 24 00:34:13 slippy amd[2741]: '/home': mount: Operation not > supported > Oct 24 00:34:13 slippy amd[2742]: '/vol': mount: Operation not supported > Oct 24 00:34:13 slippy amd[2743]: '/net': mount: Operation not supported > Oct 24 00:34:14 slippy amd[2742]: '/vol': mount: Operation not supported > Oct 24 00:34:14 slippy amd[2741]: '/home': mount: Operation not > supported > Oct 24 00:34:14 slippy amd[2742]: amfs_toplvl_mount: amfs_mount failed: > Operation not supported Try this. diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8d98cb199ec..74bfe733100 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -808,8 +808,10 @@ sys_mount(struct thread *td, struct mount_args *uap) free(fstype, M_TEMP); if (vfsp == NULL) return (ENOENT); - if (vfsp->vfc_vfsops->vfs_cmount == NULL || ((vfsp->vfc_flags & - VFCF_SBDRY) != 0 && (vfsp->vfc_vfsops_sd->vfs_cmount == NULL))) + if (((vfsp->vfc_flags & VFCF_SBDRY) != 0 && + vfsp->vfc_vfsops_sd->vfs_cmount == NULL) || + ((vfsp->vfc_flags & VFCF_SBDRY) == 0 && + vfsp->vfc_vfsops->vfs_cmount == NULL)) return (EOPNOTSUPP); ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); From owner-svn-src-head@freebsd.org Wed Oct 24 15:01:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66121FEDC9B; Wed, 24 Oct 2018 15:01:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8BCE96BE6; Wed, 24 Oct 2018 15:01:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w9OF17p8089782 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 24 Oct 2018 18:01:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9OF17p8089782 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9OF17BQ089781; Wed, 24 Oct 2018 18:01:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 24 Oct 2018 18:01:07 +0300 From: Konstantin Belousov To: Toomas Soome Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339673 - head/stand/libsa Message-ID: <20181024150107.GE5335@kib.kiev.ua> References: <201810232311.w9NNBc4n031783@repo.freebsd.org> <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home 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, 24 Oct 2018 15:01:18 -0000 On Wed, Oct 24, 2018 at 08:33:19AM +0300, Toomas Soome wrote: > > > > On 24 Oct 2018, at 02:11, Konstantin Belousov wrote: > > > > Author: kib > > Date: Tue Oct 23 23:11:38 2018 > > New Revision: 339673 > > URL: https://svnweb.freebsd.org/changeset/base/339673 > > > > Log: > > Fix stand/ build after r339671. > > > > ffs_subr.c requires calculate_crc32c() from libkern. Unfortunately we > > cannot just add libkern/crc32.c to libstand because crc32.o is already > > compiled from contrib/zlib/crc32.c. Use the include trick to rename > > the source. > > > > Note that libstand also provides crc32.c which seems to be unused. > > It is used by part.c, by the GPT functions. However, if we have non-optional compile case for crc32, it is not hard to update part.c and drop the unused instance. My point is that static library cannot usefully contain two files with the same name. I believe that libstand.a provides crc32.o compiled from the contrib/zlib location. From owner-svn-src-head@freebsd.org Wed Oct 24 15:09:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4295AFEE1B5 for ; Wed, 24 Oct 2018 15:09:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1FF29727B for ; Wed, 24 Oct 2018 15:09:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe2c.google.com with SMTP id r83so3382826vsc.4 for ; Wed, 24 Oct 2018 08:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mPT8S/B+lPz0DQdgoivmB+0+jBtA98vPZtDR3Up1ibQ=; b=zNfpN3DPQuXLVHsTKoQLnDLm/4IIXwLyeM+6XHok2ppPQKmsPKRqKFs9ZNdpIMFrqa MsBOQnYl2vSbyrvjcAy3YAIpniBHGLibDr91dGeD7S08cPusXqzb0u7wm39T/JfIcSs3 BOFr2P02bk4fhzsZq8yknb1FJa9JEUCmzpy/TFvCcf4k+1NGFAzxVmBvJF27AwiebGRA R2cECxPcYEKGT2VL8uNmj6EJ5T6S3o+5TnkgI42rDnLoSaIIYXPe6kSdgUzrFENsHmqJ LhUD59LzteEpjkydThfRCRD1ToMHOfQOdjavvMgmUrTpbDIjhNaLauVtwmmvWvKrFCIM nbqQ== 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=mPT8S/B+lPz0DQdgoivmB+0+jBtA98vPZtDR3Up1ibQ=; b=Dzl+pTU+Qoxno6nLWjX5w0wCi9fMkdvQ0yBZf0DpEK13oKBzfhhEixrI4Q0U4rUSRW ymAmHDLoLeYARRaun6SrEGg2SiMaJJ3v9jO6c1IA5WbBx0nJu6Z29hRRbiDQSBFYKSEg gRU3Sb4xm487QWa/0aS0zzQIBnxkp8h2ym4WFGQN3qM0ToGCzWII/svaqVtGwYcO4OiR N7Z2dOjMDZciNrFVoPZagEz2F4Dt/SXuUl/xRxzmP0udvIiDDLinoH6KxrpZp2pWytJx cT3TaGQ45G0/Qp/Zjzj2wjbm980CVCbHP0ruV3y1wftMw5GeT6SDT1fIVrnGP7WJ0TVP D5fA== X-Gm-Message-State: AGRZ1gKkJUx2CY7Kmb8S+sEvFa/405J/6fcEQ+ko1Ro9naWBptUG0Ch9 dENgVxr8P+XHefMvCDyo83UaWc0FVk4gsUOUxT+Zcw== X-Google-Smtp-Source: AJdET5ccpXNvAmkXTf3N3/Vjknnav4dhvpNcImNTj/QsTqUzRMifYUz1XzLO26uk4QzdCKVgBUzDetRV9JKnOEafdt0= X-Received: by 2002:a67:e86:: with SMTP id 128mr1275082vso.201.1540393749882; Wed, 24 Oct 2018 08:09:09 -0700 (PDT) MIME-Version: 1.0 References: <201810232311.w9NNBc4n031783@repo.freebsd.org> <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> <20181024150107.GE5335@kib.kiev.ua> In-Reply-To: <20181024150107.GE5335@kib.kiev.ua> From: Warner Losh Date: Wed, 24 Oct 2018 09:08:59 -0600 Message-ID: Subject: Re: svn commit: r339673 - head/stand/libsa To: Konstantin Belousov Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: Wed, 24 Oct 2018 15:09:11 -0000 On Wed, Oct 24, 2018 at 9:01 AM Konstantin Belousov wrote: > On Wed, Oct 24, 2018 at 08:33:19AM +0300, Toomas Soome wrote: > > > > > > > On 24 Oct 2018, at 02:11, Konstantin Belousov wrote: > > > > > > Author: kib > > > Date: Tue Oct 23 23:11:38 2018 > > > New Revision: 339673 > > > URL: https://svnweb.freebsd.org/changeset/base/339673 > > > > > > Log: > > > Fix stand/ build after r339671. > > > > > > ffs_subr.c requires calculate_crc32c() from libkern. Unfortunately we > > > cannot just add libkern/crc32.c to libstand because crc32.o is already > > > compiled from contrib/zlib/crc32.c. Use the include trick to rename > > > the source. > > > > > > Note that libstand also provides crc32.c which seems to be unused. > > > > It is used by part.c, by the GPT functions. However, if we have > non-optional compile case for crc32, it is not hard to update part.c and > drop the unused instance. > > My point is that static library cannot usefully contain two files with the > same name. I believe that libstand.a provides crc32.o compiled from the > contrib/zlib location. > Yes. It does. Warner From owner-svn-src-head@freebsd.org Wed Oct 24 15:42:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68170FF18A8; Wed, 24 Oct 2018 15:42:31 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22B4D6A558; Wed, 24 Oct 2018 15:42:31 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 0FD205F85; Wed, 24 Oct 2018 15:42:31 +0000 (UTC) From: Jan Beich To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> Date: Wed, 24 Oct 2018 17:42:27 +0200 In-Reply-To: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> (Warner Losh's message of "Mon, 22 Oct 2018 02:34:00 +0000 (UTC)") Message-ID: 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: Wed, 24 Oct 2018 15:42:31 -0000 Warner Losh writes: > Author: imp > Date: Mon Oct 22 02:34:00 2018 > New Revision: 339563 > URL: https://svnweb.freebsd.org/changeset/base/339563 > > Log: > Remove joy(4) driver. > > This driver was marked as gone in 12. We're at 13 now. Remove it. > Data from nycbug's dmesg cache shows only one potential user, > suggesting it never was used much. > > RelNotes: yes > Differential Revision: https://reviews.freebsd.org/D17629 Breaking userland API but not bothering with an exp-run or bumping __FreeBSD_version. Is the following the pointy hat you were looking for? https://forums.freebsd.org/threads/graphics-freeglut-fails-to-build-sys-joystick-h-not-found.68002/ From owner-svn-src-head@freebsd.org Wed Oct 24 15:51:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6594AFF1E46; Wed, 24 Oct 2018 15:51:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 130296AC7A; Wed, 24 Oct 2018 15:51:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C602C60D; Wed, 24 Oct 2018 15:51:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OFptZu044664; Wed, 24 Oct 2018 15:51:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OFpt6Q044663; Wed, 24 Oct 2018 15:51:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810241551.w9OFpt6Q044663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 24 Oct 2018 15:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339684 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 339684 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, 24 Oct 2018 15:51:56 -0000 Author: gjb Date: Wed Oct 24 15:51:55 2018 New Revision: 339684 URL: https://svnweb.freebsd.org/changeset/base/339684 Log: Reduce the GCE image size to 27G to be lower than the free quota limit. PR: 232313 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Wed Oct 24 14:14:49 2018 (r339683) +++ head/release/tools/gce.conf Wed Oct 24 15:51:55 2018 (r339684) @@ -3,6 +3,9 @@ # $FreeBSD$ # +# Reduce VMSIZE to be below the free quota limit. +export VMSIZE=27G + # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ From owner-svn-src-head@freebsd.org Wed Oct 24 16:01:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC1EFFA433; Wed, 24 Oct 2018 16:01:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5036B3AD; Wed, 24 Oct 2018 16:01:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 855092C8A2; Wed, 24 Oct 2018 16:01:57 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OG1vVY050484; Wed, 24 Oct 2018 16:01:57 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OG1vGC050482; Wed, 24 Oct 2018 16:01:57 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810241601.w9OG1vGC050482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 24 Oct 2018 16:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339685 - head/tools/tools/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tools/tools/netmap X-SVN-Commit-Revision: 339685 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, 24 Oct 2018 16:01:58 -0000 Author: vmaffione Date: Wed Oct 24 16:01:56 2018 New Revision: 339685 URL: https://svnweb.freebsd.org/changeset/base/339685 Log: netmap: add man page for the vale-ctl program Added man page for vale-ctl program. Small fixes to vale-ctl, including the support for -m option (to specify the netmap memory allocator id). Reviewed by: 0mp Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D17683 Added: head/tools/tools/netmap/vale-ctl.4 (contents, props changed) Modified: head/tools/tools/netmap/vale-ctl.c Added: head/tools/tools/netmap/vale-ctl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netmap/vale-ctl.4 Wed Oct 24 16:01:56 2018 (r339685) @@ -0,0 +1,163 @@ +.\" Copyright (c) 2016 Michio Honda. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 24, 2018 +.Dt VALE-CTL 4 +.Os +.Sh NAME +.Nm vale-ctl +.Nd manage VALE switches provided by netmap +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "vale-ctl" +.It Nm +.Op Fl g Ar valeSSS:PPP +.Op Fl a Ar valeSSS:interface +.Op Fl h Ar valeSSS:interface +.Op Fl d Ar valeSSS:interface +.Op Fl n Ar interface +.Op Fl r Ar interface +.Op Fl l Ar valeSSS:PPP +.Op Fl l +.Op Fl p Ar valeSSS:PPP +.Op Fl P Ar valeSSS:PPP +.Op Fl C Ar spec +.Op Fl m Ar memid +.El +.Ek +.Sh DESCRIPTION +.Nm +manages and inspects +.Xr vale 4 +switches, for instance attaching and detaching interfaces, creating +and deleting persistent VALE ports, or listing the existing switches +and their ports. +In the following, +.Ar valeSSS +is the name of a VALE switch, while +.Ar valeSSS:PPP +is the name of a VALE port of +.Ar valeSSS . +.Pp +When issued without options it lists all the existing switch ports together +with their internal bridge number and port number. +.Bl -tag -width Ds +.It Fl g Ar valeSSS:PPP +Print the number of receive rings of +.Ar valeSSS:PPP . +.It Fl a Ar valeSSS:interface +Attach +.Ar interface +(which must be an existing network interface) to +.Ar valeSSS +and detach it from the host stack. +.It Fl h Ar valeSSS:interface +Attach +.Ar interface +(which must be an existing network interface) to +.Ar valeSSS +while keeping it attached to the host stack. +More precisely, packets coming from +the host stack and directed to the interface will go through the switch, where +they can still reach the interface if the switch rules allow it. +Conversely, packets coming from the interface will go through the switch and, +if appropriate, will reach the host stack. +.It Fl d Ar valeSSS:interface +Detach +.Ar interface +from +.Ar valeSSS . +.It Fl n Ar interface +Create a new persistent VALE port with name +.Ar interface . +The name must be different from any other network interface +already present in the system. +.It Fl d Ar interface +Destroy the persistent VALE port with name +.Ar inteface . +.It Fl l Ar valeSSS:PPP +Show the internal bridge number and port number of the given switch port. +.It Fl p Ar valeSSS:PPP +Enable polling mode for +.Ar valeSSS:PPP . +In polling mode, a dedicated kernel thread is spawned to handle packets +received from +.Ar valeSSS:PPP +and push them into the switch. +The kernel thread busy waits on the switch port rather than relying on +interrupts or notifications. +Polling mode can only be used on physical NICs attached to a VALE switch. +.It Fl P Ar valeSSS:PPP +Disable polling mode for +.Ar valeSSS:PPP . +.It Fl C Ar x | Ar x,y | Ar x,y,z | Ar x,y,z,w +When used in conjunction with +.Fl n +it supplies the number of tx and rx rings and slots. +The full format with four numbers gives, in order, number of tx slots, number +of rx slots, number of tx rings and number of rx rings. +The form with three numbers uses +.Ar z +for both the number of tx and the number of rx rings. +The forms with less than two numbers use the default values for the number +of rings. +The form with two numbers supplies the numbers of tx and rx slots. +The form with only one number uses +.Ar x +for both the number of tx and the number of rx slots. +.Pp +When used in conjunction with +.Fl p +only the first three forms are used. +The first number may be either 0 or 1. +If 0, then all interface rings will be polled by a single thread, running +on the core id given by the second number (the third number, if present, +must be 1). +If the first number is 1, then the ring identified by the second number will +be polled by the core with the same id. +If a third number is given, then this is repeated for as many consecutive +rings and cores. +.It Fl m Ar memid +Used in conjunction with +.Fl n +supplies the netmap memory region identifier to use together with the newly +created persistent VALE port. +These ports use a private memory region by default. +Using this option you can let them share memory with other ports. +Pass 1 as +.Ar memid +to use the global memory region already shared by all +harware netmap ports. +.El +.Sh SEE ALSO +.Xr netmap 4 , +.Xr vale 4 +.Sh AUTHORS +.An -nosplit +.Nm +has been written by +.An Michio Honda +at NetApp. Modified: head/tools/tools/netmap/vale-ctl.c ============================================================================== --- head/tools/tools/netmap/vale-ctl.c Wed Oct 24 15:51:55 2018 (r339684) +++ head/tools/tools/netmap/vale-ctl.c Wed Oct 24 16:01:56 2018 (r339685) @@ -82,7 +82,7 @@ void parse_nmr_config(const char* conf, struct nmreq * } static int -bdg_ctl(const char *name, int nr_cmd, int nr_arg, char *nmr_config) +bdg_ctl(const char *name, int nr_cmd, int nr_arg, char *nmr_config, int nr_arg2) { struct nmreq nmr; int error = 0; @@ -96,9 +96,10 @@ bdg_ctl(const char *name, int nr_cmd, int nr_arg, char bzero(&nmr, sizeof(nmr)); nmr.nr_version = NETMAP_API; if (name != NULL) /* might be NULL */ - strncpy(nmr.nr_name, name, sizeof(nmr.nr_name)); + strncpy(nmr.nr_name, name, sizeof(nmr.nr_name)-1); nmr.nr_cmd = nr_cmd; parse_nmr_config(nmr_config, &nmr); + nmr.nr_arg2 = nr_arg2; switch (nr_cmd) { case NETMAP_BDG_DELIF: @@ -195,42 +196,44 @@ bdg_ctl(const char *name, int nr_cmd, int nr_arg, char return error; } +static void +usage(int errcode) +{ + fprintf(stderr, + "Usage:\n" + "vale-ctl arguments\n" + "\t-g interface interface name to get info\n" + "\t-d interface interface name to be detached\n" + "\t-a interface interface name to be attached\n" + "\t-h interface interface name to be attached with the host stack\n" + "\t-n interface interface name to be created\n" + "\t-r interface interface name to be deleted\n" + "\t-l list all or specified bridge's interfaces (default)\n" + "\t-C string ring/slot setting of an interface creating by -n\n" + "\t-p interface start polling. Additional -C x,y,z configures\n" + "\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n" + "\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n" + "\t\t z: (ONE_NIC only) num of total cores/rings\n" + "\t-P interface stop polling\n" + "\t-m memid to use when creating a new interface\n"); + exit(errcode); +} + int main(int argc, char *argv[]) { int ch, nr_cmd = 0, nr_arg = 0; - const char *command = basename(argv[0]); char *name = NULL, *nmr_config = NULL; + int nr_arg2 = 0; - if (argc > 5) { -usage: - fprintf(stderr, - "Usage:\n" - "%s arguments\n" - "\t-g interface interface name to get info\n" - "\t-d interface interface name to be detached\n" - "\t-a interface interface name to be attached\n" - "\t-h interface interface name to be attached with the host stack\n" - "\t-n interface interface name to be created\n" - "\t-r interface interface name to be deleted\n" - "\t-l list all or specified bridge's interfaces (default)\n" - "\t-C string ring/slot setting of an interface creating by -n\n" - "\t-p interface start polling. Additional -C x,y,z configures\n" - "\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n" - "\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n" - "\t\t z: (ONE_NIC only) num of total cores/rings\n" - "\t-P interface stop polling\n" - "", command); - return 0; - } - - while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:")) != -1) { - if (ch != 'C') + while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:")) != -1) { + if (ch != 'C' && ch != 'm') name = optarg; /* default */ switch (ch) { default: fprintf(stderr, "bad option %c %s", ch, optarg); - goto usage; + usage(-1); + break; case 'd': nr_cmd = NETMAP_BDG_DETACH; break; @@ -252,8 +255,6 @@ usage: break; case 'l': nr_cmd = NETMAP_BDG_LIST; - if (optind < argc && argv[optind][0] == '-') - name = NULL; break; case 'C': nmr_config = strdup(optarg); @@ -264,13 +265,18 @@ usage: case 'P': nr_cmd = NETMAP_BDG_POLLING_OFF; break; + case 'm': + nr_arg2 = atoi(optarg); + break; } } if (optind != argc) { // fprintf(stderr, "optind %d argc %d\n", optind, argc); - goto usage; + usage(-1); } - if (argc == 1) + if (argc == 1) { nr_cmd = NETMAP_BDG_LIST; - return bdg_ctl(name, nr_cmd, nr_arg, nmr_config) ? 1 : 0; + name = NULL; + } + return bdg_ctl(name, nr_cmd, nr_arg, nmr_config, nr_arg2) ? 1 : 0; } From owner-svn-src-head@freebsd.org Wed Oct 24 16:41:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2103DFFC2A0; Wed, 24 Oct 2018 16:41:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BECAB6D60D; Wed, 24 Oct 2018 16:41:47 +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 B9B562CE52; Wed, 24 Oct 2018 16:41:47 +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 w9OGfl8Z070157; Wed, 24 Oct 2018 16:41:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OGflA6070155; Wed, 24 Oct 2018 16:41:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810241641.w9OGflA6070155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Oct 2018 16:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339686 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339686 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, 24 Oct 2018 16:41:48 -0000 Author: markj Date: Wed Oct 24 16:41:47 2018 New Revision: 339686 URL: https://svnweb.freebsd.org/changeset/base/339686 Log: Use a vm_domainset iterator in keg_fetch_slab(). Previously, it used a hand-rolled round-robin iterator. This meant that the minskip logic in r338507 didn't apply to UMA allocations, and also meant that we would call vm_wait() for individual domains rather than permitting an allocation from any domain with sufficient free pages. Discussed with: jeff Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17420 Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Oct 24 16:01:56 2018 (r339685) +++ head/sys/vm/uma_core.c Wed Oct 24 16:41:47 2018 (r339686) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -991,6 +993,8 @@ zone_drain(uma_zone_t zone) /* * Allocate a new slab for a keg. This does not insert the slab onto a list. + * If the allocation was successful, the keg lock will be held upon return, + * otherwise the keg will be left unlocked. * * Arguments: * wait Shall we wait? @@ -1012,13 +1016,12 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom KASSERT(domain >= 0 && domain < vm_ndomains, ("keg_alloc_slab: domain %d out of range", domain)); mtx_assert(&keg->uk_lock, MA_OWNED); - slab = NULL; - mem = NULL; allocf = keg->uk_allocf; KEG_UNLOCK(keg); - size = keg->uk_ppera * PAGE_SIZE; + slab = NULL; + mem = NULL; if (keg->uk_flags & UMA_ZONE_OFFPAGE) { slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, wait); if (slab == NULL) @@ -1041,6 +1044,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom wait |= M_NODUMP; /* zone is passed for legacy reasons. */ + size = keg->uk_ppera * PAGE_SIZE; mem = allocf(zone, size, domain, &flags, wait); if (mem == NULL) { if (keg->uk_flags & UMA_ZONE_OFFPAGE) @@ -1079,20 +1083,18 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom goto out; } } -out: KEG_LOCK(keg); CTR3(KTR_UMA, "keg_alloc_slab: allocated slab %p for %s(%p)", slab, keg->uk_name, keg); - if (slab != NULL) { - if (keg->uk_flags & UMA_ZONE_HASH) - UMA_HASH_INSERT(&keg->uk_hash, slab, mem); + if (keg->uk_flags & UMA_ZONE_HASH) + UMA_HASH_INSERT(&keg->uk_hash, slab, mem); - keg->uk_pages += keg->uk_ppera; - keg->uk_free += keg->uk_ipers; - } + keg->uk_pages += keg->uk_ppera; + keg->uk_free += keg->uk_ipers; +out: return (slab); } @@ -1559,7 +1561,6 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_init = arg->uminit; keg->uk_fini = arg->fini; keg->uk_align = arg->align; - keg->uk_cursor = 0; keg->uk_free = 0; keg->uk_reserve = 0; keg->uk_pages = 0; @@ -1567,6 +1568,14 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_slabzone = NULL; /* + * We use a global round-robin policy by default. Zones with + * UMA_ZONE_NUMA set will use first-touch instead, in which case the + * iterator is never run. + */ + keg->uk_dr.dr_policy = DOMAINSET_RR(); + keg->uk_dr.dr_iter = 0; + + /* * The master zone is passed to us at keg-creation time. */ zone = arg->zone; @@ -2607,7 +2616,7 @@ uma_zalloc_domain(uma_zone_t zone, void *udata, int do * only 'domain'. */ static uma_slab_t -keg_first_slab(uma_keg_t keg, int domain, int rr) +keg_first_slab(uma_keg_t keg, int domain, bool rr) { uma_domain_t dom; uma_slab_t slab; @@ -2636,43 +2645,51 @@ keg_first_slab(uma_keg_t keg, int domain, int rr) } static uma_slab_t -keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, int flags) +keg_fetch_free_slab(uma_keg_t keg, int domain, bool rr, int flags) { + uint32_t reserve; + + mtx_assert(&keg->uk_lock, MA_OWNED); + + reserve = (flags & M_USE_RESERVE) != 0 ? 0 : keg->uk_reserve; + if (keg->uk_free <= reserve) + return (NULL); + return (keg_first_slab(keg, domain, rr)); +} + +static uma_slab_t +keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, const int flags) +{ + struct vm_domainset_iter di; uma_domain_t dom; uma_slab_t slab; - int allocflags, domain, reserve, rr, start; + int aflags, domain; + bool rr; +restart: mtx_assert(&keg->uk_lock, MA_OWNED); - slab = NULL; - reserve = 0; - allocflags = flags; - if ((flags & M_USE_RESERVE) == 0) - reserve = keg->uk_reserve; /* - * Round-robin for non first-touch zones when there is more than one - * domain. + * Use the keg's policy if upper layers haven't already specified a + * domain (as happens with first-touch zones). + * + * To avoid races we run the iterator with the keg lock held, but that + * means that we cannot allow the vm_domainset layer to sleep. Thus, + * clear M_WAITOK and handle low memory conditions locally. */ - if (vm_ndomains == 1) - rdomain = 0; rr = rdomain == UMA_ANYDOMAIN; if (rr) { - start = keg->uk_cursor; - do { - keg->uk_cursor = (keg->uk_cursor + 1) % vm_ndomains; - domain = keg->uk_cursor; - } while (VM_DOMAIN_EMPTY(domain) && domain != start); - domain = start = keg->uk_cursor; - /* Only block on the second pass. */ - if ((flags & (M_WAITOK | M_NOVM)) == M_WAITOK) - allocflags = (allocflags & ~M_WAITOK) | M_NOWAIT; - } else - domain = start = rdomain; + aflags = (flags & ~M_WAITOK) | M_NOWAIT; + vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, + &aflags); + } else { + aflags = flags; + domain = rdomain; + } -again: - do { - if (keg->uk_free > reserve && - (slab = keg_first_slab(keg, domain, rr)) != NULL) { + for (;;) { + slab = keg_fetch_free_slab(keg, domain, rr, flags); + if (slab != NULL) { MPASS(slab->us_keg == keg); return (slab); } @@ -2700,7 +2717,7 @@ again: msleep(keg, &keg->uk_lock, PVM, "keglimit", 0); continue; } - slab = keg_alloc_slab(keg, zone, domain, allocflags); + slab = keg_alloc_slab(keg, zone, domain, aflags); /* * If we got a slab here it's safe to mark it partially used * and return. We assume that the caller is going to remove @@ -2712,17 +2729,16 @@ again: LIST_INSERT_HEAD(&dom->ud_part_slab, slab, us_link); return (slab); } - if (rr) { - do { - domain = (domain + 1) % vm_ndomains; - } while (VM_DOMAIN_EMPTY(domain) && domain != start); + KEG_LOCK(keg); + if (rr && vm_domainset_iter_policy(&di, &domain) != 0) { + if ((flags & M_WAITOK) != 0) { + KEG_UNLOCK(keg); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + KEG_LOCK(keg); + goto restart; + } + break; } - } while (domain != start); - - /* Retry domain scan with blocking. */ - if (allocflags != flags) { - allocflags = flags; - goto again; } /* @@ -2730,8 +2746,7 @@ again: * could have while we were unlocked. Check again before we * fail. */ - if (keg->uk_free > reserve && - (slab = keg_first_slab(keg, domain, rr)) != NULL) { + if ((slab = keg_fetch_free_slab(keg, domain, rr, flags)) != NULL) { MPASS(slab->us_keg == keg); return (slab); } @@ -3606,14 +3621,13 @@ uma_prealloc(uma_zone_t zone, int items) domain = 0; if (slabs * keg->uk_ipers < items) slabs++; - while (slabs > 0) { + while (slabs-- > 0) { slab = keg_alloc_slab(keg, zone, domain, M_WAITOK); if (slab == NULL) - break; + return; MPASS(slab->us_keg == keg); dom = &keg->uk_domain[slab->us_domain]; LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); - slabs--; do { domain = (domain + 1) % vm_ndomains; } while (VM_DOMAIN_EMPTY(domain)); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Oct 24 16:01:56 2018 (r339685) +++ head/sys/vm/uma_int.h Wed Oct 24 16:41:47 2018 (r339686) @@ -226,7 +226,7 @@ struct uma_keg { struct uma_hash uk_hash; LIST_HEAD(,uma_zone) uk_zones; /* Keg's zones */ - uint32_t uk_cursor; /* Domain alloc cursor. */ + struct domainset_ref uk_dr; /* Domain selection policy. */ uint32_t uk_align; /* Alignment mask */ uint32_t uk_pages; /* Total page count */ uint32_t uk_free; /* Count of items free in slabs */ From owner-svn-src-head@freebsd.org Wed Oct 24 16:46:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 091BAFFC712; Wed, 24 Oct 2018 16:46: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC3D16DB04; Wed, 24 Oct 2018 16:46:26 +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 93D5D2CF8A; Wed, 24 Oct 2018 16:46:26 +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 w9OGkQJJ071397; Wed, 24 Oct 2018 16:46:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OGkQ6x071396; Wed, 24 Oct 2018 16:46:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810241646.w9OGkQ6x071396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Oct 2018 16:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339687 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339687 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, 24 Oct 2018 16:46:27 -0000 Author: markj Date: Wed Oct 24 16:46:26 2018 New Revision: 339687 URL: https://svnweb.freebsd.org/changeset/base/339687 Log: Always free dynamically allocated memory before returning. CID: 1007418 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Wed Oct 24 16:41:47 2018 (r339686) +++ head/usr.sbin/rtsold/rtsold.c Wed Oct 24 16:46:26 2018 (r339687) @@ -334,16 +334,16 @@ ifconfig(char *ifname) struct sockaddr_dl *sdl; int flags; + ifi = NULL; if ((sdl = if_nametosdl(ifname)) == NULL) { warnmsg(LOG_ERR, __func__, "failed to get link layer information for %s", ifname); - return (-1); + goto bad; } if (find_ifinfo(sdl->sdl_index)) { warnmsg(LOG_ERR, __func__, "interface %s was already configured", ifname); - free(sdl); - return (-1); + goto bad; } if (Fflag) { @@ -352,30 +352,29 @@ ifconfig(char *ifname) if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { warnmsg(LOG_ERR, __func__, "socket() failed."); - return (-1); + goto bad; } memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, ifname, sizeof(nd.ifname)); if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) { warnmsg(LOG_ERR, __func__, "cannot get accept_rtadv flag"); - close(s); - return (-1); + (void)close(s); + goto bad; } nd.ndi.flags |= ND6_IFF_ACCEPT_RTADV; if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&nd) < 0) { warnmsg(LOG_ERR, __func__, "cannot set accept_rtadv flag"); - close(s); - return (-1); + (void)close(s); + goto bad; } - close(s); + (void)close(s); } if ((ifi = malloc(sizeof(*ifi))) == NULL) { warnmsg(LOG_ERR, __func__, "memory allocation failed"); - free(sdl); - return (-1); + goto bad; } memset(ifi, 0, sizeof(*ifi)); ifi->sdl = sdl; @@ -426,7 +425,7 @@ ifconfig(char *ifname) return (0); bad: - free(ifi->sdl); + free(sdl); free(ifi); return (-1); } From owner-svn-src-head@freebsd.org Wed Oct 24 16:49:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B516EFFCA43; Wed, 24 Oct 2018 16:49: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65F816DE26; Wed, 24 Oct 2018 16:49: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 6105B2CF8F; Wed, 24 Oct 2018 16:49: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 w9OGnH0U071552; Wed, 24 Oct 2018 16:49:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OGnHk6071551; Wed, 24 Oct 2018 16:49:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810241649.w9OGnHk6071551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Oct 2018 16:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339688 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339688 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, 24 Oct 2018 16:49:17 -0000 Author: markj Date: Wed Oct 24 16:49:16 2018 New Revision: 339688 URL: https://svnweb.freebsd.org/changeset/base/339688 Log: Add an #include required after r339686. X-MFC with: r339686 Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Oct 24 16:46:26 2018 (r339687) +++ head/sys/vm/uma_int.h Wed Oct 24 16:49:16 2018 (r339688) @@ -31,6 +31,7 @@ */ #include +#include #include /* From owner-svn-src-head@freebsd.org Wed Oct 24 17:09:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05388FFD516; Wed, 24 Oct 2018 17:09:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A061E6ED93; Wed, 24 Oct 2018 17:09:20 +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 8C0F52D2E5; Wed, 24 Oct 2018 17:09:20 +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 w9OH9K9L082413; Wed, 24 Oct 2018 17:09:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OH9K4h082412; Wed, 24 Oct 2018 17:09:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810241709.w9OH9K4h082412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Oct 2018 17:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339689 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339689 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, 24 Oct 2018 17:09:21 -0000 Author: markj Date: Wed Oct 24 17:09:20 2018 New Revision: 339689 URL: https://svnweb.freebsd.org/changeset/base/339689 Log: Add a !NUMA definition for vm_domainset_iter_policy_ref_init(). Pointy hat: markj X-MFC with: r339661 Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_domainset.c Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Wed Oct 24 16:49:16 2018 (r339688) +++ head/sys/vm/vm_domainset.c Wed Oct 24 17:09:20 2018 (r339689) @@ -351,4 +351,12 @@ vm_domainset_iter_policy_init(struct vm_domainset_iter *domain = 0; } +void +vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *di, + struct domainset_ref *dr, int *domain, int *flags) +{ + + *domain = 0; +} + #endif /* NUMA */ From owner-svn-src-head@freebsd.org Wed Oct 24 18:22:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 167151008795; Wed, 24 Oct 2018 18:22:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 939527397E; Wed, 24 Oct 2018 18:22:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id EA8FA10B429; Wed, 24 Oct 2018 14:22:06 -0400 (EDT) Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys To: Jan Beich , Warner Losh References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <810fae05-8f1f-8efa-c42e-6cc2572feede@FreeBSD.org> Date: Wed, 24 Oct 2018 11:22:06 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 24 Oct 2018 14:22:07 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean 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, 24 Oct 2018 18:22:09 -0000 On 10/24/18 8:42 AM, Jan Beich wrote: > Warner Losh writes: > >> Author: imp >> Date: Mon Oct 22 02:34:00 2018 >> New Revision: 339563 >> URL: https://svnweb.freebsd.org/changeset/base/339563 >> >> Log: >> Remove joy(4) driver. >> >> This driver was marked as gone in 12. We're at 13 now. Remove it. >> Data from nycbug's dmesg cache shows only one potential user, >> suggesting it never was used much. >> >> RelNotes: yes >> Differential Revision: https://reviews.freebsd.org/D17629 > > Breaking userland API but not bothering with an exp-run or bumping __FreeBSD_version. > Is the following the pointy hat you were looking for? > > https://forums.freebsd.org/threads/graphics-freeglut-fails-to-build-sys-joystick-h-not-found.68002/ Jan, While breaking the userland API isn't something we should do, your tone in this mail isn't helpful. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Oct 24 18:42:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEFAC103662E; Wed, 24 Oct 2018 18:42:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9301174C16; Wed, 24 Oct 2018 18:42:13 +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 8DDDF2E344; Wed, 24 Oct 2018 18:42:13 +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 w9OIgD8d035681; Wed, 24 Oct 2018 18:42:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OIgDCX035680; Wed, 24 Oct 2018 18:42:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810241842.w9OIgDCX035680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Oct 2018 18:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339692 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 339692 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, 24 Oct 2018 18:42:14 -0000 Author: markj Date: Wed Oct 24 18:42:13 2018 New Revision: 339692 URL: https://svnweb.freebsd.org/changeset/base/339692 Log: Clarify slightly the interaction between wait*() and pdfork(). There are multiple ways to wait for any child process to return a status (e.g., waitpid(-1, ...), waitid(P_ALL, ...)), so don't be so specific. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/sys/wait.2 Modified: head/lib/libc/sys/wait.2 ============================================================================== --- head/lib/libc/sys/wait.2 Wed Oct 24 18:19:32 2018 (r339691) +++ head/lib/libc/sys/wait.2 Wed Oct 24 18:42:13 2018 (r339692) @@ -28,7 +28,7 @@ .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 24, 2018 .Dt WAIT 2 .Os .Sh NAME @@ -597,11 +597,11 @@ fields of .Fa infop must be checked against zero to determine if a process reported status. .Pp +The .Fn wait -called with -1 to wait for any child process will ignore a child that is -referenced by a process descriptor (see -.Xr pdfork 2 ) . -Specific processes can still be waited on by specifying the process ID. +family of functions will not return a child process created with +.Xr pdfork 2 +unless specifically directed to do so by specifying its process ID. .Sh ERRORS The .Fn wait From owner-svn-src-head@freebsd.org Wed Oct 24 19:21:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CA201037500; Wed, 24 Oct 2018 19:21:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E400D76034; Wed, 24 Oct 2018 19:21:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF0F82E97F; Wed, 24 Oct 2018 19:21:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OJL4Gh052219; Wed, 24 Oct 2018 19:21:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OJL4ra052218; Wed, 24 Oct 2018 19:21:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810241921.w9OJL4ra052218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 24 Oct 2018 19:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339693 - head/usr.sbin/ctm X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/ctm X-SVN-Commit-Revision: 339693 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, 24 Oct 2018 19:21:05 -0000 Author: imp Date: Wed Oct 24 19:21:04 2018 New Revision: 339693 URL: https://svnweb.freebsd.org/changeset/base/339693 Log: add links to the saga of CTM Submitted by: phk Modified: head/usr.sbin/ctm/README Modified: head/usr.sbin/ctm/README ============================================================================== --- head/usr.sbin/ctm/README Wed Oct 24 18:42:13 2018 (r339692) +++ head/usr.sbin/ctm/README Wed Oct 24 19:21:04 2018 (r339693) @@ -82,4 +82,8 @@ Why is CTM not being maintained? Because CVSUP has improved on the concept quite a bit, and is now the method of choice. +Is there a pointer to this whole glorious saga? +----------------------------------------------- +You bet! http://phk.freebsd.dk/sagas/ctm.html + Poul-Henning From owner-svn-src-head@freebsd.org Wed Oct 24 19:28:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB3A0103774B; Wed, 24 Oct 2018 19:28:09 +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 16CEE7647E; Wed, 24 Oct 2018 19:28:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id FOoxgrquSWppDFOoygshJO; Wed, 24 Oct 2018 13:28:01 -0600 X-Authority-Analysis: v=2.3 cv=YIcrNiOx c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=smKx5t2vBNcA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=sGet12G_jDSfRzJ0xdQA:9 a=CjuIK1q_8ugA:10 a=RdyI0T4chQwA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 6CE86AC0; Wed, 24 Oct 2018 12:27:56 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w9OJRrHb004490; Wed, 24 Oct 2018 12:27:53 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w9OJRq8H004487; Wed, 24 Oct 2018 12:27:53 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201810241927.w9OJRq8H004487@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339672 - in head/sys: fs/nfsclient kern sys tools In-Reply-To: Message from Konstantin Belousov of "Wed, 24 Oct 2018 17:56:49 +0300." <20181024145649.GC5335@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Oct 2018 12:27:52 -0700 X-CMAE-Envelope: MS4wfAf2b35ngr1f4W8yU50gmMz/7RkW+lcp0dVaNQiUiLwf1zyzuWs7ix9oS2sCujqWJR7LdewhF63j6yyBYtlETJkDCba4gWBiRZnnmIYSota8DrCjttqO OFSolSZgkGcNHVZRy4LxVYbyVPwTCycaQy0D6e9r4v5y5O1c+lBvYLcPPpDsQmuPq3FT1hcHNDrd6UCc0b8JI93vMsaIJjTrBzm54CG6JFWTVI3g7KkAyTDF ExAYK8qbrMV44Zr/qPf5I7yuKCDZnXG+amHuADzNddYcX0cKGH6dbxmCUHu711DWAZLvUfjDCJck4/81oPgmVg== 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, 24 Oct 2018 19:28:10 -0000 In message <20181024145649.GC5335@kib.kiev.ua>, Konstantin Belousov writes: > On Wed, Oct 24, 2018 at 07:19:33AM -0700, Cy Schubert wrote: > > In message <201810241159.w9OBxFWg013534@slippy.cwsent.com>, Cy Schubert > > writes: > > > In message <201810232143.w9NLhfeK087221@repo.freebsd.org>, Konstantin > > > Belousov > > > writes: > > > > Author: kib > > > > Date: Tue Oct 23 21:43:41 2018 > > > > New Revision: 339672 > > > > URL: https://svnweb.freebsd.org/changeset/base/339672 > > > > > > > > Log: > > > > Only call sigdeferstop() for NFS. > > > > > > > > Use bypass to catch any NFS VOP dispatch and route it through the > > > > wrapper which does sigdeferstop() and then dispatches original > > > > VOP. NFS does not need a bypass below it, which is not supported. > > > > > > > > The vop offset in the vop_vector is added since otherwise it is > > > > impossible to get vop_op_t from the internal table, and I did not > > > > wanted to create the layered fs only to wrap NFS VOPs. > > > > > > > > VFS_OP()s wrap is straightforward. > > > > > > > > Requested and reviewed by: mjg (previous version) > > > > Tested by: pho > > > > Sponsored by: The FreeBSD Foundation > > > > Differential revision: https://reviews.freebsd.org/D17658 > > > > > > > > Modified: > > > > head/sys/fs/nfsclient/nfs_clvnops.c > > > > head/sys/kern/vfs_default.c > > > > head/sys/kern/vfs_init.c > > > > head/sys/kern/vfs_mount.c > > > > head/sys/sys/mount.h > > > > head/sys/sys/vnode.h > > > > head/sys/tools/vnode_if.awk > > > > > > > > > > Unfortunately this broke amd(8). > > > > I should have included this. > > > > Oct 24 00:34:13 slippy amd[2741]: '/home': mount: Operation not > > supported > > Oct 24 00:34:13 slippy amd[2742]: '/vol': mount: Operation not supported > > Oct 24 00:34:13 slippy amd[2743]: '/net': mount: Operation not supported > > Oct 24 00:34:14 slippy amd[2742]: '/vol': mount: Operation not supported > > Oct 24 00:34:14 slippy amd[2741]: '/home': mount: Operation not > > supported > > Oct 24 00:34:14 slippy amd[2742]: amfs_toplvl_mount: amfs_mount failed: > > Operation not supported > > Try this. > > diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c > index 8d98cb199ec..74bfe733100 100644 > --- a/sys/kern/vfs_mount.c > +++ b/sys/kern/vfs_mount.c > @@ -808,8 +808,10 @@ sys_mount(struct thread *td, struct mount_args *uap) > free(fstype, M_TEMP); > if (vfsp == NULL) > return (ENOENT); > - if (vfsp->vfc_vfsops->vfs_cmount == NULL || ((vfsp->vfc_flags & > - VFCF_SBDRY) != 0 && (vfsp->vfc_vfsops_sd->vfs_cmount == NULL))) > + if (((vfsp->vfc_flags & VFCF_SBDRY) != 0 && > + vfsp->vfc_vfsops_sd->vfs_cmount == NULL) || > + ((vfsp->vfc_flags & VFCF_SBDRY) == 0 && > + vfsp->vfc_vfsops->vfs_cmount == NULL)) > return (EOPNOTSUPP); > > ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); Yes, that fixes it. Thank you. -- 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 Wed Oct 24 19:40:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910631037CB4; Wed, 24 Oct 2018 19:40:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475D176BB6; Wed, 24 Oct 2018 19:40:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DE3D2EBD7; Wed, 24 Oct 2018 19:40:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OJe9UN062088; Wed, 24 Oct 2018 19:40:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OJe9Ge062087; Wed, 24 Oct 2018 19:40:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810241940.w9OJe9Ge062087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Oct 2018 19:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339694 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339694 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, 24 Oct 2018 19:40:10 -0000 Author: kib Date: Wed Oct 24 19:40:09 2018 New Revision: 339694 URL: https://svnweb.freebsd.org/changeset/base/339694 Log: Correct condition to detect mount(2) support by a filesystem. Reported and tested by: cy Sponsored by: The FreeBSD Foundation Approved by: re (rgrimes) Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Oct 24 19:21:04 2018 (r339693) +++ head/sys/kern/vfs_mount.c Wed Oct 24 19:40:09 2018 (r339694) @@ -808,8 +808,10 @@ sys_mount(struct thread *td, struct mount_args *uap) free(fstype, M_TEMP); if (vfsp == NULL) return (ENOENT); - if (vfsp->vfc_vfsops->vfs_cmount == NULL || ((vfsp->vfc_flags & - VFCF_SBDRY) != 0 && (vfsp->vfc_vfsops_sd->vfs_cmount == NULL))) + if (((vfsp->vfc_flags & VFCF_SBDRY) != 0 && + vfsp->vfc_vfsops_sd->vfs_cmount == NULL) || + ((vfsp->vfc_flags & VFCF_SBDRY) == 0 && + vfsp->vfc_vfsops->vfs_cmount == NULL)) return (EOPNOTSUPP); ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); From owner-svn-src-head@freebsd.org Wed Oct 24 20:36:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 781C8106F574 for ; Wed, 24 Oct 2018 20:36:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12D18792F2 for ; Wed, 24 Oct 2018 20:36:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe35.google.com with SMTP id a202so4064281vsd.5 for ; Wed, 24 Oct 2018 13:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I+0aIpQZoZlxkXyPeOY/NVF0FZ4brjaY7ZS/H1HZk2I=; b=N88riH07/VUG3owgSGPm3dtPqabsTQSPuKnxoRguLnKbTuDiC6093yahkJyI6NjPju k70fHzQ5xPKd7qQ9UH8jVERdVfyJfXLxqYTSxs3upL6Ye6CYqxOEQgFet4BEvrfqf2u0 4VLO1QojqEd6ZhFzNW2yNSX9qsdKy4TFgHROV3l8XQuxHQZgG+hPnWw8IL3/Ph1MjHxV Vq67UodMoxPu7I+xjPpC+HgHnx1BcO9Jo4qaywedqNEYcdWA65kkh8Gm00x6WDsHdkVE eq0iP6L86vDJ+Uq1nQAKSDkakyVtHHpH3rVKeP5GbsYcpeLUNEoZNRLbfjc3HseHTDsa FIFg== 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+0aIpQZoZlxkXyPeOY/NVF0FZ4brjaY7ZS/H1HZk2I=; b=Bnn6Ol+K7Omj80HDR4Jm80PVdzG/6RtyRnc+mUH7L5lSX8mMovZe6cEyivikOj1yQc LxCSh99OCx18cWTurPddf/2SgqLtjl/1+ReWVkH95ovfhWGi2PR1HkEd4MBa13+Uaq3z XDpFGys79RvarWJ3d8yZo/nn5y5pd6XTjrlbFre2xkMRrVNe6hGPZl4nMv9jMvXPAepj cNT+tt0B2k4qIiFqoeXW21dP1lphe2V8GeUxn6zUHmPkAT3KgUTtGrkJa/+kYH42sJrP buJhtefC7mIrzCvm9D9DNlB0NBClHXfiFAx2KBG8kFNrYjSgSvrGKduBB6p6ljTZj4YP VnFA== X-Gm-Message-State: AGRZ1gJdjZMuufg7R9jiKvtjqDjDQtAtqX99FRHx+EhCLL6phEmPo1uP aNS5OfOfxFljUK3ghsCMZLt9hRF6RfnFIp//y+vAEg== X-Google-Smtp-Source: AJdET5f09ewyhUZEs64bnmP6CIrWP2v7BRUupR5UnDEhVH+bDiuFnHzjpyojFR5BD6NlXzot1SGtVEoMoGV39sK2SNg= X-Received: by 2002:a67:f757:: with SMTP id w23mr1877176vso.76.1540413376223; Wed, 24 Oct 2018 13:36:16 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 24 Oct 2018 14:36:05 -0600 Message-ID: Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys To: Jan Beich Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: Wed, 24 Oct 2018 20:36:17 -0000 On Wed, Oct 24, 2018 at 9:42 AM Jan Beich wrote: > Warner Losh writes: > > > Author: imp > > Date: Mon Oct 22 02:34:00 2018 > > New Revision: 339563 > > URL: https://svnweb.freebsd.org/changeset/base/339563 > > > > Log: > > Remove joy(4) driver. > > > > This driver was marked as gone in 12. We're at 13 now. Remove it. > > Data from nycbug's dmesg cache shows only one potential user, > > suggesting it never was used much. > > > > RelNotes: yes > > Differential Revision: https://reviews.freebsd.org/D17629 > > Breaking userland API but not bothering with an exp-run or bumping > __FreeBSD_version. > Is the following the pointy hat you were looking for? > > > https://forums.freebsd.org/threads/graphics-freeglut-fails-to-build-sys-joystick-h-not-found.68002/ Your tone is not acceptable. Please try again, only this time with the required level of professionalism. I'm not an idiot, and you will treat me with respect. This driver was flagged for removal in 12 ages ago and the port failed to update to take that deprecation into account. So this tone is out of line. You can use the bump to 1300000 as the version to fix it. I didn't bump the revision because it wasn't needed. Warner From owner-svn-src-head@freebsd.org Wed Oct 24 20:49:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8C3106FB0A; Wed, 24 Oct 2018 20:49:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A60279A1D; Wed, 24 Oct 2018 20:49:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 661902F70E; Wed, 24 Oct 2018 20:49:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OKnqQH097926; Wed, 24 Oct 2018 20:49:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OKnqil097925; Wed, 24 Oct 2018 20:49:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810242049.w9OKnqil097925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Oct 2018 20:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339695 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 339695 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, 24 Oct 2018 20:49:53 -0000 Author: glebius Date: Wed Oct 24 20:49:51 2018 New Revision: 339695 URL: https://svnweb.freebsd.org/changeset/base/339695 Log: Remove code that is dead since r287197. Today wlan(4) interfaces aren't children of some other interface. Creation happens only in wlan_up(). Modified: head/libexec/rc/network.subr Modified: head/libexec/rc/network.subr ============================================================================== --- head/libexec/rc/network.subr Wed Oct 24 19:40:09 2018 (r339694) +++ head/libexec/rc/network.subr Wed Oct 24 20:49:51 2018 (r339695) @@ -1469,39 +1469,12 @@ clone_down() # Create and configure child interfaces. Return 0 if child # interfaces are created. # -# XXXGL: the wlan code in this functions is superseded by wlan_up(), -# and will go away soon. -# childif_create() { - local cfg child child_vlans child_wlans create_args debug_flags ifn i + local cfg child child_vlans create_args debug_flags ifn i cfg=1 ifn=$1 - # Create wireless interfaces - child_wlans=`get_if_var $ifn wlans_IF` - - for child in ${child_wlans}; do - create_args="wlandev $ifn `get_if_var $child create_args_IF`" - debug_flags="`get_if_var $child wlandebug_IF`" - - if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then - ${IFCONFIG_CMD} $child create ${create_args} && cfg=0 - if [ -n "${debug_flags}" ]; then - wlandebug -i $child ${debug_flags} - fi - else - i=`${IFCONFIG_CMD} wlan create ${create_args}` - if [ -n "${debug_flags}" ]; then - wlandebug -i $i ${debug_flags} - fi - ${IFCONFIG_CMD} $i name $child && cfg=0 - fi - if autoif $child; then - ifn_start $child - fi - done - # Create vlan interfaces child_vlans=`get_if_var $ifn vlans_IF` @@ -1536,16 +1509,8 @@ childif_create() # childif_destroy() { - local cfg child child_vlans child_wlans ifn + local cfg child child_vlans ifn cfg=1 - - child_wlans=`get_if_var $ifn wlans_IF` - for child in ${child_wlans}; do - if ! ifexists $child; then - continue - fi - ${IFCONFIG_CMD} -n $child destroy && cfg=0 - done child_vlans=`get_if_var $ifn vlans_IF` for child in ${child_vlans}; do From owner-svn-src-head@freebsd.org Wed Oct 24 20:57:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4853106FDE4 for ; Wed, 24 Oct 2018 20:57:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488A779EFD for ; Wed, 24 Oct 2018 20:57:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe2a.google.com with SMTP id u21so3412529vsl.6 for ; Wed, 24 Oct 2018 13:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bCNdR7B1VmQHP6KhIdclcLA8Tj9Jku/0s2/6Z814K2o=; b=Yq6iCcIvym/4W4Rg6Fk9FS8q9vR1FMaKGzFvCV5u2gKoeiYxzfS0bxnzUMcMFW8aQ7 pW3W3LcOH/e9TGY4a9s5GVO2BQ9gcLRXaiKpHaO4D06VtQeTFFKuWt1JRaQ8eAsiR3ZG zK0rmJRTiFJO+2uP/L7GLvydgrhj9aJCCPM2ZZiVufOsN5QuZeIrC4uMi1TD0ujjf30P d8K8r0JkYU5wlxw5gBZ0HrGsHIt/R0R53hEk2Ou9YAoJvuJFVe2VMtNa3KdfRMivys+W wC28LRxRP+vmaBKXo5VxVpiE7k4CePKH/v5dYWFRhk+pJlHg5UrexIWyJOmZs9zYMNK/ 5kxw== 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=bCNdR7B1VmQHP6KhIdclcLA8Tj9Jku/0s2/6Z814K2o=; b=fa9m6nq/v7bilfFoQWT59yvEjVZSekpR/jRLj87PcdPppdXGAH9RmNwl9o0e4Gf+W0 j4+kw3rBqNWIt8XSy/9kSDVROP94lMPWwNGxPXzu4q8BAJ0dIme2OaozWYw/Ih8bZI6c LaRG+cxueO+Aq2h4fTLju26/kXdUG/Ur1sJ39Rk2P3l+db5RTvANImHB0FKOo2BNYBD4 uC7yssM2fzCTqA4V2BdOr1bKjR11KhszQW+pXMjrqOweejQs4MCVT/IQKnE3+fAc20qJ XDkANWXdl5CkXaig7C8wVOask8lF7RZbfu8RIbPbZJDa2u4ijXawTD9jXUP6oceC60pl eTFg== X-Gm-Message-State: AGRZ1gJvkgZ7V5Uz7qxPYWj6o5s85XGTEWsAOR8K+Oz/baMI4KGlhduD 11QukWoXxUHkfqGipb0OsWBZzswBBaUUbnp+KJso9A== X-Google-Smtp-Source: AJdET5f9RoRRd0B31XxTn+PpFDouRj3OQRL108C1DPwGSRa7PnoAfg+gBCtJgSkgnXFIkp1I/99EHKxjhBJlyPslmZQ= X-Received: by 2002:a67:4988:: with SMTP id d8mr1883568vsg.41.1540414636033; Wed, 24 Oct 2018 13:57:16 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 24 Oct 2018 14:57:04 -0600 Message-ID: Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys To: Jan Beich Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: Wed, 24 Oct 2018 20:57:18 -0000 On Wed, Oct 24, 2018 at 2:36 PM Warner Losh wrote: > > > On Wed, Oct 24, 2018 at 9:42 AM Jan Beich wrote: > >> Warner Losh writes: >> >> > Author: imp >> > Date: Mon Oct 22 02:34:00 2018 >> > New Revision: 339563 >> > URL: https://svnweb.freebsd.org/changeset/base/339563 >> > >> > Log: >> > Remove joy(4) driver. >> > >> > This driver was marked as gone in 12. We're at 13 now. Remove it. >> > Data from nycbug's dmesg cache shows only one potential user, >> > suggesting it never was used much. >> > >> > RelNotes: yes >> > Differential Revision: https://reviews.freebsd.org/D17629 >> >> Breaking userland API but not bothering with an exp-run or bumping >> __FreeBSD_version. >> Is the following the pointy hat you were looking for? >> >> >> https://forums.freebsd.org/threads/graphics-freeglut-fails-to-build-sys-joystick-h-not-found.68002/ > > > Your tone is not acceptable. Please try again, only this time with the > required level of professionalism. I'm not an idiot, and you will treat me > with respect. > > This driver was flagged for removal in 12 ages ago and the port failed to > update to take that deprecation into account. So this tone is out of line. > You can use the bump to 1300000 as the version to fix it. I didn't bump the > revision because it wasn't needed. > I posted a patch to the port that makes it compile for me to that thread. If there's confirmation that it works, i'll work with x11@freebsd.org to get it pushed in. Or just push it in myself since I'm on that list and I'm a ports committer. Warner From owner-svn-src-head@freebsd.org Wed Oct 24 21:06:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F67F10703A1; Wed, 24 Oct 2018 21:06:23 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) (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 7139E7A6B0; Wed, 24 Oct 2018 21:06:22 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 78F9B58095F; Thu, 25 Oct 2018 00:06:12 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id b0mevr5MfR-6C7CljRY; Thu, 25 Oct 2018 00:06:12 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1540415172; bh=j5+bq0JkUZMrU13lqdS/PgkSFUxxyGG0NWHSCneS38g=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=v3bU1J4imdfAytVbTjW612v1aIqI3mCtqxydAhOQ466hjolo7eKCQ1oYF0Ya5Ln3/ VNjvFVwY0Itu5WDcgN4VYGiblNnLpmNN8Qo+KCMNI3EXwXTmPfZjdm45buo4zQLUfv yZ3VyCAWr5MyEW/BAp1t1mGQgT0QolOaDffdbpjk= Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id bxGRsXT048-6Bti4qOP; Thu, 25 Oct 2018 00:06:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1540415171; bh=j5+bq0JkUZMrU13lqdS/PgkSFUxxyGG0NWHSCneS38g=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=LifPFPMZlFk3trm9XunJ+H+uKLSbs4xwIkpVvwNVamXW18amP9/9C05yCAMUa9jxu MmABsFJ15YfKjpzmgIRL33I7VwistM0F3TUxbxsrWNzw5O+sJGz4Su9rVUHku971zC FCrqwdAL6EOeRIQmEz8/sr0Bw8xmwvo/Onrw+zCY= Authentication-Results: smtp1j.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r339673 - head/stand/libsa To: Warner Losh , Konstantin Belousov Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810232311.w9NNBc4n031783@repo.freebsd.org> <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> <20181024150107.GE5335@kib.kiev.ua> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <9ec336bd-e45d-4d0f-58de-19dd8eed0a09@yandex.ru> Date: Thu, 25 Oct 2018 00:04:20 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="P5U4jVKQ45paAtvGPWvmYsnnr53O3L4CD" 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, 24 Oct 2018 21:06:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P5U4jVKQ45paAtvGPWvmYsnnr53O3L4CD Content-Type: multipart/mixed; boundary="xp9uGLQZgYTcrylJfLwXXkfRUj9lCm88N"; protected-headers="v1" From: "Andrey V. Elsukov" To: Warner Losh , Konstantin Belousov Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9ec336bd-e45d-4d0f-58de-19dd8eed0a09@yandex.ru> Subject: Re: svn commit: r339673 - head/stand/libsa References: <201810232311.w9NNBc4n031783@repo.freebsd.org> <4893BA79-ED08-401E-9AFD-4A9BD71A076C@me.com> <20181024150107.GE5335@kib.kiev.ua> In-Reply-To: --xp9uGLQZgYTcrylJfLwXXkfRUj9lCm88N Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 24.10.2018 18:08, Warner Losh wrote: > > >=C2=A0 Note that libstand also provides crc32.c which seems to b= e unused. > > > > It is used by part.c, by the GPT functions. However, if we have > non-optional compile case for crc32, it is not hard to update part.= c > and drop the unused instance. >=20 > My point is that static library cannot usefully contain two files > with the > same name.=C2=A0 I believe that libstand.a provides crc32.o compile= d from the > contrib/zlib location. >=20 >=20 > Yes. It does. AFAIR, there was some PR that asks for adding CRC32 support to tha loader commands. Maybe it is time to add something that can be used by all consumers. https://bugs.freebsd.org/bugzilla/buglist.cgi?list_id=3D256921&query_form= at=3Dadvanced&short_desc=3Dcrc32&short_desc_type=3Dallwordssubstr --=20 WBR, Andrey V. Elsukov --xp9uGLQZgYTcrylJfLwXXkfRUj9lCm88N-- --P5U4jVKQ45paAtvGPWvmYsnnr53O3L4CD 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/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlvQ3lQACgkQAcXqBBDI oXqVFQf/XFkkmemE/1tQ/RbaB2mOTcxVuWwpPxkHso+9OdaVm0BucIv/rvFY4gNz kCVfIEmn5olEhfDwuYN/Z0aY+FWn3bgFyfOjeqqis3xXL8teIB77C9U3nLgcahYo JpzFEB633kRuolggXx+j190X5EZPe4Rc+YE5jSXw45jcedE0ikQRkn0ZsEPL01pO PPnUnLi9G/Fg9nAdBSxYkteGj5tW6EMMFpTegukgFdUDpWEeIkeW9gENZcRYwGw0 DvtO2o3ccC2qzQBRMIxKF9OCjzoJOYaXOPXGL6YWKNuPbjylJv/O+InWVrfZx+/i cJ2uIwWYDNLSBVrx1m8rPmCKvx5beQ== =083y -----END PGP SIGNATURE----- --P5U4jVKQ45paAtvGPWvmYsnnr53O3L4CD-- From owner-svn-src-head@freebsd.org Thu Oct 25 01:20:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BB51076CBA; Thu, 25 Oct 2018 01:20:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA5D8341B; Thu, 25 Oct 2018 01:20:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37B062396; Thu, 25 Oct 2018 01:20:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9P1KXIl037359; Thu, 25 Oct 2018 01:20:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P1KXRk037358; Thu, 25 Oct 2018 01:20:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810250120.w9P1KXRk037358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Oct 2018 01:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339700 - 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: 339700 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, 25 Oct 2018 01:20:33 -0000 Author: np Date: Thu Oct 25 01:20:32 2018 New Revision: 339700 URL: https://svnweb.freebsd.org/changeset/base/339700 Log: cxgbe(4): new sysctl to display the start of the RSS region for a VI. dev...rss_base For example: dev.cc.0.rss_base: 0 dev.cc.1.rss_base: 128 dev.vcc.0.rss_base: 256 dev.vcc.1.rss_base: 384 Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Oct 24 23:31:33 2018 (r339699) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 25 01:20:32 2018 (r339700) @@ -6067,6 +6067,8 @@ vi_sysctls(struct vi_info *vi) &vi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &vi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rss_base", CTLFLAG_RD, NULL, + vi->rss_base, "start of RSS indirection table"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rss_size", CTLFLAG_RD, NULL, vi->rss_size, "size of RSS indirection table"); From owner-svn-src-head@freebsd.org Thu Oct 25 02:04:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135CE107938F; Thu, 25 Oct 2018 02:04:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC09A8525F; Thu, 25 Oct 2018 02:04:01 +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 B6F032C3D; Thu, 25 Oct 2018 02:04:01 +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 w9P2416U063042; Thu, 25 Oct 2018 02:04:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P241Db063041; Thu, 25 Oct 2018 02:04:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810250204.w9P241Db063041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Oct 2018 02:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339701 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 339701 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, 25 Oct 2018 02:04:02 -0000 Author: kevans Date: Thu Oct 25 02:04:01 2018 New Revision: 339701 URL: https://svnweb.freebsd.org/changeset/base/339701 Log: Update lualoader test script a little bit Use userboot.so from the test directory if possible, fall back to .OBJDIR. This avoids a problem that we've had since userboot coexistence was added, where userboot.so alone no longer exists in the .OBJDIR but is instead just a link installed later. Modified: head/tools/boot/lua-test.sh Modified: head/tools/boot/lua-test.sh ============================================================================== --- head/tools/boot/lua-test.sh Thu Oct 25 01:20:32 2018 (r339700) +++ head/tools/boot/lua-test.sh Thu Oct 25 02:04:01 2018 (r339701) @@ -13,13 +13,16 @@ scriptdir=$(dirname $(realpath $0)) cd $(make -V SRCTOP)/stand obj=$(make -V .OBJDIR) t=$obj/userboot/test/test -u=$obj/userboot/userboot/userboot.so [ -n "$dir" ] || dir=/tmp/loadertest [ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir} +# We'll try userboot.so from the test directory before plucking it straight out +# of .OBJDIR. +u=$dir/boot/userboot.so +[ -f "$u" ] || u=$obj/userboot/userboot_lua/userboot_lua.so [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" [ -x "$t" ] || die "no userboot test jig found ($t)" -[ -x "$u" ] || die "no userboot.so ($u) found" +[ -f "$u" ] || die "no userboot.so ($u) found" $t -h $dir -b $u From owner-svn-src-head@freebsd.org Thu Oct 25 02:14:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51D15107A071; Thu, 25 Oct 2018 02:14:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0141A85CA1; Thu, 25 Oct 2018 02:14:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04A22E1A; Thu, 25 Oct 2018 02:14: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 w9P2EZsX068176; Thu, 25 Oct 2018 02:14:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P2EZfI068174; Thu, 25 Oct 2018 02:14:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810250214.w9P2EZfI068174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Oct 2018 02:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339702 - in head/stand: liblua lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: liblua lua X-SVN-Commit-Revision: 339702 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, 25 Oct 2018 02:14:36 -0000 Author: kevans Date: Thu Oct 25 02:14:35 2018 New Revision: 339702 URL: https://svnweb.freebsd.org/changeset/base/339702 Log: lualoader: Improve module loading diagnostics Some fixes: - Maintain historical behavior more accurately w.r.t verbose_loading; verbose_loading strictly prints "${module_name...}" and later "failed!" or "ok" based on load success - With or without verbose_loading, dump command_errbuf on load failure. This usually happens prior to ok/failed if we're verbose_loading Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17694 Modified: head/stand/liblua/lutils.c head/stand/lua/config.lua Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Thu Oct 25 02:04:01 2018 (r339701) +++ head/stand/liblua/lutils.c Thu Oct 25 02:14:35 2018 (r339702) @@ -77,6 +77,14 @@ lua_perform(lua_State *L) return 1; } +static int +lua_command_error(lua_State *L) +{ + + lua_pushstring(L, command_errbuf); + return 1; +} + /* * Accepts a space-delimited loader command and runs it through the standard * loader parsing, as if it were executed at the loader prompt by the user. @@ -341,6 +349,7 @@ lua_writefile(lua_State *L) #define REG_SIMPLE(n) { #n, lua_ ## n } static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(delay), + REG_SIMPLE(command_error), REG_SIMPLE(command), REG_SIMPLE(interpret), REG_SIMPLE(parse), Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Thu Oct 25 02:04:01 2018 (r339701) +++ head/stand/lua/config.lua Thu Oct 25 02:14:35 2018 (r339702) @@ -55,7 +55,6 @@ local MSG_XENKERNLOADING = "Loading Xen kernel..." local MSG_KERNLOADING = "Loading kernel..." local MSG_MODLOADING = "Loading configured modules..." local MSG_MODBLACKLIST = "Not loading blacklisted module '%s'" -local MSG_MODLOADFAIL = "Could not load one or more modules!" local MODULEEXPR = '([%w-_]+)' local QVALEXPR = "\"([%w%s%p]-)\"" @@ -292,6 +291,9 @@ local function loadModule(mod, silent) end goto continue end + if not silent then + loader.printc(module_name .. "...") + end local str = "load " if v.type ~= nil then str = str .. "-t " .. v.type .. " " @@ -309,23 +311,29 @@ local function loadModule(mod, silent) end if cli_execute_unparsed(str) ~= 0 then + -- XXX Temporary shim: don't break the boot if + -- loader hadn't been recompiled with this + -- function exposed. + if loader.command_error then + print(loader.command_error()) + end if not silent then - print(MSG_FAILEXMOD:format(str)) + print("failed!") end if v.error ~= nil then cli_execute_unparsed(v.error) end status = false - end - - if v.after ~= nil then + elseif v.after ~= nil then pstatus = cli_execute_unparsed(v.after) == 0 if not pstatus and not silent then print(MSG_FAILEXAF:format(v.after, k)) end + if not silent then + print("ok") + end status = status and pstatus end - end ::continue:: end @@ -622,20 +630,18 @@ function config.loadelf() print(MSG_XENKERNLOADING) if cli_execute_unparsed('load ' .. xen_kernel) ~= 0 then print(MSG_XENKERNFAIL:format(xen_kernel)) - return + return false end end print(MSG_KERNLOADING) loaded = config.loadKernel(kernel) if not loaded then - return + return false end print(MSG_MODLOADING) - if not loadModule(modules, not config.verbose) then - print(MSG_MODLOADFAIL) - end + return loadModule(modules, not config.verbose) end hook.registerType("config.loaded") From owner-svn-src-head@freebsd.org Thu Oct 25 04:14:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85566FD6C5C; Thu, 25 Oct 2018 04:14: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 304D06DB11; Thu, 25 Oct 2018 04:14:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 430393C475F; Thu, 25 Oct 2018 04:14:46 +0000 (UTC) Date: Thu, 25 Oct 2018 04:14:46 +0000 From: Brooks Davis To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339703 - in head: share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc sys/dev/ae sys/dev/bm sys/dev/cs sys/dev/de sys/dev/dme sys/dev/ed sys/dev/ep sys/dev/ex sys/dev/f... Message-ID: <20181025041446.GA31765@spindle.one-eyed-alien.net> References: <201810250410.w9P4AfHj025410@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <201810250410.w9P4AfHj025410@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) 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, 25 Oct 2018 04:14:53 -0000 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 25, 2018 at 04:10:41AM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Oct 25 04:10:41 2018 > New Revision: 339703 > URL: https://svnweb.freebsd.org/changeset/base/339703 >=20 > Log: > Deprecate a number of less used 10 and 10/100 Ethernet devices. > =20 > The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, > pcn, sf, sn, tl, tx, txp, vx, wb, xe > =20 > The list as refined as part of FCP-0101. Per the FCP, devices may be > removed from the deprecation list if enough users are found or they are > converted to iflib. > =20 > FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md I've committed this prior to a formal wrap up of core voting due to a request to get these into tomorrow's BETA build. Voting stands a 5-yes, 0-no, and 1-abstain (me as the author) so this seems sufficiently safe. -- Brooks --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJb0UM1AAoJEKzQXbSebgfA12YIAIJrqrDhLp8avy9/vMil1N2N MAA1oEXsoj2SW9NO69W1Hy/GP6eFM4AFjz2FSmuYBJ3k/HdrTZPGl1YGZWIOFYJx IiWTvBsRsNgQAIRWB5gOU15vVF5xe4AbkTIVZmilxMpTelB9zc5/4rvGm8BpyTcj bYJoPw6w88kVTB2LQCLuC1Dz69o00GLY9GVJQI/2kUJA6godW94PQSgvvB54tkfZ RrFEJG1ktKjfans0Bg0THJRo8LjtG7e6PGm8cs03WpBEnsR8f2fWEWUOYtV2vCLg /r1F1Lziwqtfje5KHeNiqfvHaQQWwz8f80JEFSBanRCDbwvqxcm+zvZsD93UR5k= =C6Ec -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3-- From owner-svn-src-head@freebsd.org Thu Oct 25 04:29:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA75FD75B4; Thu, 25 Oct 2018 04:29:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 6FEF56E084; Thu, 25 Oct 2018 04:29:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9P4T04m032351; Wed, 24 Oct 2018 21:29:00 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9P4SxHw032350; Wed, 24 Oct 2018 21:28:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810250428.w9P4SxHw032350@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339703 - in head: share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc sys/dev/ae sys/dev/bm sys/dev/cs sys/dev/de sys/dev/dme sys/dev/ed sys/dev/ep sys/dev/ex sys/dev/f... In-Reply-To: <20181025041446.GA31765@spindle.one-eyed-alien.net> To: Brooks Davis Date: Wed, 24 Oct 2018 21:28:59 -0700 (PDT) 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-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, 25 Oct 2018 04:29:03 -0000 > On Thu, Oct 25, 2018 at 04:10:41AM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Thu Oct 25 04:10:41 2018 > > New Revision: 339703 > > URL: https://svnweb.freebsd.org/changeset/base/339703 > > > > Log: > > Deprecate a number of less used 10 and 10/100 Ethernet devices. > > > > The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, > > pcn, sf, sn, tl, tx, txp, vx, wb, xe > > > > The list as refined as part of FCP-0101. Per the FCP, devices may be > > removed from the deprecation list if enough users are found or they are > > converted to iflib. > > > > FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Differential: https://reviews.freebsd.org/D17654 Reviewed by: rgrimes > I've committed this prior to a formal wrap up of core voting due to a > request to get these into tomorrow's BETA build. Voting stands a 5-yes, > 0-no, and 1-abstain (me as the author) so this seems sufficiently safe. > > -- Brooks -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Oct 25 04:10:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83D44FD681B; Thu, 25 Oct 2018 04:10:49 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35B336D72C; Thu, 25 Oct 2018 04:10:49 +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 17F24493D; Thu, 25 Oct 2018 04:10:49 +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 w9P4AnUX025447; Thu, 25 Oct 2018 04:10:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P4AfHj025410; Thu, 25 Oct 2018 04:10:41 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810250410.w9P4AfHj025410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 25 Oct 2018 04:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339703 - in head: share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc sys/dev/ae sys/dev/bm sys/dev/cs sys/dev/de sys/dev/dme sys/dev/ed sys/dev/ep sys/dev/ex sys/dev/f... X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc sys/dev/ae sys/dev/bm sys/dev/cs sys/dev/de sys/dev/dme sys/dev/ed sys/dev/ep sys/dev/ex sys/dev/fe sys/dev/pcn sys/dev/sf ... X-SVN-Commit-Revision: 339703 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, 25 Oct 2018 04:10:49 -0000 Author: brooks Date: Thu Oct 25 04:10:41 2018 New Revision: 339703 URL: https://svnweb.freebsd.org/changeset/base/339703 Log: Deprecate a number of less used 10 and 10/100 Ethernet devices. The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, pcn, sf, sn, tl, tx, txp, vx, wb, xe The list as refined as part of FCP-0101. Per the FCP, devices may be removed from the deprecation list if enough users are found or they are converted to iflib. FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Modified: head/share/man/man4/ae.4 head/share/man/man4/de.4 head/share/man/man4/ed.4 head/share/man/man4/man4.i386/cs.4 head/share/man/man4/man4.i386/ep.4 head/share/man/man4/man4.i386/ex.4 head/share/man/man4/man4.i386/fe.4 head/share/man/man4/man4.i386/vx.4 head/share/man/man4/man4.powerpc/bm.4 head/share/man/man4/pcn.4 head/share/man/man4/sf.4 head/share/man/man4/sn.4 head/share/man/man4/tl.4 head/share/man/man4/tx.4 head/share/man/man4/txp.4 head/share/man/man4/wb.4 head/share/man/man4/xe.4 head/sys/dev/ae/if_ae.c head/sys/dev/bm/if_bm.c head/sys/dev/cs/if_cs.c head/sys/dev/de/if_de.c head/sys/dev/dme/if_dme.c head/sys/dev/ed/if_ed.c head/sys/dev/ep/if_ep.c head/sys/dev/ex/if_ex.c head/sys/dev/fe/if_fe.c head/sys/dev/pcn/if_pcn.c head/sys/dev/sf/if_sf.c head/sys/dev/sn/if_sn.c head/sys/dev/tl/if_tl.c head/sys/dev/tx/if_tx.c head/sys/dev/txp/if_txp.c head/sys/dev/vx/if_vx.c head/sys/dev/wb/if_wb.c head/sys/dev/xe/if_xe.c head/sys/sys/systm.h Modified: head/share/man/man4/ae.4 ============================================================================== --- head/share/man/man4/ae.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/ae.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 4, 2008 +.Dd October 24, 2018 .Dt AE 4 .Os .Sh NAME @@ -44,6 +44,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ae_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/de.4 ============================================================================== --- head/share/man/man4/de.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/de.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt DE 4 .Os .Sh NAME @@ -45,6 +45,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_de_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/ed.4 ============================================================================== --- head/share/man/man4/ed.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/ed.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd October 24, 2018 .Dt ED 4 .Os .Sh NAME @@ -51,6 +51,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ed_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/man4.i386/cs.4 ============================================================================== --- head/share/man/man4/man4.i386/cs.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/man4.i386/cs.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24 2018 .Dt CS 4 i386 .Os .Sh NAME @@ -52,6 +52,14 @@ In .Cd hint.cs.0.port="0x300" .Cd hint.cs.0.irq="10" .Cd hint.cs.0.maddr="0xd000" +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/man4.i386/ep.4 ============================================================================== --- head/share/man/man4/man4.i386/ep.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/man4.i386/ep.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2011 +.Dd October 24, 2018 .Dt EP 4 i386 .Os .Sh NAME @@ -49,6 +49,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ep_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/man4.i386/ex.4 ============================================================================== --- head/share/man/man4/man4.i386/ex.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/man4.i386/ex.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt EX 4 i386 .Os .Sh NAME @@ -45,6 +45,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ex_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/man4.i386/fe.4 ============================================================================== --- head/share/man/man4/man4.i386/fe.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/man4.i386/fe.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -22,7 +22,7 @@ .\" for fe driver. .\" .\" $FreeBSD$ -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt FE 4 i386 .Os .Sh NAME @@ -48,6 +48,14 @@ In .Cd hint.fe.0.at="isa" .Cd hint.fe.0.port="0x300" .Cd hint.fe.0.flags="0x0" +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/man4.i386/vx.4 ============================================================================== --- head/share/man/man4/man4.i386/vx.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/man4.i386/vx.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2017 +.Dd October 24, 2018 .Dt VX 4 i386 .Os .Sh NAME @@ -50,6 +50,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_vx_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/man4.powerpc/bm.4 ============================================================================== --- head/share/man/man4/man4.powerpc/bm.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/man4.powerpc/bm.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2008 +.Dd October 24, 2018 .Dt BM 4 .Os .Sh NAME @@ -46,6 +46,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_bm_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/pcn.4 ============================================================================== --- head/share/man/man4/pcn.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/pcn.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2006 +.Dd October 24, 2018 .Dt PCN 4 .Os .Sh NAME @@ -52,6 +52,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_pcn_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/sf.4 ============================================================================== --- head/share/man/man4/sf.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/sf.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2008 +.Dd October 24, 2018 .Dt SF 4 .Os .Sh NAME @@ -53,6 +53,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_sf_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/sn.4 ============================================================================== --- head/share/man/man4/sn.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/sn.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt SN 4 .Os .Sh NAME @@ -43,6 +43,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_sn_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/tl.4 ============================================================================== --- head/share/man/man4/tl.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/tl.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt TL 4 .Os .Sh NAME @@ -51,6 +51,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_tl_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/tx.4 ============================================================================== --- head/share/man/man4/tx.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/tx.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt TX 4 .Os .Sh NAME @@ -46,6 +46,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_tx_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/txp.4 ============================================================================== --- head/share/man/man4/txp.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/txp.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2012 +.Dd October 24, 2018 .Dt TXP 4 .Os .Sh NAME @@ -46,6 +46,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_txp_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/wb.4 ============================================================================== --- head/share/man/man4/wb.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/wb.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24, 2018 .Dt WB 4 .Os .Sh NAME @@ -51,6 +51,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_wb_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/share/man/man4/xe.4 ============================================================================== --- head/share/man/man4/xe.4 Thu Oct 25 02:14:35 2018 (r339702) +++ head/share/man/man4/xe.4 Thu Oct 25 04:10:41 2018 (r339703) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd October 24 2018 .Dt XE 4 .Os .Sh NAME @@ -45,6 +45,14 @@ module at boot time, place the following line in .Bd -literal -offset indent if_xe_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more +information. .Sh DESCRIPTION The .Nm Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/ae/if_ae.c Thu Oct 25 04:10:41 2018 (r339703) @@ -396,6 +396,8 @@ ae_attach(device_t dev) goto fail; } + gone_by_fcp101_dev(dev); + fail: if (error != 0) ae_detach(dev); Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/bm/if_bm.c Thu Oct 25 04:10:41 2018 (r339703) @@ -483,6 +483,8 @@ bm_attach(device_t dev) ether_ifattach(ifp, sc->sc_enaddr); ifp->if_hwassist = 0; + gone_by_fcp101_dev(dev); + return (0); } Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/cs/if_cs.c Thu Oct 25 04:10:41 2018 (r339703) @@ -574,6 +574,8 @@ cs_attach(device_t dev) return (error); } + gone_by_fcp101_dev(dev); + return (0); } Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/de/if_de.c Thu Oct 25 04:10:41 2018 (r339703) @@ -4432,6 +4432,8 @@ tulip_attach(tulip_softc_t * const sc) TULIP_LOCK(sc); sc->tulip_flags &= ~TULIP_DEVICEPROBE; TULIP_UNLOCK(sc); + + gone_by_fcp101_dev(sc->tulip_dev); } /* Release memory for a single descriptor ring. */ Modified: head/sys/dev/dme/if_dme.c ============================================================================== --- head/sys/dev/dme/if_dme.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/dme/if_dme.c Thu Oct 25 04:10:41 2018 (r339703) @@ -915,6 +915,9 @@ dme_attach(device_t dev) ether_ifdetach(ifp); goto fail; } + + gone_by_fcp101_dev(dev); + fail: if (error != 0) dme_detach(dev); Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/ed/if_ed.c Thu Oct 25 04:10:41 2018 (r339703) @@ -365,6 +365,9 @@ ed_attach(device_t dev) #endif printf("\n"); } + + gone_by_fcp101_dev(dev); + return (0); } Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/ep/if_ep.c Thu Oct 25 04:10:41 2018 (r339703) @@ -350,6 +350,8 @@ ep_attach(struct ep_softc *sc) epstop(sc); EP_UNLOCK(sc); + gone_by_fcp101_dev(sc->dev); + return (0); } Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/ex/if_ex.c Thu Oct 25 04:10:41 2018 (r339703) @@ -276,6 +276,8 @@ ex_attach(device_t dev) return (error); } + gone_by_fcp101_dev(dev); + return(0); } Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/fe/if_fe.c Thu Oct 25 04:10:41 2018 (r339703) @@ -861,6 +861,8 @@ fe_attach (device_t dev) if (sc->stability & UNSTABLE_TYPE) device_printf(dev, "warning: hardware type was not validated\n"); + gone_by_fcp101_dev(dev); + return 0; } Modified: head/sys/dev/pcn/if_pcn.c ============================================================================== --- head/sys/dev/pcn/if_pcn.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/pcn/if_pcn.c Thu Oct 25 04:10:41 2018 (r339703) @@ -684,6 +684,8 @@ fail: if (error) pcn_detach(dev); + gone_by_fcp101_dev(dev); + return(error); } Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/sf/if_sf.c Thu Oct 25 04:10:41 2018 (r339703) @@ -917,6 +917,8 @@ sf_attach(device_t dev) goto fail; } + gone_by_fcp101_dev(dev); + fail: if (error) sf_detach(dev); Modified: head/sys/dev/sn/if_sn.c ============================================================================== --- head/sys/dev/sn/if_sn.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/sn/if_sn.c Thu Oct 25 04:10:41 2018 (r339703) @@ -227,6 +227,9 @@ sn_attach(device_t dev) sn_detach(dev); return err; } + + gone_by_fcp101_dev(dev); + return 0; } Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/tl/if_tl.c Thu Oct 25 04:10:41 2018 (r339703) @@ -1242,6 +1242,8 @@ tl_attach(dev) goto fail; } + gone_by_fcp101_dev(dev); + fail: if (error) tl_detach(dev); Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/tx/if_tx.c Thu Oct 25 04:10:41 2018 (r339703) @@ -428,6 +428,8 @@ epic_attach(device_t dev) goto fail; } + gone_by_fcp101_dev(dev); + return (0); fail: epic_release(sc); Modified: head/sys/dev/txp/if_txp.c ============================================================================== --- head/sys/dev/txp/if_txp.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/txp/if_txp.c Thu Oct 25 04:10:41 2018 (r339703) @@ -472,6 +472,8 @@ txp_attach(device_t dev) goto fail; } + gone_by_fcp101_dev(dev); + return (0); fail: Modified: head/sys/dev/vx/if_vx.c ============================================================================== --- head/sys/dev/vx/if_vx.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/vx/if_vx.c Thu Oct 25 04:10:41 2018 (r339703) @@ -206,6 +206,8 @@ vx_attach(device_t dev) vx_stop(sc); VX_UNLOCK(sc); + gone_by_fcp101_dev(dev); + return 1; } Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/wb/if_wb.c Thu Oct 25 04:10:41 2018 (r339703) @@ -694,6 +694,8 @@ wb_attach(dev) goto fail; } + gone_by_fcp101_dev(dev); + fail: if (error) wb_detach(dev); Modified: head/sys/dev/xe/if_xe.c ============================================================================== --- head/sys/dev/xe/if_xe.c Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/dev/xe/if_xe.c Thu Oct 25 04:10:41 2018 (r339703) @@ -317,6 +317,8 @@ xe_attach(device_t dev) return (err); } + gone_by_fcp101_dev(dev); + /* Done */ return (0); } Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Thu Oct 25 02:14:35 2018 (r339702) +++ head/sys/sys/systm.h Thu Oct 25 04:10:41 2018 (r339703) @@ -542,6 +542,9 @@ void _gone_in_dev(struct device *dev, int major, const #endif #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) +#define gone_by_fcp101_dev(dev) \ + gone_in_dev((dev), 13, \ + "see https://github.com/freebsd/fcp/blob/master/fcp-0101.md") __NULLABILITY_PRAGMA_POP From owner-svn-src-head@freebsd.org Thu Oct 25 06:24:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A7A7FEE2B0; Thu, 25 Oct 2018 06:24:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0119472DB3; Thu, 25 Oct 2018 06:24:43 +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 F01DC608B; Thu, 25 Oct 2018 06:24:42 +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 w9P6Og5h096372; Thu, 25 Oct 2018 06:24:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P6OgeY096370; Thu, 25 Oct 2018 06:24:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810250624.w9P6OgeY096370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Oct 2018 06:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339705 - 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: 339705 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, 25 Oct 2018 06:24:43 -0000 Author: np Date: Thu Oct 25 06:24:42 2018 New Revision: 339705 URL: https://svnweb.freebsd.org/changeset/base/339705 Log: cxgbe(4): Update the VI's default queue when netmap is enabled/disabled. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Oct 25 05:18:25 2018 (r339704) +++ head/sys/dev/cxgbe/adapter.h Thu Oct 25 06:24:42 2018 (r339705) @@ -194,6 +194,7 @@ struct vi_info { int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ uint16_t rss_base; /* start of VI's RSS table slice */ + int hashen; int nintr; int first_intr; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 25 05:18:25 2018 (r339704) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 25 06:24:42 2018 (r339705) @@ -5152,7 +5152,7 @@ vi_full_init(struct vi_info *vi) struct ifnet *ifp = vi->ifp; uint16_t *rss; struct sge_rxq *rxq; - int rc, i, j, hashen; + int rc, i, j; #ifdef RSS int nbuckets = rss_getnumbuckets(); int hashconfig = rss_gethashconfig(); @@ -5216,14 +5216,14 @@ vi_full_init(struct vi_info *vi) } #ifdef RSS - hashen = hashconfig_to_hashen(hashconfig); + vi->hashen = hashconfig_to_hashen(hashconfig); /* * We may have had to enable some hashes even though the global config * wants them disabled. This is a potential problem that must be * reported to the user. */ - extra = hashen_to_hashconfig(hashen) ^ hashconfig; + extra = hashen_to_hashconfig(vi->hashen) ^ hashconfig; /* * If we consider only the supported hash types, then the enabled hashes @@ -5252,12 +5252,12 @@ vi_full_init(struct vi_info *vi) if (extra & RSS_HASHTYPE_RSS_UDP_IPV6) if_printf(ifp, "UDP/IPv6 4-tuple hashing forced on.\n"); #else - hashen = F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | + vi->hashen = F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_UDPEN; #endif - rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, hashen, rss[0], 0, 0); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, rss[0], 0, 0); if (rc != 0) { free(rss, M_CXGBE); if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc); Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Oct 25 05:18:25 2018 (r339704) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Oct 25 06:24:42 2018 (r339705) @@ -415,6 +415,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi if (rc != 0) if_printf(ifp, "netmap rss_config failed: %d\n", rc); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, + vi->nm_rss[0], 0, 0); + if (rc != 0) + if_printf(ifp, "netmap rss hash/defaultq config failed: %d\n", rc); + return (rc); } @@ -436,6 +441,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v vi->rss, vi->rss_size); if (rc != 0) if_printf(ifp, "failed to restore RSS config: %d\n", rc); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, vi->rss[0], 0, 0); + if (rc != 0) + if_printf(ifp, "failed to restore RSS hash/defaultq: %d\n", rc); nm_clear_native_flags(na); for_each_nm_txq(vi, i, nm_txq) { From owner-svn-src-head@freebsd.org Thu Oct 25 08:05:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB2BFFDA37; Thu, 25 Oct 2018 08:05:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AF5376073; Thu, 25 Oct 2018 08:05:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1234E7128; Thu, 25 Oct 2018 08:05:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9P85rvc047707; Thu, 25 Oct 2018 08:05:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P85r9s047706; Thu, 25 Oct 2018 08:05:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201810250805.w9P85r9s047706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Oct 2018 08:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339706 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/portsnap/portsnap X-SVN-Commit-Revision: 339706 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, 25 Oct 2018 08:05:54 -0000 Author: delphij Date: Thu Oct 25 08:05:53 2018 New Revision: 339706 URL: https://svnweb.freebsd.org/changeset/base/339706 Log: Now that the portsnap buildbox is generating the raw bits for INDEX-13, add it to the set of INDEX files built by portsnap. Switch to INDEX-13 for head/. Modified: head/usr.sbin/portsnap/portsnap/portsnap.conf Modified: head/usr.sbin/portsnap/portsnap/portsnap.conf ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.conf Thu Oct 25 06:24:42 2018 (r339705) +++ head/usr.sbin/portsnap/portsnap/portsnap.conf Thu Oct 25 08:05:53 2018 (r339706) @@ -32,4 +32,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3 # List of INDEX files to build and the DESCRIBE file to use for each #INDEX INDEX-10 DESCRIBE.10 #INDEX INDEX-11 DESCRIBE.11 -INDEX INDEX-12 DESCRIBE.12 +#INDEX INDEX-12 DESCRIBE.12 +INDEX INDEX-13 DESCRIBE.13 From owner-svn-src-head@freebsd.org Thu Oct 25 12:13:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A7BE1073746; Thu, 25 Oct 2018 12:13:14 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2467F4C1; Thu, 25 Oct 2018 12:13:14 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB4A11ABC; Thu, 25 Oct 2018 12:13:14 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PCDDvS075251; Thu, 25 Oct 2018 12:13:13 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PCDDxl075250; Thu, 25 Oct 2018 12:13:13 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201810251213.w9PCDDxl075250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 25 Oct 2018 12:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339707 - head/sbin/fdisk X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/sbin/fdisk X-SVN-Commit-Revision: 339707 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, 25 Oct 2018 12:13:14 -0000 Author: rgrimes Date: Thu Oct 25 12:13:13 2018 New Revision: 339707 URL: https://svnweb.freebsd.org/changeset/base/339707 Log: Allow fdisk(8) to deal with sectors larger than 2048 especially for 4Kn drives with PMBR's Approved by: bde (mentor) MFC: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Thu Oct 25 08:05:53 2018 (r339706) +++ head/sbin/fdisk/fdisk.c Thu Oct 25 12:13:13 2018 (r339707) @@ -67,7 +67,7 @@ static char lbuf[LBUF]; #define Decimal(str, ans, tmp, maxval) if (decimal(str, &tmp, ans, maxval)) ans = tmp -#define MAX_SEC_SIZE 2048 /* maximum section size that is supported */ +#define MAX_SEC_SIZE 65536 /* maximum sector size that is supported */ #define MIN_SEC_SIZE 512 /* the sector size to start sensing at */ static int secsize = 0; /* the sensed sector size */ From owner-svn-src-head@freebsd.org Thu Oct 25 13:37:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 518F610767C0; Thu, 25 Oct 2018 13:37:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03B9E82B44; Thu, 25 Oct 2018 13:37:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D905012813; Thu, 25 Oct 2018 13:37:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PDbw6M016245; Thu, 25 Oct 2018 13:37:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PDbwTR016242; Thu, 25 Oct 2018 13:37:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810251337.w9PDbwTR016242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 25 Oct 2018 13:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339709 - in head: . secure/lib/libcrypto secure/lib/libssl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: . secure/lib/libcrypto secure/lib/libssl X-SVN-Commit-Revision: 339709 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, 25 Oct 2018 13:37:59 -0000 Author: kib Date: Thu Oct 25 13:37:57 2018 New Revision: 339709 URL: https://svnweb.freebsd.org/changeset/base/339709 Log: Bump base OpenSSL libraries versions to avoid conflict with port's libraries. Reported by: many Reviewed by: gjb Sponsored by: The FreeBSD Foundation MFC after: 3 hours Modified: head/ObsoleteFiles.inc head/secure/lib/libcrypto/Makefile head/secure/lib/libssl/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Oct 25 12:27:16 2018 (r339708) +++ head/ObsoleteFiles.inc Thu Oct 25 13:37:57 2018 (r339709) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20181025: OpenSSL libraries version bump to avoid conflict with ports +OLD_LIBS+=lib/libcrypto.so.9 +OLD_LIBS+=usr/lib/libssl.so.9 +OLD_LIBS+=usr/lib32/libcrypto.so.9 +OLD_LIBS+=usr/lib32/libssl.so.9 # 20181021: mse(4) removal OLD_FILES+=usr/share/man/man4/mse.4.gz # 20181021: joy(4) removal Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Thu Oct 25 12:27:16 2018 (r339708) +++ head/secure/lib/libcrypto/Makefile Thu Oct 25 13:37:57 2018 (r339709) @@ -6,7 +6,7 @@ SUBDIR= engines .include LIB= crypto -SHLIB_MAJOR= 9 +SHLIB_MAJOR= 111 VERSION_MAP= ${.CURDIR}/Version.map NO_LINT= Modified: head/secure/lib/libssl/Makefile ============================================================================== --- head/secure/lib/libssl/Makefile Thu Oct 25 12:27:16 2018 (r339708) +++ head/secure/lib/libssl/Makefile Thu Oct 25 13:37:57 2018 (r339709) @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= ssl -SHLIB_MAJOR= 9 +SHLIB_MAJOR= 111 VERSION_MAP= ${.CURDIR}/Version.map NO_LINT= From owner-svn-src-head@freebsd.org Thu Oct 25 14:37:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D371078F0B; Thu, 25 Oct 2018 14:37:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2B1186135; Thu, 25 Oct 2018 14:37:27 +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 9985313264; Thu, 25 Oct 2018 14:37:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PEbRFS047605; Thu, 25 Oct 2018 14:37:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PEbRVe047601; Thu, 25 Oct 2018 14:37:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810251437.w9PEbRVe047601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Oct 2018 14:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339717 - 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: 339717 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, 25 Oct 2018 14:37:28 -0000 Author: np Date: Thu Oct 25 14:37:26 2018 New Revision: 339717 URL: https://svnweb.freebsd.org/changeset/base/339717 Log: cxgbe(4): Allow "pass" filters to distribute matching traffic using a subset of a VI's RSS indirection table. This makes it possible to make groups out of rx queues and steer different kinds of traffic to different groups. For example, an interface with 8 rx queues could have all non-TCP traffic delivered to queues 0-3 and all TCP traffic to queues 4-7. Note that it is already possible for filters to steer traffic to a particular queue or to distribute it using the full indirection table (much like normal rx does). Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Thu Oct 25 14:36:56 2018 (r339716) +++ head/sys/dev/cxgbe/t4_filter.c Thu Oct 25 14:37:26 2018 (r339717) @@ -864,8 +864,8 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (t->fs.val.iport >= sc->params.nports) return (EINVAL); - /* Can't specify an iq if not steering to it */ - if (!t->fs.dirsteer && t->fs.iq) + /* Can't specify an iqid/rss_info if not steering. */ + if (!t->fs.dirsteer && !t->fs.dirsteerhash && !t->fs.maskhash && t->fs.iq) return (EINVAL); /* Validate against the global filter mode and ingress config */ Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Thu Oct 25 14:36:56 2018 (r339716) +++ head/sys/dev/cxgbe/t4_ioctl.h Thu Oct 25 14:37:26 2018 (r339717) @@ -209,7 +209,7 @@ struct t4_filter_specification { uint32_t rpttid:1; /* report TID in RSS hash field */ uint32_t dirsteer:1; /* 0 => RSS, 1 => steer to iq */ uint32_t iq:10; /* ingress queue */ - uint32_t maskhash:1; /* dirsteer=0: store RSS hash in TCB */ + uint32_t maskhash:1; /* dirsteer=0: steer to an RSS sub-region */ uint32_t dirsteerhash:1;/* dirsteer=1: 0 => TCB contains RSS hash */ /* 1 => TCB contains IQ ID */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 25 14:36:56 2018 (r339716) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 25 14:37:26 2018 (r339717) @@ -4156,6 +4156,11 @@ set_params__post_init(struct adapter *sc) if (t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val) == 0) sc->params.port_caps32 = 1; + /* Let filter + maskhash steer to a part of the VI's RSS region. */ + val = 1 << (G_MASKSIZE(t4_read_reg(sc, A_TP_RSS_CONFIG_TNL)) - 1); + t4_set_reg_field(sc, A_TP_RSS_CONFIG_TNL, V_MASKFILTER(M_MASKFILTER), + V_MASKFILTER(val - 1)); + #ifdef TCP_OFFLOAD /* * Override the TOE timers with user provided tunables. This is not the From owner-svn-src-head@freebsd.org Thu Oct 25 15:41:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3ACA107B9E6; Thu, 25 Oct 2018 15:41:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5792989F73; Thu, 25 Oct 2018 15:41:00 +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 38DBD13C66; Thu, 25 Oct 2018 15:41:00 +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 w9PFf0tw079007; Thu, 25 Oct 2018 15:41:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PFf0Ix079006; Thu, 25 Oct 2018 15:41:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810251541.w9PFf0Ix079006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Oct 2018 15:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339728 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339728 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, 25 Oct 2018 15:41:00 -0000 Author: markj Date: Thu Oct 25 15:40:59 2018 New Revision: 339728 URL: https://svnweb.freebsd.org/changeset/base/339728 Log: Remove a redundant check. CID: 1042100 MFC after: 2 weeks Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Thu Oct 25 15:35:12 2018 (r339727) +++ head/sys/kern/subr_vmem.c Thu Oct 25 15:40:59 2018 (r339728) @@ -283,7 +283,7 @@ bt_fill(vmem_t *vm, int flags) VMEM_UNLOCK(vm); bt = uma_zalloc(vmem_bt_zone, flags); VMEM_LOCK(vm); - if (bt == NULL && (flags & M_NOWAIT) != 0) + if (bt == NULL) break; } LIST_INSERT_HEAD(&vm->vm_freetags, bt, bt_freelist); From owner-svn-src-head@freebsd.org Thu Oct 25 15:41:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0605D107BA1E; Thu, 25 Oct 2018 15:41:21 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE7058A10A; Thu, 25 Oct 2018 15:41:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 788B313D8C; Thu, 25 Oct 2018 15:41:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PFfKb7081280; Thu, 25 Oct 2018 15:41:20 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PFfKV7081279; Thu, 25 Oct 2018 15:41:20 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201810251541.w9PFfKV7081279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 25 Oct 2018 15:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339729 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 339729 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, 25 Oct 2018 15:41:21 -0000 Author: 0mp (ports committer) Date: Thu Oct 25 15:41:19 2018 New Revision: 339729 URL: https://svnweb.freebsd.org/changeset/base/339729 Log: efivar(3): Fix some typos and improve style - Fix some typos. - Remove redundant semicolons from the synopsis section. - Stylize variable names and types with Vt and Va respectively. - Use a list to present non-implemented functions. - Sort the order of the sections. - Add a history section. - Use Nm when "libefivar" is mentioned. PR: 232626 Reported by: Tiwei Bie Reviewed by: bcr, imp Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17686 Modified: head/lib/libefivar/efivar.3 Modified: head/lib/libefivar/efivar.3 ============================================================================== --- head/lib/libefivar/efivar.3 Thu Oct 25 15:40:59 2018 (r339728) +++ head/lib/libefivar/efivar.3 Thu Oct 25 15:41:19 2018 (r339729) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2016 +.Dd October 25, 2018 .Dt LIBEFIVAR 3 .Os .Sh NAME .Nm libefivar -.Nd EFI Non Volatile Variable Suppoert +.Nd EFI Non Volatile Variable Support .Sh SYNOPSIS .In efivar.h .Ft int @@ -55,15 +55,17 @@ .Ft int .Fn efi_set_variable "efi_guid_t guid" "const char *name" "void *data" "size_t data_size" "uint32_t attributes" .Ft int -.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid"; +.Fn efi_str_to_guid "const char *s" "efi_guid_t *guid" .Ft int -.Fn efi_variables_supported "void"; +.Fn efi_variables_supported "void" .Sh DESCRIPTION The .Nm library implements access to EFI Variables via the EFI Runtime -Serivces. -All char * strings are converted to 16-bit UTF strings before passing +Services. +All +.Vt "char *" +strings are converted to 16-bit UTF strings before passing them to EFI. .Pp .Fn efi_variables_supported @@ -73,28 +75,48 @@ Otherwise zero is returned. .Pp .Fn efi_del_variable deletes the EFI variable selected by -.Dv guid +.Va guid and -.Dv name . +.Va name . .Pp +The following functions have not been implemented yet: +.Bl -dash -offset indent -compact +.It +.Fn efi_append_variable +.It +.Fn efi_get_next_variable_name +.It .Fn efi_get_variable +.It .Fn efi_get_variable_attributes +.It .Fn efi_get_variable_size -.Fn efi_append_variable -.Fn efi_set_variable -.Fn efi_get_next_variable_name -.Fn efi_str_to_guid -.Fn efi_guid_to_str -.Fn efi_name_to_guid +.It .Fn efi_guid_to_name +.It +.Fn efi_guid_to_str +.It .Fn efi_guid_to_symbol -This function is not actually implemented. -.Sh BUGS -No facilities exist to process the strings as native UTF. -This is a limitation in the Linux libefivar library interface. +.It +.Fn efi_name_to_guid +.It +.Fn efi_set_variable +.It +.Fn efi_str_to_guid +.El .Sh SEE ALSO .Xr efidev 4 +.Sh HISTORY +The +.Nm +library first appeared in +.Fx 12.0 . .Sh AUTHORS .An -nosplit This software was originally written by .An Warner Losh . +.Sh BUGS +No facilities exist to process the strings as native UTF. +This is a limitation in the Linux +.Nm +library interface. From owner-svn-src-head@freebsd.org Thu Oct 25 15:41:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFBE2107BA61; Thu, 25 Oct 2018 15:41:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 642188A18E; Thu, 25 Oct 2018 15:41:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3FBC13D9B; Thu, 25 Oct 2018 15:41:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PFfQjl082108; Thu, 25 Oct 2018 15:41:26 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PFfQ9X082107; Thu, 25 Oct 2018 15:41:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810251541.w9PFfQ9X082107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 25 Oct 2018 15:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339730 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339730 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, 25 Oct 2018 15:41:28 -0000 Author: gjb Date: Thu Oct 25 15:41:26 2018 New Revision: 339730 URL: https://svnweb.freebsd.org/changeset/base/339730 Log: Bump __FreeBSD_version following the OpenSSL shared library version number bump. Submitted by: antoine MFC with: r339709 Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Oct 25 15:41:19 2018 (r339729) +++ head/sys/sys/param.h Thu Oct 25 15:41:26 2018 (r339730) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300000 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300001 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Oct 25 15:43:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 191DD107BD8D; Thu, 25 Oct 2018 15:43:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C33B28A604; Thu, 25 Oct 2018 15:43:21 +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 A560713E07; Thu, 25 Oct 2018 15:43:21 +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 w9PFhL5r083652; Thu, 25 Oct 2018 15:43:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PFhLq3083651; Thu, 25 Oct 2018 15:43:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810251543.w9PFhLq3083651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Oct 2018 15:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339731 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339731 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, 25 Oct 2018 15:43:22 -0000 Author: markj Date: Thu Oct 25 15:43:21 2018 New Revision: 339731 URL: https://svnweb.freebsd.org/changeset/base/339731 Log: Add FALLTHROUGH comments to appease Coverity. CID: 1017862-1017864, 1017866-1017868 MFC after: 2 weeks Modified: head/sys/kern/kern_environment.c head/sys/kern/vfs_mount.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Thu Oct 25 15:41:26 2018 (r339730) +++ head/sys/kern/kern_environment.c Thu Oct 25 15:43:21 2018 (r339731) @@ -839,10 +839,13 @@ getenv_quad(const char *name, quad_t *data) switch (vtp[0]) { case 't': case 'T': iv *= 1024; + /* FALLTHROUGH */ case 'g': case 'G': iv *= 1024; + /* FALLTHROUGH */ case 'm': case 'M': iv *= 1024; + /* FALLTHROUGH */ case 'k': case 'K': iv *= 1024; case '\0': Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Oct 25 15:41:26 2018 (r339730) +++ head/sys/kern/vfs_mount.c Thu Oct 25 15:43:21 2018 (r339731) @@ -1647,17 +1647,16 @@ vfs_getopt_size(struct vfsoptlist *opts, const char *n if (iv < 0) return (EINVAL); switch (vtp[0]) { - case 't': - case 'T': + case 't': case 'T': iv *= 1024; - case 'g': - case 'G': + /* FALLTHROUGH */ + case 'g': case 'G': iv *= 1024; - case 'm': - case 'M': + /* FALLTHROUGH */ + case 'm': case 'M': iv *= 1024; - case 'k': - case 'K': + /* FALLTHROUGH */ + case 'k': case 'K': iv *= 1024; case '\0': break; From owner-svn-src-head@freebsd.org Thu Oct 25 17:17:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6132A1086934; Thu, 25 Oct 2018 17:17:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3E698FEC9; Thu, 25 Oct 2018 17:17:11 +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 92A3514D83; Thu, 25 Oct 2018 17:17:11 +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 w9PHHBeA030709; Thu, 25 Oct 2018 17:17:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PHHBwh030708; Thu, 25 Oct 2018 17:17:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810251717.w9PHHBwh030708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 25 Oct 2018 17:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339736 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 339736 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, 25 Oct 2018 17:17:12 -0000 Author: imp Date: Thu Oct 25 17:17:11 2018 New Revision: 339736 URL: https://svnweb.freebsd.org/changeset/base/339736 Log: Update comment for AMI00[12]0 override. The AML is even stupider than always returning 0. It will only return non-zero for an OS that reports itself as "Windows 2015", at least on the Threadripper board's AML that I've examined. Those AMLs also suggest we may need this quirk for AMI0030 as well. There may be other cases where we need to override the _STA in a generic way, so we should consider writing code to do that. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu Oct 25 17:00:39 2018 (r339735) +++ head/sys/dev/acpica/acpi.c Thu Oct 25 17:17:11 2018 (r339736) @@ -2222,10 +2222,10 @@ acpi_DeviceIsPresent(device_t dev) status = acpi_GetInteger(h, "_STA", &s); /* - * Onboard serial ports on certain AMD motherboards have an invalid _STA - * method that always returns 0. Force them to always be treated as present. - * - * This may solely be a quirk of a preproduction BIOS. + * Certain Treadripper boards always returns 0 for FreeBSD because it + * only returns non-zero for the OS string "Windows 2015". Otherwise it + * will return zero. Force them to always be treated as present. + * Beata versions were worse: they always returned 0. */ if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) return (TRUE); From owner-svn-src-head@freebsd.org Thu Oct 25 17:36:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4222E10876AA; Thu, 25 Oct 2018 17:36:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D480E6A828; Thu, 25 Oct 2018 17:36:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2E33150E6; Thu, 25 Oct 2018 17:36:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PHaS5N041250; Thu, 25 Oct 2018 17:36:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PHaS7k041249; Thu, 25 Oct 2018 17:36:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810251736.w9PHaS7k041249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Oct 2018 17:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339737 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339737 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, 25 Oct 2018 17:36:29 -0000 Author: markj Date: Thu Oct 25 17:36:28 2018 New Revision: 339737 URL: https://svnweb.freebsd.org/changeset/base/339737 Log: Remove a dead store. CID: 1304878 MFC after: 1 week Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Thu Oct 25 17:17:11 2018 (r339736) +++ head/sys/kern/vfs_mountroot.c Thu Oct 25 17:36:28 2018 (r339737) @@ -579,7 +579,7 @@ parse_dir_md(char **conf) if (root_mount_mddev != -1) { mdio->md_unit = root_mount_mddev; - error = kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio); + (void)kern_ioctl(td, fd, MDIOCDETACH, (void *)mdio); /* Ignore errors. We don't care. */ root_mount_mddev = -1; } From owner-svn-src-head@freebsd.org Thu Oct 25 17:39:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E709710878A2; Thu, 25 Oct 2018 17:39:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB7B6AA3D; Thu, 25 Oct 2018 17:39:45 +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 6A7AB150EF; Thu, 25 Oct 2018 17:39:45 +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 w9PHdjMc041460; Thu, 25 Oct 2018 17:39:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PHdfc7041441; Thu, 25 Oct 2018 17:39:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810251739.w9PHdfc7041441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Oct 2018 17:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339738 - in head: gnu/lib lib/csu lib/csu/aarch64 lib/csu/amd64 lib/csu/common lib/csu/i386 lib/csu/powerpc64 lib/csu/tests lib/csu/tests/dynamic lib/csu/tests/static share/mk tools/bu... X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: gnu/lib lib/csu lib/csu/aarch64 lib/csu/amd64 lib/csu/common lib/csu/i386 lib/csu/powerpc64 lib/csu/tests lib/csu/tests/dynamic lib/csu/tests/static share/mk tools/build/options X-SVN-Commit-Revision: 339738 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, 25 Oct 2018 17:39:46 -0000 Author: andrew Date: Thu Oct 25 17:39:41 2018 New Revision: 339738 URL: https://svnweb.freebsd.org/changeset/base/339738 Log: Implement a BSD licensed crtbegin/crtend These are needed for .ctors/.dtors and .jcr handling. The former needs all the function pointers to be called in the correct order from the .init/.fini section. The latter just needs to call a gcj specific function if it exists with a pointer to the start of the .jcr section. This is currently disabled until __dso_handle support is added. Reviewed by: emaste MFC after: 1 month Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17587 Added: head/lib/csu/aarch64/crt.h (contents, props changed) head/lib/csu/amd64/crt.h (contents, props changed) head/lib/csu/common/crtbegin.c (contents, props changed) head/lib/csu/common/crtend.c (contents, props changed) head/lib/csu/i386/crt.h (contents, props changed) head/lib/csu/powerpc64/crt.h (contents, props changed) head/lib/csu/tests/ head/lib/csu/tests/Makefile (contents, props changed) head/lib/csu/tests/Makefile.inc (contents, props changed) head/lib/csu/tests/Makefile.tests (contents, props changed) head/lib/csu/tests/cxx_constructors.cc (contents, props changed) head/lib/csu/tests/dynamic/ head/lib/csu/tests/dynamic/Makefile (contents, props changed) head/lib/csu/tests/fini_test.c (contents, props changed) head/lib/csu/tests/init_test.c (contents, props changed) head/lib/csu/tests/static/ head/lib/csu/tests/static/Makefile (contents, props changed) head/tools/build/options/WITHOUT_BSD_CRTBEGIN (contents, props changed) head/tools/build/options/WITH_BSD_CRTBEGIN (contents, props changed) Modified: head/gnu/lib/Makefile head/lib/csu/Makefile head/lib/csu/Makefile.inc head/share/mk/src.opts.mk Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Thu Oct 25 17:36:28 2018 (r339737) +++ head/gnu/lib/Makefile Thu Oct 25 17:39:41 2018 (r339738) @@ -2,11 +2,15 @@ .include -SUBDIR= csu +SUBDIR= SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests + +.if ${MK_BSD_CRTBEGIN} == "no" +SUBDIR+= csu +.endif .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" Modified: head/lib/csu/Makefile ============================================================================== --- head/lib/csu/Makefile Thu Oct 25 17:36:28 2018 (r339737) +++ head/lib/csu/Makefile Thu Oct 25 17:39:41 2018 (r339738) @@ -6,4 +6,10 @@ SUBDIR+= ${MACHINE_ARCH} SUBDIR+= ${MACHINE_CPUARCH} .endif +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ + ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc64" +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests +.endif + .include Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Thu Oct 25 17:36:28 2018 (r339737) +++ head/lib/csu/Makefile.inc Thu Oct 25 17:39:41 2018 (r339738) @@ -6,4 +6,27 @@ SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/ NO_WMISSING_VARIABLE_DECLARATIONS= +.include + +.if ${MK_BSD_CRTBEGIN} != "no" && !defined(BUILDING_TESTS) + +OBJS+= crtbegin.o crtbeginS.o crtbeginT.o +OBJS+= crtend.o crtendS.o + +CFLAGS_CRTS= -DSHARED ${PICFLAG} + +crtbegin.o: crtbegin.c +crtbeginS.o: crtbegin.c +crtbeginT.o: crtbegin.c +crtend.o: crtend.c +crtendS.o: crtend.c + +crtbegin.o crtend.o crtbeginT.o: + ${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC} + +crtbeginS.o crtendS.o: + ${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} ${.ALLSRC} + +.endif + .include "../Makefile.inc" Added: head/lib/csu/aarch64/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/aarch64/crt.h Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +/* Empty so we can include this unconditionally */ Added: head/lib/csu/amd64/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/amd64/crt.h Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,32 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS +#define INIT_CALL_SEQ(func) "call " __STRING(func) + +#endif Added: head/lib/csu/common/crtbegin.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/common/crtbegin.c Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,99 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "crt.h" + +typedef void (*crt_func)(void); + +/* + * On some architectures and toolchains we may need to call the .dtors. + * These are called in the order they are in the ELF file. + */ +#ifdef HAVE_CTORS +static void __do_global_dtors_aux(void) __used; + +crt_func __CTOR_LIST__[] __section(".ctors") __hidden = { + (crt_func)-1 +}; +crt_func __DTOR_LIST__[] __section(".dtors") __hidden = { + (crt_func)-1 +}; + +static void +__do_global_dtors_aux(void) +{ + crt_func fn; + int n; + + for (n = 1;; n++) { + fn = __DTOR_LIST__[n]; + if (fn == (crt_func)0 || fn == (crt_func)-1) + break; + fn(); + } +} + +asm ( + ".pushsection .fini \n" + "\t" INIT_CALL_SEQ(__do_global_dtors_aux) "\n" + ".popsection \n" +); +#endif + +/* + * Handler for gcj. These provide a _Jv_RegisterClasses function and fill + * out the .jcr section. We just need to call this function with a pointer + * to the appropriate section. + */ +extern void _Jv_RegisterClasses(void *) __weak_symbol; +static void register_classes(void) __used; + +crt_func __JCR_LIST__[] __section(".jcr") __used __hidden = { }; + +#ifndef CTORS_CONSTRUCTORS +__attribute__((constructor)) +#endif +static void +register_classes(void) +{ + + if (_Jv_RegisterClasses != NULL && __JCR_LIST__[0] != 0) + _Jv_RegisterClasses(__JCR_LIST__); +} + +/* + * We can't use constructors when they use the .ctors section as they may be + * placed before __CTOR_LIST__. + */ +#ifdef CTORS_CONSTRUCTORS +asm ( + ".pushsection .init \n" + "\t" INIT_CALL_SEQ(register_classes) "\n" + ".popsection \n" +); +#endif Added: head/lib/csu/common/crtend.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/common/crtend.c Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,64 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "crt.h" + +#ifdef HAVE_CTORS +typedef void (*crt_func)(void); + +/* + * On some architectures and toolchains we may need to call the .ctors. + * These are called in the reverse order they are in the ELF file. + */ +static void __do_global_ctors_aux(void) __used; + +crt_func __CTOR_END__[] __section(".ctors") __used __hidden = { + (crt_func)0 +}; +crt_func __DTOR_END__[] __section(".dtors") __used __hidden = { + (crt_func)0 +}; + +static void +__do_global_ctors_aux(void) +{ + crt_func fn; + int n; + + for (n = 1;; n++) { + fn = __CTOR_END__[-n]; + if (fn == (crt_func)0 || fn == (crt_func)-1) + break; + fn(); + } +} + +asm ( + ".pushsection .init \n" + "\t" INIT_CALL_SEQ(__do_global_ctors_aux) "\n" + ".popsection \n" +); +#endif Added: head/lib/csu/i386/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/i386/crt.h Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,32 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS +#define INIT_CALL_SEQ(func) "call " __STRING(func) + +#endif Added: head/lib/csu/powerpc64/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/powerpc64/crt.h Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS +#define CTORS_CONSTRUCTORS +#define INIT_CALL_SEQ(func) "bl " __STRING(func) "; nop" + +#endif Added: head/lib/csu/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/Makefile Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +TESTS_SUBDIRS= dynamic +TESTS_SUBDIRS+= static + +.include Added: head/lib/csu/tests/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/Makefile.inc Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +TESTSDIR:= ${TESTSBASE}/${RELDIR:C/csu\/tests/csu/} Added: head/lib/csu/tests/Makefile.tests ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/Makefile.tests Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +ATF_TESTS_C+= init_test +ATF_TESTS_C+= fini_test +ATF_TESTS_CXX+= cxx_constructors + +.if exists(${.CURDIR:H:H}/${MACHINE_ARCH}) +CFLAGS+= -I${.CURDIR:H:H}/${MACHINE_ARCH} +.else +CFLAGS+= -I${.CURDIR:H:H}/${MACHINE_CPUARCH} +.endif Added: head/lib/csu/tests/cxx_constructors.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/cxx_constructors.cc Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,92 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +static volatile int constructor_run; +static bool run_destructor_test = false; +struct Foo { + Foo() { + constructor_run = 1; + } + ~Foo() { + if (run_destructor_test) + _exit(1); + } +}; +extern Foo foo; +Foo foo; + +ATF_TEST_CASE_WITHOUT_HEAD(cxx_constructor); +ATF_TEST_CASE_BODY(cxx_constructor) +{ + + ATF_REQUIRE(constructor_run == 1); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx_destructor); +ATF_TEST_CASE_BODY(cxx_destructor) +{ + pid_t pid, wpid; + int status; + + pid = fork(); + switch(pid) { + case -1: + break; + case 0: + run_destructor_test = true; + exit(0); + default: + while ((wpid = waitpid(pid, &status, 0)) == -1 && + errno == EINTR) + ; + ATF_REQUIRE(WEXITSTATUS(status) == 1); + break; + } +} + +ATF_INIT_TEST_CASES(tcs) +{ + + ATF_ADD_TEST_CASE(tcs, cxx_constructor); + ATF_ADD_TEST_CASE(tcs, cxx_destructor); +} Added: head/lib/csu/tests/dynamic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/dynamic/Makefile Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR:H} +WARNS?= 6 + +.include "../Makefile.tests" +.include Added: head/lib/csu/tests/fini_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/fini_test.c Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,129 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +typedef void (*func_ptr)(void); + +static bool run_dtors_test = false; +static bool run_fini_array_test = false; + +static void +dtors_handler(void) +{ + + if (run_dtors_test) + _exit(1); +} +__section(".dtors") __used static func_ptr dtors_func = + &dtors_handler; + +ATF_TC_WITHOUT_HEAD(dtors_test); +ATF_TC_BODY(dtors_test, tc) +{ + pid_t pid, wpid; + int status; + + pid = fork(); + switch(pid) { + case -1: + break; + case 0: + run_dtors_test = true; + exit(0); + default: + while ((wpid = waitpid(pid, &status, 0)) == -1 && + errno == EINTR) + ; +#ifdef HAVE_CTORS + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 1, + ".dtors failed to run"); +#else + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + ".dtors incorrectly ran"); +#endif + break; + } +} + +static void +fini_array_handler(void) +{ + + if (run_fini_array_test) + _exit(1); +} +__section(".fini_array") __used static func_ptr fini_array_func = + &fini_array_handler; + +ATF_TC_WITHOUT_HEAD(fini_array_test); +ATF_TC_BODY(fini_array_test, tc) +{ + pid_t pid, wpid; + int status; + + pid = fork(); + switch(pid) { + case -1: + break; + case 0: + run_fini_array_test = true; + exit(0); + default: + while ((wpid = waitpid(pid, &status, 0)) == -1 && + errno == EINTR) + ; + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 1, + ".fini_array failed to run"); + break; + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, dtors_test); + ATF_TP_ADD_TC(tp, fini_array_test); + + return (atf_no_error()); +} Added: head/lib/csu/tests/init_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/init_test.c Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,137 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +typedef void (*func_ptr)(void); + +static volatile int jcr_run; +static const func_ptr *jcr_ptr; +static volatile int ctors_run; +static volatile int preinit_array_run; +static volatile int preinit_array_state = -1; +static volatile int init_array_run; +static volatile int init_array_state = -1; + +void _Jv_RegisterClasses(const func_ptr *); + +__section(".jcr") __used static func_ptr jcr_func = (func_ptr)1; + +void +_Jv_RegisterClasses(const func_ptr *jcr __unused) +{ + + jcr_run = 1; + jcr_ptr = jcr; +} + +ATF_TC_WITHOUT_HEAD(jcr_test); +ATF_TC_BODY(jcr_test, tc) +{ + + ATF_REQUIRE_MSG(jcr_run == 1, ".jcr not run"); + ATF_REQUIRE_MSG(jcr_ptr == &jcr_func, + "Incorrect pointer passed to _Jv_RegisterClasses"); +} + +static void +ctors_handler(void) +{ + + ctors_run = 1; +} +__section(".ctors") __used static func_ptr ctors_func = + &ctors_handler; + +ATF_TC_WITHOUT_HEAD(ctors_test); +ATF_TC_BODY(ctors_test, tc) +{ + +#ifdef HAVE_CTORS + ATF_REQUIRE_MSG(ctors_run == 1, ".ctors not run"); +#else + ATF_REQUIRE_MSG(ctors_run == 0, ".ctors run"); +#endif +} + +static void +preinit_array_handler(void) +{ + + preinit_array_run = 1; + preinit_array_state = init_array_run; +} +__section(".preinit_array") __used static func_ptr preinit_array_func = + &preinit_array_handler; + +ATF_TC_WITHOUT_HEAD(preinit_array_test); +ATF_TC_BODY(preinit_array_test, tc) +{ + + ATF_REQUIRE_MSG(preinit_array_run == 1, ".preinit_array not run"); + ATF_REQUIRE_MSG(preinit_array_state == 0, + ".preinit_array was not run before .init_array"); +} + +static void +init_array_handler(void) +{ + + init_array_run = 1; + init_array_state = preinit_array_run; +} +__section(".init_array") __used static func_ptr init_array_func = + &init_array_handler; + +ATF_TC_WITHOUT_HEAD(init_array_test); +ATF_TC_BODY(init_array_test, tc) +{ + + ATF_REQUIRE_MSG(init_array_run == 1, ".init_array not run"); + ATF_REQUIRE_MSG(init_array_state == 1, + ".init_array was not run after .preinit_array"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, jcr_test); + ATF_TP_ADD_TC(tp, ctors_test); + ATF_TP_ADD_TC(tp, preinit_array_test); + ATF_TP_ADD_TC(tp, init_array_test); + + return (atf_no_error()); +} Added: head/lib/csu/tests/static/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/static/Makefile Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR:H} +NO_SHARED= +WARNS?= 6 + +.include "../Makefile.tests" +.include Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Oct 25 17:36:28 2018 (r339737) +++ head/share/mk/src.opts.mk Thu Oct 25 17:39:41 2018 (r339738) @@ -385,6 +385,13 @@ BROKEN_OPTIONS+=HYPERV BROKEN_OPTIONS+=NVME .endif +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64" +__DEFAULT_NO_OPTIONS+=BSD_CRTBEGIN +.else +BROKEN_OPTIONS+=BSD_CRTBEGIN +.endif + .include # Added: head/tools/build/options/WITHOUT_BSD_CRTBEGIN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BSD_CRTBEGIN Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Disable the BSD licensed +.Pa crtbegin.o +and +.Pa crtend.o . Added: head/tools/build/options/WITH_BSD_CRTBEGIN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BSD_CRTBEGIN Thu Oct 25 17:39:41 2018 (r339738) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Enable the BSD licensed +.Pa crtbegin.o +and +.Pa crtend.o . From owner-svn-src-head@freebsd.org Thu Oct 25 17:42:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B958C1087B61; Thu, 25 Oct 2018 17:42:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C23D6AE7D; Thu, 25 Oct 2018 17:42:44 +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 4BFD415287; Thu, 25 Oct 2018 17:42:44 +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 w9PHgi0W046144; Thu, 25 Oct 2018 17:42:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PHgiDi046143; Thu, 25 Oct 2018 17:42:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810251742.w9PHgiDi046143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Oct 2018 17:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339739 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 339739 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, 25 Oct 2018 17:42:44 -0000 Author: andrew Date: Thu Oct 25 17:42:43 2018 New Revision: 339739 URL: https://svnweb.freebsd.org/changeset/base/339739 Log: Regen src.conf.5 to add WITH_BSD_CRTBEGIN Sponsored by: DARPA, AFRL Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Oct 25 17:39:41 2018 (r339738) +++ head/share/man/man5/src.conf.5 Thu Oct 25 17:42:43 2018 (r339739) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 21, 2018 +.Dd October 25, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -219,6 +219,11 @@ and related programs. .It Va WITHOUT_BSD_CPIO Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . +.It Va WITH_BSD_CRTBEGIN +Enable the BSD licensed +.Pa crtbegin.o +and +.Pa crtend.o . .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP From owner-svn-src-head@freebsd.org Thu Oct 25 18:06:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D5DC10882CE; Thu, 25 Oct 2018 18:06:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4716BA5E; Thu, 25 Oct 2018 18:06:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AC2015601; Thu, 25 Oct 2018 18:06:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PI6NdP056768; Thu, 25 Oct 2018 18:06:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PI6NE3056767; Thu, 25 Oct 2018 18:06:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810251806.w9PI6NE3056767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 25 Oct 2018 18:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339740 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 339740 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, 25 Oct 2018 18:06:24 -0000 Author: ae Date: Thu Oct 25 18:06:23 2018 New Revision: 339740 URL: https://svnweb.freebsd.org/changeset/base/339740 Log: Use correct format specificator to print setdscp action. PR: 232642 MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Oct 25 17:42:43 2018 (r339739) +++ head/sbin/ipfw/ipfw2.c Thu Oct 25 18:06:23 2018 (r339740) @@ -1946,7 +1946,7 @@ print_action_instruction(struct buf_pr *bp, const stru if (s != NULL) bprintf(bp, "setdscp %s", s); else - bprintf(bp, "setdscp %s", cmd->arg1 & 0x3F); + bprintf(bp, "setdscp %u", cmd->arg1 & 0x3F); break; case O_REASS: bprintf(bp, "reass"); From owner-svn-src-head@freebsd.org Thu Oct 25 18:20:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9081088C03; Thu, 25 Oct 2018 18:20:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3B56C294; Thu, 25 Oct 2018 18:20:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id CB1CF16583; Thu, 25 Oct 2018 18:20:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r339709 - in head: . secure/lib/libcrypto secure/lib/libssl To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810251337.w9PDbwTR016242@repo.freebsd.org> From: Jung-uk Kim Openpgp: preference=signencrypt Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdSvQR0 fA59RfTTECMwTrSEfYGUnxIDBraxJ7Ecs/0hGQ7sljIj8WBvlRDU5fU1xfF35aw56T8POQRq F4E6RVJW3YGuTpSwgtGZOTfygcLRhAiq3dFC3JNLaTVTpM8PjOinJyt9AU6RoITGOKwDABEB AAHNHkp1bmctdWsgS2ltIDxqa2ltQEZyZWVCU0Qub3JnPsLAfQQTAQoAJwUCUkHO1QIbAwUJ E0/POwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRB8n5Ym/NvxRqyzB/wL7QtsIpeGfGIA ZPMtgXMucM3NWzomyQMln2j2efUkDKthzh9jBxgF53TjOr7imwIt0PT2k1bqctPrq5IRqnu9 mGroqaCLE3LG2/E3jEaao4k9PO6efwlioyivUo5NrqIQOQ4k3EAXw7d2y0Dk1VpTgdMrnUAB hj7lGlLqS4ydcrf24DdbCRGdEQwqd9DBeBgbWynxAJMgbZBhYVEyIHuQKkJ8qY0ibIPXXuF0 KYDeH0qUHtWV2K3srNyPtymUkBQD84Pl1GWRYx05XdUHDmnX0JV3lg0BfYJZgZv0ehPQrMfY Fd9abTkf9FHQYz1JtsC8wUuRgqElRd6+YAGf8Tt9zsBNBFJBztUBCADLtSrP44El2VoJmH14 OFrlOgxzZnbn+Y/Gf1k12mJBiR+A+pBeRLD50p7AiTrjHRxO3cHcl9Dh0uf1VSbXgp8Or0ye iP/86fZPd4k5HXNmDTLL0HecPE08SCqGZ0W8vllQrokB1QxxRUB+fFMPJyMCjDAZ7P9fFTOS dTw1bJSTtOD8Sx8MpZUa9ti06bXFlVYDlaqSdgk181SSx+ZbSKkQR8CIMARlHwiLsa3Z9q9O EJr20HPyxe0AlTvwvFndH61hg7ds63eRvglwRnNON28VXO/lvKXq7Br/CiiyhFdKfINIx2Z5 htYq22tgGTW7mBURbIKoECFBTX9Lv6BXz6w9ABEBAAHCwGUEGAEKAA8FAlJBztUCGwwFCRNP zzsACgkQfJ+WJvzb8UZcJQf+IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: Date: Thu, 25 Oct 2018 14:20:15 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <201810251337.w9PDbwTR016242@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="djOJnPwy149di6Pypz1rLCS5ljF2J8F4J" 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, 25 Oct 2018 18:20:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --djOJnPwy149di6Pypz1rLCS5ljF2J8F4J Content-Type: multipart/mixed; boundary="wQ9puUW10SJEMnwusuzvutrpvH30970k5"; protected-headers="v1" From: Jung-uk Kim To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r339709 - in head: . secure/lib/libcrypto secure/lib/libssl References: <201810251337.w9PDbwTR016242@repo.freebsd.org> In-Reply-To: <201810251337.w9PDbwTR016242@repo.freebsd.org> --wQ9puUW10SJEMnwusuzvutrpvH30970k5 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18. 10. 25., Konstantin Belousov wrote: > Author: kib > Date: Thu Oct 25 13:37:57 2018 > New Revision: 339709 > URL: https://svnweb.freebsd.org/changeset/base/339709 >=20 > Log: > Bump base OpenSSL libraries versions to avoid conflict with port's li= braries. > =20 > Reported by: many > Reviewed by: gjb > Sponsored by: The FreeBSD Foundation > MFC after: 3 hours >=20 > Modified: > head/ObsoleteFiles.inc > head/secure/lib/libcrypto/Makefile > head/secure/lib/libssl/Makefile >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Thu Oct 25 12:27:16 2018 (r339708) > +++ head/ObsoleteFiles.inc Thu Oct 25 13:37:57 2018 (r339709) > @@ -38,6 +38,11 @@ > # xargs -n1 | sort | uniq -d; > # done > =20 > +# 20181025: OpenSSL libraries version bump to avoid conflict with port= s > +OLD_LIBS+=3Dlib/libcrypto.so.9 > +OLD_LIBS+=3Dusr/lib/libssl.so.9 > +OLD_LIBS+=3Dusr/lib32/libcrypto.so.9 > +OLD_LIBS+=3Dusr/lib32/libssl.so.9 > # 20181021: mse(4) removal > OLD_FILES+=3Dusr/share/man/man4/mse.4.gz > # 20181021: joy(4) removal >=20 > Modified: head/secure/lib/libcrypto/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/secure/lib/libcrypto/Makefile Thu Oct 25 12:27:16 2018 (r33970= 8) > +++ head/secure/lib/libcrypto/Makefile Thu Oct 25 13:37:57 2018 (r33970= 9) > @@ -6,7 +6,7 @@ SUBDIR=3D engines > .include > =20 > LIB=3D crypto > -SHLIB_MAJOR=3D 9 > +SHLIB_MAJOR=3D 111 > VERSION_MAP=3D ${.CURDIR}/Version.map > =20 > NO_LINT=3D >=20 > Modified: head/secure/lib/libssl/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/secure/lib/libssl/Makefile Thu Oct 25 12:27:16 2018 (r339708) > +++ head/secure/lib/libssl/Makefile Thu Oct 25 13:37:57 2018 (r339709) > @@ -1,7 +1,7 @@ > # $FreeBSD$ > =20 > LIB=3D ssl > -SHLIB_MAJOR=3D 9 > +SHLIB_MAJOR=3D 111 > VERSION_MAP=3D ${.CURDIR}/Version.map > =20 > NO_LINT=3D You forgot to update SHLIB_VERSION_NUMBER. https://svnweb.freebsd.org/base/head/crypto/openssl/include/openssl/opens= slv.h?revision=3D339270&view=3Dmarkup#l95 Jung-uk Kim --wQ9puUW10SJEMnwusuzvutrpvH30970k5-- --djOJnPwy149di6Pypz1rLCS5ljF2J8F4J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlvSCWoACgkQfJ+WJvzb 8Ubc4AgAhah434mRPVfprl7VPz7IGHZei4lHBBiM3G+u93aXZVmn1rn8ls3s9D1r vNFKot9pJKOvA8M1m65YZnWg5jVNcFDQE9sy3mC0HKBqQ4n74Q3nV8Zl2UTmDo+u L1pldpSojHdOjE9lE/PXuoAJwm1xSKmQXQz17MCx6CyXGsebvfOf8izx+2bIfmsZ takEoZPuMUTM6e6IJtmj89q3DgHKB9tFlS6dCn5IEgdai9lrwAxnmGejvXOiTs82 broRrguo6g31VUAF0AeSg+fkuITia8Hi7IDqPdiZlLmrQVB0svV9R319R3IGYS3W FX/9Bl7tk5bnHGY7K+VS09zKrW5TgA== =JAxe -----END PGP SIGNATURE----- --djOJnPwy149di6Pypz1rLCS5ljF2J8F4J-- From owner-svn-src-head@freebsd.org Thu Oct 25 18:37:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACBC61089419; Thu, 25 Oct 2018 18:37:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5A26CC08; Thu, 25 Oct 2018 18:37:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w9PIbj6J082543 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Oct 2018 21:37:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9PIbj6J082543 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9PIbjiX082542; Thu, 25 Oct 2018 21:37:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 25 Oct 2018 21:37:45 +0300 From: Konstantin Belousov To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339709 - in head: . secure/lib/libcrypto secure/lib/libssl Message-ID: <20181025183745.GS5335@kib.kiev.ua> References: <201810251337.w9PDbwTR016242@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home 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, 25 Oct 2018 18:37:56 -0000 On Thu, Oct 25, 2018 at 02:20:15PM -0400, Jung-uk Kim wrote: > On 18. 10. 25., Konstantin Belousov wrote: > > Author: kib > > Date: Thu Oct 25 13:37:57 2018 > > New Revision: 339709 > > URL: https://svnweb.freebsd.org/changeset/base/339709 > > > > Log: > > Bump base OpenSSL libraries versions to avoid conflict with port's libraries. > > > > Reported by: many > > Reviewed by: gjb > > Sponsored by: The FreeBSD Foundation > > MFC after: 3 hours > > > > Modified: > > head/ObsoleteFiles.inc > > head/secure/lib/libcrypto/Makefile > > head/secure/lib/libssl/Makefile > > > > Modified: head/ObsoleteFiles.inc > > ============================================================================== > > --- head/ObsoleteFiles.inc Thu Oct 25 12:27:16 2018 (r339708) > > +++ head/ObsoleteFiles.inc Thu Oct 25 13:37:57 2018 (r339709) > > @@ -38,6 +38,11 @@ > > # xargs -n1 | sort | uniq -d; > > # done > > > > +# 20181025: OpenSSL libraries version bump to avoid conflict with ports > > +OLD_LIBS+=lib/libcrypto.so.9 > > +OLD_LIBS+=usr/lib/libssl.so.9 > > +OLD_LIBS+=usr/lib32/libcrypto.so.9 > > +OLD_LIBS+=usr/lib32/libssl.so.9 > > # 20181021: mse(4) removal > > OLD_FILES+=usr/share/man/man4/mse.4.gz > > # 20181021: joy(4) removal > > > > Modified: head/secure/lib/libcrypto/Makefile > > ============================================================================== > > --- head/secure/lib/libcrypto/Makefile Thu Oct 25 12:27:16 2018 (r339708) > > +++ head/secure/lib/libcrypto/Makefile Thu Oct 25 13:37:57 2018 (r339709) > > @@ -6,7 +6,7 @@ SUBDIR= engines > > .include > > > > LIB= crypto > > -SHLIB_MAJOR= 9 > > +SHLIB_MAJOR= 111 > > VERSION_MAP= ${.CURDIR}/Version.map > > > > NO_LINT= > > > > Modified: head/secure/lib/libssl/Makefile > > ============================================================================== > > --- head/secure/lib/libssl/Makefile Thu Oct 25 12:27:16 2018 (r339708) > > +++ head/secure/lib/libssl/Makefile Thu Oct 25 13:37:57 2018 (r339709) > > @@ -1,7 +1,7 @@ > > # $FreeBSD$ > > > > LIB= ssl > > -SHLIB_MAJOR= 9 > > +SHLIB_MAJOR= 111 > > VERSION_MAP= ${.CURDIR}/Version.map > > > > NO_LINT= > > You forgot to update SHLIB_VERSION_NUMBER. > > https://svnweb.freebsd.org/base/head/crypto/openssl/include/openssl/opensslv.h?revision=339270&view=markup#l95 > Would the following be enough ? diff --git a/crypto/openssl/include/openssl/opensslv.h b/crypto/openssl/include/openssl/opensslv.h index d23d73f90ce..363359d9ef4 100644 --- a/crypto/openssl/include/openssl/opensslv.h +++ b/crypto/openssl/include/openssl/opensslv.h @@ -92,7 +92,7 @@ extern "C" { * should only keep the versions that are binary compatible with the current. */ # define SHLIB_VERSION_HISTORY "" -# define SHLIB_VERSION_NUMBER "9" +# define SHLIB_VERSION_NUMBER "111" #ifdef __cplusplus From owner-svn-src-head@freebsd.org Thu Oct 25 18:46:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF281089A3A; Thu, 25 Oct 2018 18:46:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 511966D1E7; Thu, 25 Oct 2018 18:46:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3206B15CA8; Thu, 25 Oct 2018 18:46:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PIkk1Z077059; Thu, 25 Oct 2018 18:46:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PIkksp077058; Thu, 25 Oct 2018 18:46:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810251846.w9PIkksp077058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 25 Oct 2018 18:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339741 - head/crypto/openssl/include/openssl X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/crypto/openssl/include/openssl X-SVN-Commit-Revision: 339741 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, 25 Oct 2018 18:46:46 -0000 Author: gjb Date: Thu Oct 25 18:46:45 2018 New Revision: 339741 URL: https://svnweb.freebsd.org/changeset/base/339741 Log: Update SHLIB_VERSION_NUMBER following the OpenSSL shared library number bump. Reported by: jkim Discussed with: kib MFC after: immediate Sponsored by: The FreeBSD Foundation Modified: head/crypto/openssl/include/openssl/opensslv.h Modified: head/crypto/openssl/include/openssl/opensslv.h ============================================================================== --- head/crypto/openssl/include/openssl/opensslv.h Thu Oct 25 18:06:23 2018 (r339740) +++ head/crypto/openssl/include/openssl/opensslv.h Thu Oct 25 18:46:45 2018 (r339741) @@ -92,7 +92,7 @@ extern "C" { * should only keep the versions that are binary compatible with the current. */ # define SHLIB_VERSION_HISTORY "" -# define SHLIB_VERSION_NUMBER "9" +# define SHLIB_VERSION_NUMBER "111" #ifdef __cplusplus From owner-svn-src-head@freebsd.org Thu Oct 25 18:47:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F591089B53; Thu, 25 Oct 2018 18:47:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC136D36D; Thu, 25 Oct 2018 18:47:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D382E1688F; Thu, 25 Oct 2018 18:47:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r339709 - in head: . secure/lib/libcrypto secure/lib/libssl To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810251337.w9PDbwTR016242@repo.freebsd.org> <20181025183745.GS5335@kib.kiev.ua> From: Jung-uk Kim Openpgp: preference=signencrypt Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdSvQR0 fA59RfTTECMwTrSEfYGUnxIDBraxJ7Ecs/0hGQ7sljIj8WBvlRDU5fU1xfF35aw56T8POQRq F4E6RVJW3YGuTpSwgtGZOTfygcLRhAiq3dFC3JNLaTVTpM8PjOinJyt9AU6RoITGOKwDABEB AAHNHkp1bmctdWsgS2ltIDxqa2ltQEZyZWVCU0Qub3JnPsLAfQQTAQoAJwUCUkHO1QIbAwUJ E0/POwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRB8n5Ym/NvxRqyzB/wL7QtsIpeGfGIA ZPMtgXMucM3NWzomyQMln2j2efUkDKthzh9jBxgF53TjOr7imwIt0PT2k1bqctPrq5IRqnu9 mGroqaCLE3LG2/E3jEaao4k9PO6efwlioyivUo5NrqIQOQ4k3EAXw7d2y0Dk1VpTgdMrnUAB hj7lGlLqS4ydcrf24DdbCRGdEQwqd9DBeBgbWynxAJMgbZBhYVEyIHuQKkJ8qY0ibIPXXuF0 KYDeH0qUHtWV2K3srNyPtymUkBQD84Pl1GWRYx05XdUHDmnX0JV3lg0BfYJZgZv0ehPQrMfY Fd9abTkf9FHQYz1JtsC8wUuRgqElRd6+YAGf8Tt9zsBNBFJBztUBCADLtSrP44El2VoJmH14 OFrlOgxzZnbn+Y/Gf1k12mJBiR+A+pBeRLD50p7AiTrjHRxO3cHcl9Dh0uf1VSbXgp8Or0ye iP/86fZPd4k5HXNmDTLL0HecPE08SCqGZ0W8vllQrokB1QxxRUB+fFMPJyMCjDAZ7P9fFTOS dTw1bJSTtOD8Sx8MpZUa9ti06bXFlVYDlaqSdgk181SSx+ZbSKkQR8CIMARlHwiLsa3Z9q9O EJr20HPyxe0AlTvwvFndH61hg7ds63eRvglwRnNON28VXO/lvKXq7Br/CiiyhFdKfINIx2Z5 htYq22tgGTW7mBURbIKoECFBTX9Lv6BXz6w9ABEBAAHCwGUEGAEKAA8FAlJBztUCGwwFCRNP zzsACgkQfJ+WJvzb8UZcJQf+IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: <704d0027-e5fc-8190-6fa4-629e8cd2683a@FreeBSD.org> Date: Thu, 25 Oct 2018 14:47:49 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181025183745.GS5335@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="houE0lTUYi8FgDsmlyv6HTcqPIP2nxP9L" 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, 25 Oct 2018 18:47:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --houE0lTUYi8FgDsmlyv6HTcqPIP2nxP9L Content-Type: multipart/mixed; boundary="FHt3xEL9h4tBxd3szEsgm0urIV8O9LXEu"; protected-headers="v1" From: Jung-uk Kim To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <704d0027-e5fc-8190-6fa4-629e8cd2683a@FreeBSD.org> Subject: Re: svn commit: r339709 - in head: . secure/lib/libcrypto secure/lib/libssl References: <201810251337.w9PDbwTR016242@repo.freebsd.org> <20181025183745.GS5335@kib.kiev.ua> In-Reply-To: <20181025183745.GS5335@kib.kiev.ua> --FHt3xEL9h4tBxd3szEsgm0urIV8O9LXEu Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 18. 10. 25., Konstantin Belousov wrote: > On Thu, Oct 25, 2018 at 02:20:15PM -0400, Jung-uk Kim wrote: >> On 18. 10. 25., Konstantin Belousov wrote: >>> Author: kib >>> Date: Thu Oct 25 13:37:57 2018 >>> New Revision: 339709 >>> URL: https://svnweb.freebsd.org/changeset/base/339709 >>> >>> Log: >>> Bump base OpenSSL libraries versions to avoid conflict with port's = libraries. >>> =20 >>> Reported by: many >>> Reviewed by: gjb >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 3 hours >>> >>> Modified: >>> head/ObsoleteFiles.inc >>> head/secure/lib/libcrypto/Makefile >>> head/secure/lib/libssl/Makefile >>> >>> Modified: head/ObsoleteFiles.inc >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Thu Oct 25 12:27:16 2018 (r339708) >>> +++ head/ObsoleteFiles.inc Thu Oct 25 13:37:57 2018 (r339709) >>> @@ -38,6 +38,11 @@ >>> # xargs -n1 | sort | uniq -d; >>> # done >>> =20 >>> +# 20181025: OpenSSL libraries version bump to avoid conflict with po= rts >>> +OLD_LIBS+=3Dlib/libcrypto.so.9 >>> +OLD_LIBS+=3Dusr/lib/libssl.so.9 >>> +OLD_LIBS+=3Dusr/lib32/libcrypto.so.9 >>> +OLD_LIBS+=3Dusr/lib32/libssl.so.9 >>> # 20181021: mse(4) removal >>> OLD_FILES+=3Dusr/share/man/man4/mse.4.gz >>> # 20181021: joy(4) removal >>> >>> Modified: head/secure/lib/libcrypto/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/secure/lib/libcrypto/Makefile Thu Oct 25 12:27:16 2018 (r339= 708) >>> +++ head/secure/lib/libcrypto/Makefile Thu Oct 25 13:37:57 2018 (r339= 709) >>> @@ -6,7 +6,7 @@ SUBDIR=3D engines >>> .include >>> =20 >>> LIB=3D crypto >>> -SHLIB_MAJOR=3D 9 >>> +SHLIB_MAJOR=3D 111 >>> VERSION_MAP=3D ${.CURDIR}/Version.map >>> =20 >>> NO_LINT=3D >>> >>> Modified: head/secure/lib/libssl/Makefile >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/secure/lib/libssl/Makefile Thu Oct 25 12:27:16 2018 (r339708= ) >>> +++ head/secure/lib/libssl/Makefile Thu Oct 25 13:37:57 2018 (r339709= ) >>> @@ -1,7 +1,7 @@ >>> # $FreeBSD$ >>> =20 >>> LIB=3D ssl >>> -SHLIB_MAJOR=3D 9 >>> +SHLIB_MAJOR=3D 111 >>> VERSION_MAP=3D ${.CURDIR}/Version.map >>> =20 >>> NO_LINT=3D >> >> You forgot to update SHLIB_VERSION_NUMBER. >> >> https://svnweb.freebsd.org/base/head/crypto/openssl/include/openssl/op= ensslv.h?revision=3D339270&view=3Dmarkup#l95 >> >=20 > Would the following be enough ? >=20 > diff --git a/crypto/openssl/include/openssl/opensslv.h b/crypto/openssl= /include/openssl/opensslv.h > index d23d73f90ce..363359d9ef4 100644 > --- a/crypto/openssl/include/openssl/opensslv.h > +++ b/crypto/openssl/include/openssl/opensslv.h > @@ -92,7 +92,7 @@ extern "C" { > * should only keep the versions that are binary compatible with the c= urrent. > */ > # define SHLIB_VERSION_HISTORY "" > -# define SHLIB_VERSION_NUMBER "9" > +# define SHLIB_VERSION_NUMBER "111" > =20 > =20 > #ifdef __cplusplus Yes. Jung-uk Kim --FHt3xEL9h4tBxd3szEsgm0urIV8O9LXEu-- --houE0lTUYi8FgDsmlyv6HTcqPIP2nxP9L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlvSD9UACgkQfJ+WJvzb 8UZjZAf/RlwewwsGvLxcLQbm/HtqaSph/rN6Qmlw5g26dpX5i25EpXLYT9HZ0tP3 2XDUarOpBL6yAf4+HJxys2aqftlPpQYmsEo9zXG7p3lN1eaaT/9RFqIPT1afA2mv S/yaVTwmxESMAbIsMIqXL0cKrdF5AapfUEy/g+04xmIY950Y2qIvkkU+9BSEsNkV Jc3NE5m1wJDMKF5o8C/N29pei48eIBKPlTNh5hBZDKNPeGyfIjFVBSfp7AiCEnJy fdGZLS4Y00H8yNem5t8n2hNs4PYSrKt1k6krXhrij7pIAb/IxbSFRAhmBlchY+i/ wiS0/rKP9yHMMJWGx0ohW/aMeOb4QQ== =WrCj -----END PGP SIGNATURE----- --houE0lTUYi8FgDsmlyv6HTcqPIP2nxP9L-- From owner-svn-src-head@freebsd.org Thu Oct 25 21:08:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E028610C71FB; Thu, 25 Oct 2018 21:08:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94907733F7; Thu, 25 Oct 2018 21:08:16 +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 756E2174EC; Thu, 25 Oct 2018 21:08:16 +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 w9PL8G6u050177; Thu, 25 Oct 2018 21:08:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PL8GJ5050176; Thu, 25 Oct 2018 21:08:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810252108.w9PL8GJ5050176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Oct 2018 21:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339744 - head/lib/csu X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu X-SVN-Commit-Revision: 339744 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, 25 Oct 2018 21:08:17 -0000 Author: andrew Date: Thu Oct 25 21:08:15 2018 New Revision: 339744 URL: https://svnweb.freebsd.org/changeset/base/339744 Log: Add a missing include for src.opts.mk. Without it MK_TESTS isn't defined. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/Makefile Modified: head/lib/csu/Makefile ============================================================================== --- head/lib/csu/Makefile Thu Oct 25 20:44:14 2018 (r339743) +++ head/lib/csu/Makefile Thu Oct 25 21:08:15 2018 (r339744) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .if exists(${.CURDIR}/${MACHINE_ARCH}) SUBDIR+= ${MACHINE_ARCH} .else From owner-svn-src-head@freebsd.org Thu Oct 25 21:41:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDD310C938E; Thu, 25 Oct 2018 21:41:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65EC374560; Thu, 25 Oct 2018 21:41:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4821517A7B; Thu, 25 Oct 2018 21:41:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PLfx6M070070; Thu, 25 Oct 2018 21:41:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PLfxAR070069; Thu, 25 Oct 2018 21:41:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810252141.w9PLfxAR070069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Oct 2018 21:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339745 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339745 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, 25 Oct 2018 21:41:59 -0000 Author: markj Date: Thu Oct 25 21:41:58 2018 New Revision: 339745 URL: https://svnweb.freebsd.org/changeset/base/339745 Log: Clarify the description of the -u option. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/rtsold.8 Modified: head/usr.sbin/rtsold/rtsold.8 ============================================================================== --- head/usr.sbin/rtsold/rtsold.8 Thu Oct 25 21:08:15 2018 (r339744) +++ head/usr.sbin/rtsold/rtsold.8 Thu Oct 25 21:41:58 2018 (r339745) @@ -241,16 +241,16 @@ The .Xr resolvconf 8 script is used by default. .It Fl u -Specifies whether adding the source address of Router Advertisement -messages to the interface name in an argument of the RDNSS and DNSSL -script. +Specifies whether to add the source address of Router Advertisement +messages to the interface name in the parameters of the RDNSS and DNSSL +scripts. .Pp If .Fl u -is specified, the interface name in the script argument will be +is specified, the interface name in the script parameters will be .Ql ifname:slaac:[RA-source-address] . .Pp -If not, it will be +Otherwise it will be .Ql ifname:slaac . .El .Sh FILES From owner-svn-src-head@freebsd.org Thu Oct 25 21:44:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 997D910C988E; Thu, 25 Oct 2018 21:44:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49098748B7; Thu, 25 Oct 2018 21:44:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27AAA17B98; Thu, 25 Oct 2018 21:44:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PLiJEt070247; Thu, 25 Oct 2018 21:44:19 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PLiHUY070238; Thu, 25 Oct 2018 21:44:17 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201810252144.w9PLiHUY070238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 25 Oct 2018 21:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339746 - in head: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils lib/l... X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils lib/libarchive lib/libarchive/... X-SVN-Commit-Revision: 339746 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, 25 Oct 2018 21:44:20 -0000 Author: mm Date: Thu Oct 25 21:44:17 2018 New Revision: 339746 URL: https://svnweb.freebsd.org/changeset/base/339746 Log: MFV r339640,339641,339644: Sync libarchive with vendor Relevant vendor changes: PR #1013: Add missing h_base offset when performing absolute seeks in xar decompression PR #1061: Add support for extraction of RAR v5 archives PR #1066: Fix out of bounds read on empty string filename for gnutar, pax and v7tar PR #1067: Fix temporary file path buffer overflow in tests IS #1068: Correctly process and verify integer arguments passed to bsdcpio and bsdtar PR #1070: Don't default XAR entry atime/mtime to the current time MFC after: 1 month Added: head/contrib/libarchive/libarchive/archive_blake2.h - copied unchanged from r339640, vendor/libarchive/dist/libarchive/archive_blake2.h head/contrib/libarchive/libarchive/archive_blake2_impl.h - copied unchanged from r339640, vendor/libarchive/dist/libarchive/archive_blake2_impl.h head/contrib/libarchive/libarchive/archive_blake2s_ref.c - copied unchanged from r339640, vendor/libarchive/dist/libarchive/archive_blake2s_ref.c head/contrib/libarchive/libarchive/archive_blake2sp_ref.c - copied unchanged from r339640, vendor/libarchive/dist/libarchive/archive_blake2sp_ref.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c - copied, changed from r339640, vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_arm.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_blake2.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_compressed.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiple_files.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_solid.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_stored.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu - copied unchanged from r339640, vendor/libarchive/dist/libarchive/test/test_read_format_rar5_win32.rar.uu Modified: head/contrib/libarchive/COPYING head/contrib/libarchive/NEWS head/contrib/libarchive/README.md head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_read_support_format_all.c head/contrib/libarchive/libarchive/archive_read_support_format_by_code.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c head/contrib/libarchive/libarchive/test/test_read_format_xar.c head/contrib/libarchive/tar/bsdtar.c head/contrib/libarchive/test_utils/test_main.c head/lib/libarchive/Makefile head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/COPYING ============================================================================== --- head/contrib/libarchive/COPYING Thu Oct 25 21:41:58 2018 (r339745) +++ head/contrib/libarchive/COPYING Thu Oct 25 21:44:17 2018 (r339746) @@ -23,6 +23,13 @@ the actual statements in the files are controlling. * The following source files are in the public domain: libarchive/archive_getdate.c +* The following source files are triple-licensed with the ability to choose + from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: + libarchive/archive_blake2.h + libarchive/archive_blake2_impl.h + libarchive/archive_blake2s_ref.c + libarchive/archive_blake2sp_ref.c + * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have widely varying licensing terms. Please check individual files before @@ -34,7 +41,7 @@ do use the license below. The varying licensing of th seems to be an unavoidable mess. -Copyright (c) 2003-2009 +Copyright (c) 2003-2018 All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Thu Oct 25 21:41:58 2018 (r339745) +++ head/contrib/libarchive/NEWS Thu Oct 25 21:44:17 2018 (r339746) @@ -1,3 +1,5 @@ +Oct 06, 2018: RAR 5.0 reader + Sep 03, 2018: libarchive 3.3.3 released Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files Modified: head/contrib/libarchive/README.md ============================================================================== --- head/contrib/libarchive/README.md Thu Oct 25 21:41:58 2018 (r339745) +++ head/contrib/libarchive/README.md Thu Oct 25 21:44:17 2018 (r339746) @@ -86,7 +86,7 @@ Currently, the library automatically detects and reads * 7-Zip archives * Microsoft CAB format * LHA and LZH archives - * RAR archives (with some limitations due to RAR's proprietary status) + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) * XAR archives The library also detects and handles any of the following before evaluating the archive: Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Thu Oct 25 21:41:58 2018 (r339745) +++ head/contrib/libarchive/cpio/cpio.c Thu Oct 25 21:44:17 2018 (r339746) @@ -134,8 +134,9 @@ main(int argc, char *argv[]) struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; const char *errmsg; + char *tptr; int uid, gid; - int opt; + int opt, t; cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); @@ -204,9 +205,15 @@ main(int argc, char *argv[]) cpio->add_filter = opt; break; case 'C': /* NetBSD/OpenBSD */ - cpio->bytes_per_block = atoi(cpio->argument); - if (cpio->bytes_per_block <= 0) - lafe_errc(1, 0, "Invalid blocksize %s", cpio->argument); + errno = 0; + tptr = NULL; + t = (int)strtol(cpio->argument, &tptr, 10); + if (errno || t <= 0 || *(cpio->argument) == '\0' || + tptr == NULL || *tptr != '\0') { + lafe_errc(1, 0, "Invalid blocksize: %s", + cpio->argument); + } + cpio->bytes_per_block = t; break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Thu Oct 25 21:41:58 2018 (r339745) +++ head/contrib/libarchive/libarchive/archive.h Thu Oct 25 21:44:17 2018 (r339746) @@ -338,6 +338,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 +#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 @@ -449,6 +450,7 @@ __LA_DECL int archive_read_support_format_iso9660(stru __LA_DECL int archive_read_support_format_lha(struct archive *); __LA_DECL int archive_read_support_format_mtree(struct archive *); __LA_DECL int archive_read_support_format_rar(struct archive *); +__LA_DECL int archive_read_support_format_rar5(struct archive *); __LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_warc(struct archive *); Copied: head/contrib/libarchive/libarchive/archive_blake2.h (from r339640, vendor/libarchive/dist/libarchive/archive_blake2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_blake2.h Thu Oct 25 21:44:17 2018 (r339746, copy of r339640, vendor/libarchive/dist/libarchive/archive_blake2.h) @@ -0,0 +1,194 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_H +#define BLAKE2_H + +#include +#include + +#if defined(_MSC_VER) +#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) +#else +#define BLAKE2_PACKED(x) x __attribute__((packed)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + enum blake2s_constant + { + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 + }; + + enum blake2b_constant + { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 + }; + + typedef struct blake2s_state__ + { + uint32_t h[8]; + uint32_t t[2]; + uint32_t f[2]; + uint8_t buf[BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2s_state; + + typedef struct blake2b_state__ + { + uint64_t h[8]; + uint64_t t[2]; + uint64_t f[2]; + uint8_t buf[BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2b_state; + + typedef struct blake2sp_state__ + { + blake2s_state S[8][1]; + blake2s_state R[1]; + uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2sp_state; + + typedef struct blake2bp_state__ + { + blake2b_state S[4][1]; + blake2b_state R[1]; + uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2bp_state; + + BLAKE2_PACKED(struct blake2s_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint16_t xof_length; /* 14 */ + uint8_t node_depth; /* 15 */ + uint8_t inner_length; /* 16 */ + /* uint8_t reserved[0]; */ + uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ + uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ + }); + + typedef struct blake2s_param__ blake2s_param; + + BLAKE2_PACKED(struct blake2b_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint32_t xof_length; /* 16 */ + uint8_t node_depth; /* 17 */ + uint8_t inner_length; /* 18 */ + uint8_t reserved[14]; /* 32 */ + uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ + uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ + }); + + typedef struct blake2b_param__ blake2b_param; + + typedef struct blake2xs_state__ + { + blake2s_state S[1]; + blake2s_param P[1]; + } blake2xs_state; + + typedef struct blake2xb_state__ + { + blake2b_state S[1]; + blake2b_param P[1]; + } blake2xb_state; + + /* Padded structs result in a compile-time error */ + enum { + BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + }; + + /* Streaming API */ + int blake2s_init( blake2s_state *S, size_t outlen ); + int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); + int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); + int blake2s_final( blake2s_state *S, void *out, size_t outlen ); + + int blake2b_init( blake2b_state *S, size_t outlen ); + int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); + int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); + int blake2b_final( blake2b_state *S, void *out, size_t outlen ); + + int blake2sp_init( blake2sp_state *S, size_t outlen ); + int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); + int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); + + int blake2bp_init( blake2bp_state *S, size_t outlen ); + int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); + int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); + + /* Variable output length API */ + int blake2xs_init( blake2xs_state *S, const size_t outlen ); + int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); + int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); + + int blake2xb_init( blake2xb_state *S, const size_t outlen ); + int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); + int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); + + /* Simple API */ + int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + /* This is simply an alias for blake2b */ + int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + +#if defined(__cplusplus) +} +#endif + +#endif Copied: head/contrib/libarchive/libarchive/archive_blake2_impl.h (from r339640, vendor/libarchive/dist/libarchive/archive_blake2_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_blake2_impl.h Thu Oct 25 21:44:17 2018 (r339746, copy of r339640, vendor/libarchive/dist/libarchive/archive_blake2_impl.h) @@ -0,0 +1,160 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_IMPL_H +#define BLAKE2_IMPL_H + +#include +#include + +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) + #if defined(_MSC_VER) + #define BLAKE2_INLINE __inline + #elif defined(__GNUC__) + #define BLAKE2_INLINE __inline__ + #else + #define BLAKE2_INLINE + #endif +#else + #define BLAKE2_INLINE inline +#endif + +static BLAKE2_INLINE uint32_t load32( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint32_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8) | + (( uint32_t )( p[2] ) << 16) | + (( uint32_t )( p[3] ) << 24) ; +#endif +} + +static BLAKE2_INLINE uint64_t load64( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint64_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) | + (( uint64_t )( p[6] ) << 48) | + (( uint64_t )( p[7] ) << 56) ; +#endif +} + +static BLAKE2_INLINE uint16_t load16( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint16_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); +#endif +} + +static BLAKE2_INLINE void store16( void *dst, uint16_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + *p++ = ( uint8_t )w; w >>= 8; + *p++ = ( uint8_t )w; +#endif +} + +static BLAKE2_INLINE void store32( void *dst, uint32_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); +#endif +} + +static BLAKE2_INLINE void store64( void *dst, uint64_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); + p[6] = (uint8_t)(w >> 48); + p[7] = (uint8_t)(w >> 56); +#endif +} + +static BLAKE2_INLINE uint64_t load48( const void *src ) +{ + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) ; +} + +static BLAKE2_INLINE void store48( void *dst, uint64_t w ) +{ + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); +} + +static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 32 - c ) ); +} + +static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 64 - c ) ); +} + +/* prevents compiler optimizing out memset() */ +static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) +{ + static void *(*const volatile memset_v)(void *, int, size_t) = &memset; + memset_v(v, 0, n); +} + +#endif Copied: head/contrib/libarchive/libarchive/archive_blake2s_ref.c (from r339640, vendor/libarchive/dist/libarchive/archive_blake2s_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_blake2s_ref.c Thu Oct 25 21:44:17 2018 (r339746, copy of r339640, vendor/libarchive/dist/libarchive/archive_blake2s_ref.c) @@ -0,0 +1,367 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +static const uint32_t blake2s_IV[8] = +{ + 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, + 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +}; + +static const uint8_t blake2s_sigma[10][16] = +{ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , +}; + +static void blake2s_set_lastnode( blake2s_state *S ) +{ + S->f[1] = (uint32_t)-1; +} + +/* Some helper functions, not necessarily useful */ +static int blake2s_is_lastblock( const blake2s_state *S ) +{ + return S->f[0] != 0; +} + +static void blake2s_set_lastblock( blake2s_state *S ) +{ + if( S->last_node ) blake2s_set_lastnode( S ); + + S->f[0] = (uint32_t)-1; +} + +static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) +{ + S->t[0] += inc; + S->t[1] += ( S->t[0] < inc ); +} + +static void blake2s_init0( blake2s_state *S ) +{ + size_t i; + memset( S, 0, sizeof( blake2s_state ) ); + + for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; +} + +/* init2 xors IV with input parameter block */ +int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) +{ + const unsigned char *p = ( const unsigned char * )( P ); + size_t i; + + blake2s_init0( S ); + + /* IV XOR ParamBlock */ + for( i = 0; i < 8; ++i ) + S->h[i] ^= load32( &p[i * 4] ); + + S->outlen = P->digest_length; + return 0; +} + + +/* Sequential blake2s initialization */ +int blake2s_init( blake2s_state *S, size_t outlen ) +{ + blake2s_param P[1]; + + /* Move interval verification here? */ + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = 0; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + +int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) +{ + blake2s_param P[1]; + + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + + if( blake2s_init_param( S, P ) < 0 ) return -1; + + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2*i+0]]; \ + d = rotr32(d ^ a, 16); \ + c = c + d; \ + b = rotr32(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2*i+1]]; \ + d = rotr32(d ^ a, 8); \ + c = c + d; \ + b = rotr32(b ^ c, 7); \ + } while(0) + +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + +static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) +{ + uint32_t m[16]; + uint32_t v[16]; + size_t i; + + for( i = 0; i < 16; ++i ) { + m[i] = load32( in + i * sizeof( m[i] ) ); + } + + for( i = 0; i < 8; ++i ) { + v[i] = S->h[i]; + } + + v[ 8] = blake2s_IV[0]; + v[ 9] = blake2s_IV[1]; + v[10] = blake2s_IV[2]; + v[11] = blake2s_IV[3]; + v[12] = S->t[0] ^ blake2s_IV[4]; + v[13] = S->t[1] ^ blake2s_IV[5]; + v[14] = S->f[0] ^ blake2s_IV[6]; + v[15] = S->f[1] ^ blake2s_IV[7]; + + ROUND( 0 ); + ROUND( 1 ); + ROUND( 2 ); + ROUND( 3 ); + ROUND( 4 ); + ROUND( 5 ); + ROUND( 6 ); + ROUND( 7 ); + ROUND( 8 ); + ROUND( 9 ); + + for( i = 0; i < 8; ++i ) { + S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; + } +} + +#undef G +#undef ROUND + +int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + if( inlen > 0 ) + { + size_t left = S->buflen; + size_t fill = BLAKE2S_BLOCKBYTES - left; + if( inlen > fill ) + { + S->buflen = 0; + memcpy( S->buf + left, in, fill ); /* Fill buffer */ + blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); + blake2s_compress( S, S->buf ); /* Compress */ + in += fill; inlen -= fill; + while(inlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); + blake2s_compress( S, in ); + in += BLAKE2S_BLOCKBYTES; + inlen -= BLAKE2S_BLOCKBYTES; + } + } + memcpy( S->buf + S->buflen, in, inlen ); + S->buflen += inlen; + } + return 0; +} + +int blake2s_final( blake2s_state *S, void *out, size_t outlen ) +{ + uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; + size_t i; + + if( out == NULL || outlen < S->outlen ) + return -1; + + if( blake2s_is_lastblock( S ) ) + return -1; + + blake2s_increment_counter( S, ( uint32_t )S->buflen ); + blake2s_set_lastblock( S ); + memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ + blake2s_compress( S, S->buf ); + + for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ + store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); + + memcpy( out, buffer, outlen ); + secure_zero_memory(buffer, sizeof(buffer)); + return 0; +} + +int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +{ + blake2s_state S[1]; + + /* Verify parameters */ + if ( NULL == in && inlen > 0 ) return -1; + + if ( NULL == out ) return -1; + + if ( NULL == key && keylen > 0) return -1; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( keylen > BLAKE2S_KEYBYTES ) return -1; + + if( keylen > 0 ) + { + if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; + } + else + { + if( blake2s_init( S, outlen ) < 0 ) return -1; + } + + blake2s_update( S, ( const uint8_t * )in, inlen ); + blake2s_final( S, out, outlen ); + return 0; +} + +#if defined(SUPERCOP) +int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +{ + return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); +} +#endif + +#if defined(BLAKE2S_SELFTEST) +#include +#include "blake2-kat.h" +int main( void ) +{ + uint8_t key[BLAKE2S_KEYBYTES]; + uint8_t buf[BLAKE2_KAT_LENGTH]; + size_t i, step; + + for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) + key[i] = ( uint8_t )i; + + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + buf[i] = ( uint8_t )i; + + /* Test simple API */ + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); + + if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) + { + goto fail; + } + } + + /* Test streaming API */ + for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { + for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s_state S; + uint8_t * p = buf; + size_t mlen = i; + int err = 0; + + if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { + goto fail; + } + + while (mlen >= step) { + if ( (err = blake2s_update(&S, p, step)) < 0 ) { + goto fail; + } + mlen -= step; + p += step; + } + if ( (err = blake2s_update(&S, p, mlen)) < 0) { + goto fail; + } + if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { + goto fail; + } + + if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { + goto fail; + } + } + } + + puts( "ok" ); + return 0; +fail: + puts("error"); + return -1; +} +#endif Copied: head/contrib/libarchive/libarchive/archive_blake2sp_ref.c (from r339640, vendor/libarchive/dist/libarchive/archive_blake2sp_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_blake2sp_ref.c Thu Oct 25 21:44:17 2018 (r339746, copy of r339640, vendor/libarchive/dist/libarchive/archive_blake2sp_ref.c) @@ -0,0 +1,359 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#if defined(_OPENMP) +#include +#endif + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +#define PARALLELISM_DEGREE 8 + +/* + blake2sp_init_param defaults to setting the expecting output length + from the digest_length parameter block field. + + In some cases, however, we do not want this, as the output length + of these instances is given by inner_length instead. +*/ +static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) +{ + int err = blake2s_init_param(S, P); + S->outlen = P->inner_length; + return err; +} + +static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint32_t offset ) +{ + blake2s_param P[1]; + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = PARALLELISM_DEGREE; + P->depth = 2; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, offset ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = BLAKE2S_OUTBYTES; + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2sp_init_leaf_param( S, P ); +} + +static int blake2sp_init_root( blake2s_state *S, size_t outlen, size_t keylen ) +{ + blake2s_param P[1]; + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = PARALLELISM_DEGREE; + P->depth = 2; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 1; + P->inner_length = BLAKE2S_OUTBYTES; + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + + +int blake2sp_init( blake2sp_state *S, size_t outlen ) +{ + size_t i; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + memset( S->buf, 0, sizeof( S->buf ) ); + S->buflen = 0; + S->outlen = outlen; + + if( blake2sp_init_root( S->R, outlen, 0 ) < 0 ) + return -1; + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; + + S->R->last_node = 1; + S->S[PARALLELISM_DEGREE - 1]->last_node = 1; + return 0; +} + +int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ) +{ + size_t i; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + memset( S->buf, 0, sizeof( S->buf ) ); + S->buflen = 0; + S->outlen = outlen; + + if( blake2sp_init_root( S->R, outlen, keylen ) < 0 ) + return -1; + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; + + S->R->last_node = 1; + S->S[PARALLELISM_DEGREE - 1]->last_node = 1; + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + blake2s_update( S->S[i], block, BLAKE2S_BLOCKBYTES ); + + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + + +int blake2sp_update( blake2sp_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + size_t left = S->buflen; + size_t fill = sizeof( S->buf ) - left; + size_t i; + + if( left && inlen >= fill ) + { + memcpy( S->buf + left, in, fill ); + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); + + in += fill; + inlen -= fill; + left = 0; + } + +#if defined(_OPENMP) + #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) +#else + for( i = 0; i < PARALLELISM_DEGREE; ++i ) +#endif + { +#if defined(_OPENMP) + size_t i = omp_get_thread_num(); +#endif + size_t inlen__ = inlen; + const unsigned char *in__ = ( const unsigned char * )in; + in__ += i * BLAKE2S_BLOCKBYTES; + + while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) + { + blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES ); + in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; + inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; + } + } + + in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Oct 25 21:45:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22A0010C9945; Thu, 25 Oct 2018 21:45:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C39C274A55; Thu, 25 Oct 2018 21:45:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D9AB17B99; Thu, 25 Oct 2018 21:45:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PLjOsI070343; Thu, 25 Oct 2018 21:45:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PLjOHx070342; Thu, 25 Oct 2018 21:45:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810252145.w9PLjOHx070342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Oct 2018 21:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339747 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339747 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, 25 Oct 2018 21:45:25 -0000 Author: markj Date: Thu Oct 25 21:45:24 2018 New Revision: 339747 URL: https://svnweb.freebsd.org/changeset/base/339747 Log: Minor style fixes around script execution. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/rtsol.c Modified: head/usr.sbin/rtsold/rtsol.c ============================================================================== --- head/usr.sbin/rtsold/rtsol.c Thu Oct 25 21:44:17 2018 (r339746) +++ head/usr.sbin/rtsold/rtsol.c Thu Oct 25 21:45:24 2018 (r339747) @@ -98,22 +98,20 @@ static char *make_rsid(const char *, const char *, str #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid -#define CALL_SCRIPT(name, sm_head) \ - do { \ - const char *const sarg[] = { _ARGS_##name, NULL }; \ - call_script(sizeof(sarg), sarg, sm_head); \ - } while(0) +#define CALL_SCRIPT(name, sm_head) do { \ + const char *const sarg[] = { _ARGS_##name, NULL }; \ + call_script(sizeof(sarg), sarg, sm_head); \ +} while (0) -#define ELM_MALLOC(p,error_action) \ - do { \ - p = malloc(sizeof(*p)); \ - if (p == NULL) { \ - warnmsg(LOG_ERR, __func__, "malloc failed: %s", \ - strerror(errno)); \ - error_action; \ - } \ - memset(p, 0, sizeof(*p)); \ - } while(0) +#define ELM_MALLOC(p, error_action) do { \ + p = malloc(sizeof(*p)); \ + if (p == NULL) { \ + warnmsg(LOG_ERR, __func__, "malloc failed: %s", \ + strerror(errno)); \ + error_action; \ + } \ + memset(p, 0, sizeof(*p)); \ +} while (0) int sockopen(void) @@ -697,13 +695,12 @@ make_rsid(const char *ifname, const char *origin, stru } int -ra_opt_rdnss_dispatch(struct ifinfo *ifi, - struct rainfo *rai, +ra_opt_rdnss_dispatch(struct ifinfo *ifi, struct rainfo *rai, struct script_msg_head_t *sm_rdnss_head, struct script_msg_head_t *sm_dnssl_head) { - const char *r; struct script_msg *smp1; + const char *r; int error; error = 0; @@ -715,10 +712,7 @@ ra_opt_rdnss_dispatch(struct ifinfo *ifi, } TAILQ_CONCAT(sm_rdnss_head, sm_dnssl_head, sm_next); - if (rai != NULL && uflag) - r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, rai); - else - r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, NULL); + r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, uflag ? rai : NULL); if (r == NULL) { warnmsg(LOG_ERR, __func__, "make_rsid() failed. " "Script was not invoked."); From owner-svn-src-head@freebsd.org Thu Oct 25 22:16:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D5710CAA87; Thu, 25 Oct 2018 22:16:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D65275A83; Thu, 25 Oct 2018 22:16:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CD9E180A9; Thu, 25 Oct 2018 22:16:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PMGcQE086774; Thu, 25 Oct 2018 22:16:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PMGYNw086754; Thu, 25 Oct 2018 22:16:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810252216.w9PMGYNw086754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 25 Oct 2018 22:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339748 - in head: lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/linux sys/kern sys/sys sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/linux sys/kern sys/sys sys/ufs/ffs X-SVN-Commit-Revision: 339748 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, 25 Oct 2018 22:16:40 -0000 Author: kib Date: Thu Oct 25 22:16:34 2018 New Revision: 339748 URL: https://svnweb.freebsd.org/changeset/base/339748 Log: Implement O_BENEATH and AT_BENEATH. Flags prevent open(2) and *at(2) vfs syscalls name lookup from escaping the starting directory. Supposedly the interface is similar to the same proposed Linux flags. Reviewed by: jilles (code, previous version of manpages), 0mp (manpages) Discussed with: allanjude, emaste, jonathan Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17547 Modified: head/lib/libc/sys/access.2 head/lib/libc/sys/chflags.2 head/lib/libc/sys/chmod.2 head/lib/libc/sys/chown.2 head/lib/libc/sys/link.2 head/lib/libc/sys/open.2 head/lib/libc/sys/stat.2 head/lib/libc/sys/unlink.2 head/lib/libc/sys/utimensat.2 head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/compat/cloudabi/cloudabi_file.c head/sys/compat/linux/linux_file.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/sys/fcntl.h head/sys/sys/namei.h head/sys/sys/syscallsubr.h head/sys/ufs/ffs/ffs_alloc.c Modified: head/lib/libc/sys/access.2 ============================================================================== --- head/lib/libc/sys/access.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/access.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd October 20, 2018 .Dt ACCESS 2 .Os .Sh NAME @@ -120,6 +120,8 @@ list, defined in The checks for accessibility are performed using the effective user and group IDs instead of the real user and group ID as required in a call to .Fn access . +.It Dv AT_BENEATH +Only operate on files and directories below the starting directory. .El .Pp Even if a process's real or effective user has appropriate privileges @@ -195,6 +197,15 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr chmod 2 , Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/chflags.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 22, 2013 +.Dd October 20, 2018 .Dt CHFLAGS 2 .Os .Sh NAME @@ -94,6 +94,9 @@ defined in If .Fa path names a symbolic link, then the flags of the symbolic link are changed. +.It Dv AT_BENEATH +Only allow to change flags for a file which is beneath of +the starting directory. .El .Pp If @@ -302,6 +305,15 @@ error occurred while reading from or writing to the fi The underlying file system does not support file flags, or does not support all of the flags set in .Fa flags . +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr chflags 1 , Modified: head/lib/libc/sys/chmod.2 ============================================================================== --- head/lib/libc/sys/chmod.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/chmod.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 20, 2018 .Dt CHMOD 2 .Os .Sh NAME @@ -101,6 +101,9 @@ in If .Fa path names a symbolic link, then the mode of the symbolic link is changed. +.It Dv AT_BENEATH +Only allow to change permissions of a file which is beneath of +the starting directory. .El .Pp If @@ -285,6 +288,15 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr chmod 1 , Modified: head/lib/libc/sys/chown.2 ============================================================================== --- head/lib/libc/sys/chown.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/chown.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd Octover 20, 2018 .Dt CHOWN 2 .Os .Sh NAME @@ -118,6 +118,9 @@ list, defined in If .Fa path names a symbolic link, ownership of the symbolic link is changed. +.It Dv AT_BENEATH +Only allow to change ownership of a file which is beneath of +the starting directory. .El .Pp If @@ -227,6 +230,15 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr chgrp 1 , Modified: head/lib/libc/sys/link.2 ============================================================================== --- head/lib/libc/sys/link.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/link.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 20, 2018 .Dt LINK 2 .Os .Sh NAME @@ -115,6 +115,8 @@ If .Fa name1 names a symbolic link, a new link for the target of the symbolic link is created. +.It Dv AT_BENEATH +Only allow to link to a file which is beneath of the starting directory. .El .Pp If @@ -257,6 +259,17 @@ or respectively, is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa name1 +is not strictly relative to the starting directory. +For example, +.Fa name1 +is absolute or includes a ".." component that escapes the starting directory. +.Dv AT_BENEATH +flag was specified. .El .Sh SEE ALSO .Xr chflags 2 , Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/open.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 20, 2018 .Dt OPEN 2 .Os .Sh NAME @@ -142,6 +142,7 @@ O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file +O_BENEATH require path to be strictly relative to starting directory .Ed .Pp Opening a file with @@ -269,6 +270,23 @@ means is implementation specific. The run-time linker (rtld) uses this flag to ensure shared objects have been verified before operating on them. .Pp +.Dv O_BENEATH +returns +.Er ENOTCAPABLE +if the specified path, after resolving all symlinks and ".." references +in it, does not reside in the directory hierarchy of children beneath +the starting directory, or is an absolute path. +Starting directory is the process current directory if relative +.Fa path +is used for +.Fn open , +and the directory referenced by the +.Fa fd +argument when specifying relative +.Fa path +for +.Fn openat . +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor. @@ -487,9 +505,13 @@ is specified and the process is in capability mode. was called and the process is in capability mode. .It Bq Er ENOTCAPABLE .Fa path -is an absolute path or contained a ".." component leading to a +is an absolute path, +or contained a ".." component leading to a directory outside of the directory hierarchy specified by -.Fa fd . +.Fa fd , +and the process is in capability mode or the +.Dv O_BENEATH +flag was provided. .El .Sh SEE ALSO .Xr chmod 2 , Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/stat.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 20, 2018 .Dt STAT 2 .Os .Sh NAME @@ -100,6 +100,13 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. +.It Dv AT_BENEATH +Only stat files and directories below the starting directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -397,6 +404,15 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr access 2 , Modified: head/lib/libc/sys/unlink.2 ============================================================================== --- head/lib/libc/sys/unlink.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/unlink.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd October 20, 2018 .Dt UNLINK 2 .Os .Sh NAME @@ -89,6 +89,9 @@ Remove the directory entry specified by and .Fa path as a directory, not a normal file. +.It Dv AT_BENEATH +Only unlink files and directories which are beneath of the starting +directory. .El .Pp If @@ -200,6 +203,15 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr chflags 2 , Modified: head/lib/libc/sys/utimensat.2 ============================================================================== --- head/lib/libc/sys/utimensat.2 Thu Oct 25 21:45:24 2018 (r339747) +++ head/lib/libc/sys/utimensat.2 Thu Oct 25 22:16:34 2018 (r339748) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 7, 2017 +.Dd October 20, 2018 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -146,6 +146,9 @@ names a symbolic link, the symbolic link's times are c By default, .Fn utimensat changes the times of the file referenced by the symbolic link. +.It Dv AT_BENEATH +Only allow to change the times of a file which is beneath of +the starting directory. .El .Sh RETURN VALUES .Rv -std @@ -267,6 +270,15 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was specified but +.Fa path +is not strictly relative to the starting directory. +For example, +.Fa path +is absolute or includes a ".." component that escapes the starting directory. .El .Sh SEE ALSO .Xr chflags 2 , Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vnode.h Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/cddl/compat/opensolaris/sys/vnode.h Thu Oct 25 22:16:34 2018 (r339748) @@ -278,7 +278,7 @@ vn_remove(char *fnamep, enum uio_seg seg, enum rm dirf ASSERT(seg == UIO_SYSSPACE); ASSERT(dirflag == RMFILE); - return (kern_unlinkat(curthread, AT_FDCWD, fnamep, seg, 0)); + return (kern_unlinkat(curthread, AT_FDCWD, fnamep, seg, 0, 0)); } #endif /* _KERNEL */ Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/compat/cloudabi/cloudabi_file.c Thu Oct 25 22:16:34 2018 (r339748) @@ -752,9 +752,9 @@ cloudabi_sys_file_unlink(struct thread *td, return (error); if (uap->flags & CLOUDABI_UNLINK_REMOVEDIR) - error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE); + error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE, 0); else - error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0); + error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0, 0); cloudabi_freestr(path); return (error); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/compat/linux/linux_file.c Thu Oct 25 22:16:34 2018 (r339748) @@ -590,7 +590,7 @@ linux_unlink(struct thread *td, struct linux_unlink_ar printf(ARGS(unlink, "%s"), path); #endif - error = kern_unlinkat(td, AT_FDCWD, path, UIO_SYSSPACE, 0); + error = kern_unlinkat(td, AT_FDCWD, path, UIO_SYSSPACE, 0, 0); if (error == EPERM) { /* Introduce POSIX noncompliant behaviour of Linux */ if (kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, @@ -623,9 +623,9 @@ linux_unlinkat(struct thread *td, struct linux_unlinka #endif if (args->flag & LINUX_AT_REMOVEDIR) - error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE); + error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE, 0); else - error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE, 0); + error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE, 0, 0); if (error == EPERM && !(args->flag & LINUX_AT_REMOVEDIR)) { /* Introduce POSIX noncompliant behaviour of Linux */ if (kern_statat(td, AT_SYMLINK_NOFOLLOW, dfd, path, @@ -741,7 +741,7 @@ linux_rmdir(struct thread *td, struct linux_rmdir_args if (ldebug(rmdir)) printf(ARGS(rmdir, "%s"), path); #endif - error = kern_rmdirat(td, AT_FDCWD, path, UIO_SYSSPACE); + error = kern_rmdirat(td, AT_FDCWD, path, UIO_SYSSPACE, 0); LFREEPATH(path); return (error); } Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/kern/vfs_lookup.c Thu Oct 25 22:16:34 2018 (r339748) @@ -242,7 +242,8 @@ namei_handle_root(struct nameidata *ndp, struct vnode struct componentname *cnp; cnp = &ndp->ni_cnd; - if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0) { + if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 || + (cnp->cn_flags & BENEATH) != 0) { #ifdef KTRACE if (KTRPOINT(curthread, KTR_CAPFAIL)) ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); @@ -434,8 +435,10 @@ namei(struct nameidata *ndp) vrele(dp); goto out; } - if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && - lookup_cap_dotdot != 0) + if (((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && + lookup_cap_dotdot != 0) || + ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && + (cnp->cn_flags & BENEATH) != 0)) ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; SDT_PROBE3(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf, cnp->cn_flags); Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/kern/vfs_mountroot.c Thu Oct 25 22:16:34 2018 (r339748) @@ -389,7 +389,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount vfs_unbusy(mpdevfs); /* Unlink the no longer needed /dev/dev -> / symlink */ error = kern_unlinkat(td, AT_FDCWD, "/dev/dev", - UIO_SYSSPACE, 0); + UIO_SYSSPACE, 0, 0); if (error) printf("mountroot: unable to unlink /dev/dev " "(error %d)\n", error); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/kern/vfs_syscalls.c Thu Oct 25 22:16:34 2018 (r339748) @@ -1443,11 +1443,12 @@ sys_linkat(struct thread *td, struct linkat_args *uap) int flag; flag = uap->flag; - if (flag & ~AT_SYMLINK_FOLLOW) + if ((flag & ~(AT_SYMLINK_FOLLOW | AT_BENEATH)) != 0) return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, - UIO_USERSPACE, (flag & AT_SYMLINK_FOLLOW) ? FOLLOW : NOFOLLOW)); + UIO_USERSPACE, ((flag & AT_SYMLINK_FOLLOW) != 0 ? FOLLOW : + NOFOLLOW) | ((flag & AT_BENEATH) != 0 ? BENEATH : 0))); } int hardlink_check_uid = 0; @@ -1731,7 +1732,7 @@ int sys_unlink(struct thread *td, struct unlink_args *uap) { - return (kern_unlinkat(td, AT_FDCWD, uap->path, UIO_USERSPACE, 0)); + return (kern_unlinkat(td, AT_FDCWD, uap->path, UIO_USERSPACE, 0, 0)); } #ifndef _SYS_SYSPROTO_H_ @@ -1744,22 +1745,25 @@ struct unlinkat_args { int sys_unlinkat(struct thread *td, struct unlinkat_args *uap) { - int flag = uap->flag; - int fd = uap->fd; - char *path = uap->path; + int fd, flag; + char *path; - if (flag & ~AT_REMOVEDIR) + flag = uap->flag; + fd = uap->fd; + path = uap->path; + + if ((flag & ~(AT_REMOVEDIR | AT_BENEATH)) != 0) return (EINVAL); - if (flag & AT_REMOVEDIR) - return (kern_rmdirat(td, fd, path, UIO_USERSPACE)); + if ((uap->flag & AT_REMOVEDIR) != 0) + return (kern_rmdirat(td, fd, path, UIO_USERSPACE, flag)); else - return (kern_unlinkat(td, fd, path, UIO_USERSPACE, 0)); + return (kern_unlinkat(td, fd, path, UIO_USERSPACE, flag, 0)); } int kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, - ino_t oldinum) + int flag, ino_t oldinum) { struct mount *mp; struct vnode *vp; @@ -1769,7 +1773,8 @@ kern_unlinkat(struct thread *td, int fd, char *path, e restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1, + NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | + ((flag & AT_BENEATH) != 0 ? BENEATH : 0), pathseg, path, fd, &cap_unlinkat_rights, td); if ((error = namei(&nd)) != 0) return (error == EINVAL ? EPERM : error); @@ -1960,7 +1965,7 @@ kern_accessat(struct thread *td, int fd, char *path, e struct nameidata nd; int error; - if (flag & ~AT_EACCESS) + if ((flag & ~(AT_EACCESS | AT_BENEATH)) != 0) return (EINVAL); if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) return (EINVAL); @@ -1981,8 +1986,8 @@ kern_accessat(struct thread *td, int fd, char *path, e usecred = cred; AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, - td); + AUDITVNODE1 | ((flag & AT_BENEATH) != 0 ? BENEATH : 0), + pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) goto out; vp = nd.ni_vp; @@ -2273,11 +2278,12 @@ kern_statat(struct thread *td, int flag, int fd, char struct stat sb; int error; - if (flag & ~AT_SYMLINK_NOFOLLOW) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) return (EINVAL); - NDINIT_ATRIGHTS(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : - FOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, + NDINIT_ATRIGHTS(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) != 0 ? + NOFOLLOW : FOLLOW) | ((flag & AT_BENEATH) != 0 ? BENEATH : 0) | + LOCKSHARED | LOCKLEAF | AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) @@ -2588,15 +2594,12 @@ struct chflagsat_args { int sys_chflagsat(struct thread *td, struct chflagsat_args *uap) { - int fd = uap->fd; - const char *path = uap->path; - u_long flags = uap->flags; - int atflag = uap->atflag; - if (atflag & ~AT_SYMLINK_NOFOLLOW) + if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) return (EINVAL); - return (kern_chflagsat(td, fd, path, UIO_USERSPACE, flags, atflag)); + return (kern_chflagsat(td, uap->fd, uap->path, UIO_USERSPACE, + uap->flags, uap->atflag)); } /* @@ -2625,6 +2628,7 @@ kern_chflagsat(struct thread *td, int fd, const char * AUDIT_ARG_FFLAGS(flags); follow = (atflag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; + follow |= (atflag & AT_BENEATH) != 0 ? BENEATH : 0; NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, &cap_fchflags_rights, td); if ((error = namei(&nd)) != 0) @@ -2719,15 +2723,12 @@ struct fchmodat_args { int sys_fchmodat(struct thread *td, struct fchmodat_args *uap) { - int flag = uap->flag; - int fd = uap->fd; - char *path = uap->path; - mode_t mode = uap->mode; - if (flag & ~AT_SYMLINK_NOFOLLOW) + if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) return (EINVAL); - return (kern_fchmodat(td, fd, path, UIO_USERSPACE, mode, flag)); + return (kern_fchmodat(td, uap->fd, uap->path, UIO_USERSPACE, + uap->mode, uap->flag)); } /* @@ -2755,7 +2756,8 @@ kern_fchmodat(struct thread *td, int fd, char *path, e int error, follow; AUDIT_ARG_MODE(mode); - follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; + follow = (flag & AT_SYMLINK_NOFOLLOW) != 0 ? NOFOLLOW : FOLLOW; + follow |= (flag & AT_BENEATH) != 0 ? BENEATH : 0; NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, &cap_fchmod_rights, td); if ((error = namei(&nd)) != 0) @@ -2850,10 +2852,8 @@ struct fchownat_args { int sys_fchownat(struct thread *td, struct fchownat_args *uap) { - int flag; - flag = uap->flag; - if (flag & ~AT_SYMLINK_NOFOLLOW) + if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) return (EINVAL); return (kern_fchownat(td, uap->fd, uap->path, UIO_USERSPACE, uap->uid, @@ -2869,6 +2869,7 @@ kern_fchownat(struct thread *td, int fd, char *path, e AUDIT_ARG_OWNER(uid, gid); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; + follow |= (flag & AT_BENEATH) != 0 ? BENEATH : 0; NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd, &cap_fchown_rights, td); @@ -3220,14 +3221,14 @@ kern_utimensat(struct thread *td, int fd, char *path, struct timespec ts[2]; int error, flags; - if (flag & ~AT_SYMLINK_NOFOLLOW) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_BENEATH)) != 0) return (EINVAL); if ((error = getutimens(tptr, tptrseg, ts, &flags)) != 0) return (error); NDINIT_ATRIGHTS(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : - FOLLOW) | AUDITVNODE1, pathseg, path, fd, - &cap_futimes_rights, td); + FOLLOW) | ((flag & AT_BENEATH) != 0 ? BENEATH : 0) | AUDITVNODE1, + pathseg, path, fd, &cap_futimes_rights, td); if ((error = namei(&nd)) != 0) return (error); /* @@ -3671,11 +3672,12 @@ int sys_rmdir(struct thread *td, struct rmdir_args *uap) { - return (kern_rmdirat(td, AT_FDCWD, uap->path, UIO_USERSPACE)); + return (kern_rmdirat(td, AT_FDCWD, uap->path, UIO_USERSPACE, 0)); } int -kern_rmdirat(struct thread *td, int fd, char *path, enum uio_seg pathseg) +kern_rmdirat(struct thread *td, int fd, char *path, enum uio_seg pathseg, + int flag) { struct mount *mp; struct vnode *vp; @@ -3684,7 +3686,8 @@ kern_rmdirat(struct thread *td, int fd, char *path, en restart: bwillwrite(); - NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1, + NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | + ((flag & AT_BENEATH) != 0 ? BENEATH : 0), pathseg, path, fd, &cap_unlinkat_rights, td); if ((error = namei(&nd)) != 0) return (error); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/kern/vfs_vnops.c Thu Oct 25 22:16:34 2018 (r339748) @@ -212,6 +212,8 @@ restart: ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | NOCACHE; if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0) ndp->ni_cnd.cn_flags |= FOLLOW; + if ((fmode & O_BENEATH) != 0) + ndp->ni_cnd.cn_flags |= BENEATH; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) ndp->ni_cnd.cn_flags |= AUDITVNODE1; if (vn_open_flags & VN_OPEN_NOCAPCHECK) @@ -269,6 +271,8 @@ restart: ((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKLEAF; if (!(fmode & FWRITE)) ndp->ni_cnd.cn_flags |= LOCKSHARED; + if ((fmode & O_BENEATH) != 0) + ndp->ni_cnd.cn_flags |= BENEATH; if (!(vn_open_flags & VN_OPEN_NOAUDIT)) ndp->ni_cnd.cn_flags |= AUDITVNODE1; if (vn_open_flags & VN_OPEN_NOCAPCHECK) Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/sys/fcntl.h Thu Oct 25 22:16:34 2018 (r339748) @@ -133,6 +133,7 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE #define O_VERIFY 0x00200000 /* open only after verification */ +#define O_BENEATH 0x00400000 /* Fail if not under cwd */ #endif /* @@ -206,10 +207,12 @@ typedef __pid_t pid_t; /* * Miscellaneous flags for the *at() syscalls. */ -#define AT_EACCESS 0x100 /* Check access using effective user and group ID */ -#define AT_SYMLINK_NOFOLLOW 0x200 /* Do not follow symbolic links */ -#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic link */ -#define AT_REMOVEDIR 0x800 /* Remove directory instead of file */ +#define AT_EACCESS 0x0100 /* Check access using effective user + and group ID */ +#define AT_SYMLINK_NOFOLLOW 0x0200 /* Do not follow symbolic links */ +#define AT_SYMLINK_FOLLOW 0x0400 /* Follow symbolic link */ +#define AT_REMOVEDIR 0x0800 /* Remove directory instead of file */ +#define AT_BENEATH 0x1000 /* Fail if not under dirfd */ #endif /* Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/sys/namei.h Thu Oct 25 22:16:34 2018 (r339748) @@ -119,6 +119,7 @@ struct nameidata { #define WANTPARENT 0x0010 /* want parent vnode returned unlocked */ #define NOCACHE 0x0020 /* name must not be left in cache */ #define FOLLOW 0x0040 /* follow symbolic links */ +#define BENEATH 0x0080 /* No escape from the start dir */ #define LOCKSHARED 0x0100 /* Shared lock leaf */ #define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ #define MODMASK 0x01fc /* mask of operational modifiers */ Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/sys/syscallsubr.h Thu Oct 25 22:16:34 2018 (r339748) @@ -219,7 +219,7 @@ int kern_recvit(struct thread *td, int s, struct msghd int kern_renameat(struct thread *td, int oldfd, char *old, int newfd, char *new, enum uio_seg pathseg); int kern_rmdirat(struct thread *td, int fd, char *path, - enum uio_seg pathseg); + enum uio_seg pathseg, int flag); int kern_sched_getparam(struct thread *td, struct thread *targettd, struct sched_param *param); int kern_sched_getscheduler(struct thread *td, struct thread *targettd, @@ -286,7 +286,7 @@ int kern_thr_suspend(struct thread *td, struct timespe int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, off_t length); int kern_unlinkat(struct thread *td, int fd, char *path, - enum uio_seg pathseg, ino_t oldinum); + enum uio_seg pathseg, int flag, ino_t oldinum); int kern_utimesat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_utimensat(struct thread *td, int fd, char *path, Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Thu Oct 25 21:45:24 2018 (r339747) +++ head/sys/ufs/ffs/ffs_alloc.c Thu Oct 25 22:16:34 2018 (r339748) @@ -3399,7 +3399,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) vn_finished_write(mp); mp = NULL; error = kern_unlinkat(td, AT_FDCWD, (char *)(intptr_t)cmd.value, - UIO_USERSPACE, (ino_t)cmd.size); + UIO_USERSPACE, 0, (ino_t)cmd.size); break; case FFS_SET_INODE: From owner-svn-src-head@freebsd.org Thu Oct 25 22:55:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CBA710CC214; Thu, 25 Oct 2018 22:55:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6B3D77190; Thu, 25 Oct 2018 22:55:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B249318768; Thu, 25 Oct 2018 22:55:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PMtIql007123; Thu, 25 Oct 2018 22:55:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PMtIjE007122; Thu, 25 Oct 2018 22:55:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810252255.w9PMtIjE007122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Oct 2018 22:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339749 - 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: 339749 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, 25 Oct 2018 22:55:19 -0000 Author: np Date: Thu Oct 25 22:55:18 2018 New Revision: 339749 URL: https://svnweb.freebsd.org/changeset/base/339749 Log: cxgbe(4): Add a knob to split the rx queues for a netmap enabled interface into two groups. Filters can be used to match traffic and distribute it across a group. hw.cxgbe.nm_split_rss Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Oct 25 22:16:34 2018 (r339748) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Oct 25 22:55:18 2018 (r339749) @@ -101,6 +101,15 @@ int lazy_tx_credit_flush = 1; SYSCTL_INT(_hw_cxgbe, OID_AUTO, lazy_tx_credit_flush, CTLFLAG_RWTUN, &lazy_tx_credit_flush, 0, "lazy credit flush for netmap tx queues."); +/* + * Split the netmap rx queues into two groups that populate separate halves of + * the RSS indirection table. This allows filters with hashmask to steer to a + * particular group of queues. + */ +static int nm_split_rss = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_split_rss, CTLFLAG_RWTUN, + &nm_split_rss, 0, "Split the netmap rx queues into two groups."); + static int alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong) { @@ -333,7 +342,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi struct netmap_kring *kring; struct sge_nm_rxq *nm_rxq; struct sge_nm_txq *nm_txq; - int rc, i, j, hwidx; + int rc, i, j, hwidx, defq, nrssq; struct hw_buf_info *hwb; ASSERT_SYNCHRONIZED_OP(sc); @@ -403,20 +412,69 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi vi->nm_rss = malloc(vi->rss_size * sizeof(uint16_t), M_CXGBE, M_ZERO | M_WAITOK); } - for (i = 0; i < vi->rss_size;) { - for_each_nm_rxq(vi, j, nm_rxq) { - vi->nm_rss[i++] = nm_rxq->iq_abs_id; - if (i == vi->rss_size) - break; + + MPASS(vi->nnmrxq > 0); + if (nm_split_rss == 0 || vi->nnmrxq == 1) { + for (i = 0; i < vi->rss_size;) { + for_each_nm_rxq(vi, j, nm_rxq) { + vi->nm_rss[i++] = nm_rxq->iq_abs_id; + if (i == vi->rss_size) + break; + } } + defq = vi->nm_rss[0]; + } else { + /* We have multiple queues and we want to split the table. */ + MPASS(nm_split_rss != 0); + MPASS(vi->nnmrxq > 1); + + nm_rxq = &sc->sge.nm_rxq[vi->first_nm_rxq]; + nrssq = vi->nnmrxq; + if (vi->nnmrxq & 1) { + /* + * Odd number of queues. The first rxq is designated the + * default queue, the rest are split evenly. + */ + defq = nm_rxq->iq_abs_id; + nm_rxq++; + nrssq--; + } else { + /* + * Even number of queues split into two halves. The + * first rxq in one of the halves is designated the + * default queue. + */ +#if 1 + /* First rxq in the first half. */ + defq = nm_rxq->iq_abs_id; +#else + /* First rxq in the second half. */ + defq = nm_rxq[vi->nnmrxq / 2].iq_abs_id; +#endif + } + + i = 0; + while (i < vi->rss_size / 2) { + for (j = 0; j < nrssq / 2; j++) { + vi->nm_rss[i++] = nm_rxq[j].iq_abs_id; + if (i == vi->rss_size / 2) + break; + } + } + while (i < vi->rss_size) { + for (j = nrssq / 2; j < nrssq; j++) { + vi->nm_rss[i++] = nm_rxq[j].iq_abs_id; + if (i == vi->rss_size) + break; + } + } } rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, vi->nm_rss, vi->rss_size); if (rc != 0) if_printf(ifp, "netmap rss_config failed: %d\n", rc); - rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, - vi->nm_rss[0], 0, 0); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, defq, 0, 0); if (rc != 0) if_printf(ifp, "netmap rss hash/defaultq config failed: %d\n", rc); From owner-svn-src-head@freebsd.org Thu Oct 25 23:13:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BA5110CCBA4; Thu, 25 Oct 2018 23:13:20 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30AD577C32; Thu, 25 Oct 2018 23:13:20 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E744C18AC5; Thu, 25 Oct 2018 23:13:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PNDJxd017610; Thu, 25 Oct 2018 23:13:19 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PNDJgd017609; Thu, 25 Oct 2018 23:13:19 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201810252313.w9PNDJgd017609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 25 Oct 2018 23:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339751 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 339751 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, 25 Oct 2018 23:13:20 -0000 Author: mm Date: Thu Oct 25 23:13:19 2018 New Revision: 339751 URL: https://svnweb.freebsd.org/changeset/base/339751 Log: MFV r339750: Sync libarchive with vendor. Relevant vendor changes: RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), sparc64 and riscv64 MFC after: 1 month Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Thu Oct 25 23:10:06 2018 (r339750) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Thu Oct 25 23:13:19 2018 (r339751) @@ -737,11 +737,11 @@ static void dist_cache_push(struct rar5* rar, int valu q[0] = value; } -static int dist_cache_touch(struct rar5* rar, int index) { +static int dist_cache_touch(struct rar5* rar, int idx) { int* q = rar->cstate.dist_cache; - int i, dist = q[index]; + int i, dist = q[idx]; - for(i = index; i > 0; i--) + for(i = idx; i > 0; i--) q[i] = q[i - 1]; q[0] = dist; @@ -1500,10 +1500,10 @@ static int process_head_main(struct archive_read* a, s (void) entry; int ret; - size_t extra_data_size, - extra_field_size, - extra_field_id, - archive_flags; + size_t extra_data_size = 0; + size_t extra_field_size = 0; + size_t extra_field_id = 0; + size_t archive_flags = 0; if(block_flags & HFL_EXTRA_DATA) { if(!read_var_sized(a, &extra_data_size, NULL)) @@ -1528,7 +1528,7 @@ static int process_head_main(struct archive_read* a, s rar->main.solid = (archive_flags & SOLID) > 0; if(archive_flags & VOLUME_NUMBER) { - size_t v; + size_t v = 0; if(!read_var_sized(a, &v, NULL)) { return ARCHIVE_EOF; } @@ -1644,7 +1644,8 @@ static int process_base_block(struct archive_read* a, struct rar5* rar = get_context(a); uint32_t hdr_crc, computed_crc; size_t raw_hdr_size, hdr_size_len, hdr_size; - size_t header_id, header_flags; + size_t header_id = 0; + size_t header_flags = 0; const uint8_t* p; int ret; @@ -2529,8 +2530,8 @@ static int do_uncompress_block(struct archive_read* a, continue; } else if(num < 262) { - const int index = num - 258; - const int dist = dist_cache_touch(rar, index); + const int idx = num - 258; + const int dist = dist_cache_touch(rar, idx); uint16_t len_slot; int len; From owner-svn-src-head@freebsd.org Thu Oct 25 23:32:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FF6410CD87F; Thu, 25 Oct 2018 23:32:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA79178748; Thu, 25 Oct 2018 23:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BC2F18E1E; Thu, 25 Oct 2018 23:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PNWWSs027265; Thu, 25 Oct 2018 23:32:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PNWW1a027264; Thu, 25 Oct 2018 23:32:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810252332.w9PNWW1a027264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 25 Oct 2018 23:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339752 - head/usr.sbin/bsdconfig/share X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/share X-SVN-Commit-Revision: 339752 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, 25 Oct 2018 23:32:33 -0000 Author: dteske Date: Thu Oct 25 23:32:32 2018 New Revision: 339752 URL: https://svnweb.freebsd.org/changeset/base/339752 Log: Remove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Thu Oct 25 23:13:19 2018 (r339751) +++ head/usr.sbin/bsdconfig/share/dialog.subr Thu Oct 25 23:32:32 2018 (r339752) @@ -79,7 +79,6 @@ unset XDIALOG_INFOBOX_TIMEOUT DIALOG_OK=${SUCCESS:-0} DIALOG_CANCEL=${FAILURE:-1} DIALOG_HELP=2 -DIALOG_ITEM_HELP=2 DIALOG_EXTRA=3 DIALOG_ITEM_HELP=4 export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1' From owner-svn-src-head@freebsd.org Fri Oct 26 00:05:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D5610CEB88; Fri, 26 Oct 2018 00:05:54 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F06279BD4; Fri, 26 Oct 2018 00:05:54 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DFE61932B; Fri, 26 Oct 2018 00:05:54 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q05slP042863; Fri, 26 Oct 2018 00:05:54 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q05lud042824; Fri, 26 Oct 2018 00:05:47 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201810260005.w9Q05lud042824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Fri, 26 Oct 2018 00:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339754 - in head/sys/dev: acpi_support acpica amdgpio asmc fdc gpio hyperv/vmbus ichiic intel ipmi sdhci tpm X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: in head/sys/dev: acpi_support acpica amdgpio asmc fdc gpio hyperv/vmbus ichiic intel ipmi sdhci tpm X-SVN-Commit-Revision: 339754 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, 26 Oct 2018 00:05:55 -0000 Author: takawata Date: Fri Oct 26 00:05:46 2018 New Revision: 339754 URL: https://svnweb.freebsd.org/changeset/base/339754 Log: Distinguish _CID match and _HID match and make lower priority probe when _CID match. Reviewed by: jhb, imp Differential Revision:https://reviews.freebsd.org/D16468 Modified: head/sys/dev/acpi_support/acpi_asus.c head/sys/dev/acpi_support/acpi_fujitsu.c head/sys/dev/acpi_support/acpi_ibm.c head/sys/dev/acpi_support/acpi_panasonic.c head/sys/dev/acpi_support/acpi_rapidstart.c head/sys/dev/acpi_support/acpi_sony.c head/sys/dev/acpi_support/acpi_toshiba.c head/sys/dev/acpi_support/acpi_wmi.c head/sys/dev/acpi_support/atk0110.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_acad.c head/sys/dev/acpica/acpi_button.c head/sys/dev/acpica/acpi_cmbat.c head/sys/dev/acpica/acpi_container.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_if.m head/sys/dev/acpica/acpi_isab.c head/sys/dev/acpica/acpi_lid.c head/sys/dev/acpica/acpi_pci_link.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpi_smbat.c head/sys/dev/acpica/acpivar.h head/sys/dev/amdgpio/amdgpio.c head/sys/dev/asmc/asmc.c head/sys/dev/fdc/fdc_acpi.c head/sys/dev/gpio/bytgpio.c head/sys/dev/gpio/chvgpio.c head/sys/dev/hyperv/vmbus/vmbus_res.c head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/intel/spi.c head/sys/dev/ipmi/ipmi_acpi.c head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/tpm/tpm_acpi.c Modified: head/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_asus.c Fri Oct 26 00:05:46 2018 (r339754) @@ -549,15 +549,16 @@ acpi_asus_probe(device_t dev) ACPI_OBJECT Arg, *Obj; ACPI_OBJECT_LIST Args; static char *asus_ids[] = { "ATK0100", "ASUS010", NULL }; + int rv; char *rstr; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (acpi_disabled("asus")) return (ENXIO); - rstr = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids); - if (rstr == NULL) { - return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids, &rstr); + if (rv > 0) { + return (rv); } sc = device_get_softc(dev); @@ -595,7 +596,7 @@ acpi_asus_probe(device_t dev) sc->model = &acpi_samsung_models[0]; device_set_desc(dev, "Samsung P30 Laptop Extras"); AcpiOsFree(Buf.Pointer); - return (0); + return (rv); } /* EeePC */ @@ -603,7 +604,7 @@ acpi_asus_probe(device_t dev) sc->model = &acpi_eeepc_models[0]; device_set_desc(dev, "ASUS EeePC"); AcpiOsFree(Buf.Pointer); - return (0); + return (rv); } } @@ -627,7 +628,7 @@ good: sbuf_delete(sb); AcpiOsFree(Buf.Pointer); - return (0); + return (rv); } /* Modified: head/sys/dev/acpi_support/acpi_fujitsu.c ============================================================================== --- head/sys/dev/acpi_support/acpi_fujitsu.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_fujitsu.c Fri Oct 26 00:05:46 2018 (r339754) @@ -228,16 +228,15 @@ acpi_fujitsu_probe(device_t dev) { char *name; char buffer[64]; + int rv; - name = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids); - if (acpi_disabled("fujitsu") || name == NULL || - device_get_unit(dev) > 1) + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids, &name); + if (acpi_disabled("fujitsu") || rv > 0 || device_get_unit(dev) > 1) return (ENXIO); - sprintf(buffer, "Fujitsu Function Hotkeys %s", name); device_set_desc_copy(dev, buffer); - return (0); + return (rv); } static int Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_ibm.c Fri Oct 26 00:05:46 2018 (r339754) @@ -411,14 +411,17 @@ acpi_ibm_mic_led_set (struct acpi_ibm_softc *sc, int a static int acpi_ibm_probe(device_t dev) { + int rv; + if (acpi_disabled("ibm") || - ACPI_ID_PROBE(device_get_parent(dev), dev, ibm_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ibm_ids, NULL); - device_set_desc(dev, "IBM ThinkPad ACPI Extras"); - - return (0); + if (rv <= 0) + device_set_desc(dev, "IBM ThinkPad ACPI Extras"); + + return (rv); } static int Modified: head/sys/dev/acpi_support/acpi_panasonic.c ============================================================================== --- head/sys/dev/acpi_support/acpi_panasonic.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_panasonic.c Fri Oct 26 00:05:46 2018 (r339754) @@ -137,14 +137,16 @@ static int acpi_panasonic_probe(device_t dev) { static char *mat_ids[] = { "MAT0019", NULL }; - + int rv; + if (acpi_disabled("panasonic") || - ACPI_ID_PROBE(device_get_parent(dev), dev, mat_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, mat_ids, NULL); - device_set_desc(dev, "Panasonic Notebook Hotkeys"); - return (0); + if (rv <= 0) + device_set_desc(dev, "Panasonic Notebook Hotkeys"); + return (rv); } static int Modified: head/sys/dev/acpi_support/acpi_rapidstart.c ============================================================================== --- head/sys/dev/acpi_support/acpi_rapidstart.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_rapidstart.c Fri Oct 26 00:05:46 2018 (r339754) @@ -62,14 +62,16 @@ static char *rapidstart_ids[] = {"INT3392", NULL}; static int acpi_rapidstart_probe(device_t dev) { + int rv; + if (acpi_disabled("rapidstart") || - ACPI_ID_PROBE(device_get_parent(dev), dev, rapidstart_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, rapidstart_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Intel Rapid Start ACPI device"); - device_set_desc(dev, "Intel Rapid Start ACPI device"); - - return (0); + return (rv); } Modified: head/sys/dev/acpi_support/acpi_sony.c ============================================================================== --- head/sys/dev/acpi_support/acpi_sony.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_sony.c Fri Oct 26 00:05:46 2018 (r339754) @@ -114,11 +114,11 @@ static char *sny_id[] = {"SNY5001", NULL}; static int acpi_sony_probe(device_t dev) { - int ret = ENXIO; + int ret; - if (ACPI_ID_PROBE(device_get_parent(dev), dev, sny_id)) { + ret = ACPI_ID_PROBE(device_get_parent(dev), dev, sny_id, NULL); + if (ret <= 0) { device_set_desc(dev, "Sony notebook controller"); - ret = 0; } return (ret); } Modified: head/sys/dev/acpi_support/acpi_toshiba.c ============================================================================== --- head/sys/dev/acpi_support/acpi_toshiba.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_toshiba.c Fri Oct 26 00:05:46 2018 (r339754) @@ -220,14 +220,15 @@ static int acpi_toshiba_probe(device_t dev) { static char *tosh_ids[] = { "TOS6200", "TOS6207", "TOS6208", NULL }; + int rv; if (acpi_disabled("toshiba") || - ACPI_ID_PROBE(device_get_parent(dev), dev, tosh_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); - - device_set_desc(dev, "Toshiba HCI Extras"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, tosh_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Toshiba HCI Extras"); + return (rv); } static int @@ -543,15 +544,17 @@ static int acpi_toshiba_video_probe(device_t dev) { static char *vid_ids[] = { "TOS6201", NULL }; + int rv; if (acpi_disabled("toshiba") || - ACPI_ID_PROBE(device_get_parent(dev), dev, vid_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); device_quiet(dev); - device_set_desc(dev, "Toshiba Video"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, vid_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Toshiba Video"); + return (rv); } static int Modified: head/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_wmi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/acpi_wmi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -208,12 +208,15 @@ static char *wmi_ids[] = {"PNP0C14", NULL}; static int acpi_wmi_probe(device_t dev) { - if (acpi_disabled("wmi") || - ACPI_ID_PROBE(device_get_parent(dev), dev, wmi_ids) == NULL) + int rv; + + if (acpi_disabled("wmi")) return (ENXIO); - device_set_desc(dev, "ACPI-WMI mapping"); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, wmi_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "ACPI-WMI mapping"); - return (0); + return (rv); } /* Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpi_support/atk0110.c Fri Oct 26 00:05:46 2018 (r339754) @@ -122,11 +122,13 @@ static char* aibs_hids[] = { static int aibs_probe(device_t dev) { - if (acpi_disabled("aibs") || - ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids) == NULL) - return (ENXIO); + int rv; - device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)"); + if (acpi_disabled("aibs")) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids, NULL); + if (rv <= 0 ) + device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)"); return (0); } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -140,7 +140,7 @@ static void acpi_delete_resource(device_t bus, device_ int rid); static uint32_t acpi_isa_get_logicalid(device_t dev); static int acpi_isa_get_compatid(device_t dev, uint32_t *cids, int count); -static char *acpi_device_id_probe(device_t bus, device_t dev, char **ids); +static int acpi_device_id_probe(device_t bus, device_t dev, char **ids, char **match); static ACPI_STATUS acpi_device_eval_obj(device_t bus, device_t dev, ACPI_STRING pathname, ACPI_OBJECT_LIST *parameters, ACPI_BUFFER *ret); @@ -1183,7 +1183,7 @@ acpi_sysres_alloc(device_t dev) if (device_get_children(dev, &children, &child_count) != 0) return (ENXIO); for (i = 0; i < child_count; i++) { - if (ACPI_ID_PROBE(dev, children[i], sysres_ids) != NULL) + if (ACPI_ID_PROBE(dev, children[i], sysres_ids, NULL) <= 0) device_probe_and_attach(children[i]); } free(children, M_TEMP); @@ -1242,7 +1242,7 @@ acpi_reserve_resources(device_t dev) rl = &ad->ad_rl; /* Don't reserve system resources. */ - if (ACPI_ID_PROBE(dev, children[i], sysres_ids) != NULL) + if (ACPI_ID_PROBE(dev, children[i], sysres_ids, NULL) <= 0) continue; STAILQ_FOREACH(rle, rl, link) { @@ -1292,7 +1292,8 @@ acpi_set_resource(device_t dev, device_t child, int ty rman_res_t end; /* Ignore IRQ resources for PCI link devices. */ - if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL) + if (type == SYS_RES_IRQ && + ACPI_ID_PROBE(dev, child, pcilink_ids, NULL) <= 0) return (0); /* @@ -1335,7 +1336,7 @@ acpi_set_resource(device_t dev, device_t child, int ty return (0); /* Don't reserve system resources. */ - if (ACPI_ID_PROBE(dev, child, sysres_ids) != NULL) + if (ACPI_ID_PROBE(dev, child, sysres_ids, NULL) <= 0) return (0); /* @@ -1640,26 +1641,34 @@ acpi_isa_get_compatid(device_t dev, uint32_t *cids, in return_VALUE (valid); } -static char * -acpi_device_id_probe(device_t bus, device_t dev, char **ids) +static int +acpi_device_id_probe(device_t bus, device_t dev, char **ids, char **match) { ACPI_HANDLE h; ACPI_OBJECT_TYPE t; + int rv; int i; h = acpi_get_handle(dev); if (ids == NULL || h == NULL) - return (NULL); + return (ENXIO); t = acpi_get_type(dev); if (t != ACPI_TYPE_DEVICE && t != ACPI_TYPE_PROCESSOR) - return (NULL); + return (ENXIO); /* Try to match one of the array of IDs with a HID or CID. */ for (i = 0; ids[i] != NULL; i++) { - if (acpi_MatchHid(h, ids[i])) - return (ids[i]); + rv = acpi_MatchHid(h, ids[i]); + if (rv == ACPI_MATCHHID_NOMATCH) + continue; + + if (match != NULL) { + *match = ids[i]; + } + return ((rv == ACPI_MATCHHID_HID)? + BUS_PROBE_DEFAULT : BUS_PROBE_LOW_PRIORITY); } - return (NULL); + return (ENXIO); } static ACPI_STATUS @@ -2285,8 +2294,11 @@ acpi_has_hid(ACPI_HANDLE h) /* * Match a HID string against a handle + * returns ACPI_MATCHHID_HID if _HID match + * ACPI_MATCHHID_CID if _CID match and not _HID match. + * ACPI_MATCHHID_NOMATCH=0 if no match. */ -BOOLEAN +int acpi_MatchHid(ACPI_HANDLE h, const char *hid) { ACPI_DEVICE_INFO *devinfo; @@ -2295,16 +2307,16 @@ acpi_MatchHid(ACPI_HANDLE h, const char *hid) if (hid == NULL || h == NULL || ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) - return (FALSE); + return (ACPI_MATCHHID_NOMATCH); ret = FALSE; if ((devinfo->Valid & ACPI_VALID_HID) != 0 && strcmp(hid, devinfo->HardwareId.String) == 0) - ret = TRUE; + ret = ACPI_MATCHHID_HID; else if ((devinfo->Valid & ACPI_VALID_CID) != 0) for (i = 0; i < devinfo->CompatibleIdList.Count; i++) { if (strcmp(hid, devinfo->CompatibleIdList.Ids[i].String) == 0) { - ret = TRUE; + ret = ACPI_MATCHHID_CID; break; } } Modified: head/sys/dev/acpica/acpi_acad.c ============================================================================== --- head/sys/dev/acpica/acpi_acad.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_acad.c Fri Oct 26 00:05:46 2018 (r339754) @@ -142,13 +142,14 @@ static int acpi_acad_probe(device_t dev) { static char *acad_ids[] = { "ACPI0003", NULL }; + int rv; - if (acpi_disabled("acad") || - ACPI_ID_PROBE(device_get_parent(dev), dev, acad_ids) == NULL) + if (acpi_disabled("acad")) return (ENXIO); - - device_set_desc(dev, "AC Adapter"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, acad_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "AC Adapter"); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_button.c ============================================================================== --- head/sys/dev/acpica/acpi_button.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_button.c Fri Oct 26 00:05:46 2018 (r339754) @@ -98,11 +98,14 @@ acpi_button_probe(device_t dev) { struct acpi_button_softc *sc; char *str; + int rv; - if (acpi_disabled("button") || - (str = ACPI_ID_PROBE(device_get_parent(dev), dev, btn_ids)) == NULL) + if (acpi_disabled("button")) return (ENXIO); - + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, btn_ids, &str); + if (rv > 0) + return (ENXIO); + sc = device_get_softc(dev); if (strcmp(str, "PNP0C0C") == 0) { device_set_desc(dev, "Power Button"); @@ -120,7 +123,7 @@ acpi_button_probe(device_t dev) sc->fixed = 1; } - return (0); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_cmbat.c ============================================================================== --- head/sys/dev/acpica/acpi_cmbat.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_cmbat.c Fri Oct 26 00:05:46 2018 (r339754) @@ -116,13 +116,14 @@ static int acpi_cmbat_probe(device_t dev) { static char *cmbat_ids[] = { "PNP0C0A", NULL }; - - if (acpi_disabled("cmbat") || - ACPI_ID_PROBE(device_get_parent(dev), dev, cmbat_ids) == NULL) + int rv; + + if (acpi_disabled("cmbat")) return (ENXIO); - - device_set_desc(dev, "ACPI Control Method Battery"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, cmbat_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "ACPI Control Method Battery"); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_container.c ============================================================================== --- head/sys/dev/acpica/acpi_container.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_container.c Fri Oct 26 00:05:46 2018 (r339754) @@ -98,13 +98,14 @@ static int acpi_syscont_probe(device_t dev) { static char *syscont_ids[] = { "ACPI0004", "PNP0A05", "PNP0A06", NULL }; + int rv; - if (acpi_disabled("syscontainer") || - ACPI_ID_PROBE(device_get_parent(dev), dev, syscont_ids) == NULL) + if (acpi_disabled("syscontainer")) return (ENXIO); - - device_set_desc(dev, "System Container"); - return (BUS_PROBE_DEFAULT); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, syscont_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "System Container"); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_cpu.c Fri Oct 26 00:05:46 2018 (r339754) @@ -252,7 +252,7 @@ acpi_cpu_probe(device_t dev) if (type != ACPI_TYPE_PROCESSOR && type != ACPI_TYPE_DEVICE) return (ENXIO); if (type == ACPI_TYPE_DEVICE && - ACPI_ID_PROBE(device_get_parent(dev), dev, cpudev_ids) == NULL) + ACPI_ID_PROBE(device_get_parent(dev), dev, cpudev_ids, NULL) >= 0) return (ENXIO); handle = acpi_get_handle(dev); Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_ec.c Fri Oct 26 00:05:46 2018 (r339754) @@ -362,7 +362,10 @@ acpi_ec_probe(device_t dev) if (params != NULL) { ecdt = 1; ret = 0; - } else if (ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)) { + } else { + ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); + if (ret > 0) + goto out; params = malloc(sizeof(struct acpi_ec_params), M_TEMP, M_WAITOK | M_ZERO); h = acpi_get_handle(dev); @@ -422,14 +425,14 @@ acpi_ec_probe(device_t dev) * this device. */ peer = devclass_get_device(acpi_ec_devclass, params->uid); - if (peer == NULL || !device_is_alive(peer)) - ret = 0; - else + if (peer != NULL && device_is_alive(peer)){ + ret = ENXIO; device_disable(dev); + } } out: - if (ret == 0) { + if (ret <= 0) { snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", params->gpe_bit, (params->glk) ? ", GLK" : "", ecdt ? ", ECDT" : ""); Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_hpet.c Fri Oct 26 00:05:46 2018 (r339754) @@ -450,16 +450,15 @@ hpet_identify(driver_t *driver, device_t parent) static int hpet_probe(device_t dev) { - ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); + int rv; + ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); if (acpi_disabled("hpet") || acpi_hpet_disabled) return (ENXIO); - if (acpi_get_handle(dev) != NULL && - ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL) - return (ENXIO); - - device_set_desc(dev, "High Precision Event Timer"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "High Precision Event Timer"); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_if.m ============================================================================== --- head/sys/dev/acpica/acpi_if.m Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_if.m Fri Oct 26 00:05:46 2018 (r339754) @@ -78,12 +78,19 @@ CODE { # # char **ids: array of ID strings to consider # -# Returns: ID string matched or NULL if no match +# char **match: Pointer to store ID string matched or NULL if no match +# pass NULL if not needed. # -METHOD char * id_probe { +# Returns: BUS_PROBE_DEFAULT if _HID match +# BUS_PROBE_LOW_PRIORITY if _CID match and not _HID match +# ENXIO if no match. +# + +METHOD int id_probe { device_t bus; device_t dev; char **ids; + char **match; } DEFAULT acpi_generic_id_probe; # Modified: head/sys/dev/acpica/acpi_isab.c ============================================================================== --- head/sys/dev/acpica/acpi_isab.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_isab.c Fri Oct 26 00:05:46 2018 (r339754) @@ -92,14 +92,15 @@ static int acpi_isab_probe(device_t dev) { static char *isa_ids[] = { "PNP0A05", "PNP0A06", NULL }; - + int rv; + if (acpi_disabled("isab") || - ACPI_ID_PROBE(device_get_parent(dev), dev, isa_ids) == NULL || devclass_get_device(isab_devclass, 0) != dev) return (ENXIO); - - device_set_desc(dev, "ACPI Generic ISA bridge"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, isa_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "ACPI Generic ISA bridge"); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_lid.c Fri Oct 26 00:05:46 2018 (r339754) @@ -88,13 +88,14 @@ static int acpi_lid_probe(device_t dev) { static char *lid_ids[] = { "PNP0C0D", NULL }; + int rv; - if (acpi_disabled("lid") || - ACPI_ID_PROBE(device_get_parent(dev), dev, lid_ids) == NULL) + if (acpi_disabled("lid")) return (ENXIO); - - device_set_desc(dev, "Control Method Lid Switch"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, lid_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Control Method Lid Switch"); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- head/sys/dev/acpica/acpi_pci_link.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_pci_link.c Fri Oct 26 00:05:46 2018 (r339754) @@ -146,15 +146,18 @@ static int acpi_pci_link_probe(device_t dev) { char descr[28], name[12]; + int rv; /* * We explicitly do not check _STA since not all systems set it to * sensible values. */ - if (acpi_disabled("pci_link") || - ACPI_ID_PROBE(device_get_parent(dev), dev, pci_link_ids) == NULL) - return (ENXIO); - + if (acpi_disabled("pci_link")) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, pci_link_ids, NULL); + if (rv > 0) + return (rv); + if (ACPI_SUCCESS(acpi_short_name(acpi_get_handle(dev), name, sizeof(name)))) { snprintf(descr, sizeof(descr), "ACPI PCI Link %s", name); @@ -162,7 +165,7 @@ acpi_pci_link_probe(device_t dev) } else device_set_desc(dev, "ACPI PCI Link"); device_quiet(dev); - return (0); + return (rv); } static ACPI_STATUS Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_resource.c Fri Oct 26 00:05:46 2018 (r339754) @@ -696,14 +696,17 @@ static int acpi_sysres_probe(device_t dev) { static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; + int rv; - if (acpi_disabled("sysresource") || - ACPI_ID_PROBE(device_get_parent(dev), dev, sysres_ids) == NULL) + if (acpi_disabled("sysresource")) return (ENXIO); - + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, sysres_ids, NULL); + if (rv > 0){ + return (rv); + } device_set_desc(dev, "System Resource"); device_quiet(dev); - return (BUS_PROBE_DEFAULT); + return (rv); } static int Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpi_smbat.c Fri Oct 26 00:05:46 2018 (r339754) @@ -107,16 +107,18 @@ acpi_smbat_probe(device_t dev) { static char *smbat_ids[] = {"ACPI0001", "ACPI0005", NULL}; ACPI_STATUS status; + int rv; - if (acpi_disabled("smbat") || - ACPI_ID_PROBE(device_get_parent(dev), dev, smbat_ids) == NULL) + if (acpi_disabled("smbat")) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, smbat_ids, NULL); + if (rv > 0) + return (rv); status = AcpiEvaluateObject(acpi_get_handle(dev), "_EC", NULL, NULL); if (ACPI_FAILURE(status)) return (ENXIO); - device_set_desc(dev, "ACPI Smart Battery"); - return (0); + return (rv); } static int Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/acpica/acpivar.h Fri Oct 26 00:05:46 2018 (r339754) @@ -371,7 +371,11 @@ int acpi_bus_alloc_gas(device_t dev, int *type, int * u_int flags); void acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, void *arg); -BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); +int acpi_MatchHid(ACPI_HANDLE h, const char *hid); +#define ACPI_MATCHHID_NOMATCH 0 +#define ACPI_MATCHHID_HID 1 +#define ACPI_MATCHHID_CID 2 + struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); Modified: head/sys/dev/amdgpio/amdgpio.c ============================================================================== --- head/sys/dev/amdgpio/amdgpio.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/amdgpio/amdgpio.c Fri Oct 26 00:05:46 2018 (r339754) @@ -344,13 +344,16 @@ static int amdgpio_probe(device_t dev) { static char *gpio_ids[] = { "AMD0030", "AMDI0030", NULL }; - - if (acpi_disabled("gpio") || - ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids) == NULL) - return (ENXIO); - - device_set_desc(dev, "AMD GPIO Controller"); - return (0); + int rv; + + if (acpi_disabled("gpio")) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids, NULL); + + if (rv <= 0) + device_set_desc(dev, "AMD GPIO Controller"); + + return (rv); } static int Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/asmc/asmc.c Fri Oct 26 00:05:46 2018 (r339754) @@ -374,11 +374,13 @@ static int asmc_probe(device_t dev) { struct asmc_model *model; + int rv; if (resource_disabled("asmc", 0)) return (ENXIO); - if (ACPI_ID_PROBE(device_get_parent(dev), dev, asmc_ids) == NULL) - return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, asmc_ids, NULL); + if (rv > 0) + return (rv); model = asmc_match(dev); if (!model) { @@ -387,7 +389,7 @@ asmc_probe(device_t dev) } device_set_desc(dev, model->smc_desc); - return (BUS_PROBE_DEFAULT); + return (rv); } static int Modified: head/sys/dev/fdc/fdc_acpi.c ============================================================================== --- head/sys/dev/fdc/fdc_acpi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/fdc/fdc_acpi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -81,16 +81,18 @@ fdc_acpi_probe(device_t dev) { device_t bus; static char *fdc_ids[] = { "PNP0700", "PNP0701", NULL }; + int rv; bus = device_get_parent(dev); - if (ACPI_ID_PROBE(bus, dev, fdc_ids) == NULL) - return (ENXIO); + rv = ACPI_ID_PROBE(bus, dev, fdc_ids, NULL); + if (rv > 0) + return (rv); if (ACPI_SUCCESS(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, NULL))) device_set_desc(dev, "floppy drive controller (FDE)"); else device_set_desc(dev, "floppy drive controller"); - return (0); + return (rv); } static int Modified: head/sys/dev/gpio/bytgpio.c ============================================================================== --- head/sys/dev/gpio/bytgpio.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/gpio/bytgpio.c Fri Oct 26 00:05:46 2018 (r339754) @@ -541,13 +541,14 @@ static int bytgpio_probe(device_t dev) { static char *gpio_ids[] = { "INT33FC", NULL }; + int rv; - if (acpi_disabled("gpio") || - ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids) == NULL) - return (ENXIO); - - device_set_desc(dev, "Intel Baytrail GPIO Controller"); - return (0); + if (acpi_disabled("gpio")) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Intel Baytrail GPIO Controller"); + return (rv); } static int Modified: head/sys/dev/gpio/chvgpio.c ============================================================================== --- head/sys/dev/gpio/chvgpio.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/gpio/chvgpio.c Fri Oct 26 00:05:46 2018 (r339754) @@ -343,12 +343,14 @@ static char *chvgpio_hids[] = { static int chvgpio_probe(device_t dev) { - if (acpi_disabled("chvgpio") || - ACPI_ID_PROBE(device_get_parent(dev), dev, chvgpio_hids) == NULL) + int rv; + + if (acpi_disabled("chvgpio")) return (ENXIO); - - device_set_desc(dev, "Intel Cherry View GPIO"); - return (0); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, chvgpio_hids, NULL); + if (rv <= 0) + device_set_desc(dev, "Intel Cherry View GPIO"); + return (rv); } static int Modified: head/sys/dev/hyperv/vmbus/vmbus_res.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_res.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/hyperv/vmbus/vmbus_res.c Fri Oct 26 00:05:46 2018 (r339754) @@ -73,14 +73,15 @@ static int vmbus_res_probe(device_t dev) { char *id[] = { "VMBUS", NULL }; - - if (ACPI_ID_PROBE(device_get_parent(dev), dev, id) == NULL || - device_get_unit(dev) != 0 || vm_guest != VM_GUEST_HV || + int rv; + + if (device_get_unit(dev) != 0 || vm_guest != VM_GUEST_HV || (hyperv_features & CPUID_HV_MSR_SYNIC) == 0) return (ENXIO); - - device_set_desc(dev, "Hyper-V Vmbus Resource"); - return (BUS_PROBE_DEFAULT); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, id, NULL); + if (rv <= 0) + device_set_desc(dev, "Hyper-V Vmbus Resource"); + return (rv); } static int Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/ichiic/ig4_acpi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -70,21 +70,23 @@ ig4iic_acpi_probe(device_t dev) { ig4iic_softc_t *sc; char *hid; - + int rv; sc = device_get_softc(dev); if (acpi_disabled("ig4iic")) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids, &hid); + if (rv > 0){ + return (rv); + } - hid = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids); - if (hid == NULL) - return (ENXIO); + if (strcmp("AMDI0010", hid) == 0) + sc->access_intr_mask = 1; - if (strcmp("AMDI0010", hid) == 0) - sc->access_intr_mask = 1; - - device_set_desc(dev, "Designware I2C Controller"); - return (0); + + if (rv <= 0) + device_set_desc(dev, "Designware I2C Controller"); + return (rv); } static int Modified: head/sys/dev/intel/spi.c ============================================================================== --- head/sys/dev/intel/spi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/intel/spi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -423,13 +423,14 @@ static int intelspi_probe(device_t dev) { static char *gpio_ids[] = { "80860F0E", NULL }; - - if (acpi_disabled("spi") || - ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids) == NULL) - return (ENXIO); - - device_set_desc(dev, "Intel SPI Controller"); - return (0); + int rv; + + if (acpi_disabled("spi") ) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Intel SPI Controller"); + return (rv); } static int Modified: head/sys/dev/ipmi/ipmi_acpi.c ============================================================================== --- head/sys/dev/ipmi/ipmi_acpi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/ipmi/ipmi_acpi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -61,17 +61,18 @@ int ipmi_acpi_probe(device_t dev) { static char *ipmi_ids[] = {"IPI0001", NULL}; + int rv; if (ipmi_attached) return (EBUSY); - if (acpi_disabled("ipmi") || - ACPI_ID_PROBE(device_get_parent(dev), dev, ipmi_ids) == NULL) + if (acpi_disabled("ipmi")) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ipmi_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "IPMI System Interface"); - device_set_desc(dev, "IPMI System Interface"); - - return (0); + return (rv); } static int Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/sdhci/sdhci_acpi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -192,13 +192,14 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { - const char *hid; + char *hid; int i, uid; ACPI_HANDLE handle; ACPI_STATUS status; + int rv; - hid = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids); - if (hid == NULL) + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids, &hid); + if (rv > 0) return (NULL); handle = acpi_get_handle(dev); Modified: head/sys/dev/tpm/tpm_acpi.c ============================================================================== --- head/sys/dev/tpm/tpm_acpi.c Fri Oct 26 00:00:13 2018 (r339753) +++ head/sys/dev/tpm/tpm_acpi.c Fri Oct 26 00:05:46 2018 (r339754) @@ -52,12 +52,13 @@ char *tpm_ids[] = {"ATM1200", "BCM0102", "INTC0102", static int tpm_acpi_probe(device_t dev) { - if (ACPI_ID_PROBE(device_get_parent(dev), dev, tpm_ids) != NULL) { - device_set_desc(dev, "Trusted Platform Module"); - return BUS_PROBE_DEFAULT; - } + int rv; - return ENXIO; + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, tpm_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Trusted Platform Module"); + + return (rv); } static device_method_t tpm_acpi_methods[] = { From owner-svn-src-head@freebsd.org Fri Oct 26 00:08:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E9410CECF7; Fri, 26 Oct 2018 00:08:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A95A979DB2; Fri, 26 Oct 2018 00:08:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A62C19335; Fri, 26 Oct 2018 00:08:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q08RvN043005; Fri, 26 Oct 2018 00:08:27 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q08Rjw043004; Fri, 26 Oct 2018 00:08:27 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810260008.w9Q08Rjw043004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 00:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339755 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339755 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, 26 Oct 2018 00:08:28 -0000 Author: dteske Date: Fri Oct 26 00:08:27 2018 New Revision: 339755 URL: https://svnweb.freebsd.org/changeset/base/339755 Log: Fix dialog autosizing in bsdinstall hostname Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/hostname Modified: head/usr.sbin/bsdinstall/scripts/hostname ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 00:05:46 2018 (r339754) +++ head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 00:08:27 2018 (r339755) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2015 Devin Teske +# Copyright (c) 2015-2018 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,27 +26,93 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES -: ${DIALOG_OK=0} -: ${DIALOG_CANCEL=1} -: ${DIALOG_HELP=2} -: ${DIALOG_EXTRA=3} -: ${DIALOG_ITEM_HELP=4} -: ${DIALOG_ESC=255} +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading_includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr -exec 3>&1 -HOSTNAME=`dialog --backtitle 'FreeBSD Installer' --title 'Set Hostname' --nocancel --inputbox \ - 'Please choose a hostname for this machine. +############################################################ CONFIGURATION -If you are running on a managed network, please ask your network administrator for an appropriate name.' \ - 0 0 $(hostname) 2>&1 1>&3` -if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi -exec 3>&- +# +# Default value +# +: ${HOSTNAME=$( hostname )} -echo "hostname=\"$HOSTNAME\"" > $BSDINSTALL_TMPETC/rc.conf.hostname +# +# Default file to store hostname entry in +# +: ${HOSTNAMEFILE:=$BSDINSTALL_TMPETC/rc.conf.hostname} + +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +msg_set_hostname="Set Hostname" +msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf you are running on a managed network, please ask\nyour network administrator for an appropriate name." +msg_ok="OK" +msg_freebsd_installer="FreeBSD Installer" + +############################################################ FUNCTIONS + +# dialog_hostname +# +# Display input box (without cancel button) for user to enter desired hostname. +# +dialog_hostname() +{ + local prompt="$msg_please_choose_a_hostname" + local hline= + local value="$*" + + local height width + f_dialog_inputbox_size height width \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" "$value" "$hline" + + $DIALOG \ + --title "$DIALOG_TITLE" \ + --backtitle "$DIALOG_BACKTITLE" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --no-cancel \ + --inputbox "$prompt" \ + $height $width "$value" \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD +} + +############################################################ MAIN + +# +# Initialize +# +f_dialog_title "$msg_set_hostname" +f_dialog_backtitle "$msg_freebsd_installer" + +# +# Get user input +# +HOSTNAME=$( dialog_hostname "$HOSTNAME" ) +[ $? -eq $DIALOG_CANCEL ] && exit 1 + +# +# Store the user's choice +# +echo "hostname=\"$HOSTNAME\"" > "$HOSTNAMEFILE" retval=$? + +# +# Activate entry if configured +# if [ "$BSDINSTALL_CONFIGCURRENT" ]; then hostname -s "$HOSTNAME" retval=$? fi + exit $retval + +################################################################################ +# END +################################################################################ From owner-svn-src-head@freebsd.org Fri Oct 26 01:06:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D80110D0535; Fri, 26 Oct 2018 01:06:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8557B93C; Fri, 26 Oct 2018 01:06:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E23F719D24; Fri, 26 Oct 2018 01:06:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q163b3073767; Fri, 26 Oct 2018 01:06:03 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q16371073766; Fri, 26 Oct 2018 01:06:03 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810260106.w9Q16371073766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 01:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339756 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339756 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, 26 Oct 2018 01:06:04 -0000 Author: dteske Date: Fri Oct 26 01:06:03 2018 New Revision: 339756 URL: https://svnweb.freebsd.org/changeset/base/339756 Log: Add improved error checking to bsdinstall hostname Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/hostname Modified: head/usr.sbin/bsdinstall/scripts/hostname ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 00:08:27 2018 (r339755) +++ head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 01:06:03 2018 (r339756) @@ -56,6 +56,12 @@ msg_please_choose_a_hostname="Please choose a hostname msg_ok="OK" msg_freebsd_installer="FreeBSD Installer" +# +# Command strings for various tasks +# +ECHO_OVERWRITE='echo "%s" > "%s"' +SET_HOSTNAME='hostname -s "%s"' + ############################################################ FUNCTIONS # dialog_hostname @@ -100,14 +106,15 @@ HOSTNAME=$( dialog_hostname "$HOSTNAME" ) # # Store the user's choice # -echo "hostname=\"$HOSTNAME\"" > "$HOSTNAMEFILE" +f_eval_catch "$pgm" echo "$ECHO_OVERWRITE" \ + 'hostname=\"$HOSTNAME\"' "$HOSTNAMEFILE" retval=$? # # Activate entry if configured # if [ "$BSDINSTALL_CONFIGCURRENT" ]; then - hostname -s "$HOSTNAME" + f_eval_catch "$pgm" hostname "$SET_HOSTNAME" "$HOSTNAME" retval=$? fi From owner-svn-src-head@freebsd.org Fri Oct 26 01:13:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E193710D0D2F; Fri, 26 Oct 2018 01:13:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 899337C230; Fri, 26 Oct 2018 01:13:21 +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 6A81B19ECB; Fri, 26 Oct 2018 01:13:21 +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 w9Q1DLf1078542; Fri, 26 Oct 2018 01:13:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q1DLau078541; Fri, 26 Oct 2018 01:13:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810260113.w9Q1DLau078541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 26 Oct 2018 01:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339757 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339757 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, 26 Oct 2018 01:13:22 -0000 Author: emaste Date: Fri Oct 26 01:13:20 2018 New Revision: 339757 URL: https://svnweb.freebsd.org/changeset/base/339757 Log: Update elftoolchain bootstrapping test after r339083 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Oct 26 01:06:03 2018 (r339756) +++ head/Makefile.inc1 Fri Oct 26 01:13:20 2018 (r339757) @@ -1934,7 +1934,8 @@ update: .PHONY # r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. # r334881 added libdwarf constants used by ctfconvert. # r338478 fixed a crash in objcopy for mips64el objects -.if ${BOOTSTRAPPING} < 1200084 +# r339083 libelf: correct mips64el test to use ELF header +.if ${BOOTSTRAPPING} < 1200085 _elftoolchain_libs= lib/libelf lib/libdwarf .endif From owner-svn-src-head@freebsd.org Fri Oct 26 01:47:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9ACA10D18BD; Fri, 26 Oct 2018 01:47:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD2C7CE84; Fri, 26 Oct 2018 01:47:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C5861A3B8; Fri, 26 Oct 2018 01:47:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q1lrBT094015; Fri, 26 Oct 2018 01:47:53 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q1lrlE094014; Fri, 26 Oct 2018 01:47:53 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810260147.w9Q1lrlE094014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 01:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339758 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339758 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, 26 Oct 2018 01:47:53 -0000 Author: dteske Date: Fri Oct 26 01:47:52 2018 New Revision: 339758 URL: https://svnweb.freebsd.org/changeset/base/339758 Log: Sort i18n strings in bsdinstall hostname Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/hostname Modified: head/usr.sbin/bsdinstall/scripts/hostname ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 01:13:20 2018 (r339757) +++ head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 01:47:52 2018 (r339758) @@ -51,10 +51,10 @@ f_include $BSDCFG_SHARE/dialog.subr # # Strings that should be moved to an i18n file and loaded with f_include_lang() # -msg_set_hostname="Set Hostname" -msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf you are running on a managed network, please ask\nyour network administrator for an appropriate name." -msg_ok="OK" msg_freebsd_installer="FreeBSD Installer" +msg_ok="OK" +msg_please_choose_a_hostname="Please choose a hostname for this machine.\n\nIf you are running on a managed network, please ask\nyour network administrator for an appropriate name." +msg_set_hostname="Set Hostname" # # Command strings for various tasks From owner-svn-src-head@freebsd.org Fri Oct 26 01:57:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 995E210D1BCC; Fri, 26 Oct 2018 01:57:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 467497D34B; Fri, 26 Oct 2018 01:57:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B1FC1A55B; Fri, 26 Oct 2018 01:57:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q1vW8n099298; Fri, 26 Oct 2018 01:57:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q1vWUh099297; Fri, 26 Oct 2018 01:57:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810260157.w9Q1vWUh099297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 01:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339759 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339759 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, 26 Oct 2018 01:57:33 -0000 Author: dteske Date: Fri Oct 26 01:57:32 2018 New Revision: 339759 URL: https://svnweb.freebsd.org/changeset/base/339759 Log: Whitespace alignment in bsdinstall hostname Aligning line-continuation characters to prevent mistakes. This is also the prevalent style replication throughout. Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/hostname Modified: head/usr.sbin/bsdinstall/scripts/hostname ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 01:47:52 2018 (r339758) +++ head/usr.sbin/bsdinstall/scripts/hostname Fri Oct 26 01:57:32 2018 (r339759) @@ -79,13 +79,13 @@ dialog_hostname() "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$prompt" "$value" "$hline" $DIALOG \ - --title "$DIALOG_TITLE" \ + --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ - --hline "$hline" \ - --ok-label "$msg_ok" \ - --no-cancel \ - --inputbox "$prompt" \ - $height $width "$value" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --no-cancel \ + --inputbox "$prompt" \ + $height $width "$value" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD } From owner-svn-src-head@freebsd.org Fri Oct 26 02:08:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A63210D2094; Fri, 26 Oct 2018 02:08:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08C047D893; Fri, 26 Oct 2018 02:08:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBA3D1A714; Fri, 26 Oct 2018 02:08:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q28iNb004379; Fri, 26 Oct 2018 02:08:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q28iNh004378; Fri, 26 Oct 2018 02:08:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810260208.w9Q28iNh004378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 02:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339760 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339760 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, 26 Oct 2018 02:08:45 -0000 Author: dteske Date: Fri Oct 26 02:08:44 2018 New Revision: 339760 URL: https://svnweb.freebsd.org/changeset/base/339760 Log: Fix dialog autosizing in bsdinstall auto error messages Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Fri Oct 26 01:57:32 2018 (r339759) +++ head/usr.sbin/bsdinstall/scripts/auto Fri Oct 26 02:08:44 2018 (r339760) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013 Devin Teske +# Copyright (c) 2013-2018 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,30 +33,58 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_include $BSDCFG_SHARE/dialog.subr -############################################################ FUNCTIONS +############################################################ GLOBALS -error() { - local msg - if [ -n "$1" ]; then - msg="$1\n\n" - fi - test -n "$DISTDIR_IS_UNIONFS" && umount -f $BSDINSTALL_DISTDIR - test -f $PATH_FSTAB && bsdinstall umount - dialog --backtitle "FreeBSD Installer" --title "Abort" \ - --no-label "Exit" --yes-label "Restart" --yesno \ - "${msg}An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0 - if [ $? -ne 0 ]; then - exit 1 - else - exec $0 - fi -} - +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# hline_arrows_tab_enter="Press arrows, TAB or ENTER" +hline_arrows_tab_space_enter="Press arrows, TAB, SPACE or ENTER" +msg_abort="Abort" +msg_exit="Exit" +msg_freebsd_installer="FreeBSD Installer" msg_gpt_active_fix="Your hardware is known to have issues booting in CSM/Legacy/BIOS mode from GPT partitions that are not set active. Would you like the installer to apply this workaround for you?" msg_lenovo_fix="Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?" +msg_an_installation_step_has_been_aborted="An installation step has been aborted. Would you like\nto restart the installation or exit the installer?" msg_no="NO" +msg_restart="Restart" msg_yes="YES" + +############################################################ FUNCTIONS + +# error [$msg] +# +# Display generic error message when a script fails. An optional message +# argument can preceed the generic message. User is given the choice of +# restarting the installer or exiting. +# +error() +{ + local title="$msg_abort" + local btitle="$msg_freebsd_installer" + local prompt="${1:+$1\n\n}$msg_an_installation_step_has_been_aborted" + local hline="$hline_arrows_tab_space_enter" + + [ "$DISTDIR_IS_UNIONFS" ] && umount -f "$BSDINSTALL_DISTDIR" + [ -f "$PATH_FSTAB" ] && bsdinstall umount + + local height width + f_dialog_buttonbox_size height width \ + "$title" "$btitle" "$prompt" "$hline" + + if $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --no-label "$msg_exit" \ + --yes-label "$msg_restart" \ + --yesno "$prompt" $height $width + then + exec $0 + # NOTREACHED + fi + exit 1 +} # dialog_workaround # From owner-svn-src-head@freebsd.org Fri Oct 26 02:40:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E4A10D2EA7; Fri, 26 Oct 2018 02:40:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC1A77E7FC; Fri, 26 Oct 2018 02:40:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4BF1A19816; Fri, 26 Oct 2018 02:40:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f50.google.com with SMTP id q6-v6so7611970lfh.9; Thu, 25 Oct 2018 19:40:53 -0700 (PDT) X-Gm-Message-State: AGRZ1gJWMDKH4BPq0hoUoys6XjXXW+3A2zWOXzNOPPz0KwzxaPOWiXk6 iyknh40WaMC/ubXcCdzaPS/39YkeIWTa3tj7IeU= X-Google-Smtp-Source: AJdET5fIKcH0U1s7V+NMDU+iP7bCvUj3tupKk7GNhMUOfopjoy8yluI3DAQaTR4Yu8L7ZTafFUmJ9jcJWr3Iq9Ivhc0= X-Received: by 2002:a19:6803:: with SMTP id d3-v6mr993446lfc.45.1540521651610; Thu, 25 Oct 2018 19:40:51 -0700 (PDT) MIME-Version: 1.0 References: <201810251739.w9PHdfc7041441@repo.freebsd.org> In-Reply-To: <201810251739.w9PHdfc7041441@repo.freebsd.org> From: Kyle Evans Date: Thu, 25 Oct 2018 21:40:40 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339738 - in head: gnu/lib lib/csu lib/csu/aarch64 lib/csu/amd64 lib/csu/common lib/csu/i386 lib/csu/powerpc64 lib/csu/tests lib/csu/tests/dynamic lib/csu/tests/static share/mk tools/bu... To: Andrew Turner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" 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, 26 Oct 2018 02:40:54 -0000 On Thu, Oct 25, 2018 at 12:40 PM Andrew Turner wrote: > > Author: andrew > Date: Thu Oct 25 17:39:41 2018 > New Revision: 339738 > URL: https://svnweb.freebsd.org/changeset/base/339738 > > Log: > Implement a BSD licensed crtbegin/crtend > > These are needed for .ctors/.dtors and .jcr handling. The former needs > all the function pointers to be called in the correct order from the > .init/.fini section. The latter just needs to call a gcj specific function > if it exists with a pointer to the start of the .jcr section. > > This is currently disabled until __dso_handle support is added. > > Reviewed by: emaste > MFC after: 1 month > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D17587 > > Added: > head/lib/csu/aarch64/crt.h (contents, props changed) > head/lib/csu/amd64/crt.h (contents, props changed) > head/lib/csu/common/crtbegin.c (contents, props changed) > head/lib/csu/common/crtend.c (contents, props changed) > head/lib/csu/i386/crt.h (contents, props changed) > head/lib/csu/powerpc64/crt.h (contents, props changed) > head/lib/csu/tests/ > head/lib/csu/tests/Makefile (contents, props changed) > head/lib/csu/tests/Makefile.inc (contents, props changed) > head/lib/csu/tests/Makefile.tests (contents, props changed) > head/lib/csu/tests/cxx_constructors.cc (contents, props changed) > head/lib/csu/tests/dynamic/ > head/lib/csu/tests/dynamic/Makefile (contents, props changed) > head/lib/csu/tests/fini_test.c (contents, props changed) > head/lib/csu/tests/init_test.c (contents, props changed) > head/lib/csu/tests/static/ > head/lib/csu/tests/static/Makefile (contents, props changed) > head/tools/build/options/WITHOUT_BSD_CRTBEGIN (contents, props changed) > head/tools/build/options/WITH_BSD_CRTBEGIN (contents, props changed) > Modified: > head/gnu/lib/Makefile > head/lib/csu/Makefile > head/lib/csu/Makefile.inc > head/share/mk/src.opts.mk > Hi, The tests seems to have given CI some heartburn on ppc64/riscv64 after they were enabled: https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/7811/console Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Oct 26 03:30:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76C2A10D3F68; Fri, 26 Oct 2018 03:30:10 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC90803F5; Fri, 26 Oct 2018 03:30:10 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 1CCB1D2E1; Fri, 26 Oct 2018 03:30:10 +0000 (UTC) From: Jan Beich To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> Date: Fri, 26 Oct 2018 05:30:06 +0200 Message-ID: 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, 26 Oct 2018 03:30:10 -0000 Warner Losh writes: > On Wed, Oct 24, 2018 at 9:42 AM Jan Beich wrote: > >> Warner Losh writes: >> >> > Author: imp >> > Date: Mon Oct 22 02:34:00 2018 >> > New Revision: 339563 >> > URL: https://svnweb.freebsd.org/changeset/base/339563 >> > >> > Log: >> > Remove joy(4) driver. >> > >> > This driver was marked as gone in 12. We're at 13 now. Remove it. >> > Data from nycbug's dmesg cache shows only one potential user, >> > suggesting it never was used much. >> > >> > RelNotes: yes >> > Differential Revision: https://reviews.freebsd.org/D17629 >> >> Breaking userland API but not bothering with an exp-run or bumping >> __FreeBSD_version. >> Is the following the pointy hat you were looking for? >> >> >> https://forums.freebsd.org/threads/graphics-freeglut-fails-to-build-sys-joystick-h-not-found.68002/ > > > Your tone is not acceptable. Please try again, only this time with the > required level of professionalism. I'm not an idiot, and you will treat me > with respect. Apologies for the snide remark. I've expected someone with ports/ commit bit to be a bit more careful. > This driver was flagged for removal in 12 ages ago and the port failed to > update to take that deprecation into account. Not sure what "ages ago" refers to when not even 1 year passed since r328523. Neither joy(4) manpage mentioned deprecation nor __attribute__((deprecated)) was used. Maintainers of consumers aren't necessarily joy(4) users. Was joy(4) deprecation announced on the public mailing lists? For some reason, I can't easily find it in the archives. > You can use the bump to 1300000 as the version to fix it. I didn't bump the > revision because it wasn't needed. poudriere won't force rebuild everything if __FreeBSD_version doesn't change. Expect silence from pkg-fallout@ until the next bump. http://www.ipv6proxy.net/go.php?u=http://beefy12.nyi.freebsd.org/data/latest-per-pkg/sdl/1.2.15_12,2/head-amd64-default.log http://www.ipv6proxy.net/go.php?u=http://beefy12.nyi.freebsd.org/data/latest-per-pkg/plib/1.8.5_7/head-amd64-default.log vs. http://beefy8.nyi.freebsd.org/data/latest-per-pkg/sdl/1.2.15_12,2/head-armv6-default.log http://beefy8.nyi.freebsd.org/data/latest-per-pkg/plib/1.8.5_7/head-armv6-default.log > I posted a patch to the port that makes it compile for me to that thread. > If there's confirmation that it works, i'll work with x11@freebsd.org to > get it pushed in. Or just push it in myself since I'm on that list and I'm > a ports committer. https://codesearch.debian.net/search?q=sys/joystick.h could've been used to guess a few consumers before pkg-fallout@ complains. From owner-svn-src-head@freebsd.org Fri Oct 26 03:44:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D281E10D44E4 for ; Fri, 26 Oct 2018 03:44:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 680E580B9A for ; Fri, 26 Oct 2018 03:44:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x934.google.com with SMTP id g10so3266137uak.5 for ; Thu, 25 Oct 2018 20:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z07UUqUtx+4C7l+zkFUj6P9pKl/0f2MPnx+o4r6VGic=; b=WozOIfwGZV7O+MGqkT++k4lWzefQ34Fcx6ueQxYqla1J6VEyzn5TPI3k1yVKuntwvt UDJZLO9yYaZLup0/LAGXInxAfCUBPJukb42SmmTFqpEBR9fyw/Wq3yJDPawY3ryZ7RVm ISbj65nVzwgeXh3mWAGpwGUr8v3mFRoo8WtuHCi0raFEPE2nhx70m25fLncKAZM5Bdnl X0cpgsGDArtMdWJSyjKaLr2vQJK6741A3e/8hLrMM2eFLxt2n+95OPsggHDLJI7JDt8y 5uq/XbSmEymQ0DZ5zUtNQrgyus1bDDZ9NGNesGfv9REKTDCXAuzu8a/BE3HZRNieV8Sk msbg== 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=Z07UUqUtx+4C7l+zkFUj6P9pKl/0f2MPnx+o4r6VGic=; b=lxQngC/f+CNiyR5UQzQHfuIvWwGFpfDi+dz3TO2xNUO4X2rYX8gJAdIGBrqKDsRJa2 SunGMUvHJXMqgOP1hi7LvK/G3QJh4EwxCULHBwz7400teiBWWOrb0pZW2cUsaiPSVidz qgqeLn9+7p3q21lsVW0kFZLyj6ODX9B4vG0Qw9NS1j567Xa/0LOPZmrVmc3CL/bR8Mzm udYu+oke87Os8Qp77B9id8STwI9RXX7yenhEcauwwrWIbVGtfYTZBHWJVD5HC71oel/V 8i01tZ+lzHgaXCy/bTzsDN5DbNCjFiTPRlqxXN7RRUycoX6l+lmAxYSmGQqJCqyX5gsF JgaA== X-Gm-Message-State: AGRZ1gL0NVM0X4bLur0fyDvNDpJiRjWqQb5sos2Atb1dZBI/ddqCeUX7 C3O63lY0flg8+mdWbFk6TOEElXzzXWzoUtHMsmBbJg== X-Google-Smtp-Source: AJdET5exTgU7rzKYFrzsAqbuBFZAT1+xNAJcgCn/hFxQCCLNPy0Yv4iG+inShscMrJ+3PFSJGgZJG8d7Or0DNeJXhcQ= X-Received: by 2002:ab0:53c3:: with SMTP id l3mr852760uaa.16.1540525477651; Thu, 25 Oct 2018 20:44:37 -0700 (PDT) MIME-Version: 1.0 References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 25 Oct 2018 21:44:24 -0600 Message-ID: Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys To: Jan Beich Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: Fri, 26 Oct 2018 03:44:39 -0000 On Thu, Oct 25, 2018 at 9:30 PM Jan Beich wrote: > Warner Losh writes: > > > On Wed, Oct 24, 2018 at 9:42 AM Jan Beich wrote: > > > >> Warner Losh writes: > >> > >> > Author: imp > >> > Date: Mon Oct 22 02:34:00 2018 > >> > New Revision: 339563 > >> > URL: https://svnweb.freebsd.org/changeset/base/339563 > >> > > >> > Log: > >> > Remove joy(4) driver. > >> > > >> > This driver was marked as gone in 12. We're at 13 now. Remove it. > >> > Data from nycbug's dmesg cache shows only one potential user, > >> > suggesting it never was used much. > >> > > >> > RelNotes: yes > >> > Differential Revision: https://reviews.freebsd.org/D17629 > >> > >> Breaking userland API but not bothering with an exp-run or bumping > >> __FreeBSD_version. > >> Is the following the pointy hat you were looking for? > >> > >> > >> > https://forums.freebsd.org/threads/graphics-freeglut-fails-to-build-sys-joystick-h-not-found.68002/ > > > > > > Your tone is not acceptable. Please try again, only this time with the > > required level of professionalism. I'm not an idiot, and you will treat > me > > with respect. > > Apologies for the snide remark. I've expected someone with ports/ commit > bit > to be a bit more careful. > To be honest, I've never been burned before. It has been a learning lession. > > This driver was flagged for removal in 12 ages ago and the port failed to > > update to take that deprecation into account. > > Not sure what "ages ago" refers to when not even 1 year passed since > r328523. > Neither joy(4) manpage mentioned deprecation nor > __attribute__((deprecated)) > was used. Maintainers of consumers aren't necessarily joy(4) users. > But only joy(4) generates events and supports things described here. And joy(4) hasn't been relevant in this century. I thought this was totally safe. And I've not ever used / seen __attribute__((deprecated)). I will have to start using it. > Was joy(4) deprecation announced on the public mailing lists? For some > reason, > I can't easily find it in the archives. > I thought I had, but I'm not seeing it in my archives. > > You can use the bump to 1300000 as the version to fix it. I didn't bump > the > > revision because it wasn't needed. > > poudriere won't force rebuild everything if __FreeBSD_version doesn't > change. > Right. OK. I was not aware of that. > Expect silence from pkg-fallout@ until the next bump. > There was one earlier today. > > http://www.ipv6proxy.net/go.php?u=http://beefy12.nyi.freebsd.org/data/latest-per-pkg/sdl/1.2.15_12,2/head-amd64-default.log > > http://www.ipv6proxy.net/go.php?u=http://beefy12.nyi.freebsd.org/data/latest-per-pkg/plib/1.8.5_7/head-amd64-default.log > > vs. > > > http://beefy8.nyi.freebsd.org/data/latest-per-pkg/sdl/1.2.15_12,2/head-armv6-default.log > > http://beefy8.nyi.freebsd.org/data/latest-per-pkg/plib/1.8.5_7/head-armv6-default.log Yea, that's more extensive than I'd expected. > I posted a patch to the port that makes it compile for me to that thread. > > If there's confirmation that it works, i'll work with x11@freebsd.org to > > get it pushed in. Or just push it in myself since I'm on that list and > I'm > > a ports committer. > > https://codesearch.debian.net/search?q=sys/joystick.h could've been used > to guess a few consumers before pkg-fallout@ complains. > True. Most of them are bogus, but many are not. Given the number, I'm going to add sys/joystick.h back and bump the __FreeBSD_version and learn from my mistake. Warner From owner-svn-src-head@freebsd.org Fri Oct 26 03:59:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC84C10D4C01; Fri, 26 Oct 2018 03:59: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6312981514; Fri, 26 Oct 2018 03:59: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 263341B9C2; Fri, 26 Oct 2018 03:59: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 w9Q3xZ2e061775; Fri, 26 Oct 2018 03:59:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q3xZFQ061774; Fri, 26 Oct 2018 03:59:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810260359.w9Q3xZFQ061774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 03:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339761 - head/sys/dev/joy X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/joy X-SVN-Commit-Revision: 339761 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, 26 Oct 2018 03:59:36 -0000 Author: imp Date: Fri Oct 26 03:59:35 2018 New Revision: 339761 URL: https://svnweb.freebsd.org/changeset/base/339761 Log: Put sys/dev/joy back for the moment Added: head/sys/dev/joy/ From owner-svn-src-head@freebsd.org Fri Oct 26 04:05:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A06710D4F9F; Fri, 26 Oct 2018 04:05: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EA3D81A0E; Fri, 26 Oct 2018 04:05:49 +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 052301BB5E; Fri, 26 Oct 2018 04:05:49 +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 w9Q45miL066907; Fri, 26 Oct 2018 04:05:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q45muC066906; Fri, 26 Oct 2018 04:05:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810260405.w9Q45muC066906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 04:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339762 - head/sys/modules/joy X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/joy X-SVN-Commit-Revision: 339762 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, 26 Oct 2018 04:05:49 -0000 Author: imp Date: Fri Oct 26 04:05:48 2018 New Revision: 339762 URL: https://svnweb.freebsd.org/changeset/base/339762 Log: add modules/joy before revert of r339563 Added: head/sys/modules/joy/ From owner-svn-src-head@freebsd.org Fri Oct 26 04:10:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81D7110D50E1; Fri, 26 Oct 2018 04:10: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C07081C06; Fri, 26 Oct 2018 04:10: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 0E4911BB69; Fri, 26 Oct 2018 04:10: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 w9Q4AZTX067209; Fri, 26 Oct 2018 04:10:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q4AWWw067194; Fri, 26 Oct 2018 04:10:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810260410.w9Q4AWWw067194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 04:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339763 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys X-SVN-Commit-Revision: 339763 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, 26 Oct 2018 04:10:35 -0000 Author: imp Date: Fri Oct 26 04:10:32 2018 New Revision: 339763 URL: https://svnweb.freebsd.org/changeset/base/339763 Log: Revert r339563. I held the mistaken belief this was completely unused. While the driver is unused and likely not relevant for a long time, sys/joystick.h lives on in maybe half a dozen ports, even though hardware to use it hasn't been widely used in maybe 15 years. Added: head/share/man/man4/joy.4 - copied unchanged from r339562, head/share/man/man4/joy.4 head/sys/dev/joy/joy.c - copied unchanged from r339562, head/sys/dev/joy/joy.c head/sys/dev/joy/joy_isa.c - copied unchanged from r339562, head/sys/dev/joy/joy_isa.c head/sys/dev/joy/joyvar.h - copied unchanged from r339562, head/sys/dev/joy/joyvar.h head/sys/modules/joy/Makefile - copied unchanged from r339562, head/sys/modules/joy/Makefile head/sys/sys/joystick.h - copied unchanged from r339562, head/sys/sys/joystick.h head/tools/kerneldoc/subsys/Doxyfile-dev_joy - copied unchanged from r339562, head/tools/kerneldoc/subsys/Doxyfile-dev_joy Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 26 04:05:48 2018 (r339762) +++ head/ObsoleteFiles.inc Fri Oct 26 04:10:32 2018 (r339763) @@ -45,9 +45,6 @@ OLD_LIBS+=usr/lib32/libcrypto.so.9 OLD_LIBS+=usr/lib32/libssl.so.9 # 20181021: mse(4) removal OLD_FILES+=usr/share/man/man4/mse.4.gz -# 20181021: joy(4) removal -OLD_FILES+=usr/share/man/man4/joy.4.gz -OLD_FILES+=usr/include/sys/joystick.h # 20181015: Stale libcasper(3) files following r329452 OLD_LIBS+=lib/casper/libcap_sysctl.so.0 OLD_LIBS+=lib/casper/libcap_grp.so.0 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Oct 26 04:05:48 2018 (r339762) +++ head/share/man/man4/Makefile Fri Oct 26 04:10:32 2018 (r339763) @@ -239,6 +239,7 @@ MAN= aac.4 \ ixl.4 \ jedec_dimm.4 \ jme.4 \ + joy.4 \ kbdmux.4 \ keyboard.4 \ kld.4 \ Copied: head/share/man/man4/joy.4 (from r339562, head/share/man/man4/joy.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/joy.4 Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/share/man/man4/joy.4) @@ -0,0 +1,119 @@ +.\" +.\" $FreeBSD$ +.\" +.Dd January 23, 1995 +.Dt JOY 4 +.Os +.Sh NAME +.Nm joy +.Nd joystick device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device joy" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +joy_load="YES" +.Ed +.Pp +In +.Pa /boot/device.hints : +.Cd hint.joy.0.at="isa" +.Cd hint.joy.0.port="0x201" +.Cd hint.joy.1.at="isa" +.Cd hint.joy.1.port="0x201" +.Pp +.In sys/joystick.h +.Sh DESCRIPTION +The joystick device driver allows applications to read the status of +the PC joystick. +.Pp +This device may be opened by only one process at a time. +.Pp +The joystick status is read from a structure via a read() +call. +The structure is defined in the header file as follows: +.Bd -literal -offset indent + struct joystick { + int x; /* x position */ + int y; /* y position */ + int b1; /* button 1 status */ + int b2; /* button 2 status */ + }; +.Ed +.Pp +Positions are typically in the range 0-2000. +.Ss One line perl example: +.Bd -literal -compact +perl -e 'open(JOY,"/dev/joy0")||die;while(1) +{sysread(JOY,$x,16);@j=unpack("iiii",$x);print "@j\\n";sleep(1);}' +.Ed +.Ss ioctl calls +Several ioctl() calls are also available. +They take an argument of +type int * +.Bl -tag -width JOY_SET_X_OFFSET +.It Dv JOY_SETTIMEOUT Fa int *limit +Set the time limit (in microseconds) for reading the joystick +status. +Setting a value +too small may prevent to get correct values for the positions (which +are then set to -2147483648), however this can be useful if one is +only interested by the buttons status. +.It Dv JOY_GETTIMEOUT Fa int *limit +Get the time limit (in microseconds) used for reading the joystick +status. +.It Dv JOY_SET_X_OFFSET Fa int *offset +Set the value to be added to the X position when reading the joystick +status. +.It Dv JOY_SET_Y_OFFSET Fa int *offset +Set the value to be added to the Y position when reading the joystick +status. +.It Dv JOY_GET_X_OFFSET Fa int *offset +Get the value which is added to the X position when reading the joystick +status. +.It Dv JOY_GET_Y_OFFSET Fa int *offset +Get the value which is added to the Y position when reading the joystick +status. +.El +.Sh TECHNICAL SPECIFICATIONS +The pinout of the DB-15 connector is as follow: +.Bd -literal + 1 XY1 (+5v) + 2 Switch 1 + 3 X1 (potentiometer #1) + 4 Switch 1 (GND) + 5 Switch 2 (GND) + 6 Y1 (potentiometer #2) + 7 Switch 2 + 8 N.C. + 9 XY2 (+5v) + 10 Switch 4 + 11 X2 (potentiometer #3) + 12 Switch 3&4 (GND) + 13 Y2 (potentiometer #4) + 14 Switch 3 + 15 N.C. +.Ed +.Pp +Pots are normally 0-150k variable resistors (0-100k sometimes), and +according to the IBM technical reference, the time is given by +Time = 24.2e-6s + 0.011e-6s * R/Ohms +.Sh FILES +.Bl -tag -width /dev/joy? +.It Pa /dev/joy? +joystick device files +.El +.Sh HISTORY +The +.Nm +driver appeared in +.Fx 2.0.5 . +.Sh AUTHORS +.An Jean-Marc Zucconi Aq Mt jmz@cabri.obs-besancon.fr Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Oct 26 04:05:48 2018 (r339762) +++ head/sys/conf/NOTES Fri Oct 26 04:10:32 2018 (r339763) @@ -2313,8 +2313,12 @@ options SND_OLDSTEREO # Miscellaneous hardware: # # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board +# joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader +device joy # PnP aware, hints for non-PnP only +hint.joy.0.at="isa" +hint.joy.0.port="0x201" device cmx # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 26 04:05:48 2018 (r339762) +++ head/sys/conf/files Fri Oct 26 04:10:32 2018 (r339763) @@ -2294,6 +2294,8 @@ dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv ine compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jedec_dimm/jedec_dimm.c optional jedec_dimm smbus dev/jme/if_jme.c optional jme pci +dev/joy/joy.c optional joy +dev/joy/joy_isa.c optional joy isa dev/kbd/kbd.c optional atkbd | pckbd | sc | ukbd | vt dev/kbdmux/kbdmux.c optional kbdmux dev/ksyms/ksyms.c optional ksyms Copied: head/sys/dev/joy/joy.c (from r339562, head/sys/dev/joy/joy.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/joy/joy.c Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/sys/dev/joy/joy.c) @@ -0,0 +1,251 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1995 Jean-Marc Zucconi + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The game port can manage 4 buttons and 4 variable resistors (usually 2 + * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201. + * Getting the state of the buttons is done by reading the game port: + * buttons 1-4 correspond to bits 4-7 and resistors 1-4 (X1, Y1, X2, Y2) + * to bits 0-3. + * if button 1 (resp 2, 3, 4) is pressed, the bit 4 (resp 5, 6, 7) is set to 0 + * to get the value of a resistor, write the value 0xff at port and + * wait until the corresponding bit returns to 0. + */ + +#define joypart(d) (dev2unit(d)&1) +#ifndef JOY_TIMEOUT +#define JOY_TIMEOUT 2000 /* 2 milliseconds */ +#endif + +static d_open_t joyopen; +static d_close_t joyclose; +static d_read_t joyread; +static d_ioctl_t joyioctl; + +static struct cdevsw joy_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDGIANT, + .d_open = joyopen, + .d_close = joyclose, + .d_read = joyread, + .d_ioctl = joyioctl, + .d_name = "joy", +}; + +devclass_t joy_devclass; + +int +joy_probe(device_t dev) +{ +#ifdef WANT_JOYSTICK_CONNECTED +#ifdef notyet + outb(dev->id_iobase, 0xff); + DELAY(10000); /* 10 ms delay */ + return (inb(dev->id_iobase) & 0x0f) != 0x0f; +#else + return (0); +#endif +#else + return (0); +#endif +} + +int +joy_attach(device_t dev) +{ + int unit = device_get_unit(dev); + struct joy_softc *joy = device_get_softc(dev); + + joy->rid = 0; + joy->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &joy->rid, + RF_ACTIVE|RF_SHAREABLE); + if (joy->res == NULL) + return ENXIO; + joy->bt = rman_get_bustag(joy->res); + joy->port = rman_get_bushandle(joy->res); + joy->timeout[0] = joy->timeout[1] = 0; + joy->d = make_dev(&joy_cdevsw, unit, 0, 0, 0600, "joy%d", unit); + joy->d->si_drv1 = joy; + gone_in_dev(dev, 12, "joy(4) driver"); + + return (0); +} + +int +joy_detach(device_t dev) +{ + struct joy_softc *joy = device_get_softc(dev); + + if (joy->res != NULL) + bus_release_resource(dev, SYS_RES_IOPORT, joy->rid, joy->res); + if (joy->d) + destroy_dev(joy->d); + return (0); +} + + +static int +joyopen(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + int i = joypart (dev); + struct joy_softc *joy = dev->si_drv1; + + if (joy->timeout[i]) + return (EBUSY); + joy->x_off[i] = joy->y_off[i] = 0; + joy->timeout[i] = JOY_TIMEOUT; + return (0); +} + +static int +joyclose(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + int i = joypart (dev); + struct joy_softc *joy = dev->si_drv1; + + joy->timeout[i] = 0; + return (0); +} + +static int +joyread(struct cdev *dev, struct uio *uio, int flag) +{ + struct joy_softc *joy = dev->si_drv1; + bus_space_handle_t port = joy->port; + bus_space_tag_t bt = joy->bt; + struct timespec t, start, end; + int state = 0; + struct timespec x, y; + struct joystick c; +#ifndef __i386__ + int s; + + s = splhigh(); +#else + disable_intr (); +#endif + nanotime(&t); + end.tv_sec = 0; + end.tv_nsec = joy->timeout[joypart(dev)] * 1000; + timespecadd(&end, &t, &end); + for (; timespeccmp(&t, &end, <) && (bus_space_read_1(bt, port, 0) & 0x0f); nanotime(&t)) + ; /* nothing */ + bus_space_write_1 (bt, port, 0, 0xff); + nanotime(&start); + end.tv_sec = 0; + end.tv_nsec = joy->timeout[joypart(dev)] * 1000; + timespecadd(&end, &start, &end); + t = start; + timespecclear(&x); + timespecclear(&y); + while (timespeccmp(&t, &end, <)) { + state = bus_space_read_1 (bt, port, 0); + if (joypart(dev) == 1) + state >>= 2; + nanotime(&t); + if (!timespecisset(&x) && !(state & 0x01)) + x = t; + if (!timespecisset(&y) && !(state & 0x02)) + y = t; + if (timespecisset(&x) && timespecisset(&y)) + break; + } +#ifndef __i386__ + splx(s); +#else + enable_intr (); +#endif + if (timespecisset(&x)) { + timespecsub(&x, &start, &x); + c.x = joy->x_off[joypart(dev)] + x.tv_nsec / 1000; + } else + c.x = 0x80000000; + if (timespecisset(&y)) { + timespecsub(&y, &start, &y); + c.y = joy->y_off[joypart(dev)] + y.tv_nsec / 1000; + } else + c.y = 0x80000000; + state >>= 4; + c.b1 = ~state & 1; + c.b2 = ~(state >> 1) & 1; + return (uiomove((caddr_t)&c, sizeof(struct joystick), uio)); +} + +static int +joyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) +{ + struct joy_softc *joy = dev->si_drv1; + int i = joypart (dev); + int x; + + switch (cmd) { + case JOY_SETTIMEOUT: + x = *(int *) data; + if (x < 1 || x > 10000) /* 10ms maximum! */ + return EINVAL; + joy->timeout[i] = x; + break; + case JOY_GETTIMEOUT: + *(int *) data = joy->timeout[i]; + break; + case JOY_SET_X_OFFSET: + joy->x_off[i] = *(int *) data; + break; + case JOY_SET_Y_OFFSET: + joy->y_off[i] = *(int *) data; + break; + case JOY_GET_X_OFFSET: + *(int *) data = joy->x_off[i]; + break; + case JOY_GET_Y_OFFSET: + *(int *) data = joy->y_off[i]; + break; + default: + return (ENOTTY); + } + return (0); +} Copied: head/sys/dev/joy/joy_isa.c (from r339562, head/sys/dev/joy/joy_isa.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/joy/joy_isa.c Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/sys/dev/joy/joy_isa.c) @@ -0,0 +1,88 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1995 Jean-Marc Zucconi + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "isa_if.h" + +static int joy_isa_probe (device_t); + +static struct isa_pnp_id joy_ids[] = { + {0x0100630e, "CSC0001 PnP Joystick"}, /* CSC0001 */ + {0x0101630e, "CSC0101 PnP Joystick"}, /* CSC0101 */ + {0x01100002, "ALS0110 PnP Joystick"}, /* @P@1001 */ + {0x01200002, "ALS0120 PnP Joystick"}, /* @P@2001 */ + {0x01007316, "ESS0001 PnP Joystick"}, /* ESS0001 */ + {0x2fb0d041, "Generic PnP Joystick"}, /* PNPb02f */ + {0x2200a865, "YMH0022 PnP Joystick"}, /* YMH0022 */ + {0x82719304, NULL}, /* ADS7182 */ + {0} +}; + +static int +joy_isa_probe(device_t dev) +{ + if (ISA_PNP_PROBE(device_get_parent(dev), dev, joy_ids) == ENXIO) + return ENXIO; + return (joy_probe(dev)); +} + +static device_method_t joy_methods[] = { + DEVMETHOD(device_probe, joy_isa_probe), + DEVMETHOD(device_attach, joy_attach), + DEVMETHOD(device_detach, joy_detach), + { 0, 0 } +}; + +static driver_t joy_isa_driver = { + "joy", + joy_methods, + sizeof (struct joy_softc) +}; + +DRIVER_MODULE(joy, isa, joy_isa_driver, joy_devclass, 0, 0); +DRIVER_MODULE(joy, acpi, joy_isa_driver, joy_devclass, 0, 0); +ISA_PNP_INFO(joy_ids); Copied: head/sys/dev/joy/joyvar.h (from r339562, head/sys/dev/joy/joyvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/joy/joyvar.h Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/sys/dev/joy/joyvar.h) @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1995 Jean-Marc Zucconi + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +struct joy_softc { + bus_space_tag_t bt; + bus_space_handle_t port; + int x_off[2], y_off[2]; + int timeout[2]; + struct resource *res; + int rid; + struct cdev *d; +}; + +int joy_probe(device_t); +int joy_attach(device_t); +int joy_detach(device_t); + +extern devclass_t joy_devclass; Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Oct 26 04:05:48 2018 (r339762) +++ head/sys/modules/Makefile Fri Oct 26 04:10:32 2018 (r339763) @@ -205,6 +205,7 @@ SUBDIR= \ ${_ixv} \ ${_ixl} \ jme \ + joy \ kbdmux \ kgssapi \ kgssapi_krb5 \ Copied: head/sys/modules/joy/Makefile (from r339562, head/sys/modules/joy/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/joy/Makefile Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/sys/modules/joy/Makefile) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/joy + +KMOD= joy +SRCS= bus_if.h device_if.h isa_if.h joy.c joy_isa.c + +.include Copied: head/sys/sys/joystick.h (from r339562, head/sys/sys/joystick.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/joystick.h Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/sys/sys/joystick.h) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1995 Jean-Marc Zucconi + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_JOYSTICK_H_ +#define _SYS_JOYSTICK_H_ + +#include + +struct joystick { + int x; + int y; + int b1; + int b2; +}; + +#define JOY_SETTIMEOUT _IOW('J', 1, int) /* set timeout */ +#define JOY_GETTIMEOUT _IOR('J', 2, int) /* get timeout */ +#define JOY_SET_X_OFFSET _IOW('J', 3, int) /* set offset on X-axis */ +#define JOY_SET_Y_OFFSET _IOW('J', 4, int) /* set offset on Y-axis */ +#define JOY_GET_X_OFFSET _IOR('J', 5, int) /* get offset on X-axis */ +#define JOY_GET_Y_OFFSET _IOR('J', 6, int) /* get offset on Y-axis */ + +#endif /* !_SYS_JOYSTICK_H_ */ Copied: head/tools/kerneldoc/subsys/Doxyfile-dev_joy (from r339562, head/tools/kerneldoc/subsys/Doxyfile-dev_joy) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_joy Fri Oct 26 04:10:32 2018 (r339763, copy of r339562, head/tools/kerneldoc/subsys/Doxyfile-dev_joy) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel JOY device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_joy/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/joy/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_joy/dev_joy.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + From owner-svn-src-head@freebsd.org Fri Oct 26 04:11:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5DC410D5404; Fri, 26 Oct 2018 04:11: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1B4827D1; Fri, 26 Oct 2018 04:11: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 66EBD1BCDC; Fri, 26 Oct 2018 04:11: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 w9Q4BwLM071951; Fri, 26 Oct 2018 04:11:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q4Bw60071950; Fri, 26 Oct 2018 04:11:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810260411.w9Q4Bw60071950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 04:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339764 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339764 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, 26 Oct 2018 04:11:58 -0000 Author: imp Date: Fri Oct 26 04:11:58 2018 New Revision: 339764 URL: https://svnweb.freebsd.org/changeset/base/339764 Log: Add warning to sys/joystick.h announcing its planned demise. Modified: head/sys/sys/joystick.h Modified: head/sys/sys/joystick.h ============================================================================== --- head/sys/sys/joystick.h Fri Oct 26 04:10:32 2018 (r339763) +++ head/sys/sys/joystick.h Fri Oct 26 04:11:58 2018 (r339764) @@ -49,4 +49,6 @@ struct joystick { #define JOY_GET_X_OFFSET _IOR('J', 5, int) /* get offset on X-axis */ #define JOY_GET_Y_OFFSET _IOR('J', 6, int) /* get offset on Y-axis */ +#warning "This interface is for obsolete hardware and will be removed in FreeBSD 13" + #endif /* !_SYS_JOYSTICK_H_ */ From owner-svn-src-head@freebsd.org Fri Oct 26 04:13:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4750310D55F1; Fri, 26 Oct 2018 04:13:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7AB382A44; Fri, 26 Oct 2018 04:13:56 +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 C8DCC1BD0D; Fri, 26 Oct 2018 04:13:56 +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 w9Q4DujZ072077; Fri, 26 Oct 2018 04:13:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q4DuS3072075; Fri, 26 Oct 2018 04:13:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810260413.w9Q4DuS3072075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 04:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339765 - in head/sys: modules sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: modules sys X-SVN-Commit-Revision: 339765 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, 26 Oct 2018 04:13:57 -0000 Author: imp Date: Fri Oct 26 04:13:56 2018 New Revision: 339765 URL: https://svnweb.freebsd.org/changeset/base/339765 Log: Bump to 1300002 for sys/joystick.h removal reversion. Modified: head/sys/modules/Makefile head/sys/sys/param.h Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Oct 26 04:11:58 2018 (r339764) +++ head/sys/modules/Makefile Fri Oct 26 04:13:56 2018 (r339765) @@ -205,7 +205,6 @@ SUBDIR= \ ${_ixv} \ ${_ixl} \ jme \ - joy \ kbdmux \ kgssapi \ kgssapi_krb5 \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Oct 26 04:11:58 2018 (r339764) +++ head/sys/sys/param.h Fri Oct 26 04:13:56 2018 (r339765) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300001 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300002 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Oct 26 04:53:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43FE10D64A1; Fri, 26 Oct 2018 04:53:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 850A683CD8; Fri, 26 Oct 2018 04:53:30 +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 6187C1C3B5; Fri, 26 Oct 2018 04:53:30 +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 w9Q4rUii092851; Fri, 26 Oct 2018 04:53:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q4rUiW092850; Fri, 26 Oct 2018 04:53:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810260453.w9Q4rUiW092850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 04:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339766 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339766 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, 26 Oct 2018 04:53:31 -0000 Author: imp Date: Fri Oct 26 04:53:29 2018 New Revision: 339766 URL: https://svnweb.freebsd.org/changeset/base/339766 Log: Remove #warning since it breaks libsysdecode Modified: head/sys/sys/joystick.h Modified: head/sys/sys/joystick.h ============================================================================== --- head/sys/sys/joystick.h Fri Oct 26 04:13:56 2018 (r339765) +++ head/sys/sys/joystick.h Fri Oct 26 04:53:29 2018 (r339766) @@ -49,6 +49,4 @@ struct joystick { #define JOY_GET_X_OFFSET _IOR('J', 5, int) /* get offset on X-axis */ #define JOY_GET_Y_OFFSET _IOR('J', 6, int) /* get offset on Y-axis */ -#warning "This interface is for obsolete hardware and will be removed in FreeBSD 13" - #endif /* !_SYS_JOYSTICK_H_ */ From owner-svn-src-head@freebsd.org Fri Oct 26 05:25:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E4510D712F; Fri, 26 Oct 2018 05:25:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80FEE84AB7; Fri, 26 Oct 2018 05:25:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D6A31C8A3; Fri, 26 Oct 2018 05:25:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q5PN7w008453; Fri, 26 Oct 2018 05:25:23 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q5PNxw008452; Fri, 26 Oct 2018 05:25:23 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810260525.w9Q5PNxw008452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 05:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339768 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339768 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, 26 Oct 2018 05:25:24 -0000 Author: dteske Date: Fri Oct 26 05:25:22 2018 New Revision: 339768 URL: https://svnweb.freebsd.org/changeset/base/339768 Log: Adjust bsdinstall zfsboot code to 80-columns and whitespace fixes No functional changes. Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Fri Oct 26 05:12:56 2018 (r339767) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Fri Oct 26 05:25:22 2018 (r339768) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2013-2016 Allan Jude -# Copyright (c) 2013-2015 Devin Teske +# Copyright (c) 2013-2018 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -627,7 +627,7 @@ dialog_menu_layout() # Not enough disks selected f_dprintf "$funcname: %s: %s (%u < %u minimum)" \ "$ZFSBOOT_VDEV_TYPE" \ - "Not enough disks selected." \ + "Not enough disks selected." \ $ndisks $want_disks f_interactive || return $FAILURE msg_yes="$msg_change_selection" msg_no="$msg_cancel" \ @@ -843,15 +843,17 @@ zfs_create_diskpart() # # 2. Add small freebsd-boot and/or efi partition # - if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then + if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o \ + "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ] + then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_small" efiboot$index efi 200M \ - $disk || - return $FAILURE + $disk || return $FAILURE f_eval_catch $funcname mkdir "$MKDIR_P" \ - "$BSDINSTALL_TMPETC/esp" || return $FAILURE + "$BSDINSTALL_TMPETC/esp" || + return $FAILURE f_eval_catch $funcname newfs_msdos "$NEWFS_ESP" "16" \ "EFISYS" "/dev/${disk}p1" || return $FAILURE @@ -874,19 +876,23 @@ zfs_create_diskpart() return $FAILURE fi - if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ]; then + if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o \ + "$ZFSBOOT_BOOT_TYPE" = "BIOS+UEFI" ] + then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ - "$align_small" gptboot$index freebsd-boot \ - 512k $disk || return $FAILURE + "$align_small" gptboot$index \ + freebsd-boot 512k $disk || return $FAILURE if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" ]; then - f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 1 $disk || - return $FAILURE + f_eval_catch $funcname gpart \ + "$GPART_BOOTCODE_PART" \ + /boot/pmbr /boot/gptzfsboot 1 \ + $disk || return $FAILURE else - f_eval_catch $funcname gpart "$GPART_BOOTCODE_PART" \ - /boot/pmbr /boot/gptzfsboot 2 $disk || - return $FAILURE + f_eval_catch $funcname gpart \ + "$GPART_BOOTCODE_PART" \ + /boot/pmbr /boot/gptzfsboot 2 \ + $disk || return $FAILURE fi fi @@ -918,8 +924,7 @@ zfs_create_diskpart() f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_big" boot$index freebsd-zfs \ - ${bootsize}b $disk || - return $FAILURE + ${bootsize}b $disk || return $FAILURE # Pedantically nuke any old labels f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/$disk$bootpart @@ -938,8 +943,7 @@ zfs_create_diskpart() f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ "$align_big" swap$index freebsd-swap \ - ${swapsize}b $disk || - return $FAILURE + ${swapsize}b $disk || return $FAILURE # Pedantically nuke any old labels on the swap f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/$disk$swappart @@ -971,9 +975,8 @@ zfs_create_diskpart() # # 2. Add freebsd slice with all available space # - f_eval_catch $funcname gpart "$GPART_ADD_ALIGN" "$align_small" \ - freebsd $disk || - return $FAILURE + f_eval_catch $funcname gpart "$GPART_ADD_ALIGN" \ + "$align_small" freebsd $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_SET_ACTIVE" 1 $disk || return $FAILURE # Pedantically nuke any old labels @@ -1016,8 +1019,8 @@ zfs_create_diskpart() if [ ${swapsize:-0} -gt 0 ]; then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_INDEX_WITH_SIZE" \ - "$align_small" 2 freebsd-swap ${swapsize}b ${disk}s1 || - return $FAILURE + "$align_small" 2 freebsd-swap \ + ${swapsize}b ${disk}s1 || return $FAILURE # Pedantically nuke any old labels on the swap f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/${disk}s1b @@ -1027,7 +1030,8 @@ zfs_create_diskpart() # 5. Add freebsd-zfs partition for zroot # f_eval_catch $funcname gpart "$GPART_ADD_ALIGN_INDEX" \ - "$align_small" $mbrindex freebsd-zfs ${disk}s1 || return $FAILURE + "$align_small" $mbrindex freebsd-zfs ${disk}s1 || + return $FAILURE f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/$disk$targetpart # Pedantic f_eval_catch $funcname dd "$DD_WITH_OPTIONS" \ @@ -1047,25 +1051,21 @@ zfs_create_diskpart() elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/mirror/swap.eli none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE isswapmirror=1 elif [ "$ZFSBOOT_SWAP_MIRROR" ]; then f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/mirror/swap none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE isswapmirror=1 elif [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/$disk${swappart}.eli none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE else f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/$disk$swappart none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE + $BSDINSTALL_TMPETC/fstab || return $FAILURE fi return $SUCCESS @@ -1272,8 +1272,8 @@ zfs_create_boot() # the key files, use only a password if ! echo "$pw_password" | f_eval_catch \ $funcname geli \ - "$GELI_PASSWORD_GELIBOOT_INIT" AES-XTS \ - $disk$targetpart + "$GELI_PASSWORD_GELIBOOT_INIT" \ + AES-XTS $disk$targetpart then f_interactive || f_die unset pw_password # Sensitive info @@ -1326,8 +1326,7 @@ zfs_create_boot() done f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ - "$zroot_name" "" "$raid10_vdevs" || - return $FAILURE + "$zroot_name" "" "$raid10_vdevs" || return $FAILURE else f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ @@ -1366,8 +1365,7 @@ zfs_create_boot() # f_dprintf "$funcname: Setting mountpoint for root of the pool..." f_eval_catch $funcname zfs "$ZFS_SET" \ - "mountpoint=/$zroot_name" "$zroot_name" || - return $FAILURE + "mountpoint=/$zroot_name" "$zroot_name" || return $FAILURE # Touch up permissions on the tmp directories f_dprintf "$funcname: Modifying directory permissions..." @@ -1409,11 +1407,12 @@ zfs_create_boot() # Re-import the ZFS pool(s) f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || - return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$zroot_name" || return $FAILURE if [ "$ZFSBOOT_BOOT_POOL" ]; then # Import the bootpool, but do not mount it yet - f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ + f_eval_catch $funcname zpool \ + "$ZPOOL_IMPORT_WITH_OPTIONS" \ "-o altroot=\"$BSDINSTALL_CHROOT\" -N" \ "$bootpool_name" || return $FAILURE fi @@ -1438,12 +1437,13 @@ zfs_create_boot() if [ "$ZFSBOOT_BOOT_POOL" ]; then f_eval_catch $funcname printf "$PRINTF_CONF" \ - vfs.root.mountfrom "\"zfs:$zroot_name/$zroot_bootfs\"" \ + vfs.root.mountfrom \ + "\"zfs:$zroot_name/$zroot_bootfs\"" \ $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE fi # - # Set canmount=noauto so that the default Boot Environment (BE) does not - # get mounted if a different BE is selected from the beastie menu + # Set canmount=noauto so that the default Boot Environment (BE) does + # not get mounted if a different BE is selected from the beastie menu # f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ @@ -1729,10 +1729,14 @@ while :; do ;; ?" $msg_partition_scheme") # Toggle between GPT (BIOS), GPT (UEFI) and MBR - if [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a "$ZFSBOOT_BOOT_TYPE" = "BIOS" ]; then + if [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a \ + "$ZFSBOOT_BOOT_TYPE" = "BIOS" ] + then ZFSBOOT_PARTITION_SCHEME="GPT" ZFSBOOT_BOOT_TYPE="UEFI" - elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a "$ZFSBOOT_BOOT_TYPE" = "UEFI" ]; then + elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" -a \ + "$ZFSBOOT_BOOT_TYPE" = "UEFI" ] + then ZFSBOOT_PARTITION_SCHEME="GPT" ZFSBOOT_BOOT_TYPE="BIOS+UEFI" elif [ "$ZFSBOOT_PARTITION_SCHEME" = "GPT" ]; then From owner-svn-src-head@freebsd.org Fri Oct 26 08:12:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7F0210DB0C3; Fri, 26 Oct 2018 08:12:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E74A6BD86; Fri, 26 Oct 2018 08:12:29 +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 5F9301E41B; Fri, 26 Oct 2018 08:12:29 +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 w9Q8CTvO094871; Fri, 26 Oct 2018 08:12:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q8CS3L094868; Fri, 26 Oct 2018 08:12:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810260812.w9Q8CS3L094868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 26 Oct 2018 08:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339770 - in head/lib/csu/tests: . dynamic static X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/lib/csu/tests: . dynamic static X-SVN-Commit-Revision: 339770 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, 26 Oct 2018 08:12:30 -0000 Author: andrew Date: Fri Oct 26 08:12:28 2018 New Revision: 339770 URL: https://svnweb.freebsd.org/changeset/base/339770 Log: Drop the csu tests WARNS to 5 to fix the powerpc64 build. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/tests/Makefile.tests head/lib/csu/tests/dynamic/Makefile head/lib/csu/tests/static/Makefile Modified: head/lib/csu/tests/Makefile.tests ============================================================================== --- head/lib/csu/tests/Makefile.tests Fri Oct 26 06:12:56 2018 (r339769) +++ head/lib/csu/tests/Makefile.tests Fri Oct 26 08:12:28 2018 (r339770) @@ -4,6 +4,8 @@ ATF_TESTS_C+= init_test ATF_TESTS_C+= fini_test ATF_TESTS_CXX+= cxx_constructors +WARNS?= 5 + .if exists(${.CURDIR:H:H}/${MACHINE_ARCH}) CFLAGS+= -I${.CURDIR:H:H}/${MACHINE_ARCH} .else Modified: head/lib/csu/tests/dynamic/Makefile ============================================================================== --- head/lib/csu/tests/dynamic/Makefile Fri Oct 26 06:12:56 2018 (r339769) +++ head/lib/csu/tests/dynamic/Makefile Fri Oct 26 08:12:28 2018 (r339770) @@ -1,7 +1,6 @@ # $FreeBSD$ .PATH: ${.CURDIR:H} -WARNS?= 6 .include "../Makefile.tests" .include Modified: head/lib/csu/tests/static/Makefile ============================================================================== --- head/lib/csu/tests/static/Makefile Fri Oct 26 06:12:56 2018 (r339769) +++ head/lib/csu/tests/static/Makefile Fri Oct 26 08:12:28 2018 (r339770) @@ -2,7 +2,6 @@ .PATH: ${.CURDIR:H} NO_SHARED= -WARNS?= 6 .include "../Makefile.tests" .include From owner-svn-src-head@freebsd.org Fri Oct 26 08:28:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4299B10DB837; Fri, 26 Oct 2018 08:28:01 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id D6C9A6C40C; Fri, 26 Oct 2018 08:28:00 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [IPv6:2a02:c7f:1e13:cf00:5cb7:507:fbd1:e97a] (unknown [IPv6:2a02:c7f:1e13:cf00:5cb7:507:fbd1:e97a]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 5F9F14EBE7; Fri, 26 Oct 2018 08:27:22 +0000 (UTC) From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339738 - in head: gnu/lib lib/csu lib/csu/aarch64 lib/csu/amd64 lib/csu/common lib/csu/i386 lib/csu/powerpc64 lib/csu/tests lib/csu/tests/dynamic lib/csu/tests/static share/mk tools/bu... Date: Fri, 26 Oct 2018 09:27:20 +0100 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Kyle Evans References: <201810251739.w9PHdfc7041441@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.9.1) Content-Type: text/plain; charset=us-ascii 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: Fri, 26 Oct 2018 08:28:01 -0000 > On 26 Oct 2018, at 03:40, Kyle Evans wrote: >=20 > On Thu, Oct 25, 2018 at 12:40 PM Andrew Turner > wrote: >>=20 >> Author: andrew >> Date: Thu Oct 25 17:39:41 2018 >> New Revision: 339738 >> URL: https://svnweb.freebsd.org/changeset/base/339738 >>=20 >> Log: >> Implement a BSD licensed crtbegin/crtend >>=20 >> These are needed for .ctors/.dtors and .jcr handling. The former = needs >> all the function pointers to be called in the correct order from the >> .init/.fini section. The latter just needs to call a gcj specific = function >> if it exists with a pointer to the start of the .jcr section. >>=20 >> This is currently disabled until __dso_handle support is added. >>=20 >> Reviewed by: emaste >> MFC after: 1 month >> Sponsored by: DARPA, AFRL >> Differential Revision: https://reviews.freebsd.org/D17587 >>=20 >> Added: >> head/lib/csu/aarch64/crt.h (contents, props changed) >> head/lib/csu/amd64/crt.h (contents, props changed) >> head/lib/csu/common/crtbegin.c (contents, props changed) >> head/lib/csu/common/crtend.c (contents, props changed) >> head/lib/csu/i386/crt.h (contents, props changed) >> head/lib/csu/powerpc64/crt.h (contents, props changed) >> head/lib/csu/tests/ >> head/lib/csu/tests/Makefile (contents, props changed) >> head/lib/csu/tests/Makefile.inc (contents, props changed) >> head/lib/csu/tests/Makefile.tests (contents, props changed) >> head/lib/csu/tests/cxx_constructors.cc (contents, props changed) >> head/lib/csu/tests/dynamic/ >> head/lib/csu/tests/dynamic/Makefile (contents, props changed) >> head/lib/csu/tests/fini_test.c (contents, props changed) >> head/lib/csu/tests/init_test.c (contents, props changed) >> head/lib/csu/tests/static/ >> head/lib/csu/tests/static/Makefile (contents, props changed) >> head/tools/build/options/WITHOUT_BSD_CRTBEGIN (contents, props = changed) >> head/tools/build/options/WITH_BSD_CRTBEGIN (contents, props = changed) >> Modified: >> head/gnu/lib/Makefile >> head/lib/csu/Makefile >> head/lib/csu/Makefile.inc >> head/share/mk/src.opts.mk >>=20 >=20 > Hi, >=20 > The tests seems to have given CI some heartburn on ppc64/riscv64 after > they were enabled: > https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/7811/console = This should be fixed in r339770 Andrew From owner-svn-src-head@freebsd.org Fri Oct 26 11:53:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81E9B10E0BFC; Fri, 26 Oct 2018 11:53:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3721273FAF; Fri, 26 Oct 2018 11:53:21 +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 1860A20A06; Fri, 26 Oct 2018 11:53:21 +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 w9QBrKhE007519; Fri, 26 Oct 2018 11:53:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QBrK60007518; Fri, 26 Oct 2018 11:53:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810261153.w9QBrK60007518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 26 Oct 2018 11:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339773 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 339773 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, 26 Oct 2018 11:53:21 -0000 Author: andrew Date: Fri Oct 26 11:53:20 2018 New Revision: 339773 URL: https://svnweb.freebsd.org/changeset/base/339773 Log: Add __dso_handle to the BSD crtbegin. This is used to identify shared objects. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/common/crtbegin.c Modified: head/lib/csu/common/crtbegin.c ============================================================================== --- head/lib/csu/common/crtbegin.c Fri Oct 26 10:20:03 2018 (r339772) +++ head/lib/csu/common/crtbegin.c Fri Oct 26 11:53:20 2018 (r339773) @@ -30,6 +30,14 @@ __FBSDID("$FreeBSD$"); typedef void (*crt_func)(void); +extern void *__dso_handle __hidden; + +#ifdef SHARED +void *__dso_handle = &__dso_handle; +#else +void *__dso_handle = 0; +#endif + /* * On some architectures and toolchains we may need to call the .dtors. * These are called in the order they are in the ELF file. From owner-svn-src-head@freebsd.org Fri Oct 26 12:27:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E451F10E2464; Fri, 26 Oct 2018 12:27:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 983F8752AF; Fri, 26 Oct 2018 12:27:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A76920F05; Fri, 26 Oct 2018 12:27:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QCR7NE023172; Fri, 26 Oct 2018 12:27:07 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QCR7gR023171; Fri, 26 Oct 2018 12:27:07 GMT (envelope-from br@FreeBSD.org) Message-Id: <201810261227.w9QCR7gR023171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 26 Oct 2018 12:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339774 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 339774 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, 26 Oct 2018 12:27:08 -0000 Author: br Date: Fri Oct 26 12:27:07 2018 New Revision: 339774 URL: https://svnweb.freebsd.org/changeset/base/339774 Log: o Add pmap lock around pmap_fault_fixup() to ensure other thread will not modify l3 pte after we loaded old value and before we stored new value. o Preset A(accessed), D(dirty) bits for kernel mappings. Reported by: kib Reviewed by: markj Discussed with: jhb Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Oct 26 11:53:20 2018 (r339773) +++ head/sys/riscv/riscv/pmap.c Fri Oct 26 12:27:07 2018 (r339774) @@ -2015,16 +2015,21 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ pt_entry_t orig_l3; pt_entry_t new_l3; pt_entry_t *l3; + int rv; + rv = 0; + + PMAP_LOCK(pmap); + l3 = pmap_l3(pmap, va); if (l3 == NULL) - return (0); + goto done; orig_l3 = pmap_load(l3); if ((orig_l3 & PTE_V) == 0 || ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) - return (0); + goto done; new_l3 = orig_l3 | PTE_A; if ((prot & VM_PROT_WRITE) != 0) @@ -2033,7 +2038,8 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ if (orig_l3 != new_l3) { pmap_load_store(l3, new_l3); pmap_invalidate_page(pmap, va); - return (1); + rv = 1; + goto done; } /* @@ -2041,7 +2047,10 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ * the PTE shouldn't have resulted in a fault. */ - return (0); +done: + PMAP_UNLOCK(pmap); + + return (rv); } /* @@ -2084,6 +2093,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v new_l3 |= PTE_W; if ((va >> 63) == 0) new_l3 |= PTE_U; + else + new_l3 |= PTE_A | PTE_D; new_l3 |= (pn << PTE_PPN0_S); if ((flags & PMAP_ENTER_WIRED) != 0) From owner-svn-src-head@freebsd.org Fri Oct 26 13:15:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F5B710E3120; Fri, 26 Oct 2018 13:15:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F58E76A0B; Fri, 26 Oct 2018 13:15:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f179.google.com with SMTP id p64-v6so1593704itp.0; Fri, 26 Oct 2018 06:15:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xiDHpcyhEQSJtaA5wU7Of4Q6w0zkdMFymN+bdzyPOV8=; b=ixrxRLAgcrFoLtW9iNHVQOVGvUnRu4uxtwdKtYe/AAzeBxWaMxkQTW02QsLLKB2z4K VGiA5fCGLrmZsELGwsVTd9jJcO60dz8wj4s5LEBNQkjY6MUw3MgCbFz8TCYq8979V2hq SG8zp0S0pYWTddcM6PLvza2ekItzRr0qrttjLidu/ZM/qcmJO7EoOqOMy4TIOGbM65NP 9QiiZ7Ytfto1pfIQCL36sxLuYEE/3xRSOpPqFfQXy+4aXN4nLgIIr4MnXODNod8ByIpk +HRh6xT0+4Embf/z82CaG9XHgOHVFmyufqsWEqPpvwAl4oTLCFlXrKEbsmDKPVq3YT4k HHFg== X-Gm-Message-State: AGRZ1gKpB7hxVFFlVN/AdSl5X5bNQqsIMtuYJ5ZOoq33Ncj/bKIcWtiV U5Ku//gMcGjVl0y0+S+X9pPD9MC8Qg6YpRl5dqbGFJos X-Google-Smtp-Source: AJdET5fhk76BIdp3+EIY7wUPQZuTn4BN/1AEQCZ1hfa6xKCH6sDPLKHdR5BdOoeKExQqoC0D5A9XFYdEJwFcFVbmb04= X-Received: by 2002:a24:7012:: with SMTP id f18-v6mr3494869itc.87.1540559720375; Fri, 26 Oct 2018 06:15:20 -0700 (PDT) MIME-Version: 1.0 References: <201810252313.w9PNDJgd017609@repo.freebsd.org> In-Reply-To: <201810252313.w9PNDJgd017609@repo.freebsd.org> From: Ed Maste Date: Fri, 26 Oct 2018 05:16:38 -0400 Message-ID: Subject: Re: svn commit: r339751 - head/contrib/libarchive/libarchive To: Martin Matuska Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" 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, 26 Oct 2018 13:15:22 -0000 On Thu, 25 Oct 2018 at 19:13, Martin Matuska wrote: > > Author: mm > Date: Thu Oct 25 23:13:19 2018 > New Revision: 339751 > URL: https://svnweb.freebsd.org/changeset/base/339751 > > Log: > MFV r339750: > Sync libarchive with vendor. > > Relevant vendor changes: > RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), > sparc64 and riscv64 It looks like riscv64 is still broken (at r339774, https://ci.freebsd.org/job/FreeBSD-head-riscv64-build/11025/console) 12:35:54 /workspace/src/contrib/libarchive/libarchive/archive_read_support_format_rar5.c: In function 'process_head_file': 12:35:54 /workspace/src/contrib/libarchive/libarchive/archive_read_support_format_rar5.c:1422:5: error: 'name_size' may be used uninitialized in this function [-Werror=maybe-uninitialized] 12:35:54 memcpy(name_utf8_buf, p, name_size); 12:35:54 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... From owner-svn-src-head@freebsd.org Fri Oct 26 14:24:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D452E10E8980 for ; Fri, 26 Oct 2018 14:24:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 4D644796C1 for ; Fri, 26 Oct 2018 14:24:20 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1540563856; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ioKUU8hK+k2Iwstk0ZkmiRl2fZS3oeeQ8BCkPW5R/oW1LvK6xQ4ZXwNTMdbl8UNqWq5mr1pUNkhjq qJRKq7b224MGW6mPjqYKCA1ewUqHCXypGMYQGxcGW0vJHb+C9xi9+Xpf6nJQ90d2InCppVZd/8GEjf 3Fcil1BC1N8h5hxxA59kovXO+pMHkXIsq5Qnw1Nj9vWtN9PkNGbvndug5vx1mckHkTUeTR2w8IlybD mTWX2/XkzTHUfbhYZZjL5HZuh3OdVG9uIM5fsiXdK3IrKzmhG6XnVwQ68ey+AzEehKdiN7KH1qpgow fT8X73uCiV8u9QTBSJPXL+VbkIUEbHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=VnCH/BJDPYHz/YgpPcfiR/fCZ3h+4+MqojoqdueMhK0=; b=o9FiMccDc81diVkavv41aD+QpM/ArP56Wj6H+6N1F/yPq2yQJw1R9kdaYOAt0QKNg/ppNE4gbkX9Q +iAtQL5a1Sccw4Naer0OnLNAo4V/ybwUsdC3hf/vsoINa07Zk0Du+2Qzc85WSTPB6dMjL91XKEcg0R MOo8Ya8rQqv/2lS80gpD/c7CQEGKHXCDszLdm2LPkapnrgCOkU8WkS7t/7W5QUnB9lW3uzUT3SgJLM XWmV7IucsLmZZ99n5DYOl4qC2RWpHmIJ3V95k8yw0lbZQlqy5r/H8SdjmBqcFNkxhCtRLKUS94+vV6 5EF/uziIsJm6OgDtQk9Mi99HauLKKhg== ARC-Authentication-Results: i=1; outbound1.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=VnCH/BJDPYHz/YgpPcfiR/fCZ3h+4+MqojoqdueMhK0=; b=uWN7JyOuaNYHRd04hNxe3SDNUMf+WP//5mWuG0kuZLirrYSAZmFoN8auRICU7qU+taZrjWpj7Sy/x vRZzHVzQW1Zx3VzURdXtjPA8dgUM7b6MKKM+GupFCopRZgq+vfDnq8zOTJhmYEpA8TcUHVu6ocnTuq wRgB7wsWeMUrza54tudMtoICMubSI/QgyfzR9+3B/OQih8TGUbzY6ycxQ1BKDs5GuKQjNrslQJXEL6 fEUpkHIZhfbvcYrZT29ribv96QZC22LWsdZi4+zcC6qTpZWV1wVKUh5piohP1DuCrVfyspybBzf06Z 6U2qi7a+3Je0NJWe5Xa0aU+/gQQyRog== X-MHO-RoutePath: aGlwcGll X-MHO-User: cc913ca3-d92a-11e8-9048-075f73944867 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id cc913ca3-d92a-11e8-9048-075f73944867; Fri, 26 Oct 2018 14:24:13 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w9QEO7Oe055297; Fri, 26 Oct 2018 08:24:07 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1540563847.22340.91.camel@freebsd.org> Subject: Re: svn commit: r339563 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules sys/modules/joy sys/sys tools/kerneldoc/subsys From: Ian Lepore To: Jan Beich , Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 26 Oct 2018 08:24:07 -0600 In-Reply-To: References: <201810220234.w9M2Y0Wk043492@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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, 26 Oct 2018 14:24:21 -0000 On Fri, 2018-10-26 at 05:30 +0200, Jan Beich wrote: > > Your tone is not acceptable. Please try again, only this time with > the > > required level of professionalism. I'm not an idiot, and you will > treat me > > with respect. > > Apologies for the snide remark. I've expected someone with ports/ > commit bit to be a bit more careful. It isn't much of an appology if you use it as an opportunity to tack on another insult. -- Ian From owner-svn-src-head@freebsd.org Fri Oct 26 14:27:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9067910E8A16; Fri, 26 Oct 2018 14:27: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43C2079873; Fri, 26 Oct 2018 14:27: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 20CA8222E2; Fri, 26 Oct 2018 14:27: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 w9QERbI2085295; Fri, 26 Oct 2018 14:27:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QERbSM085294; Fri, 26 Oct 2018 14:27:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810261427.w9QERbSM085294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 14:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339775 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 339775 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, 26 Oct 2018 14:27:38 -0000 Author: imp Date: Fri Oct 26 14:27:37 2018 New Revision: 339775 URL: https://svnweb.freebsd.org/changeset/base/339775 Log: Put a workaround in for command timeout malfunctioning At least one NVMe drive has a bug that makeing the Command Time Out PCIe feature unreliable. The workaround is to disable this feature. The driver wouldn't deal correctly with a timeout anyway. Only do this for drives that are known bad. Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D17708 Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Fri Oct 26 12:27:07 2018 (r339774) +++ head/sys/dev/nvme/nvme.c Fri Oct 26 14:27:37 2018 (r339775) @@ -106,6 +106,7 @@ static struct _pcsid { 0x05401c5f, 0, 0, "Memblaze Pblaze4", QUIRK_DELAY_B4_CHK_RDY }, { 0xa821144d, 0, 0, "Samsung PM1725", QUIRK_DELAY_B4_CHK_RDY }, { 0xa822144d, 0, 0, "Samsung PM1725a", QUIRK_DELAY_B4_CHK_RDY }, + { 0x01161179, 0, 0, "Toshiba XG5", QUIRK_DISABLE_TIMEOUT }, { 0x00000000, 0, 0, NULL } }; @@ -276,6 +277,25 @@ nvme_attach(device_t dev) if (status != 0) { nvme_ctrlr_destruct(ctrlr, dev); return (status); + } + + /* + * Some drives do not implement the completion timeout feature + * correctly. There's a WAR from the manufacturer to just disable it. + * The driver wouldn't respond correctly to a timeout anyway. + */ + if (ep->quirks & QUIRK_DISABLE_TIMEOUT) { + int ptr; + uint16_t devctl2; + + status = pci_find_cap(dev, PCIY_EXPRESS, &ptr); + if (status) { + device_printf(dev, "Can't locate PCIe capability?"); + return (status); + } + devctl2 = pci_read_config(dev, ptr + PCIER_DEVICE_CTL2, sizeof(devctl2)); + devctl2 |= PCIEM_CTL2_COMP_TIMO_DISABLE; + pci_write_config(dev, ptr + PCIER_DEVICE_CTL2, devctl2, sizeof(devctl2)); } /* Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Oct 26 12:27:07 2018 (r339774) +++ head/sys/dev/nvme/nvme_private.h Fri Oct 26 14:27:37 2018 (r339775) @@ -247,7 +247,8 @@ struct nvme_controller { uint32_t ready_timeout_in_ms; uint32_t quirks; -#define QUIRK_DELAY_B4_CHK_RDY 1 /* Can't touch MMIO on disable */ +#define QUIRK_DELAY_B4_CHK_RDY 1 /* Can't touch MMIO on disable */ +#define QUIRK_DISABLE_TIMEOUT 2 /* Disable broken completion timeout feature */ bus_space_tag_t bus_tag; bus_space_handle_t bus_handle; From owner-svn-src-head@freebsd.org Fri Oct 26 16:03:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D21A10EA9E6; Fri, 26 Oct 2018 16:03:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 006B67C95C; Fri, 26 Oct 2018 16:03:32 +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 BC30923320; Fri, 26 Oct 2018 16:03: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 w9QG3Vc9037044; Fri, 26 Oct 2018 16:03:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QG3UO7037040; Fri, 26 Oct 2018 16:03:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810261603.w9QG3UO7037040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 16:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339776 - in head: . share/man/man4 sys/conf sys/dev/joy sys/modules/joy tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/joy sys/modules/joy tools/kerneldoc/subsys X-SVN-Commit-Revision: 339776 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, 26 Oct 2018 16:03:32 -0000 Author: imp Date: Fri Oct 26 16:03:30 2018 New Revision: 339776 URL: https://svnweb.freebsd.org/changeset/base/339776 Log: Redo r339563: Remove joy(4) driver. This driver was marked as gone in 12. We're at 13 now. Remove it. Data from nycbug's dmesg cache shows only one potential user, suggesting it never was used much. However, even though this device has been obsolete for 15 years at least, sys/joystick.h is included in a number of graphics packages still, so that remains. A full exprun is needed before that can be removed. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D17629 Deleted: head/share/man/man4/joy.4 head/sys/dev/joy/joy.c head/sys/dev/joy/joy_isa.c head/sys/dev/joy/joyvar.h head/sys/modules/joy/Makefile head/tools/kerneldoc/subsys/Doxyfile-dev_joy Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 26 14:27:37 2018 (r339775) +++ head/ObsoleteFiles.inc Fri Oct 26 16:03:30 2018 (r339776) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181026: joy(4) removal +OLD_FILES+=usr/share/man/man4/joy.4.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports OLD_LIBS+=lib/libcrypto.so.9 OLD_LIBS+=usr/lib/libssl.so.9 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Oct 26 14:27:37 2018 (r339775) +++ head/share/man/man4/Makefile Fri Oct 26 16:03:30 2018 (r339776) @@ -239,7 +239,6 @@ MAN= aac.4 \ ixl.4 \ jedec_dimm.4 \ jme.4 \ - joy.4 \ kbdmux.4 \ keyboard.4 \ kld.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Oct 26 14:27:37 2018 (r339775) +++ head/sys/conf/NOTES Fri Oct 26 16:03:30 2018 (r339776) @@ -2313,12 +2313,8 @@ options SND_OLDSTEREO # Miscellaneous hardware: # # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board -# joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader -device joy # PnP aware, hints for non-PnP only -hint.joy.0.at="isa" -hint.joy.0.port="0x201" device cmx # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 26 14:27:37 2018 (r339775) +++ head/sys/conf/files Fri Oct 26 16:03:30 2018 (r339776) @@ -2294,8 +2294,6 @@ dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv ine compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jedec_dimm/jedec_dimm.c optional jedec_dimm smbus dev/jme/if_jme.c optional jme pci -dev/joy/joy.c optional joy -dev/joy/joy_isa.c optional joy isa dev/kbd/kbd.c optional atkbd | pckbd | sc | ukbd | vt dev/kbdmux/kbdmux.c optional kbdmux dev/ksyms/ksyms.c optional ksyms From owner-svn-src-head@freebsd.org Fri Oct 26 16:23:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665AA10EAFC8; Fri, 26 Oct 2018 16:23:53 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3737D629; Fri, 26 Oct 2018 16:23:53 +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 F145423648; Fri, 26 Oct 2018 16:23: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 w9QGNq8Q047427; Fri, 26 Oct 2018 16:23:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QGNqwu047424; Fri, 26 Oct 2018 16:23:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810261623.w9QGNqwu047424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 16:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339777 - in head/sys/cam: ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata nvme scsi X-SVN-Commit-Revision: 339777 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, 26 Oct 2018 16:23:53 -0000 Author: imp Date: Fri Oct 26 16:23:51 2018 New Revision: 339777 URL: https://svnweb.freebsd.org/changeset/base/339777 Log: Add statistics for TRIM comands Add a counter for the LBAs, Ranges and hardware commands so that we can provide additional color to the statistics we provide to vendors. Sponsored by: Netflix, Inc Modified: head/sys/cam/ata/ata_da.c head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Oct 26 16:03:30 2018 (r339776) +++ head/sys/cam/ata/ata_da.c Fri Oct 26 16:23:51 2018 (r339777) @@ -251,6 +251,9 @@ struct ada_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; struct trim_request trim_req; + uint64_t trim_count; + uint64_t trim_ranges; + uint64_t trim_lbas; #ifdef CAM_IO_STATS struct sysctl_ctx_list sysctl_stats_ctx; struct sysctl_oid *sysctl_stats_tree; @@ -1440,6 +1443,18 @@ adasysctlinit(void *context, int pending) OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, softc, 0, adadeletemethodsysctl, "A", "BIO_DELETE execution method"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_count", CTLFLAG_RD, &softc->trim_count, + "Total number of dsm commands sent"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_ranges", CTLFLAG_RD, &softc->trim_ranges, + "Total number of ranges in dsm commands"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_lbas", CTLFLAG_RD, &softc->trim_lbas, + "Total lbas in the dsm commands sent"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "read_ahead", CTLFLAG_RW | CTLFLAG_MPSAFE, &softc->read_ahead, 0, "Enable disk read ahead."); @@ -1918,7 +1933,7 @@ adaregister(struct cam_periph *periph, void *arg) static int ada_dsmtrim_req_create(struct ada_softc *softc, struct bio *bp, struct trim_request *req) { - uint64_t lastlba = (uint64_t)-1; + uint64_t lastlba = (uint64_t)-1, lbas = 0; int c, lastcount = 0, off, ranges = 0; bzero(req, sizeof(*req)); @@ -1937,6 +1952,7 @@ ada_dsmtrim_req_create(struct ada_softc *softc, struct (lastcount >> 8) & 0xff; count -= c; lba += c; + lbas += c; } while (count > 0) { @@ -1951,6 +1967,7 @@ ada_dsmtrim_req_create(struct ada_softc *softc, struct req->data[off + 6] = c & 0xff; req->data[off + 7] = (c >> 8) & 0xff; lba += c; + lbas += c; count -= c; lastcount = c; ranges++; @@ -1972,6 +1989,9 @@ ada_dsmtrim_req_create(struct ada_softc *softc, struct break; } } while (1); + softc->trim_count++; + softc->trim_ranges += ranges; + softc->trim_lbas += lbas; return (ranges); } Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Fri Oct 26 16:03:30 2018 (r339776) +++ head/sys/cam/nvme/nvme_da.c Fri Oct 26 16:23:51 2018 (r339777) @@ -105,12 +105,14 @@ struct nda_softc { nda_quirks quirks; int unmappedio; quad_t deletes; - quad_t dsm_req; uint32_t nsid; /* Namespace ID for this nda device */ struct disk *disk; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; + uint64_t trim_count; + uint64_t trim_ranges; + uint64_t trim_lbas; #ifdef CAM_TEST_FAILURE int force_read_error; int force_write_error; @@ -637,9 +639,18 @@ ndasysctlinit(void *context, int pending) OID_AUTO, "deletes", CTLFLAG_RD, &softc->deletes, "Number of BIO_DELETE requests"); - SYSCTL_ADD_QUAD(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "dsm_req", CTLFLAG_RD, - &softc->dsm_req, "Number of DSM requests sent to SIM"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_count", CTLFLAG_RD, &softc->trim_count, + "Total number of unmap/dsm commands sent"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_ranges", CTLFLAG_RD, &softc->trim_ranges, + "Total number of ranges in unmap/dsm commands"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_lbas", CTLFLAG_RD, &softc->trim_lbas, + "Total lbas in the unmap/dsm commands sent"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "rotating", CTLFLAG_RD, &nda_rotating_media, 1, @@ -939,6 +950,7 @@ ndastart(struct cam_periph *periph, union ccb *start_c struct nda_trim_request *trim; struct bio *bp1; int ents; + uint32_t totalcount = 0, ranges = 0; trim = malloc(sizeof(*trim), M_NVMEDA, M_ZERO | M_NOWAIT); if (trim == NULL) { @@ -959,6 +971,8 @@ ndastart(struct cam_periph *periph, union ccb *start_c htole32(bp1->bio_bcount / softc->disk->d_sectorsize); dsm_range->starting_lba = htole64(bp1->bio_offset / softc->disk->d_sectorsize); + ranges++; + totalcount += dsm_range->length; dsm_range++; if (dsm_range >= dsm_end) break; @@ -967,10 +981,12 @@ ndastart(struct cam_periph *periph, union ccb *start_c /* XXX -- Could limit based on total payload size */ } while (bp1 != NULL); start_ccb->ccb_trim = trim; - softc->dsm_req++; nda_nvme_trim(softc, &start_ccb->nvmeio, &trim->dsm, dsm_range - &trim->dsm); start_ccb->ccb_state = NDA_CCB_TRIM; + softc->trim_count++; + softc->trim_ranges += ranges; + softc->trim_lbas += totalcount; /* * Note: We can have multiple TRIMs in flight, so we don't call * cam_iosched_submit_trim(softc->cam_iosched); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Oct 26 16:03:30 2018 (r339776) +++ head/sys/cam/scsi/scsi_da.c Fri Oct 26 16:23:51 2018 (r339777) @@ -334,6 +334,9 @@ struct da_softc { uint32_t unmap_gran; uint32_t unmap_gran_align; uint64_t ws_max_blks; + uint64_t trim_count; + uint64_t trim_ranges; + uint64_t trim_lbas; da_delete_methods delete_method_pref; da_delete_methods delete_method; da_delete_func_t *delete_func; @@ -2182,6 +2185,18 @@ dasysctlinit(void *context, int pending) OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_count", CTLFLAG_RD, &softc->trim_count, + "Total number of unmap/dsm commands sent"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_ranges", CTLFLAG_RD, &softc->trim_ranges, + "Total number of ranges in unmap/dsm commands"); + SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, + "trim_lbas", CTLFLAG_RD, &softc->trim_lbas, + "Total lbas in the unmap/dsm commands sent"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "zone_mode", CTLTYPE_STRING | CTLFLAG_RD, @@ -3934,6 +3949,9 @@ da_delete_unmap(struct cam_periph *periph, union ccb * da_default_timeout * 1000); ccb->ccb_h.ccb_state = DA_CCB_DELETE; ccb->ccb_h.flags |= CAM_UNLOCKED; + softc->trim_count++; + softc->trim_ranges += ranges; + softc->trim_lbas += totalcount; cam_iosched_submit_trim(softc->cam_iosched); } From owner-svn-src-head@freebsd.org Fri Oct 26 16:34:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E24C10EB2C4; Fri, 26 Oct 2018 16:34:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47207DB6F; Fri, 26 Oct 2018 16:34:19 +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 8CAF3237F0; Fri, 26 Oct 2018 16:34:19 +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 w9QGYJtS052532; Fri, 26 Oct 2018 16:34:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QGYJqu052531; Fri, 26 Oct 2018 16:34:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810261634.w9QGYJqu052531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 16:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339778 - in head/sys: dev/joy modules/joy X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/joy modules/joy X-SVN-Commit-Revision: 339778 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, 26 Oct 2018 16:34:20 -0000 Author: imp Date: Fri Oct 26 16:34:19 2018 New Revision: 339778 URL: https://svnweb.freebsd.org/changeset/base/339778 Log: Remove empty directories after r339776. git svn won't remove empty directories without --rmdir which I forgot in r339776. Deleted: head/sys/dev/joy/ head/sys/modules/joy/ From owner-svn-src-head@freebsd.org Fri Oct 26 17:59:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A5A10ECFBB; Fri, 26 Oct 2018 17:59:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18A1E80ABC; Fri, 26 Oct 2018 17:59:27 +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 DEC8924515; Fri, 26 Oct 2018 17:59:26 +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 w9QHxQrc093377; Fri, 26 Oct 2018 17:59:26 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QHxPqE093372; Fri, 26 Oct 2018 17:59:25 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810261759.w9QHxPqE093372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 26 Oct 2018 17:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339779 - in head/sys: compat/freebsd32 fs/devfs kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 fs/devfs kern sys X-SVN-Commit-Revision: 339779 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, 26 Oct 2018 17:59:27 -0000 Author: brooks Date: Fri Oct 26 17:59:25 2018 New Revision: 339779 URL: https://svnweb.freebsd.org/changeset/base/339779 Log: Move 32-bit compat support for FIODGNAME to the right place. ioctl(2) commands only have meaning in the context of a file descriptor so translating them in the syscall layer is incorrect. The new handler users an accessor to retrieve/construct a pointer from the last member of the passed structure and relies on type punning to access the other member which requires no translation. Unlike r339174 this change supports both places FIODGNAME is handled. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17475 Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/freebsd32/freebsd32_ioctl.h head/sys/fs/devfs/devfs_vnops.c head/sys/kern/tty_pts.c head/sys/sys/filio.h Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Fri Oct 26 16:34:19 2018 (r339778) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Fri Oct 26 17:59:25 2018 (r339779) @@ -59,22 +59,6 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct mem_range_op32) == 12); static int -freebsd32_ioctl_fiodgname(struct thread *td, - struct freebsd32_ioctl_args *uap, struct file *fp) -{ - struct fiodgname_arg fgn; - struct fiodgname_arg32 fgn32; - int error; - - if ((error = copyin(uap->data, &fgn32, sizeof fgn32)) != 0) - return (error); - CP(fgn32, fgn, len); - PTRIN_CP(fgn32, fgn, buf); - error = fo_ioctl(fp, FIODGNAME, (caddr_t)&fgn, td->td_ucred, td); - return (error); -} - -static int freebsd32_ioctl_memrange(struct thread *td, struct freebsd32_ioctl_args *uap, struct file *fp) { @@ -237,10 +221,6 @@ freebsd32_ioctl(struct thread *td, struct freebsd32_io } switch (uap->com) { - case FIODGNAME_32: - error = freebsd32_ioctl_fiodgname(td, uap, fp); - break; - case MEMRANGE_GET32: /* FALLTHROUGH */ case MEMRANGE_SET32: error = freebsd32_ioctl_memrange(td, uap, fp); Modified: head/sys/compat/freebsd32/freebsd32_ioctl.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.h Fri Oct 26 16:34:19 2018 (r339778) +++ head/sys/compat/freebsd32/freebsd32_ioctl.h Fri Oct 26 17:59:25 2018 (r339779) @@ -38,11 +38,6 @@ typedef __uint32_t caddr_t32; -struct fiodgname_arg32 { - int len; - caddr_t32 buf; -}; - struct mem_range_op32 { caddr_t32 mo_desc; @@ -60,7 +55,6 @@ struct pci_bar_mmap32 { int pbm_memattr; }; -#define FIODGNAME_32 _IOW('f', 120, struct fiodgname_arg32) #define MEMRANGE_GET32 _IOWR('m', 50, struct mem_range_op32) #define MEMRANGE_SET32 _IOW('m', 51, struct mem_range_op32) #define SG_IO_32 _IOWR(SGIOC, 0x85, struct sg_io_hdr32) Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Fri Oct 26 16:34:19 2018 (r339778) +++ head/sys/fs/devfs/devfs_vnops.c Fri Oct 26 17:59:25 2018 (r339779) @@ -767,6 +767,29 @@ devfs_ioctl_f(struct file *fp, u_long com, void *data, return (error); } +void * +fiodgname_buf_get_ptr(void *fgnp, u_long com) +{ + union { + struct fiodgname_arg fgn; +#ifdef COMPAT_FREEBSD32 + struct fiodgname_arg32 fgn32; +#endif + } *fgnup; + + fgnup = fgnp; + switch (com) { + case FIODGNAME: + return (fgnup->fgn.buf); +#ifdef COMPAT_FREEBSD32 + case FIODGNAME_32: + return ((void *)(uintptr_t)fgnup->fgn32.buf); +#endif + default: + panic("Unhandled ioctl command %ld", com); + } +} + static int devfs_ioctl(struct vop_ioctl_args *ap) { @@ -789,24 +812,27 @@ devfs_ioctl(struct vop_ioctl_args *ap) KASSERT(dev->si_refcount > 0, ("devfs: un-referenced struct cdev *(%s)", devtoname(dev))); - if (com == FIODTYPE) { + switch (com) { + case FIODTYPE: *(int *)ap->a_data = dsw->d_flags & D_TYPEMASK; error = 0; - goto out; - } else if (com == FIODGNAME) { + break; + case FIODGNAME: +#ifdef COMPAT_FREEBSD32 + case FIODGNAME_32: +#endif fgn = ap->a_data; p = devtoname(dev); i = strlen(p) + 1; if (i > fgn->len) error = EINVAL; else - error = copyout(p, fgn->buf, i); - goto out; + error = copyout(p, fiodgname_buf_get_ptr(fgn, com), i); + break; + default: + error = dsw->d_ioctl(dev, com, ap->a_data, ap->a_fflag, td); } - error = dsw->d_ioctl(dev, com, ap->a_data, ap->a_fflag, td); - -out: dev_relthread(dev, ref); if (error == ENOIOCTL) error = ENOTTY; Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Fri Oct 26 16:34:19 2018 (r339778) +++ head/sys/kern/tty_pts.c Fri Oct 26 17:59:25 2018 (r339779) @@ -281,7 +281,11 @@ ptsdev_ioctl(struct file *fp, u_long cmd, void *data, } tty_unlock(tp); return (0); - case FIODGNAME: { + case FIODGNAME: +#ifdef COMPAT_FREEBSD32 + case FIODGNAME_32: +#endif + { struct fiodgname_arg *fgn; const char *p; int i; @@ -292,7 +296,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd, void *data, i = strlen(p) + 1; if (i > fgn->len) return (EINVAL); - return copyout(p, fgn->buf, i); + return (copyout(p, fiodgname_buf_get_ptr(fgn, cmd), i)); } /* Modified: head/sys/sys/filio.h ============================================================================== --- head/sys/sys/filio.h Fri Oct 26 16:34:19 2018 (r339778) +++ head/sys/sys/filio.h Fri Oct 26 17:59:25 2018 (r339779) @@ -63,4 +63,16 @@ struct fiodgname_arg { #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ +#ifdef _KERNEL +#ifdef COMPAT_FREEBSD32 +struct fiodgname_arg32 { + int len; + uint32_t buf; /* (void *) */ +}; +#define FIODGNAME_32 _IOC_NEWTYPE(FIODGNAME, struct fiodgname_arg32) +#endif + +void *fiodgname_buf_get_ptr(void *fgnp, u_long com); +#endif + #endif /* !_SYS_FILIO_H_ */ From owner-svn-src-head@freebsd.org Fri Oct 26 18:56:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F25E31085729; Fri, 26 Oct 2018 18:56: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8F8883216; Fri, 26 Oct 2018 18:56: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 89F7B24E8E; Fri, 26 Oct 2018 18:56: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 w9QIuwVZ023949; Fri, 26 Oct 2018 18:56:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QIuwam023948; Fri, 26 Oct 2018 18:56:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810261856.w9QIuwam023948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Oct 2018 18:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339780 - head/bin/setfacl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/setfacl X-SVN-Commit-Revision: 339780 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, 26 Oct 2018 18:56:59 -0000 Author: markj Date: Fri Oct 26 18:56:58 2018 New Revision: 339780 URL: https://svnweb.freebsd.org/changeset/base/339780 Log: Avoid leaking memory in error paths. CID: 1390906 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/bin/setfacl/setfacl.c Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Fri Oct 26 17:59:25 2018 (r339779) +++ head/bin/setfacl/setfacl.c Fri Oct 26 18:56:58 2018 (r339780) @@ -252,6 +252,8 @@ handle_file(FTS *ftsp, FTSENT *file) } } + ret = 0; + /* * Don't try to set an empty default ACL; it will always fail. * Use acl_delete_def_file(3) instead. @@ -261,34 +263,33 @@ handle_file(FTS *ftsp, FTSENT *file) if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", file->fts_path); - return (1); + ret = 1; } - return (0); + goto out; } /* Don't bother setting the ACL if something is broken. */ if (local_error) { - return (1); - } - - if (acl_type != ACL_TYPE_NFS4 && need_mask && + ret = 1; + } else if (acl_type != ACL_TYPE_NFS4 && need_mask && set_acl_mask(&acl, file->fts_path) == -1) { warnx("%s: failed to set ACL mask", file->fts_path); - return (1); + ret = 1; } else if (follow_symlink) { if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { warn("%s: acl_set_file() failed", file->fts_path); - return (1); + ret = 1; } } else { if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { warn("%s: acl_set_link_np() failed", file->fts_path); - return (1); + ret = 1; } } +out: acl_free(acl); - return (0); + return (ret); } int From owner-svn-src-head@freebsd.org Fri Oct 26 19:01:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE7F1085BAC; Fri, 26 Oct 2018 19:01:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A21F5837BE; Fri, 26 Oct 2018 19:01:52 +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 833DF24EEE; Fri, 26 Oct 2018 19:01:52 +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 w9QJ1qia025629; Fri, 26 Oct 2018 19:01:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QJ1qAK025628; Fri, 26 Oct 2018 19:01:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810261901.w9QJ1qAK025628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Oct 2018 19:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339781 - head/bin/setfacl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/setfacl X-SVN-Commit-Revision: 339781 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, 26 Oct 2018 19:01:53 -0000 Author: markj Date: Fri Oct 26 19:01:52 2018 New Revision: 339781 URL: https://svnweb.freebsd.org/changeset/base/339781 Log: Don't print pathconf() errors if the target file doesn't exist. The subsequent acl_get_file(3) call will simply echo the same error. PR: 229930 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/bin/setfacl/setfacl.c Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Fri Oct 26 18:56:58 2018 (r339780) +++ head/bin/setfacl/setfacl.c Fri Oct 26 19:01:52 2018 (r339781) @@ -174,8 +174,8 @@ handle_file(FTS *ftsp, FTSENT *file) } else if (ret == 0) { if (acl_type == ACL_TYPE_NFS4) acl_type = ACL_TYPE_ACCESS; - } else if (ret < 0 && errno != EINVAL) { - warn("%s: pathconf(..., _PC_ACL_NFS4) failed", + } else if (ret < 0 && errno != EINVAL && errno != ENOENT) { + warn("%s: pathconf(_PC_ACL_NFS4) failed", file->fts_path); } From owner-svn-src-head@freebsd.org Fri Oct 26 19:03:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0410D1085D8B; Fri, 26 Oct 2018 19:03:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABAFB83A30; Fri, 26 Oct 2018 19:03:31 +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 8C9732503C; Fri, 26 Oct 2018 19:03:31 +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 w9QJ3VMj028865; Fri, 26 Oct 2018 19:03:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QJ3U9l028861; Fri, 26 Oct 2018 19:03:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810261903.w9QJ3U9l028861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Oct 2018 19:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339782 - head/tests/sys/acl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/acl X-SVN-Commit-Revision: 339782 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, 26 Oct 2018 19:03:32 -0000 Author: markj Date: Fri Oct 26 19:03:30 2018 New Revision: 339782 URL: https://svnweb.freebsd.org/changeset/base/339782 Log: Update and re-enable ACL tests following r332396 and r339781. PR: 229930 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/acl/Makefile head/tests/sys/acl/tools-nfs4-psarc.test head/tests/sys/acl/tools-nfs4.test head/tests/sys/acl/tools-posix.test Modified: head/tests/sys/acl/Makefile ============================================================================== --- head/tests/sys/acl/Makefile Fri Oct 26 19:01:52 2018 (r339781) +++ head/tests/sys/acl/Makefile Fri Oct 26 19:03:30 2018 (r339782) @@ -14,11 +14,9 @@ ${PACKAGE}FILES+= tools-posix.test SCRIPTS+= run -# Disable 00 and 02 until they've been updated for setfacl's new behavior -# PR 229930 tests/sys/acl/00:main fails in CI due to unexpected error message -# TAP_TESTS_SH+= 00 -# TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 00 TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 TAP_TESTS_SH+= 03 TAP_TESTS_SH+= 04 Modified: head/tests/sys/acl/tools-nfs4-psarc.test ============================================================================== --- head/tests/sys/acl/tools-nfs4-psarc.test Fri Oct 26 19:01:52 2018 (r339781) +++ head/tests/sys/acl/tools-nfs4-psarc.test Fri Oct 26 19:03:30 2018 (r339782) @@ -186,7 +186,7 @@ $ ls -l xxx yyy zzz | cut -d' ' -f1 > -rw-r--r-- $ setfacl -m u:42:x:allow,g:43:w:allow nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -215,7 +215,7 @@ $ getfacl -nq nnn xxx yyy zzz > everyone@:r-----a-R-c--s:-------:allow $ setfacl -b nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory Modified: head/tests/sys/acl/tools-nfs4.test ============================================================================== --- head/tests/sys/acl/tools-nfs4.test Fri Oct 26 19:01:52 2018 (r339781) +++ head/tests/sys/acl/tools-nfs4.test Fri Oct 26 19:03:30 2018 (r339782) @@ -214,7 +214,7 @@ $ ls -l xxx yyy zzz | cut -d' ' -f1 > -rw-r--r-- $ setfacl -m u:42:x:allow,g:43:w:allow nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -252,7 +252,7 @@ $ getfacl -nq nnn xxx yyy zzz > everyone@:r-----a-R-c--s:-------:allow $ setfacl -b nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory Modified: head/tests/sys/acl/tools-posix.test ============================================================================== --- head/tests/sys/acl/tools-posix.test Fri Oct 26 19:01:52 2018 (r339781) +++ head/tests/sys/acl/tools-posix.test Fri Oct 26 19:03:30 2018 (r339782) @@ -226,7 +226,7 @@ $ ls -l xxx yyy zzz | cut -d' ' -f1 > -rw-r--r-- $ setfacl -m u:42:x,g:43:w nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -258,7 +258,7 @@ $ getfacl -nq nnn xxx yyy zzz > other::r-- $ setfacl -b nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory @@ -267,7 +267,7 @@ $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > -rw-r--r--+ $ setfacl -bn nnn xxx yyy zzz -> setfacl: nnn: stat() failed: No such file or directory +> setfacl: nnn: acl_get_file() failed: No such file or directory $ ls -l nnn xxx yyy zzz | cut -d' ' -f1 > ls: nnn: No such file or directory From owner-svn-src-head@freebsd.org Fri Oct 26 19:16:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73EC210863D6; Fri, 26 Oct 2018 19:16:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2734484138; Fri, 26 Oct 2018 19:16:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE69A251CF; Fri, 26 Oct 2018 19:16:17 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QJGHOk034359; Fri, 26 Oct 2018 19:16:17 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QJGHe0034358; Fri, 26 Oct 2018 19:16:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810261916.w9QJGHe0034358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Oct 2018 19:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339783 - head/usr.sbin/ngctl X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/ngctl X-SVN-Commit-Revision: 339783 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, 26 Oct 2018 19:16:18 -0000 Author: dteske Date: Fri Oct 26 19:16:17 2018 New Revision: 339783 URL: https://svnweb.freebsd.org/changeset/base/339783 Log: Add blank line after each item in "ngctl ls -l" The output of "ngctl ls -l" is hard to read. To make it easier, add a blank line after each listed item much how traditional "ls -l" does when listing the contents of multiple directories. Sponsored by: Smule, Inc. Modified: head/usr.sbin/ngctl/list.c Modified: head/usr.sbin/ngctl/list.c ============================================================================== --- head/usr.sbin/ngctl/list.c Fri Oct 26 19:03:30 2018 (r339782) +++ head/usr.sbin/ngctl/list.c Fri Oct 26 19:16:17 2018 (r339783) @@ -125,6 +125,8 @@ ListCmd(int ac, char **av) break; ninfo++; nlist->numnames--; + if (nlist->numnames > 0) + printf("\n"); } } else { while (nlist->numnames > 0) { From owner-svn-src-head@freebsd.org Fri Oct 26 19:54:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0215E1087065; Fri, 26 Oct 2018 19:54:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC15853B0; Fri, 26 Oct 2018 19:54: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 79B182581D; Fri, 26 Oct 2018 19:54: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 w9QJs0Q1054835; Fri, 26 Oct 2018 19:54:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QJs05X054833; Fri, 26 Oct 2018 19:54:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810261954.w9QJs05X054833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 19:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339784 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 339784 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, 26 Oct 2018 19:54:01 -0000 Author: cem Date: Fri Oct 26 19:53:59 2018 New Revision: 339784 URL: https://svnweb.freebsd.org/changeset/base/339784 Log: dumpon(8): Provide seatbelt against weak RSA keys The premise of dumpon -k foo.pem is that dump contents will be confidential except to anyone holding the corresponding RSA private key. This guarantee breaks down when weak RSA keys are used. Small RSA keys (e.g. 512 bits) can be broken on a single personal computer in tractible time. Marginal RSA keys (768 bits) can be broken by EC2 and a few dollars. Even 1024 bit keys can probably be broken by sophisticated and wealthy attackers. NIST SP800-57 (2016) recommends a minimum of 2048 bit RSA keys, and estimates this provides 112 bits of security. It would also be good to protect users from weak values of 'e' (i.e., 3) and perhaps sanity check that their public key .pem does not accidentally contain their private key as well. These considerations are left as future work. Reviewed by: markj, darius AT dons.net.au (previous version) Discussed with: bjk Differential Revision: https://reviews.freebsd.org/D17678 Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Fri Oct 26 19:16:17 2018 (r339783) +++ head/sbin/dumpon/dumpon.8 Fri Oct 26 19:53:59 2018 (r339784) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd October 26, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -348,3 +348,15 @@ is taken, it is not possible to send crash dumps direc It is currently not possible to configure both compression and encryption. The encrypted dump format assumes that the kernel dump size is a multiple of the cipher block size, which may not be true when the dump is compressed. +.Sh SECURITY CONSIDERATIONS +RSA keys smaller than 1024 bits are practical to factor and therefore weak. +Even 1024 bit keys may not be large enough to ensure privacy for many +years, so NIST recommends a minimum of 2048 bit RSA keys. +As a seatbelt, +.Nm +prevents users from configuring encrypted kernel dumps with weak RSA keys. +If you do not care for cryptographic privacy guarantees, just use +.Nm +without specifying a +.Fl k Ar pubkey +option. Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Fri Oct 26 19:16:17 2018 (r339783) +++ head/sbin/dumpon/dumpon.c Fri Oct 26 19:53:59 2018 (r339784) @@ -243,6 +243,30 @@ genkey(const char *pubkeyfile, struct diocskerneldump_ if (pubkey == NULL) errx(1, "Unable to read data from %s.", pubkeyfile); + /* + * RSA keys under ~1024 bits are trivially factorable (2018). OpenSSL + * provides an API for RSA keys to estimate the symmetric-cipher + * "equivalent" bits of security (defined in NIST SP800-57), which as + * of this writing equates a 2048-bit RSA key to 112 symmetric cipher + * bits. + * + * Use this API as a seatbelt to avoid suggesting to users that their + * privacy is protected by encryption when the key size is insufficient + * to prevent compromise via factoring. + * + * Future work: Sanity check for weak 'e', and sanity check for absence + * of 'd' (i.e., the supplied key is a public key rather than a full + * keypair). + */ +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + if (RSA_security_bits(pubkey) < 112) +#else + if (RSA_size(pubkey) * 8 < 2048) +#endif + errx(1, "Small RSA keys (you provided: %db) can be " + "factored cheaply. Please generate a larger key.", + RSA_size(pubkey) * 8); + kdap->kda_encryptedkeysize = RSA_size(pubkey); if (kdap->kda_encryptedkeysize > KERNELDUMP_ENCKEY_MAX_SIZE) { errx(1, "Public key has to be at most %db long.", From owner-svn-src-head@freebsd.org Fri Oct 26 20:04:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AACF10873D7; Fri, 26 Oct 2018 20:04: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3BE485BA7; Fri, 26 Oct 2018 20:03:59 +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 C5F2C259C2; Fri, 26 Oct 2018 20:03:59 +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 w9QK3xnA060091; Fri, 26 Oct 2018 20:03:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QK3xHO060090; Fri, 26 Oct 2018 20:03:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810262003.w9QK3xHO060090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 20:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339785 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 339785 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, 26 Oct 2018 20:04:00 -0000 Author: cem Date: Fri Oct 26 20:03:59 2018 New Revision: 339785 URL: https://svnweb.freebsd.org/changeset/base/339785 Log: dumpon.8: Significantly revamp page Start with a short summary and cover the options in a standard list style. Organize sections by common focus and prioritize more useful information closer to the top. Flesh out authors, history, caveats, and security considerations sections. Reviewed by: markj, eadler (previous version) Differential Revision: https://reviews.freebsd.org/D17679 Modified: head/sbin/dumpon/dumpon.8 Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Fri Oct 26 19:53:59 2018 (r339784) +++ head/sbin/dumpon/dumpon.8 Fri Oct 26 20:03:59 2018 (r339785) @@ -59,27 +59,120 @@ .Sh DESCRIPTION The .Nm -utility is used to specify a device where the kernel can save a crash -dump in the case of a panic. +utility is used to configure where the kernel can save a crash dump in the case +of a panic. .Pp -Calls to +System administrators should typically configure .Nm -normally occur from the system multi-user initialization file -.Pa /etc/rc , -controlled by the -.Dq dumpdev +in a persistent fashion using the +.Xr rc.conf 5 +variables +.Va dumpdev and -.Dq dumpon_flags -variables in the boot time configuration file -.Pa /etc/rc.conf . +.Va dumpon_flags . +For more information on this usage, see +.Xr rc.conf 5 . +.Ss General options +.Bl -tag -width _k_pubkey +.It Fl k Ar pubkey +Configure encrypted kernel dumps. .Pp +A random, one-time symmetric key is automatically generated for bulk kernel +dump encryption every time +.Nm +is used. +The provided +.Ar pubkey +is used to encrypt a copy of the symmetric key. +The encrypted dump contents consist of a standard dump header, the +pubkey-encrypted symmetric key contents, and the symmetric key encrypted core +dump contents. +.Pp +As a result, only someone with the corresponding private key can decrypt the symmetric key. +The symmetric key is necessary to decrypt the kernel core. +The goal of the mechanism is to provide confidentiality. +.Pp +The +.Va pubkey +file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl l +List the currently configured dump device, or /dev/null if no device is +configured. +.It Fl v +Enable verbose mode. +.It Fl Z +Enable compression (Zstandard). +.It Fl z +Enable compression (gzip). +Only one compression method may be enabled at a time, so +.Fl z +is incompatible with +.Fl Z . +.Pp +Zstandard provides superior compression ratio and performance. +.El +.Ss Netdump +.Nm +may also configure the kernel to dump to a remote +.Xr netdumpd 8 +server. +(The +.Xr netdumpd 8 +server is available in ports.) +.Xr netdump 4 +eliminates the need to reserve space for crash dumps. +It is especially useful in diskless environments. +When +.Nm +is used to configure netdump, the +.Ar device +(or +.Ar iface ) +parameter should specify a network interface (e.g., +.Va igb1 ) . +The specified NIC must be up (online) to configure netdump. +.Pp +.Xr netdump 4 +specific options include: +.Bl -tag -width _g_gateway +.It Fl c Ar client +The local IP address of the +.Xr netdump 4 +client. +.It Fl g Ar gateway +Optional. +If not specified, it is assumed that the +.Ar server +is on the same link as the +.Ar client . +.Pp +If specified, +.Ar gateway +is the address of the first-hop router between the +.Ar client +and the +.Ar server . +The special value +.Dv Dq default +indicates that the currently configured system default route should be used. +.It Fl s Ar server +The IP address of the +.Xr netdumpd 8 +server. +.El +.Pp +All of these options can be specified in the +.Xr rc.conf 5 +variable +.Va dumpon_flags . +.Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. -.Pp +.Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a @@ -93,155 +186,18 @@ total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. -.Pp -.Nm -is used to configure a local storage device as the dump device. -With additional parameters, the kernel can instead be configured to -transmit a dump to a remote server using -.Xr netdump 4 . -This eliminates the need to reserve space for saving crash dumps and -is especially useful in diskless environments. -The -.Xr netdump 4 -server address is specified with -.Fl s Ar server , -and the local address is specified with -.Fl c Ar client . -The -.Fl g Ar gateway -parameter may be used to specify a first-hop router to the server, -or to specify that the currently configured default gateway is to -be used. -Note that the -.Xr netdump 4 -configuration is not automatically updated if any network configuration -(e.g., the default route) changes after the -.Nm -invocation. -The name of the interface to be used must be specified as -.Ar iface . -The interface must be up in order to configure -.Xr netdump 4 . -.Pp -The -.Fl k Ar pubkey -flag causes -.Nm -to generate a one-time key for kernel crash dump encryption. -The key will be replaced by a new one when the -.Nm -utility is run again. -The key is encrypted using -.Ar pubkey . -This process is sandboxed using -.Xr capsicum 4 . -Both plain and encrypted keys are sent to the kernel using -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 . -A user can specify the -.Ar pubkey -in the -.Dq dumpon_flags -variable defined in -.Pa /etc/rc.conf -for use with the -.Pa /etc/rc.d/dumpon -.Xr rc 8 -script. -This flag requires a kernel compiled with the -.Dv EKCD -kernel option. -.Pp -The -.Fl z -and -.Fl Z -options configure the kernel to compress the dump before writing it to -the dump device. -This reduces the amount of space required for the dump and accelerates -recovery with -.Xr savecore 8 -since less data needs to be copied from the dump device. -When compression is enabled, the -.Nm -utility will not verify that the dump device is sufficiently large for a full -dump. -The -.Fl z -and -.Fl Z -options cause the dump to be written in -.Xr gzip 1 -and -.Xr zstd 1 -format, respectively. -These flags require a kernel compiled with the -.Dv GZIO -or -.Dv ZSTDIO -kernel options. -.Pp -The -.Fl l -flag causes -.Nm -to print the current dump device or _PATH_DEVNULL ("/dev/null") if no device is -configured. -.Pp -The -.Fl v -flag causes -.Nm -to be verbose about its activity. .Sh IMPLEMENTATION NOTES -Since a -.Xr panic 9 -condition may occur in a situation -where the kernel cannot trust its internal representation -of the state of any given file system, -one of the system swap devices, -and -.Em not -a device containing a file system, -should be used as the dump device. +Because the file system layer is already dead by the time a crash dump +is taken, it is not possible to send crash dumps directly to a file. .Pp The -.Nm -utility operates by opening -.Ar device -and making a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -request on it to save kernel crash dumps. -If -.Ar device -is the text string: -.Dq Li off , -.Nm -performs a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -on -.Pa /dev/null -and thus instructs the kernel not to save crash dumps. -.Pp -Since -.Nm -cannot be used during kernel initialization, the -.Va dumpdev -variable of .Xr loader 8 -must be used to enable dumps for system panics which occur -during kernel initialization. -.Sh FILES -.Bl -tag -width "/dev/{ada,da}?s?b" -compact -.It Pa /dev/{ada,da}?s?b -standard swap areas -.It Pa /etc/rc.conf -boot-time system configuration -.El +variable +.Va dumpdev +may be used to enable early kernel core dumps for system panics which occur +before userspace starts. .Sh EXAMPLES -In order to generate an RSA private key a user can use the +In order to generate an RSA private key, a user can use the .Xr genrsa 1 tool: .Pp @@ -253,7 +209,8 @@ tool: .Pp .Dl # openssl rsa -in private.pem -out public.pem -pubout .Pp -Once the RSA keys are created the private key should be moved to a safe place. +Once the RSA keys are created in a safe place, the public key may be moved to +the untrusted netdump client machine. Now .Pa public.pem can be used by @@ -278,21 +235,23 @@ reboot: .Pp After reboot .Xr savecore 8 -should be able to save the core dump in the core directory which is +should be able to save the core dump in the +.Va Dq dumpdir +directory, which is .Pa /var/crash by default: .Pp -.Dl # savecore /var/crash /dev/ada0s1b +.Dl # savecore /dev/ada0s1b .Pp Three files should be created in the core directory: .Pa info.# , .Pa key.# and .Pa vmcore_encrypted.# -where +(where .Dq # is the number of the last core dump saved by -.Xr savecore 8 . +.Xr savecore 8 ) . The .Pa vmcore_encrypted.# can be decrypted using the @@ -320,12 +279,15 @@ The core was decrypted properly if .Xr kgdb 1 does not print any errors. Note that the live kernel might be at a different path -which can be examined by looking at the kern.bootfile sysctl. +which can be examined by looking at the +.Va kern.bootfile +.Xr sysctl 8 . .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , .Xr zstd 1 , .Xr ddb 4 , +.Xr netdump 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , @@ -341,22 +303,72 @@ The .Nm utility appeared in .Fx 2.0.5 . -.Sh BUGS -Because the file system layer is already dead by the time a crash dump -is taken, it is not possible to send crash dumps directly to a file. .Pp +Support for encrypted kernel core dumps and netdump was added in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org , +.An Conrad Meyer Aq Mt cem@FreeBSD.org , +.An Konrad Witaszczyk Aq Mt def@FreeBSD.org , +and countless others. +.Sh CAVEATS +To configure encrypted kernel core dumps, the running kernel must have been +compiled with the +.Dv EKCD +option. +.Pp +Netdump does not automatically update the configured +.Ar gateway +if routing topology changes. +.Pp +The size of a compressed dump or a minidump is not a fixed function of RAM +size. +Therefore, when at least one of these options is enabled, the +.Nm +utility cannot verify that the +.Ar device +has sufficient space for a dump. +.Nm +is also unable to verify that a configured +.Xr netdumpd 8 +server has sufficient space for a dump. +.Pp +.Fl Z +requires a kernel compiled with the +.Dv ZSTDIO +kernel option. +Similarly, +.Fl z +requires the +.Dv GZIO +option. +.Sh BUGS It is currently not possible to configure both compression and encryption. The encrypted dump format assumes that the kernel dump size is a multiple of the cipher block size, which may not be true when the dump is compressed. +.Pp +Netdump only supports IPv4 at this time. .Sh SECURITY CONSIDERATIONS +The current encrypted kernel core dump scheme does not provide integrity nor +authentication. +That is, the recipient of an encrypted kernel core dump cannot know if they +received an intact core dump, nor can they verify the provenance of the dump. +.Pp RSA keys smaller than 1024 bits are practical to factor and therefore weak. Even 1024 bit keys may not be large enough to ensure privacy for many years, so NIST recommends a minimum of 2048 bit RSA keys. As a seatbelt, .Nm -prevents users from configuring encrypted kernel dumps with weak RSA keys. +prevents users from configuring encrypted kernel dumps with extremely weak RSA +keys. If you do not care for cryptographic privacy guarantees, just use .Nm without specifying a .Fl k Ar pubkey option. +.Pp +This process is sandboxed using +.Xr capsicum 4 . From owner-svn-src-head@freebsd.org Fri Oct 26 20:07:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8967510874C3; Fri, 26 Oct 2018 20:07:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B34985D8F; Fri, 26 Oct 2018 20:07:47 +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 0FFB4259E2; Fri, 26 Oct 2018 20:07:47 +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 w9QK7kV4060286; Fri, 26 Oct 2018 20:07:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QK7kRB060285; Fri, 26 Oct 2018 20:07:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810262007.w9QK7kRB060285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 20:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339786 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339786 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, 26 Oct 2018 20:07:47 -0000 Author: cem Date: Fri Oct 26 20:07:46 2018 New Revision: 339786 URL: https://svnweb.freebsd.org/changeset/base/339786 Log: poll: Unify userspace pollfd pointer name Some of the poll code used 'fds' and some used 'ufds' to refer to the uap->fds userspace pointer that was passed around to subroutines. Some of the poll code used 'fds' to refer to the kernel memory pollfd arrays, which seemed unnecessarily confusing. Unify on 'ufds' to refer to the userspace pollfd array. Additionally, 'bits' is not an accurate description of the kernel pollfd array in kern_poll, so rename that to 'kfds'. Finally, clean up some logic with mallocarray() and nitems(). No functional change. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D17670 Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Fri Oct 26 20:03:59 2018 (r339785) +++ head/sys/kern/sys_generic.c Fri Oct 26 20:07:46 2018 (r339786) @@ -1304,16 +1304,15 @@ sys_poll(struct thread *td, struct poll_args *uap) } int -kern_poll(struct thread *td, struct pollfd *fds, u_int nfds, +kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds, struct timespec *tsp, sigset_t *uset) { - struct pollfd *bits; - struct pollfd smallbits[32]; + struct pollfd *kfds; + struct pollfd stackfds[32]; sbintime_t sbt, precision, tmp; time_t over; struct timespec ts; int error; - size_t ni; precision = 0; if (tsp != NULL) { @@ -1342,12 +1341,11 @@ kern_poll(struct thread *td, struct pollfd *fds, u_int if (nfds > maxfilesperproc && nfds > FD_SETSIZE) return (EINVAL); - ni = nfds * sizeof(struct pollfd); - if (ni > sizeof(smallbits)) - bits = malloc(ni, M_TEMP, M_WAITOK); + if (nfds > nitems(stackfds)) + kfds = mallocarray(nfds, sizeof(*kfds), M_TEMP, M_WAITOK); else - bits = smallbits; - error = copyin(fds, bits, ni); + kfds = stackfds; + error = copyin(ufds, kfds, nfds * sizeof(*kfds)); if (error) goto done; @@ -1370,7 +1368,7 @@ kern_poll(struct thread *td, struct pollfd *fds, u_int seltdinit(td); /* Iterate until the timeout expires or descriptors become ready. */ for (;;) { - error = pollscan(td, bits, nfds); + error = pollscan(td, kfds, nfds); if (error || td->td_retval[0] != 0) break; error = seltdwait(td, sbt, precision); @@ -1389,13 +1387,13 @@ done: if (error == EWOULDBLOCK) error = 0; if (error == 0) { - error = pollout(td, bits, fds, nfds); + error = pollout(td, kfds, ufds, nfds); if (error) goto out; } out: - if (ni > sizeof(smallbits)) - free(bits, M_TEMP); + if (nfds > nitems(stackfds)) + free(kfds, M_TEMP); return (error); } From owner-svn-src-head@freebsd.org Fri Oct 26 20:53:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5303D108843E; Fri, 26 Oct 2018 20:53:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 079CD87287; Fri, 26 Oct 2018 20:53:02 +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 DDEFD261F2; Fri, 26 Oct 2018 20:53:01 +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 w9QKr1HY086091; Fri, 26 Oct 2018 20:53:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QKr1o6086090; Fri, 26 Oct 2018 20:53:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810262053.w9QKr1o6086090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 20:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339787 - head/sys/crypto/rijndael X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/rijndael X-SVN-Commit-Revision: 339787 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, 26 Oct 2018 20:53:02 -0000 Author: cem Date: Fri Oct 26 20:53:01 2018 New Revision: 339787 URL: https://svnweb.freebsd.org/changeset/base/339787 Log: rijndael (AES): Avoid leaking sensitive data on kernel stack Noticed this investigating Fortuna. Remove useless duplicate stack copies of sensitive contents when possible, or if not possible, be sure to zero them out when we're finished. Approved by: secteam (gordon) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16935 Modified: head/sys/crypto/rijndael/rijndael-api-fst.c Modified: head/sys/crypto/rijndael/rijndael-api-fst.c ============================================================================== --- head/sys/crypto/rijndael/rijndael-api-fst.c Fri Oct 26 20:07:46 2018 (r339786) +++ head/sys/crypto/rijndael/rijndael-api-fst.c Fri Oct 26 20:53:01 2018 (r339787) @@ -36,7 +36,6 @@ typedef u_int8_t BYTE; int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen, const char *keyMaterial) { - u_int8_t cipherKey[RIJNDAEL_MAXKB]; if (key == NULL) { return BAD_KEY_INSTANCE; @@ -59,13 +58,12 @@ int rijndael_makeKey(keyInstance *key, BYTE direction, } /* initialize key schedule: */ - memcpy(cipherKey, key->keyMaterial, keyLen/8); if (direction == DIR_ENCRYPT) { - key->Nr = rijndaelKeySetupEnc(key->rk, cipherKey, keyLen); + key->Nr = rijndaelKeySetupEnc(key->rk, key->keyMaterial, keyLen); } else { - key->Nr = rijndaelKeySetupDec(key->rk, cipherKey, keyLen); + key->Nr = rijndaelKeySetupDec(key->rk, key->keyMaterial, keyLen); } - rijndaelKeySetupEnc(key->ek, cipherKey, keyLen); + rijndaelKeySetupEnc(key->ek, key->keyMaterial, keyLen); return TRUE; } @@ -186,6 +184,7 @@ int rijndael_blockEncrypt(cipherInstance *cipher, keyI return BAD_CIPHER_STATE; } + explicit_bzero(block, sizeof(block)); return 128*numBlocks; } @@ -258,6 +257,7 @@ int rijndael_padEncrypt(cipherInstance *cipher, keyIns return BAD_CIPHER_STATE; } + explicit_bzero(block, sizeof(block)); return 16*(numBlocks + 1); } @@ -357,12 +357,13 @@ int rijndael_blockDecrypt(cipherInstance *cipher, keyI return BAD_CIPHER_STATE; } + explicit_bzero(block, sizeof(block)); return 128*numBlocks; } int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key, const BYTE *input, int inputOctets, BYTE *outBuffer) { - int i, numBlocks, padLen; + int i, numBlocks, padLen, rval; u_int8_t block[16]; u_int32_t iv[4]; @@ -392,11 +393,13 @@ int rijndael_padDecrypt(cipherInstance *cipher, keyIns rijndaelDecrypt(key->rk, key->Nr, input, block); padLen = block[15]; if (padLen >= 16) { - return BAD_DATA; + rval = BAD_DATA; + goto out; } for (i = 16 - padLen; i < 16; i++) { if (block[i] != padLen) { - return BAD_DATA; + rval = BAD_DATA; + goto out; } } memcpy(outBuffer, block, 16 - padLen); @@ -424,11 +427,13 @@ int rijndael_padDecrypt(cipherInstance *cipher, keyIns ((u_int32_t*)block)[3] ^= iv[3]; padLen = block[15]; if (padLen <= 0 || padLen > 16) { - return BAD_DATA; + rval = BAD_DATA; + goto out; } for (i = 16 - padLen; i < 16; i++) { if (block[i] != padLen) { - return BAD_DATA; + rval = BAD_DATA; + goto out; } } memcpy(outBuffer, block, 16 - padLen); @@ -438,5 +443,9 @@ int rijndael_padDecrypt(cipherInstance *cipher, keyIns return BAD_CIPHER_STATE; } - return 16*numBlocks - padLen; + rval = 16*numBlocks - padLen; + +out: + explicit_bzero(block, sizeof(block)); + return rval; } From owner-svn-src-head@freebsd.org Fri Oct 26 20:55:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A19B910884E7; Fri, 26 Oct 2018 20:55:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5688A8742B; Fri, 26 Oct 2018 20:55:02 +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 33B3C261FC; Fri, 26 Oct 2018 20:55:02 +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 w9QKt1or086235; Fri, 26 Oct 2018 20:55:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QKt1mg086234; Fri, 26 Oct 2018 20:55:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810262055.w9QKt1mg086234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 20:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339788 - 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: 339788 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, 26 Oct 2018 20:55:02 -0000 Author: cem Date: Fri Oct 26 20:55:01 2018 New Revision: 339788 URL: https://svnweb.freebsd.org/changeset/base/339788 Log: Fortuna: fix a correctness issue in reseed (fortuna_pre_read) 'i' counts the number of pools included in the array 's'. Passing 'i+1' to reseed_internal() as the number of blocks in 's' is a bogus overrun of the initialized portion of 's' -- technically UB. I found this via code inspection, referencing §9.5.2 "Pools" of the Fortuna chapter, but I would expect Coverity to notice the same issue. Unfortunately, it doesn't appear to. Reviewed by: markm Approved by: secteam (gordon) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16985 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Oct 26 20:53:01 2018 (r339787) +++ head/sys/dev/random/fortuna.c Fri Oct 26 20:55:01 2018 (r339788) @@ -408,7 +408,7 @@ random_fortuna_pre_read(void) SDT_PROBE2(random, fortuna, event_processor, debug, fortuna_state.fs_reseedcount, fortuna_state.fs_pool); #endif /* FS&K */ - random_fortuna_reseed_internal(s, i < RANDOM_FORTUNA_NPOOLS ? i + 1 : RANDOM_FORTUNA_NPOOLS); + random_fortuna_reseed_internal(s, i); /* Clean up and secure */ explicit_bzero(s, sizeof(s)); explicit_bzero(temp, sizeof(temp)); From owner-svn-src-head@freebsd.org Fri Oct 26 21:00:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C58610885FD; Fri, 26 Oct 2018 21:00: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4B1487641; Fri, 26 Oct 2018 21:00:26 +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 B1E232620B; Fri, 26 Oct 2018 21:00:26 +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 w9QL0Q0T086536; Fri, 26 Oct 2018 21:00:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QL0Q5a086535; Fri, 26 Oct 2018 21:00:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810262100.w9QL0Q5a086535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 21:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339789 - 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: 339789 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, 26 Oct 2018 21:00:27 -0000 Author: cem Date: Fri Oct 26 21:00:26 2018 New Revision: 339789 URL: https://svnweb.freebsd.org/changeset/base/339789 Log: fortuna: Drop global lock to zero stack variables Also drop explicit zeroing of hash context -- hash finish() operation is expected to do this. PR: 230877 Suggested by: delphij@ Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16986 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Oct 26 20:55:01 2018 (r339788) +++ head/sys/dev/random/fortuna.c Fri Oct 26 21:00:26 2018 (r339789) @@ -374,47 +374,50 @@ random_fortuna_pre_read(void) now = getsbinuptime(); #endif - if (fortuna_state.fs_pool[0].fsp_length >= fortuna_state.fs_minpoolsize + if (fortuna_state.fs_pool[0].fsp_length < fortuna_state.fs_minpoolsize #ifdef _KERNEL /* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ - && (now - fortuna_state.fs_lasttime > SBT_1S/10) + || (now - fortuna_state.fs_lasttime <= SBT_1S/10) #endif ) { + RANDOM_RESEED_UNLOCK(); + return; + } + #ifdef _KERNEL - fortuna_state.fs_lasttime = now; + fortuna_state.fs_lasttime = now; #endif - /* FS&K - ReseedCNT = ReseedCNT + 1 */ - fortuna_state.fs_reseedcount++; - /* s = \epsilon at start */ - for (i = 0; i < RANDOM_FORTUNA_NPOOLS; i++) { - /* FS&K - if Divides(ReseedCnt, 2^i) ... */ - if ((fortuna_state.fs_reseedcount % (1 << i)) == 0) { - /*- - * FS&K - temp = (P_i) - * - P_i = \epsilon - * - s = s|H(temp) - */ - randomdev_hash_finish(&fortuna_state.fs_pool[i].fsp_hash, temp); - randomdev_hash_init(&fortuna_state.fs_pool[i].fsp_hash); - fortuna_state.fs_pool[i].fsp_length = 0; - randomdev_hash_init(&context); - randomdev_hash_iterate(&context, temp, RANDOM_KEYSIZE); - randomdev_hash_finish(&context, s + i*RANDOM_KEYSIZE_WORDS); - } else - break; - } + /* FS&K - ReseedCNT = ReseedCNT + 1 */ + fortuna_state.fs_reseedcount++; + /* s = \epsilon at start */ + for (i = 0; i < RANDOM_FORTUNA_NPOOLS; i++) { + /* FS&K - if Divides(ReseedCnt, 2^i) ... */ + if ((fortuna_state.fs_reseedcount % (1 << i)) == 0) { + /*- + * FS&K - temp = (P_i) + * - P_i = \epsilon + * - s = s|H(temp) + */ + randomdev_hash_finish(&fortuna_state.fs_pool[i].fsp_hash, temp); + randomdev_hash_init(&fortuna_state.fs_pool[i].fsp_hash); + fortuna_state.fs_pool[i].fsp_length = 0; + randomdev_hash_init(&context); + randomdev_hash_iterate(&context, temp, RANDOM_KEYSIZE); + randomdev_hash_finish(&context, s + i*RANDOM_KEYSIZE_WORDS); + } else + break; + } #ifdef _KERNEL - SDT_PROBE2(random, fortuna, event_processor, debug, fortuna_state.fs_reseedcount, fortuna_state.fs_pool); + SDT_PROBE2(random, fortuna, event_processor, debug, fortuna_state.fs_reseedcount, fortuna_state.fs_pool); #endif - /* FS&K */ - random_fortuna_reseed_internal(s, i); - /* Clean up and secure */ - explicit_bzero(s, sizeof(s)); - explicit_bzero(temp, sizeof(temp)); - explicit_bzero(&context, sizeof(context)); - } + /* FS&K */ + random_fortuna_reseed_internal(s, i); RANDOM_RESEED_UNLOCK(); + + /* Clean up and secure */ + explicit_bzero(s, sizeof(s)); + explicit_bzero(temp, sizeof(temp)); } /*- From owner-svn-src-head@freebsd.org Fri Oct 26 21:03:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B921310887D9; Fri, 26 Oct 2018 21:03:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60AC369D89; Fri, 26 Oct 2018 21:03:58 +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 3BDAA263A3; Fri, 26 Oct 2018 21:03:58 +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 w9QL3wug091350; Fri, 26 Oct 2018 21:03:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QL3vJe091349; Fri, 26 Oct 2018 21:03:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810262103.w9QL3vJe091349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 26 Oct 2018 21:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339790 - 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: 339790 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, 26 Oct 2018 21:03:58 -0000 Author: cem Date: Fri Oct 26 21:03:57 2018 New Revision: 339790 URL: https://svnweb.freebsd.org/changeset/base/339790 Log: Fortuna: Add failpoints to simulate initial seeding conditions Set debug.fail_point.random_fortuna_pre_read=return(1) and debug.fail_point.random_fortuna_seeded=return(1) to return to unseeded status (sort of). See the Differential URL for more detail. The goal is to reproduce e.g. Lev's recent CURRENT report[1] about failing newfs arc4random(3) usage (fixed in r338542). No functional change when failpoints are not set. [1]: https://lists.freebsd.org/pipermail/freebsd-current/2018-September/071067.html Reported by: lev Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17047 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Oct 26 21:00:26 2018 (r339789) +++ head/sys/dev/random/fortuna.c Fri Oct 26 21:03:57 2018 (r339790) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include +#include #include #include #include @@ -385,6 +386,18 @@ random_fortuna_pre_read(void) } #ifdef _KERNEL + /* + * When set, pretend we do not have enough entropy to reseed yet. + */ + KFAIL_POINT_CODE(DEBUG_FP, random_fortuna_pre_read, { + if (RETURN_VALUE != 0) { + RANDOM_RESEED_UNLOCK(); + return; + } + }); +#endif + +#ifdef _KERNEL fortuna_state.fs_lasttime = now; #endif @@ -441,6 +454,14 @@ random_fortuna_read(uint8_t *buf, u_int bytecount) bool random_fortuna_seeded(void) { + +#ifdef _KERNEL + /* When set, act as if we are not seeded. */ + KFAIL_POINT_CODE(DEBUG_FP, random_fortuna_seeded, { + if (RETURN_VALUE != 0) + fortuna_state.fs_counter = UINT128_ZERO; + }); +#endif return (!uint128_is_zero(fortuna_state.fs_counter)); } From owner-svn-src-head@freebsd.org Fri Oct 26 21:04:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B203B1088804; Fri, 26 Oct 2018 21:04:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64A0069EF1; Fri, 26 Oct 2018 21:04:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CFF5263AF; Fri, 26 Oct 2018 21:04:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QL4IOt091412; Fri, 26 Oct 2018 21:04:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QL4H0O091410; Fri, 26 Oct 2018 21:04:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810262104.w9QL4H0O091410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 26 Oct 2018 21:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339791 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 339791 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, 26 Oct 2018 21:04:19 -0000 Author: tuexen Date: Fri Oct 26 21:04:17 2018 New Revision: 339791 URL: https://svnweb.freebsd.org/changeset/base/339791 Log: Add initial descriptions for SCTP related MIB variable. This work was mostly done by Marie-Helene Kvello-Aune. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3583 Modified: head/share/man/man4/sctp.4 head/sys/netinet/sctp_sysctl.h Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Fri Oct 26 21:03:57 2018 (r339790) +++ head/share/man/man4/sctp.4 Fri Oct 26 21:04:17 2018 (r339791) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2006 +.Dd October 10, 2018 .Dt SCTP 4 .Os .Sh NAME @@ -145,7 +145,7 @@ with no regard to the ordering of any other message. The FreeBSD implementation of .Tn SCTP also supports the following extensions: -.Bl -hang -width indent +.Bl -tag -width "sctp partial reliability" .It "sctp partial reliability" This extension allows one to have message be skipped and not delivered based on some user specified parameters. @@ -168,7 +168,7 @@ utilization. This extension allows a user on either side to reset the stream sequence numbers used by any or all streams. .El -.Pp +.Ss Socket Options .Tn SCTP supports a number of socket options which can be set with .Xr setsockopt 2 @@ -176,7 +176,7 @@ and tested with .Xr getsockopt 2 or .Xr sctp_opt_info 3 : -.Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" +.Bl -tag -indent .It Dv SCTP_NODELAY Under most circumstances, .Tn SCTP @@ -409,6 +409,191 @@ Note that the peer endpoint must also support the stream reset extension as well. .El +.Ss MIB Variables +The +.Tn SCTP +protocol implements a number of variables in the +.Va net.inet.sctp +branch of the +.Xr sysctl 3 +MIB. +.Bl -ohang +.It Sy Congestion Control +.Bl -tag -width indent +.It Va default_cc_module +Default congestion control module. +Default value is 0. +The minimum is 0, and the maximum is 3. +A value of 0 enables the default congestion control algorithm. +A value of 1 enables the High Speed congestion control algorithm. +A value of 2 enables the HTCP congestion control algorithm. +A value of 3 enables the data center congestion control (DCCC) algorithm. +.It Va initial_cwnd +Defines the initial congestion window size in MTUs. +.It Va cwnd_maxburst +Use congestion control instead of 'blind' logic to limit maximum burst when sending. +Default value is 1. May be set to 0 or 1. +.It Va ecn_enable +Enable Explicit Congestion Notification (ECN). +Default value is 1. May be set to 0 or 1. +.It Va rttvar_steady_step +Number of identical bandwidth measurements DCCC takes to try step down the congestion window. +Default value is 20. +The minimum is 0, and the maximum is 65535. +.It Va rttvar_eqret +Whether DCCC reduces the congestion window size when round-trip time and bandwidth remain unchanged. +Default value is 0. +May be set to 0 or 1. +.It Va rttvar_bw +Shift amount DCCC uses for bandwidth smoothing on round-trip-time calculation. +Default value is 4. +The minimum is 0, and the maximum is 32. +.It Va rttvar_rtt +Shift amount DCCC uses for round-trip-time smoothing on round-trip-time calculation. +Default value is 5. +The minimum is 0, and the maximum is 32. +.It Va use_dcccecn +Enable ECN when using DCCC. +Default value is 1. +May be set to 0 or 1. +.El +.It Sy Misc +.Bl -tag -width indent +.It Va getcred +Get the ucred of a SCTP connection. +.It Va assoclist +List of active SCTP associations. +.It Va stats +SCTP statistics (struct sctp_stat). +.It Va diag_info_code +Diagnostic information error cause code. +.It Va blackhole +Enable SCTP blackholing. +See +.Xr blackhole 4 +for more details. +.It Va buffer_splitting +Enable send/receive buffer splitting. +.It Va vtag_time_wait +Vtag wait time in seconds, 0 to disable. +.It Va nat_friendly_init +Enable sending of the NAT-friendly SCTP option on INITs. +.It Va enable_sack_immediately +Enable sending of the SACK-IMMEDIATELY bit. +.It Va udp_tunneling_port +Set the SCTP/UDP tunneling port. +.It Va mobility_fasthandoff +Enable SCTP fast handoff. +.It Va mobility_base +Enable SCTP base mobility +.It Va default_frag_interleave +Default fragment interleave level. +.It Va default_ss_module +Default stream scheduling module. +.It Va log_level +Ltrace/KTR trace logging level. +.It Va max_retran_chunk +Number of retransmissions of a DATA chunk before an association is aborted. +.It Va min_residual +Minimum residual data chunk in second part of split. +.It Va strict_data_order +Enforce strict data ordering, abort if control inside data. +.It Va abort_at_limit +Abort when one-to-one hits qlimit. +.It Va hb_max_burst +Confirmation heartbeat max burst. +.It Va do_sctp_drain +Flush chunks in receive queues with TSN higher than the cumulative TSN if the +system is low on mbufs. +.It Va max_chained_mbufs +Default max number of small mbufs on a chain. +.It Va abc_l_var +SCTP ABC max increase per SACK (L). +.It Va nat_friendly +SCTP NAT friendly operation. +.It Va cmt_use_dac +CMT DAC on/off flag. +.It Va cmt_on_off +CMT settings. +.It Va outgoing_streams +Default number of outgoing streams. +.It Va incoming_streams +Default number of incoming streams. +.It Va add_more_on_output +When space-wise is it worthwhile to try to add more to a socket send buffer. +.It Va path_pf_threshold +Default potentially failed threshold. +.It Va path_rtx_max +Default maximum of retransmissions per path. +.It Va assoc_rtx_max +Default maximum number of retransmissions per association. +.It Va init_rtx_max +Default maximum number of retransmissions for INIT chunks. +.It Va valid_cookie_life +Default cookie lifetime in seconds. +.It Va init_rto_max +Default maximum retransmission timeout during association setup in ms. +.It Va rto_initial +Default initial retransmission timeout in ms. +.It Va rto_min +Default minimum retransmission timeout in ms. +.It Va rto_max +Default maximum retransmission timeout in ms. +.It Va secret_lifetime +Default secret lifetime in seconds. +.It Va shutdown_guard_time +Shutdown guard timer in seconds (0 means 5 times RTO.Max). +.It Va pmtu_raise_time +Default PMTU raise timer in seconds. +.It Va heartbeat_interval +Default heartbeat interval in ms. +.It Va asoc_resource +Max number of cached resources in an association. +.It Va sys_resource +Max number of cached resources in the system. +.It Va sack_freq +Default SACK frequency. +.It Va delayed_sack_time +Default delayed SACK timer in ms. +.It Va chunkscale +Tunable for scaling of number of chunks and messages. +.It Va min_split_point +Minimum size when splitting a chunk. +.It Va pcbhashsize +Tunable for PCB hash table sizes. +.It Va tcbhashsize +Tunable for TCB hash table sizes. +.It Va maxchunks +Default max chunks on queue per association. +.It Va fr_maxburst +Default max burst for SCTP endpoints when fast retransmitting. +.It Va maxburst +Default max burst for SCTP endpoints. +.It Va peer_chkoh +Amount to debit peers rwnd per chunk sent. +.It Va strict_sacks +Enable SCTP Strict SACK checking. +.It Va pktdrop_enable +Enable SCTP PKTDROP. +.It Va nrsack_enable +Enable SCTP NR-SACK. +.It Va reconfig_enable +Enable SCTP RE-CONFIG. +.It Va asconf_enable +Enable SCTP ASCONF. +.It Va auth_enable +Enable SCTP AUTH. +.It Va pr_enable +Enable PR-SCTP. +.It Va auto_asconf +Enable SCTP Auto-ASCONF. +.It Va recvspace +Maximum incoming SCTP buffer size. +.It Va sendspace +Maximum outgoing SCTP buffer size. +.El +.El + .Sh SEE ALSO .Xr accept 2 , .Xr bind 2 , @@ -418,4 +603,5 @@ as well. .Xr sctp_connectx 3 , .Xr sctp_opt_info 3 , .Xr sctp_recvmsg 3 , -.Xr sctp_sendmsg 3 +.Xr sctp_sendmsg 3 , +.Xr blackhole 4 Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Fri Oct 26 21:03:57 2018 (r339790) +++ head/sys/netinet/sctp_sysctl.h Fri Oct 26 21:04:17 2018 (r339791) @@ -212,7 +212,7 @@ struct sctp_sysctl { #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST /* fr_maxburst: Default max burst for sctp endpoints when fast retransmitting */ -#define SCTPCTL_FRMAXBURST_DESC "Default fr max burst for sctp endpoints" +#define SCTPCTL_FRMAXBURST_DESC "Default max burst for SCTP endpoints when fast retransmitting" #define SCTPCTL_FRMAXBURST_MIN 0 #define SCTPCTL_FRMAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_FRMAXBURST_DEFAULT SCTP_DEF_FRMAX_BURST @@ -243,7 +243,7 @@ struct sctp_sysctl { #define SCTPCTL_MIN_SPLIT_POINT_DEFAULT SCTP_DEFAULT_SPLIT_POINT_MIN /* chunkscale: Tunable for Scaling of number of chunks and messages */ -#define SCTPCTL_CHUNKSCALE_DESC "Tunable for Scaling of number of chunks and messages" +#define SCTPCTL_CHUNKSCALE_DESC "Tunable for scaling of number of chunks and messages" #define SCTPCTL_CHUNKSCALE_MIN 1 #define SCTPCTL_CHUNKSCALE_MAX 0xFFFFFFFF #define SCTPCTL_CHUNKSCALE_DEFAULT SCTP_CHUNKQUEUE_SCALE @@ -327,7 +327,7 @@ struct sctp_sysctl { #define SCTPCTL_VALID_COOKIE_LIFE_DEFAULT SCTP_DEFAULT_COOKIE_LIFE /* init_rtx_max: Default maximum number of retransmission for INIT chunks */ -#define SCTPCTL_INIT_RTX_MAX_DESC "Default maximum number of retransmission for INIT chunks" +#define SCTPCTL_INIT_RTX_MAX_DESC "Default maximum number of retransmissions for INIT chunks" #define SCTPCTL_INIT_RTX_MAX_MIN 0 #define SCTPCTL_INIT_RTX_MAX_MAX 0xFFFFFFFF #define SCTPCTL_INIT_RTX_MAX_DEFAULT SCTP_DEF_MAX_INIT @@ -380,8 +380,8 @@ struct sctp_sysctl { #define SCTPCTL_CMT_USE_DAC_MAX 1 #define SCTPCTL_CMT_USE_DAC_DEFAULT 0 -/* cwnd_maxburst: Use a CWND adjusting maxburst */ -#define SCTPCTL_CWND_MAXBURST_DESC "Use a CWND adjusting maxburst" +/* cwnd_maxburst: Use a CWND adjusting to implement maxburst */ +#define SCTPCTL_CWND_MAXBURST_DESC "Adjust congestion control window to limit maximum burst when sending" #define SCTPCTL_CWND_MAXBURST_MIN 0 #define SCTPCTL_CWND_MAXBURST_MAX 1 #define SCTPCTL_CWND_MAXBURST_DEFAULT 1 @@ -417,7 +417,7 @@ struct sctp_sysctl { #define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_HBMAX_BURST /* abort_at_limit: When one-2-one hits qlimit abort */ -#define SCTPCTL_ABORT_AT_LIMIT_DESC "When one-2-one hits qlimit abort" +#define SCTPCTL_ABORT_AT_LIMIT_DESC "Abort when one-to-one hits qlimit" #define SCTPCTL_ABORT_AT_LIMIT_MIN 0 #define SCTPCTL_ABORT_AT_LIMIT_MAX 1 #define SCTPCTL_ABORT_AT_LIMIT_DEFAULT 0 @@ -429,7 +429,7 @@ struct sctp_sysctl { #define SCTPCTL_MIN_RESIDUAL_DEFAULT 1452 /* max_retran_chunk: max chunk retransmissions */ -#define SCTPCTL_MAX_RETRAN_CHUNK_DESC "Maximum times an unlucky chunk can be retran'd before assoc abort" +#define SCTPCTL_MAX_RETRAN_CHUNK_DESC "Maximum times an unlucky chunk can be retransmitted before assoc abort" #define SCTPCTL_MAX_RETRAN_CHUNK_MIN 0 #define SCTPCTL_MAX_RETRAN_CHUNK_MAX 65535 #define SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT 30 @@ -477,63 +477,63 @@ struct sctp_sysctl { #define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT 0 /* Enable sending of the SACK-IMMEDIATELY bit */ -#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit." +#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit" #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN 0 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX 1 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX /* Enable sending of the NAT-FRIENDLY message */ -#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs." +#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs" #define SCTPCTL_NAT_FRIENDLY_INITS_MIN 0 #define SCTPCTL_NAT_FRIENDLY_INITS_MAX 1 #define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT SCTPCTL_NAT_FRIENDLY_INITS_MIN /* Vtag time wait in seconds */ -#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it." +#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it" #define SCTPCTL_TIME_WAIT_MIN 0 #define SCTPCTL_TIME_WAIT_MAX 0xffffffff #define SCTPCTL_TIME_WAIT_DEFAULT SCTP_TIME_WAIT /* Enable Send/Receive buffer splitting */ -#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting." +#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting" #define SCTPCTL_BUFFER_SPLITTING_MIN 0 #define SCTPCTL_BUFFER_SPLITTING_MAX 0x3 #define SCTPCTL_BUFFER_SPLITTING_DEFAULT SCTPCTL_BUFFER_SPLITTING_MIN -/* Initial congestion window in MTU */ -#define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs" +/* Initial congestion window in MTUs */ +#define SCTPCTL_INITIAL_CWND_DESC "Defines the initial congestion window size in MTUs" #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 /* rttvar smooth avg for bw calc */ -#define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smoothing on rtt calc" +#define SCTPCTL_RTTVAR_BW_DESC "Shift amount DCCC uses for bw smoothing on rtt calc" #define SCTPCTL_RTTVAR_BW_MIN 0 #define SCTPCTL_RTTVAR_BW_MAX 32 #define SCTPCTL_RTTVAR_BW_DEFAULT 4 /* rttvar smooth avg for bw calc */ -#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount for rtt smoothing on rtt calc" +#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount DCCC uses for rtt smoothing on rtt calc" #define SCTPCTL_RTTVAR_RTT_MIN 0 #define SCTPCTL_RTTVAR_RTT_MAX 32 #define SCTPCTL_RTTVAR_RTT_DEFAULT 5 -#define SCTPCTL_RTTVAR_EQRET_DESC "What to return when rtt and bw are unchanged" +#define SCTPCTL_RTTVAR_EQRET_DESC "Whether DCCC increases cwnd when the rtt and bw are unchanged" #define SCTPCTL_RTTVAR_EQRET_MIN 0 #define SCTPCTL_RTTVAR_EQRET_MAX 1 #define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 -#define SCTPCTL_RTTVAR_STEADYS_DESC "How many the sames it takes to try step down of cwnd" +#define SCTPCTL_RTTVAR_STEADYS_DESC "Number of identical bw measurements DCCC takes to try step down of cwnd" #define SCTPCTL_RTTVAR_STEADYS_MIN 0 #define SCTPCTL_RTTVAR_STEADYS_MAX 0xFFFF #define SCTPCTL_RTTVAR_STEADYS_DEFAULT 20 /* 0 means disable feature */ -#define SCTPCTL_RTTVAR_DCCCECN_DESC "Enable for RTCC CC datacenter ECN" +#define SCTPCTL_RTTVAR_DCCCECN_DESC "Enable ECN for DCCC." #define SCTPCTL_RTTVAR_DCCCECN_MIN 0 #define SCTPCTL_RTTVAR_DCCCECN_MAX 1 #define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */ -#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing. See blackhole(4) for more details." +#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing, see blackhole(4) for more details" #define SCTPCTL_BLACKHOLE_MIN 0 #define SCTPCTL_BLACKHOLE_MAX 2 #define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN @@ -553,7 +553,7 @@ struct sctp_sysctl { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP." +#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP" #define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 #define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 #define SCTPCTL_OUTPUT_UNLOCKED_DEFAULT SCTPCTL_OUTPUT_UNLOCKED_MIN From owner-svn-src-head@freebsd.org Fri Oct 26 21:17:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97C011088BA8; Fri, 26 Oct 2018 21:17:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC546A67D; Fri, 26 Oct 2018 21:17:07 +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 193102655D; Fri, 26 Oct 2018 21:17:07 +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 w9QLH6ZX096705; Fri, 26 Oct 2018 21:17:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QLH6gU096703; Fri, 26 Oct 2018 21:17:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810262117.w9QLH6gU096703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Oct 2018 21:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339793 - head/bin/setfacl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/setfacl X-SVN-Commit-Revision: 339793 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, 26 Oct 2018 21:17:07 -0000 Author: markj Date: Fri Oct 26 21:17:06 2018 New Revision: 339793 URL: https://svnweb.freebsd.org/changeset/base/339793 Log: Don't set NFSv4 ACL inheritance flags on non-directories. They only make sense in the context of directory ACLs, and attempting to set them on regular files results in errors, causing a recursive setfacl invocation to abort. This is derived from patches by Shawn Webb and Mitchell Horne . PR: 155163 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15061 Modified: head/bin/setfacl/setfacl.1 head/bin/setfacl/setfacl.c Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Fri Oct 26 21:15:36 2018 (r339792) +++ head/bin/setfacl/setfacl.1 Fri Oct 26 21:17:06 2018 (r339793) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2018 +.Dd October 26, 2018 .Dt SETFACL 1 .Os .Sh NAME @@ -136,6 +136,8 @@ option is specified, no symbolic links are followed. This is the default. .It Fl R Perform the action recursively on any specified directories. +When modifying or adding NFSv4 ACL entries, inheritance flags +are applied only to directories. .It Fl x Ar entries | position If .Ar entries Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Fri Oct 26 21:15:36 2018 (r339792) +++ head/bin/setfacl/setfacl.c Fri Oct 26 21:17:06 2018 (r339793) @@ -27,9 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#include #include -#include #include #include @@ -73,6 +71,7 @@ static bool need_mask; static acl_type_t acl_type = ACL_TYPE_ACCESS; static int handle_file(FTS *ftsp, FTSENT *file); +static acl_t clear_inheritance_flags(acl_t acl); static char **stdin_files(void); static void usage(void); @@ -124,10 +123,57 @@ stdin_files(void) return (files_list); } +/* + * Remove any inheritance flags from NFSv4 ACLs when running in recursive + * mode. This is to avoid files being assigned identical ACLs to their + * parent directory while also being set to inherit them. + * + * The acl argument is assumed to be valid. + */ +static acl_t +clear_inheritance_flags(acl_t acl) +{ + acl_t nacl; + acl_entry_t acl_entry; + acl_flagset_t acl_flagset; + int acl_brand, entry_id; + + (void)acl_get_brand_np(acl, &acl_brand); + if (acl_brand != ACL_BRAND_NFS4) + return (acl); + + nacl = acl_dup(acl); + if (nacl == NULL) { + warn("acl_dup() failed"); + return (acl); + } + + entry_id = ACL_FIRST_ENTRY; + while (acl_get_entry(nacl, entry_id, &acl_entry) == 1) { + entry_id = ACL_NEXT_ENTRY; + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + warn("acl_get_flagset_np() failed"); + continue; + } + if (acl_get_flag_np(acl_flagset, ACL_ENTRY_INHERIT_ONLY) == 1) { + if (acl_delete_entry(nacl, acl_entry) != 0) + warn("acl_delete_entry() failed"); + continue; + } + if (acl_delete_flag_np(acl_flagset, + ACL_ENTRY_FILE_INHERIT | + ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_NO_PROPAGATE_INHERIT) != 0) + warn("acl_delete_flag_np() failed"); + } + + return (nacl); +} + static int handle_file(FTS *ftsp, FTSENT *file) { - acl_t acl; + acl_t acl, nacl; acl_entry_t unused_entry; int local_error, ret; struct sf_entry *entry; @@ -193,17 +239,20 @@ handle_file(FTS *ftsp, FTSENT *file) /* Cycle through each option. */ TAILQ_FOREACH(entry, &entrylist, next) { - if (local_error) - continue; - - switch(entry->op) { + nacl = entry->acl; + switch (entry->op) { case OP_ADD_ACL: - local_error += add_acl(entry->acl, entry->entry_number, - &acl, file->fts_path); + if (R_flag && file->fts_info != FTS_D && + acl_type == ACL_TYPE_NFS4) + nacl = clear_inheritance_flags(nacl); + local_error += add_acl(nacl, entry->entry_number, &acl, + file->fts_path); break; case OP_MERGE_ACL: - local_error += merge_acl(entry->acl, &acl, - file->fts_path); + if (R_flag && file->fts_info != FTS_D && + acl_type == ACL_TYPE_NFS4) + nacl = clear_inheritance_flags(nacl); + local_error += merge_acl(nacl, &acl, file->fts_path); need_mask = true; break; case OP_REMOVE_EXT: @@ -240,8 +289,7 @@ handle_file(FTS *ftsp, FTSENT *file) need_mask = false; break; case OP_REMOVE_ACL: - local_error += remove_acl(entry->acl, &acl, - file->fts_path); + local_error += remove_acl(nacl, &acl, file->fts_path); need_mask = true; break; case OP_REMOVE_BY_NUMBER: @@ -250,6 +298,13 @@ handle_file(FTS *ftsp, FTSENT *file) need_mask = true; break; } + + if (nacl != entry->acl) { + acl_free(nacl); + nacl = NULL; + } + if (local_error) + break; } ret = 0; From owner-svn-src-head@freebsd.org Fri Oct 26 21:17:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EAC81088BFD; Fri, 26 Oct 2018 21:17:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3385C6A807; Fri, 26 Oct 2018 21:17:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14B2626571; Fri, 26 Oct 2018 21:17:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QLHodo096796; Fri, 26 Oct 2018 21:17:50 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QLHoG6096795; Fri, 26 Oct 2018 21:17:50 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201810262117.w9QLHoG6096795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 26 Oct 2018 21:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339794 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 339794 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, 26 Oct 2018 21:17:51 -0000 Author: mm Date: Fri Oct 26 21:17:50 2018 New Revision: 339794 URL: https://svnweb.freebsd.org/changeset/base/339794 Log: MFV r339792: Sync libarchive with vendor. Relevant vendor changes: RAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build MFC after: 1 month Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Oct 26 21:17:06 2018 (r339793) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Fri Oct 26 21:17:50 2018 (r339794) @@ -1281,8 +1281,12 @@ static int process_head_file(struct archive_read* a, s struct archive_entry* entry, size_t block_flags) { ssize_t extra_data_size = 0; - size_t data_size, file_flags, file_attr, compression_info, host_os, - name_size; + size_t data_size = 0; + size_t file_flags = 0; + size_t file_attr = 0; + size_t compression_info = 0; + size_t host_os = 0; + size_t name_size = 0; uint64_t unpacked_size; uint32_t mtime = 0, crc; int c_method = 0, c_version = 0, is_dir; @@ -1297,7 +1301,7 @@ static int process_head_file(struct archive_read* a, s } if(block_flags & HFL_EXTRA_DATA) { - size_t edata_size; + size_t edata_size = 0; if(!read_var_sized(a, &edata_size, NULL)) return ARCHIVE_EOF; From owner-svn-src-head@freebsd.org Fri Oct 26 21:20:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 390861088D97; Fri, 26 Oct 2018 21:20:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E31276AC17; Fri, 26 Oct 2018 21:20:07 +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 D2AA226579; Fri, 26 Oct 2018 21:20:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QLK42A097870; Fri, 26 Oct 2018 21:20:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QLK4AA097834; Fri, 26 Oct 2018 21:20:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810262120.w9QLK4AA097834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Oct 2018 21:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339795 - head/tests/sys/acl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/acl X-SVN-Commit-Revision: 339795 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, 26 Oct 2018 21:20:08 -0000 Author: markj Date: Fri Oct 26 21:20:04 2018 New Revision: 339795 URL: https://svnweb.freebsd.org/changeset/base/339795 Log: Add a very basic regression test for setfacl -R with NFSv4 ACLs. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/acl/tools-nfs4-psarc.test head/tests/sys/acl/tools-nfs4.test Modified: head/tests/sys/acl/tools-nfs4-psarc.test ============================================================================== --- head/tests/sys/acl/tools-nfs4-psarc.test Fri Oct 26 21:17:50 2018 (r339794) +++ head/tests/sys/acl/tools-nfs4-psarc.test Fri Oct 26 21:20:04 2018 (r339795) @@ -557,6 +557,29 @@ $ rmdir yyy $ rm xxx $ cd .. $ rmdir ddd - $ rm xxx +# Test basic recursive setting of ACLs. +$ mkdir ddd +$ touch ddd/xxx +$ mkdir ddd/eee +$ touch ddd/eee/yyy +$ setfacl -R -m owner@:full_set:f:allow,group@:full_set::allow,everyone@:full_set::allow ddd +$ getfacl -q ddd +> owner@:rwxpDdaARWcCos:f------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/xxx +> owner@:rwxpDdaARWcCos:-------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee +> owner@:rwxpDdaARWcCos:f------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee/yyy +> owner@:rwxpDdaARWcCos:-------:allow +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:rwxpDdaARWcCos:-------:allow + +$ rm -r ddd Modified: head/tests/sys/acl/tools-nfs4.test ============================================================================== --- head/tests/sys/acl/tools-nfs4.test Fri Oct 26 21:17:50 2018 (r339794) +++ head/tests/sys/acl/tools-nfs4.test Fri Oct 26 21:20:04 2018 (r339795) @@ -823,6 +823,41 @@ $ rmdir yyy $ rm xxx $ cd .. $ rmdir ddd - $ rm xxx +# Test basic recursive setting of ACLs. +$ mkdir ddd +$ touch ddd/xxx +$ mkdir ddd/eee +$ touch ddd/eee/yyy +$ setfacl -R -m owner@:full_set:f:allow,group@:full_set::allow,everyone@:full_set::allow ddd +$ getfacl -q ddd +> owner@:--------------:-------:deny +> owner@:rwxpDdaARWcCos:f------:allow +> group@:-w-p----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-w-p---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/xxx +> owner@:--x-----------:-------:deny +> owner@:rwxpDdaARWcCos:-------:allow +> group@:-wxp----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee +> owner@:--------------:-------:deny +> owner@:rwxpDdaARWcCos:f------:allow +> group@:-w-p----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-w-p---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow +$ getfacl -q ddd/eee/yyy +> owner@:--x-----------:-------:deny +> owner@:rwxpDdaARWcCos:-------:allow +> group@:-wxp----------:-------:deny +> group@:rwxpDdaARWcCos:-------:allow +> everyone@:-wxp---A-W-Co-:-------:deny +> everyone@:rwxpDdaARWcCos:-------:allow + +$ rm -r ddd From owner-svn-src-head@freebsd.org Fri Oct 26 21:57:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BFE510C9288; Fri, 26 Oct 2018 21:57:23 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6A936CBD7; Fri, 26 Oct 2018 21:57:22 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A24BB26BF1; Fri, 26 Oct 2018 21:57:22 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QLvMwm019093; Fri, 26 Oct 2018 21:57:22 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QLvMow019092; Fri, 26 Oct 2018 21:57:22 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201810262157.w9QLvMow019092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 26 Oct 2018 21:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339796 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 339796 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, 26 Oct 2018 21:57:23 -0000 Author: bcran Date: Fri Oct 26 21:57:22 2018 New Revision: 339796 URL: https://svnweb.freebsd.org/changeset/base/339796 Log: Simplify the EFI delay() function by calling BS->Stall() Differential Revision: https://reviews.freebsd.org/D16753 Modified: head/stand/efi/libefi/delay.c Modified: head/stand/efi/libefi/delay.c ============================================================================== --- head/stand/efi/libefi/delay.c Fri Oct 26 21:20:04 2018 (r339795) +++ head/stand/efi/libefi/delay.c Fri Oct 26 21:57:22 2018 (r339796) @@ -33,15 +33,5 @@ __FBSDID("$FreeBSD$"); void delay(int usecs) { - static EFI_EVENT ev = 0; - UINTN junk; - - if (!ev) { - if (BS->CreateEvent(EVT_TIMER, TPL_APPLICATION, 0, 0, &ev) - != EFI_SUCCESS) - return; - } - - BS->SetTimer(ev, TimerRelative, usecs * 10); - BS->WaitForEvent(1, &ev, &junk); + BS->Stall(usecs); } From owner-svn-src-head@freebsd.org Fri Oct 26 22:13:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 246F910C9AFE; Fri, 26 Oct 2018 22: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFEE96D746; Fri, 26 Oct 2018 22: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 B149D26F29; Fri, 26 Oct 2018 22: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 w9QMDeuE029329; Fri, 26 Oct 2018 22:13:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QMDe9X029327; Fri, 26 Oct 2018 22:13:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810262213.w9QMDe9X029327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 22:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339797 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 339797 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, 26 Oct 2018 22:13:41 -0000 Author: imp Date: Fri Oct 26 22:13:40 2018 New Revision: 339797 URL: https://svnweb.freebsd.org/changeset/base/339797 Log: Implenent --fromfile to read variable values when printing variables So ./efivar --fromfile Boot0001.bin --print --load-option will take the value from Boot0001.bin file and then decode it as if it were a load-option. This is useful for debugging handling of such variables that may be hanging the boot for some people. Sponsored by: Netflix, Inc Modified: head/usr.sbin/efivar/efivar.8 head/usr.sbin/efivar/efivar.c Modified: head/usr.sbin/efivar/efivar.8 ============================================================================== --- head/usr.sbin/efivar/efivar.8 Fri Oct 26 21:57:22 2018 (r339796) +++ head/usr.sbin/efivar/efivar.8 Fri Oct 26 22:13:40 2018 (r339797) @@ -86,8 +86,17 @@ This flag implies .Fl -write unless the .Fl -append -flag is given. -This behavior is not well understood and is currently unimplemented. +or +.Fl -print +flags are given. +This behavior is not well understood and is currently unimplemented +for writes. +When +.Fl -print +is specified, the contents of the file are used as the value to +print using any other specified flags. +This is used primarily for testing purposes for more complicated +variable decoding. .It Fl a Fl -append Append the specified value to the UEFI variable rather than replacing it. Modified: head/usr.sbin/efivar/efivar.c ============================================================================== --- head/usr.sbin/efivar/efivar.c Fri Oct 26 21:57:22 2018 (r339796) +++ head/usr.sbin/efivar/efivar.c Fri Oct 26 22:13:40 2018 (r339797) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ static struct option longopts[] = { static int aflag, Aflag, bflag, dflag, Dflag, gflag, Hflag, Nflag, lflag, Lflag, Rflag, wflag, pflag, uflag, load_opt_flag; static char *varname; +static char *fromfile; static u_long attrib = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; static void @@ -183,16 +185,32 @@ print_var(efi_guid_t *guid, char *name) uint32_t att; uint8_t *data; size_t datalen; - char *gname; + char *gname = NULL; int rv; - pretty_guid(guid, &gname); - if (pflag) { - rv = efi_get_variable(*guid, name, &data, &datalen, &att); + if (guid) + pretty_guid(guid, &gname); + if (pflag || fromfile) { + if (fromfile) { + int fd; - if (rv < 0) - err(1, "%s-%s", gname, name); + fd = open(fromfile, O_RDONLY); + if (fd < 0) + err(1, "open %s", fromfile); + data = malloc(64 * 1024); + if (data == NULL) + err(1, "malloc"); + datalen = read(fd, data, 64 * 1024); + if (datalen <= 0) + err(1, "read"); + close(fd); + } else { + rv = efi_get_variable(*guid, name, &data, &datalen, &att); + if (rv < 0) + err(1, "fetching %s-%s", gname, name); + } + if (!Nflag) printf("%s-%s\n", gname, name); if (load_opt_flag) @@ -310,6 +328,9 @@ parse_args(int argc, char **argv) wflag++; break; case 'f': + free(fromfile); + fromfile = strdup(optarg); + break; case 0: errx(1, "unknown or unimplemented option\n"); break; @@ -343,7 +364,10 @@ parse_args(int argc, char **argv) write_variable(varname, NULL); else if (Lflag) print_known_guid(); - else if (varname) { + else if (fromfile) { + Nflag = 1; + print_var(NULL, NULL); + } else if (varname) { pflag++; print_variable(varname); } else if (argc > 0) { From owner-svn-src-head@freebsd.org Fri Oct 26 22:49:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1081610CB94F; Fri, 26 Oct 2018 22:49: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAFEE6E6AF; Fri, 26 Oct 2018 22:49: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 9D74F27412; Fri, 26 Oct 2018 22:49: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 w9QMnPkp045146; Fri, 26 Oct 2018 22:49:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QMnPkc045145; Fri, 26 Oct 2018 22:49:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810262249.w9QMnPkc045145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 22:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339798 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 339798 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, 26 Oct 2018 22:49:26 -0000 Author: imp Date: Fri Oct 26 22:49:25 2018 New Revision: 339798 URL: https://svnweb.freebsd.org/changeset/base/339798 Log: Require that we have at least a device path header before trying to decode the next device path. Sponsored by: Netflix, Inc Modified: head/usr.sbin/efivar/efiutil.c Modified: head/usr.sbin/efivar/efiutil.c ============================================================================== --- head/usr.sbin/efivar/efiutil.c Fri Oct 26 22:13:40 2018 (r339797) +++ head/usr.sbin/efivar/efiutil.c Fri Oct 26 22:49:25 2018 (r339798) @@ -159,7 +159,7 @@ efi_print_load_option(uint8_t *data, size_t datalen, i ucs2_to_utf8(descr, &str); printf("%s", str); free(str); - while (dp < edp) { + while (dp < edp && (size_t)(edp - dp) > sizeof(efidp_header)) { efidp_format_device_path(buf, sizeof(buf), dp, (intptr_t)(void *)edp - (intptr_t)(void *)dp); dp = (efidp)((char *)dp + efidp_size(dp)); From owner-svn-src-head@freebsd.org Fri Oct 26 22:49:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1397C10CB988; Fri, 26 Oct 2018 22:49:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789E56E7A4; Fri, 26 Oct 2018 22:49: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 AD13D27413; Fri, 26 Oct 2018 22:49: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 w9QMna58045200; Fri, 26 Oct 2018 22:49:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QMnaKZ045199; Fri, 26 Oct 2018 22:49:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810262249.w9QMnaKZ045199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 22:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339799 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 339799 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, 26 Oct 2018 22:49:39 -0000 Author: imp Date: Fri Oct 26 22:49:36 2018 New Revision: 339799 URL: https://svnweb.freebsd.org/changeset/base/339799 Log: Ensure that the device path is sane before trying to decode and print it. Sponsored by: Netflix, Inc Modified: head/lib/libefivar/efivar-dp-format.c Modified: head/lib/libefivar/efivar-dp-format.c ============================================================================== --- head/lib/libefivar/efivar-dp-format.c Fri Oct 26 22:49:25 2018 (r339798) +++ head/lib/libefivar/efivar-dp-format.c Fri Oct 26 22:49:36 2018 (r339799) @@ -2413,12 +2413,19 @@ UefiDevicePathLibConvertDevicePathToText ( } } - ssize_t efidp_format_device_path(char *buf, size_t len, const_efidp dp, ssize_t max) { char *str; ssize_t retval; + + /* + * Basic sanity check on the device path. + */ + if (!IsDevicePathValid((CONST EFI_DEVICE_PATH_PROTOCOL *) dp, max)) { + *buf = '\0'; + return 0; + } str = UefiDevicePathLibConvertDevicePathToText ( __DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp), FALSE, TRUE); From owner-svn-src-head@freebsd.org Fri Oct 26 23:08:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E4810CC2AD; Fri, 26 Oct 2018 23:08: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9A16F16D; Fri, 26 Oct 2018 23:08: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 0015E27752; Fri, 26 Oct 2018 23:08: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 w9QN8M2O055425; Fri, 26 Oct 2018 23:08:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QN8Mmk055424; Fri, 26 Oct 2018 23:08:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810262308.w9QN8Mmk055424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 23:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339800 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 339800 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, 26 Oct 2018 23:08:23 -0000 Author: imp Date: Fri Oct 26 23:08:22 2018 New Revision: 339800 URL: https://svnweb.freebsd.org/changeset/base/339800 Log: Ensure we have a full EFI_DEVICE_PATH header before we try to look at its length. Some BIOSes pad the length of the device path to an even amount. When we had a device path that was somehow an odd length, we'd wind up having 1 byte left that we were bogusly interpreting as a full device path. We'd then dereference 2 bytes into that to get a length of the node, which had undefined (and quite undesired) effects. Sponsored by: Netflix, Inc MFC After: 3 days Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Oct 26 22:49:36 2018 (r339799) +++ head/stand/efi/loader/main.c Fri Oct 26 23:08:22 2018 (r339800) @@ -349,7 +349,7 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, char * edp = (EFI_DEVICE_PATH *)(walker + fplen); if ((char *)edp > ep) return NOT_SPECIFIC; - while (dp < edp) { + while (dp < edp && (size_t)(edp - dp) > sizeof(EFI_DEVICE_PATH)) { text = efi_devpath_name(dp); if (text != NULL) { printf(" BootInfo Path: %S\n", text); From owner-svn-src-head@freebsd.org Fri Oct 26 23:44:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DB2010CCC46; Fri, 26 Oct 2018 23:44:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5686FFC7; Fri, 26 Oct 2018 23:44: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 26F0D27DAA; Fri, 26 Oct 2018 23:44: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 w9QNiecb075518; Fri, 26 Oct 2018 23:44:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QNieZN075517; Fri, 26 Oct 2018 23:44:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810262344.w9QNieZN075517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 23:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339801 - head/usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efivar X-SVN-Commit-Revision: 339801 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, 26 Oct 2018 23:44:40 -0000 Author: imp Date: Fri Oct 26 23:44:39 2018 New Revision: 339801 URL: https://svnweb.freebsd.org/changeset/base/339801 Log: Fix pointer arithmetic botch. Pointer subtraction to find size only works with char pointers. Noticed by: jhb@ Sponsored by: Netflix, Inc Modified: head/usr.sbin/efivar/efiutil.c Modified: head/usr.sbin/efivar/efiutil.c ============================================================================== --- head/usr.sbin/efivar/efiutil.c Fri Oct 26 23:08:22 2018 (r339800) +++ head/usr.sbin/efivar/efiutil.c Fri Oct 26 23:44:39 2018 (r339801) @@ -116,6 +116,8 @@ bindump(uint8_t *data, size_t datalen) #define LOAD_OPTION_ACTIVE 1 +#define SIZE(dp, edp) (size_t)((intptr_t)(void *)edp - (intptr_t)(void *)dp) + void efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int uflag) { @@ -159,9 +161,8 @@ efi_print_load_option(uint8_t *data, size_t datalen, i ucs2_to_utf8(descr, &str); printf("%s", str); free(str); - while (dp < edp && (size_t)(edp - dp) > sizeof(efidp_header)) { - efidp_format_device_path(buf, sizeof(buf), dp, - (intptr_t)(void *)edp - (intptr_t)(void *)dp); + while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { + efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); dp = (efidp)((char *)dp + efidp_size(dp)); printf(" %s\n", buf); } From owner-svn-src-head@freebsd.org Fri Oct 26 23:44:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 536CC10CCC7C; Fri, 26 Oct 2018 23:44:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBBD6700C5; Fri, 26 Oct 2018 23:44:53 +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 DCC0D27DAB; Fri, 26 Oct 2018 23:44:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9QNiox5075575; Fri, 26 Oct 2018 23:44:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9QNiocg075574; Fri, 26 Oct 2018 23:44:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810262344.w9QNiocg075574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Oct 2018 23:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339802 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 339802 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, 26 Oct 2018 23:44:57 -0000 Author: imp Date: Fri Oct 26 23:44:50 2018 New Revision: 339802 URL: https://svnweb.freebsd.org/changeset/base/339802 Log: Fix pointer arithmetic Pointer math to find the size in bytes only works with char types. Use correct pointer math to determine if we have enough of a header to look at or not. MFC After: 3 days X-MFX-With: r339800 Noticed by: jhb@ Sponsored by: Netflix, Inc Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Oct 26 23:44:39 2018 (r339801) +++ head/stand/efi/loader/main.c Fri Oct 26 23:44:50 2018 (r339802) @@ -298,6 +298,8 @@ fix_dosisms(char *p) } } +#define SIZE(dp, edp) (size_t)((intptr_t)(void *)edp - (intptr_t)(void *)dp) + enum { BOOT_INFO_OK = 0, BAD_CHOICE = 1, NOT_SPECIFIC = 2 }; static int match_boot_info(EFI_LOADED_IMAGE *img __unused, char *boot_info, size_t bisz) @@ -349,7 +351,7 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, char * edp = (EFI_DEVICE_PATH *)(walker + fplen); if ((char *)edp > ep) return NOT_SPECIFIC; - while (dp < edp && (size_t)(edp - dp) > sizeof(EFI_DEVICE_PATH)) { + while (dp < edp && SIZE(dp, edp) > sizeof(EFI_DEVICE_PATH)) { text = efi_devpath_name(dp); if (text != NULL) { printf(" BootInfo Path: %S\n", text); From owner-svn-src-head@freebsd.org Sat Oct 27 04:53:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8C8710D8827; Sat, 27 Oct 2018 04:53:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D5D17D269; Sat, 27 Oct 2018 04:53:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E7653BE9; Sat, 27 Oct 2018 04:53:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R4rQmQ040381; Sat, 27 Oct 2018 04:53:26 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R4rQWV040380; Sat, 27 Oct 2018 04:53:26 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810270453.w9R4rQWV040380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 04:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339807 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339807 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, 27 Oct 2018 04:53:27 -0000 Author: eugen Date: Sat Oct 27 04:53:25 2018 New Revision: 339807 URL: https://svnweb.freebsd.org/changeset/base/339807 Log: Prevent multicast code from panicing due to unprotected access to INADDR_HASH. PR: 220078 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sat Oct 27 04:45:28 2018 (r339806) +++ head/sys/netinet/in_mcast.c Sat Oct 27 04:53:25 2018 (r339807) @@ -1444,6 +1444,7 @@ static int inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt) { struct group_source_req gsr; + struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -1481,9 +1482,11 @@ inp_block_unblock_source(struct inpcb *inp, struct soc ssa->sin.sin_len = sizeof(struct sockaddr_in); ssa->sin.sin_addr = mreqs.imr_sourceaddr; - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + } if (sopt->sopt_name == IP_BLOCK_SOURCE) doblock = 1; @@ -1969,7 +1972,6 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sop * * Returns NULL if no ifp could be found. * - * SMPng: TODO: Acquire the appropriate locks for INADDR_TO_IFP. * FUTURE: Implement IPv4 source-address selection. */ static struct ifnet * @@ -1987,7 +1989,9 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, ifp = NULL; if (!in_nullhost(ina)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(ina, ifp); + IN_IFADDR_RUNLOCK(&in_ifa_tracker); } else { fibnum = inp ? inp->inp_inc.inc_fibnum : 0; if (fib4_lookup_nh_basic(fibnum, gsin->sin_addr, 0, 0, &nh4)==0) @@ -2332,6 +2336,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop { struct group_source_req gsr; struct ip_mreq_source mreqs; + struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -2390,9 +2395,11 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop * XXX NOTE WELL: The RFC 3678 API is preferred because * using an IPv4 address as a key is racy. */ - if (!in_nullhost(mreqs.imr_interface)) + if (!in_nullhost(mreqs.imr_interface)) { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(mreqs.imr_interface, ifp); - + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + } CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p", __func__, ntohl(mreqs.imr_interface.s_addr), ifp); @@ -2560,6 +2567,7 @@ out_inp_locked: static int inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) { + struct rm_priotracker in_ifa_tracker; struct in_addr addr; struct ip_mreqn mreqn; struct ifnet *ifp; @@ -2598,7 +2606,9 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt if (in_nullhost(addr)) { ifp = NULL; } else { + IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(addr, ifp); + IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ifp == NULL) return (EADDRNOTAVAIL); } From owner-svn-src-head@freebsd.org Sat Oct 27 03:37:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE4610D5AF9; Sat, 27 Oct 2018 03:37:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD397A47E; Sat, 27 Oct 2018 03:37:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54E0C29AF; Sat, 27 Oct 2018 03:37:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R3bFIs099253; Sat, 27 Oct 2018 03:37:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R3bF1M099252; Sat, 27 Oct 2018 03:37:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201810270337.w9R3bF1M099252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 27 Oct 2018 03:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339804 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 339804 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, 27 Oct 2018 03:37:16 -0000 Author: delphij Date: Sat Oct 27 03:37:14 2018 New Revision: 339804 URL: https://svnweb.freebsd.org/changeset/base/339804 Log: Restore backward compatibility for "attach" verb. In r332361 and r333439, two new parameters were added to geli attach verb using gctl_get_paraml, which requires the value to be present. This would prevent old geli(8) binary from attaching geli(4) device as they have no knowledge about the new parameters. Restore backward compatibility by treating the absense of these two values as seeing the default value supplied by userland. PR: 232595 Reviewed by: oshogbo MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17680 Modified: head/sys/geom/eli/g_eli_ctl.c Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Sat Oct 27 03:16:32 2018 (r339803) +++ head/sys/geom/eli/g_eli_ctl.c Sat Oct 27 03:37:14 2018 (r339804) @@ -59,8 +59,8 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class struct g_provider *pp; const char *name; u_char *key, mkey[G_ELI_DATAIVKEYLEN]; - int *nargs, *detach, *readonly, *dryrun; - int keysize, error, nkey; + int *nargs, *detach, *readonly, *dryrunp; + int keysize, error, nkey, dryrun, dummy; intmax_t *valp; g_topology_assert(); @@ -81,12 +81,14 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } - valp = gctl_get_paraml(req, "keyno", sizeof(*valp)); - if (valp == NULL) { - gctl_error(req, "No '%s' argument.", "keyno"); - return; + /* "keyno" is optional for backward compatibility */ + nkey = -1; + valp = gctl_get_param(req, "keyno", &dummy); + if (valp != NULL) { + valp = gctl_get_paraml(req, "keyno", sizeof(*valp)); + if (valp != NULL) + nkey = *valp; } - nkey = *valp; if (nkey < -1 || nkey >= G_ELI_MAXMKEYS) { gctl_error(req, "Invalid '%s' argument.", "keyno"); return; @@ -98,10 +100,13 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } - dryrun = gctl_get_paraml(req, "dryrun", sizeof(*dryrun)); - if (dryrun == NULL) { - gctl_error(req, "No '%s' argument.", "dryrun"); - return; + /* "dryrun" is optional for backward compatibility */ + dryrun = 0; + dryrunp = gctl_get_param(req, "dryrun", &dummy); + if (dryrunp != NULL) { + dryrunp = gctl_get_paraml(req, "dryrun", sizeof(*dryrunp)); + if (dryrunp != NULL) + dryrun = *dryrunp; } if (*detach && *readonly) { @@ -161,7 +166,7 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class md.md_flags |= G_ELI_FLAG_WO_DETACH; if (*readonly) md.md_flags |= G_ELI_FLAG_RO; - if (!*dryrun) + if (!dryrun) g_eli_create(req, mp, pp, &md, mkey, nkey); explicit_bzero(mkey, sizeof(mkey)); explicit_bzero(&md, sizeof(md)); From owner-svn-src-head@freebsd.org Sat Oct 27 07:32:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4DB810DD8F4; Sat, 27 Oct 2018 07:32:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B6C382AF8; Sat, 27 Oct 2018 07:32:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C97D55D8; Sat, 27 Oct 2018 07:32:26 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R7WQ1J021533; Sat, 27 Oct 2018 07:32:26 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R7WQYu021532; Sat, 27 Oct 2018 07:32:26 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810270732.w9R7WQYu021532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 07:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339810 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 339810 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, 27 Oct 2018 07:32:27 -0000 Author: eugen Date: Sat Oct 27 07:32:26 2018 New Revision: 339810 URL: https://svnweb.freebsd.org/changeset/base/339810 Log: ipfw: implement ngtee/netgraph actions for layer-2 frames. Kernel part of ipfw does not support and ignores rules other than "pass", "deny" and dummynet-related for layer-2 (ethernet frames). Others are processed as "pass". Make it support ngtee/netgraph rules just like they are supported for IP packets. For example, this allows us to mirror some frames selectively to another interface for delivery to remote network analyzer over RSPAN vlan. Assuming ng_ipfw(4) netgraph node has a hook named "900" attached to "lower" hook of vlan900's ng_ether(4) node, that would be as simple as: ipfw add ngtee 900 ip from any to 8.8.8.8 layer2 out xmit igb0 PR: 213452 MFC after: 1 month Tested-by: Fyodor Ustinov Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Sat Oct 27 05:26:09 2018 (r339809) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Sat Oct 27 07:32:26 2018 (r339810) @@ -317,11 +317,12 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct i struct ip_fw_args args; struct m_tag *mtag; + bzero(&args, sizeof(args)); + +again: /* fetch start point from rule, if any. remove the tag if present. */ mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); - if (mtag == NULL) { - args.rule.slot = 0; - } else { + if (mtag != NULL) { args.rule = *((struct ipfw_rule_ref *)(mtag+1)); m_tag_delete(*m0, mtag); if (args.rule.info & IPFW_ONEPASS) @@ -378,14 +379,27 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct i case IP_FW_DUMMYNET: ret = EACCES; + int dir2; if (ip_dn_io_ptr == NULL) break; /* i.e. drop */ *m0 = NULL; - dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; - ip_dn_io_ptr(&m, dir | PROTO_LAYER2, &args); + dir2 = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; + ip_dn_io_ptr(&m, dir2 | PROTO_LAYER2, &args); return 0; + + case IP_FW_NGTEE: + case IP_FW_NETGRAPH: + if (ng_ipfw_input_p == NULL) { + ret = EACCES; + break; /* i.e. drop */ + } + ret = ng_ipfw_input_p(m0, (dir == PFIL_IN) ? DIR_IN : DIR_OUT, + &args, (i == IP_FW_NGTEE) ? 1 : 0); + if (i == IP_FW_NGTEE) /* ignore errors for NGTEE */ + goto again; /* continue with packet */ + break; default: KASSERT(0, ("%s: unknown retval", __func__)); From owner-svn-src-head@freebsd.org Sat Oct 27 04:10:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 539B310D6B78; Sat, 27 Oct 2018 04:10:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09F7A7B4EC; Sat, 27 Oct 2018 04:10:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF4A02F20; Sat, 27 Oct 2018 04:10:42 +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 w9R4AgwP014937; Sat, 27 Oct 2018 04:10:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R4Ag8N014936; Sat, 27 Oct 2018 04:10:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810270410.w9R4Ag8N014936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 27 Oct 2018 04:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339805 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 339805 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, 27 Oct 2018 04:10:43 -0000 Author: kevans Date: Sat Oct 27 04:10:42 2018 New Revision: 339805 URL: https://svnweb.freebsd.org/changeset/base/339805 Log: lualoader: Always return a proper dictionary for blacklist If module_blacklist isn't specified, we have an empty blacklist; effectively the same as if module_blacklist="" were specified in loader.conf(5). This was reported when switching to a BE that predated the module_blacklist introduction, but the problem is valid all the same and likely to be tripped over in other scenarios. Reported by: bwidawsk MFC after: 3 days Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Oct 27 03:37:14 2018 (r339804) +++ head/stand/lua/config.lua Sat Oct 27 04:10:42 2018 (r339805) @@ -266,12 +266,12 @@ local function isValidComment(line) end local function getBlacklist() + local blacklist = {} local blacklist_str = loader.getenv('module_blacklist') if blacklist_str == nil then - return nil + return blacklist end - local blacklist = {} for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do blacklist[mod] = true end From owner-svn-src-head@freebsd.org Sat Oct 27 04:45:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56AD010D848C; Sat, 27 Oct 2018 04:45:29 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C21C7CDB2; Sat, 27 Oct 2018 04:45:29 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE6CD39A4; Sat, 27 Oct 2018 04:45:28 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R4jSgc035458; Sat, 27 Oct 2018 04:45:28 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R4jSfU035457; Sat, 27 Oct 2018 04:45:28 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810270445.w9R4jSfU035457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 04:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339806 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339806 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, 27 Oct 2018 04:45:29 -0000 Author: eugen Date: Sat Oct 27 04:45:28 2018 New Revision: 339806 URL: https://svnweb.freebsd.org/changeset/base/339806 Log: Prevent stf(4) from panicing due to unprotected access to INADDR_HASH. PR: 220078 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: head/sys/net/if_stf.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Sat Oct 27 04:10:42 2018 (r339805) +++ head/sys/net/if_stf.c Sat Oct 27 04:45:28 2018 (r339806) @@ -367,6 +367,7 @@ stf_encapcheck(const struct mbuf *m, int off, int prot static int stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) { + struct rm_priotracker in_ifa_tracker; struct ifaddr *ia; struct in_ifaddr *ia4; struct in6_ifaddr *ia6; @@ -382,9 +383,11 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *add continue; bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); + IN_IFADDR_RLOCK(&in_ifa_tracker); LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) break; + IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ia4 == NULL) continue; From owner-svn-src-head@freebsd.org Sat Oct 27 04:59:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A90E110D8E32; Sat, 27 Oct 2018 04:59:36 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 600557D7C1; Sat, 27 Oct 2018 04:59:36 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4136F3BF3; Sat, 27 Oct 2018 04:59:36 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R4xa1g040687; Sat, 27 Oct 2018 04:59:36 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R4xa3A040686; Sat, 27 Oct 2018 04:59:36 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810270459.w9R4xa3A040686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 04:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339808 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339808 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, 27 Oct 2018 04:59:36 -0000 Author: eugen Date: Sat Oct 27 04:59:35 2018 New Revision: 339808 URL: https://svnweb.freebsd.org/changeset/base/339808 Log: Prevent ip_input() from panicing due to unprotected access to INADDR_HASH. PR: 220078 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12457 Tested-by: Cassiano Peixoto and others Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Oct 27 04:53:25 2018 (r339807) +++ head/sys/netinet/ip_input.c Sat Oct 27 04:59:35 2018 (r339808) @@ -448,6 +448,7 @@ ip_direct_input(struct mbuf *m) void ip_input(struct mbuf *m) { + struct rm_priotracker in_ifa_tracker; struct ip *ip = NULL; struct in_ifaddr *ia = NULL; struct ifaddr *ifa; @@ -681,7 +682,7 @@ passin: /* * Check for exact addresses in the hash bucket. */ - /* IN_IFADDR_RLOCK(); */ + IN_IFADDR_RLOCK(&in_ifa_tracker); LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { /* * If the address matches, verify that the packet @@ -693,11 +694,11 @@ passin: counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto ours; } } - /* IN_IFADDR_RUNLOCK(); */ + IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * Check for broadcast addresses. From owner-svn-src-head@freebsd.org Sat Oct 27 07:59:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10CD810DE7E3; Sat, 27 Oct 2018 07:59:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B62528389C; Sat, 27 Oct 2018 07:59:19 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96D775917; Sat, 27 Oct 2018 07:59:19 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R7xJmT031870; Sat, 27 Oct 2018 07:59:19 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R7xJZx031869; Sat, 27 Oct 2018 07:59:19 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810270759.w9R7xJZx031869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 07:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339811 - head/sbin/route X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sbin/route X-SVN-Commit-Revision: 339811 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, 27 Oct 2018 07:59:20 -0000 Author: eugen Date: Sat Oct 27 07:59:19 2018 New Revision: 339811 URL: https://svnweb.freebsd.org/changeset/base/339811 Log: route(8): correctly return exit status when "-q" flag is used. Previously, route returned 1 in case of error properly signalling failure but "route -q" it returned 0 for same case. Fix it. PR: 186333 MFC after: 1 month Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sat Oct 27 07:32:26 2018 (r339810) +++ head/sbin/route/route.c Sat Oct 27 07:59:19 2018 (r339811) @@ -1050,10 +1050,13 @@ newroute(int argc, char **argv) } printf("\n"); } + } - fibnum = 0; - TAILQ_FOREACH(fl, &fibl_head, fl_next) { - if (fl->fl_error != 0) { + fibnum = 0; + TAILQ_FOREACH(fl, &fibl_head, fl_next) { + if (fl->fl_error != 0) { + error = 1; + if (!qflag) { printf("%s %s %s", cmd, (nrflags & F_ISHOST) ? "host" : "net", dest); if (*gateway) @@ -1087,7 +1090,6 @@ newroute(int argc, char **argv) break; } printf(": %s\n", errmsg); - error = 1; } } } From owner-svn-src-head@freebsd.org Sat Oct 27 05:26:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B2C10D9B44; Sat, 27 Oct 2018 05:26:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CCF57E3F5; Sat, 27 Oct 2018 05:26:10 +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 482C8412C; Sat, 27 Oct 2018 05:26:10 +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 w9R5QAvT055872; Sat, 27 Oct 2018 05:26:10 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R5QAJQ055871; Sat, 27 Oct 2018 05:26:10 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810270526.w9R5QAJQ055871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 27 Oct 2018 05:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339809 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 339809 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, 27 Oct 2018 05:26:11 -0000 Author: np Date: Sat Oct 27 05:26:09 2018 New Revision: 339809 URL: https://svnweb.freebsd.org/changeset/base/339809 Log: cxgbetool(8): Add a subaction (tcbrss ) that can be used with "pass" action to distribute traffic using the half of the VI's RSS indirection table. The value specified should either be the start of the VI's RSS slice (available at dev...rss_base since r339700) or the midpoint (rss_base + rss_size/2). The traffic that hits the filter will use the first or second half of the indirection table respectively. The indirection table can be populated in different ways to achieve different kinds of traffic/load distributions. For example, r339749 allows a netmap interface to have half the rx queues in the first half of the table and the rest in the other. Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Sat Oct 27 04:59:35 2018 (r339808) +++ head/usr.sbin/cxgbetool/cxgbetool.c Sat Oct 27 05:26:09 2018 (r339809) @@ -924,7 +924,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t if (t->fs.dirsteer == 0) { printf("RSS"); if (t->fs.maskhash) - printf("(TCB=hash)"); + printf("(region %d)", t->fs.iq << 1); } else { printf("%d", t->fs.iq); if (t->fs.dirsteerhash == 0) @@ -1263,11 +1263,19 @@ set_filter(uint32_t idx, int argc, const char *argv[], } else if (!parse_val("rpttid", args, &val)) { t.fs.rpttid = 1; } else if (!parse_val("queue", args, &val)) { - t.fs.dirsteer = 1; - t.fs.iq = val; + t.fs.dirsteer = 1; /* direct steer */ + t.fs.iq = val; /* to the iq with this cntxt_id */ } else if (!parse_val("tcbhash", args, &val)) { - t.fs.maskhash = 1; - t.fs.dirsteerhash = 1; + t.fs.dirsteerhash = 1; /* direct steer */ + /* XXX: use (val << 1) as the rss_hash? */ + t.fs.iq = val; + } else if (!parse_val("tcbrss", args, &val)) { + t.fs.maskhash = 1; /* steer to RSS region */ + /* + * val = start idx of the region but the internal TCB + * field is 10b only and is left shifted by 1 before use. + */ + t.fs.iq = val >> 1; } else if (!parse_val("eport", args, &val)) { t.fs.eport = val; } else if (!parse_val("swapmac", args, &val)) { From owner-svn-src-head@freebsd.org Sat Oct 27 06:09:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB08310DB0CC; Sat, 27 Oct 2018 06:09:07 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7581A7FDEB; Sat, 27 Oct 2018 06:09:07 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io1-f53.google.com with SMTP id n11-v6so2036657iob.6; Fri, 26 Oct 2018 23:09:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zqdwn8qKoAKoMaUi7GH7xekDO+ugLLpR4KFu8waRv1c=; b=AxtE44ZK7v77Bm90KlPwZg/aepvCXdWfj7gLkXVcLvfg0IphX+7j5MeWpoFTaWBiqa fOk6uL+B6L6sO/P69BmWy5kdXic5SXuiUZLqJ4W3lkFDntTrty/sppjfLbhkcIVnMu88 FXjSETfgedvkc829KCW39rtmk1iBbQqsdI97XQBMwA08YgQl60zzMxD0Rt720uEF3p0B lEEgGa9yzGNpCrAUExr96RfIca1bAVIwKUGI8C4V/aWKTebrC2kuJtKELTP++Tf9R9SL IDjKiR6bjH530dMHfVoLgRSSgvg5sdp3qPpEe8hKCnpFzHSuEbG1AL/VTAjbmekQB3bP cZSQ== X-Gm-Message-State: AGRZ1gJMX4TB0Di/SonZv7n2WiDi/B9wJhRBsHNF35cYWmOygPipMIYe i5Ip1f2te8zMa5lEAQmSeVGwNwwaDAbZdeCHym61+QSW X-Google-Smtp-Source: AJdET5fcIjqSDJhW0bUq8rz9o3lPSXTVbiaiF8uv6Yg5iFFfFe11SWUfAJWfJW4Tr5GoT0N6su4+wHjJnrGKYvBJiAs= X-Received: by 2002:a6b:7302:: with SMTP id e2-v6mr3645843ioh.94.1540620540449; Fri, 26 Oct 2018 23:09:00 -0700 (PDT) MIME-Version: 1.0 References: <201810231411.w9NEBaIl051200@repo.freebsd.org> In-Reply-To: <201810231411.w9NEBaIl051200@repo.freebsd.org> From: Antoine Brodin Date: Sat, 27 Oct 2018 08:08:49 +0200 Message-ID: Subject: Re: svn commit: r339655 - head/contrib/jemalloc/src To: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" 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, 27 Oct 2018 06:09:08 -0000 On Tue, Oct 23, 2018 at 4:11 PM Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Oct 23 14:11:35 2018 > New Revision: 339655 > URL: https://svnweb.freebsd.org/changeset/base/339655 > > Log: > Pick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream: > > Rework the way jemalloc uses mmap(2) on FreeBSD. > > This makes it directly use MAP_EXCL and MAP_ALIGNED() instead > of weird workarounds involving mapping at random places and then > unmapping parts of them. > > Discussed with: jasone > MFC after: 2 weeks > Sponsored by: DARPA, AFRL Hi, I don't know if it's related, but we now encounter a jemalloc assertion when trying to build packages for mips http://beefy7.nyi.freebsd.org/data/head-mips-default/p483081_s339802/logs/errors/pkg-1.10.5_5.log Antoine From owner-svn-src-head@freebsd.org Sat Oct 27 09:34:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05FB710E1DDE; Sat, 27 Oct 2018 09:34:34 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEE1A8718F; Sat, 27 Oct 2018 09:34:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9095668F3; Sat, 27 Oct 2018 09:34:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9R9YX9W083249; Sat, 27 Oct 2018 09:34:33 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9R9YXHH083248; Sat, 27 Oct 2018 09:34:33 GMT (envelope-from des@FreeBSD.org) Message-Id: <201810270934.w9R9YXHH083248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 27 Oct 2018 09:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339812 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 339812 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, 27 Oct 2018 09:34:34 -0000 Author: des Date: Sat Oct 27 09:34:33 2018 New Revision: 339812 URL: https://svnweb.freebsd.org/changeset/base/339812 Log: Add default value for local_unbound_tls + fix nearby style bugs. Reported by: bcran@ MFC after: 3 days Modified: head/libexec/rc/rc.conf Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Sat Oct 27 07:59:19 2018 (r339811) +++ head/libexec/rc/rc.conf Sat Oct 27 09:34:33 2018 (r339812) @@ -283,8 +283,9 @@ hastd_enable="NO" # Run the HAST daemon (YES/NO). hastd_program="/sbin/hastd" # path to hastd, if you want a different one. hastd_flags="" # Optional flags to hastd. ctld_enable="NO" # CAM Target Layer / iSCSI target daemon. -local_unbound_enable="NO" # local caching resolver -blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). +local_unbound_enable="NO" # Local caching resolver +local_unbound_tls="NO" # Use DNS over TLS +blacklistd_enable="NO" # Run blacklistd daemon (YES/NO). blacklistd_flags="" # Optional flags for blacklistd(8). resolv_enable="YES" # Enable resolv / resolvconf From owner-svn-src-head@freebsd.org Sat Oct 27 13:40:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8752710863B9; Sat, 27 Oct 2018 13:40:52 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F4436B1FD; Sat, 27 Oct 2018 13:40:52 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2F7A1D994; Sat, 27 Oct 2018 13:40:52 +0000 (UTC) Date: Sat, 27 Oct 2018 13:40:52 +0000 From: Alexey Dokuchaev To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339784 - head/sbin/dumpon Message-ID: <20181027134052.GB40528@FreeBSD.org> References: <201810261954.w9QJs05X054833@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810261954.w9QJs05X054833@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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, 27 Oct 2018 13:40:52 -0000 On Fri, Oct 26, 2018 at 07:54:00PM +0000, Conrad Meyer wrote: > New Revision: 339784 > URL: https://svnweb.freebsd.org/changeset/base/339784 > > Log: > dumpon(8): Provide seatbelt against weak RSA keys > > ... > +#if OPENSSL_VERSION_NUMBER >= 0x10100000L > + if (RSA_security_bits(pubkey) < 112) > +#else > + if (RSA_size(pubkey) * 8 < 2048) > +#endif Shouldn't the check be against 0x10100005L (that is, 1.1.0-pre5) to be precise? ./danfe From owner-svn-src-head@freebsd.org Sat Oct 27 15:09:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4716A108851C; Sat, 27 Oct 2018 15:09:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EED246DC0A; Sat, 27 Oct 2018 15:09:35 +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 CF95911ECA; Sat, 27 Oct 2018 15:09:35 +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 w9RF9ZIO056769; Sat, 27 Oct 2018 15:09:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RF9ZK1056767; Sat, 27 Oct 2018 15:09:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810271509.w9RF9ZK1056767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 27 Oct 2018 15:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339814 - in head/sys: dev/random sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/random sys X-SVN-Commit-Revision: 339814 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, 27 Oct 2018 15:09:36 -0000 Author: cem Date: Sat Oct 27 15:09:35 2018 New Revision: 339814 URL: https://svnweb.freebsd.org/changeset/base/339814 Log: random(4): Match enabled sources mask to build options r287023 and r334450 added build option mechanisms to permanently disable spammy and/or low quality entropy sources. Follow-up those changes by updating the 'enabled' sources mask to match. When sources are compile-time disabled, represent them as disabled in the source mask, and prevent users from modifying that, like pure sources. (Modifying the mask bit would have no effect, but users might think it did if it was not prevented.) Mostly a cosmetic change. Reviewed by: markm Approved by: secteam (gordon) X-MFC-With: 334450 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17252 Modified: head/sys/dev/random/random_harvestq.c head/sys/sys/random.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Sat Oct 27 14:44:39 2018 (r339813) +++ head/sys/dev/random/random_harvestq.c Sat Oct 27 15:09:35 2018 (r339814) @@ -64,6 +64,17 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(RANDOM_ENABLE_ETHER) +#define _RANDOM_HARVEST_ETHER_OFF 0 +#else +#define _RANDOM_HARVEST_ETHER_OFF (1u << RANDOM_NET_ETHER) +#endif +#if defined(RANDOM_ENABLE_UMA) +#define _RANDOM_HARVEST_UMA_OFF 0 +#else +#define _RANDOM_HARVEST_UMA_OFF (1u << RANDOM_UMA) +#endif + static void random_kthread(void); static void random_sources_feed(void); @@ -254,6 +265,10 @@ read_rate_increment(u_int chunk) static int random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) { + static const u_int user_immutable_mask = + (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START)) | + _RANDOM_HARVEST_ETHER_OFF | _RANDOM_HARVEST_UMA_OFF; + int error; u_int value, orig_value; @@ -268,8 +283,8 @@ random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) /* * Disallow userspace modification of pure entropy sources. */ - hc_source_mask = (value & ~RANDOM_HARVEST_PURE_MASK) | - (orig_value & RANDOM_HARVEST_PURE_MASK); + hc_source_mask = (value & ~user_immutable_mask) | + (orig_value & user_immutable_mask); return (0); } @@ -351,13 +366,17 @@ random_print_harvestmask_symbolic(SYSCTL_HANDLER_ARGS) static void random_harvestq_init(void *unused __unused) { + static const u_int almost_everything_mask = + (((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) & + ~_RANDOM_HARVEST_ETHER_OFF & ~_RANDOM_HARVEST_UMA_OFF); + struct sysctl_oid *random_sys_o; random_sys_o = SYSCTL_ADD_NODE(&random_clist, SYSCTL_STATIC_CHILDREN(_kern_random), OID_AUTO, "harvest", CTLFLAG_RW, 0, "Entropy Device Parameters"); - hc_source_mask = RANDOM_HARVEST_EVERYTHING_MASK; + hc_source_mask = almost_everything_mask; SYSCTL_ADD_PROC(&random_clist, SYSCTL_CHILDREN(random_sys_o), OID_AUTO, "mask", CTLTYPE_UINT | CTLFLAG_RW, Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Sat Oct 27 14:44:39 2018 (r339813) +++ head/sys/sys/random.h Sat Oct 27 15:09:35 2018 (r339814) @@ -92,9 +92,6 @@ enum random_entropy_source { _Static_assert(ENTROPYSOURCE <= 32, "hardcoded assumption that values fit in a typical word-sized bitset"); -#define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) -#define RANDOM_HARVEST_PURE_MASK (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START)) - #define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy" #define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" #define RANDOM_CACHED_SKIP_START 256 From owner-svn-src-head@freebsd.org Sat Oct 27 16:14:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D35AA10C98D6; Sat, 27 Oct 2018 16:14:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82A29701C4; Sat, 27 Oct 2018 16:14:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6260512A63; Sat, 27 Oct 2018 16:14:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RGEjAs092759; Sat, 27 Oct 2018 16:14:45 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RGEhsn092747; Sat, 27 Oct 2018 16:14:43 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810271614.w9RGEhsn092747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 16:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339815 - in head/sys/geom: . nop part raid stripe uzip X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head/sys/geom: . nop part raid stripe uzip X-SVN-Commit-Revision: 339815 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, 27 Oct 2018 16:14:46 -0000 Author: eugen Date: Sat Oct 27 16:14:42 2018 New Revision: 339815 URL: https://svnweb.freebsd.org/changeset/base/339815 Log: Extend stripeoffset and stripesize of GEOMs from u_int to off_t GEOM's stripeoffset overflows at 4 gigabyte margin (2^32) because of its u_int type. This leads to incorrect data in the output generated by "sysctl kern.geom.confxml" command, "graid list" etc. when GEOM array has volumes larger than 4G, for example. This change does not affect ABI but changes KBI. No MFC planned. Differential Revision: https://reviews.freebsd.org/D13426 Modified: head/sys/geom/geom.h head/sys/geom/geom_disk.h head/sys/geom/geom_dump.c head/sys/geom/geom_redboot.c head/sys/geom/geom_subr.c head/sys/geom/nop/g_nop.c head/sys/geom/part/g_part.c head/sys/geom/raid/g_raid.c head/sys/geom/stripe/g_stripe.c head/sys/geom/stripe/g_stripe.h head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/geom.h Sat Oct 27 16:14:42 2018 (r339815) @@ -215,8 +215,8 @@ struct g_provider { TAILQ_ENTRY(g_provider) orphan; off_t mediasize; u_int sectorsize; - u_int stripesize; - u_int stripeoffset; + off_t stripesize; + off_t stripeoffset; struct devstat *stat; u_int nstart, nend; u_int flags; Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/geom_disk.h Sat Oct 27 16:14:42 2018 (r339815) @@ -109,8 +109,8 @@ struct disk { u_int d_fwheads; u_int d_maxsize; off_t d_delmaxsize; - u_int d_stripeoffset; - u_int d_stripesize; + off_t d_stripeoffset; + off_t d_stripesize; char d_ident[DISK_IDENT_SIZE]; char d_descr[DISK_IDENT_SIZE]; uint16_t d_hba_vendor; @@ -151,7 +151,8 @@ void disk_add_alias(struct disk *disk, const char *); #define DISK_VERSION_03 0x5856105c #define DISK_VERSION_04 0x5856105d #define DISK_VERSION_05 0x5856105e -#define DISK_VERSION DISK_VERSION_05 +#define DISK_VERSION_06 0x5856105f +#define DISK_VERSION DISK_VERSION_06 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/geom_dump.c Sat Oct 27 16:14:42 2018 (r339815) @@ -64,8 +64,8 @@ g_confdot_provider(struct sbuf *sb, struct g_provider { sbuf_printf(sb, "z%p [shape=hexagon,label=\"%s\\nr%dw%de%d\\nerr#%d\\n" - "sector=%u\\nstripe=%u\"];\n", pp, pp->name, pp->acr, pp->acw, - pp->ace, pp->error, pp->sectorsize, pp->stripesize); + "sector=%u\\nstripe=%ju\"];\n", pp, pp->name, pp->acr, pp->acw, + pp->ace, pp->error, pp->sectorsize, (uintmax_t)pp->stripesize); } static void @@ -216,8 +216,8 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp sbuf_printf(sb, "\t %jd\n", (intmax_t)pp->mediasize); sbuf_printf(sb, "\t %u\n", pp->sectorsize); - sbuf_printf(sb, "\t %u\n", pp->stripesize); - sbuf_printf(sb, "\t %u\n", pp->stripeoffset); + sbuf_printf(sb, "\t %ju\n", (uintmax_t)pp->stripesize); + sbuf_printf(sb, "\t %ju\n", (uintmax_t)pp->stripeoffset); if (pp->flags & G_PF_WITHER) sbuf_printf(sb, "\t \n"); else if (pp->geom->flags & G_GEOM_WITHER) Modified: head/sys/geom/geom_redboot.c ============================================================================== --- head/sys/geom/geom_redboot.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/geom_redboot.c Sat Oct 27 16:14:42 2018 (r339815) @@ -246,7 +246,7 @@ g_redboot_taste(struct g_class *mp, struct g_provider int error, sectorsize, i; struct fis_image_desc *fd, *head; uint32_t offmask; - u_int blksize; /* NB: flash block size stored as stripesize */ + off_t blksize; /* NB: flash block size stored as stripesize */ u_char *buf; off_t offset; const char *value; @@ -283,9 +283,9 @@ g_redboot_taste(struct g_class *mp, struct g_provider else offmask = 0xffffffff; /* XXX */ if (bootverbose) - printf("%s: mediasize %ld secsize %d blksize %d offmask 0x%x\n", + printf("%s: mediasize %ld secsize %d blksize %ju offmask 0x%x\n", __func__, (long) cp->provider->mediasize, sectorsize, - blksize, offmask); + (uintmax_t)blksize, offmask); if (sectorsize < sizeof(struct fis_image_desc) || (sectorsize % sizeof(struct fis_image_desc))) return (NULL); Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/geom_subr.c Sat Oct 27 16:14:42 2018 (r339815) @@ -1409,8 +1409,8 @@ db_show_geom_provider(int indent, struct g_provider *p gprintln(" geom: %s (%p)", pp->geom->name, pp->geom); gprintln(" mediasize: %jd", (intmax_t)pp->mediasize); gprintln(" sectorsize: %u", pp->sectorsize); - gprintln(" stripesize: %u", pp->stripesize); - gprintln(" stripeoffset: %u", pp->stripeoffset); + gprintln(" stripesize: %ju", (uintmax_t)pp->stripesize); + gprintln(" stripeoffset: %ju", (uintmax_t)pp->stripeoffset); gprintln(" access: r%dw%de%d", pp->acr, pp->acw, pp->ace); gprintln(" flags: %s (0x%04x)", Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/nop/g_nop.c Sat Oct 27 16:14:42 2018 (r339815) @@ -187,7 +187,7 @@ g_nop_access(struct g_provider *pp, int dr, int dw, in static int g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, int ioerror, u_int rfailprob, u_int wfailprob, off_t offset, off_t size, - u_int secsize, u_int stripesize, u_int stripeoffset, const char *physpath) + u_int secsize, off_t stripesize, off_t stripeoffset, const char *physpath) { struct g_nop_softc *sc; struct g_geom *gp; @@ -464,7 +464,7 @@ g_nop_ctl_create(struct gctl_req *req, struct g_class *rfailprob == -1 ? 0 : (u_int)*rfailprob, *wfailprob == -1 ? 0 : (u_int)*wfailprob, (off_t)*offset, (off_t)*size, (u_int)*secsize, - (u_int)*stripesize, (u_int)*stripeoffset, + (off_t)*stripesize, (off_t)*stripeoffset, physpath) != 0) { return; } Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/part/g_part.c Sat Oct 27 16:14:42 2018 (r339815) @@ -367,9 +367,9 @@ g_part_check_integrity(struct g_part_table *table, str offset = e1->gpe_offset; if ((offset + pp->stripeoffset) % pp->stripesize) { DPRINTF("partition %d on (%s, %s) is not " - "aligned on %u bytes\n", e1->gpe_index, + "aligned on %ju bytes\n", e1->gpe_index, pp->name, table->gpt_scheme->name, - pp->stripesize); + (uintmax_t)pp->stripesize); /* Don't treat this as a critical failure */ } } @@ -820,7 +820,7 @@ g_part_ctl_add(struct gctl_req *req, struct g_part_par G_PART_FULLNAME(table, entry, sb, gp->name); if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0) sbuf_printf(sb, " added, but partition is not " - "aligned on %u bytes\n", pp->stripesize); + "aligned on %ju bytes\n", (uintmax_t)pp->stripesize); else sbuf_cat(sb, " added\n"); sbuf_finish(sb); Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/raid/g_raid.c Sat Oct 27 16:14:42 2018 (r339815) @@ -2423,7 +2423,7 @@ g_raid_dumpconf(struct sbuf *sb, const char *indent, s sbuf_printf(sb, "r%d(%s):%d@%ju", sd->sd_volume->v_global_id, sd->sd_volume->v_name, - sd->sd_pos, sd->sd_offset); + sd->sd_pos, (uintmax_t)sd->sd_offset); if (TAILQ_NEXT(sd, sd_next)) sbuf_printf(sb, ", "); } Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/stripe/g_stripe.c Sat Oct 27 16:14:42 2018 (r339815) @@ -249,7 +249,7 @@ static void g_stripe_copy(struct g_stripe_softc *sc, char *src, char *dst, off_t offset, off_t length, int mode) { - u_int stripesize; + off_t stripesize; size_t len; stripesize = sc->sc_stripesize; @@ -265,8 +265,8 @@ g_stripe_copy(struct g_stripe_softc *sc, char *src, ch } length -= len; KASSERT(length >= 0, - ("Length < 0 (stripesize=%zu, offset=%jd, length=%jd).", - (size_t)stripesize, (intmax_t)offset, (intmax_t)length)); + ("Length < 0 (stripesize=%ju, offset=%ju, length=%jd).", + (uintmax_t)stripesize, (uintmax_t)offset, (intmax_t)length)); if (length > stripesize) len = stripesize; else @@ -307,10 +307,11 @@ static int g_stripe_start_fast(struct bio *bp, u_int no, off_t offset, off_t length) { TAILQ_HEAD(, bio) queue = TAILQ_HEAD_INITIALIZER(queue); - u_int nparts = 0, stripesize; struct g_stripe_softc *sc; char *addr, *data = NULL; struct bio *cbp; + off_t stripesize; + u_int nparts = 0; int error; sc = bp->bio_to->geom->softc; @@ -436,7 +437,7 @@ g_stripe_start_economic(struct bio *bp, u_int no, off_ { TAILQ_HEAD(, bio) queue = TAILQ_HEAD_INITIALIZER(queue); struct g_stripe_softc *sc; - uint32_t stripesize; + off_t stripesize; struct bio *cbp; char *addr; int error; @@ -571,9 +572,9 @@ g_stripe_flush(struct g_stripe_softc *sc, struct bio * static void g_stripe_start(struct bio *bp) { - off_t offset, start, length, nstripe; + off_t offset, start, length, nstripe, stripesize; struct g_stripe_softc *sc; - u_int no, stripesize; + u_int no; int error, fast = 0; sc = bp->bio_to->geom->softc; @@ -1044,7 +1045,7 @@ g_stripe_ctl_create(struct gctl_req *req, struct g_cla struct g_stripe_softc *sc; struct g_geom *gp; struct sbuf *sb; - intmax_t *stripesize; + off_t *stripesize; const char *name; char param[16]; int *nargs; @@ -1076,7 +1077,7 @@ g_stripe_ctl_create(struct gctl_req *req, struct g_cla gctl_error(req, "No '%s' argument.", "stripesize"); return; } - md.md_stripesize = *stripesize; + md.md_stripesize = (uint32_t)*stripesize; bzero(md.md_provider, sizeof(md.md_provider)); /* This field is not important here. */ md.md_provsize = 0; @@ -1243,8 +1244,8 @@ g_stripe_dumpconf(struct sbuf *sb, const char *indent, (u_int)cp->index); } else { sbuf_printf(sb, "%s%u\n", indent, (u_int)sc->sc_id); - sbuf_printf(sb, "%s%u\n", indent, - (u_int)sc->sc_stripesize); + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)sc->sc_stripesize); sbuf_printf(sb, "%s", indent); switch (sc->sc_type) { case G_STRIPE_TYPE_AUTOMATIC: Modified: head/sys/geom/stripe/g_stripe.h ============================================================================== --- head/sys/geom/stripe/g_stripe.h Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/stripe/g_stripe.h Sat Oct 27 16:14:42 2018 (r339815) @@ -76,7 +76,7 @@ struct g_stripe_softc { uint32_t sc_id; /* stripe unique ID */ struct g_consumer **sc_disks; uint16_t sc_ndisks; - uint32_t sc_stripesize; + off_t sc_stripesize; uint32_t sc_stripebits; struct mtx sc_lock; }; Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Oct 27 15:09:35 2018 (r339814) +++ head/sys/geom/uzip/g_uzip.c Sat Oct 27 16:14:42 2018 (r339815) @@ -849,9 +849,9 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); - DPRINTF(GUZ_DBG_INFO, ("%s: taste ok (%d, %jd), (%d, %d), %x\n", - gp->name, pp2->sectorsize, (intmax_t)pp2->mediasize, - pp2->stripeoffset, pp2->stripesize, pp2->flags)); + DPRINTF(GUZ_DBG_INFO, ("%s: taste ok (%d, %ju), (%ju, %ju), %x\n", + gp->name, pp2->sectorsize, (uintmax_t)pp2->mediasize, + (uintmax_t)pp2->stripeoffset, (uintmax_t)pp2->stripesize, pp2->flags)); DPRINTF(GUZ_DBG_INFO, ("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz)); return (gp); From owner-svn-src-head@freebsd.org Sat Oct 27 16:41:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D25A310CB739; Sat, 27 Oct 2018 16:41:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8960771397; Sat, 27 Oct 2018 16:41:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BAF212DFE; Sat, 27 Oct 2018 16:41:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RGfZT6007306; Sat, 27 Oct 2018 16:41:35 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RGfZ6f007305; Sat, 27 Oct 2018 16:41:35 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810271641.w9RGfZ6f007305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 16:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339816 - head/sbin/mount_msdosfs X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sbin/mount_msdosfs X-SVN-Commit-Revision: 339816 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, 27 Oct 2018 16:41:36 -0000 Author: eugen Date: Sat Oct 27 16:41:34 2018 New Revision: 339816 URL: https://svnweb.freebsd.org/changeset/base/339816 Log: mount_msdosfs: do not fail mounts requiring locale name conversion table that is already present in a kernel statically. For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having options LIBICONV and MSDOSFS_ICONV. After this change, it mounts successfully. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D16951 Modified: head/sbin/mount_msdosfs/mount_msdosfs.c Modified: head/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- head/sbin/mount_msdosfs/mount_msdosfs.c Sat Oct 27 16:14:42 2018 (r339815) +++ head/sbin/mount_msdosfs/mount_msdosfs.c Sat Oct 27 16:41:34 2018 (r339816) @@ -46,6 +46,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -308,17 +309,17 @@ set_charset(struct iovec **iov, int *iovlen, const cha build_iovec_argf(iov, iovlen, "cs_win", ENCODING_UNICODE); error = kiconv_add_xlat16_cspairs(ENCODING_UNICODE, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); if (cs_dos != NULL) { error = kiconv_add_xlat16_cspairs(cs_dos, cs_local); - if (error) + if (error && errno != EEXIST) return (-1); } else { build_iovec_argf(iov, iovlen, "cs_dos", cs_local); error = kiconv_add_xlat16_cspair(cs_local, cs_local, KICONV_FROM_UPPER | KICONV_LOWER); - if (error) + if (error && errno != EEXIST) return (-1); } From owner-svn-src-head@freebsd.org Sat Oct 27 17:15:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB85D10CCFCC; Sat, 27 Oct 2018 17:15:59 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F45472D2F; Sat, 27 Oct 2018 17:15:59 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 604DC1341B; Sat, 27 Oct 2018 17:15:59 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RHFxWN024592; Sat, 27 Oct 2018 17:15:59 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RHFxqD024591; Sat, 27 Oct 2018 17:15:59 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810271715.w9RHFxqD024591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 17:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339817 - head/libexec/makewhatis.local X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/makewhatis.local X-SVN-Commit-Revision: 339817 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, 27 Oct 2018 17:16:00 -0000 Author: eugen Date: Sat Oct 27 17:15:58 2018 New Revision: 339817 URL: https://svnweb.freebsd.org/changeset/base/339817 Log: makewhatis: do not try to operate on read-only mounted directories just to fail later. MFC after: 1 month Modified: head/libexec/makewhatis.local/makewhatis.local.sh Modified: head/libexec/makewhatis.local/makewhatis.local.sh ============================================================================== --- head/libexec/makewhatis.local/makewhatis.local.sh Sat Oct 27 16:41:34 2018 (r339816) +++ head/libexec/makewhatis.local/makewhatis.local.sh Sat Oct 27 17:15:58 2018 (r339817) @@ -47,10 +47,10 @@ done dirs=`echo $dirs | sed 's/:/ /g'` case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac -localdirs=`find -H $dirs -fstype local -type d -prune -print` +localdirs=`find -H $dirs -fstype local \! -fstype rdonly -type d -prune -print` case X"$localdirs" in - X) echo "$0: no local-mounted manual directories found: $dirs" + X) echo "$0: no local rw-mounted manual directories found: $dirs" exit 1;; *) exec `basename $0 .local` $opt $localdirs;; esac From owner-svn-src-head@freebsd.org Sat Oct 27 17:21:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC5E410CD10F; Sat, 27 Oct 2018 17:21:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81AB67303A; Sat, 27 Oct 2018 17:21:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6423E13562; Sat, 27 Oct 2018 17:21:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RHLETf025759; Sat, 27 Oct 2018 17:21:14 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RHLDXg025755; Sat, 27 Oct 2018 17:21:13 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810271721.w9RHLDXg025755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 27 Oct 2018 17:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339818 - in head: libexec/rc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: libexec/rc sbin/rcorder share/man/man8 usr.sbin/acpi/acpiconf X-SVN-Commit-Revision: 339818 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, 27 Oct 2018 17:21:15 -0000 Author: eugen Date: Sat Oct 27 17:21:13 2018 New Revision: 339818 URL: https://svnweb.freebsd.org/changeset/base/339818 Log: rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume" and runs scripts containing "KEYWORD: resume" with single "resume" argument. Working example is the port sysutils/cpupdate that defines extra_commands="resume" to reload CPU microcode cleared by suspend/resume sequence. This change does nothing for a system having no scripts with KEYWORD: resume. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15247 Modified: head/libexec/rc/rc.resume head/sbin/rcorder/rcorder.8 head/share/man/man8/rc.8 head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/libexec/rc/rc.resume ============================================================================== --- head/libexec/rc/rc.resume Sat Oct 27 17:15:58 2018 (r339817) +++ head/libexec/rc/rc.resume Sat Oct 27 17:21:13 2018 (r339818) @@ -55,4 +55,22 @@ fi /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync +. /etc/rc.subr + +load_rc_config + +rcorder_opts="-k resume" + +case ${local_startup} in +[Nn][Oo] | '') ;; +*) find_local_scripts_new ;; +esac + +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` + +for _rc_elem in $files; do + debug "run_rc_script $_rc_elem resume" + run_rc_script $_rc_elem resume +done + exit 0 Modified: head/sbin/rcorder/rcorder.8 ============================================================================== --- head/sbin/rcorder/rcorder.8 Sat Oct 27 17:15:58 2018 (r339817) +++ head/sbin/rcorder/rcorder.8 Sat Oct 27 17:21:13 2018 (r339818) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2016 +.Dd October 27, 2018 .Dt RCORDER 8 .Os .Sh NAME @@ -136,6 +136,23 @@ There must be at least one file with no dependencies i arguments passed to .Nm in order for it to find a starting place in the dependency ordering. +.Sh KEYWORDS +There are several +.Em KEYWORDs +in use: +.Bl -tag -width ".Cm shutdown" -offset indent +.It Cm firstboot, nojail, nojailvnet, nostart +Used by +.Xr rc 8 . +.It Cm resume +Used by +.Nm /etc/rc.resume +(see +.Xr acpiconf 8 ) +.It Cm shutdown +Used by +.Xr rc.shutdown 8 . +.El .Sh DIAGNOSTICS The .Nm @@ -156,7 +173,9 @@ A set of files has a circular dependency which was det processing the stated file. .El .Sh SEE ALSO -.Xr rc 8 +.Xr acpiconf 8 , +.Xr rc 8 , +.Xr rc.shutdown 8 .Sh HISTORY The .Nm Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Sat Oct 27 17:15:58 2018 (r339817) +++ head/share/man/man8/rc.8 Sat Oct 27 17:21:13 2018 (r339818) @@ -44,6 +44,7 @@ .Nm rc.d/ .Nm rc.firewall .Nm rc.local +.Nm rc.resume .Nm rc.shutdown .Nm rc.subr .Sh DESCRIPTION @@ -548,6 +549,7 @@ is unnecessary, but is often included. .Xr kill 1 , .Xr rc.conf 5 , .Xr init 8 , +.Xr rc.resume 8 , .Xr rc.subr 8 , .Xr rcorder 8 , .Xr reboot 8 , Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Sat Oct 27 17:15:58 2018 (r339817) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Sat Oct 27 17:21:13 2018 (r339818) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2015 +.Dd October 27, 2018 .Dt ACPICONF 8 .Os .Sh NAME @@ -72,13 +72,35 @@ If the .Pa /etc/rc.suspend and .Pa /etc/rc.resume -scripts are executable, they will be run before and after entering -the given sleep state. +scripts are executable, they will be run by +.Xr devd 8 +or +.Xr apmd 8 +before and after entering the given sleep state. +.Pp +The +.Pa /etc/rc.resume +script uses the +.Xr rcorder 8 +utility to call scripts in +.Pa /etc/rc.d/ +and the +.Va $local_startup +directories that have a "resume" KEYWORD. +Called scripts are supplied with single "resume" +command line argument. See +.Xr rc.conf 5 +for more information about +.Va $local_startup . .El .Sh SEE ALSO .Xr acpi 4 , .Xr acpidump 8 , -.Xr apm 8 +.Xr apm 8 , +.Xr apmd 8 , +.Xr devd 8 , +.Xr rc.conf 5 , +.Xr rcorder 8 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Sat Oct 27 17:49:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE2B10CDDE8; Sat, 27 Oct 2018 17:49:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733B9743DE; Sat, 27 Oct 2018 17:49:47 +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 4FF9F13926; Sat, 27 Oct 2018 17:49:47 +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 w9RHnl6H040558; Sat, 27 Oct 2018 17:49:47 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RHnlU4040557; Sat, 27 Oct 2018 17:49:47 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201810271749.w9RHnlU4040557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 27 Oct 2018 17:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339819 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339819 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, 27 Oct 2018 17:49:47 -0000 Author: alc Date: Sat Oct 27 17:49:46 2018 New Revision: 339819 URL: https://svnweb.freebsd.org/changeset/base/339819 Log: Eliminate typically pointless calls to vm_fault_prefault() on soft, copy- on-write faults. On a page fault, when we call vm_fault_prefault(), it probes the pmap and the shadow chain of vm objects to see if there are opportunities to create read and/or execute-only mappings to neighoring pages. For example, in the case of hard faults, such effort typically pays off, that is, mappings are created that eliminate future soft page faults. However, in the the case of soft, copy-on-write faults, the effort very rarely pays off. (See the review for some specific data.) Reviewed by: kib, markj MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D17367 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sat Oct 27 17:21:13 2018 (r339818) +++ head/sys/vm/vm_fault.c Sat Oct 27 17:49:46 2018 (r339819) @@ -1181,6 +1181,16 @@ readrest: */ vm_object_pip_wakeup(fs.object); VM_OBJECT_WUNLOCK(fs.object); + + /* + * We only try to prefault read-only mappings to the + * neighboring pages when this copy-on-write fault is + * a hard fault. In other cases, trying to prefault + * is typically wasted effort. + */ + if (faultcount == 0) + faultcount = 1; + /* * Only use the new page below... */ From owner-svn-src-head@freebsd.org Sat Oct 27 18:48:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90DA510D0029; Sat, 27 Oct 2018 18:48:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D6076B26; Sat, 27 Oct 2018 18:48:50 +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 1A239142CF; Sat, 27 Oct 2018 18:48:50 +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 w9RImnRN072040; Sat, 27 Oct 2018 18:48:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RImnGa072039; Sat, 27 Oct 2018 18:48:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810271848.w9RImnGa072039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 27 Oct 2018 18:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339820 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339820 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, 27 Oct 2018 18:48:50 -0000 Author: markj Date: Sat Oct 27 18:48:49 2018 New Revision: 339820 URL: https://svnweb.freebsd.org/changeset/base/339820 Log: Use M_WAITOK in init_hwpmc(). No functional change intended. MFC after: 2 weeks Modified: head/sys/kern/kern_pmc.c Modified: head/sys/kern/kern_pmc.c ============================================================================== --- head/sys/kern/kern_pmc.c Sat Oct 27 17:49:46 2018 (r339819) +++ head/sys/kern/kern_pmc.c Sat Oct 27 18:48:49 2018 (r339820) @@ -360,9 +360,8 @@ init_hwpmc(void *dummy __unused) "range.\n", pmc_softevents); pmc_softevents = PMC_EV_DYN_COUNT; } - pmc_softs = malloc(pmc_softevents * sizeof(struct pmc_soft *), M_PMCHOOKS, M_NOWAIT|M_ZERO); - KASSERT(pmc_softs != NULL, ("cannot allocate soft events table")); - + pmc_softs = malloc(pmc_softevents * sizeof(*pmc_softs), M_PMCHOOKS, + M_WAITOK | M_ZERO); for (domain = 0; domain < NDOMAINS; domain++) { pmc_dom_hdrs[domain] = malloc_domain(sizeof(struct pmc_domain_buffer_header), M_PMC, domain, M_WAITOK|M_ZERO); From owner-svn-src-head@freebsd.org Sat Oct 27 20:17:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F079610D226A; Sat, 27 Oct 2018 20:17:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 953E079762; Sat, 27 Oct 2018 20:17:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70A3A1514B; Sat, 27 Oct 2018 20:17:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RKHwHX018577; Sat, 27 Oct 2018 20:17:58 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RKHvrA018572; Sat, 27 Oct 2018 20:17:57 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201810272017.w9RKHvrA018572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 27 Oct 2018 20:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339822 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 339822 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, 27 Oct 2018 20:17:59 -0000 Author: jilles Date: Sat Oct 27 20:17:57 2018 New Revision: 339822 URL: https://svnweb.freebsd.org/changeset/base/339822 Log: sh: Use exitstatus instead of exerrno to pass EXEXEC status No functional change is intended. Modified: head/bin/sh/eval.c head/bin/sh/exec.c head/bin/sh/exec.h head/bin/sh/jobs.c head/bin/sh/main.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Oct 27 19:08:06 2018 (r339821) +++ head/bin/sh/eval.c Sat Oct 27 20:17:57 2018 (r339822) @@ -468,7 +468,8 @@ evalredir(union node *n, int flags) popredir(); if (e == EXERROR || e == EXEXEC) { if (in_redirect) { - exitstatus = 2; + if (e == EXERROR) + exitstatus = 2; FORCEINTON; return; } @@ -669,8 +670,10 @@ evalbackcmd(union node *n, struct backcmd *result) forcelocal++; savehandler = handler; if (setjmp(jmploc.loc)) { - if (exception == EXERROR || exception == EXEXEC) + if (exception == EXERROR) exitstatus = 2; + else if (exception == EXEXEC) + /* nothing */; else if (exception != 0) { handler = savehandler; forcelocal--; @@ -1089,7 +1092,7 @@ evalcommand(union node *cmd, int flags, struct backcmd e = exception; if (e == EXINT) exitstatus = SIGINT+128; - else if (e != EXEXIT) + else if (e != EXEXEC && e != EXEXIT) exitstatus = 2; goto cmddone; } Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sat Oct 27 19:08:06 2018 (r339821) +++ head/bin/sh/exec.c Sat Oct 27 20:17:57 2018 (r339822) @@ -91,7 +91,6 @@ struct tblentry { static struct tblentry *cmdtable[CMDTABLESIZE]; static int cmdtable_cd = 0; /* cmdtable contains cd-dependent entries */ -int exerrno = 0; /* Last exec error */ static void tryexec(char *, char **, char **); @@ -135,10 +134,10 @@ shellexec(char **argv, char **envp, const char *path, /* Map to POSIX errors */ if (e == ENOENT || e == ENOTDIR) { - exerrno = 127; + exitstatus = 127; exerror(EXEXEC, "%s: not found", argv[0]); } else { - exerrno = 126; + exitstatus = 126; exerror(EXEXEC, "%s: %s", argv[0], strerror(e)); } } Modified: head/bin/sh/exec.h ============================================================================== --- head/bin/sh/exec.h Sat Oct 27 19:08:06 2018 (r339821) +++ head/bin/sh/exec.h Sat Oct 27 20:17:57 2018 (r339822) @@ -61,8 +61,6 @@ struct cmdentry { #define DO_ERR 0x01 /* prints errors */ #define DO_NOFUNC 0x02 /* don't return shell functions, for command */ -extern int exerrno; /* last exec error */ - void shellexec(char **, char **, const char *, int) __dead2; char *padvance(const char **, const char **, const char *); void find_command(const char *, struct cmdentry *, int, const char *); Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Oct 27 19:08:06 2018 (r339821) +++ head/bin/sh/jobs.c Sat Oct 27 20:17:57 2018 (r339822) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "var.h" #include "builtins.h" +#include "eval.h" /* @@ -1005,7 +1006,7 @@ vforkexecshell(struct job *jp, char **argv, char **env if (pid == 0) { TRACE(("Child shell %d\n", (int)getpid())); if (setjmp(jmploc.loc)) - _exit(exception == EXEXEC ? exerrno : 2); + _exit(exception == EXEXEC ? exitstatus : 2); if (pip != NULL) { close(pip[0]); if (pip[1] != 1) { Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sat Oct 27 19:08:06 2018 (r339821) +++ head/bin/sh/main.c Sat Oct 27 20:17:57 2018 (r339822) @@ -106,10 +106,6 @@ main(int argc, char *argv[]) state = 0; if (setjmp(main_handler.loc)) { switch (exception) { - case EXEXEC: - exitstatus = exerrno; - break; - case EXERROR: exitstatus = 2; break; From owner-svn-src-head@freebsd.org Sat Oct 27 20:22:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D15710D2588; Sat, 27 Oct 2018 20:22:43 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10C6879B77; Sat, 27 Oct 2018 20:22:43 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D62152F0; Sat, 27 Oct 2018 20:22:42 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RKMgj2023578; Sat, 27 Oct 2018 20:22:42 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RKMgOZ023575; Sat, 27 Oct 2018 20:22:42 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201810272022.w9RKMgOZ023575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 27 Oct 2018 20:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339823 - in head/sys/dev: atkbdc evdev kbdmux usb/input X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head/sys/dev: atkbdc evdev kbdmux usb/input X-SVN-Commit-Revision: 339823 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, 27 Oct 2018 20:22:43 -0000 Author: wulf Date: Sat Oct 27 20:22:41 2018 New Revision: 339823 URL: https://svnweb.freebsd.org/changeset/base/339823 Log: evdev: Use console lock as evdev lock for all supported keyboard drivers. Now evdev part of keyboard drivers does not take any locks if corresponding input/eventN device node is not opened by userland consumers. Do not assert console lock inside evdev to handle the cases when keyboard driver is called from some special single-threaded context like shutdown thread. Modified: head/sys/dev/atkbdc/atkbd.c head/sys/dev/evdev/evdev_private.h head/sys/dev/kbdmux/kbdmux.c head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Sat Oct 27 20:17:57 2018 (r339822) +++ head/sys/dev/atkbdc/atkbd.c Sat Oct 27 20:22:41 2018 (r339823) @@ -484,7 +484,7 @@ atkbd_init(int unit, keyboard_t **kbdp, void *arg, int evdev_support_led(evdev, LED_CAPSL); evdev_support_led(evdev, LED_SCROLLL); - if (evdev_register(evdev)) + if (evdev_register_mtx(evdev, &Giant)) evdev_free(evdev); else state->ks_evdev = evdev; Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sat Oct 27 20:17:57 2018 (r339822) +++ head/sys/dev/evdev/evdev_private.h Sat Oct 27 20:22:41 2018 (r339823) @@ -132,9 +132,14 @@ struct evdev_dev LIST_HEAD(, evdev_client) ev_clients; }; +#define SYSTEM_CONSOLE_LOCK &Giant + #define EVDEV_LOCK(evdev) mtx_lock((evdev)->ev_lock) #define EVDEV_UNLOCK(evdev) mtx_unlock((evdev)->ev_lock) -#define EVDEV_LOCK_ASSERT(evdev) mtx_assert((evdev)->ev_lock, MA_OWNED) +#define EVDEV_LOCK_ASSERT(evdev) do { \ + if ((evdev)->ev_lock != SYSTEM_CONSOLE_LOCK) \ + mtx_assert((evdev)->ev_lock, MA_OWNED); \ +} while (0) #define EVDEV_ENTER(evdev) do { \ if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \ EVDEV_LOCK(evdev); \ Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Sat Oct 27 20:17:57 2018 (r339822) +++ head/sys/dev/kbdmux/kbdmux.c Sat Oct 27 20:22:41 2018 (r339823) @@ -505,7 +505,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, in evdev_support_led(evdev, LED_CAPSL); evdev_support_led(evdev, LED_SCROLLL); - if (evdev_register(evdev)) + if (evdev_register_mtx(evdev, &Giant)) evdev_free(evdev); else state->ks_evdev = evdev; Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sat Oct 27 20:17:57 2018 (r339822) +++ head/sys/dev/usb/input/ukbd.c Sat Oct 27 20:22:41 2018 (r339823) @@ -1361,7 +1361,7 @@ ukbd_attach(device_t dev) if (sc->sc_flags & UKBD_FLAG_SCROLLLOCK) evdev_support_led(evdev, LED_SCROLLL); - if (evdev_register(evdev)) + if (evdev_register_mtx(evdev, &Giant)) evdev_free(evdev); else sc->sc_evdev = evdev; From owner-svn-src-head@freebsd.org Sat Oct 27 20:32:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D3810D27F9; Sat, 27 Oct 2018 20:32:07 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (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 9363579F76; Sat, 27 Oct 2018 20:32:07 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42jCFy4MjqzDhxn; Sat, 27 Oct 2018 20:32:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id N1XSVcfYA3QX; Sat, 27 Oct 2018 20:32:06 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:9eda:3eff:fe70:24c0]) by mail.daemonic.se (Postfix) with ESMTPSA id 42jCFy02Y6zDhFd; Sat, 27 Oct 2018 20:32:05 +0000 (UTC) Subject: Re: svn commit: r339823 - in head/sys/dev: atkbdc evdev kbdmux usb/input To: Vladimir Kondratyev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810272022.w9RKMgOZ023575@repo.freebsd.org> From: Niclas Zeising Message-ID: <3d441b5d-e225-1226-e229-73c93f85c8a9@freebsd.org> Date: Sat, 27 Oct 2018 22:32:05 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201810272022.w9RKMgOZ023575@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 27 Oct 2018 20:32:08 -0000 On 10/27/18 10:22 PM, Vladimir Kondratyev wrote: > Author: wulf > Date: Sat Oct 27 20:22:41 2018 > New Revision: 339823 > URL: https://svnweb.freebsd.org/changeset/base/339823 > > Log: > evdev: Use console lock as evdev lock for all supported keyboard drivers. > > Now evdev part of keyboard drivers does not take any locks if corresponding > input/eventN device node is not opened by userland consumers. > > Do not assert console lock inside evdev to handle the cases when keyboard > driver is called from some special single-threaded context like shutdown > thread. > > Modified: > head/sys/dev/atkbdc/atkbd.c > head/sys/dev/evdev/evdev_private.h > head/sys/dev/kbdmux/kbdmux.c > head/sys/dev/usb/input/ukbd.c > Related to https://reviews.freebsd.org/D15070 ? Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Sat Oct 27 21:04:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE4C210D3543; Sat, 27 Oct 2018 21:04:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 647A77AFAB; Sat, 27 Oct 2018 21:04:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26ECF15978; Sat, 27 Oct 2018 21:04:35 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RL4ZD1043922; Sat, 27 Oct 2018 21:04:35 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RL4YIM043919; Sat, 27 Oct 2018 21:04:34 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201810272104.w9RL4YIM043919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 27 Oct 2018 21:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339824 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 339824 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, 27 Oct 2018 21:04:36 -0000 Author: wulf Date: Sat Oct 27 21:04:34 2018 New Revision: 339824 URL: https://svnweb.freebsd.org/changeset/base/339824 Log: evdev: disable evdev if it is invoked from KDB or panic context This allow to prevent deadlock on entering KDB if one of evdev locks is already taken by userspace process. Also this change discards all but LED console events produced by KDB as unrelated to userspace. Tested by: dumbbell (as part of D15070) Objected by: bde (as 'KDB lock an already locked mutex' problem solution) MFC after: 1 month Modified: head/sys/dev/evdev/cdev.c head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev_private.h Modified: head/sys/dev/evdev/cdev.c ============================================================================== --- head/sys/dev/evdev/cdev.c Sat Oct 27 20:22:41 2018 (r339823) +++ head/sys/dev/evdev/cdev.c Sat Oct 27 21:04:34 2018 (r339824) @@ -349,6 +349,19 @@ evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data if (client->ec_revoked || evdev == NULL) return (ENODEV); + /* + * Fix evdev state corrupted with discarding of kdb events. + * EVIOCGKEY and EVIOCGLED ioctls can suffer from this. + */ + if (evdev->ev_kdb_active) { + EVDEV_LOCK(evdev); + if (evdev->ev_kdb_active) { + evdev->ev_kdb_active = false; + evdev_restore_after_kdb(evdev); + } + EVDEV_UNLOCK(evdev); + } + /* file I/O ioctl handling */ switch (cmd) { case FIOSETOWN: Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sat Oct 27 20:22:41 2018 (r339823) +++ head/sys/dev/evdev/evdev.c Sat Oct 27 21:04:34 2018 (r339824) @@ -32,9 +32,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -763,6 +765,30 @@ evdev_send_event(struct evdev_dev *evdev, uint16_t typ } } +void +evdev_restore_after_kdb(struct evdev_dev *evdev) +{ + int code; + + EVDEV_LOCK_ASSERT(evdev); + + /* Report postponed leds */ + for (code = 0; code < LED_CNT; code++) + if (bit_test(evdev->ev_kdb_led_states, code)) + evdev_send_event(evdev, EV_LED, code, + !bit_test(evdev->ev_led_states, code)); + bit_nclear(evdev->ev_kdb_led_states, 0, LED_MAX); + + /* Release stuck keys (CTRL + ALT + ESC) */ + evdev_stop_repeat(evdev); + for (code = 0; code < KEY_CNT; code++) { + if (bit_test(evdev->ev_key_states, code)) { + evdev_send_event(evdev, EV_KEY, code, KEY_EVENT_UP); + evdev_send_event(evdev, EV_SYN, SYN_REPORT, 1); + } + } +} + int evdev_push_event(struct evdev_dev *evdev, uint16_t type, uint16_t code, int32_t value) @@ -771,7 +797,25 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t typ if (evdev_check_event(evdev, type, code, value) != 0) return (EINVAL); + /* + * Discard all but LEDs kdb events as unrelated to userspace. + * Aggregate LED updates and postpone reporting until kdb deactivation. + */ + if (kdb_active || SCHEDULER_STOPPED()) { + evdev->ev_kdb_active = true; + if (type == EV_LED) + bit_set(evdev->ev_kdb_led_states, + bit_test(evdev->ev_led_states, code) != value); + return (0); + } + EVDEV_ENTER(evdev); + + /* Fix evdev state corrupted with discarding of kdb events */ + if (evdev->ev_kdb_active) { + evdev->ev_kdb_active = false; + evdev_restore_after_kdb(evdev); + } evdev_modify_event(evdev, type, code, &value); if (type == EV_SYN && code == SYN_REPORT && Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sat Oct 27 20:22:41 2018 (r339823) +++ head/sys/dev/evdev/evdev_private.h Sat Oct 27 21:04:34 2018 (r339824) @@ -117,6 +117,10 @@ struct evdev_dev bitstr_t bit_decl(ev_sw_states, SW_CNT); bool ev_report_opened; + /* KDB state: */ + bool ev_kdb_active; + bitstr_t bit_decl(ev_kdb_led_states, LED_CNT); + /* Multitouch protocol type B state: */ struct evdev_mt * ev_mt; @@ -190,6 +194,7 @@ int evdev_cdev_destroy(struct evdev_dev *); bool evdev_event_supported(struct evdev_dev *, uint16_t); void evdev_set_abs_bit(struct evdev_dev *, uint16_t); void evdev_set_absinfo(struct evdev_dev *, uint16_t, struct input_absinfo *); +void evdev_restore_after_kdb(struct evdev_dev *); /* Client interface: */ int evdev_register_client(struct evdev_dev *, struct evdev_client *); From owner-svn-src-head@freebsd.org Sat Oct 27 21:24:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D48E10D46BD; Sat, 27 Oct 2018 21:24:30 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2E807C0A7; Sat, 27 Oct 2018 21:24:29 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9542F15CBE; Sat, 27 Oct 2018 21:24:29 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RLOTYG054211; Sat, 27 Oct 2018 21:24:29 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RLOTpU054208; Sat, 27 Oct 2018 21:24:29 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810272124.w9RLOTpU054208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 27 Oct 2018 21:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339826 - in head: sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Commit-Revision: 339826 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, 27 Oct 2018 21:24:30 -0000 Author: yuripv Date: Sat Oct 27 21:24:28 2018 New Revision: 339826 URL: https://svnweb.freebsd.org/changeset/base/339826 Log: Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 3"). Add the document to SEE ALSO in bhyve.8 (and pet manlint here a bit). Reviewed by: jhb, rgrimes, 0mp Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D17531 Modified: head/sys/amd64/vmm/intel/vmcs.h head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Sat Oct 27 21:17:01 2018 (r339825) +++ head/sys/amd64/vmm/intel/vmcs.h Sat Oct 27 21:24:28 2018 (r339826) @@ -338,6 +338,14 @@ vmcs_write(uint32_t encoding, uint64_t val) #define EXIT_REASON_WBINVD 54 #define EXIT_REASON_XSETBV 55 #define EXIT_REASON_APIC_WRITE 56 +#define EXIT_REASON_RDRAND 57 +#define EXIT_REASON_INVPCID 58 +#define EXIT_REASON_VMFUNC 59 +#define EXIT_REASON_ENCLS 60 +#define EXIT_REASON_RDSEED 61 +#define EXIT_REASON_PM_LOG_FULL 62 +#define EXIT_REASON_XSAVES 63 +#define EXIT_REASON_XRSTORS 64 /* * NMI unblocking due to IRET. Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sat Oct 27 21:17:01 2018 (r339825) +++ head/usr.sbin/bhyve/bhyve.8 Sat Oct 27 21:24:28 2018 (r339826) @@ -367,7 +367,11 @@ Emergency write is advertised, but no-op at present. .Pp Framebuffer devices: .Bl -tag -width 10n -.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc +.It Xo +.Oo rfb= Ns Oo Ar IP\&: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns +.Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns +.Ar password Oc +.Xc .Bl -tag -width 8n .It Ar IPv4:port No or Ar [IPv6%zone]:port An @@ -398,8 +402,8 @@ and memory space .Pq 64KB at Ad 0xA0000 . The default .Dq io -option should be used for guests that attempt to issue BIOS -calls which result in I/O port queries, and fail to boot if I/O decode is disabled. +option should be used for guests that attempt to issue BIOS calls which result +in I/O port queries, and fail to boot if I/O decode is disabled. .Pp The .Dq on @@ -424,8 +428,8 @@ for configuration notes of particular guests. .It wait Instruct .Nm -to only boot upon the initiation of a VNC connection, simplifying the installation -of operating systems that require immediate keyboard input. +to only boot upon the initiation of a VNC connection, simplifying the +installation of operating systems that require immediate keyboard input. This can be removed for post-installation use. .It password This type of authentication is known to be cryptographically weak and is not @@ -497,8 +501,9 @@ General purpose registers can be queried for each virt registers such as floating-point and system registers cannot be queried. .Ss Memory Memory (including memory mapped I/O regions) can be read by the debugger, -but not written. Memory operations use virtual addresses that are resolved -to physical addresses via the current virtual CPU's active address translation. +but not written. +Memory operations use virtual addresses that are resolved to physical addresses +via the current virtual CPU's active address translation. .Ss Control The running guest can be interrupted by the debugger at any time .Pq for example, by pressing Ctrl-C in the debugger . @@ -609,6 +614,12 @@ bhyve -c 2 -m 4G -w -H \\ .Xr ethers 5 , .Xr bhyvectl 8 , .Xr bhyveload 8 +.Pp +.Rs +.%A Intel +.%B 64 and IA-32 Architectures Software Developer’s Manual +.%V Volume 3 +.Re .Sh HISTORY .Nm first appeared in Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sat Oct 27 21:17:01 2018 (r339825) +++ head/usr.sbin/bhyve/bhyverun.c Sat Oct 27 21:24:28 2018 (r339826) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -89,6 +91,73 @@ __FBSDID("$FreeBSD$"); #define MB (1024UL * 1024) #define GB (1024UL * MB) +static const char * const vmx_exit_reason_desc[] = { + [EXIT_REASON_EXCEPTION] = "Exception or non-maskable interrupt (NMI)", + [EXIT_REASON_EXT_INTR] = "External interrupt", + [EXIT_REASON_TRIPLE_FAULT] = "Triple fault", + [EXIT_REASON_INIT] = "INIT signal", + [EXIT_REASON_SIPI] = "Start-up IPI (SIPI)", + [EXIT_REASON_IO_SMI] = "I/O system-management interrupt (SMI)", + [EXIT_REASON_SMI] = "Other SMI", + [EXIT_REASON_INTR_WINDOW] = "Interrupt window", + [EXIT_REASON_NMI_WINDOW] = "NMI window", + [EXIT_REASON_TASK_SWITCH] = "Task switch", + [EXIT_REASON_CPUID] = "CPUID", + [EXIT_REASON_GETSEC] = "GETSEC", + [EXIT_REASON_HLT] = "HLT", + [EXIT_REASON_INVD] = "INVD", + [EXIT_REASON_INVLPG] = "INVLPG", + [EXIT_REASON_RDPMC] = "RDPMC", + [EXIT_REASON_RDTSC] = "RDTSC", + [EXIT_REASON_RSM] = "RSM", + [EXIT_REASON_VMCALL] = "VMCALL", + [EXIT_REASON_VMCLEAR] = "VMCLEAR", + [EXIT_REASON_VMLAUNCH] = "VMLAUNCH", + [EXIT_REASON_VMPTRLD] = "VMPTRLD", + [EXIT_REASON_VMPTRST] = "VMPTRST", + [EXIT_REASON_VMREAD] = "VMREAD", + [EXIT_REASON_VMRESUME] = "VMRESUME", + [EXIT_REASON_VMWRITE] = "VMWRITE", + [EXIT_REASON_VMXOFF] = "VMXOFF", + [EXIT_REASON_VMXON] = "VMXON", + [EXIT_REASON_CR_ACCESS] = "Control-register accesses", + [EXIT_REASON_DR_ACCESS] = "MOV DR", + [EXIT_REASON_INOUT] = "I/O instruction", + [EXIT_REASON_RDMSR] = "RDMSR", + [EXIT_REASON_WRMSR] = "WRMSR", + [EXIT_REASON_INVAL_VMCS] = + "VM-entry failure due to invalid guest state", + [EXIT_REASON_INVAL_MSR] = "VM-entry failure due to MSR loading", + [EXIT_REASON_MWAIT] = "MWAIT", + [EXIT_REASON_MTF] = "Monitor trap flag", + [EXIT_REASON_MONITOR] = "MONITOR", + [EXIT_REASON_PAUSE] = "PAUSE", + [EXIT_REASON_MCE_DURING_ENTRY] = + "VM-entry failure due to machine-check event", + [EXIT_REASON_TPR] = "TPR below threshold", + [EXIT_REASON_APIC_ACCESS] = "APIC access", + [EXIT_REASON_VIRTUALIZED_EOI] = "Virtualized EOI", + [EXIT_REASON_GDTR_IDTR] = "Access to GDTR or IDTR", + [EXIT_REASON_LDTR_TR] = "Access to LDTR or TR", + [EXIT_REASON_EPT_FAULT] = "EPT violation", + [EXIT_REASON_EPT_MISCONFIG] = "EPT misconfiguration", + [EXIT_REASON_INVEPT] = "INVEPT", + [EXIT_REASON_RDTSCP] = "RDTSCP", + [EXIT_REASON_VMX_PREEMPT] = "VMX-preemption timer expired", + [EXIT_REASON_INVVPID] = "INVVPID", + [EXIT_REASON_WBINVD] = "WBINVD", + [EXIT_REASON_XSETBV] = "XSETBV", + [EXIT_REASON_APIC_WRITE] = "APIC write", + [EXIT_REASON_RDRAND] = "RDRAND", + [EXIT_REASON_INVPCID] = "INVPCID", + [EXIT_REASON_VMFUNC] = "VMFUNC", + [EXIT_REASON_ENCLS] = "ENCLS", + [EXIT_REASON_RDSEED] = "RDSEED", + [EXIT_REASON_PM_LOG_FULL] = "Page-modification log full", + [EXIT_REASON_XSAVES] = "XSAVES", + [EXIT_REASON_XRSTORS] = "XRSTORS" +}; + typedef int (*vmexit_handler_t)(struct vmctx *, struct vm_exit *, int *vcpu); extern int vmexit_task_switch(struct vmctx *, struct vm_exit *, int *vcpu); @@ -506,14 +575,22 @@ vmexit_spinup_ap(struct vmctx *ctx, struct vm_exit *vm #define DEBUG_EPT_MISCONFIG #ifdef DEBUG_EPT_MISCONFIG -#define EXIT_REASON_EPT_MISCONFIG 49 #define VMCS_GUEST_PHYSICAL_ADDRESS 0x00002400 -#define VMCS_IDENT(x) ((x) | 0x80000000) static uint64_t ept_misconfig_gpa, ept_misconfig_pte[4]; static int ept_misconfig_ptenum; #endif +static const char * +vmexit_vmx_desc(uint32_t exit_reason) +{ + + if (exit_reason >= nitems(vmx_exit_reason_desc) || + vmx_exit_reason_desc[exit_reason] == NULL) + return ("Unknown"); + return (vmx_exit_reason_desc[exit_reason]); +} + static int vmexit_vmx(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { @@ -523,7 +600,8 @@ vmexit_vmx(struct vmctx *ctx, struct vm_exit *vmexit, fprintf(stderr, "\trip\t\t0x%016lx\n", vmexit->rip); fprintf(stderr, "\tinst_length\t%d\n", vmexit->inst_length); fprintf(stderr, "\tstatus\t\t%d\n", vmexit->u.vmx.status); - fprintf(stderr, "\texit_reason\t%u\n", vmexit->u.vmx.exit_reason); + fprintf(stderr, "\texit_reason\t%u (%s)\n", vmexit->u.vmx.exit_reason, + vmexit_vmx_desc(vmexit->u.vmx.exit_reason)); fprintf(stderr, "\tqualification\t0x%016lx\n", vmexit->u.vmx.exit_qualification); fprintf(stderr, "\tinst_type\t\t%d\n", vmexit->u.vmx.inst_type); From owner-svn-src-head@freebsd.org Sat Oct 27 21:27:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2BAF10D48D4; Sat, 27 Oct 2018 21:27:31 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4533E7C3E1; Sat, 27 Oct 2018 21:27:30 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id B580F2D6D7; Sun, 28 Oct 2018 00:27:21 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id Z4qEXKSV3bGD; Sun, 28 Oct 2018 00:27:18 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id D8DFC2D6C9; Sun, 28 Oct 2018 00:27:18 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id 9E898422128; Sun, 28 Oct 2018 00:27:14 +0300 (MSK) X-Virus-Scanned: amavisd-new at cicgroup.ru Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id F6cbqXW5lZOn; Sun, 28 Oct 2018 00:27:12 +0300 (MSK) Received: from [192.168.0.30] (gateway [10.0.2.2]) by mail.cicgroup.ru (Postfix) with ESMTPA id 42EB2422123; Sun, 28 Oct 2018 00:27:12 +0300 (MSK) Subject: Re: svn commit: r339823 - in head/sys/dev: atkbdc evdev kbdmux usb/input To: Niclas Zeising , Vladimir Kondratyev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810272022.w9RKMgOZ023575@repo.freebsd.org> <3d441b5d-e225-1226-e229-73c93f85c8a9@freebsd.org> From: Vladimir Kondratyev Openpgp: preference=signencrypt Autocrypt: addr=vladimir@kondratyev.su; prefer-encrypt=mutual; keydata= xsBNBFkI9Y8BCAC44UZYE8ZswFr/LHNHutuCmrbfP0j6jYl6zkW9VeM3cXVDjDsL3h9JhEFH zF9Or0muwHjspNuVdP2ot9vH8FCGAGEYS/GrzEEKxj4yoxAZxWnGUwzFiaf8fCtlrq5D9vOd /HSm6tb5YbcC/t/46hSwyPZ4i07rtsxmeozrKNx9H2gkcY0/AfmZ+UxY90/cj/F3aNk4wYLH gC95N99jaZvwPFX8wW5k++YaThXo8TNGQaxmC28cFFPdc1qICYdzYxS7kbTlGKp37lWmV9Z6 FursbfIkJZ7Rzw7NjGGijj4XjKif91ZwQNz/BfO58xrookQCibVCJ3JKcZo4NZ7rWTWlABEB AAHNLFZsYWRpbWlyIEtvbmRyYXR5ZXYgPHZsYWRpbWlyQGtvbmRyYXR5ZXYuc3U+wsCUBBMB CgA+FiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkJEuQCGwMFCQWjmoAFCwkIBwMFFQoJCAsF FgMCAQACHgECF4AACgkQg2u+IHApX3Wsmwf/bSUJeS0KXHQHH/XZwaqi0CfWxifrWfC+K62O DVA5TZZfZTs8h4Pov2DBvgx/DaQIVXeZazDPZho4v5SCrSulv//gboO6iN/7ZVnSRwQfyOp+ xnXLOzjC4mv4GjYc5sILJWQbWF4UPBGrBiFjtWrYjrRwVE6o/ThEXP92uu7suS2+U+f0zBh+ NZpJdf1T6EUN/dn8QLCyASNW1uYXzQ//5kTFc3ECC0VXzTnCZ7WWzkEOMbaVOwR25K5hCrg/ e41zrGlq8xLQhnXje+ZvG5DZkWKiZ0hUrB7nA8RLOVN6I1rzqStQjYxQuQqGu0Om/Bv6Rp+t AwEaLQdYOdXEyMZRe87ATQRZCPWPAQgAt5NVWoIBXPqs/lo3w3JxUZ2f2R1bTqdWNBHlKI1Y r6WDHSMWT9WM/vycZSG5N6a051ZGhyPS6LNoxxqokYwgLr9VMsBTS7pA8Nx8hzyjIAAYCQqX 2tluX2FzvcJUaEZDo3pt93IpHzvf924A1nvxP4n9NyfTu4GBZ+07sBJEploKugmAVIzXD1m6 zr1xeo6LF5Adz1b0WP2cU88gv66FiuZp9Cj6DTGdIta6hQqAtrBxINVd5XR99eXrZ0+YSiIi 7ywa3dDti8NXwkZkn4pGPDkCjb34PL1kdoD/yOCpp9yAdflF8T8KObjWuivnAMOYfmGGN30n nhh8Ub9n2DVw7wARAQABwsB8BBgBCgAmFiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkI9Y8C GwwFCQWjmoAACgkQg2u+IHApX3XzJggAs8Hiu/YeLfmZYp/57eaK/BrtW5TeLrKd5x4knFkY dxWOJ7ZJIIr7fhUH9OZKyAMYPzJaWuxhAuDIZiH39MZFnAhx6LnycCIQMY6CP4gJ8Y2ssvf7 eNcFRqL1xvEmAELMC5HtpnLp914xlYkBoqcU2rH7X0Qza4GvafQHHVrjc+DqqKbF6YjPsEew Fp4mqvvIxi71UiWy95q0x8tC3Cbm5hUCl2i5nl0iaWNNMkuh6is+jLJZ9W5CfEPcp+W2Vekd UTm4zN0+uaR7br3Lr3GbBJPlLHrH1haK6nJmyfVzf1MbK8wqIHiH1wWmIxC96QHKCEzRDjdf IVYGqb/YykLjBw== Message-ID: <82231f6b-41c4-8beb-771d-3b6ada56091c@kondratyev.su> Date: Sun, 28 Oct 2018 00:26:43 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <3d441b5d-e225-1226-e229-73c93f85c8a9@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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, 27 Oct 2018 21:27:32 -0000 On 27.10.2018 23:32, Niclas Zeising wrote: > On 10/27/18 10:22 PM, Vladimir Kondratyev wrote: >> Author: wulf >> Date: Sat Oct 27 20:22:41 2018 >> New Revision: 339823 >> URL: https://svnweb.freebsd.org/changeset/base/339823 >> >> Log: >> =C2=A0=C2=A0 evdev: Use console lock as evdev lock for all supported k= eyboard >> drivers. >> =C2=A0=C2=A0 =C2=A0=C2=A0 Now evdev part of keyboard drivers does not = take any locks if >> corresponding >> =C2=A0=C2=A0 input/eventN device node is not opened by userland consum= ers. >> =C2=A0=C2=A0 =C2=A0=C2=A0 Do not assert console lock inside evdev to h= andle the cases >> when keyboard >> =C2=A0=C2=A0 driver is called from some special single-threaded contex= t like >> shutdown >> =C2=A0=C2=A0 thread. >> > Related to https://reviews.freebsd.org/D15070 ? > Yes it is a part of D15070. Along with r339824 it closes all issues known to me that preventing evdev to be enabled by default. From owner-svn-src-head@freebsd.org Sat Oct 27 21:31:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6EFF10D4ADA; Sat, 27 Oct 2018 21:31:06 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6776A7C71C; Sat, 27 Oct 2018 21:31:06 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42jDZ10JCTzDhxn; Sat, 27 Oct 2018 21:31:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id HV3EgYaJugqE; Sat, 27 Oct 2018 21:31:04 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:9eda:3eff:fe70:24c0]) by mail.daemonic.se (Postfix) with ESMTPSA id 42jDZ030pXzDhFd; Sat, 27 Oct 2018 21:31:04 +0000 (UTC) Subject: Re: svn commit: r339823 - in head/sys/dev: atkbdc evdev kbdmux usb/input To: Vladimir Kondratyev , Vladimir Kondratyev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810272022.w9RKMgOZ023575@repo.freebsd.org> <3d441b5d-e225-1226-e229-73c93f85c8a9@freebsd.org> <82231f6b-41c4-8beb-771d-3b6ada56091c@kondratyev.su> From: Niclas Zeising Message-ID: <22411251-9d2b-8799-3914-28974a9710f2@freebsd.org> Date: Sat, 27 Oct 2018 23:31:04 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <82231f6b-41c4-8beb-771d-3b6ada56091c@kondratyev.su> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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, 27 Oct 2018 21:31:06 -0000 On 10/27/18 11:26 PM, Vladimir Kondratyev wrote: > On 27.10.2018 23:32, Niclas Zeising wrote: >> On 10/27/18 10:22 PM, Vladimir Kondratyev wrote: >>> Author: wulf >>> Date: Sat Oct 27 20:22:41 2018 >>> New Revision: 339823 >>> URL: https://svnweb.freebsd.org/changeset/base/339823 >>> >>> Log: >>> =C2=A0=C2=A0 evdev: Use console lock as evdev lock for all supported= keyboard >>> drivers. >>> =C2=A0=C2=A0 =C2=A0=C2=A0 Now evdev part of keyboard drivers does no= t take any locks if >>> corresponding >>> =C2=A0=C2=A0 input/eventN device node is not opened by userland cons= umers. >>> =C2=A0=C2=A0 =C2=A0=C2=A0 Do not assert console lock inside evdev to= handle the cases >>> when keyboard >>> =C2=A0=C2=A0 driver is called from some special single-threaded cont= ext like >>> shutdown >>> =C2=A0=C2=A0 thread. >>> >> Related to https://reviews.freebsd.org/D15070 ? >> > Yes it is a part of D15070. >=20 > Along with r339824 it closes all issues known to me that preventing > evdev to be enabled by default. >=20 Thank you! Any chance you can add a note in phabricator and close/abandon the review= ? Once again thank you! Regards --=20 Niclas Zeising From owner-svn-src-head@freebsd.org Sat Oct 27 23:31:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 946A410D7CFD; Sat, 27 Oct 2018 23:31:43 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A65181ACF; Sat, 27 Oct 2018 23:31:43 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D08E171BA; Sat, 27 Oct 2018 23:31:43 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RNVgVi022773; Sat, 27 Oct 2018 23:31:42 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RNVgdv022772; Sat, 27 Oct 2018 23:31:42 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810272331.w9RNVgdv022772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 27 Oct 2018 23:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339827 - head/usr.bin/localedef X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.bin/localedef X-SVN-Commit-Revision: 339827 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, 27 Oct 2018 23:31:43 -0000 Author: yuripv Date: Sat Oct 27 23:31:42 2018 New Revision: 339827 URL: https://svnweb.freebsd.org/changeset/base/339827 Log: localedef: define characters in "space" class also as "print", except for the known conflicts ("control" characters can't be "print"able). POSIX doesn't explicitly forbid this, and actually includes character in "print". PR: 225692 Reviewed by: bapt, cem (previous version), pfg (previous version) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D17467 Modified: head/usr.bin/localedef/ctype.c Modified: head/usr.bin/localedef/ctype.c ============================================================================== --- head/usr.bin/localedef/ctype.c Sat Oct 27 21:24:28 2018 (r339826) +++ head/usr.bin/localedef/ctype.c Sat Oct 27 23:31:42 2018 (r339827) @@ -120,7 +120,13 @@ add_ctype_impl(ctype_node_t *ctn) ctn->ctype |= (_ISDIGIT | _ISGRAPH | _ISPRINT | _ISXDIGIT | _E4); break; case T_ISSPACE: - ctn->ctype |= _ISSPACE; + /* + * This can be troublesome as , , + * , , and are defined both + * as space and cntrl, and POSIX doesn't allow cntrl/print + * combination. We will take care of this in dump_ctype(). + */ + ctn->ctype |= (_ISSPACE | _ISPRINT); break; case T_ISCNTRL: ctn->ctype |= _ISCNTRL; @@ -378,9 +384,15 @@ dump_ctype(void) ctn->ctype |= _ISPRINT; /* - * Finally, POSIX requires that certain combinations - * are invalid. We don't flag this as a fatal error, - * but we will warn about. + * POSIX requires that certain combinations are invalid. + * Try fixing the cases we know about (see add_ctype_impl()). + */ + if ((ctn->ctype & (_ISSPACE|_ISCNTRL)) == (_ISSPACE|_ISCNTRL)) + ctn->ctype &= ~_ISPRINT; + + /* + * Finally, don't flag remaining cases as a fatal error, + * and just warn about them. */ if ((ctn->ctype & _ISALPHA) && (ctn->ctype & (_ISPUNCT|_ISDIGIT)))