From owner-svn-src-head@freebsd.org Sun Feb 24 03:41:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F401510825; Sun, 24 Feb 2019 03:41:06 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E457841F3; Sun, 24 Feb 2019 03:41:05 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90F5F27451; Sun, 24 Feb 2019 03:41:05 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1O3f5t8087524; Sun, 24 Feb 2019 03:41:05 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1O3f5qU087523; Sun, 24 Feb 2019 03:41:05 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201902240341.x1O3f5qU087523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 24 Feb 2019 03:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344491 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ume X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 344491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E457841F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 03:41:06 -0000 Author: ume Date: Sun Feb 24 03:41:05 2019 New Revision: 344491 URL: https://svnweb.freebsd.org/changeset/base/344491 Log: An IPv6 address matching should be fixed. Specifying an IPv6 address by the -a option was broken since r309933. Reported by: "O. Hartmann" MFC after: 1 week Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sun Feb 24 01:56:35 2019 (r344490) +++ head/usr.sbin/syslogd/syslogd.c Sun Feb 24 03:41:05 2019 (r344491) @@ -3202,8 +3202,8 @@ validate(struct sockaddr *sa, const char *hname) dprintf("rejected in rule %d due to scope mismatch.\n", i); continue; } - if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr, - &a6p->sin6_addr, &m6p->sin6_addr) != 0) { + if (!IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr, + &a6p->sin6_addr, &m6p->sin6_addr)) { dprintf("rejected in rule %d due to IP mismatch.\n", i); continue; } From owner-svn-src-head@freebsd.org Sun Feb 24 14:20:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1CC91520523; Sun, 24 Feb 2019 14:20:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 408CB6EE67; Sun, 24 Feb 2019 14:20:48 +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 34AE265D0; Sun, 24 Feb 2019 14:20:48 +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 x1OEKmhD022707; Sun, 24 Feb 2019 14:20:48 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OEKmpv022706; Sun, 24 Feb 2019 14:20:48 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201902241420.x1OEKmpv022706@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: Sun, 24 Feb 2019 14:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344492 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 344492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 408CB6EE67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 14:20:48 -0000 Author: 0mp (ports committer) Date: Sun Feb 24 14:20:47 2019 New Revision: 344492 URL: https://svnweb.freebsd.org/changeset/base/344492 Log: style.mdoc.5: Fix a typo Reviewed by: eadler Approved by: eadler (doc) Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D19328 Modified: head/share/man/man5/style.mdoc.5 Modified: head/share/man/man5/style.mdoc.5 ============================================================================== --- head/share/man/man5/style.mdoc.5 Sun Feb 24 03:41:05 2019 (r344491) +++ head/share/man/man5/style.mdoc.5 Sun Feb 24 14:20:47 2019 (r344492) @@ -203,7 +203,7 @@ macro is usually not necessary. .It Use .Sy \&Va -instead of: +instead of .Sy \&Dv for .Xr sysctl 8 From owner-svn-src-head@freebsd.org Sun Feb 24 17:23:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D9C0150494A; Sun, 24 Feb 2019 17:23:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E46B47573D; Sun, 24 Feb 2019 17:23:55 +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 C52AB8642; Sun, 24 Feb 2019 17:23:55 +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 x1OHNtG9021948; Sun, 24 Feb 2019 17:23:55 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OHNte4021947; Sun, 24 Feb 2019 17:23:55 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201902241723.x1OHNte4021947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 24 Feb 2019 17:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344493 - 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: 344493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E46B47573D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 17:23:56 -0000 Author: kp Date: Sun Feb 24 17:23:55 2019 New Revision: 344493 URL: https://svnweb.freebsd.org/changeset/base/344493 Log: pf: Small performance tweak Because fetching a counter is a rather expansive function we should use counter_u64_fetch() in pf_state_expires() only when necessary. A "rdr pass" rule should not cause more effort than separate "rdr" and "pass" rules. For rules with adaptive timeout values the call of counter_u64_fetch() should be accepted, but otherwise not. From the man page: The adaptive timeout values can be defined both globally and for each rule. When used on a per-rule basis, the values relate to the number of states created by the rule, otherwise to the total number of states. This handling of adaptive timeouts is done in pf_state_expires(). The calculation needs three values: start, end and states. 1. Normal rules "pass .." without adaptive setting meaning "start = 0" runs in the else-section and therefore takes "start" and "end" from the global default settings and sets "states" to pf_status.states (= total number of states). 2. Special rules like "pass .. keep state (adaptive.start 500 adaptive.end 1000)" have start != 0, run in the if-section and take "start" and "end" from the rule and set "states" to the number of states created by their rule using counter_u64_fetch(). Thats all ok, but there is a third case without special handling in the above code snippet: 3. All "rdr/nat pass .." statements use together the pf_default_rule. Therefore we have "start != 0" in this case and we run the if-section but we better should run the else-section in this case and do not fetch the counter of the pf_default_rule but take the total number of states. Submitted by: Andreas Longwitz MFC after: 2 weeks Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Feb 24 14:20:47 2019 (r344492) +++ head/sys/netpfil/pf/pf.c Sun Feb 24 17:23:55 2019 (r344493) @@ -1564,7 +1564,7 @@ pf_state_expires(const struct pf_state *state) if (!timeout) timeout = V_pf_default_rule.timeout[state->timeout]; start = state->rule.ptr->timeout[PFTM_ADAPTIVE_START]; - if (start) { + if (start && state->rule.ptr != &V_pf_default_rule) { end = state->rule.ptr->timeout[PFTM_ADAPTIVE_END]; states = counter_u64_fetch(state->rule.ptr->states_cur); } else { From owner-svn-src-head@freebsd.org Sun Feb 24 18:47:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFD3A1506AC7; Sun, 24 Feb 2019 18:47:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 762CD80FF5; Sun, 24 Feb 2019 18:47:05 +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 69AD69569; Sun, 24 Feb 2019 18:47:05 +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 x1OIl54G066697; Sun, 24 Feb 2019 18:47:05 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OIl4mW066694; Sun, 24 Feb 2019 18:47:04 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201902241847.x1OIl4mW066694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 24 Feb 2019 18:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344494 - in head: sbin/sysctl sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head: sbin/sysctl sys/dev/evdev X-SVN-Commit-Revision: 344494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 762CD80FF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 18:47:06 -0000 Author: wulf Date: Sun Feb 24 18:47:04 2019 New Revision: 344494 URL: https://svnweb.freebsd.org/changeset/base/344494 Log: evdev: export event device properties through sysctl interface A big security advantage of Wayland is not allowing applications to read input devices all the time. Having /dev/input/* accessible to the user account subverts this advantage. libudev-devd was opening the evdev devices to detect their types (mouse, keyboard, touchpad, etc). This don't work if /dev/input/* is inaccessible. With the kernel exposing this information as sysctls (kern.evdev.input.*), we can work w/o /dev/input/* access, preserving the Wayland security model. Submitted by: Greg V Reviewed by: wulf, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18694 Modified: head/sbin/sysctl/sysctl.c head/sys/dev/evdev/evdev.c head/sys/dev/evdev/evdev_private.h Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Sun Feb 24 17:23:55 2019 (r344493) +++ head/sbin/sysctl/sysctl.c Sun Feb 24 18:47:04 2019 (r344494) @@ -49,6 +49,7 @@ static const char rcsid[] = #include #include #include +#include #ifdef __amd64__ #include @@ -680,6 +681,22 @@ S_vmtotal(size_t l2, void *p) return (0); } +static int +S_input_id(size_t l2, void *p) +{ + struct input_id *id = p; + + if (l2 != sizeof(*id)) { + warnx("S_input_id %zu != %zu", l2, sizeof(*id)); + return (1); + } + + printf("{ bustype = 0x%04x, vendor = 0x%04x, " + "product = 0x%04x, version = 0x%04x }", + id->bustype, id->vendor, id->product, id->version); + return (0); +} + #ifdef __amd64__ static int S_efi_map(size_t l2, void *p) @@ -983,6 +1000,8 @@ show_var(int *oid, int nlen) func = S_loadavg; else if (strcmp(fmt, "S,vmtotal") == 0) func = S_vmtotal; + else if (strcmp(fmt, "S,input_id") == 0) + func = S_input_id; #ifdef __amd64__ else if (strcmp(fmt, "S,efi_map_header") == 0) func = S_efi_map; Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sun Feb 24 17:23:55 2019 (r344493) +++ head/sys/dev/evdev/evdev.c Sun Feb 24 18:47:04 2019 (r344494) @@ -76,6 +76,8 @@ SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_R "bit2 - mouse hardware, bit3 - keyboard hardware"); SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); +SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, + "Evdev input devices"); #endif static void evdev_start_repeat(struct evdev_dev *, uint16_t); @@ -196,6 +198,87 @@ evdev_estimate_report_size(struct evdev_dev *evdev) return (size); } +static void +evdev_sysctl_create(struct evdev_dev *evdev) +{ + struct sysctl_oid *ev_sysctl_tree; + char ev_unit_str[8]; + + snprintf(ev_unit_str, sizeof(ev_unit_str), "%d", evdev->ev_unit); + sysctl_ctx_init(&evdev->ev_sysctl_ctx); + + ev_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&evdev->ev_sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_kern_evdev_input), OID_AUTO, + ev_unit_str, CTLFLAG_RD, NULL, "", "device index"); + + SYSCTL_ADD_STRING(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "name", CTLFLAG_RD, + evdev->ev_name, 0, + "Input device name"); + + SYSCTL_ADD_STRUCT(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "id", CTLFLAG_RD, + &evdev->ev_id, input_id, + "Input device identification"); + + /* ioctl returns ENOENT if phys is not set. sysctl returns "" here */ + SYSCTL_ADD_STRING(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "phys", CTLFLAG_RD, + evdev->ev_shortname, 0, + "Input device short name"); + + /* ioctl returns ENOENT if uniq is not set. sysctl returns "" here */ + SYSCTL_ADD_STRING(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "uniq", CTLFLAG_RD, + evdev->ev_serial, 0, + "Input device unique number"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "props", CTLFLAG_RD, + evdev->ev_prop_flags, sizeof(evdev->ev_prop_flags), "", + "Input device properties"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "type_bits", CTLFLAG_RD, + evdev->ev_type_flags, sizeof(evdev->ev_type_flags), "", + "Input device supported events types"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "key_bits", CTLFLAG_RD, + evdev->ev_key_flags, sizeof(evdev->ev_key_flags), + "", "Input device supported keys"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "rel_bits", CTLFLAG_RD, + evdev->ev_rel_flags, sizeof(evdev->ev_rel_flags), "", + "Input device supported relative events"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "abs_bits", CTLFLAG_RD, + evdev->ev_abs_flags, sizeof(evdev->ev_abs_flags), "", + "Input device supported absolute events"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "msc_bits", CTLFLAG_RD, + evdev->ev_msc_flags, sizeof(evdev->ev_msc_flags), "", + "Input device supported miscellaneous events"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "led_bits", CTLFLAG_RD, + evdev->ev_led_flags, sizeof(evdev->ev_led_flags), "", + "Input device supported LED events"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "snd_bits", CTLFLAG_RD, + evdev->ev_snd_flags, sizeof(evdev->ev_snd_flags), "", + "Input device supported sound events"); + + SYSCTL_ADD_OPAQUE(&evdev->ev_sysctl_ctx, + SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "sw_bits", CTLFLAG_RD, + evdev->ev_sw_flags, sizeof(evdev->ev_sw_flags), "", + "Input device supported switch events"); +} + static int evdev_register_common(struct evdev_dev *evdev) { @@ -235,6 +318,12 @@ evdev_register_common(struct evdev_dev *evdev) /* Create char device node */ ret = evdev_cdev_create(evdev); + if (ret != 0) + goto bail_out; + + /* Create sysctls (for device enumeration without /dev/input access rights) */ + evdev_sysctl_create(evdev); + bail_out: return (ret); } @@ -271,6 +360,8 @@ evdev_unregister(struct evdev_dev *evdev) int ret; debugf(evdev, "%s: unregistered evdev provider: %s\n", evdev->ev_shortname, evdev->ev_name); + + sysctl_ctx_free(&evdev->ev_sysctl_ctx); EVDEV_LOCK(evdev); evdev->ev_cdev->si_drv1 = NULL; Modified: head/sys/dev/evdev/evdev_private.h ============================================================================== --- head/sys/dev/evdev/evdev_private.h Sun Feb 24 17:23:55 2019 (r344493) +++ head/sys/dev/evdev/evdev_private.h Sun Feb 24 18:47:04 2019 (r344494) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -131,6 +132,9 @@ struct evdev_dev /* Parent driver callbacks: */ const struct evdev_methods * ev_methods; void * ev_softc; + + /* Sysctl: */ + struct sysctl_ctx_list ev_sysctl_ctx; LIST_ENTRY(evdev_dev) ev_link; LIST_HEAD(, evdev_client) ev_clients; From owner-svn-src-head@freebsd.org Sun Feb 24 21:05:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B43B150C5AB; Sun, 24 Feb 2019 21:05:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ED26884C1; Sun, 24 Feb 2019 21:05:16 +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 33C29ADEB; Sun, 24 Feb 2019 21:05:16 +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 x1OL5GKY041973; Sun, 24 Feb 2019 21:05:16 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OL5Eus041962; Sun, 24 Feb 2019 21:05:14 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201902242105.x1OL5Eus041962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 24 Feb 2019 21:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344502 - in head/bin/sh: . tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head/bin/sh: . tests/execution X-SVN-Commit-Revision: 344502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3ED26884C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 21:05:16 -0000 Author: jilles Date: Sun Feb 24 21:05:13 2019 New Revision: 344502 URL: https://svnweb.freebsd.org/changeset/base/344502 Log: sh: Add set -o pipefail The pipefail option allows checking the exit status of all commands in a pipeline more easily, at a limited cost of complexity in sh itself. It works similarly to the option in bash, ksh93 and mksh. Like ksh93 and unlike bash and mksh, the state of the option is saved when a pipeline is started. Therefore, even in the case of commands like A | B & a later change of the option does not change the exit status, the same way (A | B) & works. Since SIGPIPE is not handled specially, more work in the script is required for a proper exit status for pipelines containing commands such as head that may terminate successfully without reading all input. This can be something like ( cmd1 r=$? if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then exit 0 else exit "$r" fi ) | head PR: 224270 Relnotes: yes Added: head/bin/sh/tests/execution/pipefail1.0 (contents, props changed) head/bin/sh/tests/execution/pipefail2.42 (contents, props changed) head/bin/sh/tests/execution/pipefail3.42 (contents, props changed) head/bin/sh/tests/execution/pipefail4.42 (contents, props changed) head/bin/sh/tests/execution/pipefail5.42 (contents, props changed) head/bin/sh/tests/execution/pipefail6.42 (contents, props changed) head/bin/sh/tests/execution/pipefail7.0 (contents, props changed) Modified: head/bin/sh/jobs.c head/bin/sh/options.h head/bin/sh/sh.1 head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Feb 24 20:55:00 2019 (r344501) +++ head/bin/sh/jobs.c Sun Feb 24 21:05:13 2019 (r344502) @@ -105,6 +105,7 @@ struct job { char changed; /* true if status has changed */ char foreground; /* true if running in the foreground */ char remembered; /* true if $! referenced */ + char pipefail; /* pass any non-zero status */ #if JOBS char jobctl; /* job running under job control */ struct job *next; /* job used after this one */ @@ -144,6 +145,7 @@ static void setcurjob(struct job *); static void deljob(struct job *); static struct job *getcurjob(struct job *); #endif +static int getjobstatus(const struct job *); static void printjobcmd(struct job *); static void showjob(struct job *, int); @@ -341,6 +343,20 @@ jobscmd(int argc __unused, char *argv[] __unused) return (0); } +static int getjobstatus(const struct job *jp) +{ + int i, status; + + if (!jp->pipefail) + return (jp->ps[jp->nprocs - 1].status); + for (i = jp->nprocs - 1; i >= 0; i--) { + status = jp->ps[i].status; + if (status != 0) + return (status); + } + return (0); +} + static void printjobcmd(struct job *jp) { @@ -377,7 +393,7 @@ showjob(struct job *jp, int mode) } #endif coredump = ""; - status = jp->ps[jp->nprocs - 1].status; + status = getjobstatus(jp); if (jp->state == 0) { statestr = "Running"; #if JOBS @@ -556,7 +572,7 @@ waitcmdloop(struct job *job) do { if (job != NULL) { if (job->state == JOBDONE) { - status = job->ps[job->nprocs - 1].status; + status = getjobstatus(job); if (WIFEXITED(status)) retval = WEXITSTATUS(status); else @@ -781,6 +797,7 @@ makejob(union node *node __unused, int nprocs) jp->nprocs = 0; jp->foreground = 0; jp->remembered = 0; + jp->pipefail = pipefailflag; #if JOBS jp->jobctl = jobctl; jp->next = NULL; @@ -1076,7 +1093,7 @@ waitforjob(struct job *jp, int *signaled) if (jp->state == JOBSTOPPED) setcurjob(jp); #endif - status = jp->ps[jp->nprocs - 1].status; + status = getjobstatus(jp); if (signaled != NULL) *signaled = WIFSIGNALED(status); /* convert to 8 bits */ Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Sun Feb 24 20:55:00 2019 (r344501) +++ head/bin/sh/options.h Sun Feb 24 21:05:13 2019 (r344502) @@ -67,9 +67,10 @@ struct shparam { #define Pflag optval[17] #define hflag optval[18] #define nologflag optval[19] +#define pipefailflag optval[20] #define NSHORTOPTS 19 -#define NOPTS 20 +#define NOPTS 21 extern char optval[NOPTS]; extern const char optletter[NSHORTOPTS]; @@ -97,6 +98,7 @@ static const unsigned char optname[] = "\010physical" "\010trackall" "\005nolog" + "\010pipefail" ; #endif Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Feb 24 20:55:00 2019 (r344501) +++ head/bin/sh/sh.1 Sun Feb 24 21:05:13 2019 (r344502) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd January 24, 2019 +.Dd February 24, 2019 .Dt SH 1 .Os .Sh NAME @@ -343,6 +343,18 @@ Useful for debugging. .It Li nolog Another do-nothing option for POSIX compliance. It only has a long name. +.It Li pipefail +Change the exit status of a pipeline to the last non-zero exit status of +any command in the pipeline, if any. +Since an exit due to +.Dv SIGPIPE +counts as a non-zero exit status, +this option may cause non-zero exit status for successful pipelines +if a command such as +.Xr head 1 +in the pipeline terminates with status 0 without reading its +input completely. +This option only has a long name. .El .Pp The @@ -856,12 +868,15 @@ If the keyword .Ic !\& does not precede the pipeline, the exit status is the exit status of the last command specified -in the pipeline. +in the pipeline if the +.Cm pipefail +option is not set or all commands returned zero, +or the last non-zero exit status of any command in the pipeline otherwise. Otherwise, the exit status is the logical -NOT of the exit status of the last command. +NOT of that exit status. That is, if -the last command returns zero, the exit status is 1; if -the last command returns greater than zero, the exit status +that status is zero, the exit status is 1; if +that status is greater than zero, the exit status is zero. .Pp Because pipeline assignment of standard input or standard Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Sun Feb 24 20:55:00 2019 (r344501) +++ head/bin/sh/tests/execution/Makefile Sun Feb 24 21:05:13 2019 (r344502) @@ -31,6 +31,13 @@ ${PACKAGE}FILES+= killed2.0 ${PACKAGE}FILES+= not1.0 ${PACKAGE}FILES+= not2.0 ${PACKAGE}FILES+= path1.0 +${PACKAGE}FILES+= pipefail1.0 +${PACKAGE}FILES+= pipefail2.42 +${PACKAGE}FILES+= pipefail3.42 +${PACKAGE}FILES+= pipefail4.42 +${PACKAGE}FILES+= pipefail5.42 +${PACKAGE}FILES+= pipefail6.42 +${PACKAGE}FILES+= pipefail7.0 ${PACKAGE}FILES+= redir1.0 ${PACKAGE}FILES+= redir2.0 ${PACKAGE}FILES+= redir3.0 Added: head/bin/sh/tests/execution/pipefail1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail1.0 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +set -o pipefail +: && : | : && : | : | : && : | : | : | : Added: head/bin/sh/tests/execution/pipefail2.42 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail2.42 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +set -o pipefail +(exit 42) | : Added: head/bin/sh/tests/execution/pipefail3.42 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail3.42 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +set -o pipefail +: | (exit 42) Added: head/bin/sh/tests/execution/pipefail4.42 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail4.42 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +set -o pipefail +(exit 43) | (exit 42) Added: head/bin/sh/tests/execution/pipefail5.42 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail5.42 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +set -o pipefail +(exit 42) | : & +wait %+ Added: head/bin/sh/tests/execution/pipefail6.42 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail6.42 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +set -o pipefail +(exit 42) | : & +set +o pipefail +wait %+ Added: head/bin/sh/tests/execution/pipefail7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/pipefail7.0 Sun Feb 24 21:05:13 2019 (r344502) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +(exit 42) | : & +set -o pipefail +wait %+ From owner-svn-src-head@freebsd.org Sun Feb 24 21:22:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1FC4150D137; Sun, 24 Feb 2019 21:22:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 610F0891D7; Sun, 24 Feb 2019 21:22:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F88DB140; Sun, 24 Feb 2019 21:22:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1OLMHfN051735; Sun, 24 Feb 2019 21:22:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OLMHJu051734; Sun, 24 Feb 2019 21:22:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902242122.x1OLMHJu051734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 24 Feb 2019 21:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344503 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 344503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 610F0891D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 21:22:18 -0000 Author: dim Date: Sun Feb 24 21:22:16 2019 New Revision: 344503 URL: https://svnweb.freebsd.org/changeset/base/344503 Log: Pull in r354756 from upstream llvm trunk (by Craig Topper): [X86] Fix tls variable lowering issue with large code model Summary: The problem here is the lowering for tls variable. Below is the DAG for the code. SelectionDAG has 11 nodes: t0: ch = EntryToken t8: i64,ch = load<(load 8 from `i8 addrspace(257)* null`, addrspace 257)> t0, Constant:i64<0>, undef:i64 t10: i64 = X86ISD::WrapperRIP TargetGlobalTLSAddress:i64 0 [TF=10] t11: i64,ch = load<(load 8 from got)> t0, t10, undef:i64 t12: i64 = add t8, t11 t4: i32,ch = load<(dereferenceable load 4 from @x)> t0, t12, undef:i64 t6: ch = CopyToReg t0, Register:i32 %0, t4 And when mcmodel is large, below instruction can NOT be folded. t10: i64 = X86ISD::WrapperRIP TargetGlobalTLSAddress:i64 0 [TF=10] t11: i64,ch = load<(load 8 from got)> t0, t10, undef:i64 So "t11: i64,ch = load<(load 8 from got)> t0, t10, undef:i64" is lowered to " Morphed node: t11: i64,ch = MOV64rm t10, TargetConstant:i8<1>, Register:i64 $noreg, TargetConstant:i32<0>, Register:i32 $noreg, t0" When llvm start to lower "t10: i64 = X86ISD::WrapperRIP TargetGlobalTLSAddress:i64 0 [TF=10]", it fails. The patch is to fold the load and X86ISD::WrapperRIP. Fixes PR26906 Patch by LuoYuanke Reviewers: craig.topper, rnk, annita.zhang, wxiao3 Reviewed By: rnk Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58336 This should fix "fatal error: error in backend: Cannot select" messages when compiling functions using -mcmodel=large. Reported by: phk PR: 233143 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Feb 24 21:05:13 2019 (r344502) +++ head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Feb 24 21:22:16 2019 (r344503) @@ -989,15 +989,23 @@ bool X86DAGToDAGISel::matchWrapper(SDValue N, X86ISelA if (AM.hasSymbolicDisplacement()) return true; + bool IsRIPRelTLS = false; bool IsRIPRel = N.getOpcode() == X86ISD::WrapperRIP; + if (IsRIPRel) { + SDValue Val = N.getOperand(0); + if (Val.getOpcode() == ISD::TargetGlobalTLSAddress) + IsRIPRelTLS = true; + } - // We can't use an addressing mode in the 64-bit large code model. In the - // medium code model, we use can use an mode when RIP wrappers are present. - // That signifies access to globals that are known to be "near", such as the - // GOT itself. + // We can't use an addressing mode in the 64-bit large code model. + // Global TLS addressing is an exception. In the medium code model, + // we use can use a mode when RIP wrappers are present. + // That signifies access to globals that are known to be "near", + // such as the GOT itself. CodeModel::Model M = TM.getCodeModel(); if (Subtarget->is64Bit() && - (M == CodeModel::Large || (M == CodeModel::Medium && !IsRIPRel))) + ((M == CodeModel::Large && !IsRIPRelTLS) || + (M == CodeModel::Medium && !IsRIPRel))) return true; // Base and index reg must be 0 in order to use %rip as base. From owner-svn-src-head@freebsd.org Sun Feb 24 23:16:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1A88151116B; Sun, 24 Feb 2019 23:16:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2919C8D98C; Sun, 24 Feb 2019 23:16:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16FF0C6A1; Sun, 24 Feb 2019 23:16:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1ONGXeK009813; Sun, 24 Feb 2019 23:16:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1ONGXlX009812; Sun, 24 Feb 2019 23:16:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902242316.x1ONGXlX009812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Feb 2019 23:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344506 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2919C8D98C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 23:16:34 -0000 Author: ian Date: Sun Feb 24 23:16:33 2019 New Revision: 344506 URL: https://svnweb.freebsd.org/changeset/base/344506 Log: Add support for probing/attaching on FDT-based systems. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Feb 24 23:08:53 2019 (r344505) +++ head/sys/dev/flash/at45d.c Sun Feb 24 23:16:33 2019 (r344506) @@ -47,6 +47,21 @@ __FBSDID("$FreeBSD$"); #include #include "spibus_if.h" +#include "opt_platform.h" + +#ifdef FDT +#include +#include +#include + +static struct ofw_compat_data compat_data[] = { + { "atmel,at45", 1 }, + { "atmel,dataflash", 1 }, + { NULL, 0 }, +}; +SPIBUS_PNP_INFO(compat_data); +#endif + struct at45d_flash_ident { const char *name; @@ -187,9 +202,22 @@ at45d_wait_ready(device_t dev, uint8_t *status) static int at45d_probe(device_t dev) { + int rv; +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + rv = BUS_PROBE_DEFAULT; +#else + rv = BUS_PROBE_NOWILDCARD; +#endif + device_set_desc(dev, "AT45D Flash Family"); - return (0); + return (rv); } static int From owner-svn-src-head@freebsd.org Sun Feb 24 19:31:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D94E41508837; Sun, 24 Feb 2019 19:31: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E3FE8338A; Sun, 24 Feb 2019 19:31: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 739F59E16; Sun, 24 Feb 2019 19:31:43 +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 x1OJVhJj092648; Sun, 24 Feb 2019 19:31:43 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OJVhuQ092647; Sun, 24 Feb 2019 19:31:43 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201902241931.x1OJVhuQ092647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 24 Feb 2019 19:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344495 - 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: 344495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E3FE8338A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 19:31:44 -0000 Author: wulf Date: Sun Feb 24 19:31:42 2019 New Revision: 344495 URL: https://svnweb.freebsd.org/changeset/base/344495 Log: Fix build when EVDEV_SUPPORT is option disabled after r344494 MFC with: 344494 Modified: head/sys/dev/evdev/evdev.c Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Sun Feb 24 18:47:04 2019 (r344494) +++ head/sys/dev/evdev/evdev.c Sun Feb 24 19:31:42 2019 (r344495) @@ -69,16 +69,16 @@ MALLOC_DEFINE(M_EVDEV, "evdev", "evdev memory"); int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX; int evdev_sysmouse_t_axis = 0; -#ifdef EVDEV_SUPPORT SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); +#ifdef EVDEV_SUPPORT SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); +#endif SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, "Evdev input devices"); -#endif static void evdev_start_repeat(struct evdev_dev *, uint16_t); static void evdev_stop_repeat(struct evdev_dev *); From owner-svn-src-head@freebsd.org Sun Feb 24 22:49:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683211510699; Sun, 24 Feb 2019 22:49:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F9198CC14; Sun, 24 Feb 2019 22:49:57 +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 04DA6C129; Sun, 24 Feb 2019 22:49:57 +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 x1OMnuLk094108; Sun, 24 Feb 2019 22:49:56 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1OMnuqN094107; Sun, 24 Feb 2019 22:49:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201902242249.x1OMnuqN094107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 24 Feb 2019 22:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344504 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F9198CC14 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 22:49:57 -0000 Author: bz Date: Sun Feb 24 22:49:56 2019 New Revision: 344504 URL: https://svnweb.freebsd.org/changeset/base/344504 Log: Make arp code return (more) errors. arprequest() is a void function and in case of error we simply return without any feedback. In case of any local operation or *if_output() failing no feedback is send up the stack for the packet which triggered the arp request to be sent. arpresolve_full() has three pre-canned possible errors returned (if we have not yet sent enough arp requests or if we tried often enough without success) otherwise "no error" is returned. Make arprequest() an "internal" function arprequest_internal() which does return a possible error to the caller. Preserve arprequest() as a void wrapper function for external consumers. In arpresolve_full() add an extra error checking. Use the arprequest_internal() function and only return an error if non of the three ones (mentioend above) are already set. This will return possible errors all the way up the stack and allows functions and programs to react on the send errors rather than leaving them in the dark. Also they might get more detailed feedback of why packets cannot be sent and they will receive it quicker. Reviewed by: karels, hselasky Differential Revision: https://reviews.freebsd.org/D18904 Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Feb 24 21:22:16 2019 (r344503) +++ head/sys/netinet/if_ether.c Sun Feb 24 22:49:56 2019 (r344504) @@ -341,8 +341,8 @@ arp_fillheader(struct ifnet *ifp, struct arphdr *ah, i * - arp header target ip address * - arp header source ethernet address */ -void -arprequest(struct ifnet *ifp, const struct in_addr *sip, +static int +arprequest_internal(struct ifnet *ifp, const struct in_addr *sip, const struct in_addr *tip, u_char *enaddr) { struct mbuf *m; @@ -383,14 +383,14 @@ arprequest(struct ifnet *ifp, const struct in_addr *si NET_EPOCH_EXIT(et); if (sip == NULL) { printf("%s: cannot find matching address\n", __func__); - return; + return (EADDRNOTAVAIL); } } if (enaddr == NULL) enaddr = carpaddr ? carpaddr : (u_char *)IF_LLADDR(ifp); if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) - return; + return (ENOMEM); m->m_len = sizeof(*ah) + 2 * sizeof(struct in_addr) + 2 * ifp->if_addrlen; m->m_pkthdr.len = m->m_len; @@ -417,7 +417,7 @@ arprequest(struct ifnet *ifp, const struct in_addr *si if (error != 0 && error != EAFNOSUPPORT) { ARP_LOG(LOG_ERR, "Failed to calculate ARP header on %s: %d\n", if_name(ifp), error); - return; + return (error); } ro.ro_prepend = linkhdr; @@ -426,11 +426,22 @@ arprequest(struct ifnet *ifp, const struct in_addr *si m->m_flags |= M_BCAST; m_clrprotoflags(m); /* Avoid confusing lower layers. */ - (*ifp->if_output)(ifp, m, &sa, &ro); + error = (*ifp->if_output)(ifp, m, &sa, &ro); ARPSTAT_INC(txrequests); + if (error) + ARP_LOG(LOG_DEBUG, "Failed to send ARP packet on %s: %d\n", + if_name(ifp), error); + return (error); } +void +arprequest(struct ifnet *ifp, const struct in_addr *sip, + const struct in_addr *tip, u_char *enaddr) +{ + (void) arprequest_internal(ifp, sip, tip, enaddr); +} + /* * Resolve an IP address into an ethernet address - heavy version. * Used internally by arpresolve(). @@ -557,7 +568,7 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flag error = is_gw != 0 ? EHOSTUNREACH : EHOSTDOWN; if (renew) { - int canceled; + int canceled, e; LLE_ADDREF(la); la->la_expire = time_uptime; @@ -567,7 +578,13 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flag LLE_REMREF(la); la->la_asked++; LLE_WUNLOCK(la); - arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL); + e = arprequest_internal(ifp, NULL, &SIN(dst)->sin_addr, NULL); + /* + * Only overwrite 'error' in case of error; in case of success + * the proper return value was already set above. + */ + if (e != 0) + return (e); return (error); } From owner-svn-src-head@freebsd.org Sun Feb 24 23:08:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A61C1510F06; Sun, 24 Feb 2019 23:08:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEAE78D5F4; Sun, 24 Feb 2019 23:08:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2754C4ED; Sun, 24 Feb 2019 23:08:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1ON8rZp004947; Sun, 24 Feb 2019 23:08:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1ON8rUe004946; Sun, 24 Feb 2019 23:08:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902242308.x1ON8rUe004946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Feb 2019 23:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344505 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EEAE78D5F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 24 Feb 2019 23:08:54 -0000 Author: ian Date: Sun Feb 24 23:08:53 2019 New Revision: 344505 URL: https://svnweb.freebsd.org/changeset/base/344505 Log: Add a functional detach() implementation to make module unloading possible. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Feb 24 22:49:56 2019 (r344504) +++ head/sys/dev/flash/at45d.c Sun Feb 24 23:08:53 2019 (r344505) @@ -65,11 +65,16 @@ struct at45d_softc struct proc *p; struct intr_config_hook config_intrhook; device_t dev; + u_int taskstate; uint16_t pagecount; uint16_t pageoffset; uint16_t pagesize; }; +#define TSTATE_STOPPED 0 +#define TSTATE_STOPPING 1 +#define TSTATE_RUNNING 2 + #define AT45D_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT45D_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define AT45D_LOCK_INIT(_sc) \ @@ -209,8 +214,33 @@ at45d_attach(device_t dev) static int at45d_detach(device_t dev) { + struct at45d_softc *sc; + int err; - return (EBUSY) /* XXX */; + sc = device_get_softc(dev); + err = 0; + + AT45D_LOCK(sc); + if (sc->taskstate == TSTATE_RUNNING) { + sc->taskstate = TSTATE_STOPPING; + wakeup(sc); + while (err == 0 && sc->taskstate != TSTATE_STOPPED) { + err = msleep(sc, &sc->sc_mtx, 0, "at45dt", hz * 3); + if (err != 0) { + sc->taskstate = TSTATE_RUNNING; + device_printf(sc->dev, + "Failed to stop queue task\n"); + } + } + } + AT45D_UNLOCK(sc); + + if (err == 0 && sc->taskstate == TSTATE_STOPPED) { + disk_destroy(sc->disk); + bioq_flush(&sc->bio_queue, NULL, ENXIO); + AT45D_LOCK_DESTROY(sc); + } + return (err); } static void @@ -266,6 +296,7 @@ at45d_delayed_attach(void *xsc) bioq_init(&sc->bio_queue); kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); + sc->taskstate = TSTATE_RUNNING; device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", ident->name, pagesize, ident->pagecount); } @@ -324,6 +355,12 @@ at45d_task(void *arg) for (;;) { AT45D_LOCK(sc); do { + if (sc->taskstate == TSTATE_STOPPING) { + sc->taskstate = TSTATE_STOPPED; + AT45D_UNLOCK(sc); + wakeup(sc); + kproc_exit(0); + } bp = bioq_takefirst(&sc->bio_queue); if (bp == NULL) msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); From owner-svn-src-head@freebsd.org Mon Feb 25 03:29:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B486C151A7A0; Mon, 25 Feb 2019 03:29:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52D5A707B3; Mon, 25 Feb 2019 03:29:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41643F2FD; Mon, 25 Feb 2019 03:29:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1P3TD0Q040944; Mon, 25 Feb 2019 03:29:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1P3TDiF040943; Mon, 25 Feb 2019 03:29:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902250329.x1P3TDiF040943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Feb 2019 03:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344507 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52D5A707B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 03:29:14 -0000 Author: ian Date: Mon Feb 25 03:29:12 2019 New Revision: 344507 URL: https://svnweb.freebsd.org/changeset/base/344507 Log: Switch to using config_intrhook_oneshot(). That allows the error handling in the delayed attach to use early returns, which allows reducing the level of indentation. So all in all, what looks like a lot of changes is really no change in behavior, mostly just moving whitespace around. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sun Feb 24 23:16:33 2019 (r344506) +++ head/sys/dev/flash/at45d.c Mon Feb 25 03:29:12 2019 (r344507) @@ -78,7 +78,6 @@ struct at45d_softc struct mtx sc_mtx; struct disk *disk; struct proc *p; - struct intr_config_hook config_intrhook; device_t dev; u_int taskstate; uint16_t pagecount; @@ -229,13 +228,7 @@ at45d_attach(device_t dev) sc->dev = dev; AT45D_LOCK_INIT(sc); - /* We'll see what kind of flash we have later... */ - sc->config_intrhook.ich_func = at45d_delayed_attach; - sc->config_intrhook.ich_arg = sc; - if (config_intrhook_establish(&sc->config_intrhook) != 0) { - device_printf(dev, "config_intrhook_establish failed\n"); - return (ENOMEM); - } + config_intrhook_oneshot(at45d_delayed_attach, sc); return (0); } @@ -285,51 +278,52 @@ at45d_delayed_attach(void *xsc) ident = NULL; jedec = 0; - if (at45d_wait_ready(sc->dev, &status) != 0) + if (at45d_wait_ready(sc->dev, &status) != 0) { device_printf(sc->dev, "Error waiting for device-ready.\n"); - else if (at45d_get_mfg_info(sc->dev, buf) != 0) + return; + } + if (at45d_get_mfg_info(sc->dev, buf) != 0) { device_printf(sc->dev, "Failed to get ID.\n"); - else { - jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; - for (i = 0; i < nitems(at45d_flash_devices); i++) { - if (at45d_flash_devices[i].jedec == jedec) { - ident = &at45d_flash_devices[i]; - break; - } + return; + } + + jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; + for (i = 0; i < nitems(at45d_flash_devices); i++) { + if (at45d_flash_devices[i].jedec == jedec) { + ident = &at45d_flash_devices[i]; + break; } } - if (ident == NULL) + if (ident == NULL) { device_printf(sc->dev, "JEDEC 0x%x not in list.\n", jedec); - else { - sc->pagecount = ident->pagecount; - sc->pageoffset = ident->pageoffset; - if (ident->pagesize2n != 0 && (status & 0x01) != 0) { - sc->pageoffset -= 1; - pagesize = ident->pagesize2n; - } else - pagesize = ident->pagesize; - sc->pagesize = pagesize; - - sc->disk = disk_alloc(); - sc->disk->d_open = at45d_open; - sc->disk->d_close = at45d_close; - sc->disk->d_strategy = at45d_strategy; - sc->disk->d_name = "flash/spi"; - sc->disk->d_drv1 = sc; - sc->disk->d_maxsize = DFLTPHYS; - sc->disk->d_sectorsize = pagesize; - sc->disk->d_mediasize = pagesize * ident->pagecount; - sc->disk->d_unit = device_get_unit(sc->dev); - disk_create(sc->disk, DISK_VERSION); - bioq_init(&sc->bio_queue); - kproc_create(&at45d_task, sc, &sc->p, 0, 0, - "task: at45d flash"); - sc->taskstate = TSTATE_RUNNING; - device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", - ident->name, pagesize, ident->pagecount); + return; } - config_intrhook_disestablish(&sc->config_intrhook); + sc->pagecount = ident->pagecount; + sc->pageoffset = ident->pageoffset; + if (ident->pagesize2n != 0 && (status & 0x01) != 0) { + sc->pageoffset -= 1; + pagesize = ident->pagesize2n; + } else + pagesize = ident->pagesize; + sc->pagesize = pagesize; + + sc->disk = disk_alloc(); + sc->disk->d_open = at45d_open; + sc->disk->d_close = at45d_close; + sc->disk->d_strategy = at45d_strategy; + sc->disk->d_name = "flash/spi"; + sc->disk->d_drv1 = sc; + sc->disk->d_maxsize = DFLTPHYS; + sc->disk->d_sectorsize = pagesize; + sc->disk->d_mediasize = pagesize * ident->pagecount; + sc->disk->d_unit = device_get_unit(sc->dev); + disk_create(sc->disk, DISK_VERSION); + bioq_init(&sc->bio_queue); + kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); + sc->taskstate = TSTATE_RUNNING; + device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", + ident->name, pagesize, ident->pagecount); } static int From owner-svn-src-head@freebsd.org Mon Feb 25 09:57:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFFFD150413F; Mon, 25 Feb 2019 09:57:08 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1FF84D86; Mon, 25 Feb 2019 09:57:08 +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 5D2361B4BC; Mon, 25 Feb 2019 09:57:07 +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 x1P9v7w1043438; Mon, 25 Feb 2019 09:57:07 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1P9v7x0043437; Mon, 25 Feb 2019 09:57:07 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201902250957.x1P9v7x0043437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 25 Feb 2019 09:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344510 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 344510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F1FF84D86 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 09:57:09 -0000 Author: vmaffione Date: Mon Feb 25 09:57:06 2019 New Revision: 344510 URL: https://svnweb.freebsd.org/changeset/base/344510 Log: netmap: remove redundant call to nm_set_native_flags() This redundant call was introduced by mistake in r343772. MFC after: 3 days Sponsored by: Sunny Valley Networks Modified: head/sys/dev/netmap/if_vtnet_netmap.h Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Mon Feb 25 09:13:33 2019 (r344509) +++ head/sys/dev/netmap/if_vtnet_netmap.h Mon Feb 25 09:57:06 2019 (r344510) @@ -132,7 +132,6 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state) if (state) { netmap_krings_mode_commit(na, state); - nm_set_native_flags(na); } else { nm_clear_native_flags(na); netmap_krings_mode_commit(na, state); From owner-svn-src-head@freebsd.org Mon Feb 25 13:15:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68F29150A70E; Mon, 25 Feb 2019 13:15:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C3998C691; Mon, 25 Feb 2019 13:15:35 +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 F0B4E1D719; Mon, 25 Feb 2019 13:15:34 +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 x1PDFYGC051823; Mon, 25 Feb 2019 13:15:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PDFYBx051822; Mon, 25 Feb 2019 13:15:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902251315.x1PDFYBx051822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Feb 2019 13:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344517 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C3998C691 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 13:15:35 -0000 Author: andrew Date: Mon Feb 25 13:15:34 2019 New Revision: 344517 URL: https://svnweb.freebsd.org/changeset/base/344517 Log: Check the index hasn't changed after writing the cmp entry. If an interrupt fires while writing the cmp entry we may have a partial entry. Work around this by using atomic_cmpset to set the new index. If it fails we need to set the previous index value and try again as the entry may be in an inconsistent state. This fixes messages similar to the following from syzkaller: bad comp 224 type 2163727253 Reviewed by: tuexen Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19287 Modified: head/sys/kern/kern_kcov.c Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Mon Feb 25 12:35:52 2019 (r344516) +++ head/sys/kern/kern_kcov.c Mon Feb 25 13:15:34 2019 (r344517) @@ -247,11 +247,16 @@ trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2, if (index * 4 + 4 + 1 > info->entries) return (false); - buf[index * 4 + 1] = type; - buf[index * 4 + 2] = arg1; - buf[index * 4 + 3] = arg2; - buf[index * 4 + 4] = ret; - buf[0] = index + 1; + while (1) { + buf[index * 4 + 1] = type; + buf[index * 4 + 2] = arg1; + buf[index * 4 + 3] = arg2; + buf[index * 4 + 4] = ret; + + if (atomic_cmpset_64(&buf[0], index, index + 1)) + break; + buf[0] = index; + } return (true); } From owner-svn-src-head@freebsd.org Mon Feb 25 15:03:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D0A6150CD03; Mon, 25 Feb 2019 15:03:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC69969DE6; Mon, 25 Feb 2019 15:03:53 +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 EC8211E9D9; Mon, 25 Feb 2019 15:03:50 +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 x1PF3ogU011410; Mon, 25 Feb 2019 15:03:50 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PF3otL011409; Mon, 25 Feb 2019 15:03:50 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201902251503.x1PF3otL011409@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: Mon, 25 Feb 2019 15:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344518 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 344518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC69969DE6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 15:03:54 -0000 Author: 0mp (ports committer) Date: Mon Feb 25 15:03:50 2019 New Revision: 344518 URL: https://svnweb.freebsd.org/changeset/base/344518 Log: Add missing types to the sysctl(9) manual page Update the diff to include other missing sysctl types found in sysctl.h. Some of these sysctls are already documented in other pages (e.g counter(9) and ZONE(9)), but they should at least be mentioned here for completeness. This patch now documents all of the following: - SYSCTL_BOOL/SYSCTL_ADD_BOOL - SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64 - SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY - SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC - SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC - SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR - SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX Submitted by: mhorne063_gmail.com Reviewed by: bcr, hselasky Approved by: bcr (doc), hselasky (src) Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D19272 Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Mon Feb 25 13:15:34 2019 (r344517) +++ head/share/man/man9/sysctl.9 Mon Feb 25 15:03:50 2019 (r344518) @@ -25,11 +25,14 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2018 +.Dd February 25, 2019 .Dt SYSCTL 9 .Os .Sh NAME .Nm SYSCTL_DECL , +.Nm SYSCTL_ADD_BOOL , +.Nm SYSCTL_ADD_COUNTER_U64 , +.Nm SYSCTL_ADD_COUNTER_U64_ARRAY , .Nm SYSCTL_ADD_INT , .Nm SYSCTL_ADD_LONG , .Nm SYSCTL_ADD_NODE , @@ -42,6 +45,8 @@ .Nm SYSCTL_ADD_S16 , .Nm SYSCTL_ADD_S32 , .Nm SYSCTL_ADD_S64 , +.Nm SYSCTL_ADD_SBINTIME_MSEC , +.Nm SYSCTL_ADD_SBINTIME_USEC , .Nm SYSCTL_ADD_STRING , .Nm SYSCTL_ADD_STRUCT , .Nm SYSCTL_ADD_U8 , @@ -52,10 +57,15 @@ .Nm SYSCTL_ADD_UINT , .Nm SYSCTL_ADD_ULONG , .Nm SYSCTL_ADD_UQUAD , +.Nm SYSCTL_ADD_UMA_CUR , +.Nm SYSCTL_ADD_UMA_MAX , .Nm SYSCTL_CHILDREN , .Nm SYSCTL_STATIC_CHILDREN , .Nm SYSCTL_NODE_CHILDREN , .Nm SYSCTL_PARENT , +.Nm SYSCTL_BOOL , +.Nm SYSCTL_COUNTER_U64 , +.Nm SYSCTL_COUNTER_U64_ARRAY , .Nm SYSCTL_INT , .Nm SYSCTL_INT_WITH_LABEL , .Nm SYSCTL_LONG , @@ -69,6 +79,8 @@ .Nm SYSCTL_S16 , .Nm SYSCTL_S32 , .Nm SYSCTL_S64 , +.Nm SYSCTL_SBINTIME_MSEC , +.Nm SYSCTL_SBINTIME_USEC , .Nm SYSCTL_STRING , .Nm SYSCTL_STRUCT , .Nm SYSCTL_U8 , @@ -77,13 +89,47 @@ .Nm SYSCTL_U64 , .Nm SYSCTL_UINT , .Nm SYSCTL_ULONG , -.Nm SYSCTL_UQUAD +.Nm SYSCTL_UQUAD , +.Nm SYSCTL_UMA_CUR , +.Nm SYSCTL_UMA_MAX .Nd Dynamic and static sysctl MIB creation functions .Sh SYNOPSIS .In sys/param.h .In sys/sysctl.h .Fn SYSCTL_DECL name .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_BOOL +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "bool *ptr" +.Fa "uint8_t val" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * +.Fo SYSCTL_ADD_COUNTER_U64 +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "counter_u64_t *ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * +.Fo SYSCTL_ADD_COUNTER_U64_ARRAY +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "counter_u64_t *ptr" +.Fa "intmax_t len" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_INT .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -214,6 +260,26 @@ .Fa "const char *descr" .Fc .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_SBINTIME_MSEC +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "sbintime_t *ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * +.Fo SYSCTL_ADD_SBINTIME_USEC +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "sbintime_t *ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_STRING .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -311,6 +377,27 @@ .Fa "const char *descr" .Fc .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_UMA_CUR +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "uma_zone_t ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * +.Fo SYSCTL_ADD_UMA_MAX +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "uma_zone_t ptr" +.Fa "const char *descr" +.Fc +.Fa "const char *descr" +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_UAUTO .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -337,6 +424,9 @@ .Fo SYSCTL_PARENT .Fa "struct sysctl_oid *oid" .Fc +.Fn SYSCTL_BOOL parent number name ctlflags ptr val descr +.Fn SYSCTL_COUNTER_U64 parent number name ctlflags ptr descr +.Fn SYSCTL_COUNTER_U64_ARRAY parent number name ctlflags ptr len descr .Fn SYSCTL_INT parent number name ctlflags ptr val descr .Fn SYSCTL_INT_WITH_LABEL parent number name ctlflags ptr val descr label .Fn SYSCTL_LONG parent number name ctlflags ptr val descr @@ -350,6 +440,8 @@ .Fn SYSCTL_S16 parent number name ctlflags ptr val descr .Fn SYSCTL_S32 parent number name ctlflags ptr val descr .Fn SYSCTL_S64 parent number name ctlflags ptr val descr +.Fn SYSCTL_SBINTIME_MSEC parent number name ctlflags ptr descr +.Fn SYSCTL_SBINTIME_USEC parent number name ctlflags ptr descr .Fn SYSCTL_STRING parent number name ctlflags arg len descr .Fn SYSCTL_STRUCT parent number name ctlflags ptr struct_type descr .Fn SYSCTL_U8 parent number name ctlflags ptr val descr @@ -359,6 +451,8 @@ .Fn SYSCTL_UINT parent number name ctlflags ptr val descr .Fn SYSCTL_ULONG parent number name ctlflags ptr val descr .Fn SYSCTL_UQUAD parent number name ctlflags ptr val descr +.Fn SYSCTL_UMA_MAX parent number name ctlflags ptr descr +.Fn SYSCTL_UMA_CUR parent number name ctlflags ptr descr .Sh DESCRIPTION The .Nm SYSCTL @@ -416,6 +510,7 @@ argument. For string type OIDs a length of zero means that .Xr strlen 3 will be used to get the length of the string at each access to the OID. +For array type OIDs the length must be greater than zero. .It Fa ptr Pointer to sysctl variable or string data. For sysctl values the pointer can be SYSCTL_NULL_XXX_PTR which means the OID is read-only and the returned value should be taken from the @@ -544,6 +639,9 @@ This OID type is especially useful if the kernel data accessible, or needs to be processed before exporting. .Sh CREATING A STATIC SYSCTL Static sysctls are declared using one of the +.Fn SYSCTL_BOOL , +.Fn SYSCTL_COUNTER_U64 , +.Fn SYSCTL_COUNTER_U64_ARRAY , .Fn SYSCTL_INT , .Fn SYSCTL_INT_WITH_LABEL , .Fn SYSCTL_LONG , @@ -557,6 +655,8 @@ Static sysctls are declared using one of the .Fn SYSCTL_S16 , .Fn SYSCTL_S32 , .Fn SYSCTL_S64 , +.Fn SYSCTL_SBINTIME_MSEC , +.Fn SYSCTL_SBINTIME_USEC , .Fn SYSCTL_STRING , .Fn SYSCTL_STRUCT , .Fn SYSCTL_U8 , @@ -564,12 +664,17 @@ Static sysctls are declared using one of the .Fn SYSCTL_U32 , .Fn SYSCTL_U64 , .Fn SYSCTL_UINT , -.Fn SYSCTL_ULONG +.Fn SYSCTL_ULONG , +.Fn SYSCTL_UQUAD , +.Fn SYSCTL_UMA_CUR or -.Fn SYSCTL_UQUAD +.Fn SYSCTL_UMA_MAX macros. .Sh CREATING A DYNAMIC SYSCTL Dynamic nodes are created using one of the +.Fn SYSCTL_ADD_BOOL , +.Fn SYSCTL_ADD_COUNTER_U64 , +.Fn SYSCTL_ADD_COUNTER_U64_ARRAY , .Fn SYSCTL_ADD_INT , .Fn SYSCTL_ADD_LONG , .Fn SYSCTL_ADD_NODE , @@ -582,6 +687,8 @@ Dynamic nodes are created using one of the .Fn SYSCTL_ADD_S16 , .Fn SYSCTL_ADD_S32 , .Fn SYSCTL_ADD_S64 , +.Fn SYSCTL_ADD_SBINTIME_MSEC , +.Fn SYSCTL_ADD_SBINTIME_USEC , .Fn SYSCTL_ADD_STRING , .Fn SYSCTL_ADD_STRUCT , .Fn SYSCTL_ADD_U8 , @@ -591,8 +698,10 @@ Dynamic nodes are created using one of the .Fn SYSCTL_ADD_UAUTO , .Fn SYSCTL_ADD_UINT , .Fn SYSCTL_ADD_ULONG , +.Fn SYSCTL_ADD_UQUAD , +.Fn SYSCTL_ADD_UMA_CUR or -.Fn SYSCTL_UQUAD +.Fn SYSCTL_ADD_UMA_MAX functions. See .Xr sysctl_remove_oid 9 From owner-svn-src-head@freebsd.org Mon Feb 25 15:12:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A1D150D0D4; Mon, 25 Feb 2019 15:12:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 915FE6A491; Mon, 25 Feb 2019 15:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x531.google.com with SMTP id l11so4609928pgq.10; Mon, 25 Feb 2019 07:12:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=doMXmR4A5cks1QLONFf+cMOkPs26pCx0nI8svub5muE=; b=Jx3QD4OVkDcrfm9vk6oLMQ7UdWBhpOY94952t4K7lyXmAWICyZ8r2wo6AIIMtbmKVX 70yM9s24uDwMR/lp+Z+14k0/gKH+6jypVdzHxaRQTAxKwzZ/eW9Jss/vowBlQ7Do/BTc a22Ahxshz3w9U9FfF5zFgWZRkzfmjQ5HXvzTCaCE0LiaNVB9kKMWRSZKoj66jPpaE+BL Eq0Gu8o8o3zoqRiOd4/jjyf86SL98wkHoJFeiXRDBm1+zk41RmnBkB3saxvfdbULdnOx Z2HX/+0QZ+NVEc3xgu/L6zD8XmaC+BBHrk7CbP5qUuva7sDNrTOcS4RC6RLGlhQY8Crk F3Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=doMXmR4A5cks1QLONFf+cMOkPs26pCx0nI8svub5muE=; b=rN5Zj+oIwg6HTGcSgQTq5VFsXMxazOxJAL6sbC55GfdQt6xYFZY2nbun1ApxD3T2bD 9CRArzrVXxrkO7f4x8OHHRJpiC7CWqAV6Yvq4oVnORZ4aRSCeNeHCTxbHUj9zi5ahHPV 9As6XbzLR6qsgm1v/0FWQZvJZym95bd3ClEe5d5Ylw7u5rccNHFXXJ9ik78RDJBmyEW6 Lj2S+G1p2A/Nd30fIr8nP5FrpfE77D2oHCpJOdjuExaI3HlsLnzhD9sJfnZ/WjRLzdhJ WL8zy3EdWG5UGxusOCR+aM7fVvHGaT1wfxK2jki3NB5P69mHEhUKxdD9SiCCBB39Nd9R ADJQ== X-Gm-Message-State: AHQUAuaW2/M6R3gGtjTb2Clb94LoVAcN5V5iERBPlbQXzXesuUodDYfk u8KWnSSCsrD+u7BPfpwUXtO8c7tL X-Google-Smtp-Source: AHgI3IaZcFTpnT3lu8ZNwn4hR9tNH2qSKZH9JyR+e5fNhqQfUrP4vSYBzkS6CyzO5SYj0P8krP+3Bg== X-Received: by 2002:a63:2c7:: with SMTP id 190mr18555758pgc.367.1551107536800; Mon, 25 Feb 2019 07:12:16 -0800 (PST) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id j14sm8164829pfn.77.2019.02.25.07.12.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 07:12:16 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344518 - head/share/man/man9 From: Enji Cooper X-Mailer: iPhone Mail (16D57) In-Reply-To: <201902251503.x1PF3otL011409@repo.freebsd.org> Date: Mon, 25 Feb 2019 07:12:15 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9F0A25DA-E0D2-4F96-91AF-4648367E3E5F@gmail.com> References: <201902251503.x1PF3otL011409@repo.freebsd.org> To: Mateusz Piotrowski <0mp@freebsd.org> X-Rspamd-Queue-Id: 915FE6A491 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 15:12:19 -0000 > On Feb 25, 2019, at 07:03, Mateusz Piotrowski <0mp@freebsd.org> wrote: >=20 > Author: 0mp (ports committer) > Date: Mon Feb 25 15:03:50 2019 > New Revision: 344518 > URL: https://svnweb.freebsd.org/changeset/base/344518 >=20 > Log: > Add missing types to the sysctl(9) manual page >=20 > Update the diff to include other missing sysctl types found in sysctl.h. >=20 > Some of these sysctls are already documented in other pages (e.g counter(= 9) > and ZONE(9)), but they should at least be mentioned here for completeness= . >=20 > This patch now documents all of the following: > - SYSCTL_BOOL/SYSCTL_ADD_BOOL > - SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64 > - SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY > - SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC > - SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC > - SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR > - SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX >=20 > Submitted by: mhorne063_gmail.com > Reviewed by: bcr, hselasky > Approved by: bcr (doc), hselasky (src) > Approved by: krion (mentor, implicit), mat (mentor, implicit) > Differential Revision: https://reviews.freebsd.org/D19272 >=20 > Modified: > head/share/man/man9/sysctl.9 ... > @@ -52,10 +57,15 @@ > .Nm SYSCTL_ADD_UINT , > .Nm SYSCTL_ADD_ULONG , > .Nm SYSCTL_ADD_UQUAD , > +.Nm SYSCTL_ADD_UMA_CUR , > +.Nm SYSCTL_ADD_UMA_MAX , Same as my comment below. > .Nm SYSCTL_CHILDREN , > .Nm SYSCTL_STATIC_CHILDREN , > .Nm SYSCTL_NODE_CHILDREN , > .Nm SYSCTL_PARENT , > +.Nm SYSCTL_BOOL , > +.Nm SYSCTL_COUNTER_U64 , > +.Nm SYSCTL_COUNTER_U64_ARRAY , > .Nm SYSCTL_INT , > .Nm SYSCTL_INT_WITH_LABEL , > .Nm SYSCTL_LONG , > @@ -69,6 +79,8 @@ > .Nm SYSCTL_S16 , > .Nm SYSCTL_S32 , > .Nm SYSCTL_S64 , > +.Nm SYSCTL_SBINTIME_MSEC , > +.Nm SYSCTL_SBINTIME_USEC , > .Nm SYSCTL_STRING , > .Nm SYSCTL_STRUCT , > .Nm SYSCTL_U8 , > @@ -77,13 +89,47 @@ > .Nm SYSCTL_U64 , > .Nm SYSCTL_UINT , > .Nm SYSCTL_ULONG , > -.Nm SYSCTL_UQUAD > +.Nm SYSCTL_UQUAD , > +.Nm SYSCTL_UMA_CUR , > +.Nm SYSCTL_UMA_MAX Quick nit: UMA sorts before UQUAD. Also, these APIs deserve manpage links via MLINKS. Cheers! -Enji= From owner-svn-src-head@freebsd.org Mon Feb 25 15:47:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F47150DFAF; Mon, 25 Feb 2019 15:47:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCBFC6BC86; Mon, 25 Feb 2019 15:47:22 +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 7B9471F0DB; Mon, 25 Feb 2019 15:47:22 +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 x1PFlMK1033659; Mon, 25 Feb 2019 15:47:22 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PFlMS1033658; Mon, 25 Feb 2019 15:47:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201902251547.x1PFlMS1033658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 25 Feb 2019 15:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344519 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 344519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BCBFC6BC86 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 15:47:23 -0000 Author: np Date: Mon Feb 25 15:47:22 2019 New Revision: 344519 URL: https://svnweb.freebsd.org/changeset/base/344519 Log: cxgbe(4): Use correct port_info in the call to is_bt(). This fixes a panic during configuration if the tx channel of a port isn't the same as its port id. Reported by: Fabrice Bruel MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Feb 25 15:03:50 2019 (r344518) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Feb 25 15:47:22 2019 (r344519) @@ -3894,7 +3894,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m speed = fwcap_top_speed(lc->supported); /* Force AN on for BT cards. */ - if (is_bt(adap->port[port])) + if (is_bt(adap->port[adap->chan_map[port]])) aneg = lc->supported & FW_PORT_CAP32_ANEG; rcap = aneg | speed | fc | fec; From owner-svn-src-head@freebsd.org Mon Feb 25 16:20:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2235B150EB22; Mon, 25 Feb 2019 16:20:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA6766D26B; Mon, 25 Feb 2019 16:20:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB9311F64D; Mon, 25 Feb 2019 16:20:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PGKwLY049711; Mon, 25 Feb 2019 16:20:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PGKwnP049710; Mon, 25 Feb 2019 16:20:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902251620.x1PGKwnP049710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Feb 2019 16:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344523 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA6766D26B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 16:20:59 -0000 Author: ian Date: Mon Feb 25 16:20:58 2019 New Revision: 344523 URL: https://svnweb.freebsd.org/changeset/base/344523 Log: Include the jedec "extended device information string" in the criteria used to match a chip to our table of metadata describing the chips. At least one new DataFlash chip has a 3-byte jedec ID identical to its predecessors and differs only in the extended info, and it has different metadata requiring a unique entry in the table. This paves the way for supporting such chips. The metadata table now includes two new fields, extmask and extid. The two bytes of extended info obtained from the chip are ANDed with extmask then compared to extid, so it's possible to use only a subset of the extended info in the matching. We now always read 6 bytes of jedec ID info. Most chips don't return any extended info, and the values read back for those two bytes may be indeterminate, but such chips have extmask and extid values of 0x0000 in the table, so the extid effectively doesn't participate in the matching on those chips and it doesn't matter what they return in the extended info bytes. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Mon Feb 25 15:51:31 2019 (r344522) +++ head/sys/dev/flash/at45d.c Mon Feb 25 16:20:58 2019 (r344523) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,10 +63,22 @@ static struct ofw_compat_data compat_data[] = { SPIBUS_PNP_INFO(compat_data); #endif +/* This is the information returned by the MANUFACTURER_ID command. */ +struct at45d_mfg_info { + uint32_t jedec_id; /* Mfg ID, DevId1, DevId2, ExtLen */ + uint16_t ext_id; /* ExtId1, ExtId2 */ +}; + +/* + * This is an entry in our table of metadata describing the chips. We match on + * both jedec id and extended id info returned by the MANUFACTURER_ID command. + */ struct at45d_flash_ident { const char *name; uint32_t jedec; + uint16_t extid; + uint16_t extmask; uint16_t pagecount; uint16_t pageoffset; uint16_t pagesize; @@ -111,7 +124,7 @@ static void at45d_task(void *arg); /* helper routines */ static void at45d_delayed_attach(void *xsc); -static int at45d_get_mfg_info(device_t dev, uint8_t *resp); +static int at45d_get_mfg_info(device_t dev, struct at45d_mfg_info *resp); static int at45d_get_status(device_t dev, uint8_t *status); static int at45d_wait_ready(device_t dev, uint8_t *status); @@ -123,19 +136,28 @@ static int at45d_wait_ready(device_t dev, uint8_t *sta #define CONTINUOUS_ARRAY_READ 0xe8 /* + * Metadata for supported chips. + * + * The jedec id in this table includes the extended id length byte. A match is + * based on both jedec id and extended id matching. The chip's extended id (not + * present in most chips) is ANDed with ExtMask and the result is compared to + * ExtId. If a chip only returns 1 ext id byte it will be in the upper 8 bits + * of ExtId in this table. + * * A sectorsize2n != 0 is used to indicate that a device optionally supports * 2^N byte pages. If support for the latter is enabled, the sector offset * has to be reduced by one. */ static const struct at45d_flash_ident at45d_flash_devices[] = { - { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, - { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, - { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, - { "AT45DB081B", 0x1f2500, 4096, 9, 264, 256 }, - { "AT45DB161x", 0x1f2600, 4096, 10, 528, 512 }, - { "AT45DB321x", 0x1f2700, 8192, 10, 528, 0 }, - { "AT45DB321x", 0x1f2701, 8192, 10, 528, 512 }, - { "AT45DB642x", 0x1f2800, 8192, 11, 1056, 1024 } + /* Part Name Jedec ID ExtId ExtMask PgCnt Offs PgSz PgSz2n */ + { "AT45DB011B", 0x1f220000, 0x0000, 0x0000, 512, 9, 264, 256 }, + { "AT45DB021B", 0x1f230000, 0x0000, 0x0000, 1024, 9, 264, 256 }, + { "AT45DB041x", 0x1f240000, 0x0000, 0x0000, 2028, 9, 264, 256 }, + { "AT45DB081B", 0x1f250000, 0x0000, 0x0000, 4096, 9, 264, 256 }, + { "AT45DB161x", 0x1f260000, 0x0000, 0x0000, 4096, 10, 528, 512 }, + { "AT45DB321x", 0x1f270000, 0x0000, 0x0000, 8192, 10, 528, 0 }, + { "AT45DB321x", 0x1f270100, 0x0000, 0x0000, 8192, 10, 528, 512 }, + { "AT45DB642x", 0x1f280000, 0x0000, 0x0000, 8192, 11, 1056, 1024 }, }; static int @@ -159,7 +181,7 @@ at45d_get_status(device_t dev, uint8_t *status) } static int -at45d_get_mfg_info(device_t dev, uint8_t *resp) +at45d_get_mfg_info(device_t dev, struct at45d_mfg_info *resp) { uint8_t rxBuf[8], txBuf[8]; struct spi_command cmd; @@ -172,11 +194,14 @@ at45d_get_mfg_info(device_t dev, uint8_t *resp) txBuf[0] = MANUFACTURER_ID; cmd.tx_cmd = &txBuf; cmd.rx_cmd = &rxBuf; - cmd.tx_cmd_sz = cmd.rx_cmd_sz = 5; + cmd.tx_cmd_sz = cmd.rx_cmd_sz = 7; err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); if (err) return (err); - memcpy(resp, rxBuf + 1, 4); + + resp->jedec_id = be32dec(rxBuf + 1); + resp->ext_id = be16dec(rxBuf + 5); + return (0); } @@ -268,11 +293,12 @@ static void at45d_delayed_attach(void *xsc) { struct at45d_softc *sc; + struct at45d_mfg_info mfginfo; const struct at45d_flash_ident *ident; u_int i; uint32_t jedec; uint16_t pagesize; - uint8_t buf[4], status; + uint8_t status; sc = xsc; ident = NULL; @@ -282,19 +308,18 @@ at45d_delayed_attach(void *xsc) device_printf(sc->dev, "Error waiting for device-ready.\n"); return; } - if (at45d_get_mfg_info(sc->dev, buf) != 0) { + if (at45d_get_mfg_info(sc->dev, &mfginfo) != 0) { device_printf(sc->dev, "Failed to get ID.\n"); return; } - - jedec = buf[0] << 16 | buf[1] << 8 | buf[2]; for (i = 0; i < nitems(at45d_flash_devices); i++) { - if (at45d_flash_devices[i].jedec == jedec) { - ident = &at45d_flash_devices[i]; + ident = &at45d_flash_devices[i]; + if (mfginfo.jedec_id == ident->jedec && + (mfginfo.ext_id & ident->extmask) == ident->extid) { break; } } - if (ident == NULL) { + if (i == nitems(at45d_flash_devices)) { device_printf(sc->dev, "JEDEC 0x%x not in list.\n", jedec); return; } @@ -322,8 +347,9 @@ at45d_delayed_attach(void *xsc) bioq_init(&sc->bio_queue); kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); sc->taskstate = TSTATE_RUNNING; - device_printf(sc->dev, "%s, %d bytes per page, %d pages\n", - ident->name, pagesize, ident->pagecount); + device_printf(sc->dev, "%s, %d bytes per page, %d pages; %d KBytes\n", + ident->name, pagesize, ident->pagecount, + (pagesize * ident->pagecount) / 1024); } static int From owner-svn-src-head@freebsd.org Mon Feb 25 16:28:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACD22150ED8E; Mon, 25 Feb 2019 16:28:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCE56D7E4; Mon, 25 Feb 2019 16:28:15 +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 388561F800; Mon, 25 Feb 2019 16:28:15 +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 x1PGSF8X055319; Mon, 25 Feb 2019 16:28:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PGSEZu055314; Mon, 25 Feb 2019 16:28:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <201902251628.x1PGSEZu055314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 25 Feb 2019 16:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344524 - head/sys/dev/cxgbe/firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/firmware X-SVN-Commit-Revision: 344524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BCE56D7E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 16:28:16 -0000 Author: np Date: Mon Feb 25 16:28:13 2019 New Revision: 344524 URL: https://svnweb.freebsd.org/changeset/base/344524 Log: cxgbe(4): Updates to the default and hashfilter configurations. - Do not use nvf = 4 as it is not really supported by the firmware. Firmwares 1.23.3.0 and above will ignore it silently. - Increase PF4's share of the VIs and let it use all of the RSS table. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt head/sys/dev/cxgbe/firmware/t6fw_cfg.txt head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Mon Feb 25 16:20:58 2019 (r344523) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Mon Feb 25 16:28:13 2019 (r344524) @@ -46,54 +46,50 @@ # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by # these 4 PFs only. [function "0"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x1 [function "1"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x2 [function "2"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x4 [function "3"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x8 @@ -103,7 +99,7 @@ wx_caps = all r_caps = all nvi = 32 - rssnvi = 8 + rssnvi = 16 niqflint = 512 nethctrl = 1024 neq = 2048 @@ -166,7 +162,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -178,7 +174,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -190,7 +186,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -202,7 +198,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -246,7 +242,7 @@ [fini] version = 0x1 - checksum = 0x159b9295 + checksum = 0x3ecbe8a0 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Feb 25 16:20:58 2019 (r344523) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Feb 25 16:28:13 2019 (r344524) @@ -90,54 +90,50 @@ # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by # these 4 PFs only. [function "0"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x1 [function "1"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x2 [function "2"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x4 [function "3"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x8 @@ -147,7 +143,7 @@ wx_caps = all r_caps = all nvi = 32 - rssnvi = 8 + rssnvi = 16 niqflint = 512 nethctrl = 1024 neq = 2048 @@ -211,7 +207,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -223,7 +219,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -235,7 +231,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -247,7 +243,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -291,7 +287,7 @@ [fini] version = 0x1 - checksum = 0x30b6a157 + checksum = 0x34da8705 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt Mon Feb 25 16:20:58 2019 (r344523) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt Mon Feb 25 16:28:13 2019 (r344524) @@ -99,54 +99,50 @@ # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by # these 4 PFs only. [function "0"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x1 [function "1"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x2 [function "2"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x4 [function "3"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x8 @@ -156,7 +152,7 @@ wx_caps = all r_caps = all nvi = 32 - rssnvi = 8 + rssnvi = 16 niqflint = 512 nethctrl = 1024 neq = 2048 @@ -214,7 +210,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -226,7 +222,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -238,7 +234,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -250,7 +246,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -294,7 +290,7 @@ [fini] version = 0x1 - checksum = 0x380a0a4 + checksum = 0x7a962d44 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Mon Feb 25 16:20:58 2019 (r344523) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Mon Feb 25 16:28:13 2019 (r344524) @@ -88,54 +88,50 @@ # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by # these 4 PFs only. [function "0"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x1 [function "1"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x2 [function "2"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x4 [function "3"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x8 @@ -145,7 +141,7 @@ wx_caps = all r_caps = all nvi = 32 - rssnvi = 8 + rssnvi = 32 niqflint = 512 nethctrl = 1024 neq = 2048 @@ -212,7 +208,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -224,7 +220,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -236,7 +232,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -248,7 +244,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -276,7 +272,7 @@ [fini] version = 0x1 - checksum = 0xf3e93001 + checksum = 0x4528a6ac # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt Mon Feb 25 16:20:58 2019 (r344523) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt Mon Feb 25 16:28:13 2019 (r344524) @@ -81,54 +81,50 @@ # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by # these 4 PFs only. [function "0"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x1 [function "1"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x2 [function "2"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x4 [function "3"] - nvf = 4 wx_caps = all r_caps = all - nvi = 2 - rssnvi = 2 - niqflint = 4 - nethctrl = 4 - neq = 8 - nexactf = 4 + nvi = 1 + rssnvi = 0 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 cmask = all pmask = 0x8 @@ -138,7 +134,7 @@ wx_caps = all r_caps = all nvi = 32 - rssnvi = 8 + rssnvi = 32 niqflint = 512 nethctrl = 1024 neq = 2048 @@ -195,7 +191,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -207,7 +203,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -219,7 +215,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -231,7 +227,7 @@ wx_caps = 0x82 r_caps = 0x86 nvi = 1 - rssnvi = 1 + rssnvi = 0 niqflint = 2 nethctrl = 2 neq = 4 @@ -259,7 +255,7 @@ [fini] version = 0x1 - checksum = 0xb577311e + checksum = 0x5e0e0eb7 # # $FreeBSD$ # From owner-svn-src-head@freebsd.org Mon Feb 25 16:40:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE1F150F037; Mon, 25 Feb 2019 16:40:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32FB06DD78; Mon, 25 Feb 2019 16:40:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 248651F9AF; Mon, 25 Feb 2019 16:40:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PGeBdv060458; Mon, 25 Feb 2019 16:40:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PGeBPU060457; Mon, 25 Feb 2019 16:40:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902251640.x1PGeBPU060457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Feb 2019 16:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344525 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32FB06DD78 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 16:40:11 -0000 Author: ian Date: Mon Feb 25 16:40:10 2019 New Revision: 344525 URL: https://svnweb.freebsd.org/changeset/base/344525 Log: Add a metadata entry for the AT45DB641E chip. This chip has the same 3-byte jedec ID as its older cousin the AT45DB642D, but uses a different page size. The only way to distinguish between the two chips is that the 2D chip has 0 bytes of extended ID info and the new 1E has 1 byte of extended ID. The actual value of the extended ID byte is all zeroes. In other words, it's the presence of the extended info that identifies this chip. (Presumably a future upgrade might define non-zero values for the extended ID byte.) Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Mon Feb 25 16:28:13 2019 (r344524) +++ head/sys/dev/flash/at45d.c Mon Feb 25 16:40:10 2019 (r344525) @@ -157,6 +157,7 @@ static const struct at45d_flash_ident at45d_flash_devi { "AT45DB161x", 0x1f260000, 0x0000, 0x0000, 4096, 10, 528, 512 }, { "AT45DB321x", 0x1f270000, 0x0000, 0x0000, 8192, 10, 528, 0 }, { "AT45DB321x", 0x1f270100, 0x0000, 0x0000, 8192, 10, 528, 512 }, + { "AT45DB641E", 0x1f280001, 0x0000, 0xff00, 32768, 9, 264, 256 }, { "AT45DB642x", 0x1f280000, 0x0000, 0x0000, 8192, 11, 1056, 1024 }, }; From owner-svn-src-head@freebsd.org Mon Feb 25 17:30:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3B31510202; Mon, 25 Feb 2019 17:30:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20DF36F990; Mon, 25 Feb 2019 17:30:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 119EF20238; Mon, 25 Feb 2019 17:30:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PHU1Oi087320; Mon, 25 Feb 2019 17:30:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PHU1a2087318; Mon, 25 Feb 2019 17:30:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902251730.x1PHU1a2087318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Feb 2019 17:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344526 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20DF36F990 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 17:30:02 -0000 Author: ian Date: Mon Feb 25 17:30:01 2019 New Revision: 344526 URL: https://svnweb.freebsd.org/changeset/base/344526 Log: Resolve a name conflict when both SpiFlash and DataFlash devices are present. Both SpiFlash (mx25l) and DataFlash (at45d) drivers create a disk device with a name of /dev/flash/spiN where N is the driver's unit number. If both types of devices are present in the same system, this creates a fatal conflict that prevents attachment of whichever device attaches second (because mx25l0 and at45d0 both try to create a spi0). This gives each type of device a unique name (mx25lN or at45dN respectively) and also adds an alias of spiN for compatibility. When both device types appear in the same system, only the first to attach gets the spiN alias. When the second device attaches there is a non-fatal warning that the alias can't be created, but both devices are still accessible via their primary names (and there is no need for the spiN name to work for backwards compatibility on such a system, because it has never been possible to use the spiN names when both devices exist). Modified: head/sys/dev/flash/at45d.c head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Mon Feb 25 16:40:10 2019 (r344525) +++ head/sys/dev/flash/at45d.c Mon Feb 25 17:30:01 2019 (r344526) @@ -338,13 +338,14 @@ at45d_delayed_attach(void *xsc) sc->disk->d_open = at45d_open; sc->disk->d_close = at45d_close; sc->disk->d_strategy = at45d_strategy; - sc->disk->d_name = "flash/spi"; + sc->disk->d_name = "flash/at45d"; sc->disk->d_drv1 = sc; sc->disk->d_maxsize = DFLTPHYS; sc->disk->d_sectorsize = pagesize; sc->disk->d_mediasize = pagesize * ident->pagecount; sc->disk->d_unit = device_get_unit(sc->dev); disk_create(sc->disk, DISK_VERSION); + disk_add_alias(sc->sc_disk, "flash/spi"); bioq_init(&sc->bio_queue); kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); sc->taskstate = TSTATE_RUNNING; Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Mon Feb 25 16:40:10 2019 (r344525) +++ head/sys/dev/flash/mx25l.c Mon Feb 25 17:30:01 2019 (r344526) @@ -510,7 +510,7 @@ mx25l_attach(device_t dev) sc->sc_disk->d_strategy = mx25l_strategy; sc->sc_disk->d_getattr = mx25l_getattr; sc->sc_disk->d_ioctl = mx25l_ioctl; - sc->sc_disk->d_name = "flash/spi"; + sc->sc_disk->d_name = "flash/mx25l"; sc->sc_disk->d_drv1 = sc; sc->sc_disk->d_maxsize = DFLTPHYS; sc->sc_disk->d_sectorsize = MX25L_SECTORSIZE; @@ -522,6 +522,7 @@ mx25l_attach(device_t dev) sizeof(sc->sc_disk->d_descr)); disk_create(sc->sc_disk, DISK_VERSION); + disk_add_alias(sc->sc_disk, "flash/spi"); bioq_init(&sc->sc_bio_queue); kproc_create(&mx25l_task, sc, &sc->sc_p, 0, 0, "task: mx25l flash"); From owner-svn-src-head@freebsd.org Mon Feb 25 17:40:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76C2915104FA; Mon, 25 Feb 2019 17:40:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 189B36FEC2; Mon, 25 Feb 2019 17:40:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFADE203F5; Mon, 25 Feb 2019 17:40:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PHe0Zn092645; Mon, 25 Feb 2019 17:40:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PHe0Id092644; Mon, 25 Feb 2019 17:40:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902251740.x1PHe0Id092644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 25 Feb 2019 17:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344527 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 189B36FEC2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 17:40:01 -0000 Author: manu Date: Mon Feb 25 17:40:00 2019 New Revision: 344527 URL: https://svnweb.freebsd.org/changeset/base/344527 Log: arm64: rockchip: clk: Set the write mask when setting the clock mux RockChip clocks have a write mask in the upper 16bits of the mux register which wasn't set in the set_mux function. Also the wrong parent was tested instead of the real current one, when switch parent, test with the current one before. Pointy Hat: manu MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.c Mon Feb 25 17:30:01 2019 (r344526) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Mon Feb 25 17:40:00 2019 (r344527) @@ -128,7 +128,7 @@ rk_clk_composite_set_mux(struct clknode *clk, int inde READ4(clk, sc->muxdiv_offset, &val); val &= ~sc->mux_mask; val |= index << sc->mux_shift; - WRITE4(clk, sc->muxdiv_offset, val); + WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_COMPOSITE_MASK); DEVICE_UNLOCK(clk); return (0); @@ -222,6 +222,7 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ return (0); } + p_idx = clknode_get_parent_idx(clk); if (p_idx != best_parent) clknode_set_parent_by_idx(clk, best_parent); From owner-svn-src-head@freebsd.org Mon Feb 25 17:58:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C191510A84; Mon, 25 Feb 2019 17:58:20 +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 249B87085A; Mon, 25 Feb 2019 17:58:15 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 156F63C475F; Mon, 25 Feb 2019 17:58:09 +0000 (UTC) Date: Mon, 25 Feb 2019 17:58:09 +0000 From: Brooks Davis To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Message-ID: <20190225175809.GB47081@spindle.one-eyed-alien.net> References: <201902232114.x1NLE0cH085345@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <201902232114.x1NLE0cH085345@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 249B87085A X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-3.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; IP_SCORE(-3.60)[ip: (-9.34), ipnet: 199.48.128.0/22(-4.66), asn: 36236(-3.90), country: US(-0.07)]; MX_GOOD(-0.01)[spindle.one-eyed-alien.net]; MX_MISSING(3.50)[requested record is not found]; NEURAL_HAM_SHORT(-0.64)[-0.641,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 17:58:21 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 23, 2019 at 09:14:00PM +0000, Matt Macy wrote: > Author: mmacy > Date: Sat Feb 23 21:14:00 2019 > New Revision: 344487 > URL: https://svnweb.freebsd.org/changeset/base/344487 >=20 > Log: > gcov support > =20 > add gcov support and export results as files in debugfs We had a brief discussion of this commit within a subset of core. This addition of GPLv2 code is fine as the code is easily removal to a module (per kmoore@) should the day come that we're read to evict all GPL code. The modest increase in activation energy for that task seems worth it for the short-term gains of reduced integration cost (this code will greatly improve our ZFS-on-Linux test coverage.) Rod rightly points out that we haven't accepted SPDX tags alone as license statements. The standard GPL v2.0 boiler plate should be added to this file along side the tag. An additional issue is that the a warning tag was not added to sys/conf/files. A warning along the lines of: warning "kernel contains GPLv2 licensed GCOV" needs to be added. This commit needed more through review. We intend to update our license policy to require core sign off for new GPL code to ensure we're not adding new, tightly integrated dependencies, to document that we're doing so knowingly, and to make sure steps aren't missed. The current document is at: https://www.freebsd.org/internal/software-license.html -- Brooks --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcdCywAAoJEKzQXbSebgfAbL8H/A9EBVqx4ZQWU2cJDmUFQE8A NIA5ft21MhjOrh9UD/vFrYiBb75muK1tnIxlnk6wGVs2fYNCWR5SgJ0ng0559xdi s7UsouFVfS7fOdm111CAwrmUFxt6NoSHnVPvKO0FxLxoz7zyyC9L5rKxEy4vq4ua 6EpMqh+S8UGWCOUrEDFmFHJwVWnv0uFiMjn9L7uytIA4yzvpT1bCDZToGek+FKGN c+oo9HMKlWQUilPMJPkP5dd1dzADmpad1y8zhX6sn9p0cNGHtaUCYc8Mcy+BXQ3q 8G1YB5G26q6oWBW0kEvXm/ZLFsRuKQ7gnN3d5zfjH0LNNCjQTSuGxLn2xKQecEc= =tVeO -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR-- From owner-svn-src-head@freebsd.org Mon Feb 25 18:09:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8775F1510EED; Mon, 25 Feb 2019 18:09:31 +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 9BCDC70F4B; Mon, 25 Feb 2019 18:09:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yKgqgVLLGMKleyKgsg3lmX; Mon, 25 Feb 2019 11:09:22 -0700 X-Authority-Analysis: v=2.3 cv=EsmsUhUA c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=CFTnQlWoA9kA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=qYn3ri6uvIYhCYuhzGAA:9 a=QEXdDO2ut3YA:10 a=C9RNiP1id30A:10 a=AzmulVs9t5cA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id C1CC6120E; Mon, 25 Feb 2019 10:09:19 -0800 (PST) Date: Mon, 25 Feb 2019 10:08:59 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <20190225175809.GB47081@spindle.one-eyed-alien.net> References: <201902232114.x1NLE0cH085345@repo.freebsd.org> <20190225175809.GB47081@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: Brooks Davis ,Matt Macy CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfEuqXAt+4SgWR6IeJ/PNp+ihj0c+MRY1sJZTZbjsaE62hzwY7+/VkYsu2Uk1FHfy6Bm723/j5BrvIzR5JnqWvzVRlWkQx3CTSlR66tdhCajxBG+conqC GncGgbMuYVj1xneUEkOAVsZ4xZ1vlBH9aHtseHYWcfMhGwuLEi3rsBRQFlsVnlxv4AQmLMOD2dG2M2rIAblhqhz8fknWFfKkTCQfMmeoEgCwIj9cpF4XMy66 8dD+42UWkNH4/VvfhqK9JGamLdnXrBNs3zNZS+dp4wwh/9WUz7HzQgHAGeu3B1qyKXrTBrMzDbxq7Ux2YyH6FQ== X-Rspamd-Queue-Id: 9BCDC70F4B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.960,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 18:09:31 -0000 On February 25, 2019 9:58:09 AM PST, Brooks Davis wr= ote: >On Sat, Feb 23, 2019 at 09:14:00PM +0000, Matt Macy wrote: >> Author: mmacy >> Date: Sat Feb 23 21:14:00 2019 >> New Revision: 344487 >> URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/344487 >>=20 >> Log: >> gcov support >> =20 >> add gcov support and export results as files in debugfs > >We had a brief discussion of this commit within a subset of core=2E This >addition of GPLv2 code is fine as the code is easily removal to a >module >(per kmoore@) should the day come that we're read to evict all GPL >code=2E >The modest increase in activation energy for that task seems worth it >for the short-term gains of reduced integration cost (this code will >greatly improve our ZFS-on-Linux test coverage=2E) > >Rod rightly points out that we haven't accepted SPDX tags alone as >license statements=2E The standard GPL v2=2E0 boiler plate should be add= ed >to this file along side the tag=2E > >An additional issue is that the a warning tag was not added to >sys/conf/files=2E A warning along the lines of: > > warning "kernel contains GPLv2 licensed GCOV" > >needs to be added=2E > >This commit needed more through review=2E > > >We intend to update our license policy to require core sign off for >new GPL code to ensure we're not adding new, tightly integrated >dependencies, to document that we're doing so knowingly, and >to make sure steps aren't missed=2E The current document is at: >https://www=2Efreebsd=2Eorg/internal/software-license=2Ehtml > >-- Brooks That's a excellent idea=2E I was thinking about suggesting that over the = weekend (actually a committee, but core is better)=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Mon Feb 25 18:12:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 754FF151142A; Mon, 25 Feb 2019 18:12:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1186A7149E; Mon, 25 Feb 2019 18:12:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3AB820AA5; Mon, 25 Feb 2019 18:11:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PIBxmF012486; Mon, 25 Feb 2019 18:11:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PIBx6a012485; Mon, 25 Feb 2019 18:11:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902251811.x1PIBx6a012485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Feb 2019 18:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344529 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1186A7149E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 18:12:00 -0000 Author: ian Date: Mon Feb 25 18:11:59 2019 New Revision: 344529 URL: https://svnweb.freebsd.org/changeset/base/344529 Log: Fix a paste-o that broke the build on all arches. Reported by: many Pointy hat: ian@ Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Mon Feb 25 18:00:14 2019 (r344528) +++ head/sys/dev/flash/at45d.c Mon Feb 25 18:11:59 2019 (r344529) @@ -345,7 +345,7 @@ at45d_delayed_attach(void *xsc) sc->disk->d_mediasize = pagesize * ident->pagecount; sc->disk->d_unit = device_get_unit(sc->dev); disk_create(sc->disk, DISK_VERSION); - disk_add_alias(sc->sc_disk, "flash/spi"); + disk_add_alias(sc->disk, "flash/spi"); bioq_init(&sc->bio_queue); kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash"); sc->taskstate = TSTATE_RUNNING; From owner-svn-src-head@freebsd.org Mon Feb 25 18:22:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C25151183C; Mon, 25 Feb 2019 18:22:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB64871A9E; Mon, 25 Feb 2019 18:22: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 A369720CA1; Mon, 25 Feb 2019 18:22: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 x1PIMLDD018500; Mon, 25 Feb 2019 18:22:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PIMKGS018495; Mon, 25 Feb 2019 18:22:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902251822.x1PIMKGS018495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Feb 2019 18:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344530 - in head: . lib/libifconfig share/mk sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . lib/libifconfig share/mk sys/sys X-SVN-Commit-Revision: 344530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB64871A9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 18:22:22 -0000 Author: emaste Date: Mon Feb 25 18:22:20 2019 New Revision: 344530 URL: https://svnweb.freebsd.org/changeset/base/344530 Log: Make libifconfig INTERNALLIB Instead of PRIVATELIB + NO_PIC. This avoids the need for the wlandebug PIE special case added in r344211, and provides a stronger guarantee against 3rd party software coming to depend on the API or ABI. If / when we declare the API/ABI to be stable we can make it a normal library. Discussed with: bapt Sponsored by: The FreeBSD Foundation Modified: head/ObsoleteFiles.inc head/lib/libifconfig/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/sys/sys/capability.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 25 18:11:59 2019 (r344529) +++ head/ObsoleteFiles.inc Mon Feb 25 18:22:20 2019 (r344530) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190222: libifconfig made INTERNALLIB +OLD_FILES+=/usr/lib/libprivateifconfig.a +OLD_FILES+=/usr/lib/libprivateifconfig_p.a # 20190131: pfil(9) changed OLD_FILES+=usr/share/man/man9/pfil_hook_get.9 OLD_FILES+=usr/share/man/man9/pfil_rlock.9 Modified: head/lib/libifconfig/Makefile ============================================================================== --- head/lib/libifconfig/Makefile Mon Feb 25 18:11:59 2019 (r344529) +++ head/lib/libifconfig/Makefile Mon Feb 25 18:22:20 2019 (r344530) @@ -2,9 +2,7 @@ PACKAGE= lib${LIB} LIB= ifconfig -PRIVATELIB= true -# Don't build shared library, for now. -NO_PIC= +INTERNALLIB= true SHLIBDIR?= /lib SHLIB_MAJOR= 1 Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Feb 25 18:11:59 2019 (r344529) +++ head/share/mk/bsd.libnames.mk Mon Feb 25 18:22:20 2019 (r344530) @@ -80,7 +80,6 @@ LIBIBMAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libibmad.a LIBIBNETDISC?= ${LIBDESTDIR}${LIBDIR_BASE}/libibnetdisc.a LIBIBUMAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libibumad.a LIBIBVERBS?= ${LIBDESTDIR}${LIBDIR_BASE}/libibverbs.a -LIBIFCONFIG?= ${LIBDESTDIR}${LIBDIR_BASE}/libifconfig.a LIBIPSEC?= ${LIBDESTDIR}${LIBDIR_BASE}/libipsec.a LIBIPT?= ${LIBDESTDIR}${LIBDIR_BASE}/libipt.a LIBJAIL?= ${LIBDESTDIR}${LIBDIR_BASE}/libjail.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon Feb 25 18:11:59 2019 (r344529) +++ head/share/mk/src.libnames.mk Mon Feb 25 18:22:20 2019 (r344530) @@ -20,7 +20,6 @@ _PRIVATELIBS= \ event \ heimipcc \ heimipcs \ - ifconfig \ ldns \ sqlite3 \ ssh \ @@ -35,6 +34,7 @@ _INTERNALLIBS= \ cron \ elftc \ fifolog \ + ifconfig \ ipf \ lpr \ netbsd \ @@ -449,6 +449,9 @@ LIBVERS?= ${LIBVERSDIR}/libvers${PIE_SUFFIX}.a LIBSLDIR= ${OBJTOP}/kerberos5/lib/libsl LIBSL?= ${LIBSLDIR}/libsl${PIE_SUFFIX}.a + +LIBIFCONFIGDIR= ${OBJTOP}/lib/libifconfig +LIBIFCONFIG?= ${LIBIFCONFIGDIR}/libifconfig${PIE_SUFFIX}.a LIBIPFDIR= ${OBJTOP}/sbin/ipf/libipf LIBIPF?= ${LIBIPFDIR}/libipf${PIE_SUFFIX}.a Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Mon Feb 25 18:11:59 2019 (r344529) +++ head/sys/sys/capability.h Mon Feb 25 18:22:20 2019 (r344530) @@ -35,13 +35,13 @@ * Historically, the key userspace and kernel Capsicum definitions were found * in this file. However, it conflicted with POSIX.1e's capability.h, so has * been renamed capsicum.h. The file remains for backwards compatibility - * reasons as a nested include. It is expected to be removed before - * FreeBSD 13. + * reasons as a nested include. It will be removed on March 31, 2019 and will + * not be in FreeBSD 13. */ #ifndef _SYS_CAPABILITY_H_ #define _SYS_CAPABILITY_H_ -#warning this file includes which is deprecated +#warning this file includes , to be removed on March 31, 2019. #include #endif /* !_SYS_CAPABILITY_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 25 18:25:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB851511928; Mon, 25 Feb 2019 18:25: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC5D71D60; Mon, 25 Feb 2019 18:25: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 56D9620CB8; Mon, 25 Feb 2019 18:25: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 x1PIPsE5018847; Mon, 25 Feb 2019 18:25:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PIPsZ9018846; Mon, 25 Feb 2019 18:25:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902251825.x1PIPsZ9018846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Feb 2019 18:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344531 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 344531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FC5D71D60 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 18:25:55 -0000 Author: emaste Date: Mon Feb 25 18:25:53 2019 New Revision: 344531 URL: https://svnweb.freebsd.org/changeset/base/344531 Log: Remove unintend change to capability.h from r344530 I expect to remove capability.h in the near future, but it should not have been part of this commit. Modified: head/sys/sys/capability.h Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Mon Feb 25 18:22:20 2019 (r344530) +++ head/sys/sys/capability.h Mon Feb 25 18:25:53 2019 (r344531) @@ -35,13 +35,13 @@ * Historically, the key userspace and kernel Capsicum definitions were found * in this file. However, it conflicted with POSIX.1e's capability.h, so has * been renamed capsicum.h. The file remains for backwards compatibility - * reasons as a nested include. It will be removed on March 31, 2019 and will - * not be in FreeBSD 13. + * reasons as a nested include. It is expected to be removed before + * FreeBSD 13. */ #ifndef _SYS_CAPABILITY_H_ #define _SYS_CAPABILITY_H_ -#warning this file includes , to be removed on March 31, 2019. +#warning this file includes which is deprecated #include #endif /* !_SYS_CAPABILITY_H_ */ From owner-svn-src-head@freebsd.org Mon Feb 25 18:27:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 549DA15119BE; Mon, 25 Feb 2019 18:27:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA98271EE0; Mon, 25 Feb 2019 18:27:19 +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 D44BC20CBB; Mon, 25 Feb 2019 18:27:19 +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 x1PIRJxV018971; Mon, 25 Feb 2019 18:27:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PIRJeq018970; Mon, 25 Feb 2019 18:27:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902251827.x1PIRJeq018970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Feb 2019 18:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344532 - head/usr.sbin/wlandebug X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/wlandebug X-SVN-Commit-Revision: 344532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA98271EE0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 18:27:20 -0000 Author: emaste Date: Mon Feb 25 18:27:19 2019 New Revision: 344532 URL: https://svnweb.freebsd.org/changeset/base/344532 Log: Revert r344211: wlandebug: disable PIE to fix build failure As of r344530 libifconfig is built as a standard INTERNALLIB and the wlandebug PIE workaround from r344211 can be removed. Modified: head/usr.sbin/wlandebug/Makefile Modified: head/usr.sbin/wlandebug/Makefile ============================================================================== --- head/usr.sbin/wlandebug/Makefile Mon Feb 25 18:25:53 2019 (r344531) +++ head/usr.sbin/wlandebug/Makefile Mon Feb 25 18:27:19 2019 (r344532) @@ -2,7 +2,6 @@ PROG= wlandebug MAN= wlandebug.8 -MK_PIE:= no LIBADD+= ifconfig From owner-svn-src-head@freebsd.org Mon Feb 25 18:41:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD2C151205F; Mon, 25 Feb 2019 18:41:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 282FA72960; Mon, 25 Feb 2019 18:41:19 +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 13AD920ECA; Mon, 25 Feb 2019 18:41:19 +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 x1PIfJO1027172; Mon, 25 Feb 2019 18:41:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PIfG2q027155; Mon, 25 Feb 2019 18:41:16 GMT (envelope-from des@FreeBSD.org) Message-Id: <201902251841.x1PIfG2q027155@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: Mon, 25 Feb 2019 18:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344533 - in head/contrib/openpam: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam m4 misc modules modules/pam_deny modules/pam_perm... X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head/contrib/openpam: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam m4 misc modules modules/pam_deny modules/pam_permit modules/pam_return mod... X-SVN-Commit-Revision: 344533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 282FA72960 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 18:41:19 -0000 Author: des Date: Mon Feb 25 18:41:16 2019 New Revision: 344533 URL: https://svnweb.freebsd.org/changeset/base/344533 Log: Upgrade to OpenPAM Tabebuia. Added: head/contrib/openpam/m4/ax_pkg_config.m4 - copied unchanged from r344500, vendor/openpam/dist/m4/ax_pkg_config.m4 head/contrib/openpam/t/t_pam_env.c - copied unchanged from r344500, vendor/openpam/dist/t/t_pam_env.c head/contrib/openpam/t/t_pam_err.c - copied unchanged from r344500, vendor/openpam/dist/t/t_pam_err.c head/contrib/openpam/t/t_pam_err.h - copied unchanged from r344500, vendor/openpam/dist/t/t_pam_err.h Modified: head/contrib/openpam/CREDITS head/contrib/openpam/HISTORY head/contrib/openpam/LICENSE head/contrib/openpam/Makefile.in head/contrib/openpam/RELNOTES head/contrib/openpam/aclocal.m4 head/contrib/openpam/bin/Makefile.in head/contrib/openpam/bin/openpam_dump_policy/Makefile.in head/contrib/openpam/bin/pamtest/Makefile.in head/contrib/openpam/bin/pamtest/pamtest.1 head/contrib/openpam/bin/su/Makefile.in head/contrib/openpam/bin/su/su.1 head/contrib/openpam/compile head/contrib/openpam/config.h.in head/contrib/openpam/config.sub head/contrib/openpam/configure head/contrib/openpam/configure.ac head/contrib/openpam/depcomp head/contrib/openpam/doc/Makefile.in head/contrib/openpam/doc/man/Makefile.in head/contrib/openpam/doc/man/openpam.3 head/contrib/openpam/doc/man/openpam_borrow_cred.3 head/contrib/openpam/doc/man/openpam_free_data.3 head/contrib/openpam/doc/man/openpam_free_envlist.3 head/contrib/openpam/doc/man/openpam_get_feature.3 head/contrib/openpam/doc/man/openpam_get_option.3 head/contrib/openpam/doc/man/openpam_log.3 head/contrib/openpam/doc/man/openpam_nullconv.3 head/contrib/openpam/doc/man/openpam_readline.3 head/contrib/openpam/doc/man/openpam_readlinev.3 head/contrib/openpam/doc/man/openpam_readword.3 head/contrib/openpam/doc/man/openpam_restore_cred.3 head/contrib/openpam/doc/man/openpam_set_feature.3 head/contrib/openpam/doc/man/openpam_set_option.3 head/contrib/openpam/doc/man/openpam_straddch.3 head/contrib/openpam/doc/man/openpam_subst.3 head/contrib/openpam/doc/man/openpam_ttyconv.3 head/contrib/openpam/doc/man/pam.3 head/contrib/openpam/doc/man/pam.conf.5 head/contrib/openpam/doc/man/pam_acct_mgmt.3 head/contrib/openpam/doc/man/pam_authenticate.3 head/contrib/openpam/doc/man/pam_chauthtok.3 head/contrib/openpam/doc/man/pam_close_session.3 head/contrib/openpam/doc/man/pam_conv.3 head/contrib/openpam/doc/man/pam_end.3 head/contrib/openpam/doc/man/pam_error.3 head/contrib/openpam/doc/man/pam_get_authtok.3 head/contrib/openpam/doc/man/pam_get_data.3 head/contrib/openpam/doc/man/pam_get_item.3 head/contrib/openpam/doc/man/pam_get_user.3 head/contrib/openpam/doc/man/pam_getenv.3 head/contrib/openpam/doc/man/pam_getenvlist.3 head/contrib/openpam/doc/man/pam_info.3 head/contrib/openpam/doc/man/pam_open_session.3 head/contrib/openpam/doc/man/pam_prompt.3 head/contrib/openpam/doc/man/pam_putenv.3 head/contrib/openpam/doc/man/pam_set_data.3 head/contrib/openpam/doc/man/pam_set_item.3 head/contrib/openpam/doc/man/pam_setcred.3 head/contrib/openpam/doc/man/pam_setenv.3 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 head/contrib/openpam/doc/man/pam_sm_authenticate.3 head/contrib/openpam/doc/man/pam_sm_chauthtok.3 head/contrib/openpam/doc/man/pam_sm_close_session.3 head/contrib/openpam/doc/man/pam_sm_open_session.3 head/contrib/openpam/doc/man/pam_sm_setcred.3 head/contrib/openpam/doc/man/pam_start.3 head/contrib/openpam/doc/man/pam_strerror.3 head/contrib/openpam/doc/man/pam_verror.3 head/contrib/openpam/doc/man/pam_vinfo.3 head/contrib/openpam/doc/man/pam_vprompt.3 head/contrib/openpam/include/Makefile.in head/contrib/openpam/include/security/Makefile.in head/contrib/openpam/include/security/openpam_version.h head/contrib/openpam/install-sh head/contrib/openpam/lib/Makefile.in head/contrib/openpam/lib/libpam/Makefile.in head/contrib/openpam/lib/libpam/pam_getenv.c head/contrib/openpam/misc/Makefile.in head/contrib/openpam/missing head/contrib/openpam/modules/Makefile.in head/contrib/openpam/modules/pam_deny/Makefile.in head/contrib/openpam/modules/pam_permit/Makefile.in head/contrib/openpam/modules/pam_return/Makefile.in head/contrib/openpam/modules/pam_unix/Makefile.in head/contrib/openpam/t/Makefile.am head/contrib/openpam/t/Makefile.in head/contrib/openpam/test-driver Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/CREDITS ============================================================================== --- head/contrib/openpam/CREDITS Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/CREDITS Mon Feb 25 18:41:16 2019 (r344533) @@ -49,5 +49,6 @@ ideas: Sebastian Krahmer Solar Designer Takanori Saneto + Tim Creech Wojciech A. Koszek Yar Tikhiy Modified: head/contrib/openpam/HISTORY ============================================================================== --- head/contrib/openpam/HISTORY Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/HISTORY Mon Feb 25 18:41:16 2019 (r344533) @@ -1,3 +1,10 @@ +OpenPAM Tabebuia 2019-02-24 + + - BUGFIX: Fix off-by-one bug in pam_getenv(3) which was introduced in + OpenPAM Radula. + + - ENHANCE: Add unit tests for pam_{get,put,set}env(3). +============================================================================ OpenPAM Resedacea 2017-04-30 - BUGFIX: Reinstore the NULL check in pam_end(3) which was removed in @@ -5,7 +12,7 @@ OpenPAM Resedacea 2017-04-30 - BUGFIX: Return PAM_SYMBOL_ERR instead of PAM_SYSTEM_ERR from the dispatcher when the required service function could not be found. - + - ENHANCE: Introduce the PAM_BAD_HANDLE error code for when pamh is NULL in API functions that have a NULL check. Modified: head/contrib/openpam/LICENSE ============================================================================== --- head/contrib/openpam/LICENSE Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/LICENSE Mon Feb 25 18:41:16 2019 (r344533) @@ -1,6 +1,6 @@ Copyright (c) 2002-2003 Networks Associates Technology, Inc. -Copyright (c) 2004-2017 Dag-Erling Smørgrav +Copyright (c) 2004-2019 Dag-Erling Smørgrav All rights reserved. This software was developed for the FreeBSD Project by ThinkSec AS and Modified: head/contrib/openpam/Makefile.in ============================================================================== --- head/contrib/openpam/Makefile.in Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/Makefile.in Mon Feb 25 18:41:16 2019 (r344533) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -92,10 +92,10 @@ host_triplet = @host@ @WITH_DOC_TRUE@am__append_1 = doc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -140,7 +140,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -221,9 +221,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -271,6 +271,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -319,6 +322,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -367,8 +371,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -512,7 +516,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -577,7 +584,7 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -603,7 +610,7 @@ dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -621,7 +628,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -631,7 +638,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac Modified: head/contrib/openpam/RELNOTES ============================================================================== --- head/contrib/openpam/RELNOTES Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/RELNOTES Mon Feb 25 18:41:16 2019 (r344533) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Resedacea - =================================== + Release notes for OpenPAM Tabebuia + ================================== OpenPAM is developed primarily on FreeBSD, but is expected to work on almost any POSIX-like platform that has GNU autotools, GNU make and Modified: head/contrib/openpam/aclocal.m4 ============================================================================== --- head/contrib/openpam/aclocal.m4 Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/aclocal.m4 Mon Feb 25 18:41:16 2019 (r344533) @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, bu If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -563,7 +553,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -605,7 +595,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -647,7 +637,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -655,49 +645,42 @@ AC_SUBST([am__leading_dot])]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -738,7 +721,7 @@ fi # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -765,7 +748,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -794,7 +777,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -841,7 +824,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -860,7 +843,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -941,7 +924,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1001,7 +984,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1029,7 +1012,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1048,7 +1031,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1179,6 +1162,7 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/ax_pkg_config.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) Modified: head/contrib/openpam/bin/Makefile.in ============================================================================== --- head/contrib/openpam/bin/Makefile.in Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/bin/Makefile.in Mon Feb 25 18:41:16 2019 (r344533) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ @WITH_SU_TRUE@am__append_2 = su subdir = bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -138,7 +138,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -199,9 +199,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -249,6 +249,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,6 +300,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -329,8 +333,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -447,7 +451,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ Modified: head/contrib/openpam/bin/openpam_dump_policy/Makefile.in ============================================================================== --- head/contrib/openpam/bin/openpam_dump_policy/Makefile.in Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/bin/openpam_dump_policy/Makefile.in Mon Feb 25 18:41:16 2019 (r344533) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ noinst_PROGRAMS = openpam_dump_policy$(EXEEXT) subdir = bin/openpam_dump_policy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -129,7 +129,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/openpam_dump_policy.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -190,9 +191,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -240,6 +241,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -288,6 +292,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -324,8 +329,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -356,8 +361,14 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openpam_dump_policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openpam_dump_policy.Po@am__quote@ # am--include-marker +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -437,7 +448,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -507,7 +521,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROG mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/openpam_dump_policy.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -553,7 +567,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/openpam_dump_policy.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -574,9 +588,9 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ Modified: head/contrib/openpam/bin/pamtest/Makefile.in ============================================================================== --- head/contrib/openpam/bin/pamtest/Makefile.in Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/bin/pamtest/Makefile.in Mon Feb 25 18:41:16 2019 (r344533) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ bin_PROGRAMS = pamtest$(EXEEXT) subdir = bin/pamtest ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -129,7 +129,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/pamtest.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -221,9 +222,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -271,6 +272,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -319,6 +323,7 @@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -356,8 +361,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -428,8 +433,14 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pamtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pamtest.Po@am__quote@ # am--include-marker +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @@ -550,7 +561,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -622,7 +636,7 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/pamtest.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -668,7 +682,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/pamtest.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -691,7 +705,7 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ Modified: head/contrib/openpam/bin/pamtest/pamtest.1 ============================================================================== --- head/contrib/openpam/bin/pamtest/pamtest.1 Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/bin/pamtest/pamtest.1 Mon Feb 25 18:41:16 2019 (r344533) @@ -26,9 +26,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenPAM: pamtest.1 939 2017-04-30 21:36:50Z des $ +.\" $OpenPAM: pamtest.1 947 2019-02-24 20:18:17Z des $ .\" -.Dd April 30, 2017 +.Dd February 24, 2019 .Dt PAMTEST 1 .Os .Sh NAME Modified: head/contrib/openpam/bin/su/Makefile.in ============================================================================== --- head/contrib/openpam/bin/su/Makefile.in Mon Feb 25 18:27:19 2019 (r344532) +++ head/contrib/openpam/bin/su/Makefile.in Mon Feb 25 18:41:16 2019 (r344533) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -93,10 +93,10 @@ host_triplet = @host@ bin_PROGRAMS = su$(EXEEXT) subdir = bin/su ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pkg_config.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -129,7 +129,8 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/su.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -221,9 +222,9 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CRYB_TEST_CFLAGS = @CRYB_TEST_CFLAGS@ CRYB_TEST_LIBS = @CRYB_TEST_LIBS@ -CRYPTO_LIBS = @CRYPTO_LIBS@ -CRYPT_LIBS = @CRYPT_LIBS@ +CRYB_TEST_VERSION = @CRYB_TEST_VERSION@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -271,6 +272,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 25 18:52:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AB51512412; Mon, 25 Feb 2019 18:52:48 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD760730D3; Mon, 25 Feb 2019 18:52:47 +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 CD657211FE; Mon, 25 Feb 2019 18:52:47 +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 x1PIqlsa034854; Mon, 25 Feb 2019 18:52:47 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PIqlf7034853; Mon, 25 Feb 2019 18:52:47 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201902251852.x1PIqlf7034853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 25 Feb 2019 18:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 344534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD760730D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 18:52:48 -0000 Author: luporl Date: Mon Feb 25 18:52:47 2019 New Revision: 344534 URL: https://svnweb.freebsd.org/changeset/base/344534 Log: Increase ctfconvert buffer size Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D19353 Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb 25 18:41:16 2019 (r344533) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb 25 18:52:47 2019 (r344534) @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die die, Dwarf_O static intr_t * die_base_name_parse(const char *name, char **newp) { - char buf[100]; + char buf[256]; char const *base; char *c; int nlong = 0, nshort = 0, nchar = 0, nint = 0; From owner-svn-src-head@freebsd.org Mon Feb 25 18:56:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D631B15125D3 for ; Mon, 25 Feb 2019 18:56:26 +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 4B51873474 for ; Mon, 25 Feb 2019 18:56:26 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1551120976; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=B4f5HXNilzJsoP5q+oJKr+YbJToIMwnyFbOHgbcQ8mxkTsgX4eQkUvCRhN4ARG2cF+0Xq+jzDbWga 9pfH9BUMWB5g2iR+UriOsSAf+1j81W5jw/4fFTu5widwPc1iI5mhM7cVgkvN56oVUAnWH1YyfM8GYw Zw80P01dEN3QtFKCdF6JQZqrIwDD7T/C6kdvKHrzva7ZDR88Ikl3QKXWGbvFe3Jb/h5uKLCgij2uuY w6/NvITa9A+lrcE2udTrkRfxmSbuJN6vmekYTCRABR83UvMS/nbwzDYHV/eJTTjtIhmJMppCliYmiG yKN6o88jOi6xS9nWxPZBcFXhU2AT3Ew== 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:to:from:subject:message-id:dkim-signature:from; bh=k4TGBLRA9oIGg8OHrFeMUbHWpzoLWEuuDlKhdZqwrCU=; b=VT+c6buHgwUn6wL9UiBKKI0JeL7/IR6gqhbu7SmzaGh1u3AjD6Rat0TziVTow1RAty1BU88V/e9c/ SFNxQPsdtQWMocPyEvskZ5jHI39X6SlIaU8q99efwEU+vrF1YVIC5ZgH7ykOxxgZTap487Ok+ZeFqq Cgu6pIpPW8I1VBRriyv72e+ECdkYu1Yk5YqdDXp5knl4nVxbYKLpFFMNmOenhdvv38GGF3hLsDh2l8 B/x9TLSZUS7IXgEJGoVBa2TC/nz7MLaFrMLpmeNy8TwXR6loRny/yBCX7tZjL2wFxLT17eU5UeB/cm MY1NilLqOEMalN16QUTX9ap+iIwR4Aw== ARC-Authentication-Results: i=1; outbound2.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:to:from:subject:message-id:from; bh=k4TGBLRA9oIGg8OHrFeMUbHWpzoLWEuuDlKhdZqwrCU=; b=ka+NhSRBNzDZStNa5C8ZWqlggVGaNGjmTjsrSRWGNhP97t7FrIIji2sfxSY/ekwap1CWO8AxLS1yc u4/IkZnK5IHS/D9T8ENHS1ON6M0V8utpDveFaflZEzwH87TEMs2ZNLYJ8YEk9qVbMmBHxDHNyUrbdz eku30j+binOkPsoDAeZEWcM7YbC626OI7ta2L2tNZIjK5XVUPw4yem7wT7XLUWaHaAOKzEC5AeVw5y 1uC6KU0ImRCxGNH789sJP2YkLBciBGpmOnzpCtg+5WArSqER97VQ8WypoWjLnIuXA6nGEn/hBBcmHu 6fmR7RaWiwktIhMg1AIxyce5hV04tqQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 05b037d1-392f-11e9-803b-31925da7267c 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 outbound2.eu.mailhop.org (Halon) with ESMTPSA id 05b037d1-392f-11e9-803b-31925da7267c; Mon, 25 Feb 2019 18:56:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1PIuD9q099317; Mon, 25 Feb 2019 11:56:13 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt From: Ian Lepore To: Leandro Lupori , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 25 Feb 2019 11:56:12 -0700 In-Reply-To: <201902251852.x1PIqlf7034853@repo.freebsd.org> References: <201902251852.x1PIqlf7034853@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B51873474 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 18:56:27 -0000 On Mon, 2019-02-25 at 18:52 +0000, Leandro Lupori wrote: > Author: luporl > Date: Mon Feb 25 18:52:47 2019 > New Revision: 344534 > URL: https://svnweb.freebsd.org/changeset/base/344534 > > Log: > Increase ctfconvert buffer size > > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D19353 > This is not a very good commit message. To be good, it should say why the size is being increased. If the commit had included the summary text from D19353 it would have been perfect. -- Ian > Modified: > head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > ===================================================================== > ========= > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb > 25 18:41:16 2019 (r344533) > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb > 25 18:52:47 2019 (r344534) > @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die die, > Dwarf_O > static intr_t * > die_base_name_parse(const char *name, char **newp) > { > - char buf[100]; > + char buf[256]; > char const *base; > char *c; > int nlong = 0, nshort = 0, nchar = 0, nint = 0; > From owner-svn-src-head@freebsd.org Mon Feb 25 19:07:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BBEF1512D50; Mon, 25 Feb 2019 19:07:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (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 EF58474230; Mon, 25 Feb 2019 19:07:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id f186so522012ita.0; Mon, 25 Feb 2019 11:07:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=RYu3koXlZsTjx4wMz/Cti3o6ArPl+axG1f1fDKofheM=; b=FJkUYRAmdeoSnBEQIQhBl6YToUQ9IqP6RLHDf3hSbCeDnQdJClQsHOFNqSalAZ+fV1 pS6KmRIg3AzT7lh7KOTblYyb+2RnIMPCbrwwqoNmFTU/EXKZYU0aHgBJ/JDyLwjio0lt OC1/4s6gpd35shoDlBlJoICWR871vpGEqDjKz55QfzViE+dbPYtw5O5tC0TL30I02hMh RVZbBYGieSQaXtLwM8L/qq7MZXnFB85LWMNgCi5s+b7whoMQK7PBrODp/EeG59eLHTJa b8wUmFvgvQCBdkb7QdgBnvEgekNB1/V+qWwTl++d7PDWHKDCadoq3dgel4VJ06i6p+hM mOvg== X-Gm-Message-State: AHQUAuag6OgNZ9PpDtlZhl4SJcYCXa+hPHTGvsf8U9Zs4CRVzsmY4m/w X9TzStDfx4Zw70ZkLVp/n99J48rL X-Google-Smtp-Source: AHgI3Ia99x6UEpVzL3fQ5nFnzYEuAoCFX0msv+TpyiJZMCTujxtHeCDV0OvLvb8C6Qhk/eerP5k01g== X-Received: by 2002:a02:168a:: with SMTP id a132mr10027474jaa.101.1551121649601; Mon, 25 Feb 2019 11:07:29 -0800 (PST) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com. [209.85.166.175]) by smtp.gmail.com with ESMTPSA id i66sm5319145ite.38.2019.02.25.11.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 11:07:29 -0800 (PST) Received: by mail-it1-f175.google.com with SMTP id v83so93604itf.1; Mon, 25 Feb 2019 11:07:29 -0800 (PST) X-Received: by 2002:a02:9f86:: with SMTP id a6mr10425505jam.87.1551121648990; Mon, 25 Feb 2019 11:07:28 -0800 (PST) MIME-Version: 1.0 References: <201902251841.x1PIfG2q027155@repo.freebsd.org> In-Reply-To: <201902251841.x1PIfG2q027155@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 25 Feb 2019 11:07:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344533 - in head/contrib/openpam: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam m4 misc modules modules/pam_deny modules/pam_perm... To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: EF58474230 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 19:07:37 -0000 On Mon, Feb 25, 2019 at 10:41 AM Dag-Erling Sm=C3=B8rgrav = wrote: > > Author: des > Date: Mon Feb 25 18:41:16 2019 > New Revision: 344533 > URL: https://svnweb.freebsd.org/changeset/base/344533 > > Log: > Upgrade to OpenPAM Tabebuia. PR: 235903 From owner-svn-src-head@freebsd.org Mon Feb 25 19:10:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E815C1513108; Mon, 25 Feb 2019 19:10:39 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9010F75017; Mon, 25 Feb 2019 19:10:39 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com [209.85.166.178]) (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: luporl/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0E0B614873; Mon, 25 Feb 2019 19:10:39 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: by mail-it1-f178.google.com with SMTP id l15so75813iti.4; Mon, 25 Feb 2019 11:10:39 -0800 (PST) X-Gm-Message-State: AHQUAuY5PmoW9JNEGFDA9BfWHAjWu2GF/U+rJPY5rT6mFhsXwvHfOdRB Kz6LdMtLCBij9xD/8iMx33a181Da2s7mHWZdZpY= X-Google-Smtp-Source: AHgI3IZWeMxqoZq9QsgDAZZHnYhWny8MNVrKypBeVOWqIQJwNdi2HgaOzEqVBID4Q65FTNRTAA1eyHNiP3eHhFuCVmg= X-Received: by 2002:a02:1b58:: with SMTP id l85mr10543123jad.86.1551121838502; Mon, 25 Feb 2019 11:10:38 -0800 (PST) MIME-Version: 1.0 References: <201902251852.x1PIqlf7034853@repo.freebsd.org> In-Reply-To: From: luporl Date: Mon, 25 Feb 2019 16:10:25 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9010F75017 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 19:10:40 -0000 Sorry, I forgot to copy the summary from D19353. Is there a way to change it now? On Mon, Feb 25, 2019 at 3:56 PM Ian Lepore wrote: > > On Mon, 2019-02-25 at 18:52 +0000, Leandro Lupori wrote: > > Author: luporl > > Date: Mon Feb 25 18:52:47 2019 > > New Revision: 344534 > > URL: https://svnweb.freebsd.org/changeset/base/344534 > > > > Log: > > Increase ctfconvert buffer size > > > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D19353 > > > > This is not a very good commit message. To be good, it should say why > the size is being increased. If the commit had included the summary > text from D19353 it would have been perfect. > > -- Ian > > > Modified: > > head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > ===================================================================== > > ========= > > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb > > 25 18:41:16 2019 (r344533) > > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Feb > > 25 18:52:47 2019 (r344534) > > @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die die, > > Dwarf_O > > static intr_t * > > die_base_name_parse(const char *name, char **newp) > > { > > - char buf[100]; > > + char buf[256]; > > char const *base; > > char *c; > > int nlong = 0, nshort = 0, nchar = 0, nint = 0; > > > From owner-svn-src-head@freebsd.org Mon Feb 25 19:14:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECFEA151351E; Mon, 25 Feb 2019 19:14:16 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9159A75676; Mon, 25 Feb 2019 19:14:16 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DCD4215B4; Mon, 25 Feb 2019 19:14:16 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PJEGYD046233; Mon, 25 Feb 2019 19:14:16 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PJEGme046232; Mon, 25 Feb 2019 19:14:16 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902251914.x1PJEGme046232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Mon, 25 Feb 2019 19:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344547 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 344547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9159A75676 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 19:14:17 -0000 Author: sef Date: Mon Feb 25 19:14:16 2019 New Revision: 344547 URL: https://svnweb.freebsd.org/changeset/base/344547 Log: Fix another bug introduced during the review process of r344140: the tag wasn't being computed properly due to chaning a >= comparison to an == comparison. Specifically: CBC-MAC encodes the length of the authorization data into the the stream to be encrypted/hashed. For short data, this is two bytes (big-endian 16 bit value); for larger data, it's 6 bytes (a prefix of 0xff, 0xfe, followed by a 32-bit big-endian length). And there's a larger size, which is 10 bytes. These extra bytes weren't being accounted for with the post-review code. The other bit that then came into play was that OCF only calls the Update code with blksiz=16, which meant that I had to ignore the length variable. (It also means that it can't be called with a single buffer containing the AAD and payload; however, OCF doesn't do this for the software-only algorithsm.) I tested with this script: ALG=aes-ccm DEV=soft for aad in 0 1 2 3 4 14 16 24 30 32 34 36 1020 do for dln in 16 32 1024 2048 10240 do echo "Testing AAD length ${aad} data length ${dln}" /root/cryptocheck -A ${aad} -a ${ALG} -d ${DEV} ${dln} done done Reviewed by: cem Sponsored by: iXsystems Inc. Modified: head/sys/opencrypto/cbc_mac.c Modified: head/sys/opencrypto/cbc_mac.c ============================================================================== --- head/sys/opencrypto/cbc_mac.c Mon Feb 25 19:07:52 2019 (r344546) +++ head/sys/opencrypto/cbc_mac.c Mon Feb 25 19:14:16 2019 (r344547) @@ -124,23 +124,31 @@ AES_CBC_MAC_Reinit(struct aes_cbc_mac_ctx *ctx, const rijndaelEncrypt(ctx->keysched, ctx->rounds, b0, ctx->block); /* If there is auth data, we need to set up the staging block */ if (ctx->authDataLength) { + size_t addLength; if (ctx->authDataLength < ((1<<16) - (1<<8))) { uint16_t sizeVal = htobe16(ctx->authDataLength); bcopy(&sizeVal, ctx->staging_block, sizeof(sizeVal)); - ctx->blockIndex = sizeof(sizeVal); + addLength = sizeof(sizeVal); } else if (ctx->authDataLength < (1ULL<<32)) { uint32_t sizeVal = htobe32(ctx->authDataLength); ctx->staging_block[0] = 0xff; ctx->staging_block[1] = 0xfe; bcopy(&sizeVal, ctx->staging_block+2, sizeof(sizeVal)); - ctx->blockIndex = 2 + sizeof(sizeVal); + addLength = 2 + sizeof(sizeVal); } else { uint64_t sizeVal = htobe64(ctx->authDataLength); ctx->staging_block[0] = 0xff; ctx->staging_block[1] = 0xff; bcopy(&sizeVal, ctx->staging_block+2, sizeof(sizeVal)); - ctx->blockIndex = 2 + sizeof(sizeVal); + addLength = 2 + sizeof(sizeVal); } + ctx->blockIndex = addLength; + /* + * The length descriptor goes into the AAD buffer, so we + * need to account for it. + */ + ctx->authDataLength += addLength; + ctx->authDataCount = addLength; } } @@ -181,10 +189,9 @@ AES_CBC_MAC_Update(struct aes_cbc_mac_ctx *ctx, const ctx->authDataCount += copy_amt; ctx->blockIndex += copy_amt; ctx->blockIndex %= sizeof(ctx->staging_block); - if (ctx->authDataCount == ctx->authDataLength) - length = 0; + if (ctx->blockIndex == 0 || - ctx->authDataCount >= ctx->authDataLength) { + ctx->authDataCount == ctx->authDataLength) { /* * We're done with this block, so we * xor staging_block with block, and then @@ -193,8 +200,17 @@ AES_CBC_MAC_Update(struct aes_cbc_mac_ctx *ctx, const xor_and_encrypt(ctx, ctx->staging_block, ctx->block); bzero(ctx->staging_block, sizeof(ctx->staging_block)); ctx->blockIndex = 0; + if (ctx->authDataCount >= ctx->authDataLength) + break; } } + /* + * We'd like to be able to check length == 0 and return + * here, but the way OCF calls us, length is always + * blksize (16, in this case). So we have to count on + * the fact that OCF calls us separately for the AAD and + * for the real data. + */ return (0); } /* From owner-svn-src-head@freebsd.org Mon Feb 25 19:15:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFC6615135BB for ; Mon, 25 Feb 2019 19:15:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (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 2A9B2757F1 for ; Mon, 25 Feb 2019 19:15:46 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1551122104; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=qOJ7E4XvghZYUHb8vYR3eyTBdHjZBj9px2Epp6Zf7WVBbTT/i4xkWI3SqlWsVXzu/uCQ5aSs8Dp9y Y2lcOx7ti3apIHmqA/oiuAvcAN2MrGhY/3NxPERgfyeIbHE79oJuyjHkpb7k3z4aD/Dmz/qgYazJVx AfeNVPJfNf468EiXCxwf2Fhzh92Sxz4upEd29pqyZX9Sw52vXt49U3j01MvqSuQZAlSpjHv+9+eLGk FPfCMHx49GVqLT/TBpy2kymkd5c1tYqaWM//uNCyqTeVJ+ECzkfkCFAkgp2tLd1H1FkQPbFBEz4w5+ YTU9RAIsndBdTRJLNgTHK1CUOZ3xmyQ== 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=SVtzVl/sHxQ2hSqyxeoaq/OqpSvBl0rWyQXnE7hygyo=; b=g8uhm+Rc1d3uVero6z3af7oD6g68rXdZ2hmFw/WSUb+bzeLu39kBo6//Jkq0ow0act+U5w60NuWBi P8b8xlFClJHjsvLTtBXTToSGXajjdXK8HXPR0AsFTp4KyomDCTTnH4U4UQITdLWp3Oysa9+Zad3BNU J8hHlB0lIahKwvbLPXCzcyXlZqvDifzsWhJdEseeV/K26adhWpz4ZHWx775k38iNoGWrE2l70zonHN keXoFYQzLlcZYNawG5WaqfFYfYxeKVzDBbDFhLPys1fbAIDG5RQRcvK78NPPssfHpVcllwPW2PtwxJ KaS/C3HPNc199cBoGgt5eRTYDFu4IlA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=SVtzVl/sHxQ2hSqyxeoaq/OqpSvBl0rWyQXnE7hygyo=; b=aGOvU5SrQf5iWjhxRT4v2qlMNZjOjV3AQ3Zf8iGrpZbpno0z956plJ510xCIsiCSyJC8L6JoRMUBo f3VYQyWi1Or/HjOWtr24b5Im5e9jLpvIxmS0RYKGkJIjgyBeWnrfc6+e/NyR8QGL84nhUQtHmwqKyE YoHUNLCEQzYVeN3wfAk7CFyHLXqcYgSK6yGknSZslJnToAoX+NNxXmojdfi94rOYOqq7WtxDDK8vmw abWefSapkthZ8uZpxC/86tXprEncH9gnN2kx4pkom04bkUzULXslic8tQkdTlDjzca6AHoET17SZrT yzLcpRIFlOdBagtUvhWA1sEMhX+xWvQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: a6ab6441-3931-11e9-9789-75353a1f43cf 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 outbound3.ore.mailhop.org (Halon) with ESMTPSA id a6ab6441-3931-11e9-9789-75353a1f43cf; Mon, 25 Feb 2019 19:15:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x1PJFcnv099415; Mon, 25 Feb 2019 12:15:38 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r344534 - head/cddl/contrib/opensolaris/tools/ctf/cvt From: Ian Lepore To: luporl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 25 Feb 2019 12:15:38 -0700 In-Reply-To: References: <201902251852.x1PIqlf7034853@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2A9B2757F1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2019 19:15:48 -0000 Nope, editing prior history is administratively disabled in the svn repo. But at least the commit message did include a reference to the review, so someone can dig up the info if they need it. -- Ian On Mon, 2019-02-25 at 16:10 -0300, luporl wrote: > Sorry, I forgot to copy the summary from D19353. > > Is there a way to change it now? > > On Mon, Feb 25, 2019 at 3:56 PM Ian Lepore wrote: > > > > On Mon, 2019-02-25 at 18:52 +0000, Leandro Lupori wrote: > > > Author: luporl > > > Date: Mon Feb 25 18:52:47 2019 > > > New Revision: 344534 > > > URL: https://svnweb.freebsd.org/changeset/base/344534 > > > > > > Log: > > > Increase ctfconvert buffer size > > > > > > Reviewed by: markj > > > Differential Revision: https://reviews.freebsd.org/D19353 > > > > > > > This is not a very good commit message. To be good, it should say > > why > > the size is being increased. If the commit had included the summary > > text from D19353 it would have been perfect. > > > > -- Ian > > > > > Modified: > > > head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > > > > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > > ================================================================= > > > ==== > > > ========= > > > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon > > > Feb > > > 25 18:41:16 2019 (r344533) > > > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon > > > Feb > > > 25 18:52:47 2019 (r344534) > > > @@ -1268,7 +1268,7 @@ die_funcptr_create(dwarf_t *dw, Dwarf_Die > > > die, > > > Dwarf_O > > > static intr_t * > > > die_base_name_parse(const char *name, char **newp) > > > { > > > - char buf[100]; > > > + char buf[256]; > > > char const *base; > > > char *c; > > > int nlong = 0, nshort = 0, nchar = 0, nint = 0; > > > > > From owner-svn-src-head@freebsd.org Mon Feb 25 19:22:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E36B81513D4C; Mon, 25 Feb 2019 19:22:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76ED976154; Mon, 25 Feb 2019 19:22:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1F4121746; Mon, 25 Feb 2019 19:22: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 x1PJMDup051428; Mon, 25 Feb 2019 19:22:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PJMD0R051425; Mon, 25 Feb 2019 19:22:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902251922.x1PJMD0R051425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 25 Feb 2019 19:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344550 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 344550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76ED976154 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 19:22:15 -0000 Author: markj Date: Mon Feb 25 19:22:13 2019 New Revision: 344550 URL: https://svnweb.freebsd.org/changeset/base/344550 Log: Improve vmem tuning for platforms without a direct map. On platforms without a direct map (i.e., platforms without UMA_MD_SMALL_ALLOC defined), the boundary tag allocator reserves a number of tags for use when allocating a new slab of boundary tags, as such platforms require free boundary tags in order to allocate boundary tags. r327899 increased the number of boundary tags required for a KVA allocation in the worst case, and the aforementioned reservation was not updated accordingly. In some cases, this could lead to a system hang. Fix the problem by increasing this reservation. Also reduce KVA_QUANTUM on systems lacking superpage support. The previous import quantum (4MB with a 4KB page size) was quite large for systems with limited KVA, and fragmentation in kernel_arena could cause kernel memory allocation failures even with a substantial amount of free KVA. Reported and tested by: jhibbits Reviewed by: alc, kib No objections: jeff MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19337 Modified: head/sys/kern/subr_vmem.c head/sys/vm/vm_kern.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Mon Feb 25 19:18:32 2019 (r344549) +++ head/sys/kern/subr_vmem.c Mon Feb 25 19:22:13 2019 (r344550) @@ -689,9 +689,11 @@ vmem_startup(void) /* * Reserve enough tags to allocate new tags. We allow multiple * CPUs to attempt to allocate new tags concurrently to limit - * false restarts in UMA. + * false restarts in UMA. vmem_bt_alloc() allocates from a per-domain + * arena, which may involve importing a range from the kernel arena, + * so we need to keep at least 2 * BT_MAXALLOC tags reserved. */ - uma_zone_reserve(vmem_bt_zone, BT_MAXALLOC * (mp_ncpus + 1) / 2); + uma_zone_reserve(vmem_bt_zone, 2 * BT_MAXALLOC * mp_ncpus); uma_zone_set_allocf(vmem_bt_zone, vmem_bt_alloc); #endif } Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Mon Feb 25 19:18:32 2019 (r344549) +++ head/sys/vm/vm_kern.c Mon Feb 25 19:22:13 2019 (r344550) @@ -124,8 +124,8 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLA #if VM_NRESERVLEVEL > 0 #define KVA_QUANTUM_SHIFT (VM_LEVEL_0_ORDER + PAGE_SHIFT) #else -/* On non-superpage architectures want large import sizes. */ -#define KVA_QUANTUM_SHIFT (10 + PAGE_SHIFT) +/* On non-superpage architectures we want large import sizes. */ +#define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) #endif #define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) From owner-svn-src-head@freebsd.org Mon Feb 25 19:47:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80126151454A; Mon, 25 Feb 2019 19:47:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2260C76EAA; Mon, 25 Feb 2019 19:47: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 124A521B09; Mon, 25 Feb 2019 19:47: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 x1PJlRKn062739; Mon, 25 Feb 2019 19:47:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PJlRg2062736; Mon, 25 Feb 2019 19:47:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902251947.x1PJlRg2062736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 25 Feb 2019 19:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344551 - in head/usr.bin/cmp: . tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/usr.bin/cmp: . tests X-SVN-Commit-Revision: 344551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2260C76EAA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 19:47:28 -0000 Author: markj Date: Mon Feb 25 19:47:27 2019 New Revision: 344551 URL: https://svnweb.freebsd.org/changeset/base/344551 Log: Fix handling of rights on stdio streams, take two. Split the rights-limiting code into two cases: if one of the input files isn't a regular file, use caph_limit_stream(3) instead of open-coding the same logic; if both input files are regular files, and the initial attempts to map them succeed, we limit the rights on those files to CAP_MMAP_R. Add a regression test for PR 234885. PR: 234885 Reviewed by: delphij MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19216 Modified: head/usr.bin/cmp/cmp.c head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c head/usr.bin/cmp/tests/cmp_test2.sh Modified: head/usr.bin/cmp/cmp.c ============================================================================== --- head/usr.bin/cmp/cmp.c Mon Feb 25 19:22:13 2019 (r344550) +++ head/usr.bin/cmp/cmp.c Mon Feb 25 19:47:27 2019 (r344551) @@ -45,7 +45,6 @@ static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/9 __FBSDID("$FreeBSD$"); #include -#include #include #include @@ -80,8 +79,6 @@ main(int argc, char *argv[]) off_t skip1, skip2; int ch, fd1, fd2, oflag, special; const char *file1, *file2; - cap_rights_t rights; - uint32_t fcntls; oflag = O_RDONLY; while ((ch = getopt_long(argc, argv, "+hlsxz", long_opts, NULL)) != -1) @@ -116,14 +113,19 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 4) usage(); + /* Don't limit rights on stdin since it may be one of the inputs. */ + if (caph_limit_stream(STDOUT_FILENO, CAPH_WRITE | CAPH_IGNORE_EBADF)) + err(ERR_EXIT, "unable to limit rights on stdout"); + if (caph_limit_stream(STDERR_FILENO, CAPH_WRITE | CAPH_IGNORE_EBADF)) + err(ERR_EXIT, "unable to limit rights on stderr"); + /* Backward compatibility -- handle "-" meaning stdin. */ special = 0; if (strcmp(file1 = argv[0], "-") == 0) { special = 1; - fd1 = 0; + fd1 = STDIN_FILENO; file1 = "stdin"; - } - else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { + } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file1); else @@ -134,10 +136,9 @@ main(int argc, char *argv[]) errx(ERR_EXIT, "standard input may only be specified once"); special = 1; - fd2 = 0; + fd2 = STDIN_FILENO; file2 = "stdin"; - } - else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { + } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file2); else @@ -162,33 +163,8 @@ main(int argc, char *argv[]) exit(ERR_EXIT); } - cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_MMAP_R); - if (caph_rights_limit(fd1, &rights) < 0) - err(ERR_EXIT, "unable to limit rights for %s", file1); - if (caph_rights_limit(fd2, &rights) < 0) - err(ERR_EXIT, "unable to limit rights for %s", file2); - - /* Required for fdopen(3). */ - fcntls = CAP_FCNTL_GETFL; - if (caph_fcntls_limit(fd1, fcntls) < 0) - err(ERR_EXIT, "unable to limit fcntls for %s", file1); - if (caph_fcntls_limit(fd2, fcntls) < 0) - err(ERR_EXIT, "unable to limit fcntls for %s", file2); - - if (!special) { - cap_rights_init(&rights); - if (caph_rights_limit(STDIN_FILENO, &rights) < 0) { - err(ERR_EXIT, "unable to limit stdio"); - } - } - - if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) - err(ERR_EXIT, "unable to limit stdio"); - + /* FD rights are limited in c_special() and c_regular(). */ caph_cache_catpages(); - - if (caph_enter() < 0) - err(ERR_EXIT, "unable to enter capability mode"); if (!special) { if (fstat(fd1, &sb1)) { Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Mon Feb 25 19:22:13 2019 (r344550) +++ head/usr.bin/cmp/regular.c Mon Feb 25 19:47:27 2019 (r344551) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -61,12 +62,13 @@ void c_regular(int fd1, const char *file1, off_t skip1, off_t len1, int fd2, const char *file2, off_t skip2, off_t len2) { + struct sigaction act, oact; + cap_rights_t rights; u_char ch, *p1, *p2, *m1, *m2, *e1, *e2; off_t byte, length, line; - int dfound; off_t pagemask, off1, off2; size_t pagesize; - struct sigaction act, oact; + int dfound; if (skip1 > len1) eofmsg(file1); @@ -78,12 +80,6 @@ c_regular(int fd1, const char *file1, off_t skip1, off if (sflag && len1 != len2) exit(DIFF_EXIT); - sigemptyset(&act.sa_mask); - act.sa_flags = SA_NODEFER; - act.sa_handler = segv_handler; - if (sigaction(SIGSEGV, &act, &oact)) - err(ERR_EXIT, "sigaction()"); - pagesize = getpagesize(); pagemask = (off_t)pagesize - 1; off1 = ROUNDPAGE(skip1); @@ -101,6 +97,19 @@ c_regular(int fd1, const char *file1, off_t skip1, off c_special(fd1, file1, skip1, fd2, file2, skip2); return; } + + if (caph_rights_limit(fd1, cap_rights_init(&rights, CAP_MMAP_R)) < 0) + err(1, "unable to limit rights for %s", file1); + if (caph_rights_limit(fd2, cap_rights_init(&rights, CAP_MMAP_R)) < 0) + err(1, "unable to limit rights for %s", file2); + if (caph_enter() < 0) + err(ERR_EXIT, "unable to enter capability mode"); + + sigemptyset(&act.sa_mask); + act.sa_flags = SA_NODEFER; + act.sa_handler = segv_handler; + if (sigaction(SIGSEGV, &act, &oact)) + err(ERR_EXIT, "sigaction()"); dfound = 0; e1 = m1 + MMAP_CHUNK; Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Mon Feb 25 19:22:13 2019 (r344550) +++ head/usr.bin/cmp/special.c Mon Feb 25 19:47:27 2019 (r344551) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -54,6 +55,13 @@ c_special(int fd1, const char *file1, off_t skip1, off_t byte, line; FILE *fp1, *fp2; int dfound; + + if (caph_limit_stream(fd1, CAPH_READ) < 0) + err(ERR_EXIT, "caph_limit_stream(%s)", file1); + if (caph_limit_stream(fd2, CAPH_READ) < 0) + err(ERR_EXIT, "caph_limit_stream(%s)", file2); + if (caph_enter() < 0) + err(ERR_EXIT, "unable to enter capability mode"); if ((fp1 = fdopen(fd1, "r")) == NULL) err(ERR_EXIT, "%s", file1); Modified: head/usr.bin/cmp/tests/cmp_test2.sh ============================================================================== --- head/usr.bin/cmp/tests/cmp_test2.sh Mon Feb 25 19:22:13 2019 (r344550) +++ head/usr.bin/cmp/tests/cmp_test2.sh Mon Feb 25 19:47:27 2019 (r344551) @@ -35,6 +35,8 @@ special_body() { atf_check -s exit:0 -o empty -e empty -x "cat a | cmp - a" atf_check -s exit:1 -o not-empty -e empty -x "cat b | cmp a -" atf_check -s exit:1 -o not-empty -e empty -x "cat b | cmp - a" + + atf_check -s exit:0 -o empty -e empty -x "cmp a a <&-" } atf_test_case symlink From owner-svn-src-head@freebsd.org Mon Feb 25 21:58:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B22F1517271; Mon, 25 Feb 2019 21:58:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A42CF83B37; Mon, 25 Feb 2019 21:58:21 +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 94F2923195; Mon, 25 Feb 2019 21:58:21 +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 x1PLwLxv031674; Mon, 25 Feb 2019 21:58:21 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PLwKGm031664; Mon, 25 Feb 2019 21:58:20 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201902252158.x1PLwKGm031664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 25 Feb 2019 21:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344552 - in head: sbin/fsck_ffs sbin/fsdb sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/fsck_ffs sbin/fsdb sys/ufs/ffs X-SVN-Commit-Revision: 344552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A42CF83B37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 21:58:22 -0000 Author: mckusick Date: Mon Feb 25 21:58:19 2019 New Revision: 344552 URL: https://svnweb.freebsd.org/changeset/base/344552 Log: After a crash, a file that extends into indirect blocks may end up shorter than its size resulting in a hole as its final block (which is a violation of the invarients of the UFS filesystem). Soft updates will always ensure that the file size is correct when writing inodes to disk for files that contain only direct block pointers. However soft updates does not roll back sizes for files with indirect blocks that it has set to unallocated because their contents have not yet been written to disk. Hence, the file can appear to have a hole at its end because the block pointer has been rolled back to zero when its inode was written to disk. Thus, fsck_ffs calculates the last allocated block in the file. For files that extend into indirect blocks, fsck_ffs checks for a size past the last allocated block of the file and if that is found, shortens the file to reference the last allocated block thus avoiding having it reference a hole at its end. Submitted by: Chuck Silvers Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/setup.c head/sbin/fsdb/fsdb.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/fs.h Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Mon Feb 25 19:47:27 2019 (r344551) +++ head/sbin/fsck_ffs/fsck.h Mon Feb 25 21:58:19 2019 (r344552) @@ -232,6 +232,7 @@ struct inodesc { ufs_lbn_t id_lbn; /* logical block number of current block */ ufs2_daddr_t id_blkno; /* current block number being examined */ int id_numfrags; /* number of frags contained in block */ + ufs_lbn_t id_lballoc; /* pass1: last LBN that is allocated */ off_t id_filesize; /* for DATA nodes, the size of the directory */ ufs2_daddr_t id_entryno;/* for DATA nodes, current entry number */ int id_loc; /* for DATA nodes, current location in dir */ @@ -291,6 +292,7 @@ extern long countdirs; /* number of directories we ac #define MIBSIZE 3 /* size of fsck sysctl MIBs */ extern int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */ extern int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */ +extern int setsize[MIBSIZE]; /* MIB command to set inode size */ extern int adjndir[MIBSIZE]; /* MIB command to adjust number of directories */ extern int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ extern int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Mon Feb 25 19:47:27 2019 (r344551) +++ head/sbin/fsck_ffs/globs.c Mon Feb 25 21:58:19 2019 (r344552) @@ -63,6 +63,7 @@ unsigned long numdirs, listmax; long countdirs; /* number of directories we actually found */ int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */ int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */ +int setsize[MIBSIZE]; /* MIB command to set inode size */ int adjndir[MIBSIZE]; /* MIB command to adjust number of directories */ int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ @@ -131,6 +132,7 @@ fsckinit(void) countdirs = 0; bzero(adjrefcnt, sizeof(int) * MIBSIZE); bzero(adjblkcnt, sizeof(int) * MIBSIZE); + bzero(setsize, sizeof(int) * MIBSIZE); bzero(adjndir, sizeof(int) * MIBSIZE); bzero(adjnbfree, sizeof(int) * MIBSIZE); bzero(adjnifree, sizeof(int) * MIBSIZE); Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Mon Feb 25 19:47:27 2019 (r344551) +++ head/sbin/fsck_ffs/pass1.c Mon Feb 25 21:58:19 2019 (r344552) @@ -247,6 +247,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r off_t kernmaxfilesize; ufs2_daddr_t ndb; mode_t mode; + uintmax_t fixsize; int j, ret, offset; if ((dp = getnextinode(inumber, rebuildcg)) == NULL) @@ -377,6 +378,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r idesc->id_type = SNAP; else idesc->id_type = ADDR; + idesc->id_lballoc = -1; (void)ckinode(dp, idesc); if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) { idesc->id_type = ADDR; @@ -422,6 +424,46 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r rwerror("ADJUST INODE BLOCK COUNT", cmd.value); } } + /* + * Soft updates will always ensure that the file size is correct + * for files that contain only direct block pointers. However + * soft updates does not roll back sizes for files with indirect + * blocks that it has set to unallocated because their contents + * have not yet been written to disk. Hence, the file can appear + * to have a hole at its end because the block pointer has been + * rolled back to zero. Thus, id_lballoc tracks the last allocated + * block in the file. Here, for files that extend into indirect + * blocks, we check for a size past the last allocated block of + * the file and if that is found, shorten the file to reference + * the last allocated block to avoid having it reference a hole + * at its end. + */ + if (DIP(dp, di_size) > UFS_NDADDR * sblock.fs_bsize && + idesc->id_lballoc != lblkno(&sblock, DIP(dp, di_size) - 1)) { + fixsize = lblktosize(&sblock, idesc->id_lballoc + 1); + pwarn("INODE %lu: FILE SIZE %ju BEYOND END OF ALLOCATED FILE, " + "SIZE SHOULD BE %ju", (u_long)inumber, + (uintmax_t)DIP(dp, di_size), fixsize); + if (preen) + printf(" (ADJUSTED)\n"); + else if (reply("ADJUST") == 0) + return (1); + if (bkgrdflag == 0) { + dp = ginode(inumber); + DIP_SET(dp, di_size, fixsize); + inodirty(dp); + } else { + cmd.value = idesc->id_number; + cmd.size = fixsize; + if (debug) + printf("setsize ino %ju size set to %ju\n", + (uintmax_t)cmd.value, (uintmax_t)cmd.size); + if (sysctl(setsize, MIBSIZE, 0, 0, + &cmd, sizeof cmd) == -1) + rwerror("SET INODE SIZE", cmd.value); + } + + } return (1); unknown: pfatal("UNKNOWN FILE TYPE I=%lu", (u_long)inumber); @@ -523,5 +565,7 @@ pass1check(struct inodesc *idesc) */ idesc->id_entryno++; } + if (idesc->id_lballoc == -1 || idesc->id_lballoc < idesc->id_lbn) + idesc->id_lballoc = idesc->id_lbn; return (res); } Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Mon Feb 25 19:47:27 2019 (r344551) +++ head/sbin/fsck_ffs/setup.c Mon Feb 25 21:58:19 2019 (r344552) @@ -140,6 +140,7 @@ setup(char *dev) size = MIBSIZE; if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0|| sysctlnametomib("vfs.ffs.adjblkcnt", adjblkcnt, &size) < 0|| + sysctlnametomib("vfs.ffs.setsize", setsize, &size) < 0 || sysctlnametomib("vfs.ffs.freefiles", freefiles, &size) < 0|| sysctlnametomib("vfs.ffs.freedirs", freedirs, &size) < 0 || sysctlnametomib("vfs.ffs.freeblks", freeblks, &size) < 0) { Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Mon Feb 25 19:47:27 2019 (r344551) +++ head/sbin/fsdb/fsdb.c Mon Feb 25 21:58:19 2019 (r344552) @@ -157,6 +157,7 @@ CMDFUNC(chctime); /* Change ctime */ CMDFUNC(chatime); /* Change atime */ CMDFUNC(chinum); /* Change inode # of dirent */ CMDFUNC(chname); /* Change dirname of dirent */ +CMDFUNC(chsize); /* Change size */ struct cmdtable cmds[] = { { "help", "Print out help", 1, 1, FL_RO, helpfn }, @@ -186,6 +187,7 @@ struct cmdtable cmds[] = { { "chgrp", "Change group of current inode to GROUP", 2, 2, FL_WR, chgroup }, { "chflags", "Change flags of current inode to FLAGS", 2, 2, FL_WR, chaflags }, { "chgen", "Change generation number of current inode to GEN", 2, 2, FL_WR, chgen }, + { "chsize", "Change size of current inode to SIZE", 2, 2, FL_WR, chsize }, { "btime", "Change btime of current inode to BTIME", 2, 2, FL_WR, chbtime }, { "mtime", "Change mtime of current inode to MTIME", 2, 2, FL_WR, chmtime }, { "ctime", "Change ctime of current inode to CTIME", 2, 2, FL_WR, chctime }, @@ -1012,6 +1014,31 @@ CMDFUNCSTART(chgen) return(1); } DIP_SET(curinode, di_gen, gen); + inodirty(curinode); + printactive(0); + return rval; +} + +CMDFUNCSTART(chsize) +{ + int rval = 1; + off_t size; + char *cp; + + if (!checkactive()) + return 1; + + size = strtoll(argv[1], &cp, 0); + if (cp == argv[1] || *cp != '\0') { + warnx("bad size `%s'", argv[1]); + return 1; + } + + if (size < 0) { + warnx("size set to negative (%jd)\n", (intmax_t)size); + return(1); + } + DIP_SET(curinode, di_size, size); inodirty(curinode); printactive(0); return rval; Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Feb 25 19:47:27 2019 (r344551) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Feb 25 21:58:19 2019 (r344552) @@ -3037,6 +3037,8 @@ ffs_fserr(fs, inum, cp) * the count to zero will cause the inode to be freed. * adjblkcnt(inode, amt) - adjust the number of blocks used by the * inode by the specified amount. + * adjsize(inode, size) - set the size of the inode to the + * specified size. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - * adjust the superblock summary. * freedirs(inode, count) - directory inodes [inode..inode + count - 1] @@ -3078,6 +3080,9 @@ SYSCTL_PROC(_vfs_ffs, FFS_ADJ_REFCNT, adjrefcnt, CTLFL static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, CTLFLAG_WR, sysctl_ffs_fsck, "Adjust Inode Used Blocks Count"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, CTLFLAG_WR, + sysctl_ffs_fsck, "Set the inode size"); + static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NDIR, adjndir, CTLFLAG_WR, sysctl_ffs_fsck, "Adjust number of directories"); @@ -3225,6 +3230,23 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; ip = VTOI(vp); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + cmd.size); + ip->i_flag |= IN_CHANGE | IN_MODIFIED; + error = ffs_update(vp, 1); + vput(vp); + break; + + case FFS_SET_SIZE: +#ifdef DEBUG + if (fsckcmds) { + printf("%s: set inode %jd size to %jd\n", + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + (intmax_t)cmd.size); + } +#endif /* DEBUG */ + if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) + break; + ip = VTOI(vp); + DIP_SET(ip, i_size, cmd.size); ip->i_flag |= IN_CHANGE | IN_MODIFIED; error = ffs_update(vp, 1); vput(vp); Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Mon Feb 25 19:47:27 2019 (r344551) +++ head/sys/ufs/ffs/fs.h Mon Feb 25 21:58:19 2019 (r344552) @@ -221,7 +221,8 @@ #define FFS_UNLINK 14 /* remove a name in the filesystem */ #define FFS_SET_INODE 15 /* update an on-disk inode */ #define FFS_SET_BUFOUTPUT 16 /* set buffered writing on descriptor */ -#define FFS_MAXID 16 /* number of valid ffs ids */ +#define FFS_SET_SIZE 17 /* set inode size */ +#define FFS_MAXID 17 /* number of valid ffs ids */ /* * Command structure passed in to the filesystem to adjust filesystem values. From owner-svn-src-head@freebsd.org Mon Feb 25 21:59:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88D1315172BE; Mon, 25 Feb 2019 21:59:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 255F083C96; Mon, 25 Feb 2019 21:59:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17B3B2319A; Mon, 25 Feb 2019 21:59:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PLx1av031755; Mon, 25 Feb 2019 21:59:01 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PLx17s031752; Mon, 25 Feb 2019 21:59:01 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201902252159.x1PLx17s031752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 25 Feb 2019 21:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344553 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 344553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 255F083C96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 21:59:02 -0000 Author: dab Date: Mon Feb 25 21:59:01 2019 New Revision: 344553 URL: https://svnweb.freebsd.org/changeset/base/344553 Log: asmc: Add support for Mac mini 2,1 PR: 235798 Submitted by: Trev Reported by: Trev MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Feb 25 21:58:19 2019 (r344552) +++ head/sys/dev/asmc/asmc.c Mon Feb 25 21:59:01 2019 (r344553) @@ -259,6 +259,15 @@ struct asmc_model asmc_models[] = { ASMC_MM_TEMPS, ASMC_MM_TEMPNAMES, ASMC_MM_TEMPDESCS }, + /* The Mac Mini 2,1 has no SMS */ + { + "Macmini2,1", "Apple SMC Mac Mini 2,1", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS, + ASMC_LIGHT_FUNCS_DISABLED, + ASMC_MM21_TEMPS, ASMC_MM21_TEMPNAMES, ASMC_MM21_TEMPDESCS + }, + /* The Mac Mini 3,1 has no SMS */ { "Macmini3,1", "Apple SMC Mac Mini 3,1", Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Mon Feb 25 21:58:19 2019 (r344552) +++ head/sys/dev/asmc/asmcvar.h Mon Feb 25 21:59:01 2019 (r344553) @@ -341,6 +341,24 @@ struct asmc_softc { #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ "Northbridge Point 2" } +#define ASMC_MM21_TEMPS { "TA0P", "TC0D", \ + "TC0H", "TC0P", \ + "TC1P", "TN0P", \ + "TN1P", NULL } + +#define ASMC_MM21_TEMPNAMES { "ambient_air", "cpu_die", \ + "cpu_heatsink", "cpu_proximity1", \ + "cpu_proximity2", "northbridge_proximity1", \ + "northbridge_proximity2", } + +#define ASMC_MM21_TEMPDESCS { "Ambient Air Temperature" \ + "CPU Die Core Temperature", \ + "CPU Heatsink Temperature", \ + "CPU Proximity 1 Temperature", \ + "CPU Proximity 2 Temperature", \ + "Northbridge Proximity 1 Temperature", \ + "Northbridge Proximity 2 Temperature", } + #define ASMC_MM31_TEMPS { "TC0D", "TC0H", \ "TC0P", "TH0P", \ "TN0D", "TN0P", \ From owner-svn-src-head@freebsd.org Mon Feb 25 22:11:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D381517741; Mon, 25 Feb 2019 22:11:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5065284456; Mon, 25 Feb 2019 22:11:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43088234DB; Mon, 25 Feb 2019 22:11:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PMBjCF040791; Mon, 25 Feb 2019 22:11:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PMBjwJ040790; Mon, 25 Feb 2019 22:11:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902252211.x1PMBjwJ040790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 25 Feb 2019 22:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344554 - head X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 344554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5065284456 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 22:11:45 -0000 Author: dim Date: Mon Feb 25 22:11:44 2019 New Revision: 344554 URL: https://svnweb.freebsd.org/changeset/base/344554 Log: After r344530, remove leading slashes from libprivateifconfig lines in ObsoleteFiles.inc. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Feb 25 21:59:01 2019 (r344553) +++ head/ObsoleteFiles.inc Mon Feb 25 22:11:44 2019 (r344554) @@ -39,8 +39,8 @@ # done # 20190222: libifconfig made INTERNALLIB -OLD_FILES+=/usr/lib/libprivateifconfig.a -OLD_FILES+=/usr/lib/libprivateifconfig_p.a +OLD_FILES+=usr/lib/libprivateifconfig.a +OLD_FILES+=usr/lib/libprivateifconfig_p.a # 20190131: pfil(9) changed OLD_FILES+=usr/share/man/man9/pfil_hook_get.9 OLD_FILES+=usr/share/man/man9/pfil_rlock.9 From owner-svn-src-head@freebsd.org Mon Feb 25 23:45:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62876151960D; Mon, 25 Feb 2019 23:45:37 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF7C687BF9; Mon, 25 Feb 2019 23:45:36 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC9B9244D4; Mon, 25 Feb 2019 23:45:36 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PNja6i091019; Mon, 25 Feb 2019 23:45:36 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PNjadM091018; Mon, 25 Feb 2019 23:45:36 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201902252345.x1PNjadM091018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 25 Feb 2019 23:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344555 - head/usr.sbin/makefs X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/usr.sbin/makefs X-SVN-Commit-Revision: 344555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF7C687BF9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 23:45:37 -0000 Author: sobomax Date: Mon Feb 25 23:45:36 2019 New Revision: 344555 URL: https://svnweb.freebsd.org/changeset/base/344555 Log: Improve error handling: bail out if one of the files scheduled to go to the FS image we are making cannot be read (e.g. EPERM). Current behaviour when we issue waring but still proceeed and return success is definitely not correct: masking out error condition as well as making a slighly inconsistent FS where attempt to access the file in question ends up in EBADF. See linked DR for details. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18584 Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Mon Feb 25 22:11:44 2019 (r344554) +++ head/usr.sbin/makefs/ffs.c Mon Feb 25 23:45:36 2019 (r344555) @@ -932,8 +932,7 @@ ffs_write_file(union dinode *din, uint32_t ino, void * if (isfile) { fbuf = emalloc(ffs_opts->bsize); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { - warn("Can't open `%s' for reading", (char *)buf); - goto leave_ffs_write_file; + err(EXIT_FAILURE, "Can't open `%s' for reading", (char *)buf); } } else { p = buf; @@ -987,8 +986,6 @@ ffs_write_file(union dinode *din, uint32_t ino, void * write_inode_and_leave: ffs_write_inode(&in.i_din, in.i_number, fsopts); - - leave_ffs_write_file: if (fbuf) free(fbuf); if (ffd != -1) From owner-svn-src-head@freebsd.org Mon Feb 25 23:49:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 963A91519768; Mon, 25 Feb 2019 23:49:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C02687F4F; Mon, 25 Feb 2019 23:49:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03ADD244DA; Mon, 25 Feb 2019 23:49:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1PNnwIh091371; Mon, 25 Feb 2019 23:49:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1PNnwRJ091370; Mon, 25 Feb 2019 23:49:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902252349.x1PNnwRJ091370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 25 Feb 2019 23:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344556 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 344556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C02687F4F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 25 Feb 2019 23:49:59 -0000 Author: ian Date: Mon Feb 25 23:49:58 2019 New Revision: 344556 URL: https://svnweb.freebsd.org/changeset/base/344556 Log: Set maximum bus clock speed from hints when attaching hinted spibus(4) children. Some devices (such as spigen(4)) document that this works, but it appears that the code to implement it never got added. Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Mon Feb 25 23:45:36 2019 (r344555) +++ head/sys/dev/spibus/spibus.c Mon Feb 25 23:49:58 2019 (r344556) @@ -216,6 +216,7 @@ spibus_hinted_child(device_t bus, const char *dname, i child = BUS_ADD_CHILD(bus, 0, dname, dunit); devi = SPIBUS_IVAR(child); devi->mode = SPIBUS_MODE_NONE; + resource_int_value(dname, dunit, "clock", &devi->clock); resource_int_value(dname, dunit, "cs", &devi->cs); resource_int_value(dname, dunit, "mode", &devi->mode); } From owner-svn-src-head@freebsd.org Tue Feb 26 01:11:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC049151C1AD; Tue, 26 Feb 2019 01:11:47 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (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 6AB718B4D3; Tue, 26 Feb 2019 01:11:47 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-lf1-f65.google.com with SMTP id h10so8333348lfc.12; Mon, 25 Feb 2019 17:11:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rowckl2RJ9Z86KhzfrQeb5He+BoaFo9YslSFWZLwlmY=; b=EeAy/A+PoXgCGh3p0amzu7++ZGzu8nEEvX4SGAj0W3YRnOXumOZeKBBM3wlXVyH0V5 PVdDwYM3k0mADWe4fzcst4WwHNJn3XoMfdBaydk/yFzWXfx6NszdfGhQfng+LWbNQ/kY 1z5zyxKvMoJ4QqL1pYkY0y+bRbWfT1qlnxxx67wqsKnUMADZmTtvS0RYCM3NwNQyrvs2 Igk32ES6YP+oHkarGCDGHXHc1SXYtJz4Tcu2Q/ZAADFPXltl1KEbmUqFqyvYJTi+4gNr wd9ZbKQ8bph+GG4C6urygMgphPYXihHMI0SgBb0+V0alzPpKo9ZlN7k9r5263GESCdGN 58Gw== X-Gm-Message-State: AHQUAuY846CEMnUicVINFPuh3hiX4PJbSVi39Xmb3Qe4z4arYifErZEj w03FDXp4i76LtPqui+U/fGDCRvwjPsfh3LWcqGas+fyf X-Google-Smtp-Source: AHgI3IbhJqNfo5N8Q66J8VRea/6gSt/Fb8c0Gl+TxH4fth1lPe3gBtwd7m90lt0C2W4z9IjZ7f7ZkHo9RAzTwEhUHjg= X-Received: by 2002:a19:c90d:: with SMTP id z13mr10928755lff.126.1551143498465; Mon, 25 Feb 2019 17:11:38 -0800 (PST) MIME-Version: 1.0 References: <201902232114.x1NLE0cH085345@repo.freebsd.org> <20190225175809.GB47081@spindle.one-eyed-alien.net> In-Reply-To: <20190225175809.GB47081@spindle.one-eyed-alien.net> From: "K. Macy" Date: Mon, 25 Feb 2019 17:11:26 -0800 Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: Brooks Davis Cc: Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 6AB718B4D3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.88 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.88)[-0.880,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 01:11:48 -0000 > We had a brief discussion of this commit within a subset of core. This > addition of GPLv2 code is fine as the code is easily removal to a module > (per kmoore@) should the day come that we're read to evict all GPL code. I don't execute the ctors until coverage is enabled because I have to manually find the symbols. The linker doesn't actually generate a ctor section for functions in text.startup in spite of what Juniper's linker commit would lead one to believe - presumably they have a private linker script in addition to a private gcov port. Thus, it really could just work fine as a module. Nonetheless, everything to be profiled needs to be compiled with instrumentation, so separating it out makes very little sense to me. Although, I suppose ctfconvert + dtrace module is somewhat analogous. > The modest increase in activation energy for that task seems worth it > for the short-term gains of reduced integration cost (this code will > greatly improve our ZFS-on-Linux test coverage.) > > Rod rightly points out that we haven't accepted SPDX tags alone as > license statements. The standard GPL v2.0 boiler plate should be added > to this file along side the tag. I've copied the full copyright attribution that is in the corresponding files on Linux. Is there some reason why FreeBSD requires the files to be inflated with the full license text where the original lacks it? > > An additional issue is that the a warning tag was not added to > sys/conf/files. A warning along the lines of: > > warning "kernel contains GPLv2 licensed GCOV" > > needs to be added. Yup. > > This commit needed more through review. How would this be achieved:? I had several people on the review and no one had substantive feedback. > > We intend to update our license policy to require core sign off for > new GPL code to ensure we're not adding new, tightly integrated > dependencies, to document that we're doing so knowingly, and > to make sure steps aren't missed. The current document is at: > https://www.freebsd.org/internal/software-license.html -M From owner-svn-src-head@freebsd.org Tue Feb 26 02:18:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E11B15004A4; Tue, 26 Feb 2019 02:18: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 9D0EA900B4; Tue, 26 Feb 2019 02:18:47 +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 x1Q2IgkV042693; Mon, 25 Feb 2019 18:18:42 -0800 (PST) (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 x1Q2Ig4r042692; Mon, 25 Feb 2019 18:18:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: To: "K. Macy" Date: Mon, 25 Feb 2019 18:18:42 -0800 (PST) CC: Brooks Davis , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 9D0EA900B4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 02:18:48 -0000 > > The modest increase in activation energy for that task seems worth it > > for the short-term gains of reduced integration cost (this code will > > greatly improve our ZFS-on-Linux test coverage.) > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > license statements. The standard GPL v2.0 boiler plate should be added > > to this file along side the tag. > > I've copied the full copyright attribution that is in the > corresponding files on Linux. Is there some reason why FreeBSD > requires the files to be inflated with the full license text where the > original lacks it? I think for a few reasons, I doubt you copied the whole distribution that this file came from, as I am sure that distribution included a LICENSE file. Second if you actually read the GPL v2 documentation and follow what it says it says you must do this, just because some one else does not follow the rules of what the GPL v2 says does not give us to knowingling not do it. Third this is a particular dangerious area for BSD to be mixing a GPL code with its kernel, to my knowlege we have never had any gpl code in the kernel, no have we ever allowed it, but thats a seperate argument, that should be made. > > An additional issue is that the a warning tag was not added to > > sys/conf/files. A warning along the lines of: > > > > warning "kernel contains GPLv2 licensed GCOV" > > > > needs to be added. > > Yup. Thanks > > > > This commit needed more through review. > > How would this be achieved:? I had several people on the review and no > one had substantive feedback. I have very seriuos concerns how you can even make that comment now given that ngie@ pointed out during the review that this GPL code and you dismissed it as a non issue. This shows lack of knowlege as to the projects GPL goals, and lack of concern that you might of wanted to ask first, rather than now have to deal with it post commit. When ngie@ pointed out an issue you could of posted to a list with your review asking for more people. Everyone should strive to find reviewers, if the patch doesn't trigger enough herard rules (which we should also work on, but seems the phabricator admins are deaf or non existance as multiple requests go unanswered), it is very easy to go drop a link to your review in an appropriate mailling list -current being choice of last resort. If you do that I am pretty sure you'll get plenty of feedback. > > > > > We intend to update our license policy to require core sign off for > > new GPL code to ensure we're not adding new, tightly integrated > > dependencies, to document that we're doing so knowingly, and > > to make sure steps aren't missed. The current document is at: > > https://www.freebsd.org/internal/software-license.html Given the high push in the last few years to be GPL free, and that being well publically aired at conferences and in commit mail as we try to achive that goal I can not see why here do we need to add policy for what really should be common knowledge, yet in areas that we clearly do not follow or have policy there seems to be no reason what so ever to fix what we dont follow or add what we do want. IMHO, this commit should be a huge red flag, we seem to have a problem Houston, in communications! > -M -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 03:34:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29CE41505C1B; Tue, 26 Feb 2019 03:34:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5A4A951BE; Tue, 26 Feb 2019 03:34:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A90E227196; Tue, 26 Feb 2019 03:34:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q3YmdV014063; Tue, 26 Feb 2019 03:34:48 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q3YlKN014060; Tue, 26 Feb 2019 03:34:47 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201902260334.x1Q3YlKN014060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Feb 2019 03:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344559 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 344559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5A4A951BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 03:34:49 -0000 Author: asomers Date: Tue Feb 26 03:34:47 2019 New Revision: 344559 URL: https://svnweb.freebsd.org/changeset/base/344559 Log: ifconfig: eliminate trailing whitespace Eliminate trailing whitespace on inet, inet6, and groups lines. I think the "list txpower" command will still show some, but I'm not able to test that. PR: 153731 Reported-by: Nikolay Denev MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19004 Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifgroup.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Tue Feb 26 03:28:14 2019 (r344558) +++ head/sbin/ifconfig/af_inet.c Tue Feb 26 03:34:47 2019 (r344559) @@ -107,16 +107,16 @@ in_status(int s __unused, const struct ifaddrs *ifa) if (cidr == 0) break; } - printf("/%d ", cidr); + printf("/%d", cidr); } else if (f_inet != NULL && strcmp(f_inet, "dotted") == 0) - printf(" netmask %s ", inet_ntoa(sin->sin_addr)); + printf(" netmask %s", inet_ntoa(sin->sin_addr)); else - printf(" netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); + printf(" netmask 0x%lx", (unsigned long)ntohl(sin->sin_addr.s_addr)); if (ifa->ifa_flags & IFF_BROADCAST) { sin = (struct sockaddr_in *)ifa->ifa_broadaddr; if (sin != NULL && sin->sin_addr.s_addr != 0) - printf("broadcast %s ", inet_ntoa(sin->sin_addr)); + printf(" broadcast %s", inet_ntoa(sin->sin_addr)); } print_vhid(ifa, " "); Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Tue Feb 26 03:28:14 2019 (r344558) +++ head/sbin/ifconfig/af_inet6.c Tue Feb 26 03:34:47 2019 (r344559) @@ -247,49 +247,49 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if (sin == NULL) sin = &null_sin; if (f_inet6 != NULL && strcmp(f_inet6, "cidr") == 0) - printf("/%d ", prefix(&sin->sin6_addr, + printf("/%d", prefix(&sin->sin6_addr, sizeof(struct in6_addr))); else - printf(" prefixlen %d ", prefix(&sin->sin6_addr, + printf(" prefixlen %d", prefix(&sin->sin6_addr, sizeof(struct in6_addr))); if ((flags6 & IN6_IFF_ANYCAST) != 0) - printf("anycast "); + printf(" anycast"); if ((flags6 & IN6_IFF_TENTATIVE) != 0) - printf("tentative "); + printf(" tentative"); if ((flags6 & IN6_IFF_DUPLICATED) != 0) - printf("duplicated "); + printf(" duplicated"); if ((flags6 & IN6_IFF_DETACHED) != 0) - printf("detached "); + printf(" detached"); if ((flags6 & IN6_IFF_DEPRECATED) != 0) - printf("deprecated "); + printf(" deprecated"); if ((flags6 & IN6_IFF_AUTOCONF) != 0) - printf("autoconf "); + printf(" autoconf"); if ((flags6 & IN6_IFF_TEMPORARY) != 0) - printf("temporary "); + printf(" temporary"); if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0) - printf("prefer_source "); + printf(" prefer_source"); if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) - printf("scopeid 0x%x ", + printf(" scopeid 0x%x", ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { - printf("pltime "); + printf(" pltime"); if (lifetime.ia6t_preferred) { - printf("%s ", lifetime.ia6t_preferred < now.tv_sec + printf(" %s", lifetime.ia6t_preferred < now.tv_sec ? "0" : sec2str(lifetime.ia6t_preferred - now.tv_sec)); } else - printf("infty "); + printf(" infty"); - printf("vltime "); + printf(" vltime"); if (lifetime.ia6t_expire) { - printf("%s ", lifetime.ia6t_expire < now.tv_sec + printf(" %s", lifetime.ia6t_expire < now.tv_sec ? "0" : sec2str(lifetime.ia6t_expire - now.tv_sec)); } else - printf("infty "); + printf(" infty"); } print_vhid(ifa, " "); Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Feb 26 03:28:14 2019 (r344558) +++ head/sbin/ifconfig/ifconfig.c Tue Feb 26 03:34:47 2019 (r344559) @@ -1405,7 +1405,7 @@ print_vhid(const struct ifaddrs *ifa, const char *s) if (ifd->ifi_vhid == 0) return; - printf("vhid %d ", ifd->ifi_vhid); + printf(" vhid %d", ifd->ifi_vhid); } void Modified: head/sbin/ifconfig/ifgroup.c ============================================================================== --- head/sbin/ifconfig/ifgroup.c Tue Feb 26 03:28:14 2019 (r344558) +++ head/sbin/ifconfig/ifgroup.c Tue Feb 26 03:34:47 2019 (r344559) @@ -113,9 +113,9 @@ getifgroups(int s) len -= sizeof(struct ifg_req); if (strcmp(ifg->ifgrq_group, "all")) { if (cnt == 0) - printf("\tgroups: "); + printf("\tgroups:"); cnt++; - printf("%s ", ifg->ifgrq_group); + printf(" %s", ifg->ifgrq_group); } } if (cnt) From owner-svn-src-head@freebsd.org Tue Feb 26 03:37:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 078CD1505E64; Tue, 26 Feb 2019 03:37:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FFD79548F; Tue, 26 Feb 2019 03:37:13 +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 91D66271A7; Tue, 26 Feb 2019 03:37:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q3bD10014279; Tue, 26 Feb 2019 03:37:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q3bDcw014277; Tue, 26 Feb 2019 03:37:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201902260337.x1Q3bDcw014277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 26 Feb 2019 03:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344560 - head/stand/efi/loader/arch/i386 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/loader/arch/i386 X-SVN-Commit-Revision: 344560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FFD79548F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 03:37:14 -0000 Author: kevans Date: Tue Feb 26 03:37:12 2019 New Revision: 344560 URL: https://svnweb.freebsd.org/changeset/base/344560 Log: stand: Remove unused i386 EFI MD bits r328169 removed the copy of bootinfo that would've made this somewhat functional. However, this is irrelevant- earlier work in r292338 was done to exit boot services in the MI bi_load() rather than having N copies of the GetMemoryMap/ExitBootServices dance. i386 never quite caught up to that; ldr_enter was still being called but the prereq for that, ldr_bootinfo, was no longer. As a consequence, this ExitBootServices() was being called with a mapkey=0, clearly bogus, and reportedly breaking the boot in some instances. Reported by: bcran MFC after: 1 week Deleted: head/stand/efi/loader/arch/i386/efimd.c Modified: head/stand/efi/loader/arch/i386/Makefile.inc head/stand/efi/loader/arch/i386/elf32_freebsd.c Modified: head/stand/efi/loader/arch/i386/Makefile.inc ============================================================================== --- head/stand/efi/loader/arch/i386/Makefile.inc Tue Feb 26 03:34:47 2019 (r344559) +++ head/stand/efi/loader/arch/i386/Makefile.inc Tue Feb 26 03:37:12 2019 (r344560) @@ -1,7 +1,6 @@ # $FreeBSD$ SRCS+= start.S \ - efimd.c \ elf32_freebsd.c \ exec.c Modified: head/stand/efi/loader/arch/i386/elf32_freebsd.c ============================================================================== --- head/stand/efi/loader/arch/i386/elf32_freebsd.c Tue Feb 26 03:34:47 2019 (r344559) +++ head/stand/efi/loader/arch/i386/elf32_freebsd.c Tue Feb 26 03:37:12 2019 (r344560) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); extern void __exec(caddr_t addr, ...); extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); -extern int ldr_enter(const char *kernel); static int elf32_exec(struct preloaded_file *amp); static int elf32_obj_exec(struct preloaded_file *amp); @@ -84,8 +83,6 @@ elf32_exec(struct preloaded_file *fp) entry = ehdr->e_entry & 0xffffff; printf("Start @ 0x%x ...\n", entry); - - ldr_enter(fp->f_name); dev_cleanup(); __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, kernend); From owner-svn-src-head@freebsd.org Tue Feb 26 04:50:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F371509E0B; Tue, 26 Feb 2019 04:50:51 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19D5F6859F; Tue, 26 Feb 2019 04:50:51 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B74627ED9; Tue, 26 Feb 2019 04:50:47 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q4olLW052065; Tue, 26 Feb 2019 04:50:47 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q4oleP052064; Tue, 26 Feb 2019 04:50:47 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201902260450.x1Q4oleP052064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Tue, 26 Feb 2019 04:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344561 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 344561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19D5F6859F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 04:50:51 -0000 Author: jah Date: Tue Feb 26 04:50:46 2019 New Revision: 344561 URL: https://svnweb.freebsd.org/changeset/base/344561 Log: Fix incorrect assertion in vnode_pager_generic_getpages() Reviewed by: kib, glebius MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Feb 26 03:37:12 2019 (r344560) +++ head/sys/vm/vnode_pager.c Tue Feb 26 04:50:46 2019 (r344561) @@ -793,7 +793,7 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page KASSERT(foff < object->un_pager.vnp.vnp_size, ("%s: page %p offset beyond vp %p size", __func__, m[0], vp)); - KASSERT(count <= sizeof(bp->b_pages), + KASSERT(count <= nitems(bp->b_pages), ("%s: requested %d pages", __func__, count)); /* From owner-svn-src-head@freebsd.org Tue Feb 26 04:56:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4A01150A1CF; Tue, 26 Feb 2019 04:56:10 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8551C69FAC; Tue, 26 Feb 2019 04:56:10 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 769A4CB; Tue, 26 Feb 2019 04:56:10 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q4uAZF056383; Tue, 26 Feb 2019 04:56:10 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q4uAIu056382; Tue, 26 Feb 2019 04:56:10 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201902260456.x1Q4uAIu056382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Tue, 26 Feb 2019 04:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344562 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 344562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8551C69FAC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 04:56:11 -0000 Author: jah Date: Tue Feb 26 04:56:10 2019 New Revision: 344562 URL: https://svnweb.freebsd.org/changeset/base/344562 Log: FFS: allow sendfile(2) to work with block sizes greater than the page size Implement ffs_getpages_async(), which when possible calls the asynchronous flavor of the generic pager's getpages function. When the underlying block size is larger than the system page size, however, it will invoke the (synchronous) buffer cache pager, followed by a call to the client completion routine. This retains true asynchronous completion in the most common (block size <= page size) case, which is important for the performance of the new sendfile(2). The behavior in the larger block size case mirrors the default implementation of VOP_GETPAGES_ASYNC, which most other filesystems use anyway as they do not override the getpages_async method. PR: 235708 Reported by: pho Reviewed by: kib, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19340 Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Tue Feb 26 04:50:46 2019 (r344561) +++ head/sys/ufs/ffs/ffs_vnops.c Tue Feb 26 04:56:10 2019 (r344562) @@ -111,6 +111,7 @@ extern int ffs_rawread(struct vnode *vp, struct uio *u static vop_fdatasync_t ffs_fdatasync; static vop_fsync_t ffs_fsync; static vop_getpages_t ffs_getpages; +static vop_getpages_async_t ffs_getpages_async; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -132,7 +133,7 @@ struct vop_vector ffs_vnodeops1 = { .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, .vop_getpages = ffs_getpages, - .vop_getpages_async = vnode_pager_local_getpages_async, + .vop_getpages_async = ffs_getpages_async, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -154,7 +155,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, .vop_getpages = ffs_getpages, - .vop_getpages_async = vnode_pager_local_getpages_async, + .vop_getpages_async = ffs_getpages_async, .vop_lock1 = ffs_lock, .vop_read = ffs_read, .vop_reallocblks = ffs_reallocblks, @@ -1742,3 +1743,25 @@ ffs_getpages(struct vop_getpages_args *ap) return (vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind, ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz)); } + +static int +ffs_getpages_async(struct vop_getpages_async_args *ap) +{ + struct vnode *vp; + struct ufsmount *um; + int error; + + vp = ap->a_vp; + um = VFSTOUFS(vp->v_mount); + + if (um->um_devvp->v_bufobj.bo_bsize <= PAGE_SIZE) + return (vnode_pager_generic_getpages(vp, ap->a_m, ap->a_count, + ap->a_rbehind, ap->a_rahead, ap->a_iodone, ap->a_arg)); + + error = vfs_bio_getpages(vp, ap->a_m, ap->a_count, ap->a_rbehind, + ap->a_rahead, ffs_gbp_getblkno, ffs_gbp_getblksz); + ap->a_iodone(ap->a_arg, ap->a_m, ap->a_count, error); + + return (error); +} + From owner-svn-src-head@freebsd.org Tue Feb 26 05:46:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53B4D150C2E4; Tue, 26 Feb 2019 05:46:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id B78786C5EC; Tue, 26 Feb 2019 05:46:43 +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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id F2FB310555F4; Tue, 26 Feb 2019 16:46:40 +1100 (AEDT) Date: Tue, 26 Feb 2019 16:46:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Jason A. Harmening" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344562 - head/sys/ufs/ffs In-Reply-To: <201902260456.x1Q4uAIu056382@repo.freebsd.org> Message-ID: <20190226162300.M1437@besplex.bde.org> References: <201902260456.x1Q4uAIu056382@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=P1rLNQFAf2zFqKBdL3UA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: B78786C5EC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.83 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.83)[-0.833,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 05:46:44 -0000 On Tue, 26 Feb 2019, Jason A. Harmening wrote: > ... > Log: > FFS: allow sendfile(2) to work with block sizes greater than the page size > > Implement ffs_getpages_async(), which when possible calls the asynchronous > flavor of the generic pager's getpages function. When the underlying > block size is larger than the system page size, however, it will invoke > the (synchronous) buffer cache pager, followed by a call to the client > completion routine. This retains true asynchronous completion in the most > common (block size <= page size) case, which is important for the performance > of the new sendfile(2). The behavior in the larger block size case mirrors > the default implementation of VOP_GETPAGES_ASYNC, which most other > filesystems use anyway as they do not override the getpages_async method. block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with large pages. MINBSIZE is 4096 in ffs (except in my version, it is 512). The default is 32768 in newfs. I consider this excessive and only use it for file systems with many files larger than 1GB, but it is the most common size. It is larger than the large page size of 8192. ffs_getpages() already has an almost-never-used special case for small block sizes. It uses vnode_pager_generic_getpages() when !use_buf_pager and the block_size <= PAGE_SIZE, else vfs_bio_getpages(). But block_size <= PAGE_SIZE is unusual, and !use_buf_pager is also unusual, and use_buf_pager is mostly a debugging sysctl, so little would be lost but using vfs_bio_getpages() unconditionally. Bruce From owner-svn-src-head@freebsd.org Tue Feb 26 05:59:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8666150C650; Tue, 26 Feb 2019 05:59:24 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 576646CBDB; Tue, 26 Feb 2019 05:59:24 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440AEB50; Tue, 26 Feb 2019 05:59:24 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q5xOj9088415; Tue, 26 Feb 2019 05:59:24 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q5xNb1088410; Tue, 26 Feb 2019 05:59:23 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201902260559.x1Q5xNb1088410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 26 Feb 2019 05:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344564 - in head: contrib/bearssl contrib/bearssl/tools lib/libbearssl X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bearssl contrib/bearssl/tools lib/libbearssl X-SVN-Commit-Revision: 344564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 576646CBDB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 05:59:25 -0000 Author: sjg Date: Tue Feb 26 05:59:22 2019 New Revision: 344564 URL: https://svnweb.freebsd.org/changeset/base/344564 Log: Add libbearssl Disabled by default, used by loader and sbin/veriexec Reviewed by: emaste Sponsored by: Juniper Networks Differential Revision: D16334 Added: head/contrib/bearssl/ - copied from r343285, vendor/bearssl/dist/ head/lib/libbearssl/ head/lib/libbearssl/Makefile (contents, props changed) head/lib/libbearssl/Makefile.depend (contents, props changed) head/lib/libbearssl/Makefile.inc (contents, props changed) head/lib/libbearssl/Makefile.libsa.inc (contents, props changed) Modified: head/contrib/bearssl/tools/brssl.h head/contrib/bearssl/tools/xmem.c Modified: head/contrib/bearssl/tools/brssl.h ============================================================================== --- vendor/bearssl/dist/tools/brssl.h Mon Jan 21 20:58:33 2019 (r343285) +++ head/contrib/bearssl/tools/brssl.h Tue Feb 26 05:59:22 2019 (r344564) @@ -25,10 +25,15 @@ #ifndef BRSSL_H__ #define BRSSL_H__ +#ifndef _STANDALONE #include #include #include #include + +#elif !defined(STAND_H) +#include +#endif #include "bearssl.h" Modified: head/contrib/bearssl/tools/xmem.c ============================================================================== --- vendor/bearssl/dist/tools/xmem.c Mon Jan 21 20:58:33 2019 (r343285) +++ head/contrib/bearssl/tools/xmem.c Tue Feb 26 05:59:22 2019 (r344564) @@ -35,9 +35,13 @@ xmalloc(size_t len) } buf = malloc(len); if (buf == NULL) { +#ifndef _STANDALONE fprintf(stderr, "ERROR: could not allocate %lu byte(s)\n", (unsigned long)len); exit(EXIT_FAILURE); +#else +; +#endif } return buf; } @@ -90,9 +94,13 @@ xpkeydup(const br_x509_pkey *pk) pk2->key.ec.qlen = pk->key.ec.qlen; break; default: +#ifndef _STANDALONE fprintf(stderr, "Unknown public key type: %u\n", (unsigned)pk->key_type); exit(EXIT_FAILURE); +#else +; +#endif } return pk2; } @@ -111,9 +119,13 @@ xfreepkey(br_x509_pkey *pk) xfree(pk->key.ec.q); break; default: +#ifndef _STANDALONE fprintf(stderr, "Unknown public key type: %u\n", (unsigned)pk->key_type); exit(EXIT_FAILURE); +#else +; +#endif } xfree(pk); } Added: head/lib/libbearssl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbearssl/Makefile Tue Feb 26 05:59:22 2019 (r344564) @@ -0,0 +1,277 @@ +# $FreeBSD$ + +# This is a reach over build of BearSSL (www.BearSSL.org) + +.include + +LIB= bearssl + +# pick up SRCS used by libsa +.include "Makefile.libsa.inc" + +SRCS+= \ + codec/dec16be.c \ + codec/dec16le.c \ + codec/dec32le.c \ + codec/dec64le.c \ + codec/enc16be.c \ + codec/enc16le.c \ + codec/enc32le.c \ + codec/enc64le.c \ + codec/pemenc.c \ + ec/ec_all_m15.c \ + ec/ec_c25519_i15.c \ + ec/ec_c25519_i31.c \ + ec/ec_c25519_m15.c \ + ec/ec_curve25519.c \ + ec/ec_keygen.c \ + ec/ec_p256_m15.c \ + ec/ec_prime_i15.c \ + ec/ecdsa_default_sign_asn1.c \ + ec/ecdsa_default_sign_raw.c \ + ec/ecdsa_default_vrfy_raw.c \ + ec/ecdsa_i15_bits.c \ + ec/ecdsa_i15_sign_asn1.c \ + ec/ecdsa_i15_sign_raw.c \ + ec/ecdsa_i15_vrfy_asn1.c \ + ec/ecdsa_i15_vrfy_raw.c \ + ec/ecdsa_i31_sign_asn1.c \ + ec/ecdsa_i31_sign_raw.c \ + ec/ecdsa_rta.c \ + hash/dig_oid.c \ + hash/dig_size.c \ + hash/ghash_ctmul.c \ + hash/ghash_ctmul32.c \ + hash/ghash_ctmul64.c \ + hash/ghash_pwr8.c \ + hash/md5.c \ + hash/md5sha1.c \ + + +# this one does not compile for amd64 +# we do not need it +# hash/ghash_pclmul.c \ + +SRCS+= \ + int/i15_add.c \ + int/i15_bitlen.c \ + int/i15_decmod.c \ + int/i15_decode.c \ + int/i15_decred.c \ + int/i15_encode.c \ + int/i15_fmont.c \ + int/i15_iszero.c \ + int/i15_moddiv.c \ + int/i15_modpow.c \ + int/i15_modpow2.c \ + int/i15_montmul.c \ + int/i15_mulacc.c \ + int/i15_muladd.c \ + int/i15_ninv15.c \ + int/i15_reduce.c \ + int/i15_rshift.c \ + int/i15_sub.c \ + int/i15_tmont.c \ + int/i31_decred.c \ + int/i31_mulacc.c \ + int/i31_reduce.c \ + int/i32_add.c \ + int/i32_bitlen.c \ + int/i32_decmod.c \ + int/i32_decode.c \ + int/i32_decred.c \ + int/i32_encode.c \ + int/i32_fmont.c \ + int/i32_iszero.c \ + int/i32_modpow.c \ + int/i32_montmul.c \ + int/i32_mulacc.c \ + int/i32_muladd.c \ + int/i32_ninv32.c \ + int/i32_reduce.c \ + int/i32_sub.c \ + int/i32_tmont.c \ + +SRCS+= \ + kdf/hkdf.c \ + kdf/shake.c \ + +SRCS+= \ + rsa/rsa_default_keygen.c \ + rsa/rsa_default_modulus.c \ + rsa/rsa_default_pkcs1_sign.c \ + rsa/rsa_default_priv.c \ + rsa/rsa_default_privexp.c \ + rsa/rsa_default_pss_sign.c \ + rsa/rsa_default_pss_vrfy.c \ + rsa/rsa_default_pub.c \ + rsa/rsa_default_pubexp.c \ + rsa/rsa_i15_keygen.c \ + rsa/rsa_i15_modulus.c \ + rsa/rsa_i15_pkcs1_sign.c \ + rsa/rsa_i15_pkcs1_vrfy.c \ + rsa/rsa_i15_priv.c \ + rsa/rsa_i15_privexp.c \ + rsa/rsa_i15_pss_sign.c \ + rsa/rsa_i15_pss_vrfy.c \ + rsa/rsa_i15_pub.c \ + rsa/rsa_i15_pubexp.c \ + rsa/rsa_i31_keygen.c \ + rsa/rsa_i31_keygen_inner.c \ + rsa/rsa_i31_modulus.c \ + rsa/rsa_i31_pkcs1_sign.c \ + rsa/rsa_i31_priv.c \ + rsa/rsa_i31_privexp.c \ + rsa/rsa_i31_pss_sign.c \ + rsa/rsa_i31_pss_vrfy.c \ + rsa/rsa_i31_pubexp.c \ + rsa/rsa_i32_pkcs1_sign.c \ + rsa/rsa_i32_pkcs1_vrfy.c \ + rsa/rsa_i32_priv.c \ + rsa/rsa_i32_pss_sign.c \ + rsa/rsa_i32_pss_vrfy.c \ + rsa/rsa_i32_pub.c \ + rsa/rsa_i62_keygen.c \ + rsa/rsa_i62_pkcs1_sign.c \ + rsa/rsa_i62_priv.c \ + rsa/rsa_i62_pss_sign.c \ + rsa/rsa_i62_pss_vrfy.c \ + rsa/rsa_pkcs1_sig_pad.c \ + rsa/rsa_pss_sig_pad.c \ + rsa/rsa_pss_sig_unpad.c \ + rsa/rsa_ssl_decrypt.c \ + +SRCS+= \ + x509/encode_ec_pk8der.c \ + x509/encode_ec_rawder.c \ + x509/encode_rsa_pk8der.c \ + x509/encode_rsa_rawder.c \ + x509/skey_decoder.c \ + x509/x509_knownkey.c \ + x509/x509_minimal_full.c \ + +INCS= \ + inc/bearssl.h \ + inc/bearssl_aead.h \ + inc/bearssl_block.h \ + inc/bearssl_ec.h \ + inc/bearssl_hash.h \ + inc/bearssl_hmac.h \ + inc/bearssl_kdf.h \ + inc/bearssl_pem.h \ + inc/bearssl_prf.h \ + inc/bearssl_rand.h \ + inc/bearssl_rsa.h \ + inc/bearssl_ssl.h \ + inc/bearssl_x509.h \ + +INCS:= ${INCS:S,^,${BEARSSL}/,} + + +.if ${MK_BEARSSL_SSL:Uno} == "yes" +SRCS+= \ + mac/hmac.c \ + mac/hmac_ct.c \ + rand/hmac_drbg.c \ + ssl/prf.c \ + ssl/prf_md5sha1.c \ + ssl/prf_sha256.c \ + ssl/prf_sha384.c \ + ssl/ssl_ccert_single_ec.c \ + ssl/ssl_ccert_single_rsa.c \ + ssl/ssl_client.c \ + ssl/ssl_client_default_rsapub.c \ + ssl/ssl_client_full.c \ + ssl/ssl_engine.c \ + ssl/ssl_engine_default_aescbc.c \ + ssl/ssl_engine_default_aesccm.c \ + ssl/ssl_engine_default_aesgcm.c \ + ssl/ssl_engine_default_chapol.c \ + ssl/ssl_engine_default_descbc.c \ + ssl/ssl_engine_default_ec.c \ + ssl/ssl_engine_default_ecdsa.c \ + ssl/ssl_engine_default_rsavrfy.c \ + ssl/ssl_hashes.c \ + ssl/ssl_hs_client.c \ + ssl/ssl_hs_server.c \ + ssl/ssl_io.c \ + ssl/ssl_lru.c \ + ssl/ssl_rec_cbc.c \ + ssl/ssl_rec_ccm.c \ + ssl/ssl_rec_chapol.c \ + ssl/ssl_rec_gcm.c \ + ssl/ssl_scert_single_ec.c \ + ssl/ssl_scert_single_rsa.c \ + ssl/ssl_server.c \ + ssl/ssl_server_full_ec.c \ + ssl/ssl_server_full_rsa.c \ + ssl/ssl_server_mine2c.c \ + ssl/ssl_server_mine2g.c \ + ssl/ssl_server_minf2c.c \ + ssl/ssl_server_minf2g.c \ + ssl/ssl_server_minr2g.c \ + ssl/ssl_server_minu2g.c \ + ssl/ssl_server_minv2g.c \ + +SRCS+= \ + symcipher/aes_big_cbcdec.c \ + symcipher/aes_big_cbcenc.c \ + symcipher/aes_big_ctr.c \ + symcipher/aes_big_dec.c \ + symcipher/aes_big_enc.c \ + symcipher/aes_common.c \ + symcipher/aes_ct.c \ + symcipher/aes_ct64.c \ + symcipher/aes_ct64_cbcdec.c \ + symcipher/aes_ct64_cbcenc.c \ + symcipher/aes_ct64_ctr.c \ + symcipher/aes_ct64_dec.c \ + symcipher/aes_ct64_enc.c \ + symcipher/aes_ct_cbcdec.c \ + symcipher/aes_ct_cbcenc.c \ + symcipher/aes_ct_ctr.c \ + symcipher/aes_ct_dec.c \ + symcipher/aes_ct_enc.c \ + symcipher/aes_pwr8.c \ + symcipher/aes_pwr8_cbcdec.c \ + symcipher/aes_pwr8_cbcenc.c \ + symcipher/aes_pwr8_ctr.c \ + symcipher/aes_pwr8_ctrcbc.c \ + symcipher/aes_small_cbcdec.c \ + symcipher/aes_small_cbcenc.c \ + symcipher/aes_small_ctr.c \ + symcipher/aes_small_dec.c \ + symcipher/aes_small_enc.c \ + symcipher/aes_x86ni.c \ + symcipher/aes_x86ni_cbcdec.c \ + symcipher/aes_x86ni_cbcenc.c \ + symcipher/aes_x86ni_ctr.c \ + symcipher/chacha20_ct.c \ + symcipher/des_ct.c \ + symcipher/des_ct_cbcdec.c \ + symcipher/des_ct_cbcenc.c \ + symcipher/des_support.c \ + symcipher/des_tab.c \ + symcipher/des_tab_cbcdec.c \ + symcipher/des_tab_cbcenc.c \ + symcipher/poly1305_ctmul.c \ + symcipher/poly1305_ctmul32.c \ + symcipher/poly1305_ctmulq.c \ + symcipher/poly1305_i15.c \ + +.endif + +.include + +.if ${MACHINE} == "host" +CWARNFLAGS+= -Wno-error +.endif +XCFLAGS.gcc.rsa_i62_keygen+= -Wno-error +XCFLAGS.i15_moddiv+= -Wno-shadow +XCFLAGS.i31_moddiv+= -Wno-shadow +XCFLAGS.i62_modpow2+= -Wno-cast-align +XCFLAGS.x509_minimal+= -Wno-cast-qual + +CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U} \ + ${XCFLAGS.${COMPILER_TYPE}.${.TARGET:T:R}:U} + Added: head/lib/libbearssl/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbearssl/Makefile.depend Tue Feb 26 05:59:22 2019 (r344564) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libbearssl/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbearssl/Makefile.inc Tue Feb 26 05:59:22 2019 (r344564) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +BEARSSL?= ${SRCTOP}/contrib/bearssl +BEARSSL_SRC= ${BEARSSL}/src + +CFLAGS+= -I${BEARSSL}/inc + Added: head/lib/libbearssl/Makefile.libsa.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbearssl/Makefile.libsa.inc Tue Feb 26 05:59:22 2019 (r344564) @@ -0,0 +1,86 @@ +# $FreeBSD$ + +# This file is included by libsa +# It contains SRCS needed for loader + +.PATH: ${.PARSEDIR} + +.include "Makefile.inc" + +.PATH: ${BEARSSL_SRC} + +CFLAGS+= -I${BEARSSL_SRC} + +# we do not need/want nested objdirs +OBJS_SRCS_FILTER = T R + +# we list only the srcs the loader(s) actually needs +SRCS+= \ + codec/ccopy.c \ + codec/dec32be.c \ + codec/dec64be.c \ + codec/enc32be.c \ + codec/enc64be.c \ + codec/pemdec.c \ + +SRCS+= \ + ec/ec_all_m31.c \ + ec/ec_c25519_m31.c \ + ec/ec_c25519_m62.c \ + ec/ec_c25519_m64.c \ + ec/ec_default.c \ + ec/ec_p256_m31.c \ + ec/ec_p256_m62.c \ + ec/ec_p256_m64.c \ + ec/ec_prime_i31.c \ + ec/ec_pubkey.c \ + ec/ec_secp256r1.c \ + ec/ec_secp384r1.c \ + ec/ec_secp521r1.c \ + ec/ecdsa_atr.c \ + ec/ecdsa_default_vrfy_asn1.c \ + ec/ecdsa_i31_bits.c \ + ec/ecdsa_i31_vrfy_asn1.c \ + ec/ecdsa_i31_vrfy_raw.c \ + +# Note: sha1 is needed for OpenPGP (keyId) +SRCS+= \ + hash/multihash.c \ + hash/sha1.c \ + hash/sha2big.c \ + hash/sha2small.c \ + +SRCS+= \ + int/i31_add.c \ + int/i31_bitlen.c \ + int/i31_decmod.c \ + int/i31_decode.c \ + int/i31_encode.c \ + int/i31_fmont.c \ + int/i31_iszero.c \ + int/i31_moddiv.c \ + int/i31_modpow.c \ + int/i31_modpow2.c \ + int/i31_montmul.c \ + int/i31_muladd.c \ + int/i31_ninv31.c \ + int/i31_rshift.c \ + int/i31_sub.c \ + int/i31_tmont.c \ + int/i32_div32.c \ + int/i62_modpow2.c \ + +SRCS+= \ + rsa/rsa_default_pkcs1_vrfy.c \ + rsa/rsa_i31_pkcs1_vrfy.c \ + rsa/rsa_i31_pub.c \ + rsa/rsa_i62_pkcs1_vrfy.c \ + rsa/rsa_i62_pub.c \ + rsa/rsa_pkcs1_sig_unpad.c \ + + +SRCS+= \ + x509/asn1enc.c \ + x509/x509_decoder.c \ + x509/x509_minimal.c \ + From owner-svn-src-head@freebsd.org Tue Feb 26 06:09:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70D06150C9A7; Tue, 26 Feb 2019 06:09:13 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11E656D0D2; Tue, 26 Feb 2019 06:09:13 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F253FD11; Tue, 26 Feb 2019 06:09:12 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q69CCH093733; Tue, 26 Feb 2019 06:09:12 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q69Arq093718; Tue, 26 Feb 2019 06:09:10 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201902260609.x1Q69Arq093718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 26 Feb 2019 06:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344565 - in head/lib/libsecureboot: . h openpgp tests X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/lib/libsecureboot: . h openpgp tests X-SVN-Commit-Revision: 344565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11E656D0D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 06:09:13 -0000 Author: sjg Date: Tue Feb 26 06:09:10 2019 New Revision: 344565 URL: https://svnweb.freebsd.org/changeset/base/344565 Log: Add libsecureboot Used by loader and veriexec Depends on libbearssl Reviewed by: emaste Sponsored by: Juniper Networks Differential Revision: D16335 Added: head/lib/libsecureboot/ head/lib/libsecureboot/Makefile (contents, props changed) head/lib/libsecureboot/Makefile.depend (contents, props changed) head/lib/libsecureboot/Makefile.depend.host (contents, props changed) head/lib/libsecureboot/Makefile.inc (contents, props changed) head/lib/libsecureboot/Makefile.libsa.inc (contents, props changed) head/lib/libsecureboot/README.rst (contents, props changed) head/lib/libsecureboot/brf.c (contents, props changed) head/lib/libsecureboot/h/ head/lib/libsecureboot/h/libsecureboot.h (contents, props changed) head/lib/libsecureboot/h/verify_file.h (contents, props changed) head/lib/libsecureboot/libsecureboot-priv.h (contents, props changed) head/lib/libsecureboot/local.trust.mk (contents, props changed) head/lib/libsecureboot/openpgp/ head/lib/libsecureboot/openpgp/Makefile.inc (contents, props changed) head/lib/libsecureboot/openpgp/dearmor.c (contents, props changed) head/lib/libsecureboot/openpgp/decode.c (contents, props changed) head/lib/libsecureboot/openpgp/decode.h (contents, props changed) head/lib/libsecureboot/openpgp/opgp_key.c (contents, props changed) head/lib/libsecureboot/openpgp/opgp_sig.c (contents, props changed) head/lib/libsecureboot/openpgp/packet.h (contents, props changed) head/lib/libsecureboot/readfile.c (contents, props changed) head/lib/libsecureboot/tests/ head/lib/libsecureboot/tests/Makefile (contents, props changed) head/lib/libsecureboot/tests/Makefile.depend.host (contents, props changed) head/lib/libsecureboot/tests/tvo.c (contents, props changed) head/lib/libsecureboot/vectx.c (contents, props changed) head/lib/libsecureboot/veopen.c (contents, props changed) head/lib/libsecureboot/vepcr.c (contents, props changed) head/lib/libsecureboot/verify_file.c (contents, props changed) head/lib/libsecureboot/vesigned.c (contents, props changed) head/lib/libsecureboot/veta.c (contents, props changed) head/lib/libsecureboot/vets.c (contents, props changed) Added: head/lib/libsecureboot/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/Makefile Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.include + +LIB= secureboot + +.include "Makefile.inc" + +INCS= h/libsecureboot.h + +.include Added: head/lib/libsecureboot/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/Makefile.depend Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libsecureboot/Makefile.depend.host ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/Makefile.depend.host Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,12 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + lib/libstand \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/libsecureboot/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/Makefile.inc Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,133 @@ +# $FreeBSD$ + +.if empty(BEARSSL) +.include "../libbearssl/Makefile.inc" +.endif + +.if !target(_${__this}_) +_${__this}_: + +libsecureboot_src:= ${.PARSEDIR} + +CFLAGS+= -I${libsecureboot_src}/h + +.PATH: ${.PARSEDIR} + +SRCS+= \ + readfile.c \ + brf.c \ + vesigned.c \ + vets.c + +.if ${.CURDIR:M*libsecureboot*} != "" +SRCS+= veta.c +.endif + +CFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U} + +# we use a couple of files from ${BEARSSL}/tools +BRSSL_CFLAGS+= -I${BEARSSL}/tools +BRSSL_SRCS+= \ + ${BEARSSL}/tools/xmem.c \ + ${BEARSSL}/tools/vector.c + +# we do not need/want nested objdirs +OBJS_SRCS_FILTER = T R + +SRCS+= ${BRSSL_SRCS} + + +# extract the last cert from a chain (should be rootCA) +_LAST_PEM_USE: .USE + sed "1,`grep -n .-END ${.ALLSRC:M*.pem} | tail -2 | head -1 | sed 's,:.*,,'`d" ${.ALLSRC:M*.pem} > ${.TARGET} + +# extract 2nd last cert from chain - we use this for self-test +_2ndLAST_PEM_USE: .USE + sed -n "`grep -n .-BEGIN ${.ALLSRC:M*.pem} | tail -2 | \ + sed 's,:.*,,' | xargs | (read a b; echo $$a,$$(($$b - 1)))`p" ${.ALLSRC:M*.pem} > ${.TARGET} + +# list of hashes we support +VE_HASH_LIST?= SHA256 + +# list of signatures we support +# some people don't trust ECDSA +VE_SIGNATURE_LIST?= RSA + +# this list controls our search for signatures so will not be sorted +# note: for X509 signatures we assume we can replace the trailing +# "sig" with "certs" to find the certificate chain +# eg. for manifest.esig we use manifest.ecerts +VE_SIGNATURE_EXT_LIST?= sig + +# needs to be yes for FIPS 140-2 compliance +VE_SELF_TESTS?= no + +# rules to populate the [tv]*.pem files we use to generate ta.h +# and can add/alter VE_*_LIST as desired. +.-include "local.trust.mk" + +# this is what we use as our trust anchor +CFLAGS+= -I. -DTRUST_ANCHOR_STR=ta_PEM + +.if ${VE_SELF_TESTS} != "no" +XCFLAGS.vets+= -DVERIFY_CERTS_STR=vc_PEM +.endif + +# clean these up +VE_HASH_LIST:= ${VE_HASH_LIST:tu:O:u} +VE_SIGNATURE_LIST:= ${VE_SIGNATURE_LIST:tu:O:u} + +# define what we are supporting +CFLAGS+= ${VE_HASH_LIST:@H@-DVE_$H_SUPPORT@} \ + ${VE_SIGNATURE_LIST:@S@-DVE_$S_SUPPORT@} + +.if ${VE_SIGNATURE_LIST:MOPENPGP} != "" +.include "openpgp/Makefile.inc" +.endif + +.if ${VE_SELF_TESTS} != "no" +# The input used for hash KATs +VE_HASH_KAT_STR?= vc_PEM + +XCFLAGS.vets+= -DVE_HASH_KAT_STR=${VE_HASH_KAT_STR} +.endif + +# Generate ta.h containing one or more PEM encoded trust anchors in ta_PEM. +# +# If we are doing self-tests, we define another arrary vc_PEM +# containing certificates that we can verify for each trust anchor. +# This is typically a subordinate CA cert. +# Finally we generate a hash of vc_PEM using each supported hash method +# to use as a Known Answer Test (needed for FIPS 140-2) +# +vets.o vets.po vets.pico: ta.h +ta.h: ${.ALLTARGETS:M[tv]*pem:O:u} + @( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \ + cat ${.ALLSRC:N*crl*:Mt*.pem} /dev/null | \ + file2c -sx 'static const char ta_PEM[] = {' '};'; \ + echo "${.newline}${VE_HASH_LIST:@H@static char vh_$H[] = \"`cat ${.ALLSRC:N*crl*:Mv*.pem} | ${$H:U${H:tl}}`\";${.newline}@}"; ) > ${.TARGET} +.if ${VE_SELF_TESTS} != "no" + ( cat ${.ALLSRC:N*crl*:Mv*.pem} /dev/null | \ + file2c -sx 'static const char vc_PEM[] = {' '};'; echo ) >> ${.TARGET} +.endif +.if !empty(BUILD_UTC_FILE) + echo '#define BUILD_UTC ${${STAT:Ustat} -f %m ${BUILD_UTC_FILE}:L:sh}' >> ${.TARGET} ${.OODATE:MNOMETA_CMP} +.endif + +# This header records our preference for signature extensions. +vesigned.o vesigned.po vesigned.pico: vse.h +vse.h: + @( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \ + echo "static const char *signature_exts[] = {"; \ + echo '${VE_SIGNATURE_EXT_LIST:@e@"$e",${.newline}@}'; \ + echo 'NULL };' ) > ${.TARGET} + + +.for s in ${BRSSL_SRCS} brf.c vets.c veta.c +.ifdef BRSSL_SED +$s: brssl.h +.endif +XCFLAGS.${s:R}+= ${BRSSL_CFLAGS} +.endfor + +.endif Added: head/lib/libsecureboot/Makefile.libsa.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/Makefile.libsa.inc Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,40 @@ +# $FreeBSD$ + +BRSSL_CFLAGS+= -DNO_STDIO + +.include "Makefile.inc" + +# for "measured boot" +# loader puts the equivalent of TPM's PCR register into kenv +# this is not as good but *way* simpler than talking to TPM +CFLAGS+= -DVE_PCR_SUPPORT + +# sources that only apply to libsa +SRCS+= \ + vectx.c \ + veopen.c \ + vepcr.c \ + verify_file.c \ + +# this is the list of paths (relative to a file +# that we need to verify) used to find a signed manifest. +# the signature extensions in VE_SIGNATURE_EXT_LIST +# will be applied to each. +VE_MANIFEST_LIST?= manifest ../manifest + +verify_file.o: manifests.h +manifests.h: + @( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \ + echo "static const char *manifest_names[] = {"; \ + echo '${VE_MANIFEST_LIST:@m@"$m",${.newline}@}'; \ + echo 'NULL };' ) > ${.TARGET} + +XCFLAGS.verify_file+= \ + -DVE_DEBUG_LEVEL=${VE_DEBUG_LEVEL:U0} \ + -DVE_VERBOSE_DEFAULT=${VE_VERBOSE_DEFAULT:U0} \ + +.if !empty(MANIFEST_SKIP_ALWAYS) +XCFLAGS.verify_file+= -DMANIFEST_SKIP_ALWAYS=\"${MANIFEST_SKIP_ALWAYS}\" +.elif !empty(MANIFEST_SKIP) +XCFLAGS.verify_file+= -DMANIFEST_SKIP=\"${MANIFEST_SKIP}\" +.endif Added: head/lib/libsecureboot/README.rst ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/README.rst Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,134 @@ +libsecureboot +************* + +This library depends one way or another on verifying digital signatures. +To do that, the necessary trust anchors need to be available. + +The simplest (and most attractive for an embedded system) is to +capture them in this library. + +The makefile ``local.trust.mk`` is responsible for doing that. +The file provided is just an example and depends on the environment +here at Juniper. + +Within Juniper we use signing servers, which apart from signing things +provide access to the necessary trust anchors. +That signing server is freely available - see +http://www.crufty.net/sjg/docs/signing-server.htm + +X.509 certificates chains offer a lot of flexibility over time and are +a great solution for an embedded vendor like Juniper or even +FreeBSD.org, but are probably overkill for personal or small site use. + +Setting up a CA for this is rather involved so I'll just provide a +link below to suitable tutorial below. + +Using OpenPGP is much simpler. + + +OpenPGP +======== + +This is very simple to setup and use. + +An RSA key pair can be generated with:: + + GNUPGHOME=$PWD/.gnupg gpg --openpgp \ + --quick-generate-key --batch --passphrase '' "keyname" RSA + +The use of ``GNUPGHOME=$PWD/.gnupg`` just avoids messing with personal +keyrings. +We can list the resulting key:: + + GNUPGHOME=$PWD/.gnupg gpg --openpgp --list-keys + + gpg: WARNING: unsafe permissions on homedir + '/h/sjg/openpgp/.gnupg' + gpg: Warning: using insecure memory! + /h/sjg/openpgp/.gnupg/pubring.kbx + --------------------------------- + pub rsa2048 2018-03-26 [SC] [expires: 2020-03-25] + AB39B111E40DD019E0E7C171ACA72B4719FD2523 + uid [ultimate] OpenPGPtest + +The ``keyID`` we want later will be the last 8 octets +(``ACA72B4719FD2523``) +This is what we will use for looking up the key. + +We can then export the private and public keys:: + + GNUPGHOME=$PWD/.gnupg gpg --openpgp \ + --export --armor > ACA72B4719FD2523.pub.asc + GNUPGHOME=$PWD/.gnupg gpg --openpgp \ + --export-secret-keys --armor > ACA72B4719FD2523.sec.asc + +The public key ``ACA72B4719FD2523.pub.asc`` is what we want to +embed in this library. +If you look at the ``ta_asc.h`` target in ``openpgp/Makefile.inc`` +we want the trust anchor in a file named ``t*.asc`` +eg. ``ta_openpgp.asc``. + +The ``ta_asc.h`` target will capture all such ``t*.asc`` into that +header. + +Signatures +---------- + +We expect ascii armored (``.asc``) detached signatures. +Eg. signature for ``manifest`` would be in ``manifest.asc`` + +We only support version 4 signatures using RSA (the default for ``gpg``). + + +OpenSSL +======== + +The basic idea here is to setup a private CA. + +There are lots of good tutorials on available on this topic; +just google *setup openssl ca*. +A good example is https://jamielinux.com/docs/openssl-certificate-authority/ + +All we need for this library is a copy of the PEM encoded root CA +certificate (trust anchor). This is expected to be in a file named +``t*.pem`` eg. ``ta_rsa.pem``. + +The ``ta.h`` target in ``Makefile.inc`` will combine all such +``t*.pem`` files into that header. + +Signatures +---------- + +For Junos we currently use EC DSA signatures with file extension +``.esig`` so the signature for ``manifest`` would be ``manifest.esig`` + +This was the first signature method we used with the remote signing +servers and it ends up being a signature of a hash. +Ie. client sends a hash which during signing gets hashed again. +So for Junos we define VE_ECDSA_HASH_AGAIN which causes ``verify_ec`` +to hash again. + +Otherwise our EC DSA and RSA signatures are the default used by +OpenSSL - an original design goal was that a customer could verify our +signatures using nothing but an ``openssl`` binary. + + +Self tests +========== + +If you want the ``loader`` to perform self-test of a given signature +verification method on startup (a must for FIPS 140-2 certification) +you need to provide a suitable file signed by each supported trust +anchor. + +These should be stored in files with names that start with ``v`` and +have the same extension as the corresponding trust anchor. +Eg. for ``ta_openpgp.asc`` we use ``vc_openpgp.asc`` +and for ``ta_rsa.pem`` we use ``vc_rsa.pem``. + +Note for the X.509 case we simply extract the 2nd last certificate +from the relevant chain - which is sure to be a valid certificate +signed by the corresponding trust anchor. + +-------------------- +$FreeBSD$ Added: head/lib/libsecureboot/brf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/brf.c Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,403 @@ +// The functions here are derrived from BearSSL/tools/*.c +// When that is refactored suitably we can use them directly. +/* + * Copyright (c) 2016 Thomas Pornin + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include +__FBSDID("$FreeBSD$"); + +#define NEED_BRSSL_H +#include "libsecureboot-priv.h" +#include + + +static int +is_ign(int c) +{ + if (c == 0) { + return (0); + } + if (c <= 32 || c == '-' || c == '_' || c == '.' + || c == '/' || c == '+' || c == ':') + { + return (1); + } + return (0); +} + +/* + * Get next non-ignored character, normalised: + * ASCII letters are converted to lowercase + * control characters, space, '-', '_', '.', '/', '+' and ':' are ignored + * A terminating zero is returned as 0. + */ +static int +next_char(const char **ps, const char *limit) +{ + for (;;) { + int c; + + if (*ps == limit) { + return (0); + } + c = *(*ps) ++; + if (c == 0) { + return (0); + } + if (c >= 'A' && c <= 'Z') { + c += 'a' - 'A'; + } + if (!is_ign(c)) { + return (c); + } + } +} + +/* + * Partial string equality comparison, with normalisation. + */ +static int +eqstr_chunk(const char *s1, size_t s1_len, const char *s2, size_t s2_len) +{ + const char *lim1, *lim2; + + lim1 = s1 + s1_len; + lim2 = s2 + s2_len; + for (;;) { + int c1, c2; + + c1 = next_char(&s1, lim1); + c2 = next_char(&s2, lim2); + if (c1 != c2) { + return (0); + } + if (c1 == 0) { + return (1); + } + } +} + +/* see brssl.h */ +int +eqstr(const char *s1, const char *s2) +{ + return (eqstr_chunk(s1, strlen(s1), s2, strlen(s2))); +} + +int +looks_like_DER(const unsigned char *buf, size_t len) +{ + int fb; + size_t dlen; + + if (len < 2) { + return (0); + } + if (*buf ++ != 0x30) { + return (0); + } + fb = *buf ++; + len -= 2; + if (fb < 0x80) { + return ((size_t)fb == len); + } else if (fb == 0x80) { + return (0); + } else { + fb -= 0x80; + if (len < (size_t)fb + 2) { + return (0); + } + len -= (size_t)fb; + dlen = 0; + while (fb -- > 0) { + if (dlen > (len >> 8)) { + return (0); + } + dlen = (dlen << 8) + (size_t)*buf ++; + } + return (dlen == len); + } +} + +static void +vblob_append(void *cc, const void *data, size_t len) +{ + bvector *bv; + + bv = cc; + VEC_ADDMANY(*bv, data, len); +} + +void +free_pem_object_contents(pem_object *po) +{ + if (po != NULL) { + xfree(po->name); + xfree(po->data); + } +} + +pem_object * +decode_pem(const void *src, size_t len, size_t *num) +{ + VECTOR(pem_object) pem_list = VEC_INIT; + br_pem_decoder_context pc; + pem_object po, *pos; + const unsigned char *buf; + bvector bv = VEC_INIT; + int inobj; + int extra_nl; + + *num = 0; + br_pem_decoder_init(&pc); + buf = src; + inobj = 0; + po.name = NULL; + po.data = NULL; + po.data_len = 0; + extra_nl = 1; + while (len > 0) { + size_t tlen; + + tlen = br_pem_decoder_push(&pc, buf, len); + buf += tlen; + len -= tlen; + switch (br_pem_decoder_event(&pc)) { + + case BR_PEM_BEGIN_OBJ: + po.name = xstrdup(br_pem_decoder_name(&pc)); + br_pem_decoder_setdest(&pc, vblob_append, &bv); + inobj = 1; + break; + + case BR_PEM_END_OBJ: + if (inobj) { + po.data = VEC_TOARRAY(bv); + po.data_len = VEC_LEN(bv); + VEC_ADD(pem_list, po); + VEC_CLEAR(bv); + po.name = NULL; + po.data = NULL; + po.data_len = 0; + inobj = 0; + } + break; + + case BR_PEM_ERROR: + xfree(po.name); + VEC_CLEAR(bv); + ve_error_set("ERROR: invalid PEM encoding"); + VEC_CLEAREXT(pem_list, &free_pem_object_contents); + return (NULL); + } + + /* + * We add an extra newline at the end, in order to + * support PEM files that lack the newline on their last + * line (this is somwehat invalid, but PEM format is not + * standardised and such files do exist in the wild, so + * we'd better accept them). + */ + if (len == 0 && extra_nl) { + extra_nl = 0; + buf = (const unsigned char *)"\n"; + len = 1; + } + } + if (inobj) { + ve_error_set("ERROR: unfinished PEM object"); + xfree(po.name); + VEC_CLEAR(bv); + VEC_CLEAREXT(pem_list, &free_pem_object_contents); + return (NULL); + } + + *num = VEC_LEN(pem_list); + VEC_ADD(pem_list, po); + pos = VEC_TOARRAY(pem_list); + VEC_CLEAR(pem_list); + return (pos); +} + +br_x509_certificate * +parse_certificates(unsigned char *buf, size_t len, size_t *num) +{ + VECTOR(br_x509_certificate) cert_list = VEC_INIT; + pem_object *pos; + size_t u, num_pos; + br_x509_certificate *xcs; + br_x509_certificate dummy; + + *num = 0; + + /* + * Check for a DER-encoded certificate. + */ + if (looks_like_DER(buf, len)) { + xcs = xmalloc(2 * sizeof *xcs); + xcs[0].data = buf; + xcs[0].data_len = len; + xcs[1].data = NULL; + xcs[1].data_len = 0; + *num = 1; + return (xcs); + } + + pos = decode_pem(buf, len, &num_pos); + if (pos == NULL) { + return (NULL); + } + for (u = 0; u < num_pos; u ++) { + if (eqstr(pos[u].name, "CERTIFICATE") + || eqstr(pos[u].name, "X509 CERTIFICATE")) + { + br_x509_certificate xc; + + xc.data = pos[u].data; + xc.data_len = pos[u].data_len; + pos[u].data = NULL; + VEC_ADD(cert_list, xc); + } + } + for (u = 0; u < num_pos; u ++) { + free_pem_object_contents(&pos[u]); + } + xfree(pos); + + if (VEC_LEN(cert_list) == 0) { + return (NULL); + } + *num = VEC_LEN(cert_list); + dummy.data = NULL; + dummy.data_len = 0; + VEC_ADD(cert_list, dummy); + xcs = VEC_TOARRAY(cert_list); + VEC_CLEAR(cert_list); + return (xcs); +} + +br_x509_certificate * +read_certificates(const char *fname, size_t *num) +{ + br_x509_certificate *xcs; + unsigned char *buf; + size_t len; + + *num = 0; + + /* + * TODO: reading the whole file is crude; we could parse them + * in a streamed fashion. But it does not matter much in practice. + */ + buf = read_file(fname, &len); + if (buf == NULL) { + return (NULL); + } + xcs = parse_certificates(buf, len, num); + if (xcs == NULL) { + ve_error_set("ERROR: no certificate in file '%s'\n", fname); + } + xfree(buf); + return (xcs); +} + +/* see brssl.h */ +void +free_certificates(br_x509_certificate *certs, size_t num) +{ + size_t u; + + for (u = 0; u < num; u ++) { + xfree(certs[u].data); + } + xfree(certs); +} + + +static void +dn_append(void *ctx, const void *buf, size_t len) +{ + VEC_ADDMANY(*(bvector *)ctx, buf, len); +} + +int +certificate_to_trust_anchor_inner(br_x509_trust_anchor *ta, + br_x509_certificate *xc) +{ + br_x509_decoder_context dc; + bvector vdn = VEC_INIT; + br_x509_pkey *pk; + + br_x509_decoder_init(&dc, dn_append, &vdn); + br_x509_decoder_push(&dc, xc->data, xc->data_len); + pk = br_x509_decoder_get_pkey(&dc); + if (pk == NULL) { + ve_error_set("ERROR: CA decoding failed with error %d\n", + br_x509_decoder_last_error(&dc)); + VEC_CLEAR(vdn); + return (-1); + } + ta->dn.data = VEC_TOARRAY(vdn); + ta->dn.len = VEC_LEN(vdn); + VEC_CLEAR(vdn); + ta->flags = 0; + if (br_x509_decoder_isCA(&dc)) { + ta->flags |= BR_X509_TA_CA; + } + switch (pk->key_type) { + case BR_KEYTYPE_RSA: + ta->pkey.key_type = BR_KEYTYPE_RSA; + ta->pkey.key.rsa.n = xblobdup(pk->key.rsa.n, pk->key.rsa.nlen); + ta->pkey.key.rsa.nlen = pk->key.rsa.nlen; + ta->pkey.key.rsa.e = xblobdup(pk->key.rsa.e, pk->key.rsa.elen); + ta->pkey.key.rsa.elen = pk->key.rsa.elen; + break; + case BR_KEYTYPE_EC: + ta->pkey.key_type = BR_KEYTYPE_EC; + ta->pkey.key.ec.curve = pk->key.ec.curve; + ta->pkey.key.ec.q = xblobdup(pk->key.ec.q, pk->key.ec.qlen); + ta->pkey.key.ec.qlen = pk->key.ec.qlen; + break; + default: + ve_error_set("ERROR: unsupported public key type in CA\n"); + xfree(ta->dn.data); + return (-1); + } + return (0); +} + +/* see brssl.h */ +void +free_ta_contents(br_x509_trust_anchor *ta) +{ + xfree(ta->dn.data); + switch (ta->pkey.key_type) { + case BR_KEYTYPE_RSA: + xfree(ta->pkey.key.rsa.n); + xfree(ta->pkey.key.rsa.e); + break; + case BR_KEYTYPE_EC: + xfree(ta->pkey.key.ec.q); + break; + } +} Added: head/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/h/libsecureboot.h Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2017-2018, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * $FreeBSD$ + */ +#ifndef _LIBSECUREBOOT_H_ +#define _LIBSECUREBOOT_H_ + +#include +#ifdef _STANDALONE +#include +#else +#include +#include +#include +#include +#include +#include +#endif + +#include + +#ifndef NEED_BRSSL_H +unsigned char * read_file(const char *, size_t *); +#endif + +extern int DebugVe; + +#define DEBUG_PRINTF(n, x) if (DebugVe >= n) printf x + +int ve_trust_init(void); +int ve_trust_add(const char *); +void ve_debug_set(int); +void ve_utc_set(time_t utc); +char *ve_error_get(void); +int ve_error_set(const char *, ...) __printflike(1,2); +int ve_self_tests(void); + +void fingerprint_info_add(const char *, const char *, const char *, + const char *, struct stat *); + +int ve_check_hash(br_hash_compat_context *, const br_hash_class *, + const char *, const char *, size_t); + +struct vectx; +struct vectx* vectx_open(int, const char *, off_t, struct stat *, int *); +ssize_t vectx_read(struct vectx *, void *, size_t); +off_t vectx_lseek(struct vectx *, off_t, int); +int vectx_close(struct vectx *); + +char * hexdigest(char *, size_t, unsigned char *, size_t); +int verify_fd(int, const char *, off_t, struct stat *); +int verify_open(const char *, int); + +unsigned char *verify_signed(const char *, int); +unsigned char *verify_sig(const char *, int); +unsigned char *verify_asc(const char *, int); /* OpenPGP */ + +void ve_pcr_init(void); +void ve_pcr_update(unsigned char *, size_t); +ssize_t ve_pcr_get(unsigned char *, size_t); + +/* flags for verify_{asc,sig,signed} */ +#define VEF_VERBOSE 1 + +#define VE_FINGERPRINT_OK 1 +/* errors from verify_fd */ +#define VE_FINGERPRINT_NONE -2 +#define VE_FINGERPRINT_WRONG -3 +#define VE_FINGERPRINT_UNKNOWN -4 /* may not be an error */ + +#endif /* _LIBSECUREBOOT_H_ */ Added: head/lib/libsecureboot/h/verify_file.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/h/verify_file.h Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2017-2018, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _VERIFY_FILE_H_ +#define _VERIFY_FILE_H_ + +#define VE_GUESS -1 /* let verify_file work it out */ +#define VE_TRY 0 /* we don't mind if unverified */ +#define VE_WANT 1 /* we want this verified */ +#define VE_MUST 2 /* this must be verified */ + +#define VE_VERIFIED 1 /* all good */ +#define VE_UNVERIFIED_OK 0 /* not verified but that's ok */ +#define VE_NOT_VERIFYING 2 /* we are not verifying */ + +struct stat; + +void ve_debug_set(int); +int ve_status_get(int); +int load_manifest(const char *, const char *, const char *, struct stat *); +int verify_file(int, const char *, off_t, int); +void verify_pcr_export(void); + +#endif /* _VERIFY_FILE_H_ */ Added: head/lib/libsecureboot/libsecureboot-priv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/libsecureboot-priv.h Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2017, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * $FreeBSD$ + */ +#ifndef _LIBSECUREBOOT_PRIV_H_ +#define _LIBSECUREBOOT_PRIV_H_ + +/* public api */ +#include "libsecureboot.h" + +size_t ve_trust_anchors_add(br_x509_certificate *, size_t); +char *fingerprint_info_lookup(int, const char *); + +br_x509_certificate * parse_certificates(unsigned char *, size_t, size_t *); +int certificate_to_trust_anchor_inner(br_x509_trust_anchor *, + br_x509_certificate *); + +int verify_rsa_digest(br_rsa_public_key *pkey, + const unsigned char *hash_oid, + unsigned char *mdata, size_t mlen, + unsigned char *sdata, size_t slen); + +int openpgp_self_tests(void); + +#endif /* _LIBSECUREBOOT_PRIV_H_ */ Added: head/lib/libsecureboot/local.trust.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/local.trust.mk Tue Feb 26 06:09:10 2019 (r344565) @@ -0,0 +1,114 @@ +# $FreeBSD$ + +# Consider this file an example. +# +# For Junos this is how we obtain trust anchor .pems +# the signing server (http://www.crufty.net/sjg/blog/signing-server.htm) +# for each key will provide the appropriate certificate chain on request + +# force these for Junos +MANIFEST_SKIP_ALWAYS= boot +VE_HASH_LIST= \ + SHA1 \ + SHA256 \ + SHA384 + +VE_SIGNATURE_LIST= \ + ECDSA + +VE_SIGNATURE_EXT_LIST= \ + esig + +VE_SELF_TESTS= yes + +.if ${MACHINE} == "host" && ${.CURDIR:T} == "tests" +# for testing +VE_HASH_LIST+= \ + SHA512 + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Feb 26 06:11:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70D23150CB80; Tue, 26 Feb 2019 06:11:03 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3DCC6D299; Tue, 26 Feb 2019 06:11:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D11D3C; Tue, 26 Feb 2019 06:11:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q6B2kv093909; Tue, 26 Feb 2019 06:11:02 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q6B1x9093903; Tue, 26 Feb 2019 06:11:01 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201902260611.x1Q6B1x9093903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 26 Feb 2019 06:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344566 - in head: lib share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: lib share/mk tools/build/options X-SVN-Commit-Revision: 344566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3DCC6D299 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 06:11:03 -0000 Author: sjg Date: Tue Feb 26 06:11:01 2019 New Revision: 344566 URL: https://svnweb.freebsd.org/changeset/base/344566 Log: Enable build of libbearssl Reviewed by: emaste Sponsored by: Juniper Networks Differential Revision: D16337 Added: head/tools/build/options/WITH_BEARSSL (contents, props changed) head/tools/build/options/WITH_LOADER_VERIEXEC (contents, props changed) head/tools/build/options/WITH_VERIEXEC (contents, props changed) Modified: head/lib/Makefile head/share/mk/src.libnames.mk head/share/mk/src.opts.mk Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Feb 26 06:09:10 2019 (r344565) +++ head/lib/Makefile Tue Feb 26 06:11:01 2019 (r344566) @@ -133,6 +133,7 @@ SUBDIR_DEPEND_libpcap= ofed # NB: keep these sorted by MK_* knobs SUBDIR.${MK_ATM}+= libngatm +SUBDIR.${MK_BEARSSL}+= libbearssl libsecureboot SUBDIR.${MK_BLACKLIST}+=libblacklist SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp SUBDIR.${MK_BSNMP}+= libbsnmp @@ -204,6 +205,7 @@ SUBDIR.${MK_TESTS}+= tests SUBDIR.${MK_UNBOUND}+= libunbound SUBDIR.${MK_USB}+= libusbhid libusb SUBDIR.${MK_OFED}+= ofed +SUBDIR.${MK_VERIEXEC}+= libveriexec SUBDIR.${MK_ZFS}+= libbe .if !make(install) Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Feb 26 06:09:10 2019 (r344565) +++ head/share/mk/src.libnames.mk Tue Feb 26 06:11:01 2019 (r344566) @@ -210,6 +210,21 @@ _LIBRARIES+= \ osmvendor .endif +.if ${MK_BEARSSL} == "yes" +_INTERNALLIBS+= \ + bearssl \ + secureboot \ + +LIBBEARSSL?= ${LIBBEARSSLDIR}/libbearssl${PIE_SUFFIX}.a +LIBSECUREBOOT?= ${LIBSECUREBOOTDIR}/libsecureboot${PIE_SUFFIX}.a +.endif + +.if ${MK_VERIEXEC} == "yes" +_INTERNALLIBS+= veriexec + +LIBVERIEXEC?= ${LIBVERIEXECDIR}/libveriexec${PIE_SUFFIX}.a +.endif + # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Feb 26 06:09:10 2019 (r344565) +++ head/share/mk/src.opts.mk Tue Feb 26 06:11:01 2019 (r344566) @@ -194,6 +194,7 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ + BEARSSL \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ @@ -219,6 +220,8 @@ __DEFAULT_NO_OPTIONS = \ __DEFAULT_DEPENDENT_OPTIONS= \ CLANG_FULL/CLANG \ LLVM_TARGET_ALL/CLANG \ + LOADER_VERIEXEC/BEARSSL \ + VERIEXEC/BEARSSL \ # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". Added: head/tools/build/options/WITH_BEARSSL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BEARSSL Tue Feb 26 06:11:01 2019 (r344566) @@ -0,0 +1,11 @@ +.\" $FreeBSD$ +Build the BearSSL library. +.Pp +BearSSL is a tiny SSL library suitable for embedded environments. +For details see +.Lk http://www.BearSSL.org/ +.Pp +This library is currently only used to perform +signature verification and related operations +for Verified Exec and +.Xr loader 8 . Added: head/tools/build/options/WITH_LOADER_VERIEXEC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_VERIEXEC Tue Feb 26 06:11:01 2019 (r344566) @@ -0,0 +1,7 @@ +.\" $FreeBSD$ +Enable building +.Xr loader 8 +with support for verifcation similar to Verified Exec. +.Pp +It depends on +.Va WITH_BEARSSL Added: head/tools/build/options/WITH_VERIEXEC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_VERIEXEC Tue Feb 26 06:11:01 2019 (r344566) @@ -0,0 +1,9 @@ +.\" $FreeBSD$ +Enable building +.Xr veriexec 8 +which loads the contents of verified manifests into the kernel +for use by +.Xr mac_veriexec 4 +.Pp +It depends on +.Va WITH_BEARSSL From owner-svn-src-head@freebsd.org Tue Feb 26 06:15:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02FE9150CC5E; Tue, 26 Feb 2019 06:15:01 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0: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 67D8B6D66E; Tue, 26 Feb 2019 06:15:00 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-pf1-x429.google.com with SMTP id n74so5697525pfi.9; Mon, 25 Feb 2019 22:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=M9piqBWP4w50ijgNzPS2a5dISVdQ9cj+slvwHV3YANk=; b=IRDTn4X41Mgg2QsSIdTPxomNM/KIc4FW4hsx3mZuMC015VPi1AxUsF6oRUmIqAvs3v XrBtvksmsyaQkQOQq2T/igK9kaUKtIYkzWGZnt6OmGTdr1XTP8jLNEzpjCAEEcVDz/W4 zl71NSr9VPjfBPhRNKwO1+FL6iTGo+k9bcu/PxPQfB/USG34coO2OHne9m/TXaMxB4nx OmrbHHhvQ1f1ohvrdx+ktgoLFwjTQwM+BOwbijwQkqlmMjjGRIF0Uc80jbdRwvnvoKHR +SryzkvmVteNbm9fY8SbDs81j4c1jXejYulSyyzLDKmWHcDB6kZABSXvT0urjoO/KEuJ M+vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=M9piqBWP4w50ijgNzPS2a5dISVdQ9cj+slvwHV3YANk=; b=Y6S4Uruos5HVz2GMqeMcMK8ui9hK/zXh46kICtd62ZX30SQdzfYmAnceZ1OtSPCbQX 8QoXOSXC3QgTRKFAhcACYjC2eH8Jm339ktM3EEX/UlBahx9hfK/k4hSgyaS64d9UIDlL 5+70sjFJNcKTvlHhV/ov7bC1QmVeZCVmYaWGGXIpbBuH7Q+8J1+OzMjnMHv5cABPpbzX D/IbCh67aS62+oif4nJCL7Bt3Ab6O6Tre78zDqjSuGHvwLtiSQeso/Yc0PXl68QsD6qf te5zxEhW4hPCpv1Ndjrmjz3JukXOoNk91i0z+hr1qg11OyMqZM24jeulAzxqyfvq4s6C X0Qw== X-Gm-Message-State: AHQUAuZjtNMqq/DUp9L6HRTQ0BYRSqn3qe8QeshDBibQUfWKRk5hLsXT sfrn8p24C+xGIhQbM+rZzQusDMk= X-Google-Smtp-Source: AHgI3IasmUIuqZu0oAhKz37/IaSiFypNQaqc19x23rIa5m+bULUa0WARpsHqdpMggZOHvsFLLR3o8Q== X-Received: by 2002:a63:29c3:: with SMTP id p186mr23013602pgp.24.1551161698675; Mon, 25 Feb 2019 22:14:58 -0800 (PST) Received: from [192.168.1.2] (c-67-188-30-11.hsd1.ca.comcast.net. [67.188.30.11]) by smtp.googlemail.com with ESMTPSA id p86sm24026212pfa.104.2019.02.25.22.14.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 22:14:57 -0800 (PST) Subject: Re: svn commit: r344562 - head/sys/ufs/ffs To: Bruce Evans , "Jason A. Harmening" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902260456.x1Q4uAIu056382@repo.freebsd.org> <20190226162300.M1437@besplex.bde.org> From: Jason Harmening Message-ID: <414d1964-f822-33f2-8177-872a4cbedd13@gmail.com> Date: Mon, 25 Feb 2019 22:12:52 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: <20190226162300.M1437@besplex.bde.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67D8B6D66E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 06:15:01 -0000 On 2/25/19 9:46 PM, Bruce Evans wrote: > > block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with > large > pages.  MINBSIZE is 4096 in ffs (except in my version, it is 512).  The > default is 32768 in newfs.  I consider this excessive and only use it for > file systems with many files larger than 1GB, but it is the most common > size. > It is larger than the large page size of 8192. I think this is a case of filesystem logical block size vs. media sector size, right? Here we're checking the devvp's block size, which I think should correspond to the sector size. I'd expect cases of that being greater than PAGE_SIZE to be uncommon, in fact geli warns when that is the case. I probably should've made that clearer in the commit message. > > ffs_getpages() already has an almost-never-used special case for small > block sizes.  It uses vnode_pager_generic_getpages() when !use_buf_pager > and the block_size <= PAGE_SIZE, else vfs_bio_getpages().  But > block_size <= PAGE_SIZE is unusual, and !use_buf_pager is also unusual, > and use_buf_pager is mostly a debugging sysctl, so little would be > lost but using vfs_bio_getpages() unconditionally. > > Bruce From owner-svn-src-head@freebsd.org Tue Feb 26 06:17:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68417150CCE2; Tue, 26 Feb 2019 06:17:27 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2866D7E4; Tue, 26 Feb 2019 06:17:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DCD9EC5; Tue, 26 Feb 2019 06:17:26 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q6HQ2q098709; Tue, 26 Feb 2019 06:17:26 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q6HOra098699; Tue, 26 Feb 2019 06:17:24 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201902260617.x1Q6HOra098699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 26 Feb 2019 06:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: etc/mtree include sbin sbin/veriexec X-SVN-Commit-Revision: 344567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C2866D7E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 06:17:27 -0000 Author: sjg Date: Tue Feb 26 06:17:23 2019 New Revision: 344567 URL: https://svnweb.freebsd.org/changeset/base/344567 Log: Add verifying manifest loader for mac_veriexec This tool will verify a signed manifest and load contents into mac_veriexec for storage Sponsored by: Juniper Networks Differential Revision: D16575 Added: head/sbin/veriexec/ head/sbin/veriexec/Makefile (contents, props changed) head/sbin/veriexec/Makefile.depend (contents, props changed) head/sbin/veriexec/manifest_lexer.l (contents, props changed) head/sbin/veriexec/manifest_parser.y (contents, props changed) head/sbin/veriexec/veriexec.8 (contents, props changed) head/sbin/veriexec/veriexec.c (contents, props changed) head/sbin/veriexec/veriexec.h (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sbin/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Feb 26 06:11:01 2019 (r344566) +++ head/etc/mtree/BSD.include.dist Tue Feb 26 06:17:23 2019 (r344567) @@ -160,6 +160,8 @@ .. usb .. + veriexec + .. vkbd .. wi @@ -353,6 +355,8 @@ mac_mls .. mac_partition + .. + mac_veriexec .. .. ssp Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Feb 26 06:11:01 2019 (r344566) +++ head/include/Makefile Tue Feb 26 06:17:23 2019 (r344567) @@ -47,7 +47,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ - dev/speaker dev/tcp_log dev/vkbd dev/wi \ + dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ @@ -60,6 +60,7 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ security/mac_mls security/mac_partition \ + security/mac_veriexec \ sys/disk \ ufs/ffs ufs/ufs @@ -157,7 +158,7 @@ copies: .PHONY .META done; \ fi .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec} ${LSUBSUBDIRS} cd ${SRCTOP}/sys; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${SDESTDIR}${INCLUDEDIR}/$i @@ -196,6 +197,9 @@ copies: .PHONY .META cd ${SRCTOP}/sys/dev/pci; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \ ${SDESTDIR}${INCLUDEDIR}/dev/pci + cd ${SRCTOP}/sys/dev/veriexec; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 veriexec_ioctl.h \ + ${SDESTDIR}${INCLUDEDIR}/dev/veriexec cd ${SRCTOP}/sys/fs/cd9660/; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660 @@ -264,7 +268,7 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci} +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci:Ndev/veriexec} cd ${SRCTOP}/sys/$i; \ for h in *.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \ @@ -311,6 +315,11 @@ symlinks: .PHONY .META for h in pcireg.h; do \ ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \ ${SDESTDIR}${INCLUDEDIR}/dev/pci; \ + done + cd ${SRCTOP}/sys/dev/veriexec; \ + for h in veriexec_ioctl.h; do \ + ln -fs ../../../../sys/dev/veriexec/$$h \ + ${SDESTDIR}${INCLUDEDIR}/dev/veriexec; \ done .for i in ${LSUBSUBDIRS} cd ${SRCTOP}/sys/$i; \ Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Tue Feb 26 06:11:01 2019 (r344566) +++ head/sbin/Makefile Tue Feb 26 06:17:23 2019 (r344567) @@ -87,6 +87,7 @@ SUBDIR.${MK_PF}+= pfctl SUBDIR.${MK_PF}+= pflogd SUBDIR.${MK_QUOTAS}+= quotacheck SUBDIR.${MK_ROUTED}+= routed +SUBDIR.${MK_VERIEXEC}+= veriexec SUBDIR.${MK_ZFS}+= bectl SUBDIR.${MK_ZFS}+= zfsbootcfg Added: head/sbin/veriexec/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/Makefile Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +PROG= veriexec +MAN= veriexec.8 +SRCS= \ + veriexec.c \ + manifest_parser.y \ + manifest_lexer.l + +LIBADD+= veriexec secureboot bearssl + +NO_SHARED= + +.include + +CFLAGS+= -I${.CURDIR} ${XCFLAGS.${.TARGET:T:R}:U} + +XCFLAGS.manifest_lexer+= -Wno-missing-variable-declarations \ + -Wno-unneeded-internal-declaration +XCFLAGS.manifest_parser+= -Wno-missing-variable-declarations Added: head/sbin/veriexec/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/Makefile.depend Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,20 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libbearssl \ + lib/libc \ + lib/libcompiler_rt \ + lib/libsecureboot \ + lib/libveriexec \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/sbin/veriexec/manifest_lexer.l ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/manifest_lexer.l Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,151 @@ +%{ +/*- + * Copyright (c) 2004-2018, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include "veriexec.h" +#include "manifest_parser.h" + +#define YY_NO_UNPUT + +int lineno = 1; +int bol = 1; +extern int parser_version; + +void yyerror(const char *message); +void warning(const char *message); +int yylex(void); + +%} + +%% + +\n { + lineno++; + bol=1; + return EOL; +} + +[/a-zA-Z0-9\.][^ \t\n=]* { + yylval.string = strdup(yytext); + if (bol) { + bol=0; + return PATH; + } else + return STRING; +} + += { + return EQ; +} + + +[ \t\r] ; /* eat white ones */ + +#>[0-9]+ { + /* + * If we are older than the specified version + * ignore rest of line, otherwise just discard this token. + */ + int skip = atoi(&yytext[2]); + + VERBOSE(3, ("%s: skip if %d <= %d\n", yytext, parser_version, skip)); + if (parser_version <= skip) { + /* treat as a comment, yyless() is cheaper than yyunput() */ + yytext[yyleng - 1] = '#'; + yyless(2); + } +} + +#[^>\n].* ; /* comment */ + +. yyerror("invalid character"); + +%% + +static char *manifest_file = NULL; + +struct string_buf { + const char *buf; + size_t pos, size; +}; + +static int +read_string_buf (void *token, char *dest, int count) +{ + struct string_buf *str_buf_p = (struct string_buf *)token; + ssize_t n; + + if (count < 0) + return 0; + + n = str_buf_p->size - str_buf_p->pos; + if (count < n) + n = count; + + memcpy(dest, str_buf_p->buf + str_buf_p->pos, n); + str_buf_p->pos += n; + + return n; +} + +FILE * +manifest_open (const char *file, const char *file_content) +{ + static struct string_buf str_buf; + + if (manifest_file) { + free(manifest_file); + fclose(yyin); + } + + str_buf.buf = file_content; + str_buf.pos = 0; + str_buf.size = strlen(file_content); + yyin = fropen(&str_buf, read_string_buf); + if (yyin) { + manifest_file = strdup(file); + lineno = 1; + manifest_parser_init(); + } else + manifest_file = NULL; + return yyin; +} + +void +yyerror(const char *string) +{ + fprintf(stderr, "%s: %d: %s at %s\n", + manifest_file, lineno, string, yytext); +} + +int +yywrap(void) +{ + return (1); +} Added: head/sbin/veriexec/manifest_parser.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/manifest_parser.y Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,301 @@ +%{ +/*- + * Copyright (c) 2004-2018, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include "veriexec.h" + +int yylex(void); +void yyerror(const char *); + +/* function prototypes */ +static int convert(char *fp, unsigned int count, unsigned char *out); +static void do_ioctl(void); +static int get_fingerprint_type(const char *fp_type); + +/* ioctl parameter struct */ +#ifdef MAXLABELLEN +static struct verified_exec_label_params lparams; +static struct verified_exec_params *params = &lparams.params; +#else +static struct verified_exec_params oparams; +static struct verified_exec_params *params = &oparams; +#endif + +#ifndef SHA256_DIGEST_LENGTH +# define SHA_DIGEST_LENGTH br_sha1_SIZE +# define SHA256_DIGEST_LENGTH br_sha256_SIZE +# define SHA384_DIGEST_LENGTH br_sha384_SIZE +#endif + +static int fmode; + +extern int lineno; +extern int dev_fd; + +struct fingerprint_type { + const char *fp_type; + int fp_size; +}; + +/* static globals */ +static const struct fingerprint_type fingerprint_table[] = { + { "sha1", SHA_DIGEST_LENGTH }, + { "sha256", SHA256_DIGEST_LENGTH }, +#if MAXFINGERPRINTLEN > 32 + { "sha384", SHA384_DIGEST_LENGTH }, +#endif + { NULL, 0 } +}; + +/* + * Indicate to lexer our version. + * A token #>NUMBER will be consumed (and discared) + * by lexer if parser_version > NUMBER + * Otherwise the rest of the line will be discared + * as for a comment. + */ +int parser_version = 1; + +%} + +%union { + char *string; + int intval; +} + +%token EOL +%token EQ +%token PATH +%token STRING + +%% + +statement: /* empty */ + | statement path attributes eol + | statement error eol { + yyclearin; /* discard lookahead */ + yyerrok; /* no more error */ + fprintf(stderr, + "skipping to next fingerprint\n"); + } + ; + +attributes: /* empty */ + | attributes flag + | attributes attr + ; + +attr: STRING EQ STRING +{ + int fptype; + + fptype = get_fingerprint_type($1); + + /* + * There's only one attribute we care about + */ + if (fingerprint_table[fptype].fp_size) { + strlcpy(params->fp_type, $1, sizeof(params->fp_type)); + if (convert($3, fingerprint_table[fptype].fp_size, + params->fingerprint) < 0) { + yyerror("bad fingerprint"); + YYERROR; + } + } else if (strcmp($1, "label") == 0) { + static int warned_labels = 0; + +#ifdef VERIEXEC_LABEL + strlcpy(lparams.label, $3, sizeof(lparams.label)); + VERBOSE(3, ("version=%d label=%s\n", VeriexecVersion, + lparams.label)); + if (VeriexecVersion > 1) { + params->flags |= VERIEXEC_LABEL; + } else +#endif + if (!warned_labels) { + warnx("ignoring labels"); + warned_labels = 1; + } + } else if (strcmp($1, "mode") == 0) { + fmode = (int)strtol($3, NULL, 8); + } +}; + +flag: STRING +{ + /* + * indirect only matters if the interpreter itself is not + * executable. + */ + if (!strcmp($1, "indirect")) { + params->flags |= VERIEXEC_INDIRECT; + } else if (!strcmp($1, "no_ptrace")) { + params->flags |= VERIEXEC_NOTRACE; + } else if (!strcmp($1, "trusted")) { + params->flags |= VERIEXEC_TRUSTED; + } else if (!strcmp($1, "no_fips")) { +#ifdef VERIEXEC_NOFIPS + params->flags |= VERIEXEC_NOFIPS; +#endif + } +} +; + +path: PATH +{ + if (strlen($1) >= MAXPATHLEN) { + yyerror("Path >= MAXPATHLEN"); + YYERROR; + } + /* + * The majority of files in the manifest are relative + * to the package mount point, but we want absolute paths. + * Prepending '/' is actually all we need. + */ + if (snprintf(params->file, sizeof(params->file), "%s%s%s", + Cdir ? Cdir : "", + ($1[0] == '/') ? "" : "/", + $1) >= (int)sizeof(params->file)) { + errx(EX_DATAERR, "cannot form pathname"); + } + params->flags = 0; + fmode = -1; /* unknown */ +}; + +eol: EOL +{ + if (!YYRECOVERING()) { /* Don't do the ioctl if we saw an error */ + do_ioctl(); + } + params->fp_type[0] = '\0'; /* invalidate it */ +}; + +%% + +void +manifest_parser_init(void) +{ + params->fp_type[0] = '\0'; /* invalidate it */ +} + +int +get_fingerprint_type(const char *fp_type) +{ + int i; + + for (i = 0; fingerprint_table[i].fp_type; i++) + if (!strcmp(fp_type, fingerprint_table[i].fp_type)) + break; + + return (i); +} + +/* + * Convert: takes the hexadecimal string pointed to by fp and converts + * it to a "count" byte binary number which is stored in the array pointed to + * by out. Returns -1 if the conversion fails. + */ +static int +convert(char *fp, unsigned int count, unsigned char *out) +{ + unsigned int i; + int value; + + for (i = 0; i < count; i++) { + value = 0; + if (isdigit(fp[i * 2])) + value += fp[i * 2] - '0'; + else if (isxdigit(fp[i * 2])) + value += 10 + tolower(fp[i * 2]) - 'a'; + else + return (-1); + value <<= 4; + if (isdigit(fp[i * 2 + 1])) + value += fp[i * 2 + 1] - '0'; + else if (isxdigit(fp[i * 2 + 1])) + value += 10 + tolower(fp[i * 2 + 1]) - 'a'; + else + return (-1); + out[i] = value; + } + + return (i); +} + +/* + * Perform the load of the fingerprint. Assumes that the fingerprint + * pseudo-device is opened and the file handle is in fd. + */ +static void +do_ioctl(void) +{ + struct stat st; + + if (params->fp_type[0] == '\0') { + VERBOSE(1,("skipping %s\n", params->file)); + return; + } + + /* + * See if the path is executable, if not put it on the FILE list. + */ + if (fmode > 0) { + if (!(fmode & (S_IXUSR|S_IXGRP|S_IXOTH))) { + params->flags |= VERIEXEC_FILE; + } + } else if (stat(params->file, &st) == 0) { + if (!(st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) { + params->flags |= VERIEXEC_FILE; + } + } + /* + * We may be forcing some flags... + */ + params->flags |= ForceFlags; + VERBOSE(1, ("loading %s for %s %s flags=%#x\n", + params->fp_type, + (params->flags == VERIEXEC_FILE) ? "file" : "executable", + params->file, params->flags)); + +#ifdef VERIEXEC_LABEL + if (params->flags & VERIEXEC_LABEL) { + if (ioctl(dev_fd, VERIEXEC_LABEL_LOAD, &lparams) < 0) + warn("cannot update veriexec label for %s", + params->file); + } else +#endif + if (ioctl(dev_fd, VERIEXEC_SIGNED_LOAD, params) < 0) + warn("cannot update veriexec for %s", params->file); + params->fp_type[0] = '\0'; +} Added: head/sbin/veriexec/veriexec.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/veriexec.8 Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,146 @@ +.\"- +.\" Copyright (c) 2018, Juniper Networks, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 4, 2018 +.Dt VERIEXEC 8 +.Os +.Sh NAME +.Nm veriexec +.Nd manipulate state of mac_veriexec +.Sh SYNOPSIS +.Nm +.Op Fl v +.Op Fl C Ar directory +.Pa manifest +.Nm +.Fl z Ar state +.Nm +.Fl i Ar state +.Nm +.Fl x +.Ar file ... +.Sh DESCRIPTION +.Nm +is a utility to query or manipulate the state of +.Xr mac_veriexec 4 . +.Pp +The first form is for loading a +.Pa manifest . +.Nm +first verifies a digital signature of the +.Ar manifest +and if successful, parses it and feeds its content to kernel. +.Pp +The second form with +.Fl z +is used to modify the +.Ar state , +and with +.Fl i +to query the current +.Ar state . +.Pp +The final form with +.Fl x +is used to test whether +.Ar file +is verified or not. +This requires +.Xr mac_veriexec 4 +to be in the +.Ql active +or +.Ql enforce +state. +.Pp +The possible states +are: +.Bl -tag -width enforce +.It Ar loaded +set automatically when first +.Pa manifest +has been loaded. +.It Ar active +.Xr mac_veriexec 4 +will begin checking files. +This state can only be entered from the +.Ar loaded +state. +.It Ar enforce +.Xr mac_veriexec 4 +will fail attempts to +.Xr exec 2 +or +.Xr open 2 +files with +.Dv O_VERIFY +unless verified. +.It Ar locked +prevent loading of any more manifests. +.El +.Sh MANIFESTS +The manifest contains a mapping of relative pathnames to fingerprints +with optional flags. +For example: +.Bd -literal -offset indent +sbin/veriexec sha256=f22136...c0ff71 no_ptrace +usr/bin/python sha256=5944d9...876525 indirect +sbin/somedaemon sha256=77fc2f...63f5687 label=mod1/val1,mod2/val2 +.Ed +The supported flags are: +.Bl -tag -width indirect +.It Ql indirect +the executable cannot be run directly, +but can be used as an interpreter for example via: +.Bd -literal -offset indent +#!/usr/bin/python +.Ed +.It Ql no_ptrace +do not allow running executable under a debugger. +Useful for any application critical to the security state of system. +.El +.Pp +The +.Ql label +argument allows associating a +.Xr maclabel 7 +with the executable. +Neither +.Nm +nor +.Xr mac_veriexec 4 +(if it supports labels) +pay any attention to the content of the label +they are provided for the use of other +.Xr mac 4 +modules. +.Sh HISTORY +The Verified Exec system first appeared in NetBSD. +This utility derrives from the one found in Junos. +The key difference is the requirement that manifest files +be digitally signed. + + Added: head/sbin/veriexec/veriexec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/veriexec.c Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2018, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "veriexec.h" + +int dev_fd = -1; +int ForceFlags = 0; +int Verbose = 0; +int VeriexecVersion = 0; + +const char *Cdir = NULL; + +static int +veriexec_load(const char *manifest) +{ + unsigned char *content; + int rc; + + content = verify_signed(manifest, VEF_VERBOSE); + if (!content) + errx(EX_USAGE, "cannot verify %s", manifest); + if (manifest_open(manifest, content)) { + rc = yyparse(); + } else { + err(EX_NOINPUT, "cannot load %s", manifest); + } + free(content); + return (rc); +} + +int +main(int argc, char *argv[]) +{ + unsigned long ctl; + int c; + int x; + + dev_fd = open(_PATH_DEV_VERIEXEC, O_WRONLY, 0); + + while ((c = getopt(argc, argv, "C:i:x:vz:")) != -1) { + switch (c) { + case 'C': + Cdir = optarg; + break; + case 'i': + if (dev_fd < 0) { + err(EX_UNAVAILABLE, "cannot open veriexec"); + } + if (ioctl(dev_fd, VERIEXEC_GETSTATE, &x)) { + err(EX_UNAVAILABLE, + "Cannot get veriexec state"); + } + switch (optarg[0]) { + case 'a': /* active */ + ctl = VERIEXEC_STATE_ACTIVE; + break; + case 'e': /* enforce */ + ctl = VERIEXEC_STATE_ENFORCE; + break; + case 'l': /* loaded/locked */ + ctl = (strncmp(optarg, "lock", 4)) ? + VERIEXEC_STATE_LOCKED : + VERIEXEC_STATE_LOADED; + break; + default: + errx(EX_USAGE, "unknown state %s", optarg); + break; + } + exit((x & ctl) == 0); + break; + case 'v': + Verbose++; + break; + case 'x': + /* + * -x says all other args are paths to check. + */ + for (x = 0; optind < argc; optind++) { + if (veriexec_check_path(argv[optind])) { + warn("%s", argv[optind]); + x = 2; + } + } + exit(x); + break; + case 'z': + switch (optarg[0]) { + case 'a': /* active */ + ctl = VERIEXEC_ACTIVE; + break; + case 'd': /* debug* */ + ctl = (strstr(optarg, "off")) ? + VERIEXEC_DEBUG_OFF : VERIEXEC_DEBUG_ON; + if (optind < argc && ctl == VERIEXEC_DEBUG_ON) { + x = atoi(argv[optind]); + if (x == 0) + ctl = VERIEXEC_DEBUG_OFF; + } + break; + case 'e': /* enforce */ + ctl = VERIEXEC_ENFORCE; + break; + case 'g': + ctl = VERIEXEC_GETSTATE; /* get state */ + break; + case 'l': /* lock */ + ctl = VERIEXEC_LOCK; + break; + default: + errx(EX_USAGE, "unknown command %s", optarg); + break; + } + if (dev_fd < 0) { + err(EX_UNAVAILABLE, "cannot open veriexec"); + } + if (ioctl(dev_fd, ctl, &x)) { + err(EX_UNAVAILABLE, "cannot %s veriexec", optarg); + } + if (ctl == VERIEXEC_DEBUG_ON || + ctl == VERIEXEC_DEBUG_OFF) { + printf("debug is: %d\n", x); + } else if (ctl == VERIEXEC_GETSTATE) { + printf("%#o\n", x); + } + exit(EX_OK); + break; + } + } + openlog(getprogname(), LOG_PID, LOG_AUTH); + if (ve_trust_init() < 1) + errx(EX_OSFILE, "cannot initialize trust store"); +#ifdef VERIEXEC_GETVERSION + if (ioctl(dev_fd, VERIEXEC_GETVERSION, &VeriexecVersion)) { + VeriexecVersion = 0; /* unknown */ + } +#endif + + for (; optind < argc; optind++) { + if (veriexec_load(argv[optind])) { + err(EX_DATAERR, "cannot load %s", argv[optind]); + } + } + exit(EX_OK); +} Added: head/sbin/veriexec/veriexec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexec/veriexec.h Tue Feb 26 06:17:23 2019 (r344567) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2018, Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __VERIEXEC_H__ +#define __VERIEXEC_H__ + +#include +#include + +extern int dev_fd; +extern int parser_version; +extern int ForceFlags; +extern int Verbose; +extern int VeriexecVersion; +extern const char *Cdir; + +#define VERBOSE(n, x) if (Verbose > n) printf x + +FILE * manifest_open (const char *file, const char *file_content); +void manifest_parser_init(void); +int yyparse(void); +extern FILE *yyin; + +#endif From owner-svn-src-head@freebsd.org Tue Feb 26 06:19:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144E4150CDA6; Tue, 26 Feb 2019 06:19: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 8AF656D9A6; Tue, 26 Feb 2019 06:19:49 +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 x1Q6Jj4M043419; Mon, 25 Feb 2019 22:19:45 -0800 (PST) (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 x1Q6Jjn2043418; Mon, 25 Feb 2019 22:19:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec In-Reply-To: <201902260617.x1Q6HOra098699@repo.freebsd.org> To: "Simon J. Gerraty" Date: Mon, 25 Feb 2019 22:19:45 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8AF656D9A6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 06:19:50 -0000 > Author: sjg > Date: Tue Feb 26 06:17:23 2019 > New Revision: 344567 > URL: https://svnweb.freebsd.org/changeset/base/344567 > > Log: > Add verifying manifest loader for mac_veriexec > > This tool will verify a signed manifest and load contents into > mac_veriexec for storage > > Sponsored by: Juniper Networks > Differential Revision: D16575 Just a small nit, for future reference, from the template: > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 06:22:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AB49150CF93; Tue, 26 Feb 2019 06:22:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ACC76DD96; Tue, 26 Feb 2019 06:22:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF8BC1065; Tue, 26 Feb 2019 06:22:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q6ME2k003021; Tue, 26 Feb 2019 06:22:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q6MAI6003000; Tue, 26 Feb 2019 06:22:10 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201902260622.x1Q6MAI6003000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 26 Feb 2019 06:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344568 - in head/stand: . common ficl ficl32 i386/loader liblua libsa libsa32 X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/stand: . common ficl ficl32 i386/loader liblua libsa libsa32 X-SVN-Commit-Revision: 344568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0ACC76DD96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 06:22:15 -0000 Author: sjg Date: Tue Feb 26 06:22:10 2019 New Revision: 344568 URL: https://svnweb.freebsd.org/changeset/base/344568 Log: Enable veriexec for loader This relies on libbearssl and libsecureboot to verify files read by loader in a maner equivalent to how mac_veriexec Note: disabled by default. Use is initially expected to be by embeded vendors Reviewed by: emaste, imp Sponsored by: Juniper Networks Differential Revision: D16336 Modified: head/stand/common/boot.c head/stand/common/bootstrap.h head/stand/common/interp_forth.c head/stand/common/interp_simple.c head/stand/common/load_elf.c head/stand/common/load_elf_obj.c head/stand/common/module.c head/stand/ficl/Makefile.depend head/stand/ficl/ficl.h head/stand/ficl/fileaccess.c head/stand/ficl32/Makefile.depend head/stand/i386/loader/Makefile.depend head/stand/liblua/Makefile head/stand/liblua/lstd.c head/stand/libsa/Makefile head/stand/libsa/Makefile.depend head/stand/libsa32/Makefile.depend head/stand/loader.mk Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/boot.c Tue Feb 26 06:22:10 2019 (r344568) @@ -106,6 +106,10 @@ command_boot(int argc, char *argv[]) if (archsw.arch_autoload() != 0) return(CMD_ERROR); +#ifdef LOADER_VERIEXEC + verify_pcr_export(); /* for measured boot */ +#endif + /* Call the exec handler from the loader matching the kernel */ file_formats[fp->f_loader]->l_exec(fp); return(CMD_ERROR); Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/bootstrap.h Tue Feb 26 06:22:10 2019 (r344568) @@ -330,6 +330,9 @@ struct arch_switch /* Probe ZFS pool(s), if needed. */ void (*arch_zfs_probe)(void); + /* Return the hypervisor name/type or NULL if not virtualized. */ + const char *(*arch_hypervisor)(void); + /* For kexec-type loaders, get ksegment structure */ void (*arch_kexec_kseg_get)(int *nseg, void **kseg); }; @@ -344,6 +347,10 @@ time_t time(time_t *tloc); #ifndef CTASSERT #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") +#endif + +#ifdef LOADER_VERIEXEC +#include #endif #endif /* !_BOOTSTRAP_H_ */ Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/interp_forth.c Tue Feb 26 06:22:10 2019 (r344568) @@ -379,6 +379,13 @@ interp_include(const char *filename) return(CMD_ERROR); } +#ifdef LOADER_VERIEXEC + if (verify_file(fd, filename, 0, VE_GUESS) < 0) { + close(fd); + sprintf(command_errbuf,"can't verify '%s'", filename); + return(CMD_ERROR); + } +#endif /* * Read the script into memory. */ Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/interp_simple.c Tue Feb 26 06:22:10 2019 (r344568) @@ -96,6 +96,14 @@ interp_include(const char *filename) return(CMD_ERROR); } +#ifdef LOADER_VERIEXEC + if (verify_file(fd, filename, 0, VE_GUESS) < 0) { + close(fd); + sprintf(command_errbuf,"can't verify '%s'", filename); + return(CMD_ERROR); + } +#endif + /* * Read the script into memory. */ Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/load_elf.c Tue Feb 26 06:22:10 2019 (r344568) @@ -245,6 +245,12 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) goto error; } +#ifdef LOADER_VERIEXEC + if (verify_file(ef->fd, filename, bytes_read, VE_MUST) < 0) { + err = EAUTH; + goto error; + } +#endif return (0); error: Modified: head/stand/common/load_elf_obj.c ============================================================================== --- head/stand/common/load_elf_obj.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/load_elf_obj.c Tue Feb 26 06:22:10 2019 (r344568) @@ -129,6 +129,13 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest, goto oerr; } +#ifdef LOADER_VERIEXEC + if (verify_file(ef.fd, filename, bytes_read, VE_MUST) < 0) { + err = EAUTH; + goto oerr; + } +#endif + kfp = file_findfile(NULL, __elfN(obj_kerneltype)); if (kfp == NULL) { printf("elf" __XSTRING(__ELF_WORD_SIZE) Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/common/module.c Tue Feb 26 06:22:10 2019 (r344568) @@ -104,6 +104,8 @@ command_load(int argc, char *argv[]) { struct preloaded_file *fp; char *typestr; + char *prefix; + char *skip; int dofile, dokld, ch, error; dokld = dofile = 0; @@ -114,11 +116,18 @@ command_load(int argc, char *argv[]) command_errmsg = "no filename specified"; return (CMD_CRIT); } - while ((ch = getopt(argc, argv, "kt:")) != -1) { + prefix = skip = NULL; + while ((ch = getopt(argc, argv, "kp:s:t:")) != -1) { switch(ch) { case 'k': dokld = 1; break; + case 'p': + prefix = optarg; + break; + case 's': + skip = optarg; + break; case 't': typestr = optarg; dofile = 1; @@ -141,6 +150,12 @@ command_load(int argc, char *argv[]) return (CMD_CRIT); } +#ifdef LOADER_VERIEXEC + if (strncmp(typestr, "manifest", 8) == 0) { + return (load_manifest(argv[1], prefix, skip, NULL)); + } +#endif + fp = file_findfile(argv[1], typestr); if (fp) { snprintf(command_errbuf, sizeof(command_errbuf), @@ -434,6 +449,15 @@ file_loadraw(const char *fname, char *type, int insert free(name); return(NULL); } + +#ifdef LOADER_VERIEXEC + if (verify_file(fd, name, 0, VE_MUST) < 0) { + sprintf(command_errbuf, "can't verify '%s'", name); + free(name); + close(fd); + return(NULL); + } +#endif if (archsw.arch_loadaddr != NULL) loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); Modified: head/stand/ficl/Makefile.depend ============================================================================== --- head/stand/ficl/Makefile.depend Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/ficl/Makefile.depend Tue Feb 26 06:22:10 2019 (r344568) @@ -2,9 +2,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/xlocale \ - lib/msun \ + stand/libsa \ .include Modified: head/stand/ficl/ficl.h ============================================================================== --- head/stand/ficl/ficl.h Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/ficl/ficl.h Tue Feb 26 06:22:10 2019 (r344568) @@ -1157,6 +1157,10 @@ typedef void ficlCompileFcn(FICL_SYSTEM *); DATA_SET(Xficl_compile_set, func) SET_DECLARE(Xficl_compile_set, ficlCompileFcn); +#ifdef LOADER_VERIEXEC +#include +#endif + #ifdef __cplusplus } #endif Modified: head/stand/ficl/fileaccess.c ============================================================================== --- head/stand/ficl/fileaccess.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/ficl/fileaccess.c Tue Feb 26 06:22:10 2019 (r344568) @@ -67,14 +67,21 @@ static void ficlFopen(FICL_VM *pVM, char *writeMode) / if (f == NULL) stackPushPtr(pVM->pStack, NULL); else +#ifdef LOADER_VERIEXEC + if (*mode == 'r' && + verify_file(fileno(f), filename, 0, VE_GUESS) < 0) { + fclose(f); + stackPushPtr(pVM->pStack, NULL); + } else +#endif { - ficlFILE *ff = (ficlFILE *)malloc(sizeof(ficlFILE)); - strcpy(ff->filename, filename); - ff->f = f; - stackPushPtr(pVM->pStack, ff); + ficlFILE *ff = (ficlFILE *)malloc(sizeof(ficlFILE)); + strcpy(ff->filename, filename); + ff->f = f; + stackPushPtr(pVM->pStack, ff); - fseek(f, 0, SEEK_SET); - } + fseek(f, 0, SEEK_SET); + } pushIor(pVM, f != NULL); } Modified: head/stand/ficl32/Makefile.depend ============================================================================== --- head/stand/ficl32/Makefile.depend Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/ficl32/Makefile.depend Tue Feb 26 06:22:10 2019 (r344568) @@ -2,9 +2,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/xlocale \ - lib/msun \ + stand/libsa \ .include Modified: head/stand/i386/loader/Makefile.depend ============================================================================== --- head/stand/i386/loader/Makefile.depend Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/i386/loader/Makefile.depend Tue Feb 26 06:22:10 2019 (r344568) @@ -2,15 +2,12 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/xlocale \ - stand/ficl32 \ - stand/geli \ - stand/i386/btx/btx \ - stand/i386/btx/btxldr \ - stand/i386/btx/lib \ - stand/i386/libi386 \ - stand/libsa32 \ + stand/${MACHINE_CPUARCH}/btx/btx \ + stand/${MACHINE_CPUARCH}/btx/btxldr \ + stand/${MACHINE_CPUARCH}/btx/lib \ + stand/${MACHINE_CPUARCH}/libi386 \ + stand/ficl \ + stand/libsa \ .include Modified: head/stand/liblua/Makefile ============================================================================== --- head/stand/liblua/Makefile Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/liblua/Makefile Tue Feb 26 06:22:10 2019 (r344568) @@ -35,5 +35,8 @@ CFLAGS+= -I${BOOTSRC}/include -I${LIBLUASRC} -I${LUASR .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC .endif +.if ${MK_LOADER_VERIEXEC} == "yes" +CFLAGS+= -I${SRCTOP}/lib/libsecureboot/h -DLOADER_VERIEXEC +.endif .include Modified: head/stand/liblua/lstd.c ============================================================================== --- head/stand/liblua/lstd.c Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/liblua/lstd.c Tue Feb 26 06:22:10 2019 (r344568) @@ -31,6 +31,10 @@ __FBSDID("$FreeBSD$"); #include "lstd.h" #include "math.h" +#ifdef LOADER_VERIEXEC +#include +#endif + FILE * fopen(const char *filename, const char *mode) { @@ -75,6 +79,17 @@ fopen(const char *filename, const char *mode) close(fd); return (NULL); } + +#ifdef LOADER_VERIEXEC + /* only regular files and only reading makes sense */ + if (S_ISREG(st.st_mode) && !(m & O_WRONLY)) { + if (verify_file(fd, filename, 0, VE_GUESS) < 0) { + free(f); + close(fd); + return (NULL); + } + } +#endif f->fd = fd; f->offset = 0; Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/libsa/Makefile Tue Feb 26 06:22:10 2019 (r344568) @@ -164,6 +164,11 @@ SRCS+= explicit_bzero.c crc32_libkern.c .include "${SASRC}/geli/Makefile.inc" .endif +.if ${MK_LOADER_VERIEXEC} == "yes" && ${MK_BEARSSL} == "yes" +.include "${SRCTOP}/lib/libbearssl/Makefile.libsa.inc" +.include "${SRCTOP}/lib/libsecureboot/Makefile.libsa.inc" +.endif + # Maybe ZFS .if ${MK_LOADER_ZFS} == "yes" .include "${SASRC}/zfs/Makefile.inc" Modified: head/stand/libsa/Makefile.depend ============================================================================== --- head/stand/libsa/Makefile.depend Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/libsa/Makefile.depend Tue Feb 26 06:22:10 2019 (r344568) @@ -2,10 +2,6 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/arpa \ - include/xlocale \ - lib/libbz2 \ .include Modified: head/stand/libsa32/Makefile.depend ============================================================================== --- head/stand/libsa32/Makefile.depend Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/libsa32/Makefile.depend Tue Feb 26 06:22:10 2019 (r344568) @@ -2,10 +2,7 @@ # Autogenerated - do NOT edit! DIRDEPS = \ - include \ - include/arpa \ - include/xlocale \ - lib/libbz2 \ + stand/libsa \ .include Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Tue Feb 26 06:17:23 2019 (r344567) +++ head/stand/loader.mk Tue Feb 26 06:22:10 2019 (r344568) @@ -73,6 +73,10 @@ SRCS+= interp_simple.c .error Unknown interpreter ${LOADER_INTERP} .endif +.if ${MK_LOADER_VERIEXEC} != "no" +CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h +.endif + .if defined(BOOT_PROMPT_123) CFLAGS+= -DBOOT_PROMPT_123 .endif From owner-svn-src-head@freebsd.org Tue Feb 26 07:01:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C3E150E3A7; Tue, 26 Feb 2019 07:01:43 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D82B6F32E; Tue, 26 Feb 2019 07:01:43 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108160.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1Q6wVa4032571; Mon, 25 Feb 2019 23:01:41 -0800 Received: from nam03-by2-obe.outbound.protection.outlook.com (mail-by2nam03lp2058.outbound.protection.outlook.com [104.47.42.58]) by mx0b-00273201.pphosted.com with ESMTP id 2qvxty85y1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 25 Feb 2019 23:01:40 -0800 Received: from BYAPR05CA0054.namprd05.prod.outlook.com (2603:10b6:a03:74::31) by MWHPR05MB3086.namprd05.prod.outlook.com (2603:10b6:300:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.13; Tue, 26 Feb 2019 07:01:38 +0000 Received: from BY2NAM05FT005.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by BYAPR05CA0054.outlook.office365.com (2603:10b6:a03:74::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.5 via Frontend Transport; Tue, 26 Feb 2019 07:01:38 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.13 as permitted sender) Received: from P-EXFEND-EQX-02.jnpr.net (66.129.239.13) by BY2NAM05FT005.mail.protection.outlook.com (10.152.100.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1665.5 via Frontend Transport; Tue, 26 Feb 2019 07:01:38 +0000 Received: from P-EXBEND-EQX-02.jnpr.net (10.104.8.53) by P-EXFEND-EQX-02.jnpr.net (10.104.8.55) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 25 Feb 2019 23:01:37 -0800 Received: from P-EXBEND-EQX-02.jnpr.net (10.104.8.53) by P-EXBEND-EQX-02.jnpr.net (10.104.8.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 25 Feb 2019 23:01:37 -0800 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-02.jnpr.net (10.104.8.53) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 25 Feb 2019 23:01:37 -0800 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.50.162]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id x1Q71agn020855; Mon, 25 Feb 2019 23:01:37 -0800 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id 8F80F71ECD; Mon, 25 Feb 2019 23:01:36 -0800 (PST) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 8DCF571ECC; Mon, 25 Feb 2019 23:01:36 -0800 (PST) To: CC: , , , Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec In-Reply-To: <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> References: <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> Comments: In-reply-to: "Rodney W. Grimes" message dated "Mon, 25 Feb 2019 22:19:45 -0800." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29413.1551164496.1@kaos.jnpr.net> Date: Mon, 25 Feb 2019 23:01:36 -0800 Message-ID: <32398.1551164496@kaos.jnpr.net> X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.13; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(39860400002)(136003)(396003)(346002)(376002)(2980300002)(199004)(189003)(97756001)(26005)(77096007)(7126003)(86362001)(4744005)(97876018)(478600001)(356004)(486006)(305945005)(11346002)(6346003)(186003)(117636001)(446003)(229853002)(8676002)(14444005)(81166006)(81156014)(8936002)(126002)(47776003)(336012)(50226002)(476003)(97736004)(55016002)(6916009)(53416004)(76506005)(90966002)(105596002)(7696005)(76176011)(6246003)(23726003)(16586007)(50466002)(316002)(5660300002)(2906002)(6266002)(53936002)(106466001)(9686003)(54906003)(69596002)(68736007)(4326008)(107886003)(2351001)(46406003)(450100002); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR05MB3086; H:P-EXFEND-EQX-02.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efca162d-cccd-42c9-3636-08d69bb840bf X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4710095)(4711035)(2017052603328)(7153060); SRVR:MWHPR05MB3086; X-MS-TrafficTypeDiagnostic: MWHPR05MB3086: X-Microsoft-Exchange-Diagnostics: 1; MWHPR05MB3086; 20:ubZU0TZLT2646W8+bSnSy+TIvB7f0RnXHr7puJFe95s3hbZYrbADHg4kRgzihehZ42Gvgw20SJepcw1I7OiEZcfSww5l9dN/fNwRRqWVdHlQqdke18y2m+Yzwot3hkaDHVi7HX0UC8JJ+78faWRCBt9JOk/sbPrPq8jlq1hFvNy7WfN2jXGJPF8HQgn+9oHdMQiq7MNg9a7iv4ZzleaeEXNNUg/dCvOQSdJB7dBq+WPGMQWUjF4whHOL6JMcUEIi4NYDSscuDjRshnbEgjXd9HrKOJJG1St91Ujm+aSFscnCaW6icyJuCW/AePdE9MiWbuMQ34R/qbf57Y4qHy83+qW77lmdRydv1ods8IlrWwET2EkdrS9pwGtbCXHV98aecBQbQefdSuUIwKQUtReptGd6R864iFnwtrDg6pKex7lWo+CjRlJx6km0G6o2rw1Cvs4Fg3sli2f0T1c9A8bXK9HaMLm6Vj3VzqP2gnMQJlwE6hk9+siTSfqiTVgsTj5k X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 096029FF66 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR05MB3086; 23:CmUFd6F0NkemtD9eq9+lU81WUnu+CVgSSPvUxzscf?= =?us-ascii?Q?eEUaDtddrNvYryPNCtnMNTrcsZqpiMG1CxG2erKIHID0R5/ZJW1d7HJ2nJYn?= =?us-ascii?Q?e3HeT+z+RGLkNQ36C+A8GrNNEc3Rv8GeRZBAxk1OLCxCI8vtkH3sB8elLcKc?= =?us-ascii?Q?8atptmxhb4NIoZbW+PiQhF1L9v47k9JPajf+Ha45zd+j5GCWegnnrXjNN8vf?= =?us-ascii?Q?/JgL9dffV1gLUo4B0+qzGtsA0XNf8swQJsIdhCyhtUulMiJxt85Lfgodowyg?= =?us-ascii?Q?4aGb2xHbVjoIWgwybkaGJSb6VEutkLRqG6fHdflexfXEfa7g6PmQXLW9uIFx?= =?us-ascii?Q?tOmsiNEBRsY11hkSs/+aXJgLgVV5P6G1dU4o3Eb0kTBw5acYdNCVbYV+qu5l?= =?us-ascii?Q?MurmF387wvyTe09txI1DeL55011PKv2TAkngUfM/Nvkjg2bLiEIhQ3Dpa/OE?= =?us-ascii?Q?l5vcBWmMWWAz77IcOAJ8Sju53y+zQxlmFgwpD7IaG8iT3Q0gt/cPwooaw/Yy?= =?us-ascii?Q?lRIkqIg9ZOxXiMd7djfVlgZxgzEaw8NM7zMkvscd+Nw8J+5vMbWL6iRLRKbB?= =?us-ascii?Q?OolBlaJOFZM/DGIC1vp1De4UtKiC+Vk8P7e1rNUM5VERsGhkoKj4+e/QkLPY?= =?us-ascii?Q?hpsLcfLyN29GXRnRbaynXvIGJ/jllGODYGU3WVVwsixqxOHGaSyyS2xbo1Di?= =?us-ascii?Q?HnxETNRcse0siLOusXTeHfHykTazwI0fj/sumgAUx454n5VEqdICnKkdN+OG?= =?us-ascii?Q?DWSi7tlCwcatsery2ADVR3bDP+E+H9f6dqQvTlulUcqSHkB7M595aare46+W?= =?us-ascii?Q?J7b57f/TAdVQEbyotQChUn6r+fKLWJnRkpq1mAxRSE0dSFeKGOq7hKGYjJLK?= =?us-ascii?Q?3OdFsNooDfJ3fcTS827sKPblItMyAP2vY4hwSLZgnAWwOZHljPzOm+csxiAa?= =?us-ascii?Q?lcVH9Ms9N65MCsJa8zXU2ucJ8bsQcwAzVt5ltyfji6OiWoJDkuGK3qEcrfp2?= =?us-ascii?Q?hYzxpcDyR1aKXZnjxzLp4WrG4mcAXDeroqfcV+kYL8Mnvja4xu9r1rc43oA4?= =?us-ascii?Q?dwoiDWxh8nEVSMLu2pU482JqkLzbDzi0Ei2fgxI+BfV7HL0Co847EEAb/Gnt?= =?us-ascii?Q?xyVWLrnIt5MiDBXszj2+FnpCW1z522+LMi0O0rrVIU+QtDCBYi9HHGAwy8ul?= =?us-ascii?Q?fc4V8te3hqzikDD+cAp+R9zl6dQ0j0Y36oHts2e9WiyTmsT8rDNUcbaKMh0Q?= =?us-ascii?Q?58ul9wvGxF9wOwyWPpR0aqj8zzeOzw9n+4BIjkK7AYitVADx4qqj1aeYR9fz?= =?us-ascii?Q?MVaj3YeAl9kdz4wD5xIv+ra3Ik8pdgYGCPXWrAyuSRb639ploa+8wVU8fY6O?= =?us-ascii?Q?n5p3kHJ7ssWmlYRenDuELylg7g=3D?= X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: d5zHmf4u3K65hy+Fa4np77NsbX8LHFGBKpKcGr8KEaJtRGzVrJF8gEGiFNkhLcRG6fUghDJoKpUixEDk/IsURah/HgXR/1eh7NFFwlvcI6OnKuvXfROmY0h9ngUng04SZTaW1qVYwCAQSdxtLOz1wn40tIV1QLFWHPpOF7rCmc01lffkoCQeCsdHsv2Q0m1P3sZKXnwrL5HXd7ik4v6JzWikIt4AcrZUzkA3XBP6V582khtw5IC0df6ThPwE/xqhfSHztIV27pxj7+uTLy4D+xTn61r90Jsw7EWqzSIjTOBYxjwWZncMhrqS1NHrr5vjyecWsl4RlYYV92pPBcMU2k1jxXPZLRPuyYj6INAWQwK1lRgSu1VmXXf+Xgi241T1OkTQIk7yM447asyfqx1blPwJCSHggShlw+HGnA1RvPg= X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2019 07:01:38.1664 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: efca162d-cccd-42c9-3636-08d69bb840bf X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.13]; Helo=[P-EXFEND-EQX-02.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB3086 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-26_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=570 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902260053 X-Rspamd-Queue-Id: 5D82B6F32E X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 07:01:44 -0000 Rodney W. Grimes wrote: > > Differential Revision: D16575 > > Just a small nit, for future reference, from the template: Oops, noted thanks. This is all disabled by default, but I did a buildworld with it all enabled just prior so hopefully will not impact anyone negatively and will help those that have been playing with it. Thanks again --sjg From owner-svn-src-head@freebsd.org Tue Feb 26 07:36:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E227D150EC34; Tue, 26 Feb 2019 07:35:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 5265970069; Tue, 26 Feb 2019 07:35:58 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id A546D4355D4; Tue, 26 Feb 2019 18:35:55 +1100 (AEDT) Date: Tue, 26 Feb 2019 18:35:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jason Harmening cc: Bruce Evans , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344562 - head/sys/ufs/ffs In-Reply-To: <414d1964-f822-33f2-8177-872a4cbedd13@gmail.com> Message-ID: <20190226173749.A1863@besplex.bde.org> References: <201902260456.x1Q4uAIu056382@repo.freebsd.org> <20190226162300.M1437@besplex.bde.org> <414d1964-f822-33f2-8177-872a4cbedd13@gmail.com> MIME-Version: 1.0 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=nlC_4_pT8q9DhB4Ho9EA:9 a=Bi0UpnOnt1DyDkdv1HUA:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: 5265970069 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.927,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed 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, 26 Feb 2019 07:36:00 -0000 On Mon, 25 Feb 2019, Jason Harmening wrote: > On 2/25/19 9:46 PM, Bruce Evans wrote: >>=20 >> block_size <=3D PAGE_SIZE is very uncommon for ffs, even on systems with= =20 >> large >> pages.=C2=A0 MINBSIZE is 4096 in ffs (except in my version, it is 512).= =C2=A0 The >> default is 32768 in newfs.=C2=A0 I consider this excessive and only use = it for >> file systems with many files larger than 1GB, but it is the most common= =20 >> size. >> It is larger than the large page size of 8192. > > I think this is a case of filesystem logical block size vs. media sector= =20 > size, right? Here we're checking the devvp's block size, which I think= =20 > should correspond to the sector size. I'd expect cases of that being > greater than PAGE_SIZE to be uncommon, in fact geli warns when that is th= e=20 > case. I probably should've made that clearer in the commit message. Yes, I missed that you are checking devvp. ffs_getpages() also checks devvp. So the bug has nothing to do with file system logical (fragment) or i/o (block) block size's, except file systems themselves won't work unless their i/o size is a multiple of the underlying devices (sector) i/o size. Are there physical disk with sector size > PAGE_SIZE now? It is easy to create virtual (md) disks with sector size > PAGE_SIZE, and this may even be useful for avoiding the related problem of having to access large fs blocks to do i/o to small md sectors. I think it is best to use PAGE_SIZE blocks in all layers and sometimes combine these into clusters. Bruce From owner-svn-src-head@freebsd.org Tue Feb 26 07:49:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 076C7150F756; Tue, 26 Feb 2019 07:49: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 65D5370A4D; Tue, 26 Feb 2019 07:49: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 x1Q7n1Ah043757; Mon, 25 Feb 2019 23:49:01 -0800 (PST) (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 x1Q7n1GI043756; Mon, 25 Feb 2019 23:49:01 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902260749.x1Q7n1GI043756@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344562 - head/sys/ufs/ffs In-Reply-To: <20190226173749.A1863@besplex.bde.org> To: Bruce Evans Date: Mon, 25 Feb 2019 23:49:01 -0800 (PST) CC: Jason Harmening , "Jason A. Harmening" , 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: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT X-Rspamd-Queue-Id: 65D5370A4D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 07:49:04 -0000 > On Mon, 25 Feb 2019, Jason Harmening wrote: > > > On 2/25/19 9:46 PM, Bruce Evans wrote: > >> > >> block_size <= PAGE_SIZE is very uncommon for ffs, even on systems with > >> large > >> pages.  MINBSIZE is 4096 in ffs (except in my version, it is 512).  The > >> default is 32768 in newfs.  I consider this excessive and only use it for > >> file systems with many files larger than 1GB, but it is the most common > >> size. > >> It is larger than the large page size of 8192. > > > > I think this is a case of filesystem logical block size vs. media sector > > size, right? Here we're checking the devvp's block size, which I think > > should correspond to the sector size. I'd expect cases of that being > > greater than PAGE_SIZE to be uncommon, in fact geli warns when that is the > > case. I probably should've made that clearer in the commit message. > > Yes, I missed that you are checking devvp. ffs_getpages() also checks > devvp. > > So the bug has nothing to do with file system logical (fragment) or i/o > (block) block size's, except file systems themselves won't work unless > their i/o size is a multiple of the underlying devices (sector) i/o size. > > Are there physical disk with sector size > PAGE_SIZE now? I have been told that there are some sd/flash devices that have a 16k physical sector size, I have not been able to confirm that information though. > It is easy to > create virtual (md) disks with sector size > PAGE_SIZE, and this may even > be useful for avoiding the related problem of having to access large fs > blocks to do i/o to small md sectors. I think it is best to use PAGE_SIZE > blocks in all layers and sometimes combine these into clusters. > > Bruce -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 08:18:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B367A15102A6; Tue, 26 Feb 2019 08:18:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 535E871B00; Tue, 26 Feb 2019 08:18:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E39C233B; Tue, 26 Feb 2019 08:18:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q8IadK061180; Tue, 26 Feb 2019 08:18:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q8IZGO061175; Tue, 26 Feb 2019 08:18:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201902260818.x1Q8IZGO061175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 26 Feb 2019 08:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Commit-Revision: 344569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 535E871B00 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 08:18:37 -0000 Author: bapt Date: Tue Feb 26 08:18:34 2019 New Revision: 344569 URL: https://svnweb.freebsd.org/changeset/base/344569 Log: Implement parallel mounting for ZFS filesystem It was first implemented on Illumos and then ported to ZoL. This patch is a port to FreeBSD of the ZoL version. This patch also includes a fix for a race condition that was amended With such patch Delphix has seen a huge decrease in latency of the mount phase (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details). With that current change Gandi has measured improvments that are on par with those reported by Delphix. Zol commits incorporated: https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70c9c9e303 https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077567dfea21 Reviewed by: avg, sef Approved by: avg, sef Obtained from: ZoL MFC after: 1 month Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D19098 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 06:22:10 2019 (r344568) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 08:18:34 2019 (r344569) @@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) #define CHECK_SPINNER 30 #define SPINNER_TIME 3 /* seconds */ -#define MOUNT_TIME 5 /* seconds */ +#define MOUNT_TIME 1 /* seconds */ +typedef struct get_all_state { + boolean_t ga_verbose; + get_all_cb_t *ga_cbp; +} get_all_state_t; + static int get_one_dataset(zfs_handle_t *zhp, void *data) { @@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void *data) static int spinval = 0; static int spincheck = 0; static time_t last_spin_time = (time_t)0; - get_all_cb_t *cbp = data; + get_all_state_t *state = data; zfs_type_t type = zfs_get_type(zhp); - if (cbp->cb_verbose) { + if (state->ga_verbose) { if (--spincheck < 0) { time_t now = time(NULL); if (last_spin_time + SPINNER_TIME < now) { @@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void *data) zfs_close(zhp); return (0); } - libzfs_add_handle(cbp, zhp); - assert(cbp->cb_used <= cbp->cb_alloc); + libzfs_add_handle(state->ga_cbp, zhp); + assert(state->ga_cbp->cb_used <= state->ga_cbp->cb_alloc); return (0); } static void -get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t verbose) +get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) { - get_all_cb_t cb = { 0 }; - cb.cb_verbose = verbose; - cb.cb_getone = get_one_dataset; + get_all_state_t state = { + .ga_verbose = verbose, + .ga_cbp = cbp + }; if (verbose) set_progress_header(gettext("Reading ZFS config")); - (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); + (void) zfs_iter_root(g_zfs, get_one_dataset, &state); - *dslist = cb.cb_handles; - *count = cb.cb_used; - if (verbose) finish_progress(gettext("done.")); } @@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, size_t *count * similar, we have a common function with an extra parameter to determine which * mode we are using. */ -#define OP_SHARE 0x1 -#define OP_MOUNT 0x2 +typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; +typedef struct share_mount_state { + share_mount_op_t sm_op; + boolean_t sm_verbose; + int sm_flags; + char *sm_options; + char *sm_proto; /* only valid for OP_SHARE */ + pthread_mutex_t sm_lock; /* protects the remaining fields */ + uint_t sm_total; /* number of filesystems to process */ + uint_t sm_done; /* number of filesystems processed */ + int sm_status; /* -1 if any of the share/mount operations failed */ +} share_mount_state_t; + /* * Share or mount a dataset. */ @@ -6122,6 +6136,29 @@ report_mount_progress(int current, int total) update_progress(info); } +/* + * zfs_foreach_mountpoint() callback that mounts or shares on filesystem and + * updates the progress meter + */ +static int +share_mount_one_cb(zfs_handle_t *zhp, void *arg) +{ + share_mount_state_t *sms = arg; + int ret; + + ret = share_mount_one(zhp, sms->sm_op, sms->sm_flags, sms->sm_proto, + B_FALSE, sms->sm_options); + + pthread_mutex_lock(&sms->sm_lock); + if (ret != 0) + sms->sm_status = ret; + sms->sm_done++; + if (sms->sm_verbose) + report_mount_progress(sms->sm_done, sms->sm_total); + pthread_mutex_unlock(&sms->sm_lock); + return (ret); +} + static void append_options(char *mntopts, char *newopts) { @@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) /* check number of arguments */ if (do_all) { - zfs_handle_t **dslist = NULL; - size_t i, count = 0; char *protocol = NULL; if (op == OP_SHARE && argc > 0) { @@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) } start_progress_timer(); - get_all_datasets(&dslist, &count, verbose); + get_all_cb_t cb = { 0 }; + get_all_datasets(&cb, verbose); - if (count == 0) + if (cb.cb_used == 0) { + if (options != NULL) + free(options); return (0); + } - qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); #ifdef illumos - sa_init_selective_arg_t sharearg; - sharearg.zhandle_arr = dslist; - sharearg.zhandle_len = count; - if ((ret = zfs_init_libshare_arg(zfs_get_handle(dslist[0]), - SA_INIT_SHARE_API_SELECTIVE, &sharearg)) != SA_OK) { - (void) fprintf(stderr, - gettext("Could not initialize libshare, %d"), ret); - return (ret); + if (op == OP_SHARE) { + sa_init_selective_arg_t sharearg; + sharearg.zhandle_arr = cb.cb_handles; + sharearg.zhandle_len = cb.cb_used; + if ((ret = zfs_init_libshare_arg(g_zfs, + SA_INIT_SHARE_API_SELECTIVE, &sharearg)) != SA_OK) { + (void) fprintf(stderr, gettext( + "Could not initialize libshare, %d"), ret); + return (ret); + } } #endif + share_mount_state_t share_mount_state = { 0 }; + share_mount_state.sm_op = op; + share_mount_state.sm_verbose = verbose; + share_mount_state.sm_flags = flags; + share_mount_state.sm_options = options; + share_mount_state.sm_proto = protocol; + share_mount_state.sm_total = cb.cb_used; + pthread_mutex_init(&share_mount_state.sm_lock, NULL); - for (i = 0; i < count; i++) { - if (verbose) - report_mount_progress(i, count); + /* + * libshare isn't mt-safe, so only do the operation in parallel + * if we're mounting. + */ + zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used, + share_mount_one_cb, &share_mount_state, op == OP_MOUNT); + ret = share_mount_state.sm_status; - if (share_mount_one(dslist[i], op, flags, protocol, - B_FALSE, options) != 0) - ret = 1; - zfs_close(dslist[i]); - } - - free(dslist); + for (int i = 0; i < cb.cb_used; i++) + zfs_close(cb.cb_handles[i]); + free(cb.cb_handles); } else if (argc == 0) { struct mnttab entry; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 06:22:10 2019 (r344568) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 08:18:34 2019 (r344569) @@ -579,12 +579,12 @@ typedef struct get_all_cb { zfs_handle_t **cb_handles; size_t cb_alloc; size_t cb_used; - boolean_t cb_verbose; - int (*cb_getone)(zfs_handle_t *, void *); } get_all_cb_t; +void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, size_t, + zfs_iter_f, void*, boolean_t); + void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); -int libzfs_dataset_cmp(const void *, const void *); /* * Functions to create and destroy datasets. Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 26 06:22:10 2019 (r344568) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 26 08:18:34 2019 (r344569) @@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, const vo void libzfs_mnttab_init(libzfs_handle_t *hdl) { + pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); assert(avl_numnodes(&hdl->libzfs_mnttab_cache) == 0); avl_create(&hdl->libzfs_mnttab_cache, libzfs_mnttab_cache_compare, sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); @@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) free(mtn); } avl_destroy(&hdl->libzfs_mnttab_cache); + (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); } void @@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char *f { mnttab_node_t find; mnttab_node_t *mtn; + int ret = ENOENT; if (!hdl->libzfs_mnttab_enable) { struct mnttab srch = { 0 }; @@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char *f return (ENOENT); } + pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0) libzfs_mnttab_update(hdl); @@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char *f mtn = avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); if (mtn) { *entry = mtn->mtn_mt; - return (0); + ret = 0; } - return (ENOENT); + pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); + return (ret); } void @@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, const char *sp { mnttab_node_t *mtn; - if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0) - return; - mtn = zfs_alloc(hdl, sizeof (mnttab_node_t)); - mtn->mtn_mt.mnt_special = zfs_strdup(hdl, special); - mtn->mtn_mt.mnt_mountp = zfs_strdup(hdl, mountp); - mtn->mtn_mt.mnt_fstype = zfs_strdup(hdl, MNTTYPE_ZFS); - mtn->mtn_mt.mnt_mntopts = zfs_strdup(hdl, mntopts); - avl_add(&hdl->libzfs_mnttab_cache, mtn); -} + pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); + if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0) { + mtn = zfs_alloc(hdl, sizeof (mnttab_node_t)); + mtn->mtn_mt.mnt_special = zfs_strdup(hdl, special); + mtn->mtn_mt.mnt_mountp = zfs_strdup(hdl, mountp); + mtn->mtn_mt.mnt_fstype = zfs_strdup(hdl, MNTTYPE_ZFS); + mtn->mtn_mt.mnt_mntopts = zfs_strdup(hdl, mntopts); + avl_add(&hdl->libzfs_mnttab_cache, mtn); + } + pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); +} void libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) @@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const char mnttab_node_t find; mnttab_node_t *ret; + pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); find.mtn_mt.mnt_special = (char *)fsname; if ((ret = avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL)) != NULL) { @@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const char free(ret->mtn_mt.mnt_mntopts); free(ret); } + pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); } int Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue Feb 26 06:22:10 2019 (r344568) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue Feb 26 08:18:34 2019 (r344569) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. */ @@ -73,6 +73,13 @@ struct libzfs_handle { int libzfs_storeerr; /* stuff error messages into buffer */ void *libzfs_sharehdl; /* libshare handle */ boolean_t libzfs_mnttab_enable; + /* + * We need a lock to handle the case where parallel mount + * threads are populating the mnttab cache simultaneously. The + * lock only protects the integrity of the avl tree, and does + * not protect the contents of the mnttab entries themselves. + */ + pthread_mutex_t libzfs_mnttab_cache_lock; avl_tree_t libzfs_mnttab_cache; int libzfs_pool_iter; libzfs_fru_t **libzfs_fru_hash; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue Feb 26 06:22:10 2019 (r344568) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue Feb 26 08:18:34 2019 (r344569) @@ -26,6 +26,7 @@ * Copyright 2016 Igor Kozhukhov * Copyright 2017 Joyent, Inc. * Copyright 2017 RackTop Systems. + * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -34,25 +35,25 @@ * they are used by mount and unmount and when changing a filesystem's * mountpoint. * - * zfs_is_mounted() - * zfs_mount() - * zfs_unmount() - * zfs_unmountall() + * zfs_is_mounted() + * zfs_mount() + * zfs_unmount() + * zfs_unmountall() * * This file also contains the functions used to manage sharing filesystems via * NFS and iSCSI: * - * zfs_is_shared() - * zfs_share() - * zfs_unshare() + * zfs_is_shared() + * zfs_share() + * zfs_unshare() * - * zfs_is_shared_nfs() - * zfs_is_shared_smb() - * zfs_share_proto() - * zfs_shareall(); - * zfs_unshare_nfs() - * zfs_unshare_smb() - * zfs_unshareall_nfs() + * zfs_is_shared_nfs() + * zfs_is_shared_smb() + * zfs_share_proto() + * zfs_shareall(); + * zfs_unshare_nfs() + * zfs_unshare_smb() + * zfs_unshareall_nfs() * zfs_unshareall_smb() * zfs_unshareall() * zfs_unshareall_bypath() @@ -60,8 +61,8 @@ * The following functions are available for pool consumers, and will * mount/unmount and share/unshare all datasets within pool: * - * zpool_enable_datasets() - * zpool_disable_datasets() + * zpool_enable_datasets() + * zpool_disable_datasets() */ #include @@ -83,10 +84,14 @@ #include #include "libzfs_impl.h" +#include #include #define MAXISALEN 257 /* based on sysinfo(2) man page */ +static int mount_tp_nthr = 512; /* tpool threads for multi-threaded mounting */ + +static void zfs_mount_task(void *); static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, zfs_share_proto_t); @@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) } } +/* + * Add the given zfs handle to the cb_handles array, dynamically reallocating + * the array if it is out of space + */ void libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) { if (cbp->cb_alloc == cbp->cb_used) { size_t newsz; - void *ptr; + zfs_handle_t **newhandles; - newsz = cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; - ptr = zfs_realloc(zhp->zfs_hdl, - cbp->cb_handles, cbp->cb_alloc * sizeof (void *), - newsz * sizeof (void *)); - cbp->cb_handles = ptr; + newsz = cbp->cb_alloc != 0 ? cbp->cb_alloc * 2 : 64; + newhandles = zfs_realloc(zhp->zfs_hdl, + cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), + newsz * sizeof (zfs_handle_t *)); + cbp->cb_handles = newhandles; cbp->cb_alloc = newsz; } cbp->cb_handles[cbp->cb_used++] = zhp; } +/* + * Recursive helper function used during file system enumeration + */ static int -mount_cb(zfs_handle_t *zhp, void *data) +zfs_iter_cb(zfs_handle_t *zhp, void *data) { get_all_cb_t *cbp = data; @@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) } libzfs_add_handle(cbp, zhp); - if (zfs_iter_filesystems(zhp, mount_cb, cbp) != 0) { + if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) != 0) { zfs_close(zhp); return (-1); } return (0); } -int -libzfs_dataset_cmp(const void *a, const void *b) +/* + * Sort comparator that compares two mountpoint paths. We sort these paths so + * that subdirectories immediately follow their parents. This means that we + * effectively treat the '/' character as the lowest value non-nul char. + * Since filesystems from non-global zones can have the same mountpoint + * as other filesystems, the comparator sorts global zone filesystems to + * the top of the list. This means that the global zone will traverse the + * filesystem list in the correct order and can stop when it sees the + * first zoned filesystem. In a non-global zone, only the delegated + * filesystems are seen. + * + * An example sorted list using this comparator would look like: + * + * /foo + * /foo/bar + * /foo/bar/baz + * /foo/baz + * /foo.bar + * /foo (NGZ1) + * /foo (NGZ2) + * + * The mount code depend on this ordering to deterministically iterate + * over filesystems in order to spawn parallel mount tasks. + */ +static int +mountpoint_cmp(const void *arga, const void *argb) { - zfs_handle_t **za = (zfs_handle_t **)a; - zfs_handle_t **zb = (zfs_handle_t **)b; + zfs_handle_t *const *zap = arga; + zfs_handle_t *za = *zap; + zfs_handle_t *const *zbp = argb; + zfs_handle_t *zb = *zbp; char mounta[MAXPATHLEN]; char mountb[MAXPATHLEN]; + const char *a = mounta; + const char *b = mountb; boolean_t gota, gotb; + uint64_t zoneda, zonedb; - if ((gota = (zfs_get_type(*za) == ZFS_TYPE_FILESYSTEM)) != 0) - verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, + zoneda = zfs_prop_get_int(za, ZFS_PROP_ZONED); + zonedb = zfs_prop_get_int(zb, ZFS_PROP_ZONED); + if (zoneda && !zonedb) + return (1); + if (!zoneda && zonedb) + return (-1); + gota = (zfs_get_type(za) == ZFS_TYPE_FILESYSTEM); + if (gota) + verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, sizeof (mounta), NULL, NULL, 0, B_FALSE) == 0); - if ((gotb = (zfs_get_type(*zb) == ZFS_TYPE_FILESYSTEM)) != 0) - verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, + gotb = (zfs_get_type(zb) == ZFS_TYPE_FILESYSTEM); + if (gotb) + verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, sizeof (mountb), NULL, NULL, 0, B_FALSE) == 0); - if (gota && gotb) - return (strcmp(mounta, mountb)); + if (gota && gotb) { + while (*a != '\0' && (*a == *b)) { + a++; + b++; + } + if (*a == *b) + return (0); + if (*a == '\0') + return (-1); + if (*b == '\0') + return (-1); + if (*a == '/') + return (-1); + if (*b == '/') + return (-1); + return (*a < *b ? -1 : *a > *b); + } if (gota) return (-1); if (gotb) return (1); - return (strcmp(zfs_get_name(a), zfs_get_name(b))); + /* + * If neither filesystem has a mountpoint, revert to sorting by + * datset name. + */ + return (strcmp(zfs_get_name(za), zfs_get_name(zb))); } /* + * Reutrn true if path2 is a child of path1 + */ +static boolean_t +libzfs_path_contains(const char *path1, const char *path2) +{ + return (strstr(path2, path1) == path2 && path2[strlen(path1)] == '/'); +} + + +static int +non_descendant_idx(zfs_handle_t **handles, size_t num_handles, int idx) +{ + char parent[ZFS_MAXPROPLEN]; + char child[ZFS_MAXPROPLEN]; + int i; + + verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, + sizeof (parent), NULL, NULL, 0, B_FALSE) == 0); + + for (i = idx + 1; i < num_handles; i++) { + verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, + sizeof (child), NULL, NULL, 0, B_FALSE) == 0); + if (!libzfs_path_contains(parent, child)) + break; + } + return (i); +} + +typedef struct mnt_param { + libzfs_handle_t *mnt_hdl; + tpool_t *mnt_tp; + zfs_handle_t **mnt_zhps; /* filesystems to mount */ + size_t mnt_num_handles; + int mnt_idx; /* Index of selected entry to mount */ + zfs_iter_f mnt_func; + void *mnt_data; +} mnt_param_t; + +/* + * Allocate and populate the parameter struct for mount function, and + * schedule mounting of the entry selected by idx. + */ +static void +zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, + size_t num_handles, int idx, zfs_iter_f func, void *data, tpool_t *tp) +{ + mnt_param_t *mnt_param = zfs_alloc(hdl, sizeof (mnt_param_t)); + + mnt_param->mnt_hdl = hdl; + mnt_param->mnt_tp = tp; + mnt_param->mnt_zhps = handles; + mnt_param->mnt_num_handles = num_handles; + mnt_param->mnt_idx = idx; + mnt_param->mnt_func = func; + mnt_param->mnt_data = data; + + (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); +} + +/* + * This is the structure used to keep state of mounting or sharing operations + * during a call to zpool_enable_datasets(). + */ +typedef struct mount_state { + /* + * ms_mntstatus is set to -1 if any mount fails. While multiple threads + * could update this variable concurrently, no synchronization is + * needed as it's only ever set to -1. + */ + int ms_mntstatus; + int ms_mntflags; + const char *ms_mntopts; +} mount_state_t; + +static int +zfs_mount_one(zfs_handle_t *zhp, void *arg) +{ + mount_state_t *ms = arg; + int ret = 0; + + if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) != 0) + ret = ms->ms_mntstatus = -1; + return (ret); +} + +static int +zfs_share_one(zfs_handle_t *zhp, void *arg) +{ + mount_state_t *ms = arg; + int ret = 0; + + if (zfs_share(zhp) != 0) + ret = ms->ms_mntstatus = -1; + return (ret); +} + +/* + * Thread pool function to mount one file system. On completion, it finds and + * schedules its children to be mounted. This depends on the sorting done in + * zfs_foreach_mountpoint(). Note that the degenerate case (chain of entries + * each descending from the previous) will have no parallelism since we always + * have to wait for the parent to finish mounting before we can schedule + * its children. + */ +static void +zfs_mount_task(void *arg) +{ + mnt_param_t *mp = arg; + int idx = mp->mnt_idx; + zfs_handle_t **handles = mp->mnt_zhps; + size_t num_handles = mp->mnt_num_handles; + char mountpoint[ZFS_MAXPROPLEN]; + + verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, mountpoint, + sizeof (mountpoint), NULL, NULL, 0, B_FALSE) == 0); + + if (mp->mnt_func(handles[idx], mp->mnt_data) != 0) + return; + + /* + * We dispatch tasks to mount filesystems with mountpoints underneath + * this one. We do this by dispatching the next filesystem with a + * descendant mountpoint of the one we just mounted, then skip all of + * its descendants, dispatch the next descendant mountpoint, and so on. + * The non_descendant_idx() function skips over filesystems that are + * descendants of the filesystem we just dispatched. + */ + for (int i = idx + 1; i < num_handles; + i = non_descendant_idx(handles, num_handles, i)) { + char child[ZFS_MAXPROPLEN]; + verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, + child, sizeof (child), NULL, NULL, 0, B_FALSE) == 0); + + if (!libzfs_path_contains(mountpoint, child)) + break; /* not a descendant, return */ + zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, + mp->mnt_func, mp->mnt_data, mp->mnt_tp); + } + free(mp); +} + +/* + * Issue the func callback for each ZFS handle contained in the handles + * array. This function is used to mount all datasets, and so this function + * guarantees that filesystems for parent mountpoints are called before their + * children. As such, before issuing any callbacks, we first sort the array + * of handles by mountpoint. + * + * Callbacks are issued in one of two ways: + * + * 1. Sequentially: If the parallel argument is B_FALSE or the ZFS_SERIAL_MOUNT + * environment variable is set, then we issue callbacks sequentially. + * + * 2. In parallel: If the parallel argument is B_TRUE and the ZFS_SERIAL_MOUNT + * environment variable is not set, then we use a tpool to dispatch threads + * to mount filesystems in parallel. This function dispatches tasks to mount + * the filesystems at the top-level mountpoints, and these tasks in turn + * are responsible for recursively mounting filesystems in their children + * mountpoints. + */ +void +zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t **handles, + size_t num_handles, zfs_iter_f func, void *data, boolean_t parallel) +{ + zoneid_t zoneid = getzoneid(); + + /* + * The ZFS_SERIAL_MOUNT environment variable is an undocumented + * variable that can be used as a convenience to do a/b comparison + * of serial vs. parallel mounting. + */ + boolean_t serial_mount = !parallel || + (getenv("ZFS_SERIAL_MOUNT") != NULL); + + /* + * Sort the datasets by mountpoint. See mountpoint_cmp for details + * of how these are sorted. + */ + qsort(handles, num_handles, sizeof (zfs_handle_t *), mountpoint_cmp); + + if (serial_mount) { + for (int i = 0; i < num_handles; i++) { + func(handles[i], data); + } + return; + } + + /* + * Issue the callback function for each dataset using a parallel + * algorithm that uses a thread pool to manage threads. + */ + tpool_t *tp = tpool_create(1, mount_tp_nthr, 0, NULL); + + /* + * There may be multiple "top level" mountpoints outside of the pool's + * root mountpoint, e.g.: /foo /bar. Dispatch a mount task for each of + * these. + */ + for (int i = 0; i < num_handles; + i = non_descendant_idx(handles, num_handles, i)) { + /* + * Since the mountpoints have been sorted so that the zoned + * filesystems are at the end, a zoned filesystem seen from + * the global zone means that we're done. + */ + if (zoneid == GLOBAL_ZONEID && + zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) + break; + zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, + tp); + } + + tpool_wait(tp); /* wait for all scheduled mounts to complete */ + tpool_destroy(tp); +} + +/* * Mount and share all datasets within the given pool. This assumes that no - * datasets within the pool are currently mounted. Because users can create - * complicated nested hierarchies of mountpoints, we first gather all the - * datasets and mountpoints within the pool, and sort them by mountpoint. Once - * we have the list of all filesystems, we iterate over them in order and mount - * and/or share each one. + * datasets within the pool are currently mounted. */ #pragma weak zpool_mount_datasets = zpool_enable_datasets int zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags) { get_all_cb_t cb = { 0 }; - libzfs_handle_t *hdl = zhp->zpool_hdl; + mount_state_t ms = { 0 }; zfs_handle_t *zfsp; - int i, ret = -1; - int *good; + int ret = 0; - /* - * Gather all non-snap datasets within the pool. - */ - if ((zfsp = zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) == NULL) + if ((zfsp = zfs_open(zhp->zpool_hdl, zhp->zpool_name, + ZFS_TYPE_DATASET)) == NULL) goto out; - libzfs_add_handle(&cb, zfsp); - if (zfs_iter_filesystems(zfsp, mount_cb, &cb) != 0) - goto out; /* - * Sort the datasets by mountpoint. + * Gather all non-snapshot datasets within the pool. Start by adding + * the root filesystem for this pool to the list, and then iterate + * over all child filesystems. */ - qsort(cb.cb_handles, cb.cb_used, sizeof (void *), - libzfs_dataset_cmp); + libzfs_add_handle(&cb, zfsp); + if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) != 0) + goto out; /* - * And mount all the datasets, keeping track of which ones - * succeeded or failed. + * Mount all filesystems */ - if ((good = zfs_alloc(zhp->zpool_hdl, - cb.cb_used * sizeof (int))) == NULL) - goto out; + ms.ms_mntopts = mntopts; + ms.ms_mntflags = flags; + zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, cb.cb_used, + zfs_mount_one, &ms, B_TRUE); + if (ms.ms_mntstatus != 0) + ret = ms.ms_mntstatus; - ret = 0; - for (i = 0; i < cb.cb_used; i++) { - if (zfs_mount(cb.cb_handles[i], mntopts, flags) != 0) - ret = -1; - else - good[i] = 1; - } - /* - * Then share all the ones that need to be shared. This needs - * to be a separate pass in order to avoid excessive reloading - * of the configuration. Good should never be NULL since - * zfs_alloc is supposed to exit if memory isn't available. + * Share all filesystems that need to be shared. This needs to be + * a separate pass because libshare is not mt-safe, and so we need + * to share serially. */ - for (i = 0; i < cb.cb_used; i++) { - if (good[i] && zfs_share(cb.cb_handles[i]) != 0) - ret = -1; - } + ms.ms_mntstatus = 0; + zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, cb.cb_used, + zfs_share_one, &ms, B_FALSE); + if (ms.ms_mntstatus != 0) + ret = ms.ms_mntstatus; - free(good); - out: - for (i = 0; i < cb.cb_used; i++) + for (int i = 0; i < cb.cb_used; i++) zfs_close(cb.cb_handles[i]); free(cb.cb_handles); From owner-svn-src-head@freebsd.org Tue Feb 26 08:20:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13A2A151035E; Tue, 26 Feb 2019 08:20:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C06E71C99; Tue, 26 Feb 2019 08:20:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 6559419E3A; Tue, 26 Feb 2019 08:20:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 2968DBD1D9; Tue, 26 Feb 2019 09:20:03 +0100 (CET) Date: Tue, 26 Feb 2019 09:20:03 +0100 From: Baptiste Daroussin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common Message-ID: <20190226082002.metkz433edvfshww@ivaldir.net> References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2d7pcuzqjioj6uyf" Content-Disposition: inline In-Reply-To: <201902260818.x1Q8IZGO061175@repo.freebsd.org> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 8C06E71C99 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 08:20:05 -0000 --2d7pcuzqjioj6uyf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 08:18:35AM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Feb 26 08:18:34 2019 > New Revision: 344569 > URL: https://svnweb.freebsd.org/changeset/base/344569 >=20 > Log: > Implement parallel mounting for ZFS filesystem > =20 > It was first implemented on Illumos and then ported to ZoL. > This patch is a port to FreeBSD of the ZoL version. > This patch also includes a fix for a race condition that was amended > =20 > With such patch Delphix has seen a huge decrease in latency of the moun= t phase > (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details). > With that current change Gandi has measured improvments that are on par= with > those reported by Delphix. > =20 > Zol commits incorporated: > https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c= 70c9c9e303 > https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d407= 7567dfea21 > =20 > Reviewed by: avg, sef > Approved by: avg, sef > Obtained from: ZoL > MFC after: 1 month > Relnotes: yes > Sponsored by: Gandi.net > Differential Revision: https://reviews.freebsd.org/D19098 >=20 Forgot to mention the principal :( Submitted by: jack@gandi.net --2d7pcuzqjioj6uyf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlx09qoACgkQY4mL3PG3 Plol8hAA3ZwfyJu9D18amyEKtkf+88Yc1yPWy+MwtIKSgzR0sG+r9mgGxRVUTfTr CMGPrVnDkbhdd65SdM4UKmH92Q4hQgGaGdhTcJ9F+2JSLBGRlLd8/UEOBGngAoGR d6lBag0thKB9vf+Wyo+d9PPVHCCln/eIX5xgjr0R+8PMSEJYokWIs7uupecn77KH +W5jcnY1MAzGp0fXnhFWYF1NBvZS6qO9jb27HNRnMkU+X5747yR5q2O8v/p0ONKQ rqsnbNa0YfRUrz5e2JPDOrybcauxX5+RzGzJ7nsDSK6lC50WyOP7GNtgl8t54613 JIBBpAvkHF4Ldi88PHU7mF9jZIg+cu06m64GQby89PtQrNuQY+H3z/pYtKljnfU8 MhVT4lbqSLlaK+FmLfgBRbKVeUqjfAA/VmDlw343A8ewTJndO/odOI6D0X2ro+Jc fmjkCCOiLfvxrTzPD+IGvedLurUI62XIHEMkkVHE7UgoB3PbTFb8mxw3pan0xsp7 279o/dhiarkU2FlcLd81axeoiuRvCzF0dNwXgk4vEGpPDTGP1fNYwN34rcA7IfD1 TcgFF4qnm4cP/l5Aihm6Ieo9sE6Tfub8kMAZeSICAQGkSWtu/evy4jZrAJlZ5S+D YdQB7v1b1rgrWXEG8dKYNPwDAq7ap/1I+KCGFlRaOUuRJkP3yN4= =fu+Q -----END PGP SIGNATURE----- --2d7pcuzqjioj6uyf-- From owner-svn-src-head@freebsd.org Tue Feb 26 09:28:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DEE11513479; Tue, 26 Feb 2019 09:28:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31C7C75669; Tue, 26 Feb 2019 09:28:11 +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 21C7D2FF8; Tue, 26 Feb 2019 09:28:11 +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 x1Q9SBKv098440; Tue, 26 Feb 2019 09:28:11 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q9SBp7098439; Tue, 26 Feb 2019 09:28:11 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201902260928.x1Q9SBp7098439@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: Tue, 26 Feb 2019 09:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344570 - head/usr.sbin/sysrc X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/sysrc X-SVN-Commit-Revision: 344570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31C7C75669 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 09:28:11 -0000 Author: 0mp (ports committer) Date: Tue Feb 26 09:28:10 2019 New Revision: 344570 URL: https://svnweb.freebsd.org/changeset/base/344570 Log: sysrc.8: Pet igor and mandoc Reviewed by: bcr Approved by: bcr (doc) Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D19348 Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Tue Feb 26 08:18:34 2019 (r344569) +++ head/usr.sbin/sysrc/sysrc.8 Tue Feb 26 09:28:10 2019 (r344570) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2016 +.Dd February 26, 2019 .Dt SYSRC 8 .Os .Sh NAME @@ -144,7 +144,7 @@ Disable verbose and hide certain errors. When combined with .Sq Fl L and one or more -.Li Ar name +.Ar name arguments, provide only exit status and no output. .It Fl R Ar dir Operate within the root directory @@ -216,7 +216,8 @@ The list of system configuration files is configured i within the variable .Ql rc_conf_files , which by-default contains a space-separated list of pathnames. -On all FreeBSD +On all +.Fx systems, this defaults to the value "/etc/rc.conf /etc/rc.conf.local". Each pathname is sourced in-order upon startup. @@ -276,7 +277,7 @@ it is added For convenience, if the first character is alpha-numeric .Pq letters A-Z, a-z, or numbers 0-9 , dot -.Pq Li . , +.Pq Li \&. , or slash .Pq Li / , .Nm @@ -334,7 +335,7 @@ it is removed For convenience, if the first character is alpha-numeric .Pq letters A-Z, a-z, or numbers 0-9 , dot -.Pq Li . , +.Pq Li \&. , or slash .Pq Li / , .Nm @@ -466,11 +467,11 @@ cloned_interfaces+"alternate" .Dl returns "alternate" if $cloned_interfaces is set . .Sh SEE ALSO .Xr rc.conf 5 , -.Xr rc.subr 8 , .Xr jail 8 , .Xr jexec 8 , .Xr jls 8 , .Xr rc 8 , +.Xr rc.subr 8 , .Xr sysctl 8 .Sh HISTORY A From owner-svn-src-head@freebsd.org Tue Feb 26 09:44:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E45EF1513F84; Tue, 26 Feb 2019 09:44:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470E7763F2; Tue, 26 Feb 2019 09:44:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FA9633BC; Tue, 26 Feb 2019 09:44:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q9iB9g009221; Tue, 26 Feb 2019 09:44:11 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q9iAsX009208; Tue, 26 Feb 2019 09:44:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902260944.x1Q9iAsX009208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 26 Feb 2019 09:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344571 - head/sys/dev/syscons X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/dev/syscons X-SVN-Commit-Revision: 344571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 470E7763F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 09:44:12 -0000 Author: bde Date: Tue Feb 26 09:44:10 2019 New Revision: 344571 URL: https://svnweb.freebsd.org/changeset/base/344571 Log: Attempt to fix build breakage in r344458. Non-x86 arches use an inconsistently named header for the file containing "pc" attributes, and the ifdef messes to include the right header were out of date in the 2 files that I added to the MI files list. Only amd64, arm, i386, mips, powerpc and sparc64 are supposed to support syscons. Only arm and mips were out of date in the ifdef. Test coverage for of syscons in arm is broken (turned off) in NOTES, but syscons is in some other arm config files which universe detects as broken. arm64 and riscv remain broken due to the opposite bug of not turning off sc in NOTES, the same as before r344458 (see r344443). The header is MD to contain possibly-non-"pc" encodings of attributes, but since the attributes are essentially virtual in graphics mode and non-x86 arches only support graphics mode, the header has always been the same on all arches except for different style bugs, so there should be only 1 MI copy of it for syscons' use. It was used in pcvt and still gives an an API and an ABI, so it should be public and MI near or in sys/consio.h. Modified: head/sys/dev/syscons/scterm-dumb.c head/sys/dev/syscons/scterm-sc.c Modified: head/sys/dev/syscons/scterm-dumb.c ============================================================================== --- head/sys/dev/syscons/scterm-dumb.c Tue Feb 26 09:28:10 2019 (r344570) +++ head/sys/dev/syscons/scterm-dumb.c Tue Feb 26 09:44:10 2019 (r344571) @@ -35,7 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include Modified: head/sys/dev/syscons/scterm-sc.c ============================================================================== --- head/sys/dev/syscons/scterm-sc.c Tue Feb 26 09:28:10 2019 (r344570) +++ head/sys/dev/syscons/scterm-sc.c Tue Feb 26 09:44:10 2019 (r344571) @@ -36,7 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include From owner-svn-src-head@freebsd.org Tue Feb 26 09:45:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B4D31514114; Tue, 26 Feb 2019 09:45:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F35AE76692; Tue, 26 Feb 2019 09:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CACA433C6; Tue, 26 Feb 2019 09:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1Q9jjRP009417; Tue, 26 Feb 2019 09:45:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1Q9jj4x009414; Tue, 26 Feb 2019 09:45:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902260945.x1Q9jj4x009414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Feb 2019 09:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344572 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 344572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F35AE76692 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 09:45:46 -0000 Author: kib Date: Tue Feb 26 09:45:44 2019 New Revision: 344572 URL: https://svnweb.freebsd.org/changeset/base/344572 Log: i386 PAE: avoid atomic for pte_store() where possible. Instead carefully write upper word, and only than the lower word with PG_V, for previously invalid ptes. It provides some measurable system time saving on buildworld. Reviewed by: markj Tested by: pho Measured by: bde (early version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D19226 Modified: head/sys/i386/i386/pmap.c head/sys/i386/include/pmap_nopae.h head/sys/i386/include/pmap_pae.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Feb 26 09:44:10 2019 (r344571) +++ head/sys/i386/i386/pmap.c Tue Feb 26 09:45:44 2019 (r344572) @@ -3801,7 +3801,7 @@ validate: if ((origpte & PG_A) != 0) pmap_invalidate_page_int(pmap, va); } else - pte_store(pte, newpte); + pte_store_zero(pte, newpte); unchanged: @@ -4104,7 +4104,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v #endif if (pmap != kernel_pmap) newpte |= PG_U; - pte_store(pte, newpte); + pte_store_zero(pte, newpte); sched_unpin(); return (mpte); } Modified: head/sys/i386/include/pmap_nopae.h ============================================================================== --- head/sys/i386/include/pmap_nopae.h Tue Feb 26 09:44:10 2019 (r344571) +++ head/sys/i386/include/pmap_nopae.h Tue Feb 26 09:45:44 2019 (r344572) @@ -86,6 +86,7 @@ typedef uint32_t pdpt_entry_t; /* Only to keep struct #define pte_store(ptep, pte) do { \ *(u_int *)(ptep) = (u_int)(pte); \ } while (0) +#define pte_store_zero(ptep, pte) pte_store(ptep, pte) #define pte_load(ptep) atomic_load_int(ptep) extern pt_entry_t PTmap[]; Modified: head/sys/i386/include/pmap_pae.h ============================================================================== --- head/sys/i386/include/pmap_pae.h Tue Feb 26 09:44:10 2019 (r344571) +++ head/sys/i386/include/pmap_pae.h Tue Feb 26 09:45:44 2019 (r344572) @@ -101,6 +101,16 @@ typedef uint64_t pt_entry_t; #define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) #define pte_load_clear(ptep) atomic_swap_64_i586(ptep, 0) #define pte_store(ptep, pte) atomic_store_rel_64_i586(ptep, pte) +#define pte_store_zero(ptep, pte) \ +do { \ + uint32_t *p; \ + \ + MPASS((*ptep & PG_V) == 0); \ + p = (void *)ptep; \ + *(p + 1) = (uint32_t)(pte >> 32); \ + __compiler_membar(); \ + *p = (uint32_t)pte; \ +} while (0) #define pte_load(ptep) atomic_load_acq_64_i586(ptep) extern pdpt_entry_t *IdlePDPT; From owner-svn-src-head@freebsd.org Tue Feb 26 09:53:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11AC21514520; Tue, 26 Feb 2019 09:53:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8946276D69; Tue, 26 Feb 2019 09:53:35 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 080CD433567; Tue, 26 Feb 2019 20:53:32 +1100 (AEDT) Date: Tue, 26 Feb 2019 20:53:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344571 - head/sys/dev/syscons In-Reply-To: <201902260944.x1Q9iAsX009208@repo.freebsd.org> Message-ID: <20190226205153.V2396@besplex.bde.org> References: <201902260944.x1Q9iAsX009208@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=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=rTMOX4AMq-ou8s9nHOkA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 8946276D69 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 09:53:36 -0000 On Tue, 26 Feb 2019, Bruce Evans wrote: > ... > Log: > Attempt to fix build breakage in r344458. > ... > ... Test > coverage for of syscons in arm is broken (turned off) in NOTES, but > syscons is in some other arm config files which universe detects as broken. Oops. I forgot to say that this was reported by rpokala. Bruce From owner-svn-src-head@freebsd.org Tue Feb 26 12:48:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DB971519255; Tue, 26 Feb 2019 12:48: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 A83F4845E2; Tue, 26 Feb 2019 12:48: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 x1QClxD2044907; Tue, 26 Feb 2019 04:47:59 -0800 (PST) (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 x1QClxsH044906; Tue, 26 Feb 2019 04:47:59 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261247.x1QClxsH044906@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344570 - head/usr.sbin/sysrc In-Reply-To: <201902260928.x1Q9SBp7098439@repo.freebsd.org> To: Mateusz Piotrowski <0mp@freebsd.org> Date: Tue, 26 Feb 2019 04:47:59 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: A83F4845E2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.960,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 12:48:03 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: 0mp (ports committer) > Date: Tue Feb 26 09:28:10 2019 > New Revision: 344570 > URL: https://svnweb.freebsd.org/changeset/base/344570 > > Log: > sysrc.8: Pet igor and mandoc This only tells the source of why you changed some, a good commit log entry tells me that, and what it is that you changed. You normally do not need to name the file your changed in a commit log as the log is attached to the file, sometimes it does make since to mention a file name in a log entry when you are describing the changes to just that file in a commit that includes many files. A better log might of been: Pet igor and mandoc. Remove unneeded .Li, use .Fx as needed, escape hard stop, and sort cross references. I thank you for the cleanup. > Reviewed by: bcr > Approved by: bcr (doc) > Approved by: krion (mentor, implicit), mat (mentor, implicit) > Differential Revision: https://reviews.freebsd.org/D19348 > > Modified: > head/usr.sbin/sysrc/sysrc.8 > > Modified: head/usr.sbin/sysrc/sysrc.8 > ============================================================================== > --- head/usr.sbin/sysrc/sysrc.8 Tue Feb 26 08:18:34 2019 (r344569) > +++ head/usr.sbin/sysrc/sysrc.8 Tue Feb 26 09:28:10 2019 (r344570) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 2, 2016 > +.Dd February 26, 2019 > .Dt SYSRC 8 > .Os > .Sh NAME > @@ -144,7 +144,7 @@ Disable verbose and hide certain errors. > When combined with > .Sq Fl L > and one or more > -.Li Ar name > +.Ar name > arguments, provide only exit status and no output. > .It Fl R Ar dir > Operate within the root directory > @@ -216,7 +216,8 @@ The list of system configuration files is configured i > within the variable > .Ql rc_conf_files , > which by-default contains a space-separated list of pathnames. > -On all FreeBSD > +On all > +.Fx > systems, this defaults to the value "/etc/rc.conf /etc/rc.conf.local". > Each > pathname is sourced in-order upon startup. > @@ -276,7 +277,7 @@ it is added > For convenience, if the first character is alpha-numeric > .Pq letters A-Z, a-z, or numbers 0-9 , > dot > -.Pq Li . , > +.Pq Li \&. , > or slash > .Pq Li / , > .Nm > @@ -334,7 +335,7 @@ it is removed > For convenience, if the first character is alpha-numeric > .Pq letters A-Z, a-z, or numbers 0-9 , > dot > -.Pq Li . , > +.Pq Li \&. , > or slash > .Pq Li / , > .Nm > @@ -466,11 +467,11 @@ cloned_interfaces+"alternate" > .Dl returns "alternate" if $cloned_interfaces is set . > .Sh SEE ALSO > .Xr rc.conf 5 , > -.Xr rc.subr 8 , > .Xr jail 8 , > .Xr jexec 8 , > .Xr jls 8 , > .Xr rc 8 , > +.Xr rc.subr 8 , > .Xr sysctl 8 > .Sh HISTORY > A > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 13:12:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC9BC1519A7A; Tue, 26 Feb 2019 13:12:33 +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 37BB28534C; Tue, 26 Feb 2019 13:12:32 +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 x1QDCUqc045023; Tue, 26 Feb 2019 05:12:30 -0800 (PST) (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 x1QDCURo045022; Tue, 26 Feb 2019 05:12:30 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261312.x1QDCURo045022@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <20190225175809.GB47081@spindle.one-eyed-alien.net> To: Brooks Davis Date: Tue, 26 Feb 2019 05:12:30 -0800 (PST) CC: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 37BB28534C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 13:12:33 -0000 ... > > We intend to update our license policy to require core sign off for > new GPL code to ensure we're not adding new, tightly integrated > dependencies, to document that we're doing so knowingly, and > to make sure steps aren't missed. The current document is at: > https://www.freebsd.org/internal/software-license.html I take it that this is new text meant to replace the current text that is in the committers guide at: https://www.freebsd.org/doc/en/articles/committers-guide/pref-license.html As to the text in this new version about the All rights reserved phrase the wording "With the ratification of the Berne Convention in 2000, it became obsolete" is more correctly stated as "With the ratification of the Berne Convention in 2000, it became unnecessary". The wording "All rights reserved." are not obsolete and still do carry meaning in law. > -- Brooks -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 13:14:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7054F1519B24; Tue, 26 Feb 2019 13:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC4E854DA; Tue, 26 Feb 2019 13:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E41A85A90; Tue, 26 Feb 2019 13:14:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QDEnRV017622; Tue, 26 Feb 2019 13:14:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QDEnD4017620; Tue, 26 Feb 2019 13:14:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261314.x1QDEnD4017620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 13:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344576 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DC4E854DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 13:14:50 -0000 Author: manu Date: Tue Feb 26 13:14:49 2019 New Revision: 344576 URL: https://svnweb.freebsd.org/changeset/base/344576 Log: arm64: rockchip: clk: rk_clk_composite: Properly use the mask bits RockChip clocks register have a write mask in the upper 16 bits, if a 1 is present the corresponding bit in the lower 16 ones is set. Use this instead of always setting the mask to 0xFFFF0000. This avoids a read of the register. While here add some debug printf useful for debuging clock problems MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c head/sys/arm64/rockchip/clk/rk_clk_composite.h Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.c Tue Feb 26 12:26:25 2019 (r344575) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Tue Feb 26 13:14:49 2019 (r344576) @@ -66,8 +66,11 @@ struct rk_clk_composite_sc { #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) -#define RK_COMPOSITE_WRITE_MASK 0xFFFF0000 +#define RK_CLK_COMPOSITE_MASK_SHIFT 16 +/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#define dprintf(format, arg...) + static int rk_clk_composite_init(struct clknode *clk, device_t dev) { @@ -94,20 +97,21 @@ static int rk_clk_composite_set_gate(struct clknode *clk, bool enable) { struct rk_clk_composite_sc *sc; - uint32_t val; + uint32_t val = 0; sc = clknode_get_softc(clk); if ((sc->flags & RK_CLK_COMPOSITE_HAVE_GATE) == 0) return (0); - DEVICE_LOCK(clk); - READ4(clk, sc->gate_offset, &val); - if (enable) - val &= ~(1 << sc->gate_shift); - else + dprintf("%sabling gate\n", enable ? "En" : "Dis"); + if (!enable) val |= 1 << sc->gate_shift; - WRITE4(clk, sc->gate_offset, val | RK_CLK_COMPOSITE_MASK); + dprintf("sc->gate_shift: %x\n", sc->gate_shift); + val |= (1 << sc->gate_shift) << RK_CLK_COMPOSITE_MASK_SHIFT; + dprintf("Write: gate_offset=%x, val=%x\n", sc->gate_offset, val); + DEVICE_LOCK(clk); + WRITE4(clk, sc->gate_offset, val); DEVICE_UNLOCK(clk); return (0); @@ -117,18 +121,19 @@ static int rk_clk_composite_set_mux(struct clknode *clk, int index) { struct rk_clk_composite_sc *sc; - uint32_t val; + uint32_t val = 0; sc = clknode_get_softc(clk); if ((sc->flags & RK_CLK_COMPOSITE_HAVE_MUX) == 0) return (0); + dprintf("Set mux to %d\n", index); DEVICE_LOCK(clk); - READ4(clk, sc->muxdiv_offset, &val); - val &= ~sc->mux_mask; - val |= index << sc->mux_shift; - WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_COMPOSITE_MASK); + val |= (index << sc->mux_shift); + val |= sc->mux_mask << RK_CLK_COMPOSITE_MASK_SHIFT; + dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val); + WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); return (0); @@ -145,11 +150,12 @@ rk_clk_composite_recalc(struct clknode *clk, uint64_t DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, ®); + dprintf("Read: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, reg); DEVICE_UNLOCK(clk); div = ((reg & sc->div_mask) >> sc->div_shift) + 1; - + dprintf("parent_freq=%lu, div=%u\n", *freq, div); *freq = *freq / div; return (0); @@ -183,22 +189,25 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ struct clknode *p_clk; const char **p_names; uint64_t best, cur; - uint32_t div, best_div, val; + uint32_t div, best_div, val = 0; int p_idx, best_parent; sc = clknode_get_softc(clk); + dprintf("Finding best parent/div for target freq of %lu\n", *fout); p_names = clknode_get_parent_names(clk); for (best_div = 0, best = 0, p_idx = 0; p_idx != clknode_get_parents_num(clk); p_idx++) { p_clk = clknode_find_by_name(p_names[p_idx]); clknode_get_freq(p_clk, &fparent); + dprintf("Testing with parent %s (%d) at freq %lu\n", clknode_get_name(p_clk), p_idx, fparent); div = rk_clk_composite_find_best(sc, fparent, *fout); cur = fparent / div; if ((*fout - cur) < (*fout - best)) { best = cur; best_div = div; best_parent = p_idx; + dprintf("Best parent so far %s (%d) with best freq at %lu\n", clknode_get_name(p_clk), p_idx, best); } } @@ -223,14 +232,17 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ } p_idx = clknode_get_parent_idx(clk); - if (p_idx != best_parent) + if (p_idx != best_parent) { + dprintf("Switching parent index from %d to %d\n", p_idx, best_parent); clknode_set_parent_by_idx(clk, best_parent); + } + dprintf("Setting divider to %d\n", best_div); DEVICE_LOCK(clk); - READ4(clk, sc->muxdiv_offset, &val); - val &= ~sc->div_mask; val |= (best_div - 1) << sc->div_shift; - WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_COMPOSITE_MASK); + val |= (sc->div_mask << sc->div_shift) << RK_CLK_COMPOSITE_MASK_SHIFT; + dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val); + WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); *fout = best; Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.h Tue Feb 26 12:26:25 2019 (r344575) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.h Tue Feb 26 13:14:49 2019 (r344576) @@ -53,8 +53,6 @@ struct rk_clk_composite_def { #define RK_CLK_COMPOSITE_HAVE_MUX 0x0001 #define RK_CLK_COMPOSITE_HAVE_GATE 0x0002 -#define RK_CLK_COMPOSITE_MASK 0xFFFF0000 - int rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef); From owner-svn-src-head@freebsd.org Tue Feb 26 13:15:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 675471519B65; Tue, 26 Feb 2019 13:15:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C044855F4; Tue, 26 Feb 2019 13:15:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB2DD5A91; Tue, 26 Feb 2019 13:15:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QDFVa3017705; Tue, 26 Feb 2019 13:15:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QDFV8H017703; Tue, 26 Feb 2019 13:15:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261315.x1QDFV8H017703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 13:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344577 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C044855F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 13:15:32 -0000 Author: manu Date: Tue Feb 26 13:15:31 2019 New Revision: 344577 URL: https://svnweb.freebsd.org/changeset/base/344577 Log: arm64: rockchip: clk: ARM CLK improvement RockChip clocks register have a write mask in the upper 16 bits, if a 1 is present the corresponding bit in the lower 16 ones is set. Use this instead of always setting the mask to 0xFFFF0000. This avoids a read of the register. While here set the parent after changing its freqeuncy, this reduce the time between changing the parent and changing the divider for the arm clock. MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c head/sys/arm64/rockchip/clk/rk_clk_armclk.h Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_armclk.c Tue Feb 26 13:14:49 2019 (r344576) +++ head/sys/arm64/rockchip/clk/rk_clk_armclk.c Tue Feb 26 13:15:31 2019 (r344577) @@ -72,8 +72,11 @@ struct rk_clk_armclk_sc { #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) -#define RK_ARMCLK_WRITE_MASK 0xFFFF0000 +#define RK_ARMCLK_WRITE_MASK_SHIFT 16 +/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#define dprintf(format, arg...) + static int rk_clk_armclk_init(struct clknode *clk, device_t dev) { @@ -98,14 +101,15 @@ static int rk_clk_armclk_set_mux(struct clknode *clk, int index) { struct rk_clk_armclk_sc *sc; - uint32_t val; + uint32_t val = 0; sc = clknode_get_softc(clk); + dprintf("Set mux to %d\n", index); DEVICE_LOCK(clk); - READ4(clk, sc->muxdiv_offset, &val); - val &= ~(sc->mux_mask >> sc->mux_shift); - val |= index << sc->mux_shift | RK_ARMCLK_WRITE_MASK; + val |= index << sc->mux_shift; + val |= sc->mux_mask << RK_ARMCLK_WRITE_MASK_SHIFT; + dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val); WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); @@ -123,10 +127,12 @@ rk_clk_armclk_recalc(struct clknode *clk, uint64_t *fr DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, ®); + dprintf("Read: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, reg); DEVICE_UNLOCK(clk); div = ((reg & sc->div_mask) >> sc->div_shift) + 1; + dprintf("parent_freq=%lu, div=%u\n", *freq, div); *freq = *freq / div; @@ -141,14 +147,14 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f struct clknode *p_main; const char **p_names; uint64_t best = 0, best_p = 0; - uint32_t div = 0, val; + uint32_t div = 0, val = 0; int err, i, rate = 0; sc = clknode_get_softc(clk); + dprintf("Finding best parent/div for target freq of %lu\n", *fout); p_names = clknode_get_parent_names(clk); p_main = clknode_find_by_name(p_names[sc->main_parent]); - clknode_set_parent_by_idx(clk, sc->main_parent); for (i = 0; i < sc->nrates; i++) { if (sc->rates[i].freq == *fout) { @@ -156,6 +162,10 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f div = sc->rates[i].div; best_p = best * div; rate = i; + dprintf("Best parent %s (%d) with best freq at %lu\n", + clknode_get_name(p_main), + sc->main_parent, + best); break; } } @@ -169,17 +179,22 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f return (0); } + dprintf("Changing parent (%s) freq to %lu\n", clknode_get_name(p_main), best_p); err = clknode_set_freq(p_main, best_p, 0, 1); if (err != 0) printf("Cannot set %s to %lu\n", clknode_get_name(p_main), best_p); + clknode_set_parent_by_idx(clk, sc->main_parent); + + clknode_get_freq(p_main, &best_p); + dprintf("main parent freq at %lu\n", best_p); DEVICE_LOCK(clk); - READ4(clk, sc->muxdiv_offset, &val); - val &= ~sc->div_mask; val |= (div - 1) << sc->div_shift; - WRITE4(clk, sc->muxdiv_offset, val | RK_CLK_ARMCLK_MASK); + val |= sc->div_mask << RK_ARMCLK_WRITE_MASK_SHIFT; + dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val); + WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); *fout = best; Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_armclk.h Tue Feb 26 13:14:49 2019 (r344576) +++ head/sys/arm64/rockchip/clk/rk_clk_armclk.h Tue Feb 26 13:15:31 2019 (r344577) @@ -58,8 +58,6 @@ struct rk_clk_armclk_def { int nrates; }; -#define RK_CLK_ARMCLK_MASK 0xFFFF0000 - int rk_clk_armclk_register(struct clkdom *clkdom, struct rk_clk_armclk_def *clkdef); From owner-svn-src-head@freebsd.org Tue Feb 26 13:16:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FE4C1519BBA; Tue, 26 Feb 2019 13:16:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4E8B85732; Tue, 26 Feb 2019 13:16:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A43D65A92; Tue, 26 Feb 2019 13:16:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QDG5vG017775; Tue, 26 Feb 2019 13:16:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QDG53C017774; Tue, 26 Feb 2019 13:16:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261316.x1QDG53C017774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 13:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344578 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4E8B85732 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 13:16:06 -0000 Author: manu Date: Tue Feb 26 13:16:05 2019 New Revision: 344578 URL: https://svnweb.freebsd.org/changeset/base/344578 Log: arm64: rockchip: rk3328_pll: Multiple improvement RockChip clocks register have a write mask in the upper 16 bits, if a 1 is present the corresponding bit in the lower 16 ones is set. Use this instead of always setting the mask to 0xFFFF0000. This avoids a read of the register. While here, when switching PLL frequency, first switch it to slow mode. When set to slow mode the PLL clock will be the external oscillator. Changing the PLL parameters while its output is used can cause hang (sometimes). MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c head/sys/arm64/rockchip/clk/rk_clk_pll.h Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Tue Feb 26 13:15:31 2019 (r344577) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Tue Feb 26 13:16:05 2019 (r344578) @@ -65,24 +65,30 @@ struct rk_clk_pll_sc { #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) +#define RK_CLK_PLL_MASK_SHIFT 16 + +/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#define dprintf(format, arg...) + static int rk_clk_pll_set_gate(struct clknode *clk, bool enable) { struct rk_clk_pll_sc *sc; - uint32_t val; + uint32_t val = 0; sc = clknode_get_softc(clk); if ((sc->flags & RK_CLK_PLL_HAVE_GATE) == 0) return (0); - DEVICE_LOCK(clk); - READ4(clk, sc->gate_offset, &val); - if (enable) - val &= ~(1 << sc->gate_shift); - else + dprintf("%sabling gate\n", enable ? "En" : "Dis"); + if (!enable) val |= 1 << sc->gate_shift; - WRITE4(clk, sc->gate_offset, val | RK_CLK_PLL_MASK); + dprintf("sc->gate_shift: %x\n", sc->gate_shift); + val |= (1 << sc->gate_shift) << RK_CLK_PLL_MASK_SHIFT; + dprintf("Write: gate_offset=%x, val=%x\n", sc->gate_offset, val); + DEVICE_LOCK(clk); + WRITE4(clk, sc->gate_offset, val); DEVICE_UNLOCK(clk); return (0); @@ -114,8 +120,6 @@ rk_clk_pll_set_gate(struct clknode *clk, bool enable) #define RK3328_CLK_PLL_LOCK_MASK 0x400 -#define RK3328_CLK_PLL_WRITE_MASK 0xFFFF0000 - static int rk3328_clk_pll_init(struct clknode *clk, device_t dev) { @@ -202,31 +206,39 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t DEVICE_LOCK(clk); + /* Setting to slow mode during frequency change */ + reg = sc->mode_val << 16; + dprintf("Set PLL_MODEREG to %x\n", reg); + WRITE4(clk, sc->mode_reg, reg); + /* Setting postdiv1 and fbdiv */ - READ4(clk, sc->base_offset, ®); - reg &= ~(RK3328_CLK_PLL_POSTDIV1_MASK | RK3328_CLK_PLL_FBDIV_MASK); - reg |= rates->postdiv1 << RK3328_CLK_PLL_POSTDIV1_SHIFT; - reg |= rates->fbdiv << RK3328_CLK_PLL_FBDIV_SHIFT; - WRITE4(clk, sc->base_offset, reg | RK3328_CLK_PLL_WRITE_MASK); + reg = (rates->postdiv1 << RK3328_CLK_PLL_POSTDIV1_SHIFT) | + (rates->fbdiv << RK3328_CLK_PLL_FBDIV_SHIFT); + reg |= (RK3328_CLK_PLL_POSTDIV1_MASK | RK3328_CLK_PLL_FBDIV_MASK) << 16; + dprintf("Set PLL_CON0 to %x\n", reg); + WRITE4(clk, sc->base_offset, reg); /* Setting dsmpd, postdiv2 and refdiv */ READ4(clk, sc->base_offset + 0x4, ®); reg &= ~(RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK | RK3328_CLK_PLL_REFDIV_MASK); - reg |= rates->dsmpd << RK3328_CLK_PLL_DSMPD_SHIFT; - reg |= rates->postdiv2 << RK3328_CLK_PLL_POSTDIV2_SHIFT; - reg |= rates->refdiv << RK3328_CLK_PLL_REFDIV_SHIFT; - WRITE4(clk, sc->base_offset + 0x4, reg | RK3328_CLK_PLL_WRITE_MASK); + reg = (rates->dsmpd << RK3328_CLK_PLL_DSMPD_SHIFT) | + (rates->postdiv2 << RK3328_CLK_PLL_POSTDIV2_SHIFT) | + (rates->refdiv << RK3328_CLK_PLL_REFDIV_SHIFT); + reg |= (RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK | RK3328_CLK_PLL_REFDIV_MASK) << 16; + dprintf("Set PLL_CON1 to %x\n", reg); + WRITE4(clk, sc->base_offset + 0x4, reg); /* Setting frac */ READ4(clk, sc->base_offset + 0x8, ®); reg &= ~RK3328_CLK_PLL_FRAC_MASK; reg |= rates->frac << RK3328_CLK_PLL_FRAC_SHIFT; + dprintf("Set PLL_CON2 to %x\n", reg); WRITE4(clk, sc->base_offset + 0x8, reg); /* Setting to normal mode */ - READ4(clk, sc->mode_reg, ®); - reg |= sc->mode_val << 16 | sc->mode_val; + reg = sc->mode_val << 16 | sc->mode_val; + dprintf("Set PLL_MODEREG to %x\n", reg); WRITE4(clk, sc->mode_reg, reg); /* Reading lock */ Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.h Tue Feb 26 13:15:31 2019 (r344577) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.h Tue Feb 26 13:16:05 2019 (r344578) @@ -61,8 +61,6 @@ struct rk_clk_pll_def { #define RK_CLK_PLL_HAVE_GATE 0x1 -#define RK_CLK_PLL_MASK 0xFFFF0000 - int rk3328_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef); int rk3399_clk_pll_register(struct clkdom *clkdom, struct rk_clk_pll_def *clkdef); From owner-svn-src-head@freebsd.org Tue Feb 26 13:17:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BDC51519C60; Tue, 26 Feb 2019 13:17:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3C0E858D3; Tue, 26 Feb 2019 13:17:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BCCF5A94; Tue, 26 Feb 2019 13:17:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QDH982017860; Tue, 26 Feb 2019 13:17:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QDH9w1017859; Tue, 26 Feb 2019 13:17:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261317.x1QDH9w1017859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 13:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344579 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 344579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3C0E858D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 13:17:10 -0000 Author: manu Date: Tue Feb 26 13:17:09 2019 New Revision: 344579 URL: https://svnweb.freebsd.org/changeset/base/344579 Log: arm64: rockchip: rk805: Add LDO regulators Add the 3 LDO regulator found in the RK805 Power Management IC. MFC after: 1 week Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Tue Feb 26 13:16:05 2019 (r344578) +++ head/sys/arm64/rockchip/rk805.c Tue Feb 26 13:17:09 2019 (r344579) @@ -138,6 +138,42 @@ static struct rk805_regdef rk805_regdefs[] = { .voltage_step = 100000, .voltage_nstep = 28, }, + { + .id = RK805_LDO1, + .name = "LDO_REG1", + .enable_reg = RK805_LDO_EN, + .enable_mask = 0x11, + .voltage_reg = RK805_LDO1_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 27, + }, + { + .id = RK805_LDO2, + .name = "LDO_REG2", + .enable_reg = RK805_LDO_EN, + .enable_mask = 0x22, + .voltage_reg = RK805_LDO2_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 27, + }, + { + .id = RK805_LDO3, + .name = "LDO_REG3", + .enable_reg = RK805_LDO_EN, + .enable_mask = 0x44, + .voltage_reg = RK805_LDO3_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 27, + }, }; static struct rk805_regdef rk808_regdefs[] = { From owner-svn-src-head@freebsd.org Tue Feb 26 13:18:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 152ED1519CE1; Tue, 26 Feb 2019 13:18:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF3B985A53; Tue, 26 Feb 2019 13:18:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E6655A95; Tue, 26 Feb 2019 13:18:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QDIFLM017947; Tue, 26 Feb 2019 13:18:15 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QDIFvK017946; Tue, 26 Feb 2019 13:18:15 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261318.x1QDIFvK017946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 13:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344580 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 344580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF3B985A53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 13:18:16 -0000 Author: manu Date: Tue Feb 26 13:18:14 2019 New Revision: 344580 URL: https://svnweb.freebsd.org/changeset/base/344580 Log: arm64: rockchip: rk805: Map the regulator No map function was provided before so every regulator lookup resolved the regulator with id 1, as it uses the default mapper, which is wrong. Correctly map the regulators. While here remove some debug printfs and make them disable by default. MFC after: 1 week Modified: head/sys/arm64/rockchip/rk805.c head/sys/arm64/rockchip/rk805reg.h Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Tue Feb 26 13:17:09 2019 (r344579) +++ head/sys/arm64/rockchip/rk805.c Tue Feb 26 13:18:14 2019 (r344580) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); +/* #define dprintf(sc, format, arg...) device_printf(sc->base_dev, "%s: " format, __func__, arg) */ +#define dprintf(sc, format, arg...) + enum rk_pmic_type { RK805 = 1, RK808, @@ -258,6 +261,9 @@ rk805_regnode_enable(struct regnode *regnode, bool ena sc = regnode_get_softc(regnode); + dprintf(sc, "%sabling regulator %s\n", + enable ? "En" : "Dis", + sc->def->name); rk805_read(sc->base_dev, sc->def->enable_reg, &val, 1); if (enable) val |= sc->def->enable_mask; @@ -308,25 +314,32 @@ rk805_regnode_set_voltage(struct regnode *regnode, int { struct rk805_reg_sc *sc; uint8_t val; + int uvolt; sc = regnode_get_softc(regnode); if (!sc->def->voltage_step) return (ENXIO); + dprintf(sc, "Setting %s to %d<->%d uvolts\n", + sc->def->name, + min_uvolt, + max_uvolt); rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - printf("rk805_set_voltage: Current value for %x: %x\n", sc->def->voltage_reg, val); if (rk805_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) return (ERANGE); - printf("rk805_set_voltage: Setting %x to %x\n", sc->def->voltage_reg, val); rk805_write(sc->base_dev, sc->def->voltage_reg, val); rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - printf("rk805_set_voltage: Set value for %x: %x\n", sc->def->voltage_reg, val); *udelay = 0; + rk805_regnode_reg_to_voltage(sc, val, &uvolt); + dprintf(sc, "Regulator %s set to %d uvolt\n", + sc->def->name, + uvolt); + return (0); } @@ -344,6 +357,10 @@ rk805_regnode_get_voltage(struct regnode *regnode, int rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); rk805_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + dprintf(sc, "Regulator %s is at %d uvolt\n", + sc->def->name, + *uvolt); + return (0); } @@ -377,6 +394,7 @@ rk805_reg_attach(device_t dev, phandle_t node, initdef.std_param.max_uvolt = def->voltage_max; initdef.id = def->id; initdef.ofw_node = node; + regnode = regnode_create(dev, &rk805_regnode_class, &initdef); if (regnode == NULL) { device_printf(dev, "cannot create regulator\n"); @@ -504,11 +522,32 @@ rk805_detach(device_t dev) return (EBUSY); } +static int +rk805_map(device_t dev, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id) +{ + struct rk805_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < sc->nregs; i++) { + if (sc->regs[i]->xref == xref) { + *id = sc->regs[i]->def->id; + return (0); + } + } + + return (ERANGE); +} + static device_method_t rk805_methods[] = { DEVMETHOD(device_probe, rk805_probe), DEVMETHOD(device_attach, rk805_attach), DEVMETHOD(device_detach, rk805_detach), + /* regdev interface */ + DEVMETHOD(regdev_map, rk805_map), DEVMETHOD_END }; Modified: head/sys/arm64/rockchip/rk805reg.h ============================================================================== --- head/sys/arm64/rockchip/rk805reg.h Tue Feb 26 13:17:09 2019 (r344579) +++ head/sys/arm64/rockchip/rk805reg.h Tue Feb 26 13:18:14 2019 (r344580) @@ -61,7 +61,7 @@ #define RK805_LDO3_SLEEP_VSEL 0x40 enum rk805_regulator { - RK805_DCDC1, + RK805_DCDC1 = 0, RK805_DCDC2, RK805_DCDC3, RK805_DCDC4, @@ -71,7 +71,7 @@ enum rk805_regulator { }; enum rk808_regulator { - RK808_DCDC1, + RK808_DCDC1 = 0, RK808_DCDC2, RK808_DCDC3, RK808_DCDC4, From owner-svn-src-head@freebsd.org Tue Feb 26 13:49:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B1F151A7B3; Tue, 26 Feb 2019 13:49:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1893186BAD; Tue, 26 Feb 2019 13:49:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E35DB10A9; Tue, 26 Feb 2019 13:49:53 +0000 (UTC) Date: Tue, 26 Feb 2019 13:49:53 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec Message-ID: <20190226134953.GB39566@FreeBSD.org> References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 1893186BAD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 13:49:54 -0000 On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: > > Author: sjg > > Date: Tue Feb 26 06:17:23 2019 > > New Revision: 344567 > > URL: https://svnweb.freebsd.org/changeset/base/344567 > > > > Log: > > Add verifying manifest loader for mac_veriexec > > > > This tool will verify a signed manifest and load contents into > > mac_veriexec for storage > > > > Sponsored by: Juniper Networks > > Differential Revision: D16575 > > Just a small nit, for future reference, from the template: > > Differential Revision: https://reviews.freebsd.org/D### > (*full* phabric URL needed). IMHO we should just fix the scripts to accept D#### alone, without the URL. We don't do that for PR (bugzilla) references, and the fact that we do for the phab is both needless and confusing. Also, that URL might change one day while we could probably keep the old numbers if we move. ./danfe From owner-svn-src-head@freebsd.org Tue Feb 26 15:29:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C4C151CB71; Tue, 26 Feb 2019 15:29:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36B528A29C; Tue, 26 Feb 2019 15:29:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 160477077; Tue, 26 Feb 2019 15:29:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QFTGCd087792; Tue, 26 Feb 2019 15:29:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QFTGk8087791; Tue, 26 Feb 2019 15:29:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261529.x1QFTGk8087791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 15:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344585 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 344585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36B528A29C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 15:29:17 -0000 Author: manu Date: Tue Feb 26 15:29:16 2019 New Revision: 344585 URL: https://svnweb.freebsd.org/changeset/base/344585 Log: arm64: rockchip: rk_pinctrl: Fix two banks in RK3328 The last two banks don't have 3 bits for the pin function but only 2. This fixes eMMC on the Rock64. MFC after: 1 week Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Tue Feb 26 15:06:44 2019 (r344584) +++ head/sys/arm64/rockchip/rk_pinctrl.c Tue Feb 26 15:29:16 2019 (r344585) @@ -191,13 +191,13 @@ static struct rk_pinctrl_bank rk3328_iomux_bank[] = { .bank_num = 3, .subbank_num = 2, .offset = 0x48, - .nbits = 3, + .nbits = 2, }, { .bank_num = 3, .subbank_num = 3, .offset = 0x4c, - .nbits = 3, + .nbits = 2, }, }; From owner-svn-src-head@freebsd.org Tue Feb 26 15:46:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2A8151D0AD for ; Tue, 26 Feb 2019 15:46:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 1EEDE8AC50 for ; Tue, 26 Feb 2019 15:46:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr1-x441.google.com with SMTP id f14so14510052wrg.1 for ; Tue, 26 Feb 2019 07:46:15 -0800 (PST) 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=3CfvEoqD99EsTwGwFEOgdn2M0M4idDu4CDnGw1atmR0=; b=dpoFlmGnCjc+WCZMavaVWM3B4xZCvuN3bm8sZWgmK9V17RaJWNFEX+MHCxe4R6YP+H fSgflWBKnFNQEm5OhkT5vaAyeMrciam4yizJcMm8ph7jmfC33axmvtOBhvXmtJXrlDMR lghqVQplGvKZuWDhJ8q2IFo4vwv7auBl2+NSIPUv8t7GXbAX2WMudq17UEYWIcG/tmwK zlG0ozf7yKjyUS2/YEBTHW9+7PMmKm0fPkXo5UfCuBep1KcHc2yrz5Y3TT+MQOXHDJis AddAhH8C9AOwhaq+/wJAqPiUNPLELU2/B1RimubOshVAYR1AaKbcVMkuCd3aONUQyZGp WehA== 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=3CfvEoqD99EsTwGwFEOgdn2M0M4idDu4CDnGw1atmR0=; b=pRwViYDuSWlV0TWuZxteHWMq5EQ3V3e6jRCKYeoQWAiCwGFuUS+2ng0AxObLVmIGzD X9VRBw3fzw7ckxSBcm2eRGuxD7GytwniD6AmsdmtfqRorKtXVyT765h2GEF7Hne106fX rHuSTFpqF9rc0i6opAA93umBJwsTfnJTTW5k0jZXMVKMjmt4Kra7bm/tYonfxbjwkutX VP8bEAz11gPGK9aQzt4iuIOLSJc3ZimPOLaxudivJ5hKf28CiJIZsUDpo/lIthO384Mt nymJRE0snPUlKWoUa2vY6VvBlAbIPvFKEfmYTFjrVSCM63YHe6ypy7K2JTl43DFYMowU RvHw== X-Gm-Message-State: AHQUAuaoSMhOqAcU3aGJF2ZSmkhdHwBaLn5eks9KctYfC76PscqMmr5N tFUmDXQfGd2A8PfyVMS5iluTag== X-Google-Smtp-Source: AHgI3Ia6Lgbwukp4iAyec1VbPHJO6zBlsh7Q1tOiv/4voNYr7HFRE0EWF+KVIJfl5xC+Cluzu1exEA== X-Received: by 2002:adf:f60d:: with SMTP id t13mr16744506wrp.225.1551195973881; Tue, 26 Feb 2019 07:46:13 -0800 (PST) Received: from mutt-hbsd (fr3.tor-exit.anon.af. [95.130.9.90]) by smtp.gmail.com with ESMTPSA id w24sm5954355wmi.40.2019.02.26.07.46.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 07:46:12 -0800 (PST) Date: Tue, 26 Feb 2019 10:45:35 -0500 From: Shawn Webb To: rgrimes@freebsd.org Cc: "K. Macy" , svn-src-head@freebsd.org, Matt Macy , svn-src-all@freebsd.org, Brooks Davis , src-committers Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Message-ID: <20190226154535.q32nwf6xyupexkta@mutt-hbsd> References: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ky43oqzfcdcrljjh" Content-Disposition: inline In-Reply-To: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 1EEDE8AC50 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 15:46:15 -0000 --ky43oqzfcdcrljjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > The modest increase in activation energy for that task seems worth it > > > for the short-term gains of reduced integration cost (this code will > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > license statements. The standard GPL v2.0 boiler plate should be add= ed > > > to this file along side the tag. > >=20 > > I've copied the full copyright attribution that is in the > > corresponding files on Linux. Is there some reason why FreeBSD > > requires the files to be inflated with the full license text where the > > original lacks it? >=20 > I think for a few reasons, I doubt you copied the whole distribution > that this file came from, as I am sure that distribution included > a LICENSE file. Second if you actually read the GPL v2 documentation > and follow what it says it says you must do this, just because some > one else does not follow the rules of what the GPL v2 says does not > give us to knowingling not do it. Third this is a particular dangerious > area for BSD to be mixing a GPL code with its kernel, to my knowlege > we have never had any gpl code in the kernel, no have we ever > allowed it, but thats a seperate argument, that should be made. Would the arm64 DTS/DTB files count as "GPL code in the kernel?" I, too, would like less GPL in project, both in userland in kernel. But, I can understand the desire for gcov. Note that I'm not advocating either way that FreeBSD perform an action. ;) 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 --ky43oqzfcdcrljjh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlx1XxoACgkQaoRlj1JF bu6kYA//a/sLMSOmr/6lKX43+5eS3GxWoCUUCL1Kg0j4E1454VqrtqeRJqqrKIIi 2S8AFBq6g9hyDW2avPu8YLNkRErr2l24Q+grsdpMnYpx824f4L6L7AneBPP0tgzd 0c7pkrTlnD9GwbpXibxgDIDwnU8keL10ssmNA9HE/n8ZR90HVl8Tdcl5jogvpxs0 WGuZ/0BXOxQtg0en4fZ6+hAs2TbhCZIS6scCnUMeqzI7ZdUbGsbYKRwOOpsF6tHq rSgQXa3nBhT4Y0mW6N5jzetpceriEyr1ookW0+mYlR4TRIf7ICcbGuQLs6scA0sz 79iY5zbQu5CrDQ7BRF6HehuQYrnPz+zLEtt79AMWzqmVZtIVsnmZ8H1Z/qBMwSN/ Gn6YI5AC3xrZLMfC0528JKTt+Z5vHxVZdTpW/94qZVTpBYXxdfqN0jV19kc1hUoE /9+oJZvMOiYkoOi6TXnTDBZXxWbSIxTYd2DX8xz4DLp/mzFeT8cZ0i2RtGr99waa iCaiHWmJA69MbH4dDzneThdIC5k1Lzau0yFKZBY1LLMI7Q8hBlk5GnvMlqYFf47f YqEmgMYMLnHdBF/LlbUOS9SePSiFpxFysqyUOxHCIKTGDGJspHVTvY1GU0Bq9Q2+ hN6Ulia6Vcpxt7f1PkuYh9cfC0nb7fgkRpfwdbmkN/BRF6Mv1Hg= =NEPo -----END PGP SIGNATURE----- --ky43oqzfcdcrljjh-- From owner-svn-src-head@freebsd.org Tue Feb 26 15:48:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A1C151D1A6; Tue, 26 Feb 2019 15:48:57 +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 13C3C8AE1C; Tue, 26 Feb 2019 15:48:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yeyRgb1CmOUMhyeySgc14P; Tue, 26 Feb 2019 08:48:53 -0700 X-Authority-Analysis: v=2.3 cv=V+gDLtvi c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=CFTnQlWoA9kA:10 a=6I5d2MoRAAAA:8 a=DsloTXpuAAAA:20 a=FNC4LJVLAAAA:20 a=CgiagczvAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=qMP6dC4WzXsR6w6vuLIA:9 a=4_E-T07TjDg-RtRZ:21 a=RtqL5XdMv0z4S2Jo:21 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=ZydqF0V2MF2Cvey6h_li:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [10.250.34.171] (S01060c8ddb626965.gv.shawcable.net [70.67.252.119]) by spqr.komquats.com (Postfix) with ESMTPSA id 7A409256; Tue, 26 Feb 2019 07:48:50 -0800 (PST) Date: Tue, 26 Feb 2019 07:48:27 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <201902260818.x1Q8IZGO061175@repo.freebsd.org> References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> X-CMAE-Envelope: MS4wfNkoUu7gwW6HeOqwPKFqkBXk7oeoSYeGavHSW2tvJdQR++zscrEDbc/47AwwQaP552to+rUG+hOkFJjKSu8Pn6MfBgTnPNqhXaobUn0RoWDkYYq4nKNB L3Wz3vsCyDn/5I+5h31I6MLd60v6A3n9rqn/gCs+IDZMBeJgzhb5Z9MKHnW2TBVYHkgyGsamrS9nlcijwAZlMFMPjKP1oKFJTYUZ6CYm/XGpSBlRaXo/38Rl 7vd6Ft1NNyEr2Aql+hNRPpmQGS5eiBKNrUEwwAy/AxNMGrT/L0yYSdvxWqBZ+KAV X-Rspamd-Queue-Id: 13C3C8AE1C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 15:48:57 -0000 On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin wrote: >Author: bapt >Date: Tue Feb 26 08:18:34 2019 >New Revision: 344569 >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/344569 > >Log: > Implement parallel mounting for ZFS filesystem > =20 > It was first implemented on Illumos and then ported to ZoL=2E > This patch is a port to FreeBSD of the ZoL version=2E > This patch also includes a fix for a race condition that was amended > =20 >With such patch Delphix has seen a huge decrease in latency of the >mount phase > (https://github=2Ecom/openzfs/openzfs/commit/a3f0e2b569 for details)=2E >With that current change Gandi has measured improvments that are on par >with > those reported by Delphix=2E > =20 > Zol commits incorporated: >https://github=2Ecom/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c= 70c9c9e303 >https://github=2Ecom/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d407= 7567dfea21 > =20 > Reviewed by: avg, sef > Approved by: avg, sef > Obtained from: ZoL > MFC after: 1 month > Relnotes: yes > Sponsored by: Gandi=2Enet > Differential Revision: https://reviews=2Efreebsd=2Eorg/D19098 > >Modified: > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec > >Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec Tue Feb 26 >06:22:10 2019 (r344568) >+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec Tue Feb 26 >08:18:34 2019 (r344569) >@@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) >=20 > #define CHECK_SPINNER 30 > #define SPINNER_TIME 3 /* seconds */ >-#define MOUNT_TIME 5 /* seconds */ >+#define MOUNT_TIME 1 /* seconds */ >=20 >+typedef struct get_all_state { >+ boolean_t ga_verbose; >+ get_all_cb_t *ga_cbp; >+} get_all_state_t; >+ > static int > get_one_dataset(zfs_handle_t *zhp, void *data) > { >@@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void *data) > static int spinval =3D 0; > static int spincheck =3D 0; > static time_t last_spin_time =3D (time_t)0; >- get_all_cb_t *cbp =3D data; >+ get_all_state_t *state =3D data; > zfs_type_t type =3D zfs_get_type(zhp); >=20 >- if (cbp->cb_verbose) { >+ if (state->ga_verbose) { > if (--spincheck < 0) { > time_t now =3D time(NULL); > if (last_spin_time + SPINNER_TIME < now) { >@@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void *data) > zfs_close(zhp); > return (0); > } >- libzfs_add_handle(cbp, zhp); >- assert(cbp->cb_used <=3D cbp->cb_alloc); >+ libzfs_add_handle(state->ga_cbp, zhp); >+ assert(state->ga_cbp->cb_used <=3D state->ga_cbp->cb_alloc); >=20 > return (0); > } >=20 > static void >-get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t >verbose) >+get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) > { >- get_all_cb_t cb =3D { 0 }; >- cb=2Ecb_verbose =3D verbose; >- cb=2Ecb_getone =3D get_one_dataset; >+ get_all_state_t state =3D { >+ =2Ega_verbose =3D verbose, >+ =2Ega_cbp =3D cbp >+ }; >=20 > if (verbose) > set_progress_header(gettext("Reading ZFS config")); >- (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); >+ (void) zfs_iter_root(g_zfs, get_one_dataset, &state); >=20 >- *dslist =3D cb=2Ecb_handles; >- *count =3D cb=2Ecb_used; >- > if (verbose) > finish_progress(gettext("done=2E")); > } >@@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, size_t >*count >* similar, we have a common function with an extra parameter to >determine which > * mode we are using=2E > */ >-#define OP_SHARE 0x1 >-#define OP_MOUNT 0x2 >+typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; >=20 >+typedef struct share_mount_state { >+ share_mount_op_t sm_op; >+ boolean_t sm_verbose; >+ int sm_flags; >+ char *sm_options; >+ char *sm_proto; /* only valid for OP_SHARE */ >+ pthread_mutex_t sm_lock; /* protects the remaining fields */ >+ uint_t sm_total; /* number of filesystems to process */ >+ uint_t sm_done; /* number of filesystems processed */ >+ int sm_status; /* -1 if any of the share/mount operations failed */ >+} share_mount_state_t; >+ > /* > * Share or mount a dataset=2E > */ >@@ -6122,6 +6136,29 @@ report_mount_progress(int current, int total) > update_progress(info); > } >=20 >+/* >+ * zfs_foreach_mountpoint() callback that mounts or shares on >filesystem and >+ * updates the progress meter >+ */ >+static int >+share_mount_one_cb(zfs_handle_t *zhp, void *arg) >+{ >+ share_mount_state_t *sms =3D arg; >+ int ret; >+ >+ ret =3D share_mount_one(zhp, sms->sm_op, sms->sm_flags, sms->sm_proto, >+ B_FALSE, sms->sm_options); >+ >+ pthread_mutex_lock(&sms->sm_lock); >+ if (ret !=3D 0) >+ sms->sm_status =3D ret; >+ sms->sm_done++; >+ if (sms->sm_verbose) >+ report_mount_progress(sms->sm_done, sms->sm_total); >+ pthread_mutex_unlock(&sms->sm_lock); >+ return (ret); >+} >+ > static void > append_options(char *mntopts, char *newopts) > { >@@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) >=20 > /* check number of arguments */ > if (do_all) { >- zfs_handle_t **dslist =3D NULL; >- size_t i, count =3D 0; > char *protocol =3D NULL; >=20 > if (op =3D=3D OP_SHARE && argc > 0) { >@@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) > } >=20 > start_progress_timer(); >- get_all_datasets(&dslist, &count, verbose); >+ get_all_cb_t cb =3D { 0 }; >+ get_all_datasets(&cb, verbose); >=20 >- if (count =3D=3D 0) >+ if (cb=2Ecb_used =3D=3D 0) { >+ if (options !=3D NULL) >+ free(options); > return (0); >+ } >=20 >- qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); > #ifdef illumos >- sa_init_selective_arg_t sharearg; >- sharearg=2Ezhandle_arr =3D dslist; >- sharearg=2Ezhandle_len =3D count; >- if ((ret =3D zfs_init_libshare_arg(zfs_get_handle(dslist[0]), >- SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { >- (void) fprintf(stderr, >- gettext("Could not initialize libshare, %d"), ret); >- return (ret); >+ if (op =3D=3D OP_SHARE) { >+ sa_init_selective_arg_t sharearg; >+ sharearg=2Ezhandle_arr =3D cb=2Ecb_handles; >+ sharearg=2Ezhandle_len =3D cb=2Ecb_used; >+ if ((ret =3D zfs_init_libshare_arg(g_zfs, >+ SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { >+ (void) fprintf(stderr, gettext( >+ "Could not initialize libshare, %d"), ret); >+ return (ret); >+ } > } > #endif >+ share_mount_state_t share_mount_state =3D { 0 }; >+ share_mount_state=2Esm_op =3D op; >+ share_mount_state=2Esm_verbose =3D verbose; >+ share_mount_state=2Esm_flags =3D flags; >+ share_mount_state=2Esm_options =3D options; >+ share_mount_state=2Esm_proto =3D protocol; >+ share_mount_state=2Esm_total =3D cb=2Ecb_used; >+ pthread_mutex_init(&share_mount_state=2Esm_lock, NULL); >=20 >- for (i =3D 0; i < count; i++) { >- if (verbose) >- report_mount_progress(i, count); >+ /* >+ * libshare isn't mt-safe, so only do the operation in parallel >+ * if we're mounting=2E >+ */ >+ zfs_foreach_mountpoint(g_zfs, cb=2Ecb_handles, cb=2Ecb_used, >+ share_mount_one_cb, &share_mount_state, op =3D=3D OP_MOUNT); >+ ret =3D share_mount_state=2Esm_status; >=20 >- if (share_mount_one(dslist[i], op, flags, protocol, >- B_FALSE, options) !=3D 0) >- ret =3D 1; >- zfs_close(dslist[i]); >- } >- >- free(dslist); >+ for (int i =3D 0; i < cb=2Ecb_used; i++) >+ zfs_close(cb=2Ecb_handles[i]); >+ free(cb=2Ecb_handles); > } else if (argc =3D=3D 0) { > struct mnttab entry; >=20 > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh Tue Feb 26 >06:22:10 2019 (r344568) >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh Tue Feb 26 >08:18:34 2019 (r344569) >@@ -579,12 +579,12 @@ typedef struct get_all_cb { > zfs_handle_t **cb_handles; > size_t cb_alloc; > size_t cb_used; >- boolean_t cb_verbose; >- int (*cb_getone)(zfs_handle_t *, void *); > } get_all_cb_t; >=20 >+void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, >size_t, >+ zfs_iter_f, void*, boolean_t); >+ > void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); >-int libzfs_dataset_cmp(const void *, const void *); >=20 > /* > * Functions to create and destroy datasets=2E > >Modified: >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec Tue >Feb 26 06:22:10 2019 (r344568) >+++ >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec Tue >Feb 26 08:18:34 2019 (r344569) >@@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, const >vo > void > libzfs_mnttab_init(libzfs_handle_t *hdl) > { >+ pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); > assert(avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0); > avl_create(&hdl->libzfs_mnttab_cache, libzfs_mnttab_cache_compare, > sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); >@@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) > free(mtn); > } > avl_destroy(&hdl->libzfs_mnttab_cache); >+ (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); > } >=20 > void >@@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char >*f > { > mnttab_node_t find; > mnttab_node_t *mtn; >+ int ret =3D ENOENT; >=20 > if (!hdl->libzfs_mnttab_enable) { > struct mnttab srch =3D { 0 }; >@@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char >*f > return (ENOENT); > } >=20 >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) > libzfs_mnttab_update(hdl); >=20 >@@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >char *f > mtn =3D avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); > if (mtn) { > *entry =3D mtn->mtn_mt; >- return (0); >+ ret =3D 0; > } >- return (ENOENT); >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >+ return (ret); > } >=20 > void >@@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, const >char *sp > { > mnttab_node_t *mtn; >=20 >- if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) >- return; >- mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); >- mtn->mtn_mt=2Emnt_special =3D zfs_strdup(hdl, special); >- mtn->mtn_mt=2Emnt_mountp =3D zfs_strdup(hdl, mountp); >- mtn->mtn_mt=2Emnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); >- mtn->mtn_mt=2Emnt_mntopts =3D zfs_strdup(hdl, mntopts); >- avl_add(&hdl->libzfs_mnttab_cache, mtn); >-} >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >+ if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) { >+ mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); >+ mtn->mtn_mt=2Emnt_special =3D zfs_strdup(hdl, special); >+ mtn->mtn_mt=2Emnt_mountp =3D zfs_strdup(hdl, mountp); >+ mtn->mtn_mt=2Emnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); >+ mtn->mtn_mt=2Emnt_mntopts =3D zfs_strdup(hdl, mntopts); >+ avl_add(&hdl->libzfs_mnttab_cache, mtn); >+ } >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >+} =09 >=20 > void > libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) >@@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const >char=20 > mnttab_node_t find; > mnttab_node_t *ret; >=20 >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > find=2Emtn_mt=2Emnt_special =3D (char *)fsname; > if ((ret =3D avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL)) > !=3D NULL) { >@@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const >char=20 > free(ret->mtn_mt=2Emnt_mntopts); > free(ret); > } >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > } >=20 > int > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh Tue >Feb 26 06:22:10 2019 (r344568) >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh Tue >Feb 26 08:18:34 2019 (r344569) >@@ -22,7 +22,7 @@ > /* >* Copyright (c) 2005, 2010, Oracle and/or its affiliates=2E All rights >reserved=2E > * Copyright (c) 2011 Pawel Jakub Dawidek=2E All rights reserved=2E >- * Copyright (c) 2011, 2016 by Delphix=2E All rights reserved=2E >+ * Copyright (c) 2011, 2017 by Delphix=2E All rights reserved=2E >* Copyright (c) 2013 Martin Matuska =2E All rights >reserved=2E > */ >=20 >@@ -73,6 +73,13 @@ struct libzfs_handle { > int libzfs_storeerr; /* stuff error messages into buffer */ > void *libzfs_sharehdl; /* libshare handle */ > boolean_t libzfs_mnttab_enable; >+ /* >+ * We need a lock to handle the case where parallel mount >+ * threads are populating the mnttab cache simultaneously=2E The >+ * lock only protects the integrity of the avl tree, and does >+ * not protect the contents of the mnttab entries themselves=2E >+ */ >+ pthread_mutex_t libzfs_mnttab_cache_lock; > avl_tree_t libzfs_mnttab_cache; > int libzfs_pool_iter; > libzfs_fru_t **libzfs_fru_hash; > >Modified: >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec Tue >Feb 26 06:22:10 2019 (r344568) >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec Tue >Feb 26 08:18:34 2019 (r344569) >@@ -26,6 +26,7 @@ > * Copyright 2016 Igor Kozhukhov > * Copyright 2017 Joyent, Inc=2E > * Copyright 2017 RackTop Systems=2E >+ * Copyright 2018 OmniOS Community Edition (OmniOSce) Association=2E > */ >=20 > /* >@@ -34,25 +35,25 @@ > * they are used by mount and unmount and when changing a filesystem's > * mountpoint=2E > * >- * zfs_is_mounted() >- * zfs_mount() >- * zfs_unmount() >- * zfs_unmountall() >+ * zfs_is_mounted() >+ * zfs_mount() >+ * zfs_unmount() >+ * zfs_unmountall() > * >* This file also contains the functions used to manage sharing >filesystems via > * NFS and iSCSI: > * >- * zfs_is_shared() >- * zfs_share() >- * zfs_unshare() >+ * zfs_is_shared() >+ * zfs_share() >+ * zfs_unshare() > * >- * zfs_is_shared_nfs() >- * zfs_is_shared_smb() >- * zfs_share_proto() >- * zfs_shareall(); >- * zfs_unshare_nfs() >- * zfs_unshare_smb() >- * zfs_unshareall_nfs() >+ * zfs_is_shared_nfs() >+ * zfs_is_shared_smb() >+ * zfs_share_proto() >+ * zfs_shareall(); >+ * zfs_unshare_nfs() >+ * zfs_unshare_smb() >+ * zfs_unshareall_nfs() > * zfs_unshareall_smb() > * zfs_unshareall() > * zfs_unshareall_bypath() >@@ -60,8 +61,8 @@ > * The following functions are available for pool consumers, and will > * mount/unmount and share/unshare all datasets within pool: > * >- * zpool_enable_datasets() >- * zpool_disable_datasets() >+ * zpool_enable_datasets() >+ * zpool_disable_datasets() > */ >=20 > #include >@@ -83,10 +84,14 @@ > #include >=20 > #include "libzfs_impl=2Eh" >+#include >=20 > #include > #define MAXISALEN 257 /* based on sysinfo(2) man page */ >=20 >+static int mount_tp_nthr =3D 512; /* tpool threads for multi-threaded >mounting */ >+ >+static void zfs_mount_task(void *); > static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); > zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, > zfs_share_proto_t); >@@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) > } > } >=20 >+/* >+ * Add the given zfs handle to the cb_handles array, dynamically >reallocating >+ * the array if it is out of space >+ */ > void > libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) > { > if (cbp->cb_alloc =3D=3D cbp->cb_used) { > size_t newsz; >- void *ptr; >+ zfs_handle_t **newhandles; >=20 >- newsz =3D cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; >- ptr =3D zfs_realloc(zhp->zfs_hdl, >- cbp->cb_handles, cbp->cb_alloc * sizeof (void *), >- newsz * sizeof (void *)); >- cbp->cb_handles =3D ptr; >+ newsz =3D cbp->cb_alloc !=3D 0 ? cbp->cb_alloc * 2 : 64; >+ newhandles =3D zfs_realloc(zhp->zfs_hdl, >+ cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), >+ newsz * sizeof (zfs_handle_t *)); >+ cbp->cb_handles =3D newhandles; > cbp->cb_alloc =3D newsz; > } > cbp->cb_handles[cbp->cb_used++] =3D zhp; > } >=20 >+/* >+ * Recursive helper function used during file system enumeration >+ */ > static int >-mount_cb(zfs_handle_t *zhp, void *data) >+zfs_iter_cb(zfs_handle_t *zhp, void *data) > { > get_all_cb_t *cbp =3D data; >=20 >@@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) > } >=20 > libzfs_add_handle(cbp, zhp); >- if (zfs_iter_filesystems(zhp, mount_cb, cbp) !=3D 0) { >+ if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) !=3D 0) { > zfs_close(zhp); > return (-1); > } > return (0); > } >=20 >-int >-libzfs_dataset_cmp(const void *a, const void *b) >+/* >+ * Sort comparator that compares two mountpoint paths=2E We sort these >paths so >+ * that subdirectories immediately follow their parents=2E This means >that we >+ * effectively treat the '/' character as the lowest value non-nul >char=2E >+ * Since filesystems from non-global zones can have the same >mountpoint >+ * as other filesystems, the comparator sorts global zone filesystems >to >+ * the top of the list=2E This means that the global zone will traverse >the >+ * filesystem list in the correct order and can stop when it sees the >+ * first zoned filesystem=2E In a non-global zone, only the delegated >+ * filesystems are seen=2E >+ * >+ * An example sorted list using this comparator would look like: >+ * >+ * /foo >+ * /foo/bar >+ * /foo/bar/baz >+ * /foo/baz >+ * /foo=2Ebar >+ * /foo (NGZ1) >+ * /foo (NGZ2) >+ * >+ * The mount code depend on this ordering to deterministically iterate >+ * over filesystems in order to spawn parallel mount tasks=2E >+ */ >+static int >+mountpoint_cmp(const void *arga, const void *argb) > { >- zfs_handle_t **za =3D (zfs_handle_t **)a; >- zfs_handle_t **zb =3D (zfs_handle_t **)b; >+ zfs_handle_t *const *zap =3D arga; >+ zfs_handle_t *za =3D *zap; >+ zfs_handle_t *const *zbp =3D argb; >+ zfs_handle_t *zb =3D *zbp; > char mounta[MAXPATHLEN]; > char mountb[MAXPATHLEN]; >+ const char *a =3D mounta; >+ const char *b =3D mountb; > boolean_t gota, gotb; >+ uint64_t zoneda, zonedb; >=20 >- if ((gota =3D (zfs_get_type(*za) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) >- verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, >+ zoneda =3D zfs_prop_get_int(za, ZFS_PROP_ZONED); >+ zonedb =3D zfs_prop_get_int(zb, ZFS_PROP_ZONED); >+ if (zoneda && !zonedb) >+ return (1); >+ if (!zoneda && zonedb) >+ return (-1); >+ gota =3D (zfs_get_type(za) =3D=3D ZFS_TYPE_FILESYSTEM); >+ if (gota) >+ verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, > sizeof (mounta), NULL, NULL, 0, B_FALSE) =3D=3D 0); >- if ((gotb =3D (zfs_get_type(*zb) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) >- verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, >+ gotb =3D (zfs_get_type(zb) =3D=3D ZFS_TYPE_FILESYSTEM); >+ if (gotb) >+ verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, > sizeof (mountb), NULL, NULL, 0, B_FALSE) =3D=3D 0); >=20 >- if (gota && gotb) >- return (strcmp(mounta, mountb)); >+ if (gota && gotb) { >+ while (*a !=3D '\0' && (*a =3D=3D *b)) { >+ a++; >+ b++; >+ } >+ if (*a =3D=3D *b) >+ return (0); >+ if (*a =3D=3D '\0') >+ return (-1); >+ if (*b =3D=3D '\0') >+ return (-1); >+ if (*a =3D=3D '/') >+ return (-1); >+ if (*b =3D=3D '/') >+ return (-1); >+ return (*a < *b ? -1 : *a > *b); >+ } >=20 > if (gota) > return (-1); > if (gotb) > return (1); >=20 >- return (strcmp(zfs_get_name(a), zfs_get_name(b))); >+ /* >+ * If neither filesystem has a mountpoint, revert to sorting by >+ * datset name=2E >+ */ >+ return (strcmp(zfs_get_name(za), zfs_get_name(zb))); > } >=20 > /* >+ * Reutrn true if path2 is a child of path1 >+ */ >+static boolean_t >+libzfs_path_contains(const char *path1, const char *path2) >+{ >+ return (strstr(path2, path1) =3D=3D path2 && path2[strlen(path1)] =3D= =3D >'/'); >+} >+ >+ >+static int >+non_descendant_idx(zfs_handle_t **handles, size_t num_handles, int >idx) >+{ >+ char parent[ZFS_MAXPROPLEN]; >+ char child[ZFS_MAXPROPLEN]; >+ int i; >+ >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, >+ sizeof (parent), NULL, NULL, 0, B_FALSE) =3D=3D 0); >+ >+ for (i =3D idx + 1; i < num_handles; i++) { >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, >+ sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); >+ if (!libzfs_path_contains(parent, child)) >+ break; >+ } >+ return (i); >+} >+ >+typedef struct mnt_param { >+ libzfs_handle_t *mnt_hdl; >+ tpool_t *mnt_tp; >+ zfs_handle_t **mnt_zhps; /* filesystems to mount */ >+ size_t mnt_num_handles; >+ int mnt_idx; /* Index of selected entry to mount */ >+ zfs_iter_f mnt_func; >+ void *mnt_data; >+} mnt_param_t; >+ >+/* >+ * Allocate and populate the parameter struct for mount function, and >+ * schedule mounting of the entry selected by idx=2E >+ */ >+static void >+zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, >+ size_t num_handles, int idx, zfs_iter_f func, void *data, tpool_t >*tp) >+{ >+ mnt_param_t *mnt_param =3D zfs_alloc(hdl, sizeof (mnt_param_t)); >+ >+ mnt_param->mnt_hdl =3D hdl; >+ mnt_param->mnt_tp =3D tp; >+ mnt_param->mnt_zhps =3D handles; >+ mnt_param->mnt_num_handles =3D num_handles; >+ mnt_param->mnt_idx =3D idx; >+ mnt_param->mnt_func =3D func; >+ mnt_param->mnt_data =3D data; >+ >+ (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); >+} >+ >+/* >+ * This is the structure used to keep state of mounting or sharing >operations >+ * during a call to zpool_enable_datasets()=2E >+ */ >+typedef struct mount_state { >+ /* >+ * ms_mntstatus is set to -1 if any mount fails=2E While multiple >threads >+ * could update this variable concurrently, no synchronization is >+ * needed as it's only ever set to -1=2E >+ */ >+ int ms_mntstatus; >+ int ms_mntflags; >+ const char *ms_mntopts; >+} mount_state_t; >+ >+static int >+zfs_mount_one(zfs_handle_t *zhp, void *arg) >+{ >+ mount_state_t *ms =3D arg; >+ int ret =3D 0; >+ >+ if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) !=3D 0) >+ ret =3D ms->ms_mntstatus =3D -1; >+ return (ret); >+} >+ >+static int >+zfs_share_one(zfs_handle_t *zhp, void *arg) >+{ >+ mount_state_t *ms =3D arg; >+ int ret =3D 0; >+ >+ if (zfs_share(zhp) !=3D 0) >+ ret =3D ms->ms_mntstatus =3D -1; >+ return (ret); >+} >+ >+/* >+ * Thread pool function to mount one file system=2E On completion, it >finds and >+ * schedules its children to be mounted=2E This depends on the sorting >done in >+ * zfs_foreach_mountpoint()=2E Note that the degenerate case (chain of >entries >+ * each descending from the previous) will have no parallelism since >we always >+ * have to wait for the parent to finish mounting before we can >schedule >+ * its children=2E >+ */ >+static void >+zfs_mount_task(void *arg) >+{ >+ mnt_param_t *mp =3D arg; >+ int idx =3D mp->mnt_idx; >+ zfs_handle_t **handles =3D mp->mnt_zhps; >+ size_t num_handles =3D mp->mnt_num_handles; >+ char mountpoint[ZFS_MAXPROPLEN]; >+ >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, mountpoint, >+ sizeof (mountpoint), NULL, NULL, 0, B_FALSE) =3D=3D 0); >+ >+ if (mp->mnt_func(handles[idx], mp->mnt_data) !=3D 0) >+ return; >+ >+ /* >+ * We dispatch tasks to mount filesystems with mountpoints underneath >+ * this one=2E We do this by dispatching the next filesystem with a >+ * descendant mountpoint of the one we just mounted, then skip all of >+ * its descendants, dispatch the next descendant mountpoint, and so >on=2E >+ * The non_descendant_idx() function skips over filesystems that are >+ * descendants of the filesystem we just dispatched=2E >+ */ >+ for (int i =3D idx + 1; i < num_handles; >+ i =3D non_descendant_idx(handles, num_handles, i)) { >+ char child[ZFS_MAXPROPLEN]; >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, >+ child, sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); >+ >+ if (!libzfs_path_contains(mountpoint, child)) >+ break; /* not a descendant, return */ >+ zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, >+ mp->mnt_func, mp->mnt_data, mp->mnt_tp); >+ } >+ free(mp); >+} >+ >+/* >+ * Issue the func callback for each ZFS handle contained in the >handles >+ * array=2E This function is used to mount all datasets, and so this >function >+ * guarantees that filesystems for parent mountpoints are called >before their >+ * children=2E As such, before issuing any callbacks, we first sort the >array >+ * of handles by mountpoint=2E >+ * >+ * Callbacks are issued in one of two ways: >+ * >+ * 1=2E Sequentially: If the parallel argument is B_FALSE or the >ZFS_SERIAL_MOUNT >+ * environment variable is set, then we issue callbacks >sequentially=2E >+ * >+ * 2=2E In parallel: If the parallel argument is B_TRUE and the >ZFS_SERIAL_MOUNT >+ * environment variable is not set, then we use a tpool to dispatch >threads >+ * to mount filesystems in parallel=2E This function dispatches tasks >to mount >+ * the filesystems at the top-level mountpoints, and these tasks in >turn >+ * are responsible for recursively mounting filesystems in their >children >+ * mountpoints=2E >+ */ >+void >+zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t **handles, >+ size_t num_handles, zfs_iter_f func, void *data, boolean_t >parallel) >+{ >+ zoneid_t zoneid =3D getzoneid(); >+ >+ /* >+ * The ZFS_SERIAL_MOUNT environment variable is an undocumented >+ * variable that can be used as a convenience to do a/b comparison >+ * of serial vs=2E parallel mounting=2E >+ */ >+ boolean_t serial_mount =3D !parallel || >+ (getenv("ZFS_SERIAL_MOUNT") !=3D NULL); >+ >+ /* >+ * Sort the datasets by mountpoint=2E See mountpoint_cmp for details >+ * of how these are sorted=2E >+ */ >+ qsort(handles, num_handles, sizeof (zfs_handle_t *), mountpoint_cmp); >+ >+ if (serial_mount) { >+ for (int i =3D 0; i < num_handles; i++) { >+ func(handles[i], data); >+ } >+ return; >+ } >+ >+ /* >+ * Issue the callback function for each dataset using a parallel >+ * algorithm that uses a thread pool to manage threads=2E >+ */ >+ tpool_t *tp =3D tpool_create(1, mount_tp_nthr, 0, NULL); >+ >+ /* >+ * There may be multiple "top level" mountpoints outside of the >pool's >+ * root mountpoint, e=2Eg=2E: /foo /bar=2E Dispatch a mount task for ea= ch >of >+ * these=2E >+ */ >+ for (int i =3D 0; i < num_handles; >+ i =3D non_descendant_idx(handles, num_handles, i)) { >+ /* >+ * Since the mountpoints have been sorted so that the zoned >+ * filesystems are at the end, a zoned filesystem seen from >+ * the global zone means that we're done=2E >+ */ >+ if (zoneid =3D=3D GLOBAL_ZONEID && >+ zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) >+ break; >+ zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, >+ tp); >+ } >+ >+ tpool_wait(tp); /* wait for all scheduled mounts to complete */ >+ tpool_destroy(tp); >+} >+ >+/* >* Mount and share all datasets within the given pool=2E This assumes >that no >- * datasets within the pool are currently mounted=2E Because users can >create >- * complicated nested hierarchies of mountpoints, we first gather all >the >- * datasets and mountpoints within the pool, and sort them by >mountpoint=2E Once >- * we have the list of all filesystems, we iterate over them in order >and mount >- * and/or share each one=2E >+ * datasets within the pool are currently mounted=2E > */ > #pragma weak zpool_mount_datasets =3D zpool_enable_datasets > int >zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int >flags) > { > get_all_cb_t cb =3D { 0 }; >- libzfs_handle_t *hdl =3D zhp->zpool_hdl; >+ mount_state_t ms =3D { 0 }; > zfs_handle_t *zfsp; >- int i, ret =3D -1; >- int *good; >+ int ret =3D 0; >=20 >- /* >- * Gather all non-snap datasets within the pool=2E >- */ >- if ((zfsp =3D zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) =3D=3D >NULL) >+ if ((zfsp =3D zfs_open(zhp->zpool_hdl, zhp->zpool_name, >+ ZFS_TYPE_DATASET)) =3D=3D NULL) > goto out; >=20 >- libzfs_add_handle(&cb, zfsp); >- if (zfs_iter_filesystems(zfsp, mount_cb, &cb) !=3D 0) >- goto out; > /* >- * Sort the datasets by mountpoint=2E >+ * Gather all non-snapshot datasets within the pool=2E Start by adding >+ * the root filesystem for this pool to the list, and then iterate >+ * over all child filesystems=2E > */ >- qsort(cb=2Ecb_handles, cb=2Ecb_used, sizeof (void *), >- libzfs_dataset_cmp); >+ libzfs_add_handle(&cb, zfsp); >+ if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) !=3D 0) >+ goto out; >=20 > /* >- * And mount all the datasets, keeping track of which ones >- * succeeded or failed=2E >+ * Mount all filesystems > */ >- if ((good =3D zfs_alloc(zhp->zpool_hdl, >- cb=2Ecb_used * sizeof (int))) =3D=3D NULL) >- goto out; >+ ms=2Ems_mntopts =3D mntopts; >+ ms=2Ems_mntflags =3D flags; >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb=2Ecb_handles, cb=2Ecb_used, >+ zfs_mount_one, &ms, B_TRUE); >+ if (ms=2Ems_mntstatus !=3D 0) >+ ret =3D ms=2Ems_mntstatus; >=20 >- ret =3D 0; >- for (i =3D 0; i < cb=2Ecb_used; i++) { >- if (zfs_mount(cb=2Ecb_handles[i], mntopts, flags) !=3D 0) >- ret =3D -1; >- else >- good[i] =3D 1; >- } >- > /* >- * Then share all the ones that need to be shared=2E This needs >- * to be a separate pass in order to avoid excessive reloading >- * of the configuration=2E Good should never be NULL since >- * zfs_alloc is supposed to exit if memory isn't available=2E >+ * Share all filesystems that need to be shared=2E This needs to be >+ * a separate pass because libshare is not mt-safe, and so we need >+ * to share serially=2E > */ >- for (i =3D 0; i < cb=2Ecb_used; i++) { >- if (good[i] && zfs_share(cb=2Ecb_handles[i]) !=3D 0) >- ret =3D -1; >- } >+ ms=2Ems_mntstatus =3D 0; >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb=2Ecb_handles, cb=2Ecb_used, >+ zfs_share_one, &ms, B_FALSE); >+ if (ms=2Ems_mntstatus !=3D 0) >+ ret =3D ms=2Ems_mntstatus; >=20 >- free(good); >- > out: >- for (i =3D 0; i < cb=2Ecb_used; i++) >+ for (int i =3D 0; i < cb=2Ecb_used; i++) > zfs_close(cb=2Ecb_handles[i]); > free(cb=2Ecb_handles); >=20 This broke my systems, many filesystems fail to mount causing nullfs late = mounts to fail=2E No details now until tonight=2E Suggest we back this out until it is properly tested=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Tue Feb 26 16:04:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21186151DA4B; Tue, 26 Feb 2019 16:04:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C36D08B8A6; Tue, 26 Feb 2019 16:04:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 6111E1D179; Tue, 26 Feb 2019 16:04:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 49744BD505; Tue, 26 Feb 2019 17:04:11 +0100 (CET) Date: Tue, 26 Feb 2019 17:04:11 +0100 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fathi@gandi.net Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common Message-ID: <20190226160411.kutpzjltiqm4bfgb@ivaldir.net> References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xegza3wedosuxciq" Content-Disposition: inline In-Reply-To: <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: C36D08B8A6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 16:04:13 -0000 --xegza3wedosuxciq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: > On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin wrote: > >Author: bapt > >Date: Tue Feb 26 08:18:34 2019 > >New Revision: 344569 > >URL: https://svnweb.freebsd.org/changeset/base/344569 > > > >Log: > > Implement parallel mounting for ZFS filesystem > > =20 > > It was first implemented on Illumos and then ported to ZoL. > > This patch is a port to FreeBSD of the ZoL version. > > This patch also includes a fix for a race condition that was amended > > =20 > >With such patch Delphix has seen a huge decrease in latency of the > >mount phase > > (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details). > >With that current change Gandi has measured improvments that are on par > >with > > those reported by Delphix. > > =20 > > Zol commits incorporated: > >https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c7= 0c9c9e303 > >https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077= 567dfea21 > > =20 > > Reviewed by: avg, sef > > Approved by: avg, sef > > Obtained from: ZoL > > MFC after: 1 month > > Relnotes: yes > > Sponsored by: Gandi.net > > Differential Revision: https://reviews.freebsd.org/D19098 > > > >Modified: > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c > > > >Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.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/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 > >06:22:10 2019 (r344568) > >+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 > >08:18:34 2019 (r344569) > >@@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) > >=20 > > #define CHECK_SPINNER 30 > > #define SPINNER_TIME 3 /* seconds */ > >-#define MOUNT_TIME 5 /* seconds */ > >+#define MOUNT_TIME 1 /* seconds */ > >=20 > >+typedef struct get_all_state { > >+ boolean_t ga_verbose; > >+ get_all_cb_t *ga_cbp; > >+} get_all_state_t; > >+ > > static int > > get_one_dataset(zfs_handle_t *zhp, void *data) > > { > >@@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void *data) > > static int spinval =3D 0; > > static int spincheck =3D 0; > > static time_t last_spin_time =3D (time_t)0; > >- get_all_cb_t *cbp =3D data; > >+ get_all_state_t *state =3D data; > > zfs_type_t type =3D zfs_get_type(zhp); > >=20 > >- if (cbp->cb_verbose) { > >+ if (state->ga_verbose) { > > if (--spincheck < 0) { > > time_t now =3D time(NULL); > > if (last_spin_time + SPINNER_TIME < now) { > >@@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void *data) > > zfs_close(zhp); > > return (0); > > } > >- libzfs_add_handle(cbp, zhp); > >- assert(cbp->cb_used <=3D cbp->cb_alloc); > >+ libzfs_add_handle(state->ga_cbp, zhp); > >+ assert(state->ga_cbp->cb_used <=3D state->ga_cbp->cb_alloc); > >=20 > > return (0); > > } > >=20 > > static void > >-get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t > >verbose) > >+get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) > > { > >- get_all_cb_t cb =3D { 0 }; > >- cb.cb_verbose =3D verbose; > >- cb.cb_getone =3D get_one_dataset; > >+ get_all_state_t state =3D { > >+ .ga_verbose =3D verbose, > >+ .ga_cbp =3D cbp > >+ }; > >=20 > > if (verbose) > > set_progress_header(gettext("Reading ZFS config")); > >- (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); > >+ (void) zfs_iter_root(g_zfs, get_one_dataset, &state); > >=20 > >- *dslist =3D cb.cb_handles; > >- *count =3D cb.cb_used; > >- > > if (verbose) > > finish_progress(gettext("done.")); > > } > >@@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, size_t > >*count > >* similar, we have a common function with an extra parameter to > >determine which > > * mode we are using. > > */ > >-#define OP_SHARE 0x1 > >-#define OP_MOUNT 0x2 > >+typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; > >=20 > >+typedef struct share_mount_state { > >+ share_mount_op_t sm_op; > >+ boolean_t sm_verbose; > >+ int sm_flags; > >+ char *sm_options; > >+ char *sm_proto; /* only valid for OP_SHARE */ > >+ pthread_mutex_t sm_lock; /* protects the remaining fields */ > >+ uint_t sm_total; /* number of filesystems to process */ > >+ uint_t sm_done; /* number of filesystems processed */ > >+ int sm_status; /* -1 if any of the share/mount operations failed */ > >+} share_mount_state_t; > >+ > > /* > > * Share or mount a dataset. > > */ > >@@ -6122,6 +6136,29 @@ report_mount_progress(int current, int total) > > update_progress(info); > > } > >=20 > >+/* > >+ * zfs_foreach_mountpoint() callback that mounts or shares on > >filesystem and > >+ * updates the progress meter > >+ */ > >+static int > >+share_mount_one_cb(zfs_handle_t *zhp, void *arg) > >+{ > >+ share_mount_state_t *sms =3D arg; > >+ int ret; > >+ > >+ ret =3D share_mount_one(zhp, sms->sm_op, sms->sm_flags, sms->sm_proto, > >+ B_FALSE, sms->sm_options); > >+ > >+ pthread_mutex_lock(&sms->sm_lock); > >+ if (ret !=3D 0) > >+ sms->sm_status =3D ret; > >+ sms->sm_done++; > >+ if (sms->sm_verbose) > >+ report_mount_progress(sms->sm_done, sms->sm_total); > >+ pthread_mutex_unlock(&sms->sm_lock); > >+ return (ret); > >+} > >+ > > static void > > append_options(char *mntopts, char *newopts) > > { > >@@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) > >=20 > > /* check number of arguments */ > > if (do_all) { > >- zfs_handle_t **dslist =3D NULL; > >- size_t i, count =3D 0; > > char *protocol =3D NULL; > >=20 > > if (op =3D=3D OP_SHARE && argc > 0) { > >@@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) > > } > >=20 > > start_progress_timer(); > >- get_all_datasets(&dslist, &count, verbose); > >+ get_all_cb_t cb =3D { 0 }; > >+ get_all_datasets(&cb, verbose); > >=20 > >- if (count =3D=3D 0) > >+ if (cb.cb_used =3D=3D 0) { > >+ if (options !=3D NULL) > >+ free(options); > > return (0); > >+ } > >=20 > >- qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); > > #ifdef illumos > >- sa_init_selective_arg_t sharearg; > >- sharearg.zhandle_arr =3D dslist; > >- sharearg.zhandle_len =3D count; > >- if ((ret =3D zfs_init_libshare_arg(zfs_get_handle(dslist[0]), > >- SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { > >- (void) fprintf(stderr, > >- gettext("Could not initialize libshare, %d"), ret); > >- return (ret); > >+ if (op =3D=3D OP_SHARE) { > >+ sa_init_selective_arg_t sharearg; > >+ sharearg.zhandle_arr =3D cb.cb_handles; > >+ sharearg.zhandle_len =3D cb.cb_used; > >+ if ((ret =3D zfs_init_libshare_arg(g_zfs, > >+ SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { > >+ (void) fprintf(stderr, gettext( > >+ "Could not initialize libshare, %d"), ret); > >+ return (ret); > >+ } > > } > > #endif > >+ share_mount_state_t share_mount_state =3D { 0 }; > >+ share_mount_state.sm_op =3D op; > >+ share_mount_state.sm_verbose =3D verbose; > >+ share_mount_state.sm_flags =3D flags; > >+ share_mount_state.sm_options =3D options; > >+ share_mount_state.sm_proto =3D protocol; > >+ share_mount_state.sm_total =3D cb.cb_used; > >+ pthread_mutex_init(&share_mount_state.sm_lock, NULL); > >=20 > >- for (i =3D 0; i < count; i++) { > >- if (verbose) > >- report_mount_progress(i, count); > >+ /* > >+ * libshare isn't mt-safe, so only do the operation in parallel > >+ * if we're mounting. > >+ */ > >+ zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used, > >+ share_mount_one_cb, &share_mount_state, op =3D=3D OP_MOUNT); > >+ ret =3D share_mount_state.sm_status; > >=20 > >- if (share_mount_one(dslist[i], op, flags, protocol, > >- B_FALSE, options) !=3D 0) > >- ret =3D 1; > >- zfs_close(dslist[i]); > >- } > >- > >- free(dslist); > >+ for (int i =3D 0; i < cb.cb_used; i++) > >+ zfs_close(cb.cb_handles[i]); > >+ free(cb.cb_handles); > > } else if (argc =3D=3D 0) { > > struct mnttab entry; > >=20 > > > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 > >06:22:10 2019 (r344568) > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 > >08:18:34 2019 (r344569) > >@@ -579,12 +579,12 @@ typedef struct get_all_cb { > > zfs_handle_t **cb_handles; > > size_t cb_alloc; > > size_t cb_used; > >- boolean_t cb_verbose; > >- int (*cb_getone)(zfs_handle_t *, void *); > > } get_all_cb_t; > >=20 > >+void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, > >size_t, > >+ zfs_iter_f, void*, boolean_t); > >+ > > void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); > >-int libzfs_dataset_cmp(const void *, const void *); > >=20 > > /* > > * Functions to create and destroy datasets. > > > >Modified: > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue > >Feb 26 06:22:10 2019 (r344568) > >+++ > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue > >Feb 26 08:18:34 2019 (r344569) > >@@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, const > >vo > > void > > libzfs_mnttab_init(libzfs_handle_t *hdl) > > { > >+ pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); > > assert(avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0); > > avl_create(&hdl->libzfs_mnttab_cache, libzfs_mnttab_cache_compare, > > sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); > >@@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) > > free(mtn); > > } > > avl_destroy(&hdl->libzfs_mnttab_cache); > >+ (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); > > } > >=20 > > void > >@@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char > >*f > > { > > mnttab_node_t find; > > mnttab_node_t *mtn; > >+ int ret =3D ENOENT; > >=20 > > if (!hdl->libzfs_mnttab_enable) { > > struct mnttab srch =3D { 0 }; > >@@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char > >*f > > return (ENOENT); > > } > >=20 > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > > if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) > > libzfs_mnttab_update(hdl); > >=20 > >@@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const > >char *f > > mtn =3D avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); > > if (mtn) { > > *entry =3D mtn->mtn_mt; > >- return (0); > >+ ret =3D 0; > > } > >- return (ENOENT); > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > >+ return (ret); > > } > >=20 > > void > >@@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, const > >char *sp > > { > > mnttab_node_t *mtn; > >=20 > >- if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) > >- return; > >- mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); > >- mtn->mtn_mt.mnt_special =3D zfs_strdup(hdl, special); > >- mtn->mtn_mt.mnt_mountp =3D zfs_strdup(hdl, mountp); > >- mtn->mtn_mt.mnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); > >- mtn->mtn_mt.mnt_mntopts =3D zfs_strdup(hdl, mntopts); > >- avl_add(&hdl->libzfs_mnttab_cache, mtn); > >-} > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > >+ if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) { > >+ mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); > >+ mtn->mtn_mt.mnt_special =3D zfs_strdup(hdl, special); > >+ mtn->mtn_mt.mnt_mountp =3D zfs_strdup(hdl, mountp); > >+ mtn->mtn_mt.mnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); > >+ mtn->mtn_mt.mnt_mntopts =3D zfs_strdup(hdl, mntopts); > >+ avl_add(&hdl->libzfs_mnttab_cache, mtn); > >+ } > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > >+} =09 > >=20 > > void > > libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) > >@@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const > >char=20 > > mnttab_node_t find; > > mnttab_node_t *ret; > >=20 > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > > find.mtn_mt.mnt_special =3D (char *)fsname; > > if ((ret =3D avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL)) > > !=3D NULL) { > >@@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const > >char=20 > > free(ret->mtn_mt.mnt_mntopts); > > free(ret); > > } > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > > } > >=20 > > int > > > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue > >Feb 26 06:22:10 2019 (r344568) > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue > >Feb 26 08:18:34 2019 (r344569) > >@@ -22,7 +22,7 @@ > > /* > >* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights > >reserved. > > * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. > >- * Copyright (c) 2011, 2016 by Delphix. All rights reserved. > >+ * Copyright (c) 2011, 2017 by Delphix. All rights reserved. > >* Copyright (c) 2013 Martin Matuska . All rights > >reserved. > > */ > >=20 > >@@ -73,6 +73,13 @@ struct libzfs_handle { > > int libzfs_storeerr; /* stuff error messages into buffer */ > > void *libzfs_sharehdl; /* libshare handle */ > > boolean_t libzfs_mnttab_enable; > >+ /* > >+ * We need a lock to handle the case where parallel mount > >+ * threads are populating the mnttab cache simultaneously. The > >+ * lock only protects the integrity of the avl tree, and does > >+ * not protect the contents of the mnttab entries themselves. > >+ */ > >+ pthread_mutex_t libzfs_mnttab_cache_lock; > > avl_tree_t libzfs_mnttab_cache; > > int libzfs_pool_iter; > > libzfs_fru_t **libzfs_fru_hash; > > > >Modified: > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue > >Feb 26 06:22:10 2019 (r344568) > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue > >Feb 26 08:18:34 2019 (r344569) > >@@ -26,6 +26,7 @@ > > * Copyright 2016 Igor Kozhukhov > > * Copyright 2017 Joyent, Inc. > > * Copyright 2017 RackTop Systems. > >+ * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. > > */ > >=20 > > /* > >@@ -34,25 +35,25 @@ > > * they are used by mount and unmount and when changing a filesystem's > > * mountpoint. > > * > >- * zfs_is_mounted() > >- * zfs_mount() > >- * zfs_unmount() > >- * zfs_unmountall() > >+ * zfs_is_mounted() > >+ * zfs_mount() > >+ * zfs_unmount() > >+ * zfs_unmountall() > > * > >* This file also contains the functions used to manage sharing > >filesystems via > > * NFS and iSCSI: > > * > >- * zfs_is_shared() > >- * zfs_share() > >- * zfs_unshare() > >+ * zfs_is_shared() > >+ * zfs_share() > >+ * zfs_unshare() > > * > >- * zfs_is_shared_nfs() > >- * zfs_is_shared_smb() > >- * zfs_share_proto() > >- * zfs_shareall(); > >- * zfs_unshare_nfs() > >- * zfs_unshare_smb() > >- * zfs_unshareall_nfs() > >+ * zfs_is_shared_nfs() > >+ * zfs_is_shared_smb() > >+ * zfs_share_proto() > >+ * zfs_shareall(); > >+ * zfs_unshare_nfs() > >+ * zfs_unshare_smb() > >+ * zfs_unshareall_nfs() > > * zfs_unshareall_smb() > > * zfs_unshareall() > > * zfs_unshareall_bypath() > >@@ -60,8 +61,8 @@ > > * The following functions are available for pool consumers, and will > > * mount/unmount and share/unshare all datasets within pool: > > * > >- * zpool_enable_datasets() > >- * zpool_disable_datasets() > >+ * zpool_enable_datasets() > >+ * zpool_disable_datasets() > > */ > >=20 > > #include > >@@ -83,10 +84,14 @@ > > #include > >=20 > > #include "libzfs_impl.h" > >+#include > >=20 > > #include > > #define MAXISALEN 257 /* based on sysinfo(2) man page */ > >=20 > >+static int mount_tp_nthr =3D 512; /* tpool threads for multi-threaded > >mounting */ > >+ > >+static void zfs_mount_task(void *); > > static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); > > zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, > > zfs_share_proto_t); > >@@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) > > } > > } > >=20 > >+/* > >+ * Add the given zfs handle to the cb_handles array, dynamically > >reallocating > >+ * the array if it is out of space > >+ */ > > void > > libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) > > { > > if (cbp->cb_alloc =3D=3D cbp->cb_used) { > > size_t newsz; > >- void *ptr; > >+ zfs_handle_t **newhandles; > >=20 > >- newsz =3D cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; > >- ptr =3D zfs_realloc(zhp->zfs_hdl, > >- cbp->cb_handles, cbp->cb_alloc * sizeof (void *), > >- newsz * sizeof (void *)); > >- cbp->cb_handles =3D ptr; > >+ newsz =3D cbp->cb_alloc !=3D 0 ? cbp->cb_alloc * 2 : 64; > >+ newhandles =3D zfs_realloc(zhp->zfs_hdl, > >+ cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), > >+ newsz * sizeof (zfs_handle_t *)); > >+ cbp->cb_handles =3D newhandles; > > cbp->cb_alloc =3D newsz; > > } > > cbp->cb_handles[cbp->cb_used++] =3D zhp; > > } > >=20 > >+/* > >+ * Recursive helper function used during file system enumeration > >+ */ > > static int > >-mount_cb(zfs_handle_t *zhp, void *data) > >+zfs_iter_cb(zfs_handle_t *zhp, void *data) > > { > > get_all_cb_t *cbp =3D data; > >=20 > >@@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) > > } > >=20 > > libzfs_add_handle(cbp, zhp); > >- if (zfs_iter_filesystems(zhp, mount_cb, cbp) !=3D 0) { > >+ if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) !=3D 0) { > > zfs_close(zhp); > > return (-1); > > } > > return (0); > > } > >=20 > >-int > >-libzfs_dataset_cmp(const void *a, const void *b) > >+/* > >+ * Sort comparator that compares two mountpoint paths. We sort these > >paths so > >+ * that subdirectories immediately follow their parents. This means > >that we > >+ * effectively treat the '/' character as the lowest value non-nul > >char. > >+ * Since filesystems from non-global zones can have the same > >mountpoint > >+ * as other filesystems, the comparator sorts global zone filesystems > >to > >+ * the top of the list. This means that the global zone will traverse > >the > >+ * filesystem list in the correct order and can stop when it sees the > >+ * first zoned filesystem. In a non-global zone, only the delegated > >+ * filesystems are seen. > >+ * > >+ * An example sorted list using this comparator would look like: > >+ * > >+ * /foo > >+ * /foo/bar > >+ * /foo/bar/baz > >+ * /foo/baz > >+ * /foo.bar > >+ * /foo (NGZ1) > >+ * /foo (NGZ2) > >+ * > >+ * The mount code depend on this ordering to deterministically iterate > >+ * over filesystems in order to spawn parallel mount tasks. > >+ */ > >+static int > >+mountpoint_cmp(const void *arga, const void *argb) > > { > >- zfs_handle_t **za =3D (zfs_handle_t **)a; > >- zfs_handle_t **zb =3D (zfs_handle_t **)b; > >+ zfs_handle_t *const *zap =3D arga; > >+ zfs_handle_t *za =3D *zap; > >+ zfs_handle_t *const *zbp =3D argb; > >+ zfs_handle_t *zb =3D *zbp; > > char mounta[MAXPATHLEN]; > > char mountb[MAXPATHLEN]; > >+ const char *a =3D mounta; > >+ const char *b =3D mountb; > > boolean_t gota, gotb; > >+ uint64_t zoneda, zonedb; > >=20 > >- if ((gota =3D (zfs_get_type(*za) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) > >- verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, > >+ zoneda =3D zfs_prop_get_int(za, ZFS_PROP_ZONED); > >+ zonedb =3D zfs_prop_get_int(zb, ZFS_PROP_ZONED); > >+ if (zoneda && !zonedb) > >+ return (1); > >+ if (!zoneda && zonedb) > >+ return (-1); > >+ gota =3D (zfs_get_type(za) =3D=3D ZFS_TYPE_FILESYSTEM); > >+ if (gota) > >+ verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, > > sizeof (mounta), NULL, NULL, 0, B_FALSE) =3D=3D 0); > >- if ((gotb =3D (zfs_get_type(*zb) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) > >- verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, > >+ gotb =3D (zfs_get_type(zb) =3D=3D ZFS_TYPE_FILESYSTEM); > >+ if (gotb) > >+ verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, > > sizeof (mountb), NULL, NULL, 0, B_FALSE) =3D=3D 0); > >=20 > >- if (gota && gotb) > >- return (strcmp(mounta, mountb)); > >+ if (gota && gotb) { > >+ while (*a !=3D '\0' && (*a =3D=3D *b)) { > >+ a++; > >+ b++; > >+ } > >+ if (*a =3D=3D *b) > >+ return (0); > >+ if (*a =3D=3D '\0') > >+ return (-1); > >+ if (*b =3D=3D '\0') > >+ return (-1); > >+ if (*a =3D=3D '/') > >+ return (-1); > >+ if (*b =3D=3D '/') > >+ return (-1); > >+ return (*a < *b ? -1 : *a > *b); > >+ } > >=20 > > if (gota) > > return (-1); > > if (gotb) > > return (1); > >=20 > >- return (strcmp(zfs_get_name(a), zfs_get_name(b))); > >+ /* > >+ * If neither filesystem has a mountpoint, revert to sorting by > >+ * datset name. > >+ */ > >+ return (strcmp(zfs_get_name(za), zfs_get_name(zb))); > > } > >=20 > > /* > >+ * Reutrn true if path2 is a child of path1 > >+ */ > >+static boolean_t > >+libzfs_path_contains(const char *path1, const char *path2) > >+{ > >+ return (strstr(path2, path1) =3D=3D path2 && path2[strlen(path1)] =3D= =3D > >'/'); > >+} > >+ > >+ > >+static int > >+non_descendant_idx(zfs_handle_t **handles, size_t num_handles, int > >idx) > >+{ > >+ char parent[ZFS_MAXPROPLEN]; > >+ char child[ZFS_MAXPROPLEN]; > >+ int i; > >+ > >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, > >+ sizeof (parent), NULL, NULL, 0, B_FALSE) =3D=3D 0); > >+ > >+ for (i =3D idx + 1; i < num_handles; i++) { > >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, > >+ sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); > >+ if (!libzfs_path_contains(parent, child)) > >+ break; > >+ } > >+ return (i); > >+} > >+ > >+typedef struct mnt_param { > >+ libzfs_handle_t *mnt_hdl; > >+ tpool_t *mnt_tp; > >+ zfs_handle_t **mnt_zhps; /* filesystems to mount */ > >+ size_t mnt_num_handles; > >+ int mnt_idx; /* Index of selected entry to mount */ > >+ zfs_iter_f mnt_func; > >+ void *mnt_data; > >+} mnt_param_t; > >+ > >+/* > >+ * Allocate and populate the parameter struct for mount function, and > >+ * schedule mounting of the entry selected by idx. > >+ */ > >+static void > >+zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, > >+ size_t num_handles, int idx, zfs_iter_f func, void *data, tpool_t > >*tp) > >+{ > >+ mnt_param_t *mnt_param =3D zfs_alloc(hdl, sizeof (mnt_param_t)); > >+ > >+ mnt_param->mnt_hdl =3D hdl; > >+ mnt_param->mnt_tp =3D tp; > >+ mnt_param->mnt_zhps =3D handles; > >+ mnt_param->mnt_num_handles =3D num_handles; > >+ mnt_param->mnt_idx =3D idx; > >+ mnt_param->mnt_func =3D func; > >+ mnt_param->mnt_data =3D data; > >+ > >+ (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); > >+} > >+ > >+/* > >+ * This is the structure used to keep state of mounting or sharing > >operations > >+ * during a call to zpool_enable_datasets(). > >+ */ > >+typedef struct mount_state { > >+ /* > >+ * ms_mntstatus is set to -1 if any mount fails. While multiple > >threads > >+ * could update this variable concurrently, no synchronization is > >+ * needed as it's only ever set to -1. > >+ */ > >+ int ms_mntstatus; > >+ int ms_mntflags; > >+ const char *ms_mntopts; > >+} mount_state_t; > >+ > >+static int > >+zfs_mount_one(zfs_handle_t *zhp, void *arg) > >+{ > >+ mount_state_t *ms =3D arg; > >+ int ret =3D 0; > >+ > >+ if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) !=3D 0) > >+ ret =3D ms->ms_mntstatus =3D -1; > >+ return (ret); > >+} > >+ > >+static int > >+zfs_share_one(zfs_handle_t *zhp, void *arg) > >+{ > >+ mount_state_t *ms =3D arg; > >+ int ret =3D 0; > >+ > >+ if (zfs_share(zhp) !=3D 0) > >+ ret =3D ms->ms_mntstatus =3D -1; > >+ return (ret); > >+} > >+ > >+/* > >+ * Thread pool function to mount one file system. On completion, it > >finds and > >+ * schedules its children to be mounted. This depends on the sorting > >done in > >+ * zfs_foreach_mountpoint(). Note that the degenerate case (chain of > >entries > >+ * each descending from the previous) will have no parallelism since > >we always > >+ * have to wait for the parent to finish mounting before we can > >schedule > >+ * its children. > >+ */ > >+static void > >+zfs_mount_task(void *arg) > >+{ > >+ mnt_param_t *mp =3D arg; > >+ int idx =3D mp->mnt_idx; > >+ zfs_handle_t **handles =3D mp->mnt_zhps; > >+ size_t num_handles =3D mp->mnt_num_handles; > >+ char mountpoint[ZFS_MAXPROPLEN]; > >+ > >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, mountpoint, > >+ sizeof (mountpoint), NULL, NULL, 0, B_FALSE) =3D=3D 0); > >+ > >+ if (mp->mnt_func(handles[idx], mp->mnt_data) !=3D 0) > >+ return; > >+ > >+ /* > >+ * We dispatch tasks to mount filesystems with mountpoints underneath > >+ * this one. We do this by dispatching the next filesystem with a > >+ * descendant mountpoint of the one we just mounted, then skip all of > >+ * its descendants, dispatch the next descendant mountpoint, and so > >on. > >+ * The non_descendant_idx() function skips over filesystems that are > >+ * descendants of the filesystem we just dispatched. > >+ */ > >+ for (int i =3D idx + 1; i < num_handles; > >+ i =3D non_descendant_idx(handles, num_handles, i)) { > >+ char child[ZFS_MAXPROPLEN]; > >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, > >+ child, sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); > >+ > >+ if (!libzfs_path_contains(mountpoint, child)) > >+ break; /* not a descendant, return */ > >+ zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, > >+ mp->mnt_func, mp->mnt_data, mp->mnt_tp); > >+ } > >+ free(mp); > >+} > >+ > >+/* > >+ * Issue the func callback for each ZFS handle contained in the > >handles > >+ * array. This function is used to mount all datasets, and so this > >function > >+ * guarantees that filesystems for parent mountpoints are called > >before their > >+ * children. As such, before issuing any callbacks, we first sort the > >array > >+ * of handles by mountpoint. > >+ * > >+ * Callbacks are issued in one of two ways: > >+ * > >+ * 1. Sequentially: If the parallel argument is B_FALSE or the > >ZFS_SERIAL_MOUNT > >+ * environment variable is set, then we issue callbacks > >sequentially. > >+ * > >+ * 2. In parallel: If the parallel argument is B_TRUE and the > >ZFS_SERIAL_MOUNT > >+ * environment variable is not set, then we use a tpool to dispatch > >threads > >+ * to mount filesystems in parallel. This function dispatches tasks > >to mount > >+ * the filesystems at the top-level mountpoints, and these tasks in > >turn > >+ * are responsible for recursively mounting filesystems in their > >children > >+ * mountpoints. > >+ */ > >+void > >+zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t **handles, > >+ size_t num_handles, zfs_iter_f func, void *data, boolean_t > >parallel) > >+{ > >+ zoneid_t zoneid =3D getzoneid(); > >+ > >+ /* > >+ * The ZFS_SERIAL_MOUNT environment variable is an undocumented > >+ * variable that can be used as a convenience to do a/b comparison > >+ * of serial vs. parallel mounting. > >+ */ > >+ boolean_t serial_mount =3D !parallel || > >+ (getenv("ZFS_SERIAL_MOUNT") !=3D NULL); > >+ > >+ /* > >+ * Sort the datasets by mountpoint. See mountpoint_cmp for details > >+ * of how these are sorted. > >+ */ > >+ qsort(handles, num_handles, sizeof (zfs_handle_t *), mountpoint_cmp); > >+ > >+ if (serial_mount) { > >+ for (int i =3D 0; i < num_handles; i++) { > >+ func(handles[i], data); > >+ } > >+ return; > >+ } > >+ > >+ /* > >+ * Issue the callback function for each dataset using a parallel > >+ * algorithm that uses a thread pool to manage threads. > >+ */ > >+ tpool_t *tp =3D tpool_create(1, mount_tp_nthr, 0, NULL); > >+ > >+ /* > >+ * There may be multiple "top level" mountpoints outside of the > >pool's > >+ * root mountpoint, e.g.: /foo /bar. Dispatch a mount task for each > >of > >+ * these. > >+ */ > >+ for (int i =3D 0; i < num_handles; > >+ i =3D non_descendant_idx(handles, num_handles, i)) { > >+ /* > >+ * Since the mountpoints have been sorted so that the zoned > >+ * filesystems are at the end, a zoned filesystem seen from > >+ * the global zone means that we're done. > >+ */ > >+ if (zoneid =3D=3D GLOBAL_ZONEID && > >+ zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) > >+ break; > >+ zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, > >+ tp); > >+ } > >+ > >+ tpool_wait(tp); /* wait for all scheduled mounts to complete */ > >+ tpool_destroy(tp); > >+} > >+ > >+/* > >* Mount and share all datasets within the given pool. This assumes > >that no > >- * datasets within the pool are currently mounted. Because users can > >create > >- * complicated nested hierarchies of mountpoints, we first gather all > >the > >- * datasets and mountpoints within the pool, and sort them by > >mountpoint. Once > >- * we have the list of all filesystems, we iterate over them in order > >and mount > >- * and/or share each one. > >+ * datasets within the pool are currently mounted. > > */ > > #pragma weak zpool_mount_datasets =3D zpool_enable_datasets > > int > >zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int > >flags) > > { > > get_all_cb_t cb =3D { 0 }; > >- libzfs_handle_t *hdl =3D zhp->zpool_hdl; > >+ mount_state_t ms =3D { 0 }; > > zfs_handle_t *zfsp; > >- int i, ret =3D -1; > >- int *good; > >+ int ret =3D 0; > >=20 > >- /* > >- * Gather all non-snap datasets within the pool. > >- */ > >- if ((zfsp =3D zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) =3D=3D > >NULL) > >+ if ((zfsp =3D zfs_open(zhp->zpool_hdl, zhp->zpool_name, > >+ ZFS_TYPE_DATASET)) =3D=3D NULL) > > goto out; > >=20 > >- libzfs_add_handle(&cb, zfsp); > >- if (zfs_iter_filesystems(zfsp, mount_cb, &cb) !=3D 0) > >- goto out; > > /* > >- * Sort the datasets by mountpoint. > >+ * Gather all non-snapshot datasets within the pool. Start by adding > >+ * the root filesystem for this pool to the list, and then iterate > >+ * over all child filesystems. > > */ > >- qsort(cb.cb_handles, cb.cb_used, sizeof (void *), > >- libzfs_dataset_cmp); > >+ libzfs_add_handle(&cb, zfsp); > >+ if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) !=3D 0) > >+ goto out; > >=20 > > /* > >- * And mount all the datasets, keeping track of which ones > >- * succeeded or failed. > >+ * Mount all filesystems > > */ > >- if ((good =3D zfs_alloc(zhp->zpool_hdl, > >- cb.cb_used * sizeof (int))) =3D=3D NULL) > >- goto out; > >+ ms.ms_mntopts =3D mntopts; > >+ ms.ms_mntflags =3D flags; > >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, cb.cb_used, > >+ zfs_mount_one, &ms, B_TRUE); > >+ if (ms.ms_mntstatus !=3D 0) > >+ ret =3D ms.ms_mntstatus; > >=20 > >- ret =3D 0; > >- for (i =3D 0; i < cb.cb_used; i++) { > >- if (zfs_mount(cb.cb_handles[i], mntopts, flags) !=3D 0) > >- ret =3D -1; > >- else > >- good[i] =3D 1; > >- } > >- > > /* > >- * Then share all the ones that need to be shared. This needs > >- * to be a separate pass in order to avoid excessive reloading > >- * of the configuration. Good should never be NULL since > >- * zfs_alloc is supposed to exit if memory isn't available. > >+ * Share all filesystems that need to be shared. This needs to be > >+ * a separate pass because libshare is not mt-safe, and so we need > >+ * to share serially. > > */ > >- for (i =3D 0; i < cb.cb_used; i++) { > >- if (good[i] && zfs_share(cb.cb_handles[i]) !=3D 0) > >- ret =3D -1; > >- } > >+ ms.ms_mntstatus =3D 0; > >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, cb.cb_used, > >+ zfs_share_one, &ms, B_FALSE); > >+ if (ms.ms_mntstatus !=3D 0) > >+ ret =3D ms.ms_mntstatus; > >=20 > >- free(good); > >- > > out: > >- for (i =3D 0; i < cb.cb_used; i++) > >+ for (int i =3D 0; i < cb.cb_used; i++) > > zfs_close(cb.cb_handles[i]); > > free(cb.cb_handles); > >=20 >=20 > This broke my systems, many filesystems fail to mount causing nullfs late= mounts to fail. No details now until tonight. >=20 > Suggest we back this out until it is properly tested. >=20 What fails to mount? what message? can you provide Gandi folks more informa= tions so they can fix? I will revert if we cannot have a quick fix but let s give them a chance to= fix first. Best regards, Bapt --xegza3wedosuxciq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlx1Y3cACgkQY4mL3PG3 PlpA5Q/8C/q/9kYQFGQc+16uggmPvRDL1X/2LIfmNYglZkRYpVKV9MaSr5HwtcNW hySIux1y8A3yqz6sARpxvIXW+l0DV6LFiAEkZMHYPFGcoc++UFsJ7VtfcmvQT9/O Ixo4Au2BGxGFfTfodUdg1G1+d+jCqRqtOZaK9W4FMboSiD96zkhAdNMOkbkDZo6t z9kw6DAra5gQX3zCVHzUT4DfiTQNfCjYph3Xt8ZJbWFkDpp9qqRaTUZbKQEeUNK7 EQ3c/0+0QQjamJuArVPr4lqrt5gXbKQUkhS3Zpcdnwqlq+L1SYAxEfBto53bKrkR bD6jMnfaOrbWAJQ8lW7X8dVHc0AzV+Bs4rO/J7TmoqE2UzrSKmoRssIzENb/SdlG bm/G21AYu67TQBnQzZLMJUQscnkJX7+/D+S+13bIjxKIoVkeiGpoMCMKUPcz1VqK dTDYsTQX99NaAznM1jnnn2ejO82jviaWd85LB2TIO88vqIBYrLvT4vRCmzk+mWss 9BjR4hF936ySarY8BxPaVRb07/azOPNkGGotwcrksxcs6R5XCkrdnVe4FQ3b7Fl7 0KQp0zXHEEU8rv8a2g0jAfhzSoh7yCVeyaBmUdg76HVEnl6Eg2LTZ9eKIV5X7ZAG 1PergyJP7JPcXWEEfHlb1W/HFlxX7MSaaUe9uo7OSSq613YDjZc= =c7Xw -----END PGP SIGNATURE----- --xegza3wedosuxciq-- From owner-svn-src-head@freebsd.org Tue Feb 26 16:05:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6785151DB01; Tue, 26 Feb 2019 16:05:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF288BA56; Tue, 26 Feb 2019 16:05:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59DCB7722; Tue, 26 Feb 2019 16:05:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QG5YbM008314; Tue, 26 Feb 2019 16:05:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QG5Yjg008313; Tue, 26 Feb 2019 16:05:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902261605.x1QG5Yjg008313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 26 Feb 2019 16:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344586 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 344586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CF288BA56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 16:05:35 -0000 Author: mav Date: Tue Feb 26 16:05:33 2019 New Revision: 344586 URL: https://svnweb.freebsd.org/changeset/base/344586 Log: Scrap some debug printf's, unused for years. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Feb 26 15:29:16 2019 (r344585) +++ head/sys/cam/ctl/ctl.c Tue Feb 26 16:05:33 2019 (r344586) @@ -1452,12 +1452,6 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e if (softc->ha_mode != CTL_HA_MODE_XFER) io->io_hdr.flags |= CTL_FLAG_INT_COPY; io->io_hdr.nexus = msg->hdr.nexus; -#if 0 - printf("port %u, iid %u, lun %u\n", - io->io_hdr.nexus.targ_port, - io->io_hdr.nexus.initid, - io->io_hdr.nexus.targ_lun); -#endif io->scsiio.tag_num = msg->scsi.tag_num; io->scsiio.tag_type = msg->scsi.tag_type; #ifdef CTL_TIME_IO @@ -1537,11 +1531,6 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e msg->dt.cur_sg_entries); i++, j++) { sgl[i].addr = msg->dt.sg_list[j].addr; sgl[i].len = msg->dt.sg_list[j].len; - -#if 0 - printf("%s: DATAMOVE: %p,%lu j=%d, i=%d\n", - __func__, sgl[i].addr, sgl[i].len, j, i); -#endif } /* @@ -6466,11 +6455,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) && (subpage == SMS_SUBPAGE_PAGE_0)) continue; -#if 0 - printf("found page %#x len %d\n", - page_index->page_code & SMPH_PC_MASK, - page_index->page_len); -#endif page_len += page_index->page_len; } break; @@ -6503,12 +6487,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) && (subpage != SMS_SUBPAGE_ALL)) continue; -#if 0 - printf("found page %#x len %d\n", - page_index->page_code & SMPH_PC_MASK, - page_index->page_len); -#endif - page_len += page_index->page_len; } @@ -6527,10 +6505,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } total_len = header_len + page_len; -#if 0 - printf("header_len = %d, page_len = %d, total_len = %d\n", - header_len, page_len, total_len); -#endif ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; @@ -8218,10 +8192,6 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) case SPRO_REGISTER: case SPRO_REG_IGNO: { -#if 0 - printf("Registration received\n"); -#endif - /* * We don't support any of these options, as we report in * the read capabilities request (see @@ -8334,9 +8304,6 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) break; } case SPRO_RESERVE: -#if 0 - printf("Reserve executed type %d\n", type); -#endif mtx_lock(&lun->lun_lock); if (lun->flags & CTL_LUN_PR_RESERVED) { /* @@ -11898,15 +11865,8 @@ ctl_abort_task(union ctl_io *io) struct ctl_softc *softc = CTL_SOFTC(io); union ctl_io *xio; struct ctl_lun *lun; -#if 0 - struct sbuf sb; - char printbuf[128]; -#endif - int found; uint32_t targ_lun; - found = 0; - /* * Look up the LUN. */ @@ -11919,11 +11879,6 @@ ctl_abort_task(union ctl_io *io) return (1); } -#if 0 - printf("ctl_abort_task: called for lun %lld, tag %d type %d\n", - lun->lun, io->taskio.tag_num, io->taskio.tag_type); -#endif - mtx_lock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); /* @@ -11935,25 +11890,7 @@ ctl_abort_task(union ctl_io *io) */ for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { -#if 0 - sbuf_new(&sb, printbuf, sizeof(printbuf), SBUF_FIXEDLEN); - sbuf_printf(&sb, "LUN %lld tag %d type %d%s%s%s%s: ", - lun->lun, xio->scsiio.tag_num, - xio->scsiio.tag_type, - (xio->io_hdr.blocked_links.tqe_prev - == NULL) ? "" : " BLOCKED", - (xio->io_hdr.flags & - CTL_FLAG_DMA_INPROG) ? " DMA" : "", - (xio->io_hdr.flags & - CTL_FLAG_ABORT) ? " ABORT" : "", - (xio->io_hdr.flags & - CTL_FLAG_IS_WAS_ON_RTR ? " RTR" : "")); - ctl_scsi_command_string(&xio->scsiio, NULL, &sb); - sbuf_finish(&sb); - printf("%s\n", sbuf_data(&sb)); -#endif - if ((xio->io_hdr.nexus.targ_port != io->io_hdr.nexus.targ_port) || (xio->io_hdr.nexus.initid != io->io_hdr.nexus.initid) || (xio->io_hdr.flags & CTL_FLAG_ABORT)) @@ -11970,8 +11907,8 @@ ctl_abort_task(union ctl_io *io) #if 0 if (((xio->scsiio.tag_type == CTL_TAG_UNTAGGED) && (io->taskio.tag_type == CTL_TAG_UNTAGGED)) - || (xio->scsiio.tag_num == io->taskio.tag_num)) -#endif + || (xio->scsiio.tag_num == io->taskio.tag_num)) { +#else /* * XXX KDM we've got problems with FC, because it * doesn't send down a tag type with aborts. So we @@ -11980,8 +11917,8 @@ ctl_abort_task(union ctl_io *io) * Need to figure that out!! */ if (xio->scsiio.tag_num == io->taskio.tag_num) { +#endif xio->io_hdr.flags |= CTL_FLAG_ABORT; - found = 1; if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) == 0 && !(lun->flags & CTL_LUN_PRIMARY_SC)) { union ctl_ha_msg msg_info; @@ -11993,34 +11930,12 @@ ctl_abort_task(union ctl_io *io) msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS; msg_info.hdr.original_sc = NULL; msg_info.hdr.serializing_sc = NULL; -#if 0 - printf("Sent Abort to other side\n"); -#endif ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.task), M_NOWAIT); } -#if 0 - printf("ctl_abort_task: found I/O to abort\n"); -#endif } } mtx_unlock(&lun->lun_lock); - - if (found == 0) { - /* - * This isn't really an error. It's entirely possible for - * the abort and command completion to cross on the wire. - * This is more of an informative/diagnostic error. - */ -#if 0 - printf("ctl_abort_task: ABORT sent for nonexistent I/O: " - "%u:%u:%u tag %d type %d\n", - io->io_hdr.nexus.initid, - io->io_hdr.nexus.targ_port, - io->io_hdr.nexus.targ_lun, io->taskio.tag_num, - io->taskio.tag_type); -#endif - } io->taskio.task_status = CTL_TASK_FUNCTION_COMPLETE; return (0); } @@ -12588,11 +12503,6 @@ ctl_datamove_remote_write(union ctl_io *io) static int ctl_datamove_remote_dm_read_cb(union ctl_io *io) { -#if 0 - char str[256]; - char path_str[64]; - struct sbuf sb; -#endif uint32_t i; for (i = 0; i < io->scsiio.kern_sg_entries; i++) @@ -12601,23 +12511,6 @@ ctl_datamove_remote_dm_read_cb(union ctl_io *io) CTL_RSGL(io) = NULL; CTL_LSGL(io) = NULL; -#if 0 - scsi_path_string(io, path_str, sizeof(path_str)); - sbuf_new(&sb, str, sizeof(str), SBUF_FIXEDLEN); - sbuf_cat(&sb, path_str); - scsi_command_string(&io->scsiio, NULL, &sb); - sbuf_printf(&sb, "\n"); - sbuf_cat(&sb, path_str); - sbuf_printf(&sb, "Tag: 0x%04x, type %d\n", - io->scsiio.tag_num, io->scsiio.tag_type); - sbuf_cat(&sb, path_str); - sbuf_printf(&sb, "%s: flags %#x, status %#x\n", __func__, - io->io_hdr.flags, io->io_hdr.status); - sbuf_finish(&sb); - printk("%s", sbuf_data(&sb)); -#endif - - /* * The read is done, now we need to send status (good or bad) back * to the other side. @@ -12691,14 +12584,6 @@ ctl_datamove_remote_sgl_setup(union ctl_io *io) */ io->scsiio.kern_sg_entries = i; -#if 0 - printf("%s: kern_sg_entries = %d\n", __func__, - io->scsiio.kern_sg_entries); - for (i = 0; i < io->scsiio.kern_sg_entries; i++) - printf("%s: sg[%d] = %p, %lu\n", __func__, i, - local_sglist[i].addr, local_sglist[i].len); -#endif - return (retval); } @@ -12811,12 +12696,6 @@ ctl_datamove_remote_xfer(union ctl_io *io, unsigned co if (total_used >= io->scsiio.kern_data_len) rq->callback = callback; - -#if 0 - printf("%s: %s: local %p remote %p size %d\n", __func__, - (command == CTL_HA_DT_CMD_WRITE) ? "WRITE" : "READ", - rq->local, rq->remote, rq->size); -#endif isc_ret = ctl_dt_single(rq); if (isc_ret > CTL_HA_STATUS_SUCCESS) From owner-svn-src-head@freebsd.org Tue Feb 26 16:11:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 675FB151DD29; Tue, 26 Feb 2019 16:11:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107CD8BE56; Tue, 26 Feb 2019 16:11:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 68F611D17A; Tue, 26 Feb 2019 16:11:32 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 9941FBD527; Tue, 26 Feb 2019 17:11:31 +0100 (CET) Date: Tue, 26 Feb 2019 17:11:31 +0100 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fatih@gandi.net Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common Message-ID: <20190226161131.6rb3slb5slhkomwz@ivaldir.net> References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> <20190226160411.kutpzjltiqm4bfgb@ivaldir.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5qciaak4a75kckt7" Content-Disposition: inline In-Reply-To: <20190226160411.kutpzjltiqm4bfgb@ivaldir.net> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 107CD8BE56 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 16:11:34 -0000 --5qciaak4a75kckt7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 05:04:11PM +0100, Baptiste Daroussin wrote: > On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: > > On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin wrote: > > >Author: bapt > > >Date: Tue Feb 26 08:18:34 2019 > > >New Revision: 344569 > > >URL: https://svnweb.freebsd.org/changeset/base/344569 > > > > > >Log: > > > Implement parallel mounting for ZFS filesystem > > > =20 > > > It was first implemented on Illumos and then ported to ZoL. > > > This patch is a port to FreeBSD of the ZoL version. > > > This patch also includes a fix for a race condition that was amended > > > =20 > > >With such patch Delphix has seen a huge decrease in latency of the > > >mount phase > > > (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details). > > >With that current change Gandi has measured improvments that are on par > > >with > > > those reported by Delphix. > > > =20 > > > Zol commits incorporated: > > >https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825= c70c9c9e303 > > >https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d40= 77567dfea21 > > > =20 > > > Reviewed by: avg, sef > > > Approved by: avg, sef > > > Obtained from: ZoL > > > MFC after: 1 month > > > Relnotes: yes > > > Sponsored by: Gandi.net > > > Differential Revision: https://reviews.freebsd.org/D19098 > > > > > >Modified: > > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h > > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h > > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c > > > > > >Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.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/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 > > >06:22:10 2019 (r344568) > > >+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 > > >08:18:34 2019 (r344569) > > >@@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) > > >=20 > > > #define CHECK_SPINNER 30 > > > #define SPINNER_TIME 3 /* seconds */ > > >-#define MOUNT_TIME 5 /* seconds */ > > >+#define MOUNT_TIME 1 /* seconds */ > > >=20 > > >+typedef struct get_all_state { > > >+ boolean_t ga_verbose; > > >+ get_all_cb_t *ga_cbp; > > >+} get_all_state_t; > > >+ > > > static int > > > get_one_dataset(zfs_handle_t *zhp, void *data) > > > { > > >@@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void *data) > > > static int spinval =3D 0; > > > static int spincheck =3D 0; > > > static time_t last_spin_time =3D (time_t)0; > > >- get_all_cb_t *cbp =3D data; > > >+ get_all_state_t *state =3D data; > > > zfs_type_t type =3D zfs_get_type(zhp); > > >=20 > > >- if (cbp->cb_verbose) { > > >+ if (state->ga_verbose) { > > > if (--spincheck < 0) { > > > time_t now =3D time(NULL); > > > if (last_spin_time + SPINNER_TIME < now) { > > >@@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void *data) > > > zfs_close(zhp); > > > return (0); > > > } > > >- libzfs_add_handle(cbp, zhp); > > >- assert(cbp->cb_used <=3D cbp->cb_alloc); > > >+ libzfs_add_handle(state->ga_cbp, zhp); > > >+ assert(state->ga_cbp->cb_used <=3D state->ga_cbp->cb_alloc); > > >=20 > > > return (0); > > > } > > >=20 > > > static void > > >-get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t > > >verbose) > > >+get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) > > > { > > >- get_all_cb_t cb =3D { 0 }; > > >- cb.cb_verbose =3D verbose; > > >- cb.cb_getone =3D get_one_dataset; > > >+ get_all_state_t state =3D { > > >+ .ga_verbose =3D verbose, > > >+ .ga_cbp =3D cbp > > >+ }; > > >=20 > > > if (verbose) > > > set_progress_header(gettext("Reading ZFS config")); > > >- (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); > > >+ (void) zfs_iter_root(g_zfs, get_one_dataset, &state); > > >=20 > > >- *dslist =3D cb.cb_handles; > > >- *count =3D cb.cb_used; > > >- > > > if (verbose) > > > finish_progress(gettext("done.")); > > > } > > >@@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, size_t > > >*count > > >* similar, we have a common function with an extra parameter to > > >determine which > > > * mode we are using. > > > */ > > >-#define OP_SHARE 0x1 > > >-#define OP_MOUNT 0x2 > > >+typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; > > >=20 > > >+typedef struct share_mount_state { > > >+ share_mount_op_t sm_op; > > >+ boolean_t sm_verbose; > > >+ int sm_flags; > > >+ char *sm_options; > > >+ char *sm_proto; /* only valid for OP_SHARE */ > > >+ pthread_mutex_t sm_lock; /* protects the remaining fields */ > > >+ uint_t sm_total; /* number of filesystems to process */ > > >+ uint_t sm_done; /* number of filesystems processed */ > > >+ int sm_status; /* -1 if any of the share/mount operations failed */ > > >+} share_mount_state_t; > > >+ > > > /* > > > * Share or mount a dataset. > > > */ > > >@@ -6122,6 +6136,29 @@ report_mount_progress(int current, int total) > > > update_progress(info); > > > } > > >=20 > > >+/* > > >+ * zfs_foreach_mountpoint() callback that mounts or shares on > > >filesystem and > > >+ * updates the progress meter > > >+ */ > > >+static int > > >+share_mount_one_cb(zfs_handle_t *zhp, void *arg) > > >+{ > > >+ share_mount_state_t *sms =3D arg; > > >+ int ret; > > >+ > > >+ ret =3D share_mount_one(zhp, sms->sm_op, sms->sm_flags, sms->sm_prot= o, > > >+ B_FALSE, sms->sm_options); > > >+ > > >+ pthread_mutex_lock(&sms->sm_lock); > > >+ if (ret !=3D 0) > > >+ sms->sm_status =3D ret; > > >+ sms->sm_done++; > > >+ if (sms->sm_verbose) > > >+ report_mount_progress(sms->sm_done, sms->sm_total); > > >+ pthread_mutex_unlock(&sms->sm_lock); > > >+ return (ret); > > >+} > > >+ > > > static void > > > append_options(char *mntopts, char *newopts) > > > { > > >@@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) > > >=20 > > > /* check number of arguments */ > > > if (do_all) { > > >- zfs_handle_t **dslist =3D NULL; > > >- size_t i, count =3D 0; > > > char *protocol =3D NULL; > > >=20 > > > if (op =3D=3D OP_SHARE && argc > 0) { > > >@@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) > > > } > > >=20 > > > start_progress_timer(); > > >- get_all_datasets(&dslist, &count, verbose); > > >+ get_all_cb_t cb =3D { 0 }; > > >+ get_all_datasets(&cb, verbose); > > >=20 > > >- if (count =3D=3D 0) > > >+ if (cb.cb_used =3D=3D 0) { > > >+ if (options !=3D NULL) > > >+ free(options); > > > return (0); > > >+ } > > >=20 > > >- qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); > > > #ifdef illumos > > >- sa_init_selective_arg_t sharearg; > > >- sharearg.zhandle_arr =3D dslist; > > >- sharearg.zhandle_len =3D count; > > >- if ((ret =3D zfs_init_libshare_arg(zfs_get_handle(dslist[0]), > > >- SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { > > >- (void) fprintf(stderr, > > >- gettext("Could not initialize libshare, %d"), ret); > > >- return (ret); > > >+ if (op =3D=3D OP_SHARE) { > > >+ sa_init_selective_arg_t sharearg; > > >+ sharearg.zhandle_arr =3D cb.cb_handles; > > >+ sharearg.zhandle_len =3D cb.cb_used; > > >+ if ((ret =3D zfs_init_libshare_arg(g_zfs, > > >+ SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { > > >+ (void) fprintf(stderr, gettext( > > >+ "Could not initialize libshare, %d"), ret); > > >+ return (ret); > > >+ } > > > } > > > #endif > > >+ share_mount_state_t share_mount_state =3D { 0 }; > > >+ share_mount_state.sm_op =3D op; > > >+ share_mount_state.sm_verbose =3D verbose; > > >+ share_mount_state.sm_flags =3D flags; > > >+ share_mount_state.sm_options =3D options; > > >+ share_mount_state.sm_proto =3D protocol; > > >+ share_mount_state.sm_total =3D cb.cb_used; > > >+ pthread_mutex_init(&share_mount_state.sm_lock, NULL); > > >=20 > > >- for (i =3D 0; i < count; i++) { > > >- if (verbose) > > >- report_mount_progress(i, count); > > >+ /* > > >+ * libshare isn't mt-safe, so only do the operation in parallel > > >+ * if we're mounting. > > >+ */ > > >+ zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used, > > >+ share_mount_one_cb, &share_mount_state, op =3D=3D OP_MOUNT); > > >+ ret =3D share_mount_state.sm_status; > > >=20 > > >- if (share_mount_one(dslist[i], op, flags, protocol, > > >- B_FALSE, options) !=3D 0) > > >- ret =3D 1; > > >- zfs_close(dslist[i]); > > >- } > > >- > > >- free(dslist); > > >+ for (int i =3D 0; i < cb.cb_used; i++) > > >+ zfs_close(cb.cb_handles[i]); > > >+ free(cb.cb_handles); > > > } else if (argc =3D=3D 0) { > > > struct mnttab entry; > > >=20 > > > > > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > >--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 > > >06:22:10 2019 (r344568) > > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 > > >08:18:34 2019 (r344569) > > >@@ -579,12 +579,12 @@ typedef struct get_all_cb { > > > zfs_handle_t **cb_handles; > > > size_t cb_alloc; > > > size_t cb_used; > > >- boolean_t cb_verbose; > > >- int (*cb_getone)(zfs_handle_t *, void *); > > > } get_all_cb_t; > > >=20 > > >+void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, > > >size_t, > > >+ zfs_iter_f, void*, boolean_t); > > >+ > > > void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); > > >-int libzfs_dataset_cmp(const void *, const void *); > > >=20 > > > /* > > > * Functions to create and destroy datasets. > > > > > >Modified: > > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue > > >Feb 26 06:22:10 2019 (r344568) > > >+++ > > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue > > >Feb 26 08:18:34 2019 (r344569) > > >@@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, const > > >vo > > > void > > > libzfs_mnttab_init(libzfs_handle_t *hdl) > > > { > > >+ pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); > > > assert(avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0); > > > avl_create(&hdl->libzfs_mnttab_cache, libzfs_mnttab_cache_compare, > > > sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); > > >@@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) > > > free(mtn); > > > } > > > avl_destroy(&hdl->libzfs_mnttab_cache); > > >+ (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); > > > } > > >=20 > > > void > > >@@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char > > >*f > > > { > > > mnttab_node_t find; > > > mnttab_node_t *mtn; > > >+ int ret =3D ENOENT; > > >=20 > > > if (!hdl->libzfs_mnttab_enable) { > > > struct mnttab srch =3D { 0 }; > > >@@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const char > > >*f > > > return (ENOENT); > > > } > > >=20 > > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > > > if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) > > > libzfs_mnttab_update(hdl); > > >=20 > > >@@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const > > >char *f > > > mtn =3D avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); > > > if (mtn) { > > > *entry =3D mtn->mtn_mt; > > >- return (0); > > >+ ret =3D 0; > > > } > > >- return (ENOENT); > > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > > >+ return (ret); > > > } > > >=20 > > > void > > >@@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, const > > >char *sp > > > { > > > mnttab_node_t *mtn; > > >=20 > > >- if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) > > >- return; > > >- mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); > > >- mtn->mtn_mt.mnt_special =3D zfs_strdup(hdl, special); > > >- mtn->mtn_mt.mnt_mountp =3D zfs_strdup(hdl, mountp); > > >- mtn->mtn_mt.mnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); > > >- mtn->mtn_mt.mnt_mntopts =3D zfs_strdup(hdl, mntopts); > > >- avl_add(&hdl->libzfs_mnttab_cache, mtn); > > >-} > > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > > >+ if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) { > > >+ mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); > > >+ mtn->mtn_mt.mnt_special =3D zfs_strdup(hdl, special); > > >+ mtn->mtn_mt.mnt_mountp =3D zfs_strdup(hdl, mountp); > > >+ mtn->mtn_mt.mnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); > > >+ mtn->mtn_mt.mnt_mntopts =3D zfs_strdup(hdl, mntopts); > > >+ avl_add(&hdl->libzfs_mnttab_cache, mtn); > > >+ } > > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > > >+} =09 > > >=20 > > > void > > > libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) > > >@@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const > > >char=20 > > > mnttab_node_t find; > > > mnttab_node_t *ret; > > >=20 > > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); > > > find.mtn_mt.mnt_special =3D (char *)fsname; > > > if ((ret =3D avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL= )) > > > !=3D NULL) { > > >@@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const > > >char=20 > > > free(ret->mtn_mt.mnt_mntopts); > > > free(ret); > > > } > > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); > > > } > > >=20 > > > int > > > > > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h > > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > >--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue > > >Feb 26 06:22:10 2019 (r344568) > > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue > > >Feb 26 08:18:34 2019 (r344569) > > >@@ -22,7 +22,7 @@ > > > /* > > >* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights > > >reserved. > > > * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. > > >- * Copyright (c) 2011, 2016 by Delphix. All rights reserved. > > >+ * Copyright (c) 2011, 2017 by Delphix. All rights reserved. > > >* Copyright (c) 2013 Martin Matuska . All rights > > >reserved. > > > */ > > >=20 > > >@@ -73,6 +73,13 @@ struct libzfs_handle { > > > int libzfs_storeerr; /* stuff error messages into buffer */ > > > void *libzfs_sharehdl; /* libshare handle */ > > > boolean_t libzfs_mnttab_enable; > > >+ /* > > >+ * We need a lock to handle the case where parallel mount > > >+ * threads are populating the mnttab cache simultaneously. The > > >+ * lock only protects the integrity of the avl tree, and does > > >+ * not protect the contents of the mnttab entries themselves. > > >+ */ > > >+ pthread_mutex_t libzfs_mnttab_cache_lock; > > > avl_tree_t libzfs_mnttab_cache; > > > int libzfs_pool_iter; > > > libzfs_fru_t **libzfs_fru_hash; > > > > > >Modified: > > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue > > >Feb 26 06:22:10 2019 (r344568) > > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue > > >Feb 26 08:18:34 2019 (r344569) > > >@@ -26,6 +26,7 @@ > > > * Copyright 2016 Igor Kozhukhov > > > * Copyright 2017 Joyent, Inc. > > > * Copyright 2017 RackTop Systems. > > >+ * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. > > > */ > > >=20 > > > /* > > >@@ -34,25 +35,25 @@ > > > * they are used by mount and unmount and when changing a filesystem's > > > * mountpoint. > > > * > > >- * zfs_is_mounted() > > >- * zfs_mount() > > >- * zfs_unmount() > > >- * zfs_unmountall() > > >+ * zfs_is_mounted() > > >+ * zfs_mount() > > >+ * zfs_unmount() > > >+ * zfs_unmountall() > > > * > > >* This file also contains the functions used to manage sharing > > >filesystems via > > > * NFS and iSCSI: > > > * > > >- * zfs_is_shared() > > >- * zfs_share() > > >- * zfs_unshare() > > >+ * zfs_is_shared() > > >+ * zfs_share() > > >+ * zfs_unshare() > > > * > > >- * zfs_is_shared_nfs() > > >- * zfs_is_shared_smb() > > >- * zfs_share_proto() > > >- * zfs_shareall(); > > >- * zfs_unshare_nfs() > > >- * zfs_unshare_smb() > > >- * zfs_unshareall_nfs() > > >+ * zfs_is_shared_nfs() > > >+ * zfs_is_shared_smb() > > >+ * zfs_share_proto() > > >+ * zfs_shareall(); > > >+ * zfs_unshare_nfs() > > >+ * zfs_unshare_smb() > > >+ * zfs_unshareall_nfs() > > > * zfs_unshareall_smb() > > > * zfs_unshareall() > > > * zfs_unshareall_bypath() > > >@@ -60,8 +61,8 @@ > > > * The following functions are available for pool consumers, and will > > > * mount/unmount and share/unshare all datasets within pool: > > > * > > >- * zpool_enable_datasets() > > >- * zpool_disable_datasets() > > >+ * zpool_enable_datasets() > > >+ * zpool_disable_datasets() > > > */ > > >=20 > > > #include > > >@@ -83,10 +84,14 @@ > > > #include > > >=20 > > > #include "libzfs_impl.h" > > >+#include > > >=20 > > > #include > > > #define MAXISALEN 257 /* based on sysinfo(2) man page */ > > >=20 > > >+static int mount_tp_nthr =3D 512; /* tpool threads for multi-threaded > > >mounting */ > > >+ > > >+static void zfs_mount_task(void *); > > > static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); > > > zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, > > > zfs_share_proto_t); > > >@@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) > > > } > > > } > > >=20 > > >+/* > > >+ * Add the given zfs handle to the cb_handles array, dynamically > > >reallocating > > >+ * the array if it is out of space > > >+ */ > > > void > > > libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) > > > { > > > if (cbp->cb_alloc =3D=3D cbp->cb_used) { > > > size_t newsz; > > >- void *ptr; > > >+ zfs_handle_t **newhandles; > > >=20 > > >- newsz =3D cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; > > >- ptr =3D zfs_realloc(zhp->zfs_hdl, > > >- cbp->cb_handles, cbp->cb_alloc * sizeof (void *), > > >- newsz * sizeof (void *)); > > >- cbp->cb_handles =3D ptr; > > >+ newsz =3D cbp->cb_alloc !=3D 0 ? cbp->cb_alloc * 2 : 64; > > >+ newhandles =3D zfs_realloc(zhp->zfs_hdl, > > >+ cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), > > >+ newsz * sizeof (zfs_handle_t *)); > > >+ cbp->cb_handles =3D newhandles; > > > cbp->cb_alloc =3D newsz; > > > } > > > cbp->cb_handles[cbp->cb_used++] =3D zhp; > > > } > > >=20 > > >+/* > > >+ * Recursive helper function used during file system enumeration > > >+ */ > > > static int > > >-mount_cb(zfs_handle_t *zhp, void *data) > > >+zfs_iter_cb(zfs_handle_t *zhp, void *data) > > > { > > > get_all_cb_t *cbp =3D data; > > >=20 > > >@@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) > > > } > > >=20 > > > libzfs_add_handle(cbp, zhp); > > >- if (zfs_iter_filesystems(zhp, mount_cb, cbp) !=3D 0) { > > >+ if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) !=3D 0) { > > > zfs_close(zhp); > > > return (-1); > > > } > > > return (0); > > > } > > >=20 > > >-int > > >-libzfs_dataset_cmp(const void *a, const void *b) > > >+/* > > >+ * Sort comparator that compares two mountpoint paths. We sort these > > >paths so > > >+ * that subdirectories immediately follow their parents. This means > > >that we > > >+ * effectively treat the '/' character as the lowest value non-nul > > >char. > > >+ * Since filesystems from non-global zones can have the same > > >mountpoint > > >+ * as other filesystems, the comparator sorts global zone filesystems > > >to > > >+ * the top of the list. This means that the global zone will traverse > > >the > > >+ * filesystem list in the correct order and can stop when it sees the > > >+ * first zoned filesystem. In a non-global zone, only the delegated > > >+ * filesystems are seen. > > >+ * > > >+ * An example sorted list using this comparator would look like: > > >+ * > > >+ * /foo > > >+ * /foo/bar > > >+ * /foo/bar/baz > > >+ * /foo/baz > > >+ * /foo.bar > > >+ * /foo (NGZ1) > > >+ * /foo (NGZ2) > > >+ * > > >+ * The mount code depend on this ordering to deterministically iterate > > >+ * over filesystems in order to spawn parallel mount tasks. > > >+ */ > > >+static int > > >+mountpoint_cmp(const void *arga, const void *argb) > > > { > > >- zfs_handle_t **za =3D (zfs_handle_t **)a; > > >- zfs_handle_t **zb =3D (zfs_handle_t **)b; > > >+ zfs_handle_t *const *zap =3D arga; > > >+ zfs_handle_t *za =3D *zap; > > >+ zfs_handle_t *const *zbp =3D argb; > > >+ zfs_handle_t *zb =3D *zbp; > > > char mounta[MAXPATHLEN]; > > > char mountb[MAXPATHLEN]; > > >+ const char *a =3D mounta; > > >+ const char *b =3D mountb; > > > boolean_t gota, gotb; > > >+ uint64_t zoneda, zonedb; > > >=20 > > >- if ((gota =3D (zfs_get_type(*za) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) > > >- verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, > > >+ zoneda =3D zfs_prop_get_int(za, ZFS_PROP_ZONED); > > >+ zonedb =3D zfs_prop_get_int(zb, ZFS_PROP_ZONED); > > >+ if (zoneda && !zonedb) > > >+ return (1); > > >+ if (!zoneda && zonedb) > > >+ return (-1); > > >+ gota =3D (zfs_get_type(za) =3D=3D ZFS_TYPE_FILESYSTEM); > > >+ if (gota) > > >+ verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, > > > sizeof (mounta), NULL, NULL, 0, B_FALSE) =3D=3D 0); > > >- if ((gotb =3D (zfs_get_type(*zb) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) > > >- verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, > > >+ gotb =3D (zfs_get_type(zb) =3D=3D ZFS_TYPE_FILESYSTEM); > > >+ if (gotb) > > >+ verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, > > > sizeof (mountb), NULL, NULL, 0, B_FALSE) =3D=3D 0); > > >=20 > > >- if (gota && gotb) > > >- return (strcmp(mounta, mountb)); > > >+ if (gota && gotb) { > > >+ while (*a !=3D '\0' && (*a =3D=3D *b)) { > > >+ a++; > > >+ b++; > > >+ } > > >+ if (*a =3D=3D *b) > > >+ return (0); > > >+ if (*a =3D=3D '\0') > > >+ return (-1); > > >+ if (*b =3D=3D '\0') > > >+ return (-1); > > >+ if (*a =3D=3D '/') > > >+ return (-1); > > >+ if (*b =3D=3D '/') > > >+ return (-1); > > >+ return (*a < *b ? -1 : *a > *b); > > >+ } > > >=20 > > > if (gota) > > > return (-1); > > > if (gotb) > > > return (1); > > >=20 > > >- return (strcmp(zfs_get_name(a), zfs_get_name(b))); > > >+ /* > > >+ * If neither filesystem has a mountpoint, revert to sorting by > > >+ * datset name. > > >+ */ > > >+ return (strcmp(zfs_get_name(za), zfs_get_name(zb))); > > > } > > >=20 > > > /* > > >+ * Reutrn true if path2 is a child of path1 > > >+ */ > > >+static boolean_t > > >+libzfs_path_contains(const char *path1, const char *path2) > > >+{ > > >+ return (strstr(path2, path1) =3D=3D path2 && path2[strlen(path1)] = =3D=3D > > >'/'); > > >+} > > >+ > > >+ > > >+static int > > >+non_descendant_idx(zfs_handle_t **handles, size_t num_handles, int > > >idx) > > >+{ > > >+ char parent[ZFS_MAXPROPLEN]; > > >+ char child[ZFS_MAXPROPLEN]; > > >+ int i; > > >+ > > >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, > > >+ sizeof (parent), NULL, NULL, 0, B_FALSE) =3D=3D 0); > > >+ > > >+ for (i =3D idx + 1; i < num_handles; i++) { > > >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, > > >+ sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); > > >+ if (!libzfs_path_contains(parent, child)) > > >+ break; > > >+ } > > >+ return (i); > > >+} > > >+ > > >+typedef struct mnt_param { > > >+ libzfs_handle_t *mnt_hdl; > > >+ tpool_t *mnt_tp; > > >+ zfs_handle_t **mnt_zhps; /* filesystems to mount */ > > >+ size_t mnt_num_handles; > > >+ int mnt_idx; /* Index of selected entry to mount */ > > >+ zfs_iter_f mnt_func; > > >+ void *mnt_data; > > >+} mnt_param_t; > > >+ > > >+/* > > >+ * Allocate and populate the parameter struct for mount function, and > > >+ * schedule mounting of the entry selected by idx. > > >+ */ > > >+static void > > >+zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, > > >+ size_t num_handles, int idx, zfs_iter_f func, void *data, tpool_t > > >*tp) > > >+{ > > >+ mnt_param_t *mnt_param =3D zfs_alloc(hdl, sizeof (mnt_param_t)); > > >+ > > >+ mnt_param->mnt_hdl =3D hdl; > > >+ mnt_param->mnt_tp =3D tp; > > >+ mnt_param->mnt_zhps =3D handles; > > >+ mnt_param->mnt_num_handles =3D num_handles; > > >+ mnt_param->mnt_idx =3D idx; > > >+ mnt_param->mnt_func =3D func; > > >+ mnt_param->mnt_data =3D data; > > >+ > > >+ (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); > > >+} > > >+ > > >+/* > > >+ * This is the structure used to keep state of mounting or sharing > > >operations > > >+ * during a call to zpool_enable_datasets(). > > >+ */ > > >+typedef struct mount_state { > > >+ /* > > >+ * ms_mntstatus is set to -1 if any mount fails. While multiple > > >threads > > >+ * could update this variable concurrently, no synchronization is > > >+ * needed as it's only ever set to -1. > > >+ */ > > >+ int ms_mntstatus; > > >+ int ms_mntflags; > > >+ const char *ms_mntopts; > > >+} mount_state_t; > > >+ > > >+static int > > >+zfs_mount_one(zfs_handle_t *zhp, void *arg) > > >+{ > > >+ mount_state_t *ms =3D arg; > > >+ int ret =3D 0; > > >+ > > >+ if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) !=3D 0) > > >+ ret =3D ms->ms_mntstatus =3D -1; > > >+ return (ret); > > >+} > > >+ > > >+static int > > >+zfs_share_one(zfs_handle_t *zhp, void *arg) > > >+{ > > >+ mount_state_t *ms =3D arg; > > >+ int ret =3D 0; > > >+ > > >+ if (zfs_share(zhp) !=3D 0) > > >+ ret =3D ms->ms_mntstatus =3D -1; > > >+ return (ret); > > >+} > > >+ > > >+/* > > >+ * Thread pool function to mount one file system. On completion, it > > >finds and > > >+ * schedules its children to be mounted. This depends on the sorting > > >done in > > >+ * zfs_foreach_mountpoint(). Note that the degenerate case (chain of > > >entries > > >+ * each descending from the previous) will have no parallelism since > > >we always > > >+ * have to wait for the parent to finish mounting before we can > > >schedule > > >+ * its children. > > >+ */ > > >+static void > > >+zfs_mount_task(void *arg) > > >+{ > > >+ mnt_param_t *mp =3D arg; > > >+ int idx =3D mp->mnt_idx; > > >+ zfs_handle_t **handles =3D mp->mnt_zhps; > > >+ size_t num_handles =3D mp->mnt_num_handles; > > >+ char mountpoint[ZFS_MAXPROPLEN]; > > >+ > > >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, mountpoint, > > >+ sizeof (mountpoint), NULL, NULL, 0, B_FALSE) =3D=3D 0); > > >+ > > >+ if (mp->mnt_func(handles[idx], mp->mnt_data) !=3D 0) > > >+ return; > > >+ > > >+ /* > > >+ * We dispatch tasks to mount filesystems with mountpoints underneath > > >+ * this one. We do this by dispatching the next filesystem with a > > >+ * descendant mountpoint of the one we just mounted, then skip all of > > >+ * its descendants, dispatch the next descendant mountpoint, and so > > >on. > > >+ * The non_descendant_idx() function skips over filesystems that are > > >+ * descendants of the filesystem we just dispatched. > > >+ */ > > >+ for (int i =3D idx + 1; i < num_handles; > > >+ i =3D non_descendant_idx(handles, num_handles, i)) { > > >+ char child[ZFS_MAXPROPLEN]; > > >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, > > >+ child, sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); > > >+ > > >+ if (!libzfs_path_contains(mountpoint, child)) > > >+ break; /* not a descendant, return */ > > >+ zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, > > >+ mp->mnt_func, mp->mnt_data, mp->mnt_tp); > > >+ } > > >+ free(mp); > > >+} > > >+ > > >+/* > > >+ * Issue the func callback for each ZFS handle contained in the > > >handles > > >+ * array. This function is used to mount all datasets, and so this > > >function > > >+ * guarantees that filesystems for parent mountpoints are called > > >before their > > >+ * children. As such, before issuing any callbacks, we first sort the > > >array > > >+ * of handles by mountpoint. > > >+ * > > >+ * Callbacks are issued in one of two ways: > > >+ * > > >+ * 1. Sequentially: If the parallel argument is B_FALSE or the > > >ZFS_SERIAL_MOUNT > > >+ * environment variable is set, then we issue callbacks > > >sequentially. > > >+ * > > >+ * 2. In parallel: If the parallel argument is B_TRUE and the > > >ZFS_SERIAL_MOUNT > > >+ * environment variable is not set, then we use a tpool to dispatch > > >threads > > >+ * to mount filesystems in parallel. This function dispatches tasks > > >to mount > > >+ * the filesystems at the top-level mountpoints, and these tasks in > > >turn > > >+ * are responsible for recursively mounting filesystems in their > > >children > > >+ * mountpoints. > > >+ */ > > >+void > > >+zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t **handles, > > >+ size_t num_handles, zfs_iter_f func, void *data, boolean_t > > >parallel) > > >+{ > > >+ zoneid_t zoneid =3D getzoneid(); > > >+ > > >+ /* > > >+ * The ZFS_SERIAL_MOUNT environment variable is an undocumented > > >+ * variable that can be used as a convenience to do a/b comparison > > >+ * of serial vs. parallel mounting. > > >+ */ > > >+ boolean_t serial_mount =3D !parallel || > > >+ (getenv("ZFS_SERIAL_MOUNT") !=3D NULL); > > >+ > > >+ /* > > >+ * Sort the datasets by mountpoint. See mountpoint_cmp for details > > >+ * of how these are sorted. > > >+ */ > > >+ qsort(handles, num_handles, sizeof (zfs_handle_t *), mountpoint_cmp); > > >+ > > >+ if (serial_mount) { > > >+ for (int i =3D 0; i < num_handles; i++) { > > >+ func(handles[i], data); > > >+ } > > >+ return; > > >+ } > > >+ > > >+ /* > > >+ * Issue the callback function for each dataset using a parallel > > >+ * algorithm that uses a thread pool to manage threads. > > >+ */ > > >+ tpool_t *tp =3D tpool_create(1, mount_tp_nthr, 0, NULL); > > >+ > > >+ /* > > >+ * There may be multiple "top level" mountpoints outside of the > > >pool's > > >+ * root mountpoint, e.g.: /foo /bar. Dispatch a mount task for each > > >of > > >+ * these. > > >+ */ > > >+ for (int i =3D 0; i < num_handles; > > >+ i =3D non_descendant_idx(handles, num_handles, i)) { > > >+ /* > > >+ * Since the mountpoints have been sorted so that the zoned > > >+ * filesystems are at the end, a zoned filesystem seen from > > >+ * the global zone means that we're done. > > >+ */ > > >+ if (zoneid =3D=3D GLOBAL_ZONEID && > > >+ zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) > > >+ break; > > >+ zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, > > >+ tp); > > >+ } > > >+ > > >+ tpool_wait(tp); /* wait for all scheduled mounts to complete */ > > >+ tpool_destroy(tp); > > >+} > > >+ > > >+/* > > >* Mount and share all datasets within the given pool. This assumes > > >that no > > >- * datasets within the pool are currently mounted. Because users can > > >create > > >- * complicated nested hierarchies of mountpoints, we first gather all > > >the > > >- * datasets and mountpoints within the pool, and sort them by > > >mountpoint. Once > > >- * we have the list of all filesystems, we iterate over them in order > > >and mount > > >- * and/or share each one. > > >+ * datasets within the pool are currently mounted. > > > */ > > > #pragma weak zpool_mount_datasets =3D zpool_enable_datasets > > > int > > >zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int > > >flags) > > > { > > > get_all_cb_t cb =3D { 0 }; > > >- libzfs_handle_t *hdl =3D zhp->zpool_hdl; > > >+ mount_state_t ms =3D { 0 }; > > > zfs_handle_t *zfsp; > > >- int i, ret =3D -1; > > >- int *good; > > >+ int ret =3D 0; > > >=20 > > >- /* > > >- * Gather all non-snap datasets within the pool. > > >- */ > > >- if ((zfsp =3D zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) =3D= =3D > > >NULL) > > >+ if ((zfsp =3D zfs_open(zhp->zpool_hdl, zhp->zpool_name, > > >+ ZFS_TYPE_DATASET)) =3D=3D NULL) > > > goto out; > > >=20 > > >- libzfs_add_handle(&cb, zfsp); > > >- if (zfs_iter_filesystems(zfsp, mount_cb, &cb) !=3D 0) > > >- goto out; > > > /* > > >- * Sort the datasets by mountpoint. > > >+ * Gather all non-snapshot datasets within the pool. Start by adding > > >+ * the root filesystem for this pool to the list, and then iterate > > >+ * over all child filesystems. > > > */ > > >- qsort(cb.cb_handles, cb.cb_used, sizeof (void *), > > >- libzfs_dataset_cmp); > > >+ libzfs_add_handle(&cb, zfsp); > > >+ if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) !=3D 0) > > >+ goto out; > > >=20 > > > /* > > >- * And mount all the datasets, keeping track of which ones > > >- * succeeded or failed. > > >+ * Mount all filesystems > > > */ > > >- if ((good =3D zfs_alloc(zhp->zpool_hdl, > > >- cb.cb_used * sizeof (int))) =3D=3D NULL) > > >- goto out; > > >+ ms.ms_mntopts =3D mntopts; > > >+ ms.ms_mntflags =3D flags; > > >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, cb.cb_used, > > >+ zfs_mount_one, &ms, B_TRUE); > > >+ if (ms.ms_mntstatus !=3D 0) > > >+ ret =3D ms.ms_mntstatus; > > >=20 > > >- ret =3D 0; > > >- for (i =3D 0; i < cb.cb_used; i++) { > > >- if (zfs_mount(cb.cb_handles[i], mntopts, flags) !=3D 0) > > >- ret =3D -1; > > >- else > > >- good[i] =3D 1; > > >- } > > >- > > > /* > > >- * Then share all the ones that need to be shared. This needs > > >- * to be a separate pass in order to avoid excessive reloading > > >- * of the configuration. Good should never be NULL since > > >- * zfs_alloc is supposed to exit if memory isn't available. > > >+ * Share all filesystems that need to be shared. This needs to be > > >+ * a separate pass because libshare is not mt-safe, and so we need > > >+ * to share serially. > > > */ > > >- for (i =3D 0; i < cb.cb_used; i++) { > > >- if (good[i] && zfs_share(cb.cb_handles[i]) !=3D 0) > > >- ret =3D -1; > > >- } > > >+ ms.ms_mntstatus =3D 0; > > >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, cb.cb_used, > > >+ zfs_share_one, &ms, B_FALSE); > > >+ if (ms.ms_mntstatus !=3D 0) > > >+ ret =3D ms.ms_mntstatus; > > >=20 > > >- free(good); > > >- > > > out: > > >- for (i =3D 0; i < cb.cb_used; i++) > > >+ for (int i =3D 0; i < cb.cb_used; i++) > > > zfs_close(cb.cb_handles[i]); > > > free(cb.cb_handles); > > >=20 > >=20 > > This broke my systems, many filesystems fail to mount causing nullfs la= te mounts to fail. No details now until tonight. > >=20 > > Suggest we back this out until it is properly tested. > >=20 >=20 > What fails to mount? what message? can you provide Gandi folks more infor= mations > so they can fix? >=20 > I will revert if we cannot have a quick fix but let s give them a chance = to fix > first. >=20 With the proper email in CC there is a better chance to reach at them :) Best regards, Bapt --5qciaak4a75kckt7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlx1ZTMACgkQY4mL3PG3 PlrnMA//XWNSQQYDqYiLZhkP/ChlVQyxQ8P1hwiA6x75tClGe1UaGNAxR31zWAg1 ZqkTEvNjrRQAKzQ2qnKOjFxo0QbZ1VR/7lJWTc1IEBPPswE6qaGLAD9yUUq7MirC xVETLGhrlmnshXnFIGQddOS3HzZsflOs2tb0el1Rgkldyr7mBbCvDw8jet5bBTuD 6YkAMnSMRrQLElusHk4GuIbVES2ItT2f/DICiBaWgXUnXbg59hx3Xx+G/EE4Iqcm IZ0LN+7N1S/JO2m6RvKNO41LDwahNerMnTzq7uo1Vvkqm5TV15NwkN7V02Hk/baH Uoy9A1rc5MFex+H27bec7kHEqBXRXQSG1b0coJRWDjBltsx0+MjgUHLAJp+TJNBE ro6/MklsFIfRVoxaKWo+KqCnodHukTZ1vvfIwOBFTlr4e5A5P4X8bmqZre40MjlG YqSDnXEnyNFomjLEtbxQINkKTOyhMLpK7fyM4HBCQQAO/0yMUcgE/IqUvJOEM965 Uygr5AH6vjfS2X4a0iMrxwARUN9p3rK4OnK9zh5Tl/Cih52q7GzRKolgXug3TDNH CfDZINNsGw0a2JGb4Mqr6PMcaVTO6Wmtz01Ka3MSM/7QmVCtF0SvCpCxvwEGBkBr uquKmSMON7LetIlXTGz6GhQNXYbDw0y0ZYVNHv9dy5WNDeqXttE= =3Vsf -----END PGP SIGNATURE----- --5qciaak4a75kckt7-- From owner-svn-src-head@freebsd.org Tue Feb 26 16:13:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28C9A151DF88; Tue, 26 Feb 2019 16:13:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 40A508C1C6; Tue, 26 Feb 2019 16:13:36 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yfMCg48aueOi3yfMEgNJfN; Tue, 26 Feb 2019 09:13:28 -0700 X-Authority-Analysis: v=2.3 cv=SKA8q9nH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=CFTnQlWoA9kA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=DsloTXpuAAAA:20 a=FNC4LJVLAAAA:20 a=CgiagczvAAAA:8 a=pGLkceISAAAA:8 a=T3t4S-RIeRKQ9G2RNYsA:9 a=_KzNX97j5ZdqPuSu:21 a=k2lazpnPzGwclXad:21 a=_MumHSFdkb9DqG-v:21 a=QEXdDO2ut3YA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=ZydqF0V2MF2Cvey6h_li:22 Received: from [10.250.34.171] (S01060c8ddb626965.gv.shawcable.net [70.67.252.119]) by spqr.komquats.com (Postfix) with ESMTPSA id 75EB02EF; Tue, 26 Feb 2019 08:13:24 -0800 (PST) Date: Tue, 26 Feb 2019 08:13:01 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <1F5FB340-1CD2-400F-82D3-8D4949A351A2@cschubert.com> X-CMAE-Envelope: MS4wfHLTFkvyalzQlBILom/XbxJVKW40TpfOW1w/gKbPzvUKB63LQQlufsFKIf75wB5YxYcf6aXyVLSlye+Ppz4sh8ipXhhkHOMAw+7yZwMsQUDqd9RATPnx dumCqC2B3Pf09W30nijEdGkUBMIr2TkVvMgMoDP3VvO/0yuFI1V2N2nSiXWSO+8W46bn32fPt8Nu3YecUwmSQhlz/rBQivgD2Si5q+/P5Eh/NA7xKrD6IQnQ wcgseeljjEk4NOHr78/IRme/2t0DTQy17B6oBAe3HDYTF4GxCDNXmXfWWEtXnfEI X-Rspamd-Queue-Id: 40A508C1C6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 16:13:37 -0000 On February 26, 2019 7:48:27 AM PST, Cy Schubert wrote: >On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > wrote: >>Author: bapt >>Date: Tue Feb 26 08:18:34 2019 >>New Revision: 344569 >>URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/344569 >> >>Log: >> Implement parallel mounting for ZFS filesystem >> =20 >> It was first implemented on Illumos and then ported to ZoL=2E >> This patch is a port to FreeBSD of the ZoL version=2E >> This patch also includes a fix for a race condition that was amended >> =20 >>With such patch Delphix has seen a huge decrease in latency of the >>mount phase >> (https://github=2Ecom/openzfs/openzfs/commit/a3f0e2b569 for details)= =2E >>With that current change Gandi has measured improvments that are on >par >>with >> those reported by Delphix=2E >> =20 >> Zol commits incorporated: >>https://github=2Ecom/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825= c70c9c9e303 >>https://github=2Ecom/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d40= 77567dfea21 >> =20 >> Reviewed by: avg, sef >> Approved by: avg, sef >> Obtained from: ZoL >> MFC after: 1 month >> Relnotes: yes >> Sponsored by: Gandi=2Enet >> Differential Revision: https://reviews=2Efreebsd=2Eorg/D19098 >> >>Modified: >> head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec >> >>Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec Tue Feb 26 >>06:22:10 2019 (r344568) >>+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec Tue Feb 26 >>08:18:34 2019 (r344569) >>@@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) >>=20 >> #define CHECK_SPINNER 30 >> #define SPINNER_TIME 3 /* seconds */ >>-#define MOUNT_TIME 5 /* seconds */ >>+#define MOUNT_TIME 1 /* seconds */ >>=20 >>+typedef struct get_all_state { >>+ boolean_t ga_verbose; >>+ get_all_cb_t *ga_cbp; >>+} get_all_state_t; >>+ >> static int >> get_one_dataset(zfs_handle_t *zhp, void *data) >> { >>@@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void *data) >> static int spinval =3D 0; >> static int spincheck =3D 0; >> static time_t last_spin_time =3D (time_t)0; >>- get_all_cb_t *cbp =3D data; >>+ get_all_state_t *state =3D data; >> zfs_type_t type =3D zfs_get_type(zhp); >>=20 >>- if (cbp->cb_verbose) { >>+ if (state->ga_verbose) { >> if (--spincheck < 0) { >> time_t now =3D time(NULL); >> if (last_spin_time + SPINNER_TIME < now) { >>@@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void *data) >> zfs_close(zhp); >> return (0); >> } >>- libzfs_add_handle(cbp, zhp); >>- assert(cbp->cb_used <=3D cbp->cb_alloc); >>+ libzfs_add_handle(state->ga_cbp, zhp); >>+ assert(state->ga_cbp->cb_used <=3D state->ga_cbp->cb_alloc); >>=20 >> return (0); >> } >>=20 >> static void >>-get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t >>verbose) >>+get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) >> { >>- get_all_cb_t cb =3D { 0 }; >>- cb=2Ecb_verbose =3D verbose; >>- cb=2Ecb_getone =3D get_one_dataset; >>+ get_all_state_t state =3D { >>+ =2Ega_verbose =3D verbose, >>+ =2Ega_cbp =3D cbp >>+ }; >>=20 >> if (verbose) >> set_progress_header(gettext("Reading ZFS config")); >>- (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); >>+ (void) zfs_iter_root(g_zfs, get_one_dataset, &state); >>=20 >>- *dslist =3D cb=2Ecb_handles; >>- *count =3D cb=2Ecb_used; >>- >> if (verbose) >> finish_progress(gettext("done=2E")); >> } >>@@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, size_t >>*count >>* similar, we have a common function with an extra parameter to >>determine which >> * mode we are using=2E >> */ >>-#define OP_SHARE 0x1 >>-#define OP_MOUNT 0x2 >>+typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; >>=20 >>+typedef struct share_mount_state { >>+ share_mount_op_t sm_op; >>+ boolean_t sm_verbose; >>+ int sm_flags; >>+ char *sm_options; >>+ char *sm_proto; /* only valid for OP_SHARE */ >>+ pthread_mutex_t sm_lock; /* protects the remaining fields */ >>+ uint_t sm_total; /* number of filesystems to process */ >>+ uint_t sm_done; /* number of filesystems processed */ >>+ int sm_status; /* -1 if any of the share/mount operations failed */ >>+} share_mount_state_t; >>+ >> /* >> * Share or mount a dataset=2E >> */ >>@@ -6122,6 +6136,29 @@ report_mount_progress(int current, int total) >> update_progress(info); >> } >>=20 >>+/* >>+ * zfs_foreach_mountpoint() callback that mounts or shares on >>filesystem and >>+ * updates the progress meter >>+ */ >>+static int >>+share_mount_one_cb(zfs_handle_t *zhp, void *arg) >>+{ >>+ share_mount_state_t *sms =3D arg; >>+ int ret; >>+ >>+ ret =3D share_mount_one(zhp, sms->sm_op, sms->sm_flags, sms->sm_proto, >>+ B_FALSE, sms->sm_options); >>+ >>+ pthread_mutex_lock(&sms->sm_lock); >>+ if (ret !=3D 0) >>+ sms->sm_status =3D ret; >>+ sms->sm_done++; >>+ if (sms->sm_verbose) >>+ report_mount_progress(sms->sm_done, sms->sm_total); >>+ pthread_mutex_unlock(&sms->sm_lock); >>+ return (ret); >>+} >>+ >> static void >> append_options(char *mntopts, char *newopts) >> { >>@@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) >>=20 >> /* check number of arguments */ >> if (do_all) { >>- zfs_handle_t **dslist =3D NULL; >>- size_t i, count =3D 0; >> char *protocol =3D NULL; >>=20 >> if (op =3D=3D OP_SHARE && argc > 0) { >>@@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) >> } >>=20 >> start_progress_timer(); >>- get_all_datasets(&dslist, &count, verbose); >>+ get_all_cb_t cb =3D { 0 }; >>+ get_all_datasets(&cb, verbose); >>=20 >>- if (count =3D=3D 0) >>+ if (cb=2Ecb_used =3D=3D 0) { >>+ if (options !=3D NULL) >>+ free(options); >> return (0); >>+ } >>=20 >>- qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); >> #ifdef illumos >>- sa_init_selective_arg_t sharearg; >>- sharearg=2Ezhandle_arr =3D dslist; >>- sharearg=2Ezhandle_len =3D count; >>- if ((ret =3D zfs_init_libshare_arg(zfs_get_handle(dslist[0]), >>- SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { >>- (void) fprintf(stderr, >>- gettext("Could not initialize libshare, %d"), ret); >>- return (ret); >>+ if (op =3D=3D OP_SHARE) { >>+ sa_init_selective_arg_t sharearg; >>+ sharearg=2Ezhandle_arr =3D cb=2Ecb_handles; >>+ sharearg=2Ezhandle_len =3D cb=2Ecb_used; >>+ if ((ret =3D zfs_init_libshare_arg(g_zfs, >>+ SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { >>+ (void) fprintf(stderr, gettext( >>+ "Could not initialize libshare, %d"), ret); >>+ return (ret); >>+ } >> } >> #endif >>+ share_mount_state_t share_mount_state =3D { 0 }; >>+ share_mount_state=2Esm_op =3D op; >>+ share_mount_state=2Esm_verbose =3D verbose; >>+ share_mount_state=2Esm_flags =3D flags; >>+ share_mount_state=2Esm_options =3D options; >>+ share_mount_state=2Esm_proto =3D protocol; >>+ share_mount_state=2Esm_total =3D cb=2Ecb_used; >>+ pthread_mutex_init(&share_mount_state=2Esm_lock, NULL); >>=20 >>- for (i =3D 0; i < count; i++) { >>- if (verbose) >>- report_mount_progress(i, count); >>+ /* >>+ * libshare isn't mt-safe, so only do the operation in parallel >>+ * if we're mounting=2E >>+ */ >>+ zfs_foreach_mountpoint(g_zfs, cb=2Ecb_handles, cb=2Ecb_used, >>+ share_mount_one_cb, &share_mount_state, op =3D=3D OP_MOUNT); >>+ ret =3D share_mount_state=2Esm_status; >>=20 >>- if (share_mount_one(dslist[i], op, flags, protocol, >>- B_FALSE, options) !=3D 0) >>- ret =3D 1; >>- zfs_close(dslist[i]); >>- } >>- >>- free(dslist); >>+ for (int i =3D 0; i < cb=2Ecb_used; i++) >>+ zfs_close(cb=2Ecb_handles[i]); >>+ free(cb=2Ecb_handles); >> } else if (argc =3D=3D 0) { >> struct mnttab entry; >>=20 >> >>Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh Tue Feb >26 >>06:22:10 2019 (r344568) >>+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh Tue Feb >26 >>08:18:34 2019 (r344569) >>@@ -579,12 +579,12 @@ typedef struct get_all_cb { >> zfs_handle_t **cb_handles; >> size_t cb_alloc; >> size_t cb_used; >>- boolean_t cb_verbose; >>- int (*cb_getone)(zfs_handle_t *, void *); >> } get_all_cb_t; >>=20 >>+void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, >>size_t, >>+ zfs_iter_f, void*, boolean_t); >>+ >> void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); >>-int libzfs_dataset_cmp(const void *, const void *); >>=20 >> /* >> * Functions to create and destroy datasets=2E >> >>Modified: >>head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec Tue >>Feb 26 06:22:10 2019 (r344568) >>+++ >>head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec Tue >>Feb 26 08:18:34 2019 (r344569) >>@@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, >const >>vo >> void >> libzfs_mnttab_init(libzfs_handle_t *hdl) >> { >>+ pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); >> assert(avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0); >> avl_create(&hdl->libzfs_mnttab_cache, libzfs_mnttab_cache_compare, >> sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); >>@@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) >> free(mtn); >> } >> avl_destroy(&hdl->libzfs_mnttab_cache); >>+ (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); >> } >>=20 >> void >>@@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >char >>*f >> { >> mnttab_node_t find; >> mnttab_node_t *mtn; >>+ int ret =3D ENOENT; >>=20 >> if (!hdl->libzfs_mnttab_enable) { >> struct mnttab srch =3D { 0 }; >>@@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >char >>*f >> return (ENOENT); >> } >>=20 >>+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >> if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) >> libzfs_mnttab_update(hdl); >>=20 >>@@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >>char *f >> mtn =3D avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); >> if (mtn) { >> *entry =3D mtn->mtn_mt; >>- return (0); >>+ ret =3D 0; >> } >>- return (ENOENT); >>+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >>+ return (ret); >> } >>=20 >> void >>@@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, const >>char *sp >> { >> mnttab_node_t *mtn; >>=20 >>- if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) >>- return; >>- mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); >>- mtn->mtn_mt=2Emnt_special =3D zfs_strdup(hdl, special); >>- mtn->mtn_mt=2Emnt_mountp =3D zfs_strdup(hdl, mountp); >>- mtn->mtn_mt=2Emnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); >>- mtn->mtn_mt=2Emnt_mntopts =3D zfs_strdup(hdl, mntopts); >>- avl_add(&hdl->libzfs_mnttab_cache, mtn); >>-} >>+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >>+ if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) { >>+ mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); >>+ mtn->mtn_mt=2Emnt_special =3D zfs_strdup(hdl, special); >>+ mtn->mtn_mt=2Emnt_mountp =3D zfs_strdup(hdl, mountp); >>+ mtn->mtn_mt=2Emnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); >>+ mtn->mtn_mt=2Emnt_mntopts =3D zfs_strdup(hdl, mntopts); >>+ avl_add(&hdl->libzfs_mnttab_cache, mtn); >>+ } >>+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >>+} =09 >>=20 >> void >> libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) >>@@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const >>char=20 >> mnttab_node_t find; >> mnttab_node_t *ret; >>=20 >>+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >> find=2Emtn_mt=2Emnt_special =3D (char *)fsname; >> if ((ret =3D avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL)) >> !=3D NULL) { >>@@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, const >>char=20 >> free(ret->mtn_mt=2Emnt_mntopts); >> free(ret); >> } >>+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >> } >>=20 >> int >> >>Modified: >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh Tue >>Feb 26 06:22:10 2019 (r344568) >>+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh Tue >>Feb 26 08:18:34 2019 (r344569) >>@@ -22,7 +22,7 @@ >> /* >>* Copyright (c) 2005, 2010, Oracle and/or its affiliates=2E All rights >>reserved=2E >> * Copyright (c) 2011 Pawel Jakub Dawidek=2E All rights reserved=2E >>- * Copyright (c) 2011, 2016 by Delphix=2E All rights reserved=2E >>+ * Copyright (c) 2011, 2017 by Delphix=2E All rights reserved=2E >>* Copyright (c) 2013 Martin Matuska =2E All rights >>reserved=2E >> */ >>=20 >>@@ -73,6 +73,13 @@ struct libzfs_handle { >> int libzfs_storeerr; /* stuff error messages into buffer */ >> void *libzfs_sharehdl; /* libshare handle */ >> boolean_t libzfs_mnttab_enable; >>+ /* >>+ * We need a lock to handle the case where parallel mount >>+ * threads are populating the mnttab cache simultaneously=2E The >>+ * lock only protects the integrity of the avl tree, and does >>+ * not protect the contents of the mnttab entries themselves=2E >>+ */ >>+ pthread_mutex_t libzfs_mnttab_cache_lock; >> avl_tree_t libzfs_mnttab_cache; >> int libzfs_pool_iter; >> libzfs_fru_t **libzfs_fru_hash; >> >>Modified: >>head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec Tue >>Feb 26 06:22:10 2019 (r344568) >>+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec Tue >>Feb 26 08:18:34 2019 (r344569) >>@@ -26,6 +26,7 @@ >> * Copyright 2016 Igor Kozhukhov >> * Copyright 2017 Joyent, Inc=2E >> * Copyright 2017 RackTop Systems=2E >>+ * Copyright 2018 OmniOS Community Edition (OmniOSce) Association=2E >> */ >>=20 >> /* >>@@ -34,25 +35,25 @@ >> * they are used by mount and unmount and when changing a >filesystem's >> * mountpoint=2E >> * >>- * zfs_is_mounted() >>- * zfs_mount() >>- * zfs_unmount() >>- * zfs_unmountall() >>+ * zfs_is_mounted() >>+ * zfs_mount() >>+ * zfs_unmount() >>+ * zfs_unmountall() >> * >>* This file also contains the functions used to manage sharing >>filesystems via >> * NFS and iSCSI: >> * >>- * zfs_is_shared() >>- * zfs_share() >>- * zfs_unshare() >>+ * zfs_is_shared() >>+ * zfs_share() >>+ * zfs_unshare() >> * >>- * zfs_is_shared_nfs() >>- * zfs_is_shared_smb() >>- * zfs_share_proto() >>- * zfs_shareall(); >>- * zfs_unshare_nfs() >>- * zfs_unshare_smb() >>- * zfs_unshareall_nfs() >>+ * zfs_is_shared_nfs() >>+ * zfs_is_shared_smb() >>+ * zfs_share_proto() >>+ * zfs_shareall(); >>+ * zfs_unshare_nfs() >>+ * zfs_unshare_smb() >>+ * zfs_unshareall_nfs() >> * zfs_unshareall_smb() >> * zfs_unshareall() >> * zfs_unshareall_bypath() >>@@ -60,8 +61,8 @@ >> * The following functions are available for pool consumers, and will >> * mount/unmount and share/unshare all datasets within pool: >> * >>- * zpool_enable_datasets() >>- * zpool_disable_datasets() >>+ * zpool_enable_datasets() >>+ * zpool_disable_datasets() >> */ >>=20 >> #include >>@@ -83,10 +84,14 @@ >> #include >>=20 >> #include "libzfs_impl=2Eh" >>+#include >>=20 >> #include >> #define MAXISALEN 257 /* based on sysinfo(2) man page */ >>=20 >>+static int mount_tp_nthr =3D 512; /* tpool threads for multi-threaded >>mounting */ >>+ >>+static void zfs_mount_task(void *); >> static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); >> zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, >> zfs_share_proto_t); >>@@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) >> } >> } >>=20 >>+/* >>+ * Add the given zfs handle to the cb_handles array, dynamically >>reallocating >>+ * the array if it is out of space >>+ */ >> void >> libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) >> { >> if (cbp->cb_alloc =3D=3D cbp->cb_used) { >> size_t newsz; >>- void *ptr; >>+ zfs_handle_t **newhandles; >>=20 >>- newsz =3D cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; >>- ptr =3D zfs_realloc(zhp->zfs_hdl, >>- cbp->cb_handles, cbp->cb_alloc * sizeof (void *), >>- newsz * sizeof (void *)); >>- cbp->cb_handles =3D ptr; >>+ newsz =3D cbp->cb_alloc !=3D 0 ? cbp->cb_alloc * 2 : 64; >>+ newhandles =3D zfs_realloc(zhp->zfs_hdl, >>+ cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), >>+ newsz * sizeof (zfs_handle_t *)); >>+ cbp->cb_handles =3D newhandles; >> cbp->cb_alloc =3D newsz; >> } >> cbp->cb_handles[cbp->cb_used++] =3D zhp; >> } >>=20 >>+/* >>+ * Recursive helper function used during file system enumeration >>+ */ >> static int >>-mount_cb(zfs_handle_t *zhp, void *data) >>+zfs_iter_cb(zfs_handle_t *zhp, void *data) >> { >> get_all_cb_t *cbp =3D data; >>=20 >>@@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) >> } >>=20 >> libzfs_add_handle(cbp, zhp); >>- if (zfs_iter_filesystems(zhp, mount_cb, cbp) !=3D 0) { >>+ if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) !=3D 0) { >> zfs_close(zhp); >> return (-1); >> } >> return (0); >> } >>=20 >>-int >>-libzfs_dataset_cmp(const void *a, const void *b) >>+/* >>+ * Sort comparator that compares two mountpoint paths=2E We sort these >>paths so >>+ * that subdirectories immediately follow their parents=2E This means >>that we >>+ * effectively treat the '/' character as the lowest value non-nul >>char=2E >>+ * Since filesystems from non-global zones can have the same >>mountpoint >>+ * as other filesystems, the comparator sorts global zone filesystems >>to >>+ * the top of the list=2E This means that the global zone will traverse >>the >>+ * filesystem list in the correct order and can stop when it sees the >>+ * first zoned filesystem=2E In a non-global zone, only the delegated >>+ * filesystems are seen=2E >>+ * >>+ * An example sorted list using this comparator would look like: >>+ * >>+ * /foo >>+ * /foo/bar >>+ * /foo/bar/baz >>+ * /foo/baz >>+ * /foo=2Ebar >>+ * /foo (NGZ1) >>+ * /foo (NGZ2) >>+ * >>+ * The mount code depend on this ordering to deterministically >iterate >>+ * over filesystems in order to spawn parallel mount tasks=2E >>+ */ >>+static int >>+mountpoint_cmp(const void *arga, const void *argb) >> { >>- zfs_handle_t **za =3D (zfs_handle_t **)a; >>- zfs_handle_t **zb =3D (zfs_handle_t **)b; >>+ zfs_handle_t *const *zap =3D arga; >>+ zfs_handle_t *za =3D *zap; >>+ zfs_handle_t *const *zbp =3D argb; >>+ zfs_handle_t *zb =3D *zbp; >> char mounta[MAXPATHLEN]; >> char mountb[MAXPATHLEN]; >>+ const char *a =3D mounta; >>+ const char *b =3D mountb; >> boolean_t gota, gotb; >>+ uint64_t zoneda, zonedb; >>=20 >>- if ((gota =3D (zfs_get_type(*za) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) >>- verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, >>+ zoneda =3D zfs_prop_get_int(za, ZFS_PROP_ZONED); >>+ zonedb =3D zfs_prop_get_int(zb, ZFS_PROP_ZONED); >>+ if (zoneda && !zonedb) >>+ return (1); >>+ if (!zoneda && zonedb) >>+ return (-1); >>+ gota =3D (zfs_get_type(za) =3D=3D ZFS_TYPE_FILESYSTEM); >>+ if (gota) >>+ verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, >> sizeof (mounta), NULL, NULL, 0, B_FALSE) =3D=3D 0); >>- if ((gotb =3D (zfs_get_type(*zb) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D 0) >>- verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, >>+ gotb =3D (zfs_get_type(zb) =3D=3D ZFS_TYPE_FILESYSTEM); >>+ if (gotb) >>+ verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, >> sizeof (mountb), NULL, NULL, 0, B_FALSE) =3D=3D 0); >>=20 >>- if (gota && gotb) >>- return (strcmp(mounta, mountb)); >>+ if (gota && gotb) { >>+ while (*a !=3D '\0' && (*a =3D=3D *b)) { >>+ a++; >>+ b++; >>+ } >>+ if (*a =3D=3D *b) >>+ return (0); >>+ if (*a =3D=3D '\0') >>+ return (-1); >>+ if (*b =3D=3D '\0') >>+ return (-1); >>+ if (*a =3D=3D '/') >>+ return (-1); >>+ if (*b =3D=3D '/') >>+ return (-1); >>+ return (*a < *b ? -1 : *a > *b); >>+ } >>=20 >> if (gota) >> return (-1); >> if (gotb) >> return (1); >>=20 >>- return (strcmp(zfs_get_name(a), zfs_get_name(b))); >>+ /* >>+ * If neither filesystem has a mountpoint, revert to sorting by >>+ * datset name=2E >>+ */ >>+ return (strcmp(zfs_get_name(za), zfs_get_name(zb))); >> } >>=20 >> /* >>+ * Reutrn true if path2 is a child of path1 >>+ */ >>+static boolean_t >>+libzfs_path_contains(const char *path1, const char *path2) >>+{ >>+ return (strstr(path2, path1) =3D=3D path2 && path2[strlen(path1)] =3D= =3D >>'/'); >>+} >>+ >>+ >>+static int >>+non_descendant_idx(zfs_handle_t **handles, size_t num_handles, int >>idx) >>+{ >>+ char parent[ZFS_MAXPROPLEN]; >>+ char child[ZFS_MAXPROPLEN]; >>+ int i; >>+ >>+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, >>+ sizeof (parent), NULL, NULL, 0, B_FALSE) =3D=3D 0); >>+ >>+ for (i =3D idx + 1; i < num_handles; i++) { >>+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, >>+ sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); >>+ if (!libzfs_path_contains(parent, child)) >>+ break; >>+ } >>+ return (i); >>+} >>+ >>+typedef struct mnt_param { >>+ libzfs_handle_t *mnt_hdl; >>+ tpool_t *mnt_tp; >>+ zfs_handle_t **mnt_zhps; /* filesystems to mount */ >>+ size_t mnt_num_handles; >>+ int mnt_idx; /* Index of selected entry to mount */ >>+ zfs_iter_f mnt_func; >>+ void *mnt_data; >>+} mnt_param_t; >>+ >>+/* >>+ * Allocate and populate the parameter struct for mount function, and >>+ * schedule mounting of the entry selected by idx=2E >>+ */ >>+static void >>+zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, >>+ size_t num_handles, int idx, zfs_iter_f func, void *data, tpool_t >>*tp) >>+{ >>+ mnt_param_t *mnt_param =3D zfs_alloc(hdl, sizeof (mnt_param_t)); >>+ >>+ mnt_param->mnt_hdl =3D hdl; >>+ mnt_param->mnt_tp =3D tp; >>+ mnt_param->mnt_zhps =3D handles; >>+ mnt_param->mnt_num_handles =3D num_handles; >>+ mnt_param->mnt_idx =3D idx; >>+ mnt_param->mnt_func =3D func; >>+ mnt_param->mnt_data =3D data; >>+ >>+ (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); >>+} >>+ >>+/* >>+ * This is the structure used to keep state of mounting or sharing >>operations >>+ * during a call to zpool_enable_datasets()=2E >>+ */ >>+typedef struct mount_state { >>+ /* >>+ * ms_mntstatus is set to -1 if any mount fails=2E While multiple >>threads >>+ * could update this variable concurrently, no synchronization is >>+ * needed as it's only ever set to -1=2E >>+ */ >>+ int ms_mntstatus; >>+ int ms_mntflags; >>+ const char *ms_mntopts; >>+} mount_state_t; >>+ >>+static int >>+zfs_mount_one(zfs_handle_t *zhp, void *arg) >>+{ >>+ mount_state_t *ms =3D arg; >>+ int ret =3D 0; >>+ >>+ if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) !=3D 0) >>+ ret =3D ms->ms_mntstatus =3D -1; >>+ return (ret); >>+} >>+ >>+static int >>+zfs_share_one(zfs_handle_t *zhp, void *arg) >>+{ >>+ mount_state_t *ms =3D arg; >>+ int ret =3D 0; >>+ >>+ if (zfs_share(zhp) !=3D 0) >>+ ret =3D ms->ms_mntstatus =3D -1; >>+ return (ret); >>+} >>+ >>+/* >>+ * Thread pool function to mount one file system=2E On completion, it >>finds and >>+ * schedules its children to be mounted=2E This depends on the sorting >>done in >>+ * zfs_foreach_mountpoint()=2E Note that the degenerate case (chain of >>entries >>+ * each descending from the previous) will have no parallelism since >>we always >>+ * have to wait for the parent to finish mounting before we can >>schedule >>+ * its children=2E >>+ */ >>+static void >>+zfs_mount_task(void *arg) >>+{ >>+ mnt_param_t *mp =3D arg; >>+ int idx =3D mp->mnt_idx; >>+ zfs_handle_t **handles =3D mp->mnt_zhps; >>+ size_t num_handles =3D mp->mnt_num_handles; >>+ char mountpoint[ZFS_MAXPROPLEN]; >>+ >>+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, mountpoint, >>+ sizeof (mountpoint), NULL, NULL, 0, B_FALSE) =3D=3D 0); >>+ >>+ if (mp->mnt_func(handles[idx], mp->mnt_data) !=3D 0) >>+ return; >>+ >>+ /* >>+ * We dispatch tasks to mount filesystems with mountpoints >underneath >>+ * this one=2E We do this by dispatching the next filesystem with a >>+ * descendant mountpoint of the one we just mounted, then skip all >of >>+ * its descendants, dispatch the next descendant mountpoint, and so >>on=2E >>+ * The non_descendant_idx() function skips over filesystems that are >>+ * descendants of the filesystem we just dispatched=2E >>+ */ >>+ for (int i =3D idx + 1; i < num_handles; >>+ i =3D non_descendant_idx(handles, num_handles, i)) { >>+ char child[ZFS_MAXPROPLEN]; >>+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, >>+ child, sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); >>+ >>+ if (!libzfs_path_contains(mountpoint, child)) >>+ break; /* not a descendant, return */ >>+ zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, >>+ mp->mnt_func, mp->mnt_data, mp->mnt_tp); >>+ } >>+ free(mp); >>+} >>+ >>+/* >>+ * Issue the func callback for each ZFS handle contained in the >>handles >>+ * array=2E This function is used to mount all datasets, and so this >>function >>+ * guarantees that filesystems for parent mountpoints are called >>before their >>+ * children=2E As such, before issuing any callbacks, we first sort the >>array >>+ * of handles by mountpoint=2E >>+ * >>+ * Callbacks are issued in one of two ways: >>+ * >>+ * 1=2E Sequentially: If the parallel argument is B_FALSE or the >>ZFS_SERIAL_MOUNT >>+ * environment variable is set, then we issue callbacks >>sequentially=2E >>+ * >>+ * 2=2E In parallel: If the parallel argument is B_TRUE and the >>ZFS_SERIAL_MOUNT >>+ * environment variable is not set, then we use a tpool to >dispatch >>threads >>+ * to mount filesystems in parallel=2E This function dispatches >tasks >>to mount >>+ * the filesystems at the top-level mountpoints, and these tasks >in >>turn >>+ * are responsible for recursively mounting filesystems in their >>children >>+ * mountpoints=2E >>+ */ >>+void >>+zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t **handles, >>+ size_t num_handles, zfs_iter_f func, void *data, boolean_t >>parallel) >>+{ >>+ zoneid_t zoneid =3D getzoneid(); >>+ >>+ /* >>+ * The ZFS_SERIAL_MOUNT environment variable is an undocumented >>+ * variable that can be used as a convenience to do a/b comparison >>+ * of serial vs=2E parallel mounting=2E >>+ */ >>+ boolean_t serial_mount =3D !parallel || >>+ (getenv("ZFS_SERIAL_MOUNT") !=3D NULL); >>+ >>+ /* >>+ * Sort the datasets by mountpoint=2E See mountpoint_cmp for details >>+ * of how these are sorted=2E >>+ */ >>+ qsort(handles, num_handles, sizeof (zfs_handle_t *), >mountpoint_cmp); >>+ >>+ if (serial_mount) { >>+ for (int i =3D 0; i < num_handles; i++) { >>+ func(handles[i], data); >>+ } >>+ return; >>+ } >>+ >>+ /* >>+ * Issue the callback function for each dataset using a parallel >>+ * algorithm that uses a thread pool to manage threads=2E >>+ */ >>+ tpool_t *tp =3D tpool_create(1, mount_tp_nthr, 0, NULL); >>+ >>+ /* >>+ * There may be multiple "top level" mountpoints outside of the >>pool's >>+ * root mountpoint, e=2Eg=2E: /foo /bar=2E Dispatch a mount task for e= ach >>of >>+ * these=2E >>+ */ >>+ for (int i =3D 0; i < num_handles; >>+ i =3D non_descendant_idx(handles, num_handles, i)) { >>+ /* >>+ * Since the mountpoints have been sorted so that the zoned >>+ * filesystems are at the end, a zoned filesystem seen from >>+ * the global zone means that we're done=2E >>+ */ >>+ if (zoneid =3D=3D GLOBAL_ZONEID && >>+ zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) >>+ break; >>+ zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, >>+ tp); >>+ } >>+ >>+ tpool_wait(tp); /* wait for all scheduled mounts to complete */ >>+ tpool_destroy(tp); >>+} >>+ >>+/* >>* Mount and share all datasets within the given pool=2E This assumes >>that no >>- * datasets within the pool are currently mounted=2E Because users can >>create >>- * complicated nested hierarchies of mountpoints, we first gather all >>the >>- * datasets and mountpoints within the pool, and sort them by >>mountpoint=2E Once >>- * we have the list of all filesystems, we iterate over them in order >>and mount >>- * and/or share each one=2E >>+ * datasets within the pool are currently mounted=2E >> */ >> #pragma weak zpool_mount_datasets =3D zpool_enable_datasets >> int >>zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int >>flags) >> { >> get_all_cb_t cb =3D { 0 }; >>- libzfs_handle_t *hdl =3D zhp->zpool_hdl; >>+ mount_state_t ms =3D { 0 }; >> zfs_handle_t *zfsp; >>- int i, ret =3D -1; >>- int *good; >>+ int ret =3D 0; >>=20 >>- /* >>- * Gather all non-snap datasets within the pool=2E >>- */ >>- if ((zfsp =3D zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) =3D=3D >>NULL) >>+ if ((zfsp =3D zfs_open(zhp->zpool_hdl, zhp->zpool_name, >>+ ZFS_TYPE_DATASET)) =3D=3D NULL) >> goto out; >>=20 >>- libzfs_add_handle(&cb, zfsp); >>- if (zfs_iter_filesystems(zfsp, mount_cb, &cb) !=3D 0) >>- goto out; >> /* >>- * Sort the datasets by mountpoint=2E >>+ * Gather all non-snapshot datasets within the pool=2E Start by adding >>+ * the root filesystem for this pool to the list, and then iterate >>+ * over all child filesystems=2E >> */ >>- qsort(cb=2Ecb_handles, cb=2Ecb_used, sizeof (void *), >>- libzfs_dataset_cmp); >>+ libzfs_add_handle(&cb, zfsp); >>+ if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) !=3D 0) >>+ goto out; >>=20 >> /* >>- * And mount all the datasets, keeping track of which ones >>- * succeeded or failed=2E >>+ * Mount all filesystems >> */ >>- if ((good =3D zfs_alloc(zhp->zpool_hdl, >>- cb=2Ecb_used * sizeof (int))) =3D=3D NULL) >>- goto out; >>+ ms=2Ems_mntopts =3D mntopts; >>+ ms=2Ems_mntflags =3D flags; >>+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb=2Ecb_handles, cb=2Ecb_used, >>+ zfs_mount_one, &ms, B_TRUE); >>+ if (ms=2Ems_mntstatus !=3D 0) >>+ ret =3D ms=2Ems_mntstatus; >>=20 >>- ret =3D 0; >>- for (i =3D 0; i < cb=2Ecb_used; i++) { >>- if (zfs_mount(cb=2Ecb_handles[i], mntopts, flags) !=3D 0) >>- ret =3D -1; >>- else >>- good[i] =3D 1; >>- } >>- >> /* >>- * Then share all the ones that need to be shared=2E This needs >>- * to be a separate pass in order to avoid excessive reloading >>- * of the configuration=2E Good should never be NULL since >>- * zfs_alloc is supposed to exit if memory isn't available=2E >>+ * Share all filesystems that need to be shared=2E This needs to be >>+ * a separate pass because libshare is not mt-safe, and so we need >>+ * to share serially=2E >> */ >>- for (i =3D 0; i < cb=2Ecb_used; i++) { >>- if (good[i] && zfs_share(cb=2Ecb_handles[i]) !=3D 0) >>- ret =3D -1; >>- } >>+ ms=2Ems_mntstatus =3D 0; >>+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb=2Ecb_handles, cb=2Ecb_used, >>+ zfs_share_one, &ms, B_FALSE); >>+ if (ms=2Ems_mntstatus !=3D 0) >>+ ret =3D ms=2Ems_mntstatus; >>=20 >>- free(good); >>- >> out: >>- for (i =3D 0; i < cb=2Ecb_used; i++) >>+ for (int i =3D 0; i < cb=2Ecb_used; i++) >> zfs_close(cb=2Ecb_handles[i]); >> free(cb=2Ecb_handles); >>=20 > >This broke my systems, many filesystems fail to mount causing nullfs >late mounts to fail=2E No details now until tonight=2E > >Suggest we back this out until it is properly tested=2E Nested zfs filesystems seem not to be handled properly or possibly not sup= ported any more=2E This explains my mail gateway also not mounting all file= systems in /home=2E It was odd that dovecot stopped working=2E The symptom of the problem is zfs mount -a no longer mounts all filesystem= s=2E Zfs mount fails saying the filesystem is already mounted=2E The workar= ound is to zfs umount each affected zfs dataset by hand and zfs mount it by= hand=2E Generally this has screwed up sites that have hundreds (in my case 122) zf= s datasets=2E The work around might be to script testing each mount, unmoun= ting and remounting if necessary=2E I'm being sarcastic about creating an rc script to clean this up=2E This n= eeds to be backed out and tested properly before being committed=2E=20 --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Tue Feb 26 16:16:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AACE151E0F9; Tue, 26 Feb 2019 16:16:39 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) (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 18A038C412; Tue, 26 Feb 2019 16:16:39 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi1-x241.google.com with SMTP id q81so10779713oic.5; Tue, 26 Feb 2019 08:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AqNU/WQAqoW2czpUMzHfrv1msMtJwHBUrjE/5rbhPbk=; b=Du9IGLbnoDcm0Lib3G+3GRU4ZUpK7gcYmCW3py+no4A0n/yT3b1P3C2yMgw4SuUeYy 0m1yoo9/I4UlTmXgm3UAf3jxLG3OsaPiWUlYwzb6sHinIEB8LwDY33pLCwf1j75vZSlc nLNQ7tW6P/sxT3uMmwFGQZCviFW8divbMyKiq58PGbn81o3kL1IM0rWKUkYpNOxvkCH5 BdT3c/Xen1QH8ddzCHLFZ2WGqP3IfAJ8Xct+6okvtM4vHsrYOUyvPXiw+XFzfjVgGmxo JSk81FqVGL5OXDMHDnvym2Qp7oGKfBtClhn4LPk+BGBPp8VjtKVDQXZcgWuHTIHYga+o Lztg== 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=AqNU/WQAqoW2czpUMzHfrv1msMtJwHBUrjE/5rbhPbk=; b=L43I1Fm2EczfnWbB/znt1E+GAoNdH+Mvd1K+g2l4NIXd6UJmwIRRc4wj6XG2F6jrWu oFv2mcB/jona8sKpr6KKFGwPKIEnjYdSrB0S7CbNairloVpn8DkLTuzyGigxRfD8HU/g z/BlSKXuAsiI3WSkg7uSMfO5x4lUhRSHMd2Fiu15xBjeZFBvC7MsWJkPkbeivhe2XqWy 40y79Qv+KbNcOpwFXer2LYbfATk8rx+zYFIiQnfBIpVe4fCiUMY6dgsA4+2TpmMg0X06 xGg9iLyb/i6fOFflGC1Jr77+bRuMz3pTxafIySbW4qXoJW94pU7N9OILSxBSLnDST2jN GWHg== X-Gm-Message-State: AHQUAubyJP3nXkvVrc3gR9SnSyPEgTk3Dltq9XG9EzUqr8rDJdXHzyeU AMLwQQi9JskxSCBmNYqkFjKtaIW9bFtRPO+Ox/c= X-Google-Smtp-Source: AHgI3IbRRUL4kz8+1sgnlmMpq/Shbhw4dstSPiClZiso93rN+lzlV5DWA9K85BPz34AHwEcS7Lxt2Tdo5u6hGMMJ1jc= X-Received: by 2002:aca:54c5:: with SMTP id i188mr2929583oib.16.1551197798356; Tue, 26 Feb 2019 08:16:38 -0800 (PST) MIME-Version: 1.0 References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> <1F5FB340-1CD2-400F-82D3-8D4949A351A2@cschubert.com> In-Reply-To: <1F5FB340-1CD2-400F-82D3-8D4949A351A2@cschubert.com> From: Benjamin Kaduk Date: Tue, 26 Feb 2019 10:16:27 -0600 Message-ID: Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Cy Schubert Cc: Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 18A038C412 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 16:16:39 -0000 On Tue, Feb 26, 2019 at 10:14 AM Cy Schubert wrote: > On February 26, 2019 7:48:27 AM PST, Cy Schubert < > Cy.Schubert@cschubert.com> wrote: > >On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > > wrote: > [trimming the unneeded pile of commit body] > >This broke my systems, many filesystems fail to mount causing nullfs > >late mounts to fail. No details now until tonight. > > > >Suggest we back this out until it is properly tested. > > Nested zfs filesystems seem not to be handled properly or possibly not > supported any more. This explains my mail gateway also not mounting all > filesystems in /home. It was odd that dovecot stopped working. > > The symptom of the problem is zfs mount -a no longer mounts all > filesystems. Zfs mount fails saying the filesystem is already mounted. The > workaround is to zfs umount each affected zfs dataset by hand and zfs mount > it by hand. > > Generally this has screwed up sites that have hundreds (in my case 122) > zfs datasets. The work around might be to script testing each mount, > unmounting and remounting if necessary. > > I'm being sarcastic about creating an rc script to clean this up. This > needs to be backed out and tested properly before being committed. > > I don't know what you mean by "nested zfs filesystems" -- do you mean a zpool within a zvol? That has been unsupported for a long time, IIRC. And I'm not sure what else "nested filesystems" would be, since having (e.g.) separate zfs filesystems for /usr and /usr/ports is so common that surely it has already been tested... -Ben From owner-svn-src-head@freebsd.org Tue Feb 26 16:27:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B35151E41A; Tue, 26 Feb 2019 16:27:43 +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 181148C9B1; Tue, 26 Feb 2019 16:27:42 +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 x1QGRetW046575; Tue, 26 Feb 2019 08:27:40 -0800 (PST) (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 x1QGRefq046574; Tue, 26 Feb 2019 08:27:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <20190226154535.q32nwf6xyupexkta@mutt-hbsd> To: Shawn Webb Date: Tue, 26 Feb 2019 08:27:40 -0800 (PST) CC: rgrimes@freebsd.org, "K. Macy" , svn-src-head@freebsd.org, Matt Macy , svn-src-all@freebsd.org, Brooks Davis , src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 181148C9B1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 16:27:43 -0000 > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > The modest increase in activation energy for that task seems worth it > > > > for the short-term gains of reduced integration cost (this code will > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > > license statements. The standard GPL v2.0 boiler plate should be added > > > > to this file along side the tag. > > > > > > I've copied the full copyright attribution that is in the > > > corresponding files on Linux. Is there some reason why FreeBSD > > > requires the files to be inflated with the full license text where the > > > original lacks it? > > > > I think for a few reasons, I doubt you copied the whole distribution > > that this file came from, as I am sure that distribution included > > a LICENSE file. Second if you actually read the GPL v2 documentation > > and follow what it says it says you must do this, just because some > > one else does not follow the rules of what the GPL v2 says does not > > give us to knowingling not do it. Third this is a particular dangerious > > area for BSD to be mixing a GPL code with its kernel, to my knowlege > > we have never had any gpl code in the kernel, no have we ever > > allowed it, but thats a seperate argument, that should be made. > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > > I, too, would like less GPL in project, both in userland in kernel. > But, I can understand the desire for gcov. Note that I'm not > advocating either way that FreeBSD perform an action. ;) Didnt we just remove an inbase, compiling BSD licensed chunk of code called DRM and move it to ports. So if that was possible this should be very rapidly applied here and this issue goes away. I am still shaking my head over this one. Yes, there is some expediance to this. Also could it not live on a project branch? Like.. um.. the ZoL project branch? > Thanks, > Shawn Webb -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 16:31:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64174151E6EA; Tue, 26 Feb 2019 16:31: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02C798CE44; Tue, 26 Feb 2019 16:31:48 +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 E87837C23; Tue, 26 Feb 2019 16:31: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 x1QGVlcF023028; Tue, 26 Feb 2019 16:31:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QGVlBB023027; Tue, 26 Feb 2019 16:31:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902261631.x1QGVlBB023027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Feb 2019 16:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344587 - in head/sys/cddl/contrib/opensolaris/uts: aarch64 arm mips riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts: aarch64 arm mips riscv X-SVN-Commit-Revision: 344587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02C798CE44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 16:31:48 -0000 Author: markj Date: Tue Feb 26 16:31:47 2019 New Revision: 344587 URL: https://svnweb.freebsd.org/changeset/base/344587 Log: Remove stub fasttrap implementations. No platforms except i386, amd64 and powerpc implement fasttrap; the fasttrap files for other arches do not contain any code and bloat the output from cscope, so just remove them. MFC after: 1 week Deleted: head/sys/cddl/contrib/opensolaris/uts/aarch64/ head/sys/cddl/contrib/opensolaris/uts/arm/ head/sys/cddl/contrib/opensolaris/uts/mips/ head/sys/cddl/contrib/opensolaris/uts/riscv/ From owner-svn-src-head@freebsd.org Tue Feb 26 16:34:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 635FB151E8AE; Tue, 26 Feb 2019 16:34:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06E088D124; Tue, 26 Feb 2019 16:34:44 +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 E536F7C4C; Tue, 26 Feb 2019 16:34: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 x1QGYhZT023930; Tue, 26 Feb 2019 16:34:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QGYhun023929; Tue, 26 Feb 2019 16:34:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902261634.x1QGYhun023929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Feb 2019 16:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344588 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 344588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06E088D124 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 16:34:44 -0000 Author: markj Date: Tue Feb 26 16:34:43 2019 New Revision: 344588 URL: https://svnweb.freebsd.org/changeset/base/344588 Log: Remove illumos-specific code from the x86 fasttrap_isa.c. The file has not been touched upstream in over a decade, and the nature of the code means that a lot of FreeBSD-specific bits are required. Remove the dead code to improve readability. No functional change intended. Discussed with: cem MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Feb 26 16:31:47 2019 (r344587) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Feb 26 16:34:43 2019 (r344588) @@ -28,21 +28,11 @@ * Use is subject to license terms. */ -#ifdef illumos -#pragma ident "%Z%%M% %I% %E% SMI" -#endif - #include #include #include #include #include -#ifdef illumos -#include -#include -#include -#include -#else #include #include #include @@ -53,14 +43,8 @@ #include #include #include -#endif #include -#ifdef illumos -#include -#include -#else #include -#endif /* illumos */ #ifdef __i386__ #define r_rax r_eax @@ -707,16 +691,9 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p fasttrap_tracepoint_t *tp; fasttrap_bucket_t *bucket; fasttrap_id_t *id; -#ifdef illumos - kmutex_t *pid_mtx; - - pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; - mutex_enter(pid_mtx); -#else struct rm_priotracker tracker; rm_rlock(&fasttrap_tp_lock, &tracker); -#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { @@ -731,11 +708,7 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p * is not essential to the correct execution of the process. */ if (tp == NULL) { -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif return; } @@ -756,30 +729,12 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p rp->r_rax, rp->r_rbx, 0, 0); } -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif } static void fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) { -#ifdef illumos - sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); - - sqp->sq_info.si_signo = SIGSEGV; - sqp->sq_info.si_code = SEGV_MAPERR; - sqp->sq_info.si_addr = (caddr_t)addr; - - mutex_enter(&p->p_lock); - sigaddqa(p, t, sqp); - mutex_exit(&p->p_lock); - - if (t != NULL) - aston(t); -#else ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); ksiginfo_init(ksi); @@ -787,7 +742,6 @@ fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t ad ksi->ksi_code = SEGV_MAPERR; ksi->ksi_addr = (caddr_t)addr; (void) tdksignal(t, SIGSEGV, ksi); -#endif } #ifdef __amd64 @@ -971,9 +925,6 @@ fasttrap_pid_probe(struct trapframe *tf) uintptr_t pc; uintptr_t new_pc = 0; fasttrap_bucket_t *bucket; -#ifdef illumos - kmutex_t *pid_mtx; -#endif fasttrap_tracepoint_t *tp, tp_local; pid_t pid; dtrace_icookie_t cookie; @@ -1013,15 +964,6 @@ fasttrap_pid_probe(struct trapframe *tf) * parent. We know that there's only one thread of control in such a * process: this one. */ -#ifdef illumos - while (p->p_flag & SVFORK) { - p = p->p_parent; - } - - pid = p->p_pid; - pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; - mutex_enter(pid_mtx); -#else pp = p; sx_slock(&proctree_lock); while (pp->p_vmspace == pp->p_pptr->p_vmspace) @@ -1045,7 +987,6 @@ fasttrap_pid_probe(struct trapframe *tf) sx_sunlock(&proctree_lock); rm_rlock(&fasttrap_tp_lock, &tracker); -#endif bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; @@ -1064,10 +1005,6 @@ fasttrap_pid_probe(struct trapframe *tf) * fasttrap_ioctl), or somehow we have mislaid this tracepoint. */ if (tp == NULL) { -#ifdef illumos - mutex_exit(pid_mtx); - return (-1); -#else rm_runlock(&fasttrap_tp_lock, &tracker); gen = atomic_load_acq_64(&pp->p_fasttrap_tp_gen); if (pp != p) @@ -1088,7 +1025,6 @@ fasttrap_pid_probe(struct trapframe *tf) return (0); } return (-1); -#endif } if (pp != p) PRELE(pp); @@ -1210,11 +1146,7 @@ fasttrap_pid_probe(struct trapframe *tf) * tracepoint again later if we need to light up any return probes. */ tp_local = *tp; -#ifdef illumos - mutex_exit(pid_mtx); -#else rm_runlock(&fasttrap_tp_lock, &tracker); -#endif tp = &tp_local; /* @@ -1534,28 +1466,6 @@ fasttrap_pid_probe(struct trapframe *tf) uint8_t scratch[2 * FASTTRAP_MAX_INSTR_SIZE + 7]; #endif uint_t i = 0; -#ifdef illumos - klwp_t *lwp = ttolwp(curthread); - - /* - * Compute the address of the ulwp_t and step over the - * ul_self pointer. The method used to store the user-land - * thread pointer is very different on 32- and 64-bit - * kernels. - */ -#if defined(__amd64) - if (p->p_model == DATAMODEL_LP64) { - addr = lwp->lwp_pcb.pcb_fsbase; - addr += sizeof (void *); - } else { - addr = lwp->lwp_pcb.pcb_gsbase; - addr += sizeof (caddr32_t); - } -#else - addr = USD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); - addr += sizeof (void *); -#endif -#else /* !illumos */ fasttrap_scrspace_t *scrspace; scrspace = fasttrap_scraddr(curthread, tp->ftt_proc); if (scrspace == NULL) { @@ -1571,7 +1481,6 @@ fasttrap_pid_probe(struct trapframe *tf) break; } addr = scrspace->ftss_addr; -#endif /* illumos */ /* * Generic Instruction Tracing @@ -1813,11 +1722,9 @@ done: rp->r_rip = new_pc; -#ifndef illumos PROC_LOCK(p); proc_write_regs(curthread, rp); PROC_UNLOCK(p); -#endif return (0); } From owner-svn-src-head@freebsd.org Tue Feb 26 16:36:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57B61151E994; Tue, 26 Feb 2019 16:36:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 61AF68D2BC; Tue, 26 Feb 2019 16:36:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yficg4LI6eOi3yfidgNNaF; Tue, 26 Feb 2019 09:36:36 -0700 X-Authority-Analysis: v=2.3 cv=SKA8q9nH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=CFTnQlWoA9kA:10 a=6I5d2MoRAAAA:8 a=DsloTXpuAAAA:20 a=FNC4LJVLAAAA:20 a=CgiagczvAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=TJd5cRXsDmjO22ILt5MA:9 a=c9zDAnqu8u60ELJi:21 a=VJ2NgumJM9_WnDLf:21 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=ZydqF0V2MF2Cvey6h_li:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id D532E377; Tue, 26 Feb 2019 08:36:33 -0800 (PST) Date: Tue, 26 Feb 2019 08:36:10 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <20190226161131.6rb3slb5slhkomwz@ivaldir.net> References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> <20190226160411.kutpzjltiqm4bfgb@ivaldir.net> <20190226161131.6rb3slb5slhkomwz@ivaldir.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Baptiste Daroussin CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fatih@gandi.net From: Cy Schubert Message-ID: <44EBCB1E-4872-429A-A967-FA24CC299A5D@cschubert.com> X-CMAE-Envelope: MS4wfIFOHhn1d1+Ra3ttyLni0eRSY64ywywMwdQub6/4Qne1ozYOnnefrb45YwmXz8UE5xSKsRuKPR+M35uhfdC6iTuxvV+eI7jWe5ti8OnXGKL3jtWWVvDh xDKnVezHWx+vtybCk0rA6Mb0yehoUXbDDDLWG5GRM7neHg/tQznqSotuBT4q149sQ/pvyq4omY90bMeMMNkhF/hrG4e5gFzd3nQmrcytGltwWBuzISiRXngN PDJRQzB8UTrKbk7NJGlghbZhBbvdhcITimEtsi3nq1goP1ScXmKX/6Yr1+/vj3xxJeohbloXFEzl/DLBuAejsLoPc6DP52q8YHLiGWZ2rD8= X-Rspamd-Queue-Id: 61AF68D2BC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 16:36:38 -0000 On February 26, 2019 8:11:31 AM PST, Baptiste Daroussin wrote: >On Tue, Feb 26, 2019 at 05:04:11PM +0100, Baptiste Daroussin wrote: >> On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: >> > On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > wrote: >> > >Author: bapt >> > >Date: Tue Feb 26 08:18:34 2019 >> > >New Revision: 344569 >> > >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/344569 >> > > >> > >Log: >> > > Implement parallel mounting for ZFS filesystem >> > > =20 >> > > It was first implemented on Illumos and then ported to ZoL=2E >> > > This patch is a port to FreeBSD of the ZoL version=2E >> > > This patch also includes a fix for a race condition that was >amended >> > > =20 >> > >With such patch Delphix has seen a huge decrease in latency of the >> > >mount phase >> > > (https://github=2Ecom/openzfs/openzfs/commit/a3f0e2b569 for >details)=2E >> > >With that current change Gandi has measured improvments that are >on par >> > >with >> > > those reported by Delphix=2E >> > > =20 >> > > Zol commits incorporated: >> > >>https://github=2Ecom/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825= c70c9c9e303 >> > >>https://github=2Ecom/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d40= 77567dfea21 >> > > =20 >> > > Reviewed by: avg, sef >> > > Approved by: avg, sef >> > > Obtained from: ZoL >> > > MFC after: 1 month >> > > Relnotes: yes >> > > Sponsored by: Gandi=2Enet >> > > Differential Revision: https://reviews=2Efreebsd=2Eorg/D19098 >> > > >> > >Modified: >> > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec >> > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh >> > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec >> > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh >> > > head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec >> > > >> > >Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec >> > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec Tue Feb 26 >> > >06:22:10 2019 (r344568) >> > >+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main=2Ec Tue Feb 26 >> > >08:18:34 2019 (r344569) >> > >@@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) >> > >=20 >> > > #define CHECK_SPINNER 30 >> > > #define SPINNER_TIME 3 /* seconds */ >> > >-#define MOUNT_TIME 5 /* seconds */ >> > >+#define MOUNT_TIME 1 /* seconds */ >> > >=20 >> > >+typedef struct get_all_state { >> > >+ boolean_t ga_verbose; >> > >+ get_all_cb_t *ga_cbp; >> > >+} get_all_state_t; >> > >+ >> > > static int >> > > get_one_dataset(zfs_handle_t *zhp, void *data) >> > > { >> > >@@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void >*data) >> > > static int spinval =3D 0; >> > > static int spincheck =3D 0; >> > > static time_t last_spin_time =3D (time_t)0; >> > >- get_all_cb_t *cbp =3D data; >> > >+ get_all_state_t *state =3D data; >> > > zfs_type_t type =3D zfs_get_type(zhp); >> > >=20 >> > >- if (cbp->cb_verbose) { >> > >+ if (state->ga_verbose) { >> > > if (--spincheck < 0) { >> > > time_t now =3D time(NULL); >> > > if (last_spin_time + SPINNER_TIME < now) { >> > >@@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void >*data) >> > > zfs_close(zhp); >> > > return (0); >> > > } >> > >- libzfs_add_handle(cbp, zhp); >> > >- assert(cbp->cb_used <=3D cbp->cb_alloc); >> > >+ libzfs_add_handle(state->ga_cbp, zhp); >> > >+ assert(state->ga_cbp->cb_used <=3D state->ga_cbp->cb_alloc); >> > >=20 >> > > return (0); >> > > } >> > >=20 >> > > static void >> > >-get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t >> > >verbose) >> > >+get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) >> > > { >> > >- get_all_cb_t cb =3D { 0 }; >> > >- cb=2Ecb_verbose =3D verbose; >> > >- cb=2Ecb_getone =3D get_one_dataset; >> > >+ get_all_state_t state =3D { >> > >+ =2Ega_verbose =3D verbose, >> > >+ =2Ega_cbp =3D cbp >> > >+ }; >> > >=20 >> > > if (verbose) >> > > set_progress_header(gettext("Reading ZFS config")); >> > >- (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); >> > >+ (void) zfs_iter_root(g_zfs, get_one_dataset, &state); >> > >=20 >> > >- *dslist =3D cb=2Ecb_handles; >> > >- *count =3D cb=2Ecb_used; >> > >- >> > > if (verbose) >> > > finish_progress(gettext("done=2E")); >> > > } >> > >@@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, >size_t >> > >*count >> > >* similar, we have a common function with an extra parameter to >> > >determine which >> > > * mode we are using=2E >> > > */ >> > >-#define OP_SHARE 0x1 >> > >-#define OP_MOUNT 0x2 >> > >+typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; >> > >=20 >> > >+typedef struct share_mount_state { >> > >+ share_mount_op_t sm_op; >> > >+ boolean_t sm_verbose; >> > >+ int sm_flags; >> > >+ char *sm_options; >> > >+ char *sm_proto; /* only valid for OP_SHARE */ >> > >+ pthread_mutex_t sm_lock; /* protects the remaining fields */ >> > >+ uint_t sm_total; /* number of filesystems to process */ >> > >+ uint_t sm_done; /* number of filesystems processed */ >> > >+ int sm_status; /* -1 if any of the share/mount operations failed >*/ >> > >+} share_mount_state_t; >> > >+ >> > > /* >> > > * Share or mount a dataset=2E >> > > */ >> > >@@ -6122,6 +6136,29 @@ report_mount_progress(int current, int >total) >> > > update_progress(info); >> > > } >> > >=20 >> > >+/* >> > >+ * zfs_foreach_mountpoint() callback that mounts or shares on >> > >filesystem and >> > >+ * updates the progress meter >> > >+ */ >> > >+static int >> > >+share_mount_one_cb(zfs_handle_t *zhp, void *arg) >> > >+{ >> > >+ share_mount_state_t *sms =3D arg; >> > >+ int ret; >> > >+ >> > >+ ret =3D share_mount_one(zhp, sms->sm_op, sms->sm_flags, >sms->sm_proto, >> > >+ B_FALSE, sms->sm_options); >> > >+ >> > >+ pthread_mutex_lock(&sms->sm_lock); >> > >+ if (ret !=3D 0) >> > >+ sms->sm_status =3D ret; >> > >+ sms->sm_done++; >> > >+ if (sms->sm_verbose) >> > >+ report_mount_progress(sms->sm_done, sms->sm_total); >> > >+ pthread_mutex_unlock(&sms->sm_lock); >> > >+ return (ret); >> > >+} >> > >+ >> > > static void >> > > append_options(char *mntopts, char *newopts) >> > > { >> > >@@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) >> > >=20 >> > > /* check number of arguments */ >> > > if (do_all) { >> > >- zfs_handle_t **dslist =3D NULL; >> > >- size_t i, count =3D 0; >> > > char *protocol =3D NULL; >> > >=20 >> > > if (op =3D=3D OP_SHARE && argc > 0) { >> > >@@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) >> > > } >> > >=20 >> > > start_progress_timer(); >> > >- get_all_datasets(&dslist, &count, verbose); >> > >+ get_all_cb_t cb =3D { 0 }; >> > >+ get_all_datasets(&cb, verbose); >> > >=20 >> > >- if (count =3D=3D 0) >> > >+ if (cb=2Ecb_used =3D=3D 0) { >> > >+ if (options !=3D NULL) >> > >+ free(options); >> > > return (0); >> > >+ } >> > >=20 >> > >- qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); >> > > #ifdef illumos >> > >- sa_init_selective_arg_t sharearg; >> > >- sharearg=2Ezhandle_arr =3D dslist; >> > >- sharearg=2Ezhandle_len =3D count; >> > >- if ((ret =3D zfs_init_libshare_arg(zfs_get_handle(dslist[0]), >> > >- SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { >> > >- (void) fprintf(stderr, >> > >- gettext("Could not initialize libshare, %d"), ret); >> > >- return (ret); >> > >+ if (op =3D=3D OP_SHARE) { >> > >+ sa_init_selective_arg_t sharearg; >> > >+ sharearg=2Ezhandle_arr =3D cb=2Ecb_handles; >> > >+ sharearg=2Ezhandle_len =3D cb=2Ecb_used; >> > >+ if ((ret =3D zfs_init_libshare_arg(g_zfs, >> > >+ SA_INIT_SHARE_API_SELECTIVE, &sharearg)) !=3D SA_OK) { >> > >+ (void) fprintf(stderr, gettext( >> > >+ "Could not initialize libshare, %d"), ret); >> > >+ return (ret); >> > >+ } >> > > } >> > > #endif >> > >+ share_mount_state_t share_mount_state =3D { 0 }; >> > >+ share_mount_state=2Esm_op =3D op; >> > >+ share_mount_state=2Esm_verbose =3D verbose; >> > >+ share_mount_state=2Esm_flags =3D flags; >> > >+ share_mount_state=2Esm_options =3D options; >> > >+ share_mount_state=2Esm_proto =3D protocol; >> > >+ share_mount_state=2Esm_total =3D cb=2Ecb_used; >> > >+ pthread_mutex_init(&share_mount_state=2Esm_lock, NULL); >> > >=20 >> > >- for (i =3D 0; i < count; i++) { >> > >- if (verbose) >> > >- report_mount_progress(i, count); >> > >+ /* >> > >+ * libshare isn't mt-safe, so only do the operation in parallel >> > >+ * if we're mounting=2E >> > >+ */ >> > >+ zfs_foreach_mountpoint(g_zfs, cb=2Ecb_handles, cb=2Ecb_used, >> > >+ share_mount_one_cb, &share_mount_state, op =3D=3D OP_MOUNT); >> > >+ ret =3D share_mount_state=2Esm_status; >> > >=20 >> > >- if (share_mount_one(dslist[i], op, flags, protocol, >> > >- B_FALSE, options) !=3D 0) >> > >- ret =3D 1; >> > >- zfs_close(dslist[i]); >> > >- } >> > >- >> > >- free(dslist); >> > >+ for (int i =3D 0; i < cb=2Ecb_used; i++) >> > >+ zfs_close(cb=2Ecb_handles[i]); >> > >+ free(cb=2Ecb_handles); >> > > } else if (argc =3D=3D 0) { >> > > struct mnttab entry; >> > >=20 >> > > >> > >Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh >> > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh Tue >Feb 26 >> > >06:22:10 2019 (r344568) >> > >+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs=2Eh Tue >Feb 26 >> > >08:18:34 2019 (r344569) >> > >@@ -579,12 +579,12 @@ typedef struct get_all_cb { >> > > zfs_handle_t **cb_handles; >> > > size_t cb_alloc; >> > > size_t cb_used; >> > >- boolean_t cb_verbose; >> > >- int (*cb_getone)(zfs_handle_t *, void *); >> > > } get_all_cb_t; >> > >=20 >> > >+void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, >> > >size_t, >> > >+ zfs_iter_f, void*, boolean_t); >> > >+ >> > > void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); >> > >-int libzfs_dataset_cmp(const void *, const void *); >> > >=20 >> > > /* >> > > * Functions to create and destroy datasets=2E >> > > >> > >Modified: >> > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec >> > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec Tue >> > >Feb 26 06:22:10 2019 (r344568) >> > >+++ >> > >>head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset=2Ec Tue >> > >Feb 26 08:18:34 2019 (r344569) >> > >@@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, >const >> > >vo >> > > void >> > > libzfs_mnttab_init(libzfs_handle_t *hdl) >> > > { >> > >+ pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); >> > > assert(avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0); >> > > avl_create(&hdl->libzfs_mnttab_cache, >libzfs_mnttab_cache_compare, >> > > sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); >> > >@@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) >> > > free(mtn); >> > > } >> > > avl_destroy(&hdl->libzfs_mnttab_cache); >> > >+ (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); >> > > } >> > >=20 >> > > void >> > >@@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >char >> > >*f >> > > { >> > > mnttab_node_t find; >> > > mnttab_node_t *mtn; >> > >+ int ret =3D ENOENT; >> > >=20 >> > > if (!hdl->libzfs_mnttab_enable) { >> > > struct mnttab srch =3D { 0 }; >> > >@@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >char >> > >*f >> > > return (ENOENT); >> > > } >> > >=20 >> > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >> > > if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) >> > > libzfs_mnttab_update(hdl); >> > >=20 >> > >@@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, >const >> > >char *f >> > > mtn =3D avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); >> > > if (mtn) { >> > > *entry =3D mtn->mtn_mt; >> > >- return (0); >> > >+ ret =3D 0; >> > > } >> > >- return (ENOENT); >> > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >> > >+ return (ret); >> > > } >> > >=20 >> > > void >> > >@@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, >const >> > >char *sp >> > > { >> > > mnttab_node_t *mtn; >> > >=20 >> > >- if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) >> > >- return; >> > >- mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); >> > >- mtn->mtn_mt=2Emnt_special =3D zfs_strdup(hdl, special); >> > >- mtn->mtn_mt=2Emnt_mountp =3D zfs_strdup(hdl, mountp); >> > >- mtn->mtn_mt=2Emnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); >> > >- mtn->mtn_mt=2Emnt_mntopts =3D zfs_strdup(hdl, mntopts); >> > >- avl_add(&hdl->libzfs_mnttab_cache, mtn); >> > >-} >> > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >> > >+ if (avl_numnodes(&hdl->libzfs_mnttab_cache) =3D=3D 0) { >> > >+ mtn =3D zfs_alloc(hdl, sizeof (mnttab_node_t)); >> > >+ mtn->mtn_mt=2Emnt_special =3D zfs_strdup(hdl, special); >> > >+ mtn->mtn_mt=2Emnt_mountp =3D zfs_strdup(hdl, mountp); >> > >+ mtn->mtn_mt=2Emnt_fstype =3D zfs_strdup(hdl, MNTTYPE_ZFS); >> > >+ mtn->mtn_mt=2Emnt_mntopts =3D zfs_strdup(hdl, mntopts); >> > >+ avl_add(&hdl->libzfs_mnttab_cache, mtn); >> > >+ } >> > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >> > >+} =09 >> > >=20 >> > > void >> > > libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) >> > >@@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, >const >> > >char=20 >> > > mnttab_node_t find; >> > > mnttab_node_t *ret; >> > >=20 >> > >+ pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >> > > find=2Emtn_mt=2Emnt_special =3D (char *)fsname; >> > > if ((ret =3D avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, >NULL)) >> > > !=3D NULL) { >> > >@@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, >const >> > >char=20 >> > > free(ret->mtn_mt=2Emnt_mntopts); >> > > free(ret); >> > > } >> > >+ pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >> > > } >> > >=20 >> > > int >> > > >> > >Modified: >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh >> > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh Tue >> > >Feb 26 06:22:10 2019 (r344568) >> > >+++ >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl=2Eh Tue >> > >Feb 26 08:18:34 2019 (r344569) >> > >@@ -22,7 +22,7 @@ >> > > /* >> > >* Copyright (c) 2005, 2010, Oracle and/or its affiliates=2E All >rights >> > >reserved=2E >> > > * Copyright (c) 2011 Pawel Jakub Dawidek=2E All rights reserved=2E >> > >- * Copyright (c) 2011, 2016 by Delphix=2E All rights reserved=2E >> > >+ * Copyright (c) 2011, 2017 by Delphix=2E All rights reserved=2E >> > >* Copyright (c) 2013 Martin Matuska =2E All rights >> > >reserved=2E >> > > */ >> > >=20 >> > >@@ -73,6 +73,13 @@ struct libzfs_handle { >> > > int libzfs_storeerr; /* stuff error messages into buffer */ >> > > void *libzfs_sharehdl; /* libshare handle */ >> > > boolean_t libzfs_mnttab_enable; >> > >+ /* >> > >+ * We need a lock to handle the case where parallel mount >> > >+ * threads are populating the mnttab cache simultaneously=2E The >> > >+ * lock only protects the integrity of the avl tree, and does >> > >+ * not protect the contents of the mnttab entries themselves=2E >> > >+ */ >> > >+ pthread_mutex_t libzfs_mnttab_cache_lock; >> > > avl_tree_t libzfs_mnttab_cache; >> > > int libzfs_pool_iter; >> > > libzfs_fru_t **libzfs_fru_hash; >> > > >> > >Modified: >> > >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec >> > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec Tue >> > >Feb 26 06:22:10 2019 (r344568) >> > >+++ >head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount=2Ec Tue >> > >Feb 26 08:18:34 2019 (r344569) >> > >@@ -26,6 +26,7 @@ >> > > * Copyright 2016 Igor Kozhukhov >> > > * Copyright 2017 Joyent, Inc=2E >> > > * Copyright 2017 RackTop Systems=2E >> > >+ * Copyright 2018 OmniOS Community Edition (OmniOSce) >Association=2E >> > > */ >> > >=20 >> > > /* >> > >@@ -34,25 +35,25 @@ >> > > * they are used by mount and unmount and when changing a >filesystem's >> > > * mountpoint=2E >> > > * >> > >- * zfs_is_mounted() >> > >- * zfs_mount() >> > >- * zfs_unmount() >> > >- * zfs_unmountall() >> > >+ * zfs_is_mounted() >> > >+ * zfs_mount() >> > >+ * zfs_unmount() >> > >+ * zfs_unmountall() >> > > * >> > >* This file also contains the functions used to manage sharing >> > >filesystems via >> > > * NFS and iSCSI: >> > > * >> > >- * zfs_is_shared() >> > >- * zfs_share() >> > >- * zfs_unshare() >> > >+ * zfs_is_shared() >> > >+ * zfs_share() >> > >+ * zfs_unshare() >> > > * >> > >- * zfs_is_shared_nfs() >> > >- * zfs_is_shared_smb() >> > >- * zfs_share_proto() >> > >- * zfs_shareall(); >> > >- * zfs_unshare_nfs() >> > >- * zfs_unshare_smb() >> > >- * zfs_unshareall_nfs() >> > >+ * zfs_is_shared_nfs() >> > >+ * zfs_is_shared_smb() >> > >+ * zfs_share_proto() >> > >+ * zfs_shareall(); >> > >+ * zfs_unshare_nfs() >> > >+ * zfs_unshare_smb() >> > >+ * zfs_unshareall_nfs() >> > > * zfs_unshareall_smb() >> > > * zfs_unshareall() >> > > * zfs_unshareall_bypath() >> > >@@ -60,8 +61,8 @@ >> > > * The following functions are available for pool consumers, and >will >> > > * mount/unmount and share/unshare all datasets within pool: >> > > * >> > >- * zpool_enable_datasets() >> > >- * zpool_disable_datasets() >> > >+ * zpool_enable_datasets() >> > >+ * zpool_disable_datasets() >> > > */ >> > >=20 >> > > #include >> > >@@ -83,10 +84,14 @@ >> > > #include >> > >=20 >> > > #include "libzfs_impl=2Eh" >> > >+#include >> > >=20 >> > > #include >> > > #define MAXISALEN 257 /* based on sysinfo(2) man page */ >> > >=20 >> > >+static int mount_tp_nthr =3D 512; /* tpool threads for >multi-threaded >> > >mounting */ >> > >+ >> > >+static void zfs_mount_task(void *); >> > > static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); >> > > zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, >> > > zfs_share_proto_t); >> > >@@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) >> > > } >> > > } >> > >=20 >> > >+/* >> > >+ * Add the given zfs handle to the cb_handles array, dynamically >> > >reallocating >> > >+ * the array if it is out of space >> > >+ */ >> > > void >> > > libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) >> > > { >> > > if (cbp->cb_alloc =3D=3D cbp->cb_used) { >> > > size_t newsz; >> > >- void *ptr; >> > >+ zfs_handle_t **newhandles; >> > >=20 >> > >- newsz =3D cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; >> > >- ptr =3D zfs_realloc(zhp->zfs_hdl, >> > >- cbp->cb_handles, cbp->cb_alloc * sizeof (void *), >> > >- newsz * sizeof (void *)); >> > >- cbp->cb_handles =3D ptr; >> > >+ newsz =3D cbp->cb_alloc !=3D 0 ? cbp->cb_alloc * 2 : 64; >> > >+ newhandles =3D zfs_realloc(zhp->zfs_hdl, >> > >+ cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), >> > >+ newsz * sizeof (zfs_handle_t *)); >> > >+ cbp->cb_handles =3D newhandles; >> > > cbp->cb_alloc =3D newsz; >> > > } >> > > cbp->cb_handles[cbp->cb_used++] =3D zhp; >> > > } >> > >=20 >> > >+/* >> > >+ * Recursive helper function used during file system enumeration >> > >+ */ >> > > static int >> > >-mount_cb(zfs_handle_t *zhp, void *data) >> > >+zfs_iter_cb(zfs_handle_t *zhp, void *data) >> > > { >> > > get_all_cb_t *cbp =3D data; >> > >=20 >> > >@@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) >> > > } >> > >=20 >> > > libzfs_add_handle(cbp, zhp); >> > >- if (zfs_iter_filesystems(zhp, mount_cb, cbp) !=3D 0) { >> > >+ if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) !=3D 0) { >> > > zfs_close(zhp); >> > > return (-1); >> > > } >> > > return (0); >> > > } >> > >=20 >> > >-int >> > >-libzfs_dataset_cmp(const void *a, const void *b) >> > >+/* >> > >+ * Sort comparator that compares two mountpoint paths=2E We sort >these >> > >paths so >> > >+ * that subdirectories immediately follow their parents=2E This >means >> > >that we >> > >+ * effectively treat the '/' character as the lowest value >non-nul >> > >char=2E >> > >+ * Since filesystems from non-global zones can have the same >> > >mountpoint >> > >+ * as other filesystems, the comparator sorts global zone >filesystems >> > >to >> > >+ * the top of the list=2E This means that the global zone will >traverse >> > >the >> > >+ * filesystem list in the correct order and can stop when it sees >the >> > >+ * first zoned filesystem=2E In a non-global zone, only the >delegated >> > >+ * filesystems are seen=2E >> > >+ * >> > >+ * An example sorted list using this comparator would look like: >> > >+ * >> > >+ * /foo >> > >+ * /foo/bar >> > >+ * /foo/bar/baz >> > >+ * /foo/baz >> > >+ * /foo=2Ebar >> > >+ * /foo (NGZ1) >> > >+ * /foo (NGZ2) >> > >+ * >> > >+ * The mount code depend on this ordering to deterministically >iterate >> > >+ * over filesystems in order to spawn parallel mount tasks=2E >> > >+ */ >> > >+static int >> > >+mountpoint_cmp(const void *arga, const void *argb) >> > > { >> > >- zfs_handle_t **za =3D (zfs_handle_t **)a; >> > >- zfs_handle_t **zb =3D (zfs_handle_t **)b; >> > >+ zfs_handle_t *const *zap =3D arga; >> > >+ zfs_handle_t *za =3D *zap; >> > >+ zfs_handle_t *const *zbp =3D argb; >> > >+ zfs_handle_t *zb =3D *zbp; >> > > char mounta[MAXPATHLEN]; >> > > char mountb[MAXPATHLEN]; >> > >+ const char *a =3D mounta; >> > >+ const char *b =3D mountb; >> > > boolean_t gota, gotb; >> > >+ uint64_t zoneda, zonedb; >> > >=20 >> > >- if ((gota =3D (zfs_get_type(*za) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D= 0) >> > >- verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, >> > >+ zoneda =3D zfs_prop_get_int(za, ZFS_PROP_ZONED); >> > >+ zonedb =3D zfs_prop_get_int(zb, ZFS_PROP_ZONED); >> > >+ if (zoneda && !zonedb) >> > >+ return (1); >> > >+ if (!zoneda && zonedb) >> > >+ return (-1); >> > >+ gota =3D (zfs_get_type(za) =3D=3D ZFS_TYPE_FILESYSTEM); >> > >+ if (gota) >> > >+ verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, >> > > sizeof (mounta), NULL, NULL, 0, B_FALSE) =3D=3D 0); >> > >- if ((gotb =3D (zfs_get_type(*zb) =3D=3D ZFS_TYPE_FILESYSTEM)) !=3D= 0) >> > >- verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, >> > >+ gotb =3D (zfs_get_type(zb) =3D=3D ZFS_TYPE_FILESYSTEM); >> > >+ if (gotb) >> > >+ verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, >> > > sizeof (mountb), NULL, NULL, 0, B_FALSE) =3D=3D 0); >> > >=20 >> > >- if (gota && gotb) >> > >- return (strcmp(mounta, mountb)); >> > >+ if (gota && gotb) { >> > >+ while (*a !=3D '\0' && (*a =3D=3D *b)) { >> > >+ a++; >> > >+ b++; >> > >+ } >> > >+ if (*a =3D=3D *b) >> > >+ return (0); >> > >+ if (*a =3D=3D '\0') >> > >+ return (-1); >> > >+ if (*b =3D=3D '\0') >> > >+ return (-1); >> > >+ if (*a =3D=3D '/') >> > >+ return (-1); >> > >+ if (*b =3D=3D '/') >> > >+ return (-1); >> > >+ return (*a < *b ? -1 : *a > *b); >> > >+ } >> > >=20 >> > > if (gota) >> > > return (-1); >> > > if (gotb) >> > > return (1); >> > >=20 >> > >- return (strcmp(zfs_get_name(a), zfs_get_name(b))); >> > >+ /* >> > >+ * If neither filesystem has a mountpoint, revert to sorting by >> > >+ * datset name=2E >> > >+ */ >> > >+ return (strcmp(zfs_get_name(za), zfs_get_name(zb))); >> > > } >> > >=20 >> > > /* >> > >+ * Reutrn true if path2 is a child of path1 >> > >+ */ >> > >+static boolean_t >> > >+libzfs_path_contains(const char *path1, const char *path2) >> > >+{ >> > >+ return (strstr(path2, path1) =3D=3D path2 && path2[strlen(path1)] = =3D=3D >> > >'/'); >> > >+} >> > >+ >> > >+ >> > >+static int >> > >+non_descendant_idx(zfs_handle_t **handles, size_t num_handles, >int >> > >idx) >> > >+{ >> > >+ char parent[ZFS_MAXPROPLEN]; >> > >+ char child[ZFS_MAXPROPLEN]; >> > >+ int i; >> > >+ >> > >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, >> > >+ sizeof (parent), NULL, NULL, 0, B_FALSE) =3D=3D 0); >> > >+ >> > >+ for (i =3D idx + 1; i < num_handles; i++) { >> > >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, >> > >+ sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); >> > >+ if (!libzfs_path_contains(parent, child)) >> > >+ break; >> > >+ } >> > >+ return (i); >> > >+} >> > >+ >> > >+typedef struct mnt_param { >> > >+ libzfs_handle_t *mnt_hdl; >> > >+ tpool_t *mnt_tp; >> > >+ zfs_handle_t **mnt_zhps; /* filesystems to mount */ >> > >+ size_t mnt_num_handles; >> > >+ int mnt_idx; /* Index of selected entry to mount */ >> > >+ zfs_iter_f mnt_func; >> > >+ void *mnt_data; >> > >+} mnt_param_t; >> > >+ >> > >+/* >> > >+ * Allocate and populate the parameter struct for mount function, >and >> > >+ * schedule mounting of the entry selected by idx=2E >> > >+ */ >> > >+static void >> > >+zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, >> > >+ size_t num_handles, int idx, zfs_iter_f func, void *data, >tpool_t >> > >*tp) >> > >+{ >> > >+ mnt_param_t *mnt_param =3D zfs_alloc(hdl, sizeof (mnt_param_t)); >> > >+ >> > >+ mnt_param->mnt_hdl =3D hdl; >> > >+ mnt_param->mnt_tp =3D tp; >> > >+ mnt_param->mnt_zhps =3D handles; >> > >+ mnt_param->mnt_num_handles =3D num_handles; >> > >+ mnt_param->mnt_idx =3D idx; >> > >+ mnt_param->mnt_func =3D func; >> > >+ mnt_param->mnt_data =3D data; >> > >+ >> > >+ (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); >> > >+} >> > >+ >> > >+/* >> > >+ * This is the structure used to keep state of mounting or >sharing >> > >operations >> > >+ * during a call to zpool_enable_datasets()=2E >> > >+ */ >> > >+typedef struct mount_state { >> > >+ /* >> > >+ * ms_mntstatus is set to -1 if any mount fails=2E While multiple >> > >threads >> > >+ * could update this variable concurrently, no synchronization >is >> > >+ * needed as it's only ever set to -1=2E >> > >+ */ >> > >+ int ms_mntstatus; >> > >+ int ms_mntflags; >> > >+ const char *ms_mntopts; >> > >+} mount_state_t; >> > >+ >> > >+static int >> > >+zfs_mount_one(zfs_handle_t *zhp, void *arg) >> > >+{ >> > >+ mount_state_t *ms =3D arg; >> > >+ int ret =3D 0; >> > >+ >> > >+ if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) !=3D 0) >> > >+ ret =3D ms->ms_mntstatus =3D -1; >> > >+ return (ret); >> > >+} >> > >+ >> > >+static int >> > >+zfs_share_one(zfs_handle_t *zhp, void *arg) >> > >+{ >> > >+ mount_state_t *ms =3D arg; >> > >+ int ret =3D 0; >> > >+ >> > >+ if (zfs_share(zhp) !=3D 0) >> > >+ ret =3D ms->ms_mntstatus =3D -1; >> > >+ return (ret); >> > >+} >> > >+ >> > >+/* >> > >+ * Thread pool function to mount one file system=2E On completion, >it >> > >finds and >> > >+ * schedules its children to be mounted=2E This depends on the >sorting >> > >done in >> > >+ * zfs_foreach_mountpoint()=2E Note that the degenerate case (chain >of >> > >entries >> > >+ * each descending from the previous) will have no parallelism >since >> > >we always >> > >+ * have to wait for the parent to finish mounting before we can >> > >schedule >> > >+ * its children=2E >> > >+ */ >> > >+static void >> > >+zfs_mount_task(void *arg) >> > >+{ >> > >+ mnt_param_t *mp =3D arg; >> > >+ int idx =3D mp->mnt_idx; >> > >+ zfs_handle_t **handles =3D mp->mnt_zhps; >> > >+ size_t num_handles =3D mp->mnt_num_handles; >> > >+ char mountpoint[ZFS_MAXPROPLEN]; >> > >+ >> > >+ verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, >mountpoint, >> > >+ sizeof (mountpoint), NULL, NULL, 0, B_FALSE) =3D=3D 0); >> > >+ >> > >+ if (mp->mnt_func(handles[idx], mp->mnt_data) !=3D 0) >> > >+ return; >> > >+ >> > >+ /* >> > >+ * We dispatch tasks to mount filesystems with mountpoints >underneath >> > >+ * this one=2E We do this by dispatching the next filesystem with >a >> > >+ * descendant mountpoint of the one we just mounted, then skip >all of >> > >+ * its descendants, dispatch the next descendant mountpoint, and >so >> > >on=2E >> > >+ * The non_descendant_idx() function skips over filesystems that >are >> > >+ * descendants of the filesystem we just dispatched=2E >> > >+ */ >> > >+ for (int i =3D idx + 1; i < num_handles; >> > >+ i =3D non_descendant_idx(handles, num_handles, i)) { >> > >+ char child[ZFS_MAXPROPLEN]; >> > >+ verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, >> > >+ child, sizeof (child), NULL, NULL, 0, B_FALSE) =3D=3D 0); >> > >+ >> > >+ if (!libzfs_path_contains(mountpoint, child)) >> > >+ break; /* not a descendant, return */ >> > >+ zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, >> > >+ mp->mnt_func, mp->mnt_data, mp->mnt_tp); >> > >+ } >> > >+ free(mp); >> > >+} >> > >+ >> > >+/* >> > >+ * Issue the func callback for each ZFS handle contained in the >> > >handles >> > >+ * array=2E This function is used to mount all datasets, and so >this >> > >function >> > >+ * guarantees that filesystems for parent mountpoints are called >> > >before their >> > >+ * children=2E As such, before issuing any callbacks, we first sort >the >> > >array >> > >+ * of handles by mountpoint=2E >> > >+ * >> > >+ * Callbacks are issued in one of two ways: >> > >+ * >> > >+ * 1=2E Sequentially: If the parallel argument is B_FALSE or the >> > >ZFS_SERIAL_MOUNT >> > >+ * environment variable is set, then we issue callbacks >> > >sequentially=2E >> > >+ * >> > >+ * 2=2E In parallel: If the parallel argument is B_TRUE and the >> > >ZFS_SERIAL_MOUNT >> > >+ * environment variable is not set, then we use a tpool to >dispatch >> > >threads >> > >+ * to mount filesystems in parallel=2E This function dispatches >tasks >> > >to mount >> > >+ * the filesystems at the top-level mountpoints, and these >tasks in >> > >turn >> > >+ * are responsible for recursively mounting filesystems in >their >> > >children >> > >+ * mountpoints=2E >> > >+ */ >> > >+void >> > >+zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t >**handles, >> > >+ size_t num_handles, zfs_iter_f func, void *data, boolean_t >> > >parallel) >> > >+{ >> > >+ zoneid_t zoneid =3D getzoneid(); >> > >+ >> > >+ /* >> > >+ * The ZFS_SERIAL_MOUNT environment variable is an undocumented >> > >+ * variable that can be used as a convenience to do a/b >comparison >> > >+ * of serial vs=2E parallel mounting=2E >> > >+ */ >> > >+ boolean_t serial_mount =3D !parallel || >> > >+ (getenv("ZFS_SERIAL_MOUNT") !=3D NULL); >> > >+ >> > >+ /* >> > >+ * Sort the datasets by mountpoint=2E See mountpoint_cmp for >details >> > >+ * of how these are sorted=2E >> > >+ */ >> > >+ qsort(handles, num_handles, sizeof (zfs_handle_t *), >mountpoint_cmp); >> > >+ >> > >+ if (serial_mount) { >> > >+ for (int i =3D 0; i < num_handles; i++) { >> > >+ func(handles[i], data); >> > >+ } >> > >+ return; >> > >+ } >> > >+ >> > >+ /* >> > >+ * Issue the callback function for each dataset using a parallel >> > >+ * algorithm that uses a thread pool to manage threads=2E >> > >+ */ >> > >+ tpool_t *tp =3D tpool_create(1, mount_tp_nthr, 0, NULL); >> > >+ >> > >+ /* >> > >+ * There may be multiple "top level" mountpoints outside of the >> > >pool's >> > >+ * root mountpoint, e=2Eg=2E: /foo /bar=2E Dispatch a mount task f= or >each >> > >of >> > >+ * these=2E >> > >+ */ >> > >+ for (int i =3D 0; i < num_handles; >> > >+ i =3D non_descendant_idx(handles, num_handles, i)) { >> > >+ /* >> > >+ * Since the mountpoints have been sorted so that the zoned >> > >+ * filesystems are at the end, a zoned filesystem seen from >> > >+ * the global zone means that we're done=2E >> > >+ */ >> > >+ if (zoneid =3D=3D GLOBAL_ZONEID && >> > >+ zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) >> > >+ break; >> > >+ zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, >> > >+ tp); >> > >+ } >> > >+ >> > >+ tpool_wait(tp); /* wait for all scheduled mounts to complete */ >> > >+ tpool_destroy(tp); >> > >+} >> > >+ >> > >+/* >> > >* Mount and share all datasets within the given pool=2E This >assumes >> > >that no >> > >- * datasets within the pool are currently mounted=2E Because users >can >> > >create >> > >- * complicated nested hierarchies of mountpoints, we first gather >all >> > >the >> > >- * datasets and mountpoints within the pool, and sort them by >> > >mountpoint=2E Once >> > >- * we have the list of all filesystems, we iterate over them in >order >> > >and mount >> > >- * and/or share each one=2E >> > >+ * datasets within the pool are currently mounted=2E >> > > */ >> > > #pragma weak zpool_mount_datasets =3D zpool_enable_datasets >> > > int >> > >zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, >int >> > >flags) >> > > { >> > > get_all_cb_t cb =3D { 0 }; >> > >- libzfs_handle_t *hdl =3D zhp->zpool_hdl; >> > >+ mount_state_t ms =3D { 0 }; >> > > zfs_handle_t *zfsp; >> > >- int i, ret =3D -1; >> > >- int *good; >> > >+ int ret =3D 0; >> > >=20 >> > >- /* >> > >- * Gather all non-snap datasets within the pool=2E >> > >- */ >> > >- if ((zfsp =3D zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) = =3D=3D >> > >NULL) >> > >+ if ((zfsp =3D zfs_open(zhp->zpool_hdl, zhp->zpool_name, >> > >+ ZFS_TYPE_DATASET)) =3D=3D NULL) >> > > goto out; >> > >=20 >> > >- libzfs_add_handle(&cb, zfsp); >> > >- if (zfs_iter_filesystems(zfsp, mount_cb, &cb) !=3D 0) >> > >- goto out; >> > > /* >> > >- * Sort the datasets by mountpoint=2E >> > >+ * Gather all non-snapshot datasets within the pool=2E Start by >adding >> > >+ * the root filesystem for this pool to the list, and then >iterate >> > >+ * over all child filesystems=2E >> > > */ >> > >- qsort(cb=2Ecb_handles, cb=2Ecb_used, sizeof (void *), >> > >- libzfs_dataset_cmp); >> > >+ libzfs_add_handle(&cb, zfsp); >> > >+ if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) !=3D 0) >> > >+ goto out; >> > >=20 >> > > /* >> > >- * And mount all the datasets, keeping track of which ones >> > >- * succeeded or failed=2E >> > >+ * Mount all filesystems >> > > */ >> > >- if ((good =3D zfs_alloc(zhp->zpool_hdl, >> > >- cb=2Ecb_used * sizeof (int))) =3D=3D NULL) >> > >- goto out; >> > >+ ms=2Ems_mntopts =3D mntopts; >> > >+ ms=2Ems_mntflags =3D flags; >> > >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb=2Ecb_handles, >cb=2Ecb_used, >> > >+ zfs_mount_one, &ms, B_TRUE); >> > >+ if (ms=2Ems_mntstatus !=3D 0) >> > >+ ret =3D ms=2Ems_mntstatus; >> > >=20 >> > >- ret =3D 0; >> > >- for (i =3D 0; i < cb=2Ecb_used; i++) { >> > >- if (zfs_mount(cb=2Ecb_handles[i], mntopts, flags) !=3D 0) >> > >- ret =3D -1; >> > >- else >> > >- good[i] =3D 1; >> > >- } >> > >- >> > > /* >> > >- * Then share all the ones that need to be shared=2E This needs >> > >- * to be a separate pass in order to avoid excessive reloading >> > >- * of the configuration=2E Good should never be NULL since >> > >- * zfs_alloc is supposed to exit if memory isn't available=2E >> > >+ * Share all filesystems that need to be shared=2E This needs to >be >> > >+ * a separate pass because libshare is not mt-safe, and so we >need >> > >+ * to share serially=2E >> > > */ >> > >- for (i =3D 0; i < cb=2Ecb_used; i++) { >> > >- if (good[i] && zfs_share(cb=2Ecb_handles[i]) !=3D 0) >> > >- ret =3D -1; >> > >- } >> > >+ ms=2Ems_mntstatus =3D 0; >> > >+ zfs_foreach_mountpoint(zhp->zpool_hdl, cb=2Ecb_handles, >cb=2Ecb_used, >> > >+ zfs_share_one, &ms, B_FALSE); >> > >+ if (ms=2Ems_mntstatus !=3D 0) >> > >+ ret =3D ms=2Ems_mntstatus; >> > >=20 >> > >- free(good); >> > >- >> > > out: >> > >- for (i =3D 0; i < cb=2Ecb_used; i++) >> > >+ for (int i =3D 0; i < cb=2Ecb_used; i++) >> > > zfs_close(cb=2Ecb_handles[i]); >> > > free(cb=2Ecb_handles); >> > >=20 >> >=20 >> > This broke my systems, many filesystems fail to mount causing >nullfs late mounts to fail=2E No details now until tonight=2E >> >=20 >> > Suggest we back this out until it is properly tested=2E >> >=20 >>=20 >> What fails to mount? what message? can you provide Gandi folks more >informations >> so they can fix? >>=20 >> I will revert if we cannot have a quick fix but let s give them a >chance to fix >> first=2E >>=20 >With the proper email in CC there is a better chance to reach at them >:) > >Best regards, >Bapt Sorry about that=2E I'm terribly frustrated as this broke my mail gateway,= having to fix it using juiceSSH on my phone on the bus=2E Ssh on the phone= makes for a very grumpy Cy=2E I did bring my personal laptop to work, so I'll try to help out testing th= is at noon here and maybe look at it more=2E I'll help out any way I can=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Tue Feb 26 16:39:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EC51151EA64; Tue, 26 Feb 2019 16:39:02 +0000 (UTC) (envelope-from jack@gandi.net) Received: from gandi.net (mail12.gandi.net [IPv6:2001:4b98:dc4:5:ae1f:6bff:fe2d:9fdc]) (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 84FCD8D455; Tue, 26 Feb 2019 16:39:01 +0000 (UTC) (envelope-from jack@gandi.net) Received: from [192.168.0.35] (pla93-1-81-57-194-189.fbx.proxad.net [81.57.194.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gandi.net (Postfix) with ESMTPSA id 0F9421604B4; Tue, 26 Feb 2019 16:38:51 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common From: Jack Halford X-Mailer: iPhone Mail (16A366) In-Reply-To: <1F5FB340-1CD2-400F-82D3-8D4949A351A2@cschubert.com> Date: Tue, 26 Feb 2019 17:38:50 +0100 Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> <1F5FB340-1CD2-400F-82D3-8D4949A351A2@cschubert.com> To: Cy Schubert X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 16:39:02 -0000 > Nested zfs filesystems seem not to be handled properly or possibly not sup= ported any more. This explains my mail gateway also not mounting all filesys= tems in /home. It was odd that dovecot stopped working. >=20 > The symptom of the problem is zfs mount -a no longer mounts all filesystem= s. Zfs mount fails saying the filesystem is already mounted. The workaround i= s to zfs umount each affected zfs dataset by hand and zfs mount it by hand. >=20 > Generally this has screwed up sites that have hundreds (in my case 122) zf= s datasets. The work around might be to script testing each mount, unmountin= g and remounting if necessary. >=20 > I'm being sarcastic about creating an rc script to clean this up. This nee= ds to be backed out and tested properly before being committed.=20 Thanks for the feedback, I=E2=80=99ll try to reproduce this on my side. regards =E2=80=94 jack@gandi.net= From owner-svn-src-head@freebsd.org Tue Feb 26 16:54:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69B75151EF34; Tue, 26 Feb 2019 16:54:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 DE5EC8DC73; Tue, 26 Feb 2019 16:54:09 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52f.google.com with SMTP id 196so6466131pgf.13; Tue, 26 Feb 2019 08:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Obmxl6IrNCo2nDp4J8RXxOhMNA99aJR2x0tek+rtPrU=; b=GdhfbyYQpoFFGsUO18ZMkoWJDaCT855oGI6Uq4OmCsJioC6HNg/2Mrfrbw5qnhjZTo UWeUC+83k+i4W+2gVlS3EpiFFEgZ4oQXL5c89N0WDFAO3xpQZv6fg1FU37WQkCky2F7A OCcX8ftkE07GLyZYwCHz5O+XkGdSyyD0MEBWzWqmwYOcTWSqLRZCsxKBD9cqgP95aZsQ cGX6iTLwSAoarYOAnnV7AqF5bfctYz6YWjb82yazN+3laYv40L9AjqIZi9toSXee02/h zwjPwIR+etPJIpXQDg2gMaZa2HTdRZJp0XWXWv8cf9TMbNg3DLxmzXpue8KtD1FrIoZD zB5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Obmxl6IrNCo2nDp4J8RXxOhMNA99aJR2x0tek+rtPrU=; b=Mk7yqUlc5XZbMn3+CIeIVxAhxOSO/GNQcLfoqIdHQ8roywQoP9M1YSfj8OlD9hCi+B 7q6Cy6ZHOCZroiKF6d6fCGH/fp99q+LXay1wo8QCz9UqoDh6Qj4prGYRLgdpfb9FXxZQ vLklhldZJ/VV6oArt3PQFYoc3r1USw5SwSQYUS4C5KxSfZ2MNTXupGN1qpY9lfFwQ93g lwC3+/BQWvj4eo0cbLtJ78CHOGe+873hDMi/hZOzrVkPFCkFCoPUU4jyU/Aal3iwAGIA t9xjvKjKxoySz+AMaA+0pTJVWrBci5R89xgZOxDNtkYHCDCAu8n0w/00Y6Yp1QClxcMN +G8w== X-Gm-Message-State: AHQUAuZy7YeZ78fa8THEP8fNuNeuIX4O30hk5DSIRqMhfMgFZgJg0BR+ Dm8fHfz/uhIWXS469S3IoGvEioxR X-Google-Smtp-Source: AHgI3IaRCCs3Jn2oN8IviCoDVCHJ1nKaL8k3OydvQV0lOYmI0TuaNe9YY7zHO5W4Wfea9853bI4l6A== X-Received: by 2002:a62:6d81:: with SMTP id i123mr26732892pfc.235.1551200048053; Tue, 26 Feb 2019 08:54:08 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s6sm24143656pgi.56.2019.02.26.08.54.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 08:54:07 -0800 (PST) From: Enji Cooper Message-Id: <0E5630EC-A56B-4B02-9057-AA1C77C7849B@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Date: Tue, 26 Feb 2019 08:54:06 -0800 In-Reply-To: <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> Cc: Shawn Webb , "K. Macy" , svn-src-head@freebsd.org, Matt Macy , svn-src-all@freebsd.org, Brooks Davis , src-committers To: rgrimes@freebsd.org References: <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: DE5EC8DC73 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 16:54:10 -0000 > On Feb 26, 2019, at 8:27 AM, Rodney W. Grimes = wrote: =E2=80=A6 > Didnt we just remove an inbase, compiling BSD licensed chunk of > code called DRM and move it to ports. So if that was possible > this should be very rapidly applied here and this issue goes away. >=20 > I am still shaking my head over this one. Yes, there is some > expediance to this. Also could it not live on a project > branch? Like.. um.. the ZoL project branch? Kernel gcov provides a lot of value beyond ZoL. Knowing which branches = are being hit by analysis, then producing tests (or pruning dead = branches if need be), can greatly improve the quality of kernel code, = instead of making a discovery like, "I just tested a thing by running a = common workload, and it hit these branches by side-effect, but I omitted = these sets of branches, which resulted in panics post-release". Isilon used its own homegrown variant of this for many moons (and it was = a mess). This solution is great for developers/testers, minus the = concerns I (and others) have over licensing. Thanks, -Enji= From owner-svn-src-head@freebsd.org Tue Feb 26 16:59:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27174151F055; Tue, 26 Feb 2019 16:59:52 +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 6C6328DF59; Tue, 26 Feb 2019 16:59:51 +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 x1QGxl0w046686; Tue, 26 Feb 2019 08:59:47 -0800 (PST) (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 x1QGxkl0046685; Tue, 26 Feb 2019 08:59:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261659.x1QGxkl0046685@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: To: Benjamin Kaduk Date: Tue, 26 Feb 2019 08:59:46 -0800 (PST) CC: Cy Schubert , Baptiste Daroussin , 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-Rspamd-Queue-Id: 6C6328DF59 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 16:59:52 -0000 > On Tue, Feb 26, 2019 at 10:14 AM Cy Schubert > wrote: > > > On February 26, 2019 7:48:27 AM PST, Cy Schubert < > > Cy.Schubert@cschubert.com> wrote: > > >On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > > > wrote: > > > > [trimming the unneeded pile of commit body] > > > > >This broke my systems, many filesystems fail to mount causing nullfs > > >late mounts to fail. No details now until tonight. > > > > > >Suggest we back this out until it is properly tested. > > > > Nested zfs filesystems seem not to be handled properly or possibly not > > supported any more. This explains my mail gateway also not mounting all > > filesystems in /home. It was odd that dovecot stopped working. > > > > The symptom of the problem is zfs mount -a no longer mounts all > > filesystems. Zfs mount fails saying the filesystem is already mounted. The > > workaround is to zfs umount each affected zfs dataset by hand and zfs mount > > it by hand. > > > > Generally this has screwed up sites that have hundreds (in my case 122) > > zfs datasets. The work around might be to script testing each mount, > > unmounting and remounting if necessary. > > > > I'm being sarcastic about creating an rc script to clean this up. This > > needs to be backed out and tested properly before being committed. > > > > > I don't know what you mean by "nested zfs filesystems" -- do you mean a > zpool within a zvol? > That has been unsupported for a long time, IIRC. And That had better not be unsupported, that is the prefered technology for all of the virtualization stuff, bhyve, virtualbox, qemu, etc. I think by nested zfs it sounds like he is talking about datasets inside of other datasets just from reading "all filesystems in /home" > I'm not sure what else "nested filesystems" would be, since having (e.g.) > separate zfs filesystems for /usr and /usr/ports is so common that surely > it has already been tested... It might be when the intervening dataset is marked canmount=off? Though that should fail for the /usr /usr/foo case, as usr is normally marked this way. Maybe some other special case. > -Ben -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 17:07:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2DAF151F75E; Tue, 26 Feb 2019 17:07:31 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 520BD8E863; Tue, 26 Feb 2019 17:07:31 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (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: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 0FCDD1D80A; Tue, 26 Feb 2019 17:07:31 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it1-f175.google.com with SMTP id z131so4909010itf.5; Tue, 26 Feb 2019 09:07:31 -0800 (PST) X-Gm-Message-State: AHQUAubfD2iEMohYhSpocFWy86PI4A1fSZoxuPFiqBblVEiThmWnR02X Hrb0/xzQGAck0Kcj5fLjtWk5yIoTwq0biyIKXHM= X-Google-Smtp-Source: AHgI3IYoDwqqCCbBBK63NJCFxb2tRJRdPDSKbf4hJlCRU62+52Hp+s6ukboYUxsRUD4EOIT4xlXFMxRivaNqrI0xOZk= X-Received: by 2002:a05:660c:807:: with SMTP id j7mr2924457itk.102.1551200850513; Tue, 26 Feb 2019 09:07:30 -0800 (PST) MIME-Version: 1.0 References: <20190226154535.q32nwf6xyupexkta@mutt-hbsd> <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> From: Matthew Macy Date: Tue, 26 Feb 2019 09:07:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: rgrimes@freebsd.org Cc: Brooks Davis , "K. Macy" , Shawn Webb , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 520BD8E863 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:07:32 -0000 This has zero impact on the licensing disposition of the kernel as distributed as it is only used for test kernels. Tests compiled with coverage instrumentation run much slower than even debug, one would never ship this. You are very much in the minority being more concerned with ideological purity than minimizing the decline in relevance of FreeBSD, much less striving to increase its relevance. On Tue, Feb 26, 2019 at 08:27 Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > > The modest increase in activation energy for that task seems worth > it > > > > > for the short-term gains of reduced integration cost (this code > will > > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > > > license statements. The standard GPL v2.0 boiler plate should be > added > > > > > to this file along side the tag. > > > > > > > > I've copied the full copyright attribution that is in the > > > > corresponding files on Linux. Is there some reason why FreeBSD > > > > requires the files to be inflated with the full license text where > the > > > > original lacks it? > > > > > > I think for a few reasons, I doubt you copied the whole distribution > > > that this file came from, as I am sure that distribution included > > > a LICENSE file. Second if you actually read the GPL v2 documentation > > > and follow what it says it says you must do this, just because some > > > one else does not follow the rules of what the GPL v2 says does not > > > give us to knowingling not do it. Third this is a particular > dangerious > > > area for BSD to be mixing a GPL code with its kernel, to my knowlege > > > we have never had any gpl code in the kernel, no have we ever > > > allowed it, but thats a seperate argument, that should be made. > > > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > > > > I, too, would like less GPL in project, both in userland in kernel. > > But, I can understand the desire for gcov. Note that I'm not > > advocating either way that FreeBSD perform an action. ;) > > Didnt we just remove an inbase, compiling BSD licensed chunk of > code called DRM and move it to ports. So if that was possible > this should be very rapidly applied here and this issue goes away. > > I am still shaking my head over this one. Yes, there is some > expediance to this. Also could it not live on a project > branch? Like.. um.. the ZoL project branch? > > > Thanks, > > Shawn Webb > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Tue Feb 26 17:08:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18E9E151F7E5; Tue, 26 Feb 2019 17:08:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B18128E9E5; Tue, 26 Feb 2019 17:08:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F96A8199; Tue, 26 Feb 2019 17:08:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QH8pbZ039730; Tue, 26 Feb 2019 17:08:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QH8p4X039729; Tue, 26 Feb 2019 17:08:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261708.x1QH8p4X039729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 17:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344589 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B18128E9E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:08:52 -0000 Author: manu Date: Tue Feb 26 17:08:51 2019 New Revision: 344589 URL: https://svnweb.freebsd.org/changeset/base/344589 Log: arm64: rockchip: rk3399_pll: Switch to slow mode when changing the freq Like r344578 but for RK3399. This solve some hangs when switching between frequency. MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Tue Feb 26 16:34:43 2019 (r344588) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Tue Feb 26 17:08:51 2019 (r344589) @@ -424,6 +424,11 @@ rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t DEVICE_LOCK(clk); + /* Setting to slow mode during frequency change */ + reg = RK3399_CLK_PLL_MODE_SLOW << RK3399_CLK_PLL_MODE_SHIFT; + reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->mode_reg, reg); + /* Setting fbdiv */ READ4(clk, sc->base_offset, ®); reg &= ~RK3399_CLK_PLL_FBDIV_MASK; From owner-svn-src-head@freebsd.org Tue Feb 26 17:12:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4127151FB55; Tue, 26 Feb 2019 17:12:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 761FD8EE12; Tue, 26 Feb 2019 17:12:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id C62CB1D91A; Tue, 26 Feb 2019 17:12:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec To: Alexey Dokuchaev , rgrimes@freebsd.org Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <34ecb52f-c89e-0d5e-594e-25b0d045d171@FreeBSD.org> Date: Tue, 26 Feb 2019 09:12:11 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190226134953.GB39566@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 761FD8EE12 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:12:16 -0000 On 2/26/19 5:49 AM, Alexey Dokuchaev wrote: > On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: >>> Author: sjg >>> Date: Tue Feb 26 06:17:23 2019 >>> New Revision: 344567 >>> URL: https://svnweb.freebsd.org/changeset/base/344567 >>> >>> Log: >>> Add verifying manifest loader for mac_veriexec >>> >>> This tool will verify a signed manifest and load contents into >>> mac_veriexec for storage >>> >>> Sponsored by: Juniper Networks >>> Differential Revision: D16575 >> >> Just a small nit, for future reference, from the template: >>> Differential Revision: https://reviews.freebsd.org/D### >> (*full* phabric URL needed). > > IMHO we should just fix the scripts to accept D#### alone, without > the URL. We don't do that for PR (bugzilla) references, and the fact > that we do for the phab is both needless and confusing. Also, that > URL might change one day while we could probably keep the old numbers > if we move. It makes the review clickable in many mail clients which is very handy. (I use that very often.) The URL is already generic (reviews.freebsd.org rather than phabricator.freebsd.org) to accommodate any future replacements of phab with something else. You are more than welcome to submit patches to phab. Getting it to honor our template so one could just use 'arc commit' directly would probably be an even bigger win than honoring D in this field, though the second task is probably simpler? -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Feb 26 17:18:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C678151FCD9 for ; Tue, 26 Feb 2019 17:18:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (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 316DC8F08C for ; Tue, 26 Feb 2019 17:18:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id o6so15767663qtk.6 for ; Tue, 26 Feb 2019 09:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SWi+qUsT/yOna7Rv2qpM2sUsnri/Gp4dSzJ6uoGU+Hw=; b=k2l7X02kBm3kANSADMnjGVjfTtPYB6wqBWVw8yPlqxWhbKnxH2PQcLWSzixcVSwrOv wKTFzyiiRyguykX4Pb5J4lm5zWC1imkSK+h4arpbGagrTht7FnLjhBSb4dtJZer96rZ9 2Ch1/7zZ3D6SRTdA+L5UHQXpGvh8A31XMlPoeTqrlilS8j/lvLttIyAYGkEGznLQVTFj MFt7bpq4qB2QlZPNKOTEqe/RLvaN49A8rYxyQQ5JrhameO9T4PMWczgW8mkXx+lvVGQZ pSLGTZIk27+VfQiB7KrZPe57NTdLzsZkuRMlJTyiId6dey/fyKOOBXnqUfts5ws4sjZr Jp+Q== 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=SWi+qUsT/yOna7Rv2qpM2sUsnri/Gp4dSzJ6uoGU+Hw=; b=Cx7LXle89PvJYWXXIbXFi8psmuHMyYbYDdRvmS1CsfWbp7Q8MZV3Q2z+oJTamUqVko FynWuYK43r/mnlqLLMF5HOCTcscBvzS80QVH9IR/Kv95Hb+IpvnZXM3uYOxL+MNNgZgU GpYz/RdYLOXeV4kHW10p9CYcrNr4Th4pIYbw6lST9vgarIDMi8qmK90TKq5utvh0Acbq /2HcABZSQmRHmSOGDphu2T5iyydwpqavh73RsuYSna24Qjq1ZM+QtsxChisosPs7qQka tdltsbZCxoile4wxE1uz1PUQihqf5kju8rwQBP6NUBEkEYZAM7mDJfCrfveiUe7Oa4ns l9Pw== X-Gm-Message-State: AHQUAuYhdQ3yLxB7FnN1ZVCG2VInIAmZsfNzp0LRcXsrlgGXPC+LAoX+ qVF/nUOugMGwFm3gzgwawuTL2ioSf+JfoTzX5oAdi/oK X-Google-Smtp-Source: AHgI3IaM0f5So9OCto/FPei9njkT/M1RoV76By3Mff7kF5unyZ32EJHNCNhJ0A/XKwCQTVjO864d9PDXnBYGF/azSz8= X-Received: by 2002:ac8:16d0:: with SMTP id y16mr18249762qtk.345.1551201536550; Tue, 26 Feb 2019 09:18:56 -0800 (PST) MIME-Version: 1.0 References: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> <20190226154535.q32nwf6xyupexkta@mutt-hbsd> In-Reply-To: <20190226154535.q32nwf6xyupexkta@mutt-hbsd> From: Warner Losh Date: Tue, 26 Feb 2019 10:18:45 -0700 Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: Shawn Webb Cc: "Rodney W. Grimes" , "K. Macy" , svn-src-head@freebsd.org, Matt Macy , svn-src-all@freebsd.org, Brooks Davis , src-committers X-Rspamd-Queue-Id: 316DC8F08C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:18:57 -0000 On Tue, Feb 26, 2019 at 8:46 AM Shawn Webb wrote: > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > The modest increase in activation energy for that task seems worth it > > > > for the short-term gains of reduced integration cost (this code will > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > > license statements. The standard GPL v2.0 boiler plate should be > added > > > > to this file along side the tag. > > > > > > I've copied the full copyright attribution that is in the > > > corresponding files on Linux. Is there some reason why FreeBSD > > > requires the files to be inflated with the full license text where the > > > original lacks it? > > > > I think for a few reasons, I doubt you copied the whole distribution > > that this file came from, as I am sure that distribution included > > a LICENSE file. Second if you actually read the GPL v2 documentation > > and follow what it says it says you must do this, just because some > > one else does not follow the rules of what the GPL v2 says does not > > give us to knowingling not do it. Third this is a particular dangerious > > area for BSD to be mixing a GPL code with its kernel, to my knowlege > > we have never had any gpl code in the kernel, no have we ever > > allowed it, but thats a seperate argument, that should be made. > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > No. dts gets compiled into dtb. dtb is a separate work loaded by the boot loader. While one can compile it into the kernel, we don't ship like that. There's also a question as to whether or not these files are text representation of the hardware, and there being only one way to represent it (making it not copyrightable under at least US case law since it's a database). That question hasn't been litigated. Many hardware companies also dual license the dts. Since we're not incorporating it into the kernel, but merely using it as a standardized table (there's a separate group that controls the dts/dtb spec), I think we're safe from that angle as well. There's benefit from having it in-tree because the version of the spec evolves over time, and having the right version makes it harder to push this off into a port. Also, having them in-tree makes the project's compliance with GPL a no-op because it's all there in the open in a tagged VCS. tl;dr: I don't think this is an issue. > I, too, would like less GPL in project, both in userland in kernel. > But, I can understand the desire for gcov. Note that I'm not > advocating either way that FreeBSD perform an action. ;) > Given this is for TEST kernels, there's no issue here. While we'd like to be GPL free, let's not cut off our nose to spite our face. Given the interactions between different bits, the FreeBSD selling point of "well integrated" I think trumps the purity arguments because it's not code anybody would ever ship (and if they did, they'd get the proper warnings). Warner From owner-svn-src-head@freebsd.org Tue Feb 26 17:19:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B581151FD12; Tue, 26 Feb 2019 17:19:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFFD68F18E; Tue, 26 Feb 2019 17:19:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 455011D91B; Tue, 26 Feb 2019 17:19:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: rgrimes@freebsd.org, Benjamin Kaduk Cc: Cy Schubert , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201902261659.x1QGxkl0046685@pdx.rh.CN85.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <20a4a5ab-f088-537b-8666-e6c6f43170a9@FreeBSD.org> Date: Tue, 26 Feb 2019 09:19:02 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <201902261659.x1QGxkl0046685@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFFD68F18E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:19:12 -0000 On 2/26/19 8:59 AM, Rodney W. Grimes wrote: >> On Tue, Feb 26, 2019 at 10:14 AM Cy Schubert >> wrote: >> >>> On February 26, 2019 7:48:27 AM PST, Cy Schubert < >>> Cy.Schubert@cschubert.com> wrote: >>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin >>>> wrote: >>> >> >> [trimming the unneeded pile of commit body] >> >> >>>> This broke my systems, many filesystems fail to mount causing nullfs >>>> late mounts to fail. No details now until tonight. >>>> >>>> Suggest we back this out until it is properly tested. >>> >>> Nested zfs filesystems seem not to be handled properly or possibly not >>> supported any more. This explains my mail gateway also not mounting all >>> filesystems in /home. It was odd that dovecot stopped working. >>> >>> The symptom of the problem is zfs mount -a no longer mounts all >>> filesystems. Zfs mount fails saying the filesystem is already mounted. The >>> workaround is to zfs umount each affected zfs dataset by hand and zfs mount >>> it by hand. >>> >>> Generally this has screwed up sites that have hundreds (in my case 122) >>> zfs datasets. The work around might be to script testing each mount, >>> unmounting and remounting if necessary. >>> >>> I'm being sarcastic about creating an rc script to clean this up. This >>> needs to be backed out and tested properly before being committed. >>> >>> >> I don't know what you mean by "nested zfs filesystems" -- do you mean a >> zpool within a zvol? >> That has been unsupported for a long time, IIRC. And > That had better not be unsupported, that is the prefered technology > for all of the virtualization stuff, bhyve, virtualbox, qemu, etc. I think Ben is referring to using the nested zpool on the host itself rather than in the guest. We do actually let you do such crazy things I think (I use UFS in my VMs usually and fsck on the host against /dev/zvol/bhyve/p2 can be faster than fsck in the booted guest), but normally the host just hosts the zvol and the guest manages filesystems in the volume. Mounting the nested zpool on the host is probably best characterized as running with scissors. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Feb 26 17:20:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52162151FDAB; Tue, 26 Feb 2019 17:20:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA4C08F34A; Tue, 26 Feb 2019 17:20:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD0AC834B; Tue, 26 Feb 2019 17:20:03 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QHK3de045106; Tue, 26 Feb 2019 17:20:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QHK37x045105; Tue, 26 Feb 2019 17:20:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902261720.x1QHK37x045105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Feb 2019 17:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344590 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA4C08F34A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:20:04 -0000 Author: manu Date: Tue Feb 26 17:20:03 2019 New Revision: 344590 URL: https://svnweb.freebsd.org/changeset/base/344590 Log: arm64: rockchip: rk3399_pll: Fix copy paste RK3399 PLLs don't have mode_reg, use the correct register. MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Tue Feb 26 17:08:51 2019 (r344589) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Tue Feb 26 17:20:03 2019 (r344590) @@ -427,7 +427,7 @@ rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t /* Setting to slow mode during frequency change */ reg = RK3399_CLK_PLL_MODE_SLOW << RK3399_CLK_PLL_MODE_SHIFT; reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; - WRITE4(clk, sc->mode_reg, reg); + WRITE4(clk, sc->base_offset + 0xC, reg); /* Setting fbdiv */ READ4(clk, sc->base_offset, ®); From owner-svn-src-head@freebsd.org Tue Feb 26 17:20:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77702151FDE1; Tue, 26 Feb 2019 17:20:17 +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 EFBA48F42D; Tue, 26 Feb 2019 17:20:16 +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 x1QHKALt046818; Tue, 26 Feb 2019 09:20:10 -0800 (PST) (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 x1QHKAXr046817; Tue, 26 Feb 2019 09:20:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261720.x1QHKAXr046817@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: To: Matthew Macy Date: Tue, 26 Feb 2019 09:20:10 -0800 (PST) CC: rgrimes@freebsd.org, Brooks Davis , "K. Macy" , Shawn Webb , 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-Rspamd-Queue-Id: EFBA48F42D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:20:17 -0000 > This has zero impact on the licensing disposition of the kernel as > distributed as it is only used for test kernels. Tests compiled with > coverage instrumentation run much slower than even debug, one would never > ship this. Shit happens, mistakes get made, and sadly the consequences for someone could be pretty sad. > You are very much in the minority being more concerned with ideological > purity than minimizing the decline in relevance of FreeBSD, much less > striving to increase its relevance. I am not in the minority when it comes to GPL code anyplace in our base system, did you not read what core said, did you not read the suggested revised license guideline text? This gcov code has to eventually go, sooner or later. > On Tue, Feb 26, 2019 at 08:27 Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > > > The modest increase in activation energy for that task seems worth > > it > > > > > > for the short-term gains of reduced integration cost (this code > > will > > > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > > > > license statements. The standard GPL v2.0 boiler plate should be > > added > > > > > > to this file along side the tag. > > > > > > > > > > I've copied the full copyright attribution that is in the > > > > > corresponding files on Linux. Is there some reason why FreeBSD > > > > > requires the files to be inflated with the full license text where > > the > > > > > original lacks it? > > > > > > > > I think for a few reasons, I doubt you copied the whole distribution > > > > that this file came from, as I am sure that distribution included > > > > a LICENSE file. Second if you actually read the GPL v2 documentation > > > > and follow what it says it says you must do this, just because some > > > > one else does not follow the rules of what the GPL v2 says does not > > > > give us to knowingling not do it. Third this is a particular > > dangerious > > > > area for BSD to be mixing a GPL code with its kernel, to my knowlege > > > > we have never had any gpl code in the kernel, no have we ever > > > > allowed it, but thats a seperate argument, that should be made. > > > > > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > > > > > > I, too, would like less GPL in project, both in userland in kernel. > > > But, I can understand the desire for gcov. Note that I'm not > > > advocating either way that FreeBSD perform an action. ;) > > > > Didnt we just remove an inbase, compiling BSD licensed chunk of > > code called DRM and move it to ports. So if that was possible > > this should be very rapidly applied here and this issue goes away. > > > > I am still shaking my head over this one. Yes, there is some > > expediance to this. Also could it not live on a project > > branch? Like.. um.. the ZoL project branch? > > > > > Thanks, > > > Shawn Webb > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 17:22:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B751520032; Tue, 26 Feb 2019 17:22:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 364598F8C7; Tue, 26 Feb 2019 17:22:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (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: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 0C7441D91C; Tue, 26 Feb 2019 17:22:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io1-f44.google.com with SMTP id x3so11106202ior.6; Tue, 26 Feb 2019 09:22:19 -0800 (PST) X-Gm-Message-State: AHQUAubU1/1BimOIDBvgmhYcaxCmmCWa0pbViSImwS9t0UYj/qeylCVS IDouerecpAoxUgm+d8jrSbCoRp7T4LR6O+5Ri2s= X-Google-Smtp-Source: AHgI3IavAwp+PTDuBx7vMlbMcNHia+nJuyllomGgUJ04qiwSByyIF8swjwl1sF1RtNpmd0kyY9cThcmxa5xvxKuQdJ8= X-Received: by 2002:a6b:5006:: with SMTP id e6mr13677274iob.132.1551201738496; Tue, 26 Feb 2019 09:22:18 -0800 (PST) MIME-Version: 1.0 References: <201902261720.x1QHKAXr046817@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902261720.x1QHKAXr046817@pdx.rh.CN85.dnsmgr.net> From: Matthew Macy Date: Tue, 26 Feb 2019 09:22:07 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: rgrimes@freebsd.org Cc: Brooks Davis , "K. Macy" , Shawn Webb , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 364598F8C7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:22:19 -0000 On Tue, Feb 26, 2019 at 09:20 Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > This has zero impact on the licensing disposition of the kernel as > > distributed as it is only used for test kernels. Tests compiled with > > coverage instrumentation run much slower than even debug, one would never > > ship this. > > Shit happens, mistakes get made, and sadly the consequences for someone > could be pretty sad. > > > You are very much in the minority being more concerned with ideological > > purity than minimizing the decline in relevance of FreeBSD, much less > > striving to increase its relevance. > > I am not in the minority when it comes to GPL code anyplace > in our base system, did you not read what core said, did you > not read the suggested revised license guideline text? > > This gcov code has to eventually go, sooner or later. Unless there is a fully equivalent replacement, that will be another small step towards Linux's complete hegemony. > > > On Tue, Feb 26, 2019 at 08:27 Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > > > > The modest increase in activation energy for that task seems > worth > > > it > > > > > > > for the short-term gains of reduced integration cost (this code > > > will > > > > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags > alone as > > > > > > > license statements. The standard GPL v2.0 boiler plate should > be > > > added > > > > > > > to this file along side the tag. > > > > > > > > > > > > I've copied the full copyright attribution that is in the > > > > > > corresponding files on Linux. Is there some reason why FreeBSD > > > > > > requires the files to be inflated with the full license text > where > > > the > > > > > > original lacks it? > > > > > > > > > > I think for a few reasons, I doubt you copied the whole > distribution > > > > > that this file came from, as I am sure that distribution included > > > > > a LICENSE file. Second if you actually read the GPL v2 > documentation > > > > > and follow what it says it says you must do this, just because some > > > > > one else does not follow the rules of what the GPL v2 says does not > > > > > give us to knowingling not do it. Third this is a particular > > > dangerious > > > > > area for BSD to be mixing a GPL code with its kernel, to my > knowlege > > > > > we have never had any gpl code in the kernel, no have we ever > > > > > allowed it, but thats a seperate argument, that should be made. > > > > > > > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > > > > > > > > I, too, would like less GPL in project, both in userland in kernel. > > > > But, I can understand the desire for gcov. Note that I'm not > > > > advocating either way that FreeBSD perform an action. ;) > > > > > > Didnt we just remove an inbase, compiling BSD licensed chunk of > > > code called DRM and move it to ports. So if that was possible > > > this should be very rapidly applied here and this issue goes away. > > > > > > I am still shaking my head over this one. Yes, there is some > > > expediance to this. Also could it not live on a project > > > branch? Like.. um.. the ZoL project branch? > > > > > > > Thanks, > > > > Shawn Webb > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Tue Feb 26 17:23:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23BEB1520103; Tue, 26 Feb 2019 17:23:59 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA54E8FABA; Tue, 26 Feb 2019 17:23:58 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A839B570C; Tue, 26 Feb 2019 17:23:58 +0000 (UTC) Date: Tue, 26 Feb 2019 17:23:58 +0000 From: Alexey Dokuchaev To: John Baldwin Cc: rgrimes@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec Message-ID: <20190226172358.GA67992@FreeBSD.org> References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> <34ecb52f-c89e-0d5e-594e-25b0d045d171@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34ecb52f-c89e-0d5e-594e-25b0d045d171@FreeBSD.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: BA54E8FABA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:23:59 -0000 On Tue, Feb 26, 2019 at 09:12:11AM -0800, John Baldwin wrote: > On 2/26/19 5:49 AM, Alexey Dokuchaev wrote: > > On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: > >> ... > >> Just a small nit, for future reference, from the template: > >>> Differential Revision: https://reviews.freebsd.org/D### > >> (*full* phabric URL needed). > > > > IMHO we should just fix the scripts to accept D#### alone, without > > the URL. We don't do that for PR (bugzilla) references, and the fact > > that we do for the phab is both needless and confusing. Also, that > > URL might change one day while we could probably keep the old numbers > > if we move. > > It makes the review clickable in many mail clients which is very handy. I understand that, but then again, we don't do that for PRs and people don't seem to complain. Accepting D#### would make this all consistent and commit messages cleaner. Arguably, if one likes to click the URLs in their mail client, why not configure the client to expand the URL in place? > -- > John Baldwin > > \x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a Can you do something about this horde of \x9a's appended to your every email John? ./danfe From owner-svn-src-head@freebsd.org Tue Feb 26 17:26:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75A0F15201C4; Tue, 26 Feb 2019 17:26:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1944A8FC57; Tue, 26 Feb 2019 17:26:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2976B1DA2D; Tue, 26 Feb 2019 17:26:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: "K. Macy" , Brooks Davis Cc: Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201902232114.x1NLE0cH085345@repo.freebsd.org> <20190225175809.GB47081@spindle.one-eyed-alien.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <59e33dc7-cd10-7edd-9ff3-418d3eeef1f2@FreeBSD.org> Date: Tue, 26 Feb 2019 09:26:04 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1944A8FC57 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:26:06 -0000 On 2/25/19 5:11 PM, K. Macy wrote: >> This commit needed more through review. > > How would this be achieved:? I had several people on the review and no > one had substantive feedback. As a developer it is your responsibility to be aware of the policies that we do document. One of the things in the license policy Brooks pointed you at is that adding new GPL code requires core@ sign off. This doesn't mean core@ will say know. It does mean that core@ has to make an explicit decision. (I know Brooks said he intended to update the policy, but in fact it already requires core@ sign off for any new code that isn't following one of the accepted licenses which are all BSD/MIT-style licenses.) -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Feb 26 17:28:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCA9615202DD; Tue, 26 Feb 2019 17:28:56 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) (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 69B188FE27; Tue, 26 Feb 2019 17:28:56 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot1-x342.google.com with SMTP id m1so11793911otf.5; Tue, 26 Feb 2019 09:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=61p1ihfhQhP5HgChIZ7Nk0cwJ9Y+iMzlC+ywDrNjalE=; b=P4R4JZqdexPZpbHKh5H70fhHw01sQRnwjBnIlpW9afdWBfAysYC2XqdwEdCGg6RXkw NNts9vGN9ejlZlSIGLcBPKARaxfXrhCKGNP5ORgfSMT26FldjGWy3PIP3soWGB6gdAV9 bUbY6ITmZ88DE2ldGRUwFLPNlp+Ls3WFYsfwECP+g1Mpn9IwzcJLdJp+1wycBEca7+gj C5NBmuWMwPrAVx5z3lUshareOpJwG5KXm1KRtrRbcAh8wnGEQBMAYq+D8x+iaaYoBttR e6CUEpMvdTd9CTL2i0ZPktIWRwjdk6pCtKpOm5GN4jpu8wkHTkIo6nwNGToxgR68/eMK kwFw== 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=61p1ihfhQhP5HgChIZ7Nk0cwJ9Y+iMzlC+ywDrNjalE=; b=FfM5VPx+bVNslgMZULvbTuGY4PvJ1XgAq/11JbNJxEzWIRowutvpD1howEuCac41Vs S07krayIq6ZVUZTvjpW9IcHJcuPxYfyeelOkZPty/6QTy8TJqH5kKUp23sJPXdmaC88Y iXWHPbz7DGhtu/5azYcYj7BfznQCHtJEZU9gCn2yviQ2JJvW/RAZN4+gTuoe4w3e24cJ M0HyekLqTm63D/qirXQKI7HxEPP/CzjOn13kTMfKOZo8jadR64+vTzZbRmLjwQKNj4R7 f9y2TU3CTa0FcR+FesR2RysE3M8hCVeNadudgg9dq6uNPJI1URT42vNDP3jvCF5OTZiS kh5Q== X-Gm-Message-State: AHQUAuYTAM+61DFvRyZZmLcP/IRknpWO0DPWJt3VcPD5yz8H94STL2Po BxYXYfuYciaFahx0YIK6w9+1sFRFM9YqQCIULoZ+AKCy X-Google-Smtp-Source: AHgI3IaDSdRvYs2/qblzoaE5BiR/Rdzo61/W50+qlY/Wi9zbcdj3o0iCJ+Y6Ze9Wu4epcGWq5ELA4o40+bl9YuuVUWc= X-Received: by 2002:a05:6830:1092:: with SMTP id y18mr16061756oto.125.1551202135450; Tue, 26 Feb 2019 09:28:55 -0800 (PST) MIME-Version: 1.0 References: <201902261659.x1QGxkl0046685@pdx.rh.CN85.dnsmgr.net> <20a4a5ab-f088-537b-8666-e6c6f43170a9@FreeBSD.org> In-Reply-To: <20a4a5ab-f088-537b-8666-e6c6f43170a9@FreeBSD.org> From: Benjamin Kaduk Date: Tue, 26 Feb 2019 11:28:44 -0600 Message-ID: Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: John Baldwin Cc: rgrimes@freebsd.org, Cy Schubert , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 69B188FE27 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.964,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:28:57 -0000 On Tue, Feb 26, 2019 at 11:19 AM John Baldwin wrote: > On 2/26/19 8:59 AM, Rodney W. Grimes wrote: > >> On Tue, Feb 26, 2019 at 10:14 AM Cy Schubert > > >> wrote: > >> > >>> On February 26, 2019 7:48:27 AM PST, Cy Schubert < > >>> Cy.Schubert@cschubert.com> wrote: > >>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > >>>> wrote: > >>> > >> > >> [trimming the unneeded pile of commit body] > >> > >> > >>>> This broke my systems, many filesystems fail to mount causing nullfs > >>>> late mounts to fail. No details now until tonight. > >>>> > >>>> Suggest we back this out until it is properly tested. > >>> > >>> Nested zfs filesystems seem not to be handled properly or possibly not > >>> supported any more. This explains my mail gateway also not mounting all > >>> filesystems in /home. It was odd that dovecot stopped working. > >>> > >>> The symptom of the problem is zfs mount -a no longer mounts all > >>> filesystems. Zfs mount fails saying the filesystem is already mounted. > The > >>> workaround is to zfs umount each affected zfs dataset by hand and zfs > mount > >>> it by hand. > >>> > >>> Generally this has screwed up sites that have hundreds (in my case 122) > >>> zfs datasets. The work around might be to script testing each mount, > >>> unmounting and remounting if necessary. > >>> > >>> I'm being sarcastic about creating an rc script to clean this up. This > >>> needs to be backed out and tested properly before being committed. > >>> > >>> > >> I don't know what you mean by "nested zfs filesystems" -- do you mean a > >> zpool within a zvol? > >> That has been unsupported for a long time, IIRC. And > > That had better not be unsupported, that is the prefered technology > > for all of the virtualization stuff, bhyve, virtualbox, qemu, etc. > > I think Ben is referring to using the nested zpool on the host itself > rather > than in the guest. We do actually let you do such crazy things I think (I > use UFS in my VMs usually and fsck on the host against > /dev/zvol/bhyve/p2 > can be faster than fsck in the booted guest), but normally the host just > hosts > the zvol and the guest manages filesystems in the volume. Mounting the > nested zpool on the host is probably best characterized as running with > scissors. > > Exactly so; thanks for clarifying. -Ben From owner-svn-src-head@freebsd.org Tue Feb 26 17:33:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89CA9152054A; Tue, 26 Feb 2019 17:33:33 +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 0618A68336; Tue, 26 Feb 2019 17:33:32 +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 x1QHXU4Q046906; Tue, 26 Feb 2019 09:33:30 -0800 (PST) (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 x1QHXU0f046905; Tue, 26 Feb 2019 09:33:30 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261733.x1QHXU0f046905@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <59e33dc7-cd10-7edd-9ff3-418d3eeef1f2@FreeBSD.org> To: John Baldwin Date: Tue, 26 Feb 2019 09:33:30 -0800 (PST) CC: "K. Macy" , Brooks Davis , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 0618A68336 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:33:33 -0000 > On 2/25/19 5:11 PM, K. Macy wrote: > >> This commit needed more through review. > > > > How would this be achieved:? I had several people on the review and no > > one had substantive feedback. > > As a developer it is your responsibility to be aware of the policies that > we do document. One of the things in the license policy Brooks pointed you > at is that adding new GPL code requires core@ sign off. This doesn't mean > core@ will say know. It does mean that core@ has to make an explicit > decision. > > (I know Brooks said he intended to update the policy, but in fact it > already requires core@ sign off for any new code that isn't following > one of the accepted licenses which are all BSD/MIT-style licenses.) In defense of K Macy here, the copy of this text in the publically visible committers guide does not say that. Hence my earlier mail about is this text planned as an update to what is in the committers guide. Or can you point me to something in the public area that points at this /internal/license.html file? > -- > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 17:33:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2D6A1520588; Tue, 26 Feb 2019 17:33:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75D1B68450; Tue, 26 Feb 2019 17:33:57 +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 5921086BA; Tue, 26 Feb 2019 17:33:57 +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 x1QHXvGQ055186; Tue, 26 Feb 2019 17:33:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QHXvSm055185; Tue, 26 Feb 2019 17:33:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902261733.x1QHXvSm055185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Feb 2019 17:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344591 - in head/sys/cddl/contrib/opensolaris/uts: aarch64 arm mips riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts: aarch64 arm mips riscv X-SVN-Commit-Revision: 344591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75D1B68450 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:33:58 -0000 Author: markj Date: Tue Feb 26 17:33:56 2019 New Revision: 344591 URL: https://svnweb.freebsd.org/changeset/base/344591 Log: Revert r344587. The fasttrap_isa.h header is needed by libdtrace, not just the kernel. Added: head/sys/cddl/contrib/opensolaris/uts/aarch64/ - copied from r344586, head/sys/cddl/contrib/opensolaris/uts/aarch64/ head/sys/cddl/contrib/opensolaris/uts/arm/ - copied from r344586, head/sys/cddl/contrib/opensolaris/uts/arm/ head/sys/cddl/contrib/opensolaris/uts/mips/ - copied from r344586, head/sys/cddl/contrib/opensolaris/uts/mips/ head/sys/cddl/contrib/opensolaris/uts/riscv/ - copied from r344586, head/sys/cddl/contrib/opensolaris/uts/riscv/ From owner-svn-src-head@freebsd.org Tue Feb 26 17:35:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE041520629; Tue, 26 Feb 2019 17:35:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x131.google.com (mail-it1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 CB3D168671; Tue, 26 Feb 2019 17:35:01 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x131.google.com with SMTP id m137so5106999ita.0; Tue, 26 Feb 2019 09:35:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Cc2Bo84r1nn6SCHyddEBg2k4+IiDixYqNQmvnVKnEg=; b=lnzcUERXo+1NsweqZ60b9U/0mJ5MrqMNZ3mu5BNvrL5mRtPB3Twir15ksFo3y+5MF+ 70zKxMdVIWDC5z8KVt96MYJemnMZpaD8bG6n1KPyKU1zK+Z9CL8qYovaNm0vefjElLmN mqw08SpmaWoiWl8dnNKvLSZ+X/VXnzOl/ypKdapKSxvCHKC9xIM9NbUZb54WaCavo3Eh QmuJjAmnuotlr2YQpz9GTrcYlOqRQhWriUQdea25ZsHB9uJ9efYCvfrJgqrEofkC8jsA H+G4NfXcMohWkchwbAbk/eyHBt9S5kXDdOqq9pQqZhg2eLhHzR7L4ISs485wfaOclqL5 XanA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Cc2Bo84r1nn6SCHyddEBg2k4+IiDixYqNQmvnVKnEg=; b=NIrsFdx/1vJfB0fCx7krw/tl2SdCnRcMOduWwsrUuTuXDcm4nloQ39SB7gd+VoBsvC NmjtRiHBGFSqvoTmrm0SHoI3jCOlnnWuZrlY52rg5N5Vi3CRKUzIRMZqL2U9grQNpv3i b7myvpPD4xrk7YnKVaCtN6bO5egG5v+QdoTJZL9EtGn9nSr45GtrA2f2JEpYnesoFR0+ hRDoL9L6tPuYtB2pW288CH/fPWROJyAbePbcMzbYCxMDLwsveK9aTuREPJgBmsFlDLLg q6TaikLTewqtItn/zNla+qodI8xhvYmbXNz9btQ+g9yEy1dW8kJhqPY3NoEmnPST2099 Knmw== X-Gm-Message-State: AHQUAubE9ss7j9juGRQKPUst77Gu7/A0aCo7f+sap4ph7LIOkFB2GmT1 U4omCScPi2ySVI1ZYXImRC85MZV1iBo= X-Google-Smtp-Source: APXvYqwqbyqZKjKeG3TZe8wzFEY/qPPFbFE6V1YuC+0Qkkso+1IPfKP9XoTxdIcSXCvQBhc8yuHVNQ== X-Received: by 2002:a24:7d84:: with SMTP id b126mr3130646itc.58.1551202500570; Tue, 26 Feb 2019 09:35:00 -0800 (PST) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id u197sm28479itb.9.2019.02.26.09.34.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 09:35:00 -0800 (PST) Date: Tue, 26 Feb 2019 11:34:55 -0600 From: Justin Hibbits To: Alexey Dokuchaev Cc: John Baldwin , rgrimes@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec Message-ID: <20190226113455.0306a593@ralga.knownspace> In-Reply-To: <20190226172358.GA67992@FreeBSD.org> References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> <34ecb52f-c89e-0d5e-594e-25b0d045d171@FreeBSD.org> <20190226172358.GA67992@FreeBSD.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: CB3D168671 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:35:02 -0000 On Tue, 26 Feb 2019 17:23:58 +0000 Alexey Dokuchaev wrote: > On Tue, Feb 26, 2019 at 09:12:11AM -0800, John Baldwin wrote: > > It makes the review clickable in many mail clients which is very > > handy. > > I understand that, but then again, we don't do that for PRs and people > don't seem to complain. Accepting D#### would make this all > consistent and commit messages cleaner. Arguably, if one likes to > click the URLs in their mail client, why not configure the client to > expand the URL in place? > > > ./danfe > I, personally, would love it if the PR listed in emails was a clickable link. Or, even, if in viewvc the PR was a clickable link. That might be easier to do, since we wouldn't need to worry about links going stale to the bugtracker-of-the-year. - Justin From owner-svn-src-head@freebsd.org Tue Feb 26 17:35:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D4C01520666; Tue, 26 Feb 2019 17:35:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0852699C2; Tue, 26 Feb 2019 17:35:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36C7E86BD; Tue, 26 Feb 2019 17:35:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QHZ6Zx055289; Tue, 26 Feb 2019 17:35:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QHZ6eU055288; Tue, 26 Feb 2019 17:35:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902261735.x1QHZ6eU055288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Feb 2019 17:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344592 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 344592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0852699C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:35:08 -0000 Author: kib Date: Tue Feb 26 17:35:06 2019 New Revision: 344592 URL: https://svnweb.freebsd.org/changeset/base/344592 Log: procctl(2): fix -width parameter to .Bl. According to 0mp, macros are not expanded in the argument provided to -width. Use plain identifiers for width specification. Noted and reviewed by: 0mp Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D19308 Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Tue Feb 26 17:33:56 2019 (r344591) +++ head/lib/libc/sys/procctl.2 Tue Feb 26 17:35:06 2019 (r344592) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2018 +.Dd February 23, 2019 .Dt PROCCTL 2 .Os .Sh NAME @@ -58,7 +58,7 @@ to control as many of the selected processes as possib An error is only returned if no selected processes successfully complete the request. The following identifier types are supported: -.Bl -tag -width "Dv P_PGID" +.Bl -tag -width P_PGID .It Dv P_PID Control the process with the process ID .Fa id . @@ -71,7 +71,7 @@ The control request to perform is specified by the .Fa cmd argument. The following commands are supported: -.Bl -tag -width "Dv PROC_TRAPCAP_STATUS" +.Bl -tag -width PROC_TRAPCAP_STATUS .It Dv PROC_SPROTECT Set process protection state. This is used to mark a process as protected from being killed if the system @@ -81,7 +81,7 @@ The parameter must point to an integer containing an operation and zero or more optional flags. The following operations are supported: -.Bl -tag -width "Dv PPROT_CLEAR" +.Bl -tag -width PPROT_CLEAR .It Dv PPROT_SET Mark the selected processes as protected. .It Dv PPROT_CLEAR @@ -89,7 +89,7 @@ Clear the protected state of selected processes. .El .Pp The following optional flags are supported: -.Bl -tag -width "Dv PPROT_DESCEND" +.Bl -tag -width PPROT_DESCEND .It Dv PPROT_DESCEND Apply the requested operation to all child processes of each selected process in addition to each selected process. @@ -131,7 +131,7 @@ struct procctl_reaper_status { The .Fa rs_flags may have the following flags returned: -.Bl -tag -width "Dv REAPER_STATUS_REALINIT" +.Bl -tag -width REAPER_STATUS_REALINIT .It Dv REAPER_STATUS_OWNED The specified process has acquired reaper status and has not released it. @@ -211,7 +211,7 @@ of the process. The .Fa pi_flags field returns the following flags, further describing the descendant: -.Bl -tag -width "Dv REAPER_PIDINFO_REAPER" +.Bl -tag -width REAPER_PIDINFO_REAPER .It Dv REAPER_PIDINFO_VALID Set to indicate that the .Vt procctl_reaper_pidinfo @@ -255,7 +255,7 @@ The .Fa rk_flags field further directs the operation. It is or-ed from the following flags: -.Bl -tag -width "Dv REAPER_KILL_CHILDREN" +.Bl -tag -width REAPER_KILL_CHILDREN .It Dv REAPER_KILL_CHILDREN Deliver the specified signal only to direct children of the reaper. .It Dv REAPER_KILL_SUBTREE @@ -296,7 +296,7 @@ and core dumping. Possible values for the .Fa data argument are: -.Bl -tag -width "Dv PROC_TRACE_CTL_DISABLE_EXEC" +.Bl -tag -width PROC_TRACE_CTL_DISABLE_EXEC .It Dv PROC_TRACE_CTL_ENABLE Enable tracing, after it was disabled by .Dv PROC_TRACE_CTL_DISABLE . @@ -346,7 +346,7 @@ signal to the thread immediately before returning from Possible values for the .Fa data argument are: -.Bl -tag -width "Dv PROC_TRAPCAP_CTL_DISABLE" +.Bl -tag -width PROC_TRAPCAP_CTL_DISABLE .It Dv PROC_TRAPCAP_CTL_ENABLE Enable the .Dv SIGTRAP From owner-svn-src-head@freebsd.org Tue Feb 26 17:37:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7796F15207E7; Tue, 26 Feb 2019 17:37:29 +0000 (UTC) (envelope-from fatih.acar@gandi.net) Received: from gandi.net (mail12.gandi.net [217.70.182.73]) (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 CB9D369D1B; Tue, 26 Feb 2019 17:37:28 +0000 (UTC) (envelope-from fatih.acar@gandi.net) Received: from [217.70.181.46] (fatih.gandi.net [217.70.181.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by gandi.net (Postfix) with ESMTPSA id A46631604B8; Tue, 26 Feb 2019 17:37:25 +0000 (UTC) Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Cy Schubert , Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fatih@gandi.net References: <201902260818.x1Q8IZGO061175@repo.freebsd.org> <39F76FF0-B40A-43F9-AC77-5D535674A4B8@cschubert.com> <20190226160411.kutpzjltiqm4bfgb@ivaldir.net> <20190226161131.6rb3slb5slhkomwz@ivaldir.net> <44EBCB1E-4872-429A-A967-FA24CC299A5D@cschubert.com> From: Fatih Acar Openpgp: preference=signencrypt Autocrypt: addr=fatih.acar@gandi.net; prefer-encrypt=mutual; keydata= xsBNBFU9/MABCADo4vMvEOhUTC652Ug8TWmDET/+0CSP/nP2Fd97Oyg5kIliFh1+LJXXwrav QnBV2fHFc2dWD49q6SOdcxrTvoLy1FTPtl0LKDmVcXuufNPKY/APt8+fZATuWqI5NXqzdehe iPaQOpgXeJiq467TEA1MqT3ajsH/jhpoigaodJfFnpLnYygdf5WMdAuTtzYF5r0ykJ0V/Irk /Jyh1svSHC/vp2NoTDV5sHp5j74cylHzswOw+i6l7oiRxMcSt8rUKnJ4u+8XzxG0MjDA4s6P MSoI3W4XjPQjRadQOHt2rCEHAOzcvqdYFIGK9shRRT+irlCRpHg1chKrBzxc8/tEqcvbABEB AAHNIUZhdGloIEFDQVIgPGZhdGloLmFjYXJAZ2FuZGkubmV0PsLAeAQTAQIAIgUCVT38wAIb AwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQxI3TLcWT03OqPQgAgmHk8l4qZ/zfyIbB DlxQpxgA28kgsB0n8LXLXgxfBsZdoMOSYS2oHvrVzM8ZbM8h6g3GYWJfz82gwOty7T842Stk lkDcEb8tv3bZr0KR01FgtpYApvDWvSOuvTyttzoUT/MbOdGAl8/9gsysghSyKGIbqK4wtApf HxI5RLA2OwqPKl8BrVVbYTBrvmFqqxMthn9EOSAbJp2WlZLKmfnkoyufXaWQgNqEogE0NqcJ qVirNECv/h701VQ2exMz8KOiie0PTEL0m19SFCX5ZtilxgzZmPDm4DEtAHPzVRCAtsi6apZk 7BN3fvvrSO8gHicF523PGyYWeaTJkKy/fAenGc7ATQRVPfzAAQgAxiWQWkB1qXMAdDpneC1G LEajyH7SsbA+rTYDbDWog6d2HrEjJv0pO/nqFzpd5fWoKIxOWWhEliZHmZXO/DhImaiWuSf2 IreU8FQokJfSI14Dv3Bz0Ugk8o6vXh0I8k1gOTAfk2Pou/tXU8ZkDEug3kS2gc1DcCDDghuP mPP+trK3FnG/FcxDP/vIPshq9+akjgGRA6dghiFXMWRAajKwo29WuVZJkiJUAdontLE7/PNx BeKtUsh+SbEdjbfSdigZV4EWIXMhqKU223dBG5XoNbryQi4d6MUneCPYGNAlLE/RJIB3ECeu is6ZHWZK3IprtVtFjr9fvG68eOZWAAWx5QARAQABwsBfBBgBAgAJBQJVPfzAAhsMAAoJEMSN 0y3Fk9NzP7gH/3KW+VkC6Qmf3vK9Q4aZkRTSG/HQ+LujcU9WAI1iPXSZpzk9zZLPDfGSzJQp 1kkuWyO4UDY5DiFAPgZb9Uj0ikj0EH23ULMBjmH+AAWqbYXeCgBP+4mvyOTi2B7iVLpCCIuW bGHRrfnEfnLDWSr4s1TQs1XKFgxwQ3GchACXxXyWq9LcFi022hrL2krxN7JPU3UWrqk/JqYi Bqoc+xggovv0DJwxHBHVIy+4tBdlilfzOIR+1ctuzxUMsUwiTFrvxtVogSmdeB6vVC4s2it5 jG8QzswAKPtrduDxSHrGkV3Qvx/N5ah115w4lwEM9vy1lVZvXjvICCYIDr3Z221+2fg= Message-ID: Date: Tue, 26 Feb 2019 18:37:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Thunderbird/57.0 MIME-Version: 1.0 In-Reply-To: <44EBCB1E-4872-429A-A967-FA24CC299A5D@cschubert.com> Content-Type: multipart/mixed; boundary="------------6A54CE5B28D823DCB8C41577" Content-Language: en-US X-Rspamd-Queue-Id: CB9D369D1B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:37:29 -0000 This is a multi-part message in MIME format. --------------6A54CE5B28D823DCB8C41577 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 2/26/19 5:36 PM, Cy Schubert wrote: > On February 26, 2019 8:11:31 AM PST, Baptiste Daroussin wrote: >> On Tue, Feb 26, 2019 at 05:04:11PM +0100, Baptiste Daroussin wrote: >>> On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: >>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin >> wrote: >>>>> Author: bapt >>>>> Date: Tue Feb 26 08:18:34 2019 >>>>> New Revision: 344569 >>>>> URL: https://svnweb.freebsd.org/changeset/base/344569 >>>>> >>>>> Log: >>>>> Implement parallel mounting for ZFS filesystem >>>>> >>>>> It was first implemented on Illumos and then ported to ZoL. >>>>> This patch is a port to FreeBSD of the ZoL version. >>>>> This patch also includes a fix for a race condition that was >> amended >>>>> >>>>> With such patch Delphix has seen a huge decrease in latency of the >>>>> mount phase >>>>> (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for >> details). >>>>> With that current change Gandi has measured improvments that are >> on par >>>>> with >>>>> those reported by Delphix. >>>>> >>>>> Zol commits incorporated: >>>> >>> https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70c9c9e303 >>>> >>> https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077567dfea21 >>>>> >>>>> Reviewed by: avg, sef >>>>> Approved by: avg, sef >>>>> Obtained from: ZoL >>>>> MFC after: 1 month >>>>> Relnotes: yes >>>>> Sponsored by: Gandi.net >>>>> Differential Revision: https://reviews.freebsd.org/D19098 >>>>> >>>>> Modified: >>>>> head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c >>>>> >>>>> Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c >>>> >>> ============================================================================== >>>>> --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 >>>>> 06:22:10 2019 (r344568) >>>>> +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 >>>>> 08:18:34 2019 (r344569) >>>>> @@ -5812,8 +5812,13 @@ zfs_do_holds(int argc, char **argv) >>>>> >>>>> #define CHECK_SPINNER 30 >>>>> #define SPINNER_TIME 3 /* seconds */ >>>>> -#define MOUNT_TIME 5 /* seconds */ >>>>> +#define MOUNT_TIME 1 /* seconds */ >>>>> >>>>> +typedef struct get_all_state { >>>>> + boolean_t ga_verbose; >>>>> + get_all_cb_t *ga_cbp; >>>>> +} get_all_state_t; >>>>> + >>>>> static int >>>>> get_one_dataset(zfs_handle_t *zhp, void *data) >>>>> { >>>>> @@ -5821,10 +5826,10 @@ get_one_dataset(zfs_handle_t *zhp, void >> *data) >>>>> static int spinval = 0; >>>>> static int spincheck = 0; >>>>> static time_t last_spin_time = (time_t)0; >>>>> - get_all_cb_t *cbp = data; >>>>> + get_all_state_t *state = data; >>>>> zfs_type_t type = zfs_get_type(zhp); >>>>> >>>>> - if (cbp->cb_verbose) { >>>>> + if (state->ga_verbose) { >>>>> if (--spincheck < 0) { >>>>> time_t now = time(NULL); >>>>> if (last_spin_time + SPINNER_TIME < now) { >>>>> @@ -5850,26 +5855,24 @@ get_one_dataset(zfs_handle_t *zhp, void >> *data) >>>>> zfs_close(zhp); >>>>> return (0); >>>>> } >>>>> - libzfs_add_handle(cbp, zhp); >>>>> - assert(cbp->cb_used <= cbp->cb_alloc); >>>>> + libzfs_add_handle(state->ga_cbp, zhp); >>>>> + assert(state->ga_cbp->cb_used <= state->ga_cbp->cb_alloc); >>>>> >>>>> return (0); >>>>> } >>>>> >>>>> static void >>>>> -get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t >>>>> verbose) >>>>> +get_all_datasets(get_all_cb_t *cbp, boolean_t verbose) >>>>> { >>>>> - get_all_cb_t cb = { 0 }; >>>>> - cb.cb_verbose = verbose; >>>>> - cb.cb_getone = get_one_dataset; >>>>> + get_all_state_t state = { >>>>> + .ga_verbose = verbose, >>>>> + .ga_cbp = cbp >>>>> + }; >>>>> >>>>> if (verbose) >>>>> set_progress_header(gettext("Reading ZFS config")); >>>>> - (void) zfs_iter_root(g_zfs, get_one_dataset, &cb); >>>>> + (void) zfs_iter_root(g_zfs, get_one_dataset, &state); >>>>> >>>>> - *dslist = cb.cb_handles; >>>>> - *count = cb.cb_used; >>>>> - >>>>> if (verbose) >>>>> finish_progress(gettext("done.")); >>>>> } >>>>> @@ -5879,9 +5882,20 @@ get_all_datasets(zfs_handle_t ***dslist, >> size_t >>>>> *count >>>>> * similar, we have a common function with an extra parameter to >>>>> determine which >>>>> * mode we are using. >>>>> */ >>>>> -#define OP_SHARE 0x1 >>>>> -#define OP_MOUNT 0x2 >>>>> +typedef enum { OP_SHARE, OP_MOUNT } share_mount_op_t; >>>>> >>>>> +typedef struct share_mount_state { >>>>> + share_mount_op_t sm_op; >>>>> + boolean_t sm_verbose; >>>>> + int sm_flags; >>>>> + char *sm_options; >>>>> + char *sm_proto; /* only valid for OP_SHARE */ >>>>> + pthread_mutex_t sm_lock; /* protects the remaining fields */ >>>>> + uint_t sm_total; /* number of filesystems to process */ >>>>> + uint_t sm_done; /* number of filesystems processed */ >>>>> + int sm_status; /* -1 if any of the share/mount operations failed >> */ >>>>> +} share_mount_state_t; >>>>> + >>>>> /* >>>>> * Share or mount a dataset. >>>>> */ >>>>> @@ -6122,6 +6136,29 @@ report_mount_progress(int current, int >> total) >>>>> update_progress(info); >>>>> } >>>>> >>>>> +/* >>>>> + * zfs_foreach_mountpoint() callback that mounts or shares on >>>>> filesystem and >>>>> + * updates the progress meter >>>>> + */ >>>>> +static int >>>>> +share_mount_one_cb(zfs_handle_t *zhp, void *arg) >>>>> +{ >>>>> + share_mount_state_t *sms = arg; >>>>> + int ret; >>>>> + >>>>> + ret = share_mount_one(zhp, sms->sm_op, sms->sm_flags, >> sms->sm_proto, >>>>> + B_FALSE, sms->sm_options); >>>>> + >>>>> + pthread_mutex_lock(&sms->sm_lock); >>>>> + if (ret != 0) >>>>> + sms->sm_status = ret; >>>>> + sms->sm_done++; >>>>> + if (sms->sm_verbose) >>>>> + report_mount_progress(sms->sm_done, sms->sm_total); >>>>> + pthread_mutex_unlock(&sms->sm_lock); >>>>> + return (ret); >>>>> +} >>>>> + >>>>> static void >>>>> append_options(char *mntopts, char *newopts) >>>>> { >>>>> @@ -6194,8 +6231,6 @@ share_mount(int op, int argc, char **argv) >>>>> >>>>> /* check number of arguments */ >>>>> if (do_all) { >>>>> - zfs_handle_t **dslist = NULL; >>>>> - size_t i, count = 0; >>>>> char *protocol = NULL; >>>>> >>>>> if (op == OP_SHARE && argc > 0) { >>>>> @@ -6216,35 +6251,48 @@ share_mount(int op, int argc, char **argv) >>>>> } >>>>> >>>>> start_progress_timer(); >>>>> - get_all_datasets(&dslist, &count, verbose); >>>>> + get_all_cb_t cb = { 0 }; >>>>> + get_all_datasets(&cb, verbose); >>>>> >>>>> - if (count == 0) >>>>> + if (cb.cb_used == 0) { >>>>> + if (options != NULL) >>>>> + free(options); >>>>> return (0); >>>>> + } >>>>> >>>>> - qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp); >>>>> #ifdef illumos >>>>> - sa_init_selective_arg_t sharearg; >>>>> - sharearg.zhandle_arr = dslist; >>>>> - sharearg.zhandle_len = count; >>>>> - if ((ret = zfs_init_libshare_arg(zfs_get_handle(dslist[0]), >>>>> - SA_INIT_SHARE_API_SELECTIVE, &sharearg)) != SA_OK) { >>>>> - (void) fprintf(stderr, >>>>> - gettext("Could not initialize libshare, %d"), ret); >>>>> - return (ret); >>>>> + if (op == OP_SHARE) { >>>>> + sa_init_selective_arg_t sharearg; >>>>> + sharearg.zhandle_arr = cb.cb_handles; >>>>> + sharearg.zhandle_len = cb.cb_used; >>>>> + if ((ret = zfs_init_libshare_arg(g_zfs, >>>>> + SA_INIT_SHARE_API_SELECTIVE, &sharearg)) != SA_OK) { >>>>> + (void) fprintf(stderr, gettext( >>>>> + "Could not initialize libshare, %d"), ret); >>>>> + return (ret); >>>>> + } >>>>> } >>>>> #endif >>>>> + share_mount_state_t share_mount_state = { 0 }; >>>>> + share_mount_state.sm_op = op; >>>>> + share_mount_state.sm_verbose = verbose; >>>>> + share_mount_state.sm_flags = flags; >>>>> + share_mount_state.sm_options = options; >>>>> + share_mount_state.sm_proto = protocol; >>>>> + share_mount_state.sm_total = cb.cb_used; >>>>> + pthread_mutex_init(&share_mount_state.sm_lock, NULL); >>>>> >>>>> - for (i = 0; i < count; i++) { >>>>> - if (verbose) >>>>> - report_mount_progress(i, count); >>>>> + /* >>>>> + * libshare isn't mt-safe, so only do the operation in parallel >>>>> + * if we're mounting. >>>>> + */ >>>>> + zfs_foreach_mountpoint(g_zfs, cb.cb_handles, cb.cb_used, >>>>> + share_mount_one_cb, &share_mount_state, op == OP_MOUNT); >>>>> + ret = share_mount_state.sm_status; >>>>> >>>>> - if (share_mount_one(dslist[i], op, flags, protocol, >>>>> - B_FALSE, options) != 0) >>>>> - ret = 1; >>>>> - zfs_close(dslist[i]); >>>>> - } >>>>> - >>>>> - free(dslist); >>>>> + for (int i = 0; i < cb.cb_used; i++) >>>>> + zfs_close(cb.cb_handles[i]); >>>>> + free(cb.cb_handles); >>>>> } else if (argc == 0) { >>>>> struct mnttab entry; >>>>> >>>>> >>>>> Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h >>>> >>> ============================================================================== >>>>> --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue >> Feb 26 >>>>> 06:22:10 2019 (r344568) >>>>> +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue >> Feb 26 >>>>> 08:18:34 2019 (r344569) >>>>> @@ -579,12 +579,12 @@ typedef struct get_all_cb { >>>>> zfs_handle_t **cb_handles; >>>>> size_t cb_alloc; >>>>> size_t cb_used; >>>>> - boolean_t cb_verbose; >>>>> - int (*cb_getone)(zfs_handle_t *, void *); >>>>> } get_all_cb_t; >>>>> >>>>> +void zfs_foreach_mountpoint(libzfs_handle_t *, zfs_handle_t **, >>>>> size_t, >>>>> + zfs_iter_f, void*, boolean_t); >>>>> + >>>>> void libzfs_add_handle(get_all_cb_t *, zfs_handle_t *); >>>>> -int libzfs_dataset_cmp(const void *, const void *); >>>>> >>>>> /* >>>>> * Functions to create and destroy datasets. >>>>> >>>>> Modified: >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c >>>> >>> ============================================================================== >>>>> --- >>>> >>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue >>>>> Feb 26 06:22:10 2019 (r344568) >>>>> +++ >>>> >>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue >>>>> Feb 26 08:18:34 2019 (r344569) >>>>> @@ -799,6 +799,7 @@ libzfs_mnttab_cache_compare(const void *arg1, >> const >>>>> vo >>>>> void >>>>> libzfs_mnttab_init(libzfs_handle_t *hdl) >>>>> { >>>>> + pthread_mutex_init(&hdl->libzfs_mnttab_cache_lock, NULL); >>>>> assert(avl_numnodes(&hdl->libzfs_mnttab_cache) == 0); >>>>> avl_create(&hdl->libzfs_mnttab_cache, >> libzfs_mnttab_cache_compare, >>>>> sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node)); >>>>> @@ -839,6 +840,7 @@ libzfs_mnttab_fini(libzfs_handle_t *hdl) >>>>> free(mtn); >>>>> } >>>>> avl_destroy(&hdl->libzfs_mnttab_cache); >>>>> + (void) pthread_mutex_destroy(&hdl->libzfs_mnttab_cache_lock); >>>>> } >>>>> >>>>> void >>>>> @@ -853,6 +855,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >> char >>>>> *f >>>>> { >>>>> mnttab_node_t find; >>>>> mnttab_node_t *mtn; >>>>> + int ret = ENOENT; >>>>> >>>>> if (!hdl->libzfs_mnttab_enable) { >>>>> struct mnttab srch = { 0 }; >>>>> @@ -868,6 +871,7 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, const >> char >>>>> *f >>>>> return (ENOENT); >>>>> } >>>>> >>>>> + pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >>>>> if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0) >>>>> libzfs_mnttab_update(hdl); >>>>> >>>>> @@ -875,9 +879,10 @@ libzfs_mnttab_find(libzfs_handle_t *hdl, >> const >>>>> char *f >>>>> mtn = avl_find(&hdl->libzfs_mnttab_cache, &find, NULL); >>>>> if (mtn) { >>>>> *entry = mtn->mtn_mt; >>>>> - return (0); >>>>> + ret = 0; >>>>> } >>>>> - return (ENOENT); >>>>> + pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >>>>> + return (ret); >>>>> } >>>>> >>>>> void >>>>> @@ -886,15 +891,17 @@ libzfs_mnttab_add(libzfs_handle_t *hdl, >> const >>>>> char *sp >>>>> { >>>>> mnttab_node_t *mtn; >>>>> >>>>> - if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0) >>>>> - return; >>>>> - mtn = zfs_alloc(hdl, sizeof (mnttab_node_t)); >>>>> - mtn->mtn_mt.mnt_special = zfs_strdup(hdl, special); >>>>> - mtn->mtn_mt.mnt_mountp = zfs_strdup(hdl, mountp); >>>>> - mtn->mtn_mt.mnt_fstype = zfs_strdup(hdl, MNTTYPE_ZFS); >>>>> - mtn->mtn_mt.mnt_mntopts = zfs_strdup(hdl, mntopts); >>>>> - avl_add(&hdl->libzfs_mnttab_cache, mtn); >>>>> -} >>>>> + pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >>>>> + if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0) { >>>>> + mtn = zfs_alloc(hdl, sizeof (mnttab_node_t)); >>>>> + mtn->mtn_mt.mnt_special = zfs_strdup(hdl, special); >>>>> + mtn->mtn_mt.mnt_mountp = zfs_strdup(hdl, mountp); >>>>> + mtn->mtn_mt.mnt_fstype = zfs_strdup(hdl, MNTTYPE_ZFS); >>>>> + mtn->mtn_mt.mnt_mntopts = zfs_strdup(hdl, mntopts); >>>>> + avl_add(&hdl->libzfs_mnttab_cache, mtn); >>>>> + } >>>>> + pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >>>>> +} >>>>> >>>>> void >>>>> libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname) >>>>> @@ -902,6 +909,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, >> const >>>>> char >>>>> mnttab_node_t find; >>>>> mnttab_node_t *ret; >>>>> >>>>> + pthread_mutex_lock(&hdl->libzfs_mnttab_cache_lock); >>>>> find.mtn_mt.mnt_special = (char *)fsname; >>>>> if ((ret = avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, >> NULL)) >>>>> != NULL) { >>>>> @@ -912,6 +920,7 @@ libzfs_mnttab_remove(libzfs_handle_t *hdl, >> const >>>>> char >>>>> free(ret->mtn_mt.mnt_mntopts); >>>>> free(ret); >>>>> } >>>>> + pthread_mutex_unlock(&hdl->libzfs_mnttab_cache_lock); >>>>> } >>>>> >>>>> int >>>>> >>>>> Modified: >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h >>>> >>> ============================================================================== >>>>> --- >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue >>>>> Feb 26 06:22:10 2019 (r344568) >>>>> +++ >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Tue >>>>> Feb 26 08:18:34 2019 (r344569) >>>>> @@ -22,7 +22,7 @@ >>>>> /* >>>>> * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All >> rights >>>>> reserved. >>>>> * Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved. >>>>> - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. >>>>> + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. >>>>> * Copyright (c) 2013 Martin Matuska . All rights >>>>> reserved. >>>>> */ >>>>> >>>>> @@ -73,6 +73,13 @@ struct libzfs_handle { >>>>> int libzfs_storeerr; /* stuff error messages into buffer */ >>>>> void *libzfs_sharehdl; /* libshare handle */ >>>>> boolean_t libzfs_mnttab_enable; >>>>> + /* >>>>> + * We need a lock to handle the case where parallel mount >>>>> + * threads are populating the mnttab cache simultaneously. The >>>>> + * lock only protects the integrity of the avl tree, and does >>>>> + * not protect the contents of the mnttab entries themselves. >>>>> + */ >>>>> + pthread_mutex_t libzfs_mnttab_cache_lock; >>>>> avl_tree_t libzfs_mnttab_cache; >>>>> int libzfs_pool_iter; >>>>> libzfs_fru_t **libzfs_fru_hash; >>>>> >>>>> Modified: >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c >>>> >>> ============================================================================== >>>>> --- >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue >>>>> Feb 26 06:22:10 2019 (r344568) >>>>> +++ >> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Tue >>>>> Feb 26 08:18:34 2019 (r344569) >>>>> @@ -26,6 +26,7 @@ >>>>> * Copyright 2016 Igor Kozhukhov >>>>> * Copyright 2017 Joyent, Inc. >>>>> * Copyright 2017 RackTop Systems. >>>>> + * Copyright 2018 OmniOS Community Edition (OmniOSce) >> Association. >>>>> */ >>>>> >>>>> /* >>>>> @@ -34,25 +35,25 @@ >>>>> * they are used by mount and unmount and when changing a >> filesystem's >>>>> * mountpoint. >>>>> * >>>>> - * zfs_is_mounted() >>>>> - * zfs_mount() >>>>> - * zfs_unmount() >>>>> - * zfs_unmountall() >>>>> + * zfs_is_mounted() >>>>> + * zfs_mount() >>>>> + * zfs_unmount() >>>>> + * zfs_unmountall() >>>>> * >>>>> * This file also contains the functions used to manage sharing >>>>> filesystems via >>>>> * NFS and iSCSI: >>>>> * >>>>> - * zfs_is_shared() >>>>> - * zfs_share() >>>>> - * zfs_unshare() >>>>> + * zfs_is_shared() >>>>> + * zfs_share() >>>>> + * zfs_unshare() >>>>> * >>>>> - * zfs_is_shared_nfs() >>>>> - * zfs_is_shared_smb() >>>>> - * zfs_share_proto() >>>>> - * zfs_shareall(); >>>>> - * zfs_unshare_nfs() >>>>> - * zfs_unshare_smb() >>>>> - * zfs_unshareall_nfs() >>>>> + * zfs_is_shared_nfs() >>>>> + * zfs_is_shared_smb() >>>>> + * zfs_share_proto() >>>>> + * zfs_shareall(); >>>>> + * zfs_unshare_nfs() >>>>> + * zfs_unshare_smb() >>>>> + * zfs_unshareall_nfs() >>>>> * zfs_unshareall_smb() >>>>> * zfs_unshareall() >>>>> * zfs_unshareall_bypath() >>>>> @@ -60,8 +61,8 @@ >>>>> * The following functions are available for pool consumers, and >> will >>>>> * mount/unmount and share/unshare all datasets within pool: >>>>> * >>>>> - * zpool_enable_datasets() >>>>> - * zpool_disable_datasets() >>>>> + * zpool_enable_datasets() >>>>> + * zpool_disable_datasets() >>>>> */ >>>>> >>>>> #include >>>>> @@ -83,10 +84,14 @@ >>>>> #include >>>>> >>>>> #include "libzfs_impl.h" >>>>> +#include >>>>> >>>>> #include >>>>> #define MAXISALEN 257 /* based on sysinfo(2) man page */ >>>>> >>>>> +static int mount_tp_nthr = 512; /* tpool threads for >> multi-threaded >>>>> mounting */ >>>>> + >>>>> +static void zfs_mount_task(void *); >>>>> static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *); >>>>> zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **, >>>>> zfs_share_proto_t); >>>>> @@ -1134,25 +1139,32 @@ remove_mountpoint(zfs_handle_t *zhp) >>>>> } >>>>> } >>>>> >>>>> +/* >>>>> + * Add the given zfs handle to the cb_handles array, dynamically >>>>> reallocating >>>>> + * the array if it is out of space >>>>> + */ >>>>> void >>>>> libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp) >>>>> { >>>>> if (cbp->cb_alloc == cbp->cb_used) { >>>>> size_t newsz; >>>>> - void *ptr; >>>>> + zfs_handle_t **newhandles; >>>>> >>>>> - newsz = cbp->cb_alloc ? cbp->cb_alloc * 2 : 64; >>>>> - ptr = zfs_realloc(zhp->zfs_hdl, >>>>> - cbp->cb_handles, cbp->cb_alloc * sizeof (void *), >>>>> - newsz * sizeof (void *)); >>>>> - cbp->cb_handles = ptr; >>>>> + newsz = cbp->cb_alloc != 0 ? cbp->cb_alloc * 2 : 64; >>>>> + newhandles = zfs_realloc(zhp->zfs_hdl, >>>>> + cbp->cb_handles, cbp->cb_alloc * sizeof (zfs_handle_t *), >>>>> + newsz * sizeof (zfs_handle_t *)); >>>>> + cbp->cb_handles = newhandles; >>>>> cbp->cb_alloc = newsz; >>>>> } >>>>> cbp->cb_handles[cbp->cb_used++] = zhp; >>>>> } >>>>> >>>>> +/* >>>>> + * Recursive helper function used during file system enumeration >>>>> + */ >>>>> static int >>>>> -mount_cb(zfs_handle_t *zhp, void *data) >>>>> +zfs_iter_cb(zfs_handle_t *zhp, void *data) >>>>> { >>>>> get_all_cb_t *cbp = data; >>>>> >>>>> @@ -1178,104 +1190,362 @@ mount_cb(zfs_handle_t *zhp, void *data) >>>>> } >>>>> >>>>> libzfs_add_handle(cbp, zhp); >>>>> - if (zfs_iter_filesystems(zhp, mount_cb, cbp) != 0) { >>>>> + if (zfs_iter_filesystems(zhp, zfs_iter_cb, cbp) != 0) { >>>>> zfs_close(zhp); >>>>> return (-1); >>>>> } >>>>> return (0); >>>>> } >>>>> >>>>> -int >>>>> -libzfs_dataset_cmp(const void *a, const void *b) >>>>> +/* >>>>> + * Sort comparator that compares two mountpoint paths. We sort >> these >>>>> paths so >>>>> + * that subdirectories immediately follow their parents. This >> means >>>>> that we >>>>> + * effectively treat the '/' character as the lowest value >> non-nul >>>>> char. >>>>> + * Since filesystems from non-global zones can have the same >>>>> mountpoint >>>>> + * as other filesystems, the comparator sorts global zone >> filesystems >>>>> to >>>>> + * the top of the list. This means that the global zone will >> traverse >>>>> the >>>>> + * filesystem list in the correct order and can stop when it sees >> the >>>>> + * first zoned filesystem. In a non-global zone, only the >> delegated >>>>> + * filesystems are seen. >>>>> + * >>>>> + * An example sorted list using this comparator would look like: >>>>> + * >>>>> + * /foo >>>>> + * /foo/bar >>>>> + * /foo/bar/baz >>>>> + * /foo/baz >>>>> + * /foo.bar >>>>> + * /foo (NGZ1) >>>>> + * /foo (NGZ2) >>>>> + * >>>>> + * The mount code depend on this ordering to deterministically >> iterate >>>>> + * over filesystems in order to spawn parallel mount tasks. >>>>> + */ >>>>> +static int >>>>> +mountpoint_cmp(const void *arga, const void *argb) >>>>> { >>>>> - zfs_handle_t **za = (zfs_handle_t **)a; >>>>> - zfs_handle_t **zb = (zfs_handle_t **)b; >>>>> + zfs_handle_t *const *zap = arga; >>>>> + zfs_handle_t *za = *zap; >>>>> + zfs_handle_t *const *zbp = argb; >>>>> + zfs_handle_t *zb = *zbp; >>>>> char mounta[MAXPATHLEN]; >>>>> char mountb[MAXPATHLEN]; >>>>> + const char *a = mounta; >>>>> + const char *b = mountb; >>>>> boolean_t gota, gotb; >>>>> + uint64_t zoneda, zonedb; >>>>> >>>>> - if ((gota = (zfs_get_type(*za) == ZFS_TYPE_FILESYSTEM)) != 0) >>>>> - verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta, >>>>> + zoneda = zfs_prop_get_int(za, ZFS_PROP_ZONED); >>>>> + zonedb = zfs_prop_get_int(zb, ZFS_PROP_ZONED); >>>>> + if (zoneda && !zonedb) >>>>> + return (1); >>>>> + if (!zoneda && zonedb) >>>>> + return (-1); >>>>> + gota = (zfs_get_type(za) == ZFS_TYPE_FILESYSTEM); >>>>> + if (gota) >>>>> + verify(zfs_prop_get(za, ZFS_PROP_MOUNTPOINT, mounta, >>>>> sizeof (mounta), NULL, NULL, 0, B_FALSE) == 0); >>>>> - if ((gotb = (zfs_get_type(*zb) == ZFS_TYPE_FILESYSTEM)) != 0) >>>>> - verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb, >>>>> + gotb = (zfs_get_type(zb) == ZFS_TYPE_FILESYSTEM); >>>>> + if (gotb) >>>>> + verify(zfs_prop_get(zb, ZFS_PROP_MOUNTPOINT, mountb, >>>>> sizeof (mountb), NULL, NULL, 0, B_FALSE) == 0); >>>>> >>>>> - if (gota && gotb) >>>>> - return (strcmp(mounta, mountb)); >>>>> + if (gota && gotb) { >>>>> + while (*a != '\0' && (*a == *b)) { >>>>> + a++; >>>>> + b++; >>>>> + } >>>>> + if (*a == *b) >>>>> + return (0); >>>>> + if (*a == '\0') >>>>> + return (-1); >>>>> + if (*b == '\0') >>>>> + return (-1); >>>>> + if (*a == '/') >>>>> + return (-1); >>>>> + if (*b == '/') >>>>> + return (-1); >>>>> + return (*a < *b ? -1 : *a > *b); >>>>> + } >>>>> >>>>> if (gota) >>>>> return (-1); >>>>> if (gotb) >>>>> return (1); >>>>> >>>>> - return (strcmp(zfs_get_name(a), zfs_get_name(b))); >>>>> + /* >>>>> + * If neither filesystem has a mountpoint, revert to sorting by >>>>> + * datset name. >>>>> + */ >>>>> + return (strcmp(zfs_get_name(za), zfs_get_name(zb))); >>>>> } >>>>> >>>>> /* >>>>> + * Reutrn true if path2 is a child of path1 >>>>> + */ >>>>> +static boolean_t >>>>> +libzfs_path_contains(const char *path1, const char *path2) >>>>> +{ >>>>> + return (strstr(path2, path1) == path2 && path2[strlen(path1)] == >>>>> '/'); >>>>> +} >>>>> + >>>>> + >>>>> +static int >>>>> +non_descendant_idx(zfs_handle_t **handles, size_t num_handles, >> int >>>>> idx) >>>>> +{ >>>>> + char parent[ZFS_MAXPROPLEN]; >>>>> + char child[ZFS_MAXPROPLEN]; >>>>> + int i; >>>>> + >>>>> + verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, parent, >>>>> + sizeof (parent), NULL, NULL, 0, B_FALSE) == 0); >>>>> + >>>>> + for (i = idx + 1; i < num_handles; i++) { >>>>> + verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, child, >>>>> + sizeof (child), NULL, NULL, 0, B_FALSE) == 0); >>>>> + if (!libzfs_path_contains(parent, child)) >>>>> + break; >>>>> + } >>>>> + return (i); >>>>> +} >>>>> + >>>>> +typedef struct mnt_param { >>>>> + libzfs_handle_t *mnt_hdl; >>>>> + tpool_t *mnt_tp; >>>>> + zfs_handle_t **mnt_zhps; /* filesystems to mount */ >>>>> + size_t mnt_num_handles; >>>>> + int mnt_idx; /* Index of selected entry to mount */ >>>>> + zfs_iter_f mnt_func; >>>>> + void *mnt_data; >>>>> +} mnt_param_t; >>>>> + >>>>> +/* >>>>> + * Allocate and populate the parameter struct for mount function, >> and >>>>> + * schedule mounting of the entry selected by idx. >>>>> + */ >>>>> +static void >>>>> +zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles, >>>>> + size_t num_handles, int idx, zfs_iter_f func, void *data, >> tpool_t >>>>> *tp) >>>>> +{ >>>>> + mnt_param_t *mnt_param = zfs_alloc(hdl, sizeof (mnt_param_t)); >>>>> + >>>>> + mnt_param->mnt_hdl = hdl; >>>>> + mnt_param->mnt_tp = tp; >>>>> + mnt_param->mnt_zhps = handles; >>>>> + mnt_param->mnt_num_handles = num_handles; >>>>> + mnt_param->mnt_idx = idx; >>>>> + mnt_param->mnt_func = func; >>>>> + mnt_param->mnt_data = data; >>>>> + >>>>> + (void) tpool_dispatch(tp, zfs_mount_task, (void*)mnt_param); >>>>> +} >>>>> + >>>>> +/* >>>>> + * This is the structure used to keep state of mounting or >> sharing >>>>> operations >>>>> + * during a call to zpool_enable_datasets(). >>>>> + */ >>>>> +typedef struct mount_state { >>>>> + /* >>>>> + * ms_mntstatus is set to -1 if any mount fails. While multiple >>>>> threads >>>>> + * could update this variable concurrently, no synchronization >> is >>>>> + * needed as it's only ever set to -1. >>>>> + */ >>>>> + int ms_mntstatus; >>>>> + int ms_mntflags; >>>>> + const char *ms_mntopts; >>>>> +} mount_state_t; >>>>> + >>>>> +static int >>>>> +zfs_mount_one(zfs_handle_t *zhp, void *arg) >>>>> +{ >>>>> + mount_state_t *ms = arg; >>>>> + int ret = 0; >>>>> + >>>>> + if (zfs_mount(zhp, ms->ms_mntopts, ms->ms_mntflags) != 0) >>>>> + ret = ms->ms_mntstatus = -1; >>>>> + return (ret); >>>>> +} >>>>> + >>>>> +static int >>>>> +zfs_share_one(zfs_handle_t *zhp, void *arg) >>>>> +{ >>>>> + mount_state_t *ms = arg; >>>>> + int ret = 0; >>>>> + >>>>> + if (zfs_share(zhp) != 0) >>>>> + ret = ms->ms_mntstatus = -1; >>>>> + return (ret); >>>>> +} >>>>> + >>>>> +/* >>>>> + * Thread pool function to mount one file system. On completion, >> it >>>>> finds and >>>>> + * schedules its children to be mounted. This depends on the >> sorting >>>>> done in >>>>> + * zfs_foreach_mountpoint(). Note that the degenerate case (chain >> of >>>>> entries >>>>> + * each descending from the previous) will have no parallelism >> since >>>>> we always >>>>> + * have to wait for the parent to finish mounting before we can >>>>> schedule >>>>> + * its children. >>>>> + */ >>>>> +static void >>>>> +zfs_mount_task(void *arg) >>>>> +{ >>>>> + mnt_param_t *mp = arg; >>>>> + int idx = mp->mnt_idx; >>>>> + zfs_handle_t **handles = mp->mnt_zhps; >>>>> + size_t num_handles = mp->mnt_num_handles; >>>>> + char mountpoint[ZFS_MAXPROPLEN]; >>>>> + >>>>> + verify(zfs_prop_get(handles[idx], ZFS_PROP_MOUNTPOINT, >> mountpoint, >>>>> + sizeof (mountpoint), NULL, NULL, 0, B_FALSE) == 0); >>>>> + >>>>> + if (mp->mnt_func(handles[idx], mp->mnt_data) != 0) >>>>> + return; >>>>> + >>>>> + /* >>>>> + * We dispatch tasks to mount filesystems with mountpoints >> underneath >>>>> + * this one. We do this by dispatching the next filesystem with >> a >>>>> + * descendant mountpoint of the one we just mounted, then skip >> all of >>>>> + * its descendants, dispatch the next descendant mountpoint, and >> so >>>>> on. >>>>> + * The non_descendant_idx() function skips over filesystems that >> are >>>>> + * descendants of the filesystem we just dispatched. >>>>> + */ >>>>> + for (int i = idx + 1; i < num_handles; >>>>> + i = non_descendant_idx(handles, num_handles, i)) { >>>>> + char child[ZFS_MAXPROPLEN]; >>>>> + verify(zfs_prop_get(handles[i], ZFS_PROP_MOUNTPOINT, >>>>> + child, sizeof (child), NULL, NULL, 0, B_FALSE) == 0); >>>>> + >>>>> + if (!libzfs_path_contains(mountpoint, child)) >>>>> + break; /* not a descendant, return */ >>>>> + zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i, >>>>> + mp->mnt_func, mp->mnt_data, mp->mnt_tp); >>>>> + } >>>>> + free(mp); >>>>> +} >>>>> + >>>>> +/* >>>>> + * Issue the func callback for each ZFS handle contained in the >>>>> handles >>>>> + * array. This function is used to mount all datasets, and so >> this >>>>> function >>>>> + * guarantees that filesystems for parent mountpoints are called >>>>> before their >>>>> + * children. As such, before issuing any callbacks, we first sort >> the >>>>> array >>>>> + * of handles by mountpoint. >>>>> + * >>>>> + * Callbacks are issued in one of two ways: >>>>> + * >>>>> + * 1. Sequentially: If the parallel argument is B_FALSE or the >>>>> ZFS_SERIAL_MOUNT >>>>> + * environment variable is set, then we issue callbacks >>>>> sequentially. >>>>> + * >>>>> + * 2. In parallel: If the parallel argument is B_TRUE and the >>>>> ZFS_SERIAL_MOUNT >>>>> + * environment variable is not set, then we use a tpool to >> dispatch >>>>> threads >>>>> + * to mount filesystems in parallel. This function dispatches >> tasks >>>>> to mount >>>>> + * the filesystems at the top-level mountpoints, and these >> tasks in >>>>> turn >>>>> + * are responsible for recursively mounting filesystems in >> their >>>>> children >>>>> + * mountpoints. >>>>> + */ >>>>> +void >>>>> +zfs_foreach_mountpoint(libzfs_handle_t *hdl, zfs_handle_t >> **handles, >>>>> + size_t num_handles, zfs_iter_f func, void *data, boolean_t >>>>> parallel) >>>>> +{ >>>>> + zoneid_t zoneid = getzoneid(); >>>>> + >>>>> + /* >>>>> + * The ZFS_SERIAL_MOUNT environment variable is an undocumented >>>>> + * variable that can be used as a convenience to do a/b >> comparison >>>>> + * of serial vs. parallel mounting. >>>>> + */ >>>>> + boolean_t serial_mount = !parallel || >>>>> + (getenv("ZFS_SERIAL_MOUNT") != NULL); >>>>> + >>>>> + /* >>>>> + * Sort the datasets by mountpoint. See mountpoint_cmp for >> details >>>>> + * of how these are sorted. >>>>> + */ >>>>> + qsort(handles, num_handles, sizeof (zfs_handle_t *), >> mountpoint_cmp); >>>>> + >>>>> + if (serial_mount) { >>>>> + for (int i = 0; i < num_handles; i++) { >>>>> + func(handles[i], data); >>>>> + } >>>>> + return; >>>>> + } >>>>> + >>>>> + /* >>>>> + * Issue the callback function for each dataset using a parallel >>>>> + * algorithm that uses a thread pool to manage threads. >>>>> + */ >>>>> + tpool_t *tp = tpool_create(1, mount_tp_nthr, 0, NULL); >>>>> + >>>>> + /* >>>>> + * There may be multiple "top level" mountpoints outside of the >>>>> pool's >>>>> + * root mountpoint, e.g.: /foo /bar. Dispatch a mount task for >> each >>>>> of >>>>> + * these. >>>>> + */ >>>>> + for (int i = 0; i < num_handles; >>>>> + i = non_descendant_idx(handles, num_handles, i)) { >>>>> + /* >>>>> + * Since the mountpoints have been sorted so that the zoned >>>>> + * filesystems are at the end, a zoned filesystem seen from >>>>> + * the global zone means that we're done. >>>>> + */ >>>>> + if (zoneid == GLOBAL_ZONEID && >>>>> + zfs_prop_get_int(handles[i], ZFS_PROP_ZONED)) >>>>> + break; >>>>> + zfs_dispatch_mount(hdl, handles, num_handles, i, func, data, >>>>> + tp); >>>>> + } >>>>> + >>>>> + tpool_wait(tp); /* wait for all scheduled mounts to complete */ >>>>> + tpool_destroy(tp); >>>>> +} >>>>> + >>>>> +/* >>>>> * Mount and share all datasets within the given pool. This >> assumes >>>>> that no >>>>> - * datasets within the pool are currently mounted. Because users >> can >>>>> create >>>>> - * complicated nested hierarchies of mountpoints, we first gather >> all >>>>> the >>>>> - * datasets and mountpoints within the pool, and sort them by >>>>> mountpoint. Once >>>>> - * we have the list of all filesystems, we iterate over them in >> order >>>>> and mount >>>>> - * and/or share each one. >>>>> + * datasets within the pool are currently mounted. >>>>> */ >>>>> #pragma weak zpool_mount_datasets = zpool_enable_datasets >>>>> int >>>>> zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, >> int >>>>> flags) >>>>> { >>>>> get_all_cb_t cb = { 0 }; >>>>> - libzfs_handle_t *hdl = zhp->zpool_hdl; >>>>> + mount_state_t ms = { 0 }; >>>>> zfs_handle_t *zfsp; >>>>> - int i, ret = -1; >>>>> - int *good; >>>>> + int ret = 0; >>>>> >>>>> - /* >>>>> - * Gather all non-snap datasets within the pool. >>>>> - */ >>>>> - if ((zfsp = zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) == >>>>> NULL) >>>>> + if ((zfsp = zfs_open(zhp->zpool_hdl, zhp->zpool_name, >>>>> + ZFS_TYPE_DATASET)) == NULL) >>>>> goto out; >>>>> >>>>> - libzfs_add_handle(&cb, zfsp); >>>>> - if (zfs_iter_filesystems(zfsp, mount_cb, &cb) != 0) >>>>> - goto out; >>>>> /* >>>>> - * Sort the datasets by mountpoint. >>>>> + * Gather all non-snapshot datasets within the pool. Start by >> adding >>>>> + * the root filesystem for this pool to the list, and then >> iterate >>>>> + * over all child filesystems. >>>>> */ >>>>> - qsort(cb.cb_handles, cb.cb_used, sizeof (void *), >>>>> - libzfs_dataset_cmp); >>>>> + libzfs_add_handle(&cb, zfsp); >>>>> + if (zfs_iter_filesystems(zfsp, zfs_iter_cb, &cb) != 0) >>>>> + goto out; >>>>> >>>>> /* >>>>> - * And mount all the datasets, keeping track of which ones >>>>> - * succeeded or failed. >>>>> + * Mount all filesystems >>>>> */ >>>>> - if ((good = zfs_alloc(zhp->zpool_hdl, >>>>> - cb.cb_used * sizeof (int))) == NULL) >>>>> - goto out; >>>>> + ms.ms_mntopts = mntopts; >>>>> + ms.ms_mntflags = flags; >>>>> + zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, >> cb.cb_used, >>>>> + zfs_mount_one, &ms, B_TRUE); >>>>> + if (ms.ms_mntstatus != 0) >>>>> + ret = ms.ms_mntstatus; >>>>> >>>>> - ret = 0; >>>>> - for (i = 0; i < cb.cb_used; i++) { >>>>> - if (zfs_mount(cb.cb_handles[i], mntopts, flags) != 0) >>>>> - ret = -1; >>>>> - else >>>>> - good[i] = 1; >>>>> - } >>>>> - >>>>> /* >>>>> - * Then share all the ones that need to be shared. This needs >>>>> - * to be a separate pass in order to avoid excessive reloading >>>>> - * of the configuration. Good should never be NULL since >>>>> - * zfs_alloc is supposed to exit if memory isn't available. >>>>> + * Share all filesystems that need to be shared. This needs to >> be >>>>> + * a separate pass because libshare is not mt-safe, and so we >> need >>>>> + * to share serially. >>>>> */ >>>>> - for (i = 0; i < cb.cb_used; i++) { >>>>> - if (good[i] && zfs_share(cb.cb_handles[i]) != 0) >>>>> - ret = -1; >>>>> - } >>>>> + ms.ms_mntstatus = 0; >>>>> + zfs_foreach_mountpoint(zhp->zpool_hdl, cb.cb_handles, >> cb.cb_used, >>>>> + zfs_share_one, &ms, B_FALSE); >>>>> + if (ms.ms_mntstatus != 0) >>>>> + ret = ms.ms_mntstatus; >>>>> >>>>> - free(good); >>>>> - >>>>> out: >>>>> - for (i = 0; i < cb.cb_used; i++) >>>>> + for (int i = 0; i < cb.cb_used; i++) >>>>> zfs_close(cb.cb_handles[i]); >>>>> free(cb.cb_handles); >>>>> >>>> >>>> This broke my systems, many filesystems fail to mount causing >> nullfs late mounts to fail. No details now until tonight. >>>> >>>> Suggest we back this out until it is properly tested. >>>> >>> >>> What fails to mount? what message? can you provide Gandi folks more >> informations >>> so they can fix? >>> >>> I will revert if we cannot have a quick fix but let s give them a >> chance to fix >>> first. >>> >> With the proper email in CC there is a better chance to reach at them >> :) >> >> Best regards, >> Bapt > > Sorry about that. I'm terribly frustrated as this broke my mail gateway, having to fix it using juiceSSH on my phone on the bus. Ssh on the phone makes for a very grumpy Cy. > > I did bring my personal laptop to work, so I'll try to help out testing this at noon here and maybe look at it more. I'll help out any way I can. > > Sorry about all this... Could you try the attached patch, it should fix the issue. I don't understand how this regression happened, it's not present in ZoL... I'll check with Jack who worked on this when he's back from PTO. Thanks. -- Fatih ACAR Gandi fatih.acar@gandi.net --------------6A54CE5B28D823DCB8C41577 Content-Type: text/x-patch; name="mount.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="mount.patch" Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.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 --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c (revision 3= 44590) +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c (working co= py) @@ -1260,11 +1260,11 @@ if (*a =3D=3D '\0') return (-1); if (*b =3D=3D '\0') - return (-1); + return (1); if (*a =3D=3D '/') return (-1); if (*b =3D=3D '/') - return (-1); + return (1); return (*a < *b ? -1 : *a > *b); } =20 --------------6A54CE5B28D823DCB8C41577-- From owner-svn-src-head@freebsd.org Tue Feb 26 17:41:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A670C1520AA6; Tue, 26 Feb 2019 17:41:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493D26A15A; Tue, 26 Feb 2019 17:41:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A6AC883E; Tue, 26 Feb 2019 17:41:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QHfg1v059293; Tue, 26 Feb 2019 17:41:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QHfg2w059292; Tue, 26 Feb 2019 17:41:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902261741.x1QHfg2w059292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Feb 2019 17:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344593 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 344593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 493D26A15A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:41:42 -0000 Author: kib Date: Tue Feb 26 17:41:41 2019 New Revision: 344593 URL: https://svnweb.freebsd.org/changeset/base/344593 Log: procctl(2): document ASLR knobs. Reviewed by: 0mp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D19308 Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Tue Feb 26 17:35:06 2019 (r344592) +++ head/lib/libc/sys/procctl.2 Tue Feb 26 17:41:41 2019 (r344593) @@ -72,6 +72,46 @@ The control request to perform is specified by the argument. The following commands are supported: .Bl -tag -width PROC_TRAPCAP_STATUS +.It Dv PROC_ASLR_CTL +Controls the Address Space Layout Randomization (ASLR) in the program +images created +by +.Xr execve 2 +in the specified process or its descendants that did not changed +the control nor modified it by other means. +The +.Va arg +parameter must point to the integer variable holding one of the following +values: +.Bl -tag -width PROC_ASLR_FORCE_DISABLE +.It Dv PROC_ASLR_FORCE_ENABLE +Request that ASLR is enabled after execution, even if it is disabled +system-wide. +The image flag and set-uid might prevent ASLR enablement still. +.It Dv PROC_ASLR_FORCE_DISABLE +Request that ASLR is disabled after execution. +Same notes as for +.Dv PROC_ASKR_FORCE_ENABLE +apply. +.It Dv PROC_ASLR_NOFORCE +Use system-wide configured policy for ASLR. +.El +.It Dv PROC_ASLR_STATUS +Returns the current status of ASLR enablement for the target process. +The +.Va arg +parameter must point to the integer variable, where one of the +following values is written: +.Bl -tag -width PROC_ASLR_FORCE_DISABLE +.It Dv PROC_ASLR_FORCE_ENABLE +.It Dv PROC_ASLR_FORCE_DISABLE +.It Dv PROC_ASLR_NOFORCE +.El +.Pp +If the currently executed image in the process itself has ASLR enabled, +the +.Dv PROC_ASLR_ACTIVE +flag is or-ed with the value listed above. .It Dv PROC_SPROTECT Set process protection state. This is used to mark a process as protected from being killed if the system @@ -543,11 +583,16 @@ The .Fn procctl function appeared in .Fx 10.0 . +.Pp The reaper facility is based on a similar feature of Linux and DragonflyBSD, and first appeared in .Fx 10.2 . +.Pp The .Dv PROC_PDEATHSIG_CTL facility is based on the prctl(PR_SET_PDEATHSIG, ...) feature of Linux, and first appeared in .Fx 11.2 . +.Pp +The ASLR support was added to system for the checklists compliance in +.Fx 13.0 . From owner-svn-src-head@freebsd.org Tue Feb 26 17:43:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DCF81520B49; Tue, 26 Feb 2019 17:43: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 0472B6A3E3; Tue, 26 Feb 2019 17:43:47 +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 x1QHhjCk046958; Tue, 26 Feb 2019 09:43:45 -0800 (PST) (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 x1QHhj13046957; Tue, 26 Feb 2019 09:43:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261743.x1QHhj13046957@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec In-Reply-To: <20190226113455.0306a593@ralga.knownspace> To: Justin Hibbits Date: Tue, 26 Feb 2019 09:43:45 -0800 (PST) CC: Alexey Dokuchaev , John Baldwin , rgrimes@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 0472B6A3E3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 17:43:48 -0000 > On Tue, 26 Feb 2019 17:23:58 +0000 > Alexey Dokuchaev wrote: > > > On Tue, Feb 26, 2019 at 09:12:11AM -0800, John Baldwin wrote: > > > > It makes the review clickable in many mail clients which is very > > > handy. > > > > I understand that, but then again, we don't do that for PRs and people > > don't seem to complain. Accepting D#### would make this all > > consistent and commit messages cleaner. Arguably, if one likes to > > click the URLs in their mail client, why not configure the client to > > expand the URL in place? > > > > > > > ./danfe > > > > I, personally, would love it if the PR listed in emails was a clickable > link. Or, even, if in viewvc the PR was a clickable link. That might > be easier to do, since we wouldn't need to worry about links going > stale to the bugtracker-of-the-year. 1 push; +; -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 17:46:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 890FA1520C2D; Tue, 26 Feb 2019 17:46:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 286336A62F; Tue, 26 Feb 2019 17:46:20 +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 19EBB888A; Tue, 26 Feb 2019 17:46:20 +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 x1QHkJde060484; Tue, 26 Feb 2019 17:46:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QHkJOI060482; Tue, 26 Feb 2019 17:46:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902261746.x1QHkJOI060482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Feb 2019 17:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344594 - head/usr.bin/proccontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/proccontrol X-SVN-Commit-Revision: 344594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 286336A62F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:46:20 -0000 Author: kib Date: Tue Feb 26 17:46:19 2019 New Revision: 344594 URL: https://svnweb.freebsd.org/changeset/base/344594 Log: proccontrol(1) man page. Reviewed by: 0mp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D19308 Added: head/usr.bin/proccontrol/proccontrol.1 (contents, props changed) Modified: head/usr.bin/proccontrol/Makefile Modified: head/usr.bin/proccontrol/Makefile ============================================================================== --- head/usr.bin/proccontrol/Makefile Tue Feb 26 17:41:41 2019 (r344593) +++ head/usr.bin/proccontrol/Makefile Tue Feb 26 17:46:19 2019 (r344594) @@ -2,6 +2,5 @@ PROG= proccontrol WARNS?= 6 -MAN= .include Added: head/usr.bin/proccontrol/proccontrol.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/proccontrol/proccontrol.1 Tue Feb 26 17:46:19 2019 (r344594) @@ -0,0 +1,123 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov 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 AUTHORS 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 AUTHORS 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 February 22, 2019 +.Dt PROCCONTROL 1 +.Os +.Sh NAME +.Nm proccontrol +.Nd Control some process execution aspects +.Sh SYNOPSIS +.Nm +.Fl m Ar mode +.Op Fl s Ar control +.Op Fl q +.Fl p Ar pid | command +.Sh DESCRIPTION +The +.Nm +command modifies the execution parameter of existing process +specified by the +.Ar pid +argument, or starts execution of the new program +.Ar command +with the execution parameter set for it. +.Pp +Which execution parameter is changed, selected by the mandatory +parameter +.Ar mode . +Possible values for +.Ar mode +are: +.Bl -tag -width trapcap +.It Ar aslr +Control the Address Space Layout Randomization. +Only applicable to the new process spawned. +.It Ar trace +Control the permission for debuggers to attach. +.It Ar trapcap +Controls the signalling of capability mode access violations. +.El +.Pp +The +Ar control +specifies if the selected +.Ar mode +should be enabled or disabled. +Possible values are +.Ar enable +and +.Ar disable , +with the default value being +.Ar enable +if not specified. +See +.Xr procctl 2 +for detailed description of each mode effects and interaction with other +process control facilities. +.Pp +The +.Op Fl q +switch makes the utility query and print the current setting for +the selected mode. +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +.Bl -bullet +.It +To disable debuggers attachment to the process 1020, execute +.Dl "proccontrol -m trace -s disable -p 1020" +.It +To execute the +.Xr uniq 1 +program in a mode where capability access violations cause +.Dv SIGTRAP +delivery, do +.Dl "proccontrol -m trapcap uniq" +.It +To query the current ASLR enablement mode for the running +process 1020, do +.Dl "proccontrol -m aslr -q -p 1020" +.El +.Sh SEE ALSO +.Xr kill 2 , +.Xr procctl 2 , +.Xr ptrace 2 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +command and this manual page were written by +.An Konstantin Belousov Aq Mt kib@freebsd.org +under sponsorship from The FreeBSD Foundation. From owner-svn-src-head@freebsd.org Tue Feb 26 17:48:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16B811520CDA; Tue, 26 Feb 2019 17:48:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADF416A7D7; Tue, 26 Feb 2019 17:48:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id C3EDE1DC62; Tue, 26 Feb 2019 17:48:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: rgrimes@freebsd.org Cc: "K. Macy" , Brooks Davis , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201902261733.x1QHXU0f046905@pdx.rh.CN85.dnsmgr.net> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 26 Feb 2019 09:48:43 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <201902261733.x1QHXU0f046905@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADF416A7D7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:48:46 -0000 On 2/26/19 9:33 AM, Rodney W. Grimes wrote: >> On 2/25/19 5:11 PM, K. Macy wrote: >>>> This commit needed more through review. >>> >>> How would this be achieved:? I had several people on the review and no >>> one had substantive feedback. >> >> As a developer it is your responsibility to be aware of the policies that >> we do document. One of the things in the license policy Brooks pointed you >> at is that adding new GPL code requires core@ sign off. This doesn't mean >> core@ will say know. It does mean that core@ has to make an explicit >> decision. >> >> (I know Brooks said he intended to update the policy, but in fact it >> already requires core@ sign off for any new code that isn't following >> one of the accepted licenses which are all BSD/MIT-style licenses.) > > In defense of K Macy here, the copy of this text in the publically > visible committers guide does not say that. Hence my earlier mail > about is this text planned as an update to what is in the committers > guide. Or can you point me to something in the public area that > points at this /internal/license.html file? Things on internal/ are "public" as far as developers are concerned. The title of https://www.freebsd.org/internal/policies.html is "Policies for FreeBSD Project Members" and references the committers guide as well as additional policies rather than the other way around. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Feb 26 17:52:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 201B81520F50; Tue, 26 Feb 2019 17:52:51 +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 A7D3D6AC23; Tue, 26 Feb 2019 17:52:50 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7ACCF3C475F; Tue, 26 Feb 2019 17:52:48 +0000 (UTC) Date: Tue, 26 Feb 2019 17:52:48 +0000 From: Brooks Davis To: "K. Macy" Cc: Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Message-ID: <20190226175248.GF47081@spindle.one-eyed-alien.net> References: <201902232114.x1NLE0cH085345@repo.freebsd.org> <20190225175809.GB47081@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZRyEpB+iJ+qUx0kp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: A7D3D6AC23 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 17:52:51 -0000 --ZRyEpB+iJ+qUx0kp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 25, 2019 at 05:11:26PM -0800, K. Macy wrote: > > We had a brief discussion of this commit within a subset of core. This > > addition of GPLv2 code is fine as the code is easily removal to a module > > (per kmoore@) should the day come that we're read to evict all GPL code. >=20 > I don't execute the ctors until coverage is enabled because I have to > manually find the symbols. The linker doesn't actually generate a ctor > section for functions in text.startup in spite of what Juniper's > linker commit would lead one to believe - presumably they have a > private linker script in addition to a private gcov port. Thus, it > really could just work fine as a module. Nonetheless, everything to be > profiled needs to be compiled with instrumentation, so separating it > out makes very little sense to me. Although, I suppose ctfconvert + > dtrace module is somewhat analogous. >=20 > > The modest increase in activation energy for that task seems worth it > > for the short-term gains of reduced integration cost (this code will > > greatly improve our ZFS-on-Linux test coverage.) > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > license statements. The standard GPL v2.0 boiler plate should be added > > to this file along side the tag. >=20 > I've copied the full copyright attribution that is in the > corresponding files on Linux. Is there some reason why FreeBSD > requires the files to be inflated with the full license text where the > original lacks it? We're not asking for the full text, just the standard block: // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. //=20 // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. //=20 // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA // 02110-1301, USA. This is from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#SEC4 We're not currently using SPDX to include licenses, largely because OSI completely and utterly botched BSD licenses. Fixing this is WAY down the list of things on core's plate. Unless someone takes ownership here, I don't see this changing any time soon. > > An additional issue is that the a warning tag was not added to > > sys/conf/files. A warning along the lines of: > > > > warning "kernel contains GPLv2 licensed GCOV" > > > > needs to be added. >=20 > Yup. >=20 > > > > This commit needed more through review. >=20 > How would this be achieved:? I had several people on the review and no > one had substantive feedback. For GPL stuff, add #core to the reviewers list and feel free to drop us an email to make sure we see it promptly. -- Brooks --ZRyEpB+iJ+qUx0kp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcdXzvAAoJEKzQXbSebgfAWQsH/3kANY+XUPrSUi9UpaCjb+py aNvyxKkR5rpsWjvS4Se+bE0IpYF1kowjSIkx6Cx+ia5K4gMhRxP95DmUJ03dvUwZ FHd341kGv+g74Q3SJ7ISaWLhD8TkcH04gbWGO6bPGO0UnKrBJOUbjp5kq26Yk130 v3jNP+dshdMZwTDIycxCI1V2jAwSAukyHRVs671xNyEyietsrMgv1cBlZVa/nJxy i0Kr8OIILOSj2e5/zibJD3y1PzKWD51ap3Gbvj8UIrQjASgppJMWXOKsqcs71O3t oFSV70GcNdmrxSeAc/QDXrdjXBcxD+NGn/WmilMpIP3vVODWZsPPeLZa+l9pOkU= =Xbn1 -----END PGP SIGNATURE----- --ZRyEpB+iJ+qUx0kp-- From owner-svn-src-head@freebsd.org Tue Feb 26 18:03:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36547152133E; Tue, 26 Feb 2019 18:03:31 +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 A59CA6B396; Tue, 26 Feb 2019 18:03:30 +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 x1QI3M9L047065; Tue, 26 Feb 2019 10:03:22 -0800 (PST) (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 x1QI3MRh047064; Tue, 26 Feb 2019 10:03:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261803.x1QI3MRh047064@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344594 - head/usr.bin/proccontrol In-Reply-To: <201902261746.x1QHkJOI060482@repo.freebsd.org> To: Konstantin Belousov Date: Tue, 26 Feb 2019 10:03:22 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, emaste@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: A59CA6B396 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 18:03:31 -0000 > Author: kib > Date: Tue Feb 26 17:46:19 2019 > New Revision: 344594 > URL: https://svnweb.freebsd.org/changeset/base/344594 > > Log: > proccontrol(1) man page. > > Reviewed by: 0mp > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D19308 > > Added: > head/usr.bin/proccontrol/proccontrol.1 (contents, props changed) > Modified: > head/usr.bin/proccontrol/Makefile > > Modified: head/usr.bin/proccontrol/Makefile > ============================================================================== > --- head/usr.bin/proccontrol/Makefile Tue Feb 26 17:41:41 2019 (r344593) > +++ head/usr.bin/proccontrol/Makefile Tue Feb 26 17:46:19 2019 (r344594) > @@ -2,6 +2,5 @@ > > PROG= proccontrol > WARNS?= 6 > -MAN= > > .include > > Added: head/usr.bin/proccontrol/proccontrol.1 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/proccontrol/proccontrol.1 Tue Feb 26 17:46:19 2019 (r344594) > @@ -0,0 +1,123 @@ > +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. > +.\" All rights reserved. I thought the foundation updated all its templates and contracts such that the All rights reserved was no longer needed? Ed? > +.\" > +.\" This documentation was written by > +.\" Konstantin Belousov 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 AUTHORS 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 AUTHORS 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 February 22, 2019 > +.Dt PROCCONTROL 1 > +.Os > +.Sh NAME > +.Nm proccontrol > +.Nd Control some process execution aspects > +.Sh SYNOPSIS > +.Nm > +.Fl m Ar mode > +.Op Fl s Ar control > +.Op Fl q > +.Fl p Ar pid | command > +.Sh DESCRIPTION > +The > +.Nm > +command modifies the execution parameter of existing process > +specified by the > +.Ar pid > +argument, or starts execution of the new program > +.Ar command > +with the execution parameter set for it. > +.Pp > +Which execution parameter is changed, selected by the mandatory > +parameter > +.Ar mode . > +Possible values for > +.Ar mode > +are: > +.Bl -tag -width trapcap > +.It Ar aslr > +Control the Address Space Layout Randomization. > +Only applicable to the new process spawned. > +.It Ar trace > +Control the permission for debuggers to attach. > +.It Ar trapcap > +Controls the signalling of capability mode access violations. > +.El > +.Pp > +The > +Ar control > +specifies if the selected > +.Ar mode > +should be enabled or disabled. > +Possible values are > +.Ar enable > +and > +.Ar disable , > +with the default value being > +.Ar enable > +if not specified. > +See > +.Xr procctl 2 > +for detailed description of each mode effects and interaction with other > +process control facilities. > +.Pp > +The > +.Op Fl q > +switch makes the utility query and print the current setting for > +the selected mode. > +.Sh EXIT STATUS > +.Ex -std > +.Sh EXAMPLES > +.Bl -bullet > +.It > +To disable debuggers attachment to the process 1020, execute > +.Dl "proccontrol -m trace -s disable -p 1020" > +.It > +To execute the > +.Xr uniq 1 > +program in a mode where capability access violations cause > +.Dv SIGTRAP > +delivery, do > +.Dl "proccontrol -m trapcap uniq" > +.It > +To query the current ASLR enablement mode for the running > +process 1020, do > +.Dl "proccontrol -m aslr -q -p 1020" > +.El > +.Sh SEE ALSO > +.Xr kill 2 , > +.Xr procctl 2 , > +.Xr ptrace 2 > +.Sh HISTORY > +The > +.Nm > +command appeared in > +.Fx 10.0 . > +.Sh AUTHORS > +The > +.Nm > +command and this manual page were written by > +.An Konstantin Belousov Aq Mt kib@freebsd.org > +under sponsorship from The FreeBSD Foundation. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 18:06:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EDB215214C7; Tue, 26 Feb 2019 18:06:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2B6D6B5C8; Tue, 26 Feb 2019 18:06:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 09D601DE83; Tue, 26 Feb 2019 18:06:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec To: Alexey Dokuchaev Cc: rgrimes@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> <34ecb52f-c89e-0d5e-594e-25b0d045d171@FreeBSD.org> <20190226172358.GA67992@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 26 Feb 2019 10:06:51 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190226172358.GA67992@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2B6D6B5C8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 18:06:54 -0000 On 2/26/19 9:23 AM, Alexey Dokuchaev wrote: > On Tue, Feb 26, 2019 at 09:12:11AM -0800, John Baldwin wrote: >> On 2/26/19 5:49 AM, Alexey Dokuchaev wrote: >>> On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: >>>> ... >>>> Just a small nit, for future reference, from the template: >>>>> Differential Revision: https://reviews.freebsd.org/D### >>>> (*full* phabric URL needed). >>> >>> IMHO we should just fix the scripts to accept D#### alone, without >>> the URL. We don't do that for PR (bugzilla) references, and the fact >>> that we do for the phab is both needless and confusing. Also, that >>> URL might change one day while we could probably keep the old numbers >>> if we move. >> >> It makes the review clickable in many mail clients which is very handy. > > I understand that, but then again, we don't do that for PRs and people > don't seem to complain. Accepting D#### would make this all consistent > and commit messages cleaner. Arguably, if one likes to click the URLs > in their mail client, why not configure the client to expand the URL in > place? > >> -- >> John Baldwin >> >> \x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a > > Can you do something about this horde of \x9a's appended to your every > email John? Bizarre, that's the first time someone has mentioned that. It appears to be a misfeature of Thunderbird which I switched to last year after kmail in kde5 officially moved to "unusable trash fire" status. It doesn't show up locally, and the signature file I'm using doesn't contain them: % hexdump .signature 0000000 2d 2d 20 0a 4a 6f 68 6e 20 42 61 6c 64 77 69 6e 0000010 0a 0000011 Switching to using an inline signature instead of a signature file didn't fix it either. :( I haven't found an existing bug report for this yet. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Feb 26 18:08:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F38A11521610; Tue, 26 Feb 2019 18:08:09 +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 30A656B974; Tue, 26 Feb 2019 18:08:06 +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 x1QI84UM047093; Tue, 26 Feb 2019 10:08:04 -0800 (PST) (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 x1QI84uW047092; Tue, 26 Feb 2019 10:08:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261808.x1QI84uW047092@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: To: John Baldwin Date: Tue, 26 Feb 2019 10:08:04 -0800 (PST) CC: rgrimes@FreeBSD.org, "K. Macy" , Brooks Davis , Matt Macy , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 30A656B974 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 18:08:10 -0000 > On 2/26/19 9:33 AM, Rodney W. Grimes wrote: > >> On 2/25/19 5:11 PM, K. Macy wrote: > >>>> This commit needed more through review. > >>> > >>> How would this be achieved:? I had several people on the review and no > >>> one had substantive feedback. > >> > >> As a developer it is your responsibility to be aware of the policies that > >> we do document. One of the things in the license policy Brooks pointed you > >> at is that adding new GPL code requires core@ sign off. This doesn't mean > >> core@ will say know. It does mean that core@ has to make an explicit > >> decision. > >> > >> (I know Brooks said he intended to update the policy, but in fact it > >> already requires core@ sign off for any new code that isn't following > >> one of the accepted licenses which are all BSD/MIT-style licenses.) > > > > In defense of K Macy here, the copy of this text in the publically > > visible committers guide does not say that. Hence my earlier mail > > about is this text planned as an update to what is in the committers > > guide. Or can you point me to something in the public area that > > points at this /internal/license.html file? > > Things on internal/ are "public" as far as developers are concerned. The > title of https://www.freebsd.org/internal/policies.html is "Policies for > FreeBSD Project Members" and references the committers guide as well as > additional policies rather than the other way around. And when is a new/returning committer refered to this document? I do not recall being ever told about it. I was refered to the committers guide. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 18:15:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2AAD1521E55; Tue, 26 Feb 2019 18:15:42 +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 509F16C49D; Tue, 26 Feb 2019 18:15:42 +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 x1QIFea8047145; Tue, 26 Feb 2019 10:15:40 -0800 (PST) (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 x1QIFeor047144; Tue, 26 Feb 2019 10:15:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902261815.x1QIFeor047144@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <20190226175248.GF47081@spindle.one-eyed-alien.net> To: Brooks Davis Date: Tue, 26 Feb 2019 10:15:40 -0800 (PST) CC: "K. Macy" , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 509F16C49D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 18:15:43 -0000 > On Mon, Feb 25, 2019 at 05:11:26PM -0800, K. Macy wrote: > > > We had a brief discussion of this commit within a subset of core. This > > > addition of GPLv2 code is fine as the code is easily removal to a module > > > (per kmoore@) should the day come that we're read to evict all GPL code. > > > > I don't execute the ctors until coverage is enabled because I have to > > manually find the symbols. The linker doesn't actually generate a ctor > > section for functions in text.startup in spite of what Juniper's > > linker commit would lead one to believe - presumably they have a > > private linker script in addition to a private gcov port. Thus, it > > really could just work fine as a module. Nonetheless, everything to be > > profiled needs to be compiled with instrumentation, so separating it > > out makes very little sense to me. Although, I suppose ctfconvert + > > dtrace module is somewhat analogous. > > > > > The modest increase in activation energy for that task seems worth it > > > for the short-term gains of reduced integration cost (this code will > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > license statements. The standard GPL v2.0 boiler plate should be added > > > to this file along side the tag. > > > > I've copied the full copyright attribution that is in the > > corresponding files on Linux. Is there some reason why FreeBSD > > requires the files to be inflated with the full license text where the > > original lacks it? > > We're not asking for the full text, just the standard block: > > // This program is free software; you can redistribute it and/or > // modify it under the terms of the GNU General Public License > // as published by the Free Software Foundation; either version 2 > // of the License, or (at your option) any later version. > // > // This program is distributed in the hope that it will be useful, > // but WITHOUT ANY WARRANTY; without even the implied warranty of > // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > // GNU General Public License for more details. > // > // You should have received a copy of the GNU General Public License > // along with this program; if not, write to the Free Software > // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > // 02110-1301, USA. > > This is from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#SEC4 > > We're not currently using SPDX to include licenses, largely because OSI > completely and utterly botched BSD licenses. Fixing this is WAY down > the list of things on core's plate. Unless someone takes ownership > here, I don't see this changing any time soon. What is it that got botched, and what is it that needs to be done, some may think I do not support SPDX, I do, in that originally it was about tagging the files to mark what license applies, and I agree we should tag the files. I howerver can not support the concept that you can replace a copyright and/or license text in a file with just a SPDX tag. Some sight Linux as a big project using SPDX, but if you dig into it you find out they did this to recover from there sloppyness of actually not having anything in some 6000 files in the kernel, they simply tagged them all GPL 2 and boom they claim problem solved. > > > An additional issue is that the a warning tag was not added to > > > sys/conf/files. A warning along the lines of: > > > > > > warning "kernel contains GPLv2 licensed GCOV" > > > > > > needs to be added. > > > > Yup. > > > > > > > > This commit needed more through review. > > > > How would this be achieved:? I had several people on the review and no > > one had substantive feedback. > > For GPL stuff, add #core to the reviewers list and feel free to drop us > an email to make sure we see it promptly. Thank you Brooks, maybe also add that as a note to the text of the internal document, and could we get the text in the committers guide I sighted elsewhere to agree with the text in this internal policy? > -- Brooks -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 26 18:20:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CD071522093; Tue, 26 Feb 2019 18:20: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA1946C6EA; Tue, 26 Feb 2019 18:20:42 +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 9C1908DAB; Tue, 26 Feb 2019 18:20:42 +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 x1QIKgAn076619; Tue, 26 Feb 2019 18:20:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QIKgJ4076617; Tue, 26 Feb 2019 18:20:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902261820.x1QIKgJ4076617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Feb 2019 18:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344599 - in head/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts: common/dtrace intel/dtrace X-SVN-Commit-Revision: 344599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA1946C6EA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 18:20:43 -0000 Author: markj Date: Tue Feb 26 18:20:41 2019 New Revision: 344599 URL: https://svnweb.freebsd.org/changeset/base/344599 Log: Fix fasttrap_sig{trap,segv}(). - Don't leak the ksiginfo structure. - Hold the proc lock when sending a signal in fasttrap_sigsegv(). MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Feb 26 18:09:04 2019 (r344598) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Tue Feb 26 18:20:41 2019 (r344599) @@ -291,30 +291,15 @@ fasttrap_hash_str(const char *p) void fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) { -#ifdef illumos - sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); + ksiginfo_t ksi; - sqp->sq_info.si_signo = SIGTRAP; - sqp->sq_info.si_code = TRAP_DTRACE; - sqp->sq_info.si_addr = (caddr_t)pc; - - mutex_enter(&p->p_lock); - sigaddqa(p, t, sqp); - mutex_exit(&p->p_lock); - - if (t != NULL) - aston(t); -#else - ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); - - ksiginfo_init(ksi); - ksi->ksi_signo = SIGTRAP; - ksi->ksi_code = TRAP_DTRACE; - ksi->ksi_addr = (caddr_t)pc; + ksiginfo_init(&ksi); + ksi.ksi_signo = SIGTRAP; + ksi.ksi_code = TRAP_DTRACE; + ksi.ksi_addr = (caddr_t)pc; PROC_LOCK(p); - (void) tdsendsignal(p, t, SIGTRAP, ksi); + (void)tdsendsignal(p, t, SIGTRAP, &ksi); PROC_UNLOCK(p); -#endif } #ifndef illumos Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Feb 26 18:09:04 2019 (r344598) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Tue Feb 26 18:20:41 2019 (r344599) @@ -735,13 +735,15 @@ fasttrap_return_common(struct reg *rp, uintptr_t pc, p static void fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) { - ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); + ksiginfo_t ksi; - ksiginfo_init(ksi); - ksi->ksi_signo = SIGSEGV; - ksi->ksi_code = SEGV_MAPERR; - ksi->ksi_addr = (caddr_t)addr; - (void) tdksignal(t, SIGSEGV, ksi); + ksiginfo_init(&ksi); + ksi.ksi_signo = SIGSEGV; + ksi.ksi_code = SEGV_MAPERR; + ksi.ksi_addr = (caddr_t)addr; + PROC_LOCK(p); + (void)tdksignal(t, SIGSEGV, &ksi); + PROC_UNLOCK(p); } #ifdef __amd64 From owner-svn-src-head@freebsd.org Tue Feb 26 18:30:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8277E152241D; Tue, 26 Feb 2019 18:30:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2718B6CF10; Tue, 26 Feb 2019 18:30: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 15E508F65; Tue, 26 Feb 2019 18:30: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 x1QIUpSX082790; Tue, 26 Feb 2019 18:30:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QIUpCm082789; Tue, 26 Feb 2019 18:30:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902261830.x1QIUpCm082789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Feb 2019 18:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344600 - head/sys/geom/concat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/concat X-SVN-Commit-Revision: 344600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2718B6CF10 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 18:30:52 -0000 Author: markj Date: Tue Feb 26 18:30:51 2019 New Revision: 344600 URL: https://svnweb.freebsd.org/changeset/base/344600 Log: Add a missing return statement to g_concat_kernel_dump(). The error occurs when upper layers attempt an out-of-bounds write. Submitted by: Noah Bergbauer MFC after: 1 week Modified: head/sys/geom/concat/g_concat.c Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Tue Feb 26 18:20:41 2019 (r344599) +++ head/sys/geom/concat/g_concat.c Tue Feb 26 18:30:51 2019 (r344600) @@ -238,8 +238,10 @@ g_concat_kernel_dump(struct bio *bp) sc->sc_disks[i].d_end > gkd->offset) break; } - if (i == sc->sc_ndisks) + if (i == sc->sc_ndisks) { g_io_deliver(bp, EOPNOTSUPP); + return; + } disk = &sc->sc_disks[i]; gkd->offset -= disk->d_start; if (gkd->length > disk->d_end - disk->d_start - gkd->offset) From owner-svn-src-head@freebsd.org Tue Feb 26 19:07:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C723150036F; Tue, 26 Feb 2019 19:07:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 322576E58B; Tue, 26 Feb 2019 19:07:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 942621E512; Tue, 26 Feb 2019 19:07:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: rgrimes@freebsd.org, Brooks Davis Cc: "K. Macy" , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201902261815.x1QIFeor047144@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Message-ID: <80226bc9-1150-4b5a-ea08-86f6bb37b23a@FreeBSD.org> Date: Tue, 26 Feb 2019 14:07:40 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <201902261815.x1QIFeor047144@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 322576E58B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 19:07:59 -0000 On 26/02/2019 13:15, Rodney W. Grimes wrote: >> On Mon, Feb 25, 2019 at 05:11:26PM -0800, K. Macy wrote: >>>> We had a brief discussion of this commit within a subset of core. This >>>> addition of GPLv2 code is fine as the code is easily removal to a module >>>> (per kmoore@) should the day come that we're read to evict all GPL code. >>> I don't execute the ctors until coverage is enabled because I have to >>> manually find the symbols. The linker doesn't actually generate a ctor >>> section for functions in text.startup in spite of what Juniper's >>> linker commit would lead one to believe - presumably they have a >>> private linker script in addition to a private gcov port. Thus, it >>> really could just work fine as a module. Nonetheless, everything to be >>> profiled needs to be compiled with instrumentation, so separating it >>> out makes very little sense to me. Although, I suppose ctfconvert + >>> dtrace module is somewhat analogous. >>> >>>> The modest increase in activation energy for that task seems worth it >>>> for the short-term gains of reduced integration cost (this code will >>>> greatly improve our ZFS-on-Linux test coverage.) >>>> >>>> Rod rightly points out that we haven't accepted SPDX tags alone as >>>> license statements. The standard GPL v2.0 boiler plate should be added >>>> to this file along side the tag. >>> I've copied the full copyright attribution that is in the >>> corresponding files on Linux. Is there some reason why FreeBSD >>> requires the files to be inflated with the full license text where the >>> original lacks it? >> We're not asking for the full text, just the standard block: >> >> // This program is free software; you can redistribute it and/or >> // modify it under the terms of the GNU General Public License >> // as published by the Free Software Foundation; either version 2 >> // of the License, or (at your option) any later version. >> // >> // This program is distributed in the hope that it will be useful, >> // but WITHOUT ANY WARRANTY; without even the implied warranty of >> // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> // GNU General Public License for more details. >> // >> // You should have received a copy of the GNU General Public License >> // along with this program; if not, write to the Free Software >> // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA >> // 02110-1301, USA. >> >> This is from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#SEC4 >> >> We're not currently using SPDX to include licenses, largely because OSI >> completely and utterly botched BSD licenses. Fixing this is WAY down >> the list of things on core's plate. Unless someone takes ownership >> here, I don't see this changing any time soon. > What is it that got botched, and what is it that needs to be done, > some may think I do not support SPDX, I do, in that originally > it was about tagging the files to mark what license applies, and > I agree we should tag the files. I howerver can not support the > concept that you can replace a copyright and/or license text in a > file with just a SPDX tag. I think I have mentioned this before although not in public. I was asked to give a talk about my experience tagging SPDX files in the FreeBSD, ande did discuss about tags-replacing-licenses informally with some lawyers working on the linux kernel. They don't all agree on replacing the license with the SPDX tag, however when it is done, they are doing it in some context: 1) They keep a complete copy of the license text in the tree. 2) The copyright owners were suggested adopt such simplifications, but they were asked to do it themselves. IANAL, but I agree that bringing such files into FreeBSD must involve bringing the license text. This could probably be done once for the gnu/ branch. > Some sight Linux as a big project using SPDX, but if you dig into > it you find out they did this to recover from there sloppyness of > actually not having anything in some 6000 files in the kernel, > they simply tagged them all GPL 2 and boom they claim problem > solved. I don't really follow the linux development to know if they followed any procedure for licensing all the files or if they assumed some context in the process. They did have a huge mess due to finding variants of the GPL with different wording and subtle differences, so I understand their interest in homogenizing the licensing somehow. At least in our case we do have a bunch of build artifacts (Makefiles) and some headers without a license. In the case of Makefiles and manpages we have made no effort to tag those with SPDX, and it probably doesn't matter much. Pedro. From owner-svn-src-head@freebsd.org Tue Feb 26 19:23:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D021500F91; Tue, 26 Feb 2019 19:23:23 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9BD6F4E7; Tue, 26 Feb 2019 19:23:23 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EFD89982; Tue, 26 Feb 2019 19:23:23 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QJNN4l013275; Tue, 26 Feb 2019 19:23:23 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QJNM4q013271; Tue, 26 Feb 2019 19:23:22 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902261923.x1QJNM4q013271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Tue, 26 Feb 2019 19:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344601 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Commit-Revision: 344601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D9BD6F4E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 19:23:24 -0000 Author: sef Date: Tue Feb 26 19:23:22 2019 New Revision: 344601 URL: https://svnweb.freebsd.org/changeset/base/344601 Log: Set process title during zfs send. This adds a '-V' option to 'zfs send', which sets the process title once a second to the progress information. This code has been in FreeNAS for a long time now; this is just upstreaming it here. It was originially written by delphij. Reviewed by: mav Obtained from: iXsystems, Inc Sponsored by: iXsystems, Inc Differential Revision: https://reviews.freebsd.org/D19184 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Feb 26 18:30:51 2019 (r344600) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Feb 26 19:23:22 2019 (r344601) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 11, 2018 +.Dd February 15, 2018 .Dt ZFS 8 .Os .Sh NAME @@ -184,7 +184,7 @@ .Ar bookmark .Nm .Cm send -.Op Fl DLPRcenpv +.Op Fl DLPRVcenpv .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm @@ -194,7 +194,7 @@ .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm send -.Op Fl Penv +.Op Fl PVenv .Fl t Ar receive_resume_token .Nm .Cm receive Ns | Ns Cm recv @@ -2607,7 +2607,7 @@ feature. .It Xo .Nm .Cm send -.Op Fl DLPRcenpv +.Op Fl DLPRVcenpv .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Xc @@ -2753,6 +2753,8 @@ Print machine-parsable verbose information about the s .It Fl v, -verbose Print verbose information about the stream package generated. This information includes a per-second report of how much data has been sent. +.It Fl V +Set the process title to a per-second report of how much data has been sent. .El .Pp The format of the stream is committed. You will be able to receive your streams Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 18:30:51 2019 (r344600) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 26 19:23:22 2019 (r344601) @@ -3813,7 +3813,7 @@ zfs_do_send(int argc, char **argv) }; /* check options */ - while ((c = getopt_long(argc, argv, ":i:I:RbDpvnPLet:c", long_options, + while ((c = getopt_long(argc, argv, ":i:I:RbDpVvnPLet:c", long_options, NULL)) != -1) { switch (c) { case 'i': @@ -3836,6 +3836,10 @@ zfs_do_send(int argc, char **argv) case 'P': flags.parsable = B_TRUE; flags.verbose = B_TRUE; + break; + case 'V': + flags.progress = B_TRUE; + flags.progressastitle = B_TRUE; break; case 'v': if (flags.verbose) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 18:30:51 2019 (r344600) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Feb 26 19:23:22 2019 (r344601) @@ -651,6 +651,9 @@ typedef struct sendflags { /* compressed WRITE records are permitted */ boolean_t compress; + + /* show progress as process title(ie. -V) */ + boolean_t progressastitle; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Feb 26 18:30:51 2019 (r344600) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Tue Feb 26 19:23:22 2019 (r344601) @@ -85,6 +85,8 @@ typedef struct progress_arg { zfs_handle_t *pa_zhp; int pa_fd; boolean_t pa_parsable; + boolean_t pa_astitle; + uint64_t pa_size; } progress_arg_t; typedef struct dataref { @@ -930,6 +932,7 @@ typedef struct send_dump_data { uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; boolean_t verbose, dryrun, parsable, progress, embed_data, std_out; + boolean_t progressastitle; boolean_t large_block, compress; int outfd; boolean_t err; @@ -1110,14 +1113,14 @@ send_progress_thread(void *arg) zfs_cmd_t zc = { 0 }; zfs_handle_t *zhp = pa->pa_zhp; libzfs_handle_t *hdl = zhp->zfs_hdl; - unsigned long long bytes; + unsigned long long bytes, total; char buf[16]; time_t t; struct tm *tm; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - if (!pa->pa_parsable) + if (!pa->pa_parsable && !pa->pa_astitle) (void) fprintf(stderr, "TIME SENT SNAPSHOT\n"); /* @@ -1134,7 +1137,16 @@ send_progress_thread(void *arg) tm = localtime(&t); bytes = zc.zc_cookie; - if (pa->pa_parsable) { + if (pa->pa_astitle) { + int pct; + if (pa->pa_size > bytes) + pct = 100 * bytes / pa->pa_size; + else + pct = 100; + + setproctitle("sending %s (%d%%: %llu/%llu)", + zhp->zfs_name, pct, bytes, pa->pa_size); + } else if (pa->pa_parsable) { (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n", tm->tm_hour, tm->tm_min, tm->tm_sec, bytes, zhp->zfs_name); @@ -1204,6 +1216,7 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; FILE *fout = sdd->std_out ? stdout : stderr; + uint64_t size = 0; err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; @@ -1278,15 +1291,16 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); - if (sdd->verbose) { - uint64_t size = 0; + if (sdd->progress && sdd->dryrun) { (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, flags, &size); + sdd->size += size; + } + if (sdd->verbose) { send_print_verbose(fout, zhp->zfs_name, sdd->prevsnap[0] ? sdd->prevsnap : NULL, size, sdd->parsable); - sdd->size += size; } if (!sdd->dryrun) { @@ -1298,6 +1312,8 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) pa.pa_zhp = zhp; pa.pa_fd = sdd->outfd; pa.pa_parsable = sdd->parsable; + pa.pa_size = sdd->size; + pa.pa_astitle = sdd->progressastitle; if ((err = pthread_create(&tid, NULL, send_progress_thread, &pa)) != 0) { @@ -1580,6 +1596,7 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla int error = 0; char name[ZFS_MAX_DATASET_NAME_LEN]; enum lzc_send_flags lzc_flags = 0; + uint64_t size = 0; FILE *fout = (flags->verbose && flags->dryrun) ? stdout : stderr; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, @@ -1648,12 +1665,13 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla fromname = name; } - if (flags->verbose) { - uint64_t size = 0; + if (flags->progress) { error = lzc_send_space(zhp->zfs_name, fromname, lzc_flags, &size); if (error == 0) size = MAX(0, (int64_t)(size - bytes)); + } + if (flags->verbose) { send_print_verbose(fout, zhp->zfs_name, fromname, size, flags->parsable); } @@ -1669,6 +1687,8 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla pa.pa_zhp = zhp; pa.pa_fd = outfd; pa.pa_parsable = flags->parsable; + pa.pa_size = size; + pa.pa_astitle = flags->progressastitle; error = pthread_create(&tid, NULL, send_progress_thread, &pa); @@ -1878,6 +1898,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons sdd.verbose = flags->verbose; sdd.parsable = flags->parsable; sdd.progress = flags->progress; + sdd.progressastitle = flags->progressastitle; sdd.dryrun = flags->dryrun; sdd.large_block = flags->largeblock; sdd.embed_data = flags->embed_data; @@ -1914,7 +1935,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons sdd.cleanup_fd = -1; sdd.snapholds = NULL; } - if (flags->verbose || sdd.snapholds != NULL) { + if (flags->progress || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output * or to gather snapshot hold's before generating any data, From owner-svn-src-head@freebsd.org Tue Feb 26 19:31:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67685150111D; Tue, 26 Feb 2019 19:31:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1663B6F957; Tue, 26 Feb 2019 19:31:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2CA59AFD; Tue, 26 Feb 2019 19:31:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QJVcaJ017507; Tue, 26 Feb 2019 19:31:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QJVYqj017483; Tue, 26 Feb 2019 19:31:34 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201902261931.x1QJVYqj017483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 26 Feb 2019 19:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344602 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn c... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/a... X-SVN-Commit-Revision: 344602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1663B6F957 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 19:31:40 -0000 Author: jkim Date: Tue Feb 26 19:31:33 2019 New Revision: 344602 URL: https://svnweb.freebsd.org/changeset/base/344602 Log: Merge OpenSSL 1.1.1b. Modified: head/crypto/openssl/CHANGES head/crypto/openssl/CONTRIBUTING head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/LICENSE head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/ct_log_list.cnf head/crypto/openssl/apps/dh1024.pem head/crypto/openssl/apps/dh2048.pem head/crypto/openssl/apps/dh4096.pem head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.cnf head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/rehash.c head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/verify.c head/crypto/openssl/config head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesv8-armx.pl head/crypto/openssl/crypto/aes/asm/bsaes-x86_64.pl head/crypto/openssl/crypto/aes/asm/vpaes-armv8.pl head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl head/crypto/openssl/crypto/armcap.c head/crypto/openssl/crypto/asn1/a_digest.c head/crypto/openssl/crypto/asn1/a_sign.c head/crypto/openssl/crypto/asn1/a_verify.c head/crypto/openssl/crypto/asn1/ameth_lib.c head/crypto/openssl/crypto/asn1/charmap.h head/crypto/openssl/crypto/asn1/charmap.pl head/crypto/openssl/crypto/asn1/d2i_pu.c head/crypto/openssl/crypto/bio/b_addr.c head/crypto/openssl/crypto/bio/bss_file.c head/crypto/openssl/crypto/bio/bss_mem.c head/crypto/openssl/crypto/bn/asm/armv8-mont.pl head/crypto/openssl/crypto/bn/asm/ia64.S head/crypto/openssl/crypto/bn/asm/mips.pl head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl head/crypto/openssl/crypto/bn/asm/sparcv8plus.S head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/bn/bn_ctx.c head/crypto/openssl/crypto/bn/bn_depr.c head/crypto/openssl/crypto/bn/bn_div.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_prime.h head/crypto/openssl/crypto/bn/bn_prime.pl head/crypto/openssl/crypto/bn/bn_shift.c head/crypto/openssl/crypto/chacha/asm/chacha-armv8.pl head/crypto/openssl/crypto/cms/cms_kari.c head/crypto/openssl/crypto/cms/cms_pwri.c head/crypto/openssl/crypto/conf/conf_def.c head/crypto/openssl/crypto/conf/conf_def.h head/crypto/openssl/crypto/conf/conf_lib.c head/crypto/openssl/crypto/conf/conf_mod.c head/crypto/openssl/crypto/conf/conf_sap.c head/crypto/openssl/crypto/conf/conf_ssl.c head/crypto/openssl/crypto/conf/keysets.pl head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/des/asm/des_enc.m4 head/crypto/openssl/crypto/dso/dso_dlfcn.c head/crypto/openssl/crypto/ec/asm/ecp_nistz256-armv8.pl head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl head/crypto/openssl/crypto/ec/curve25519.c head/crypto/openssl/crypto/ec/curve448/eddsa.c head/crypto/openssl/crypto/ec/curve448/point_448.h head/crypto/openssl/crypto/ec/ec2_smpl.c head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_err.c head/crypto/openssl/crypto/ec/ec_lcl.h head/crypto/openssl/crypto/ec/ecp_mont.c head/crypto/openssl/crypto/ec/ecp_nist.c head/crypto/openssl/crypto/ec/ecp_nistp224.c head/crypto/openssl/crypto/ec/ecp_nistp256.c head/crypto/openssl/crypto/ec/ecp_nistp521.c head/crypto/openssl/crypto/ec/ecp_nistz256.c head/crypto/openssl/crypto/ec/ecp_smpl.c head/crypto/openssl/crypto/ec/ecx_meth.c head/crypto/openssl/crypto/engine/README head/crypto/openssl/crypto/engine/eng_devcrypto.c head/crypto/openssl/crypto/engine/eng_lib.c head/crypto/openssl/crypto/err/err.c head/crypto/openssl/crypto/err/openssl.txt head/crypto/openssl/crypto/evp/evp_enc.c head/crypto/openssl/crypto/evp/evp_err.c head/crypto/openssl/crypto/evp/p_lib.c head/crypto/openssl/crypto/include/internal/bn_int.h head/crypto/openssl/crypto/init.c head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl head/crypto/openssl/crypto/objects/obj_dat.h head/crypto/openssl/crypto/objects/obj_dat.pl head/crypto/openssl/crypto/objects/obj_xref.h head/crypto/openssl/crypto/objects/objects.pl head/crypto/openssl/crypto/objects/objxref.pl head/crypto/openssl/crypto/pem/pem_info.c head/crypto/openssl/crypto/perlasm/x86_64-xlate.pl head/crypto/openssl/crypto/poly1305/asm/poly1305-armv8.pl head/crypto/openssl/crypto/ppc_arch.h head/crypto/openssl/crypto/ppccap.c head/crypto/openssl/crypto/ppccpuid.pl head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rsa/rsa_ameth.c head/crypto/openssl/crypto/rsa/rsa_oaep.c head/crypto/openssl/crypto/rsa/rsa_ossl.c head/crypto/openssl/crypto/rsa/rsa_pk1.c head/crypto/openssl/crypto/rsa/rsa_ssl.c head/crypto/openssl/crypto/rsa/rsa_x931g.c head/crypto/openssl/crypto/sha/asm/keccak1600-armv8.pl head/crypto/openssl/crypto/sha/asm/sha512-armv8.pl head/crypto/openssl/crypto/srp/srp_lib.c head/crypto/openssl/crypto/srp/srp_vfy.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/uid.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509/x_crl.c head/crypto/openssl/crypto/x509/x_pubkey.c head/crypto/openssl/crypto/x509/x_x509.c head/crypto/openssl/doc/HOWTO/certificates.txt head/crypto/openssl/doc/HOWTO/proxy_certificates.txt head/crypto/openssl/doc/fingerprints.txt head/crypto/openssl/doc/man1/ca.pod head/crypto/openssl/doc/man1/ciphers.pod head/crypto/openssl/doc/man1/cms.pod head/crypto/openssl/doc/man1/dgst.pod head/crypto/openssl/doc/man1/ec.pod head/crypto/openssl/doc/man1/enc.pod head/crypto/openssl/doc/man1/genpkey.pod head/crypto/openssl/doc/man1/ocsp.pod head/crypto/openssl/doc/man1/pkcs12.pod head/crypto/openssl/doc/man1/pkcs8.pod head/crypto/openssl/doc/man1/req.pod head/crypto/openssl/doc/man1/s_client.pod head/crypto/openssl/doc/man1/s_server.pod head/crypto/openssl/doc/man1/smime.pod head/crypto/openssl/doc/man1/storeutl.pod head/crypto/openssl/doc/man1/verify.pod head/crypto/openssl/doc/man1/x509.pod head/crypto/openssl/doc/man3/ASN1_INTEGER_get_int64.pod head/crypto/openssl/doc/man3/ASYNC_WAIT_CTX_new.pod head/crypto/openssl/doc/man3/ASYNC_start_job.pod head/crypto/openssl/doc/man3/BIO_new_CMS.pod head/crypto/openssl/doc/man3/BN_generate_prime.pod head/crypto/openssl/doc/man3/BN_rand.pod head/crypto/openssl/doc/man3/BN_security_bits.pod head/crypto/openssl/doc/man3/BUF_MEM_new.pod head/crypto/openssl/doc/man3/CMS_get0_type.pod head/crypto/openssl/doc/man3/CONF_modules_load_file.pod head/crypto/openssl/doc/man3/CRYPTO_get_ex_new_index.pod head/crypto/openssl/doc/man3/CTLOG_STORE_get0_log_by_id.pod head/crypto/openssl/doc/man3/DH_size.pod head/crypto/openssl/doc/man3/DTLS_get_data_mtu.pod head/crypto/openssl/doc/man3/DTLS_set_timer_cb.pod head/crypto/openssl/doc/man3/DTLSv1_listen.pod head/crypto/openssl/doc/man3/EC_GROUP_copy.pod head/crypto/openssl/doc/man3/EVP_DigestInit.pod head/crypto/openssl/doc/man3/EVP_DigestSignInit.pod head/crypto/openssl/doc/man3/EVP_DigestVerifyInit.pod head/crypto/openssl/doc/man3/EVP_EncryptInit.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_ctrl.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_new.pod head/crypto/openssl/doc/man3/EVP_PKEY_asn1_get_count.pod head/crypto/openssl/doc/man3/EVP_PKEY_decrypt.pod head/crypto/openssl/doc/man3/EVP_PKEY_derive.pod head/crypto/openssl/doc/man3/EVP_PKEY_encrypt.pod head/crypto/openssl/doc/man3/EVP_PKEY_get_default_digest_nid.pod head/crypto/openssl/doc/man3/EVP_PKEY_keygen.pod head/crypto/openssl/doc/man3/EVP_PKEY_new.pod head/crypto/openssl/doc/man3/EVP_PKEY_print_private.pod head/crypto/openssl/doc/man3/EVP_PKEY_sign.pod head/crypto/openssl/doc/man3/EVP_PKEY_verify.pod head/crypto/openssl/doc/man3/EVP_PKEY_verify_recover.pod head/crypto/openssl/doc/man3/EVP_SignInit.pod head/crypto/openssl/doc/man3/HMAC.pod head/crypto/openssl/doc/man3/OPENSSL_init_crypto.pod head/crypto/openssl/doc/man3/OPENSSL_malloc.pod head/crypto/openssl/doc/man3/OPENSSL_secure_malloc.pod head/crypto/openssl/doc/man3/OSSL_STORE_INFO.pod head/crypto/openssl/doc/man3/OSSL_STORE_LOADER.pod head/crypto/openssl/doc/man3/OSSL_STORE_SEARCH.pod head/crypto/openssl/doc/man3/OSSL_STORE_expect.pod head/crypto/openssl/doc/man3/OSSL_STORE_open.pod head/crypto/openssl/doc/man3/PEM_read_bio_ex.pod head/crypto/openssl/doc/man3/PEM_write_bio_CMS_stream.pod head/crypto/openssl/doc/man3/PEM_write_bio_PKCS7_stream.pod head/crypto/openssl/doc/man3/PKCS12_parse.pod head/crypto/openssl/doc/man3/PKCS7_sign.pod head/crypto/openssl/doc/man3/PKCS7_sign_add_signer.pod head/crypto/openssl/doc/man3/RAND_bytes.pod head/crypto/openssl/doc/man3/RIPEMD160_Init.pod head/crypto/openssl/doc/man3/RSA_get0_key.pod head/crypto/openssl/doc/man3/RSA_padding_add_PKCS1_type_1.pod head/crypto/openssl/doc/man3/RSA_size.pod head/crypto/openssl/doc/man3/SSL_CIPHER_get_name.pod head/crypto/openssl/doc/man3/SSL_COMP_add_compression_method.pod head/crypto/openssl/doc/man3/SSL_CONF_CTX_new.pod head/crypto/openssl/doc/man3/SSL_CONF_CTX_set1_prefix.pod head/crypto/openssl/doc/man3/SSL_CONF_CTX_set_flags.pod head/crypto/openssl/doc/man3/SSL_CONF_CTX_set_ssl_ctx.pod head/crypto/openssl/doc/man3/SSL_CONF_cmd.pod head/crypto/openssl/doc/man3/SSL_CONF_cmd_argv.pod head/crypto/openssl/doc/man3/SSL_CTX_add1_chain_cert.pod head/crypto/openssl/doc/man3/SSL_CTX_config.pod head/crypto/openssl/doc/man3/SSL_CTX_dane_enable.pod head/crypto/openssl/doc/man3/SSL_CTX_get0_param.pod head/crypto/openssl/doc/man3/SSL_CTX_set0_CA_list.pod head/crypto/openssl/doc/man3/SSL_CTX_set1_curves.pod head/crypto/openssl/doc/man3/SSL_CTX_set1_verify_cert_store.pod head/crypto/openssl/doc/man3/SSL_CTX_set_ctlog_list_file.pod head/crypto/openssl/doc/man3/SSL_CTX_set_default_passwd_cb.pod head/crypto/openssl/doc/man3/SSL_CTX_set_info_callback.pod head/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod head/crypto/openssl/doc/man3/SSL_CTX_set_msg_callback.pod head/crypto/openssl/doc/man3/SSL_CTX_set_num_tickets.pod head/crypto/openssl/doc/man3/SSL_CTX_set_options.pod head/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod head/crypto/openssl/doc/man3/SSL_CTX_set_security_level.pod head/crypto/openssl/doc/man3/SSL_CTX_set_session_ticket_cb.pod head/crypto/openssl/doc/man3/SSL_CTX_set_split_send_fragment.pod head/crypto/openssl/doc/man3/SSL_CTX_set_ssl_version.pod head/crypto/openssl/doc/man3/SSL_CTX_set_tlsext_status_cb.pod head/crypto/openssl/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod head/crypto/openssl/doc/man3/SSL_SESSION_free.pod head/crypto/openssl/doc/man3/SSL_SESSION_get0_cipher.pod head/crypto/openssl/doc/man3/SSL_SESSION_get0_hostname.pod head/crypto/openssl/doc/man3/SSL_SESSION_get0_id_context.pod head/crypto/openssl/doc/man3/SSL_SESSION_get_protocol_version.pod head/crypto/openssl/doc/man3/SSL_SESSION_has_ticket.pod head/crypto/openssl/doc/man3/SSL_SESSION_is_resumable.pod head/crypto/openssl/doc/man3/SSL_SESSION_set1_id.pod head/crypto/openssl/doc/man3/SSL_export_keying_material.pod head/crypto/openssl/doc/man3/SSL_extension_supported.pod head/crypto/openssl/doc/man3/SSL_get_all_async_fds.pod head/crypto/openssl/doc/man3/SSL_get_error.pod head/crypto/openssl/doc/man3/SSL_get_version.pod head/crypto/openssl/doc/man3/SSL_key_update.pod head/crypto/openssl/doc/man3/SSL_read.pod head/crypto/openssl/doc/man3/SSL_read_early_data.pod head/crypto/openssl/doc/man3/SSL_set1_host.pod head/crypto/openssl/doc/man3/SSL_shutdown.pod head/crypto/openssl/doc/man3/SSL_want.pod head/crypto/openssl/doc/man3/SSL_write.pod head/crypto/openssl/doc/man3/UI_create_method.pod head/crypto/openssl/doc/man3/UI_new.pod head/crypto/openssl/doc/man3/X509_NAME_ENTRY_get_object.pod head/crypto/openssl/doc/man3/X509_STORE_CTX_new.pod head/crypto/openssl/doc/man3/X509_STORE_CTX_set_verify_cb.pod head/crypto/openssl/doc/man3/X509_STORE_new.pod head/crypto/openssl/doc/man3/X509_STORE_set_verify_cb_func.pod head/crypto/openssl/doc/man3/X509_VERIFY_PARAM_set_flags.pod head/crypto/openssl/doc/man3/X509_get0_signature.pod head/crypto/openssl/doc/man3/X509_get_serialNumber.pod head/crypto/openssl/doc/man3/X509_get_subject_name.pod head/crypto/openssl/doc/man3/X509_sign.pod head/crypto/openssl/doc/man3/d2i_PrivateKey.pod head/crypto/openssl/doc/man3/i2d_CMS_bio_stream.pod head/crypto/openssl/doc/man3/i2d_PKCS7_bio_stream.pod head/crypto/openssl/doc/man5/config.pod head/crypto/openssl/doc/man7/ct.pod head/crypto/openssl/e_os.h head/crypto/openssl/engines/e_dasync.c head/crypto/openssl/include/internal/conf.h head/crypto/openssl/include/internal/constant_time_locl.h head/crypto/openssl/include/internal/cryptlib.h head/crypto/openssl/include/internal/sockets.h head/crypto/openssl/include/internal/thread_once.h head/crypto/openssl/include/internal/tsan_assist.h head/crypto/openssl/include/openssl/crypto.h head/crypto/openssl/include/openssl/e_os2.h head/crypto/openssl/include/openssl/ecerr.h head/crypto/openssl/include/openssl/evp.h head/crypto/openssl/include/openssl/evperr.h head/crypto/openssl/include/openssl/lhash.h head/crypto/openssl/include/openssl/obj_mac.h head/crypto/openssl/include/openssl/opensslv.h head/crypto/openssl/include/openssl/safestack.h head/crypto/openssl/include/openssl/ssl.h head/crypto/openssl/include/openssl/sslerr.h head/crypto/openssl/include/openssl/x509_vfy.h head/crypto/openssl/ssl/record/rec_layer_d1.c head/crypto/openssl/ssl/record/rec_layer_s3.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_init.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/statem/extensions.c head/crypto/openssl/ssl/statem/statem.c head/crypto/openssl/ssl/statem/statem_clnt.c head/crypto/openssl/ssl/statem/statem_lib.c head/crypto/openssl/ssl/statem/statem_locl.h head/crypto/openssl/ssl/statem/statem_srvr.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls13_enc.c head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/aarch64/aesv8-armx.S head/secure/lib/libcrypto/aarch64/armv8-mont.S head/secure/lib/libcrypto/aarch64/chacha-armv8.S head/secure/lib/libcrypto/aarch64/ecp_nistz256-armv8.S head/secure/lib/libcrypto/aarch64/keccak1600-armv8.S head/secure/lib/libcrypto/aarch64/poly1305-armv8.S head/secure/lib/libcrypto/aarch64/sha256-armv8.S head/secure/lib/libcrypto/aarch64/sha512-armv8.S head/secure/lib/libcrypto/aarch64/vpaes-armv8.S head/secure/lib/libcrypto/amd64/aes-x86_64.S head/secure/lib/libcrypto/amd64/aesni-x86_64.S head/secure/lib/libcrypto/amd64/bsaes-x86_64.S head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S head/secure/lib/libcrypto/amd64/ghash-x86_64.S head/secure/lib/libcrypto/amd64/rsaz-avx2.S head/secure/lib/libcrypto/amd64/vpaes-x86_64.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/engine.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/list.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/prime.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/srp.1 head/secure/usr.bin/openssl/man/storeutl.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/CHANGES Tue Feb 26 19:31:33 2019 (r344602) @@ -7,6 +7,44 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1a and 1.1.1b [26 Feb 2019] + + *) Added SCA hardening for modular field inversion in EC_GROUP through + a new dedicated field_inv() pointer in EC_METHOD. + This also addresses a leakage affecting conversions from projective + to affine coordinates. + [Billy Bob Brumley, Nicola Tuveri] + + *) Change the info callback signals for the start and end of a post-handshake + message exchange in TLSv1.3. In 1.1.1/1.1.1a we used SSL_CB_HANDSHAKE_START + and SSL_CB_HANDSHAKE_DONE. Experience has shown that many applications get + confused by this and assume that a TLSv1.2 renegotiation has started. This + can break KeyUpdate handling. Instead we no longer signal the start and end + of a post handshake message exchange (although the messages themselves are + still signalled). This could break some applications that were expecting + the old signals. However without this KeyUpdate is not usable for many + applications. + [Matt Caswell] + + *) Fix a bug in the computation of the endpoint-pair shared secret used + by DTLS over SCTP. This breaks interoperability with older versions + of OpenSSL like OpenSSL 1.1.0 and OpenSSL 1.0.2. There is a runtime + switch SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG (off by default) enabling + interoperability with such broken implementations. However, enabling + this switch breaks interoperability with correct implementations. + + *) Fix a use after free bug in d2i_X509_PUBKEY when overwriting a + re-used X509_PUBKEY object if the second PUBKEY is malformed. + [Bernd Edlinger] + + *) Move strictness check from EVP_PKEY_asn1_new() to EVP_PKEY_asn1_add0(). + [Richard Levitte] + + *) Remove the 'dist' target and add a tarball building script. The + 'dist' target has fallen out of use, and it shouldn't be + necessary to configure just to create a source distribution. + [Richard Levitte] + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] *) Timing vulnerability in DSA signature generation Modified: head/crypto/openssl/CONTRIBUTING ============================================================================== --- head/crypto/openssl/CONTRIBUTING Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/CONTRIBUTING Tue Feb 26 19:31:33 2019 (r344602) @@ -57,7 +57,7 @@ guidelines: 7. For user visible changes (API changes, behaviour changes, ...), consider adding a note in CHANGES. This could be a summarising description of the change, and could explain the grander details. - Have a look through existing entries for inspiration. + Have a look through existing entries for inspiration. Please note that this is NOT simply a copy of git-log oneliners. Also note that security fixes get an entry in CHANGES. This file helps users get more in depth information of what comes Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/Configure Tue Feb 26 19:31:33 2019 (r344602) @@ -1,6 +1,6 @@ #! /usr/bin/env perl # -*- mode: perl; -*- -# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -144,6 +144,8 @@ my $gcc_devteam_warn = "-DDEBUG_UNUSED" # -Wlanguage-extension-token -- no, we use asm() # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc # -Wextended-offsetof -- no, needed in CMS ASN1 code +# -Wunused-function -- no, it forces header use of safestack et al +# DEFINE macros my $clang_devteam_warn = "" . " -Wswitch-default" . " -Wno-parentheses-equality" @@ -153,6 +155,7 @@ my $clang_devteam_warn = "" . " -Wincompatible-pointer-types-discards-qualifiers" . " -Wmissing-variable-declarations" . " -Wno-unknown-warning-option" + . " -Wno-unused-function" ; # This adds backtrace information to the memory leak info. Is only used @@ -374,6 +377,7 @@ my @disablables = ( "msan", "multiblock", "nextprotoneg", + "pinshared", "ocb", "ocsp", "pic", @@ -1110,13 +1114,13 @@ foreach my $feature (@{$target{disable}}) { $disabled{$feature} = 'config'; } foreach my $feature (@{$target{enable}}) { - if ("default" eq ($disabled{$_} // "")) { + if ("default" eq ($disabled{$feature} // "")) { if (exists $deprecated_disablables{$feature}) { warn "***** config $target enables deprecated feature $feature\n"; } elsif (!grep { $feature eq $_ } @disablables) { die "***** config $target enables unknown feature $feature\n"; } - delete $disabled{$_}; + delete $disabled{$feature}; } } @@ -1370,6 +1374,7 @@ unless ($disabled{asm}) { push @{$config{lib_defines}}, "OPENSSL_BN_ASM_MONT" if ($target{bn_asm_src} =~ /-mont/); push @{$config{lib_defines}}, "OPENSSL_BN_ASM_MONT5" if ($target{bn_asm_src} =~ /-mont5/); push @{$config{lib_defines}}, "OPENSSL_BN_ASM_GF2m" if ($target{bn_asm_src} =~ /-gf2m/); + push @{$config{lib_defines}}, "BN_DIV3W" if ($target{bn_asm_src} =~ /-div3w/); if ($target{sha1_asm_src}) { push @{$config{lib_defines}}, "SHA1_ASM" if ($target{sha1_asm_src} =~ /sx86/ || $target{sha1_asm_src} =~ /sha1/); Modified: head/crypto/openssl/INSTALL ============================================================================== --- head/crypto/openssl/INSTALL Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/INSTALL Tue Feb 26 19:31:33 2019 (r344602) @@ -326,6 +326,11 @@ Don't build support for datagram based BIOs. Selecting this option will also force the disabling of DTLS. + enable-devcryptoeng + Build the /dev/crypto engine. It is automatically selected + on BSD implementations, in which case it can be disabled with + no-devcryptoeng. + no-dso Don't build support for loading Dynamic Shared Objects. @@ -402,6 +407,24 @@ no-pic Don't build with support for Position Independent Code. + no-pinshared By default OpenSSL will attempt to stay in memory until the + process exits. This is so that libcrypto and libssl can be + properly cleaned up automatically via an "atexit()" handler. + The handler is registered by libcrypto and cleans up both + libraries. On some platforms the atexit() handler will run on + unload of libcrypto (if it has been dynamically loaded) + rather than at process exit. This option can be used to stop + OpenSSL from attempting to stay in memory until the process + exits. This could lead to crashes if either libcrypto or + libssl have already been unloaded at the point + that the atexit handler is invoked, e.g. on a platform which + calls atexit() on unload of the library, and libssl is + unloaded before libcrypto then a crash is likely to happen. + Applications can suppress running of the atexit() handler at + run time by using the OPENSSL_INIT_NO_ATEXIT option to + OPENSSL_init_crypto(). See the man page for it for further + details. + no-posix-io Don't use POSIX IO capabilities. @@ -941,10 +964,10 @@ * COMPILING existing applications - OpenSSL 1.1.0 hides a number of structures that were previously - open. This includes all internal libssl structures and a number - of EVP types. Accessor functions have been added to allow - controlled access to the structures' data. + Starting with version 1.1.0, OpenSSL hides a number of structures + that were previously open. This includes all internal libssl + structures and a number of EVP types. Accessor functions have + been added to allow controlled access to the structures' data. This means that some software needs to be rewritten to adapt to the new ways of doing things. This often amounts to allocating @@ -1047,7 +1070,7 @@ depend Rebuild the dependencies in the Makefiles. This is a legacy - option that no longer needs to be used in OpenSSL 1.1.0. + option that no longer needs to be used since OpenSSL 1.1.0. install Install all OpenSSL components. Modified: head/crypto/openssl/LICENSE ============================================================================== --- head/crypto/openssl/LICENSE Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/LICENSE Tue Feb 26 19:31:33 2019 (r344602) @@ -10,14 +10,14 @@ --------------- /* ==================================================================== - * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2019 The OpenSSL Project. 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. + * 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 @@ -72,21 +72,21 @@ * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. - * + * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * + * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -101,10 +101,10 @@ * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from + * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * + * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -116,7 +116,7 @@ * 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. - * + * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/NEWS Tue Feb 26 19:31:33 2019 (r344602) @@ -5,6 +5,13 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1a and OpenSSL 1.1.1b [26 Feb 2019] + + o Change the info callback signals for the start and end of a post-handshake + message exchange in TLSv1.3. + o Fix a bug in DTLS over SCTP. This breaks interoperability with older versions + of OpenSSL like OpenSSL 1.1.0 and OpenSSL 1.0.2. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] o Timing vulnerability in DSA signature generation (CVE-2018-0734) Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/README Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1a 20 Nov 2018 + OpenSSL 1.1.1b 26 Feb 2019 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/apps.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1561,7 +1561,7 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr #else BIO_snprintf(buf, sizeof(buf), "%s-attr", dbfile); #endif - dbattr_conf = app_load_config(buf); + dbattr_conf = app_load_config_quiet(buf); retdb = app_malloc(sizeof(*retdb), "new DB"); retdb->db = tmpdb; @@ -2196,7 +2196,7 @@ double app_tminterval(int stop, int usertime) return ret; } -#elif defined(OPENSSL_SYSTEM_VXWORKS) +#elif defined(OPENSSL_SYS_VXWORKS) # include double app_tminterval(int stop, int usertime) Modified: head/crypto/openssl/apps/ct_log_list.cnf ============================================================================== --- head/crypto/openssl/apps/ct_log_list.cnf Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/ct_log_list.cnf Tue Feb 26 19:31:33 2019 (r344602) @@ -2,8 +2,8 @@ # that are to be trusted. # Google's list of logs can be found here: -# www.certificate-transparency.org/known-logs +# www.certificate-transparency.org/known-logs # A Python program to convert the log list to OpenSSL's format can be # found here: -# https://github.com/google/certificate-transparency/blob/master/python/utilities/log_list/print_log_list.py +# https://github.com/google/certificate-transparency/blob/master/python/utilities/log_list/print_log_list.py # Use the "--openssl_output" flag. Modified: head/crypto/openssl/apps/dh1024.pem ============================================================================== --- head/crypto/openssl/apps/dh1024.pem Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/dh1024.pem Tue Feb 26 19:31:33 2019 (r344602) @@ -4,7 +4,7 @@ Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9E /1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEC -----END DH PARAMETERS----- -These are the 1024-bit DH parameters from "Internet Key Exchange +These are the 1024-bit DH parameters from "Internet Key Exchange Protocol Version 2 (IKEv2)": https://tools.ietf.org/html/rfc5996 See https://tools.ietf.org/html/rfc2412 for how they were generated. Modified: head/crypto/openssl/apps/dh2048.pem ============================================================================== --- head/crypto/openssl/apps/dh2048.pem Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/dh2048.pem Tue Feb 26 19:31:33 2019 (r344602) @@ -7,8 +7,8 @@ fDKQXkYuNs474553LBgOhgObJ4Oi7Aeij7XFXfBvTFLJ3ivL9pVYFx 5RXSJhiY+gUQFXKOWoqsqmj//////////wIBAg== -----END DH PARAMETERS----- -These are the 2048-bit DH parameters from "More Modular Exponential -(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": +These are the 2048-bit DH parameters from "More Modular Exponential +(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": https://tools.ietf.org/html/rfc3526 See https://tools.ietf.org/html/rfc2412 for how they were generated. Modified: head/crypto/openssl/apps/dh4096.pem ============================================================================== --- head/crypto/openssl/apps/dh4096.pem Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/dh4096.pem Tue Feb 26 19:31:33 2019 (r344602) @@ -12,8 +12,8 @@ ARpyPBKnh+bXiHGaEL26WyaZwycYavTiPBqUaDS2FQvaJYPpyirUTO HNAGkSfVsFqpk7TqmI2P3cGG/7fckKbAj030Nck0BjGZ//////////8CAQI= -----END DH PARAMETERS----- -These are the 4096-bit DH parameters from "More Modular Exponential -(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": +These are the 4096-bit DH parameters from "More Modular Exponential +(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)": https://tools.ietf.org/html/rfc3526 See https://tools.ietf.org/html/rfc2412 for how they were generated. Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/ocsp.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -36,7 +36,21 @@ NON_EMPTY_TRANSLATION_UNIT # include # include -# if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_NO_SOCK) \ +#ifndef HAVE_FORK +# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) +# define HAVE_FORK 0 +# else +# define HAVE_FORK 1 +# endif +#endif + +#if HAVE_FORK +# undef NO_FORK +#else +# define NO_FORK +#endif + +# if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \ && !defined(OPENSSL_NO_POSIX_IO) # define OCSP_DAEMON # include @@ -53,6 +67,20 @@ NON_EMPTY_TRANSLATION_UNIT # define LOG_ERR 2 # endif +# if defined(OPENSSL_SYS_VXWORKS) +/* not supported */ +int setpgid(pid_t pid, pid_t pgid) +{ + errno = ENOSYS; + return 0; +} +/* not supported */ +pid_t fork(void) +{ + errno = ENOSYS; + return (pid_t) -1; +} +# endif /* Maximum leeway in validity period: default 5 minutes */ # define MAX_VALIDITY_PERIOD (5 * 60) @@ -863,6 +891,7 @@ static void killall(int ret, pid_t *kidpids) for (i = 0; i < multi; ++i) if (kidpids[i] != 0) (void)kill(kidpids[i], SIGTERM); + OPENSSL_free(kidpids); sleep(1); exit(ret); } @@ -977,7 +1006,6 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ - OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: head/crypto/openssl/apps/openssl.cnf ============================================================================== --- head/crypto/openssl/apps/openssl.cnf Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/openssl.cnf Tue Feb 26 19:31:33 2019 (r344602) @@ -19,7 +19,7 @@ oid_section = new_oids # To use this configuration file with the "-extfile" option of the # "openssl x509" utility, name here the section containing the # X.509v3 extensions to use: -# extensions = +# extensions = # (Alternatively, use a configuration file that has only # X.509v3 extensions in its main [= default] section.) @@ -116,7 +116,7 @@ x509_extensions = v3_ca # The extensions to add to the # input_password = secret # output_password = secret -# This sets a mask for permitted string types. There are several options. +# This sets a mask for permitted string types. There are several options. # default: PrintableString, T61String, BMPString. # pkix : PrintableString, BMPString (PKIX recommendation before 2004) # utf8only: only UTF8Strings (PKIX recommendation after 2004). Modified: head/crypto/openssl/apps/pkcs12.c ============================================================================== --- head/crypto/openssl/apps/pkcs12.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/pkcs12.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -311,6 +311,13 @@ int pkcs12_main(int argc, char **argv) if (cpass != NULL) { mpass = cpass; noprompt = 1; + if (twopass) { + if (export_cert) + BIO_printf(bio_err, "Option -twopass cannot be used with -passout or -password\n"); + else + BIO_printf(bio_err, "Option -twopass cannot be used with -passin or -password\n"); + goto end; + } } else { cpass = pass; mpass = macpass; Modified: head/crypto/openssl/apps/rehash.c ============================================================================== --- head/crypto/openssl/apps/rehash.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/rehash.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use @@ -50,6 +50,26 @@ # define NAME_MAX 255 # endif # define MAX_COLLISIONS 256 + +# if defined(OPENSSL_SYS_VXWORKS) +/* + * VxWorks has no symbolic links + */ + +# define lstat(path, buf) stat(path, buf) + +int symlink(const char *target, const char *linkpath) +{ + errno = ENOSYS; + return -1; +} + +ssize_t readlink(const char *pathname, char *buf, size_t bufsiz) +{ + errno = ENOSYS; + return -1; +} +# endif typedef struct hentry_st { struct hentry_st *next; Modified: head/crypto/openssl/apps/s_cb.c ============================================================================== --- head/crypto/openssl/apps/s_cb.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/s_cb.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -24,7 +24,7 @@ #define COOKIE_SECRET_LENGTH 16 -VERIFY_CB_ARGS verify_args = { 0, 0, X509_V_OK, 0 }; +VERIFY_CB_ARGS verify_args = { -1, 0, X509_V_OK, 0 }; #ifndef OPENSSL_NO_SOCK static unsigned char cookie_secret[COOKIE_SECRET_LENGTH]; @@ -63,7 +63,7 @@ int verify_callback(int ok, X509_STORE_CTX *ctx) if (!ok) { BIO_printf(bio_err, "verify error:num=%d:%s\n", err, X509_verify_cert_error_string(err)); - if (verify_args.depth >= depth) { + if (verify_args.depth < 0 || verify_args.depth >= depth) { if (!verify_args.return_error) ok = 1; verify_args.error = err; Modified: head/crypto/openssl/apps/s_client.c ============================================================================== --- head/crypto/openssl/apps/s_client.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/s_client.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2005 Nokia. All rights reserved. * * Licensed under the OpenSSL license (the "License"). You may not use @@ -74,6 +74,7 @@ static void print_stuff(BIO *berr, SSL *con, int full) static int ocsp_resp_cb(SSL *s, void *arg); #endif static int ldap_ExtendedResponse_parse(const char *buf, long rem); +static int is_dNS_name(const char *host); static int saved_errno; @@ -596,6 +597,7 @@ typedef enum OPTION_choice { #endif OPT_DANE_TLSA_RRDATA, OPT_DANE_EE_NO_NAME, OPT_ENABLE_PHA, + OPT_SCTP_LABEL_BUG, OPT_R_ENUM } OPTION_CHOICE; @@ -750,6 +752,7 @@ const OPTIONS s_client_options[] = { #endif #ifndef OPENSSL_NO_SCTP {"sctp", OPT_SCTP, '-', "Use SCTP"}, + {"sctp_label_bug", OPT_SCTP_LABEL_BUG, '-', "Enable SCTP label length bug"}, #endif #ifndef OPENSSL_NO_SSL_TRACE {"trace", OPT_TRACE, '-', "Show trace output of protocol messages"}, @@ -976,6 +979,9 @@ int s_client_main(int argc, char **argv) #endif char *psksessf = NULL; int enable_pha = 0; +#ifndef OPENSSL_NO_SCTP + int sctp_label_bug = 0; +#endif FD_ZERO(&readfds); FD_ZERO(&writefds); @@ -1121,6 +1127,7 @@ int s_client_main(int argc, char **argv) goto opthelp; break; case OPT_VERIFY_RET_ERROR: + verify = SSL_VERIFY_PEER; verify_args.return_error = 1; break; case OPT_VERIFY_QUIET: @@ -1323,6 +1330,11 @@ int s_client_main(int argc, char **argv) protocol = IPPROTO_SCTP; #endif break; + case OPT_SCTP_LABEL_BUG: +#ifndef OPENSSL_NO_SCTP + sctp_label_bug = 1; +#endif + break; case OPT_TIMEOUT: #ifndef OPENSSL_NO_DTLS enable_timeouts = 1; @@ -1707,6 +1719,11 @@ int s_client_main(int argc, char **argv) } } +#ifndef OPENSSL_NO_SCTP + if (protocol == IPPROTO_SCTP && sctp_label_bug == 1) + SSL_CTX_set_mode(ctx, SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG); +#endif + if (min_version != 0 && SSL_CTX_set_min_proto_version(ctx, min_version) == 0) goto end; @@ -1975,9 +1992,11 @@ int s_client_main(int argc, char **argv) SSL_set_mode(con, SSL_MODE_SEND_FALLBACK_SCSV); if (!noservername && (servername != NULL || dane_tlsa_domain == NULL)) { - if (servername == NULL) - servername = (host == NULL) ? "localhost" : host; - if (!SSL_set_tlsext_host_name(con, servername)) { + if (servername == NULL) { + if(host == NULL || is_dNS_name(host)) + servername = (host == NULL) ? "localhost" : host; + } + if (servername != NULL && !SSL_set_tlsext_host_name(con, servername)) { BIO_printf(bio_err, "Unable to set TLS servername extension.\n"); ERR_print_errors(bio_err); goto end; @@ -3031,9 +3050,7 @@ int s_client_main(int argc, char **argv) BIO_printf(bio_err, "RENEGOTIATING\n"); SSL_renegotiate(con); cbuf_len = 0; - } - - if (!c_ign_eof && (cbuf[0] == 'K' || cbuf[0] == 'k' ) + } else if (!c_ign_eof && (cbuf[0] == 'K' || cbuf[0] == 'k' ) && cmdletters) { BIO_printf(bio_err, "KEYUPDATE\n"); SSL_key_update(con, @@ -3459,4 +3476,69 @@ static int ldap_ExtendedResponse_parse(const char *buf return ret; } +/* + * Host dNS Name verifier: used for checking that the hostname is in dNS format + * before setting it as SNI + */ +static int is_dNS_name(const char *host) +{ + const size_t MAX_LABEL_LENGTH = 63; + size_t i; + int isdnsname = 0; + size_t length = strlen(host); + size_t label_length = 0; + int all_numeric = 1; + + /* + * Deviation from strict DNS name syntax, also check names with '_' + * Check DNS name syntax, any '-' or '.' must be internal, + * and on either side of each '.' we can't have a '-' or '.'. + * + * If the name has just one label, we don't consider it a DNS name. + */ + for (i = 0; i < length && label_length < MAX_LABEL_LENGTH; ++i) { + char c = host[i]; + + if ((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || c == '_') { + label_length += 1; + all_numeric = 0; + continue; + } + + if (c >= '0' && c <= '9') { + label_length += 1; + continue; + } + + /* Dot and hyphen cannot be first or last. */ + if (i > 0 && i < length - 1) { + if (c == '-') { + label_length += 1; + continue; + } + /* + * Next to a dot the preceding and following characters must not be + * another dot or a hyphen. Otherwise, record that the name is + * plausible, since it has two or more labels. + */ + if (c == '.' + && host[i + 1] != '.' + && host[i - 1] != '-' + && host[i + 1] != '-') { + label_length = 0; + isdnsname = 1; + continue; + } + } + isdnsname = 0; + break; + } + + /* dNS name must not be all numeric and labels must be shorter than 64 characters. */ + isdnsname &= !all_numeric && !(label_length == MAX_LABEL_LENGTH); + + return isdnsname; +} #endif /* OPENSSL_NO_SOCK */ Modified: head/crypto/openssl/apps/s_server.c ============================================================================== --- head/crypto/openssl/apps/s_server.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/s_server.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * Copyright 2005 Nokia. All rights reserved. * @@ -751,7 +751,7 @@ typedef enum OPTION_choice { OPT_CERT2, OPT_KEY2, OPT_NEXTPROTONEG, OPT_ALPN, OPT_SRTP_PROFILES, OPT_KEYMATEXPORT, OPT_KEYMATEXPORTLEN, OPT_KEYLOG_FILE, OPT_MAX_EARLY, OPT_RECV_MAX_EARLY, OPT_EARLY_DATA, - OPT_S_NUM_TICKETS, OPT_ANTI_REPLAY, OPT_NO_ANTI_REPLAY, + OPT_S_NUM_TICKETS, OPT_ANTI_REPLAY, OPT_NO_ANTI_REPLAY, OPT_SCTP_LABEL_BUG, OPT_R_ENUM, OPT_S_ENUM, OPT_V_ENUM, @@ -938,6 +938,7 @@ const OPTIONS s_server_options[] = { #endif #ifndef OPENSSL_NO_SCTP {"sctp", OPT_SCTP, '-', "Use SCTP"}, + {"sctp_label_bug", OPT_SCTP_LABEL_BUG, '-', "Enable SCTP label length bug"}, #endif #ifndef OPENSSL_NO_DH {"no_dhe", OPT_NO_DHE, '-', "Disable ephemeral DH"}, @@ -1047,6 +1048,9 @@ int s_server_main(int argc, char *argv[]) const char *keylog_file = NULL; int max_early_data = -1, recv_max_early_data = -1; char *psksessf = NULL; +#ifndef OPENSSL_NO_SCTP + int sctp_label_bug = 0; +#endif /* Init of few remaining global variables */ local_argc = argc; @@ -1407,7 +1411,7 @@ int s_server_main(int argc, char *argv[]) for (p = psk_key = opt_arg(); *p; p++) { if (isxdigit(_UC(*p))) continue; - BIO_printf(bio_err, "Not a hex number '%s'\n", *argv); + BIO_printf(bio_err, "Not a hex number '%s'\n", psk_key); goto end; } break; @@ -1490,6 +1494,11 @@ int s_server_main(int argc, char *argv[]) protocol = IPPROTO_SCTP; #endif break; + case OPT_SCTP_LABEL_BUG: +#ifndef OPENSSL_NO_SCTP + sctp_label_bug = 1; +#endif + break; case OPT_TIMEOUT: #ifndef OPENSSL_NO_DTLS enable_timeouts = 1; @@ -1792,6 +1801,12 @@ int s_server_main(int argc, char *argv[]) goto end; } } + +#ifndef OPENSSL_NO_SCTP + if (protocol == IPPROTO_SCTP && sctp_label_bug == 1) + SSL_CTX_set_mode(ctx, SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG); +#endif + if (min_version != 0 && SSL_CTX_set_min_proto_version(ctx, min_version) == 0) goto end; @@ -2754,6 +2769,8 @@ static int init_ssl_connection(SSL *con) BIO_ADDR_free(client); return 0; } + + (void)BIO_ctrl_set_connected(wbio, client); BIO_ADDR_free(client); dtlslisten = 0; } else { Modified: head/crypto/openssl/apps/speed.c ============================================================================== --- head/crypto/openssl/apps/speed.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/speed.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the OpenSSL license (the "License"). You may not use @@ -100,7 +100,7 @@ #include #ifndef HAVE_FORK -# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) +# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_VXWORKS) # define HAVE_FORK 0 # else # define HAVE_FORK 1 @@ -1499,11 +1499,11 @@ int speed_main(int argc, char **argv) {"nistp192", NID_X9_62_prime192v1, 192}, {"nistp224", NID_secp224r1, 224}, {"nistp256", NID_X9_62_prime256v1, 256}, - {"nistp384", NID_secp384r1, 384}, + {"nistp384", NID_secp384r1, 384}, {"nistp521", NID_secp521r1, 521}, /* Binary Curves */ {"nistk163", NID_sect163k1, 163}, - {"nistk233", NID_sect233k1, 233}, + {"nistk233", NID_sect233k1, 233}, {"nistk283", NID_sect283k1, 283}, {"nistk409", NID_sect409k1, 409}, {"nistk571", NID_sect571k1, 571}, Modified: head/crypto/openssl/apps/verify.c ============================================================================== --- head/crypto/openssl/apps/verify.c Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/apps/verify.c Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -286,16 +286,19 @@ static int cb(int ok, X509_STORE_CTX *ctx) cert_error, X509_STORE_CTX_get_error_depth(ctx), X509_verify_cert_error_string(cert_error)); + + /* + * Pretend that some errors are ok, so they don't stop further + * processing of the certificate chain. Setting ok = 1 does this. + * After X509_verify_cert() is done, we verify that there were + * no actual errors, even if the returned value was positive. + */ switch (cert_error) { case X509_V_ERR_NO_EXPLICIT_POLICY: policies_print(ctx); /* fall thru */ case X509_V_ERR_CERT_HAS_EXPIRED: - - /* - * since we are just checking the certificates, it is ok if they - * are self signed. But we should still warn the user. - */ + /* Continue even if the leaf is a self signed cert */ case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: /* Continue after extension errors too */ case X509_V_ERR_INVALID_CA: Modified: head/crypto/openssl/config ============================================================================== --- head/crypto/openssl/config Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/config Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -19,7 +19,7 @@ THERE=`dirname $0` # pick up any command line args to config for i do -case "$i" in +case "$i" in -d*) options=$options" --debug";; -t*) DRYRUN="true" VERBOSE="true";; -v*) VERBOSE="true";; @@ -59,7 +59,7 @@ __CNF_LDLIBS= # Now test for ISC and SCO, since it is has a braindamaged uname. # -# We need to work around FreeBSD 1.1.5.1 +# We need to work around FreeBSD 1.1.5.1 ( XREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'` if [ "x$XREL" != "x" ]; then @@ -363,7 +363,7 @@ esac # At this point we gone through all the one's # we know of: Punt -echo "${MACHINE}-whatever-${SYSTEM}" +echo "${MACHINE}-whatever-${SYSTEM}" exit 0 ) 2>/dev/null | ( @@ -433,7 +433,7 @@ fi CCVER=${CCVER:-0} -# read the output of the embedded GuessOS +# read the output of the embedded GuessOS read GUESSOS echo Operating system: $GUESSOS @@ -732,7 +732,7 @@ case "$GUESSOS" in *-*-[Uu]nix[Ww]are7) if [ "$CC" = "gcc" ]; then OUT="unixware-7-gcc" ; options="$options no-sse2" - else + else OUT="unixware-7" ; options="$options no-sse2" __CNF_CPPFLAGS="$__CNF_CPPFLAGS -D__i386__" fi @@ -793,7 +793,7 @@ case "$GUESSOS" in OUT="aix64-gcc" fi elif [ $OBJECT_MODE -eq 64 ]; then - echo 'Your $OBJECT_MODE was found to be set to 64' + echo 'Your $OBJECT_MODE was found to be set to 64' OUT="aix64-cc" else OUT="aix-cc" @@ -897,7 +897,7 @@ if [ ".$PERL" = . ] ; then exit 1 fi -# run Configure to check to see if we need to specify the +# run Configure to check to see if we need to specify the # compiler for the platform ... in which case we add it on # the end ... otherwise we leave it off @@ -920,7 +920,7 @@ if [ $? = "0" ]; then __CNF_LDFLAGS="'$__CNF_LDFLAGS'" \ __CNF_LDLIBS="'$__CNF_LDLIBS'" \ $PERL $THERE/Configure $OUT $options - fi + fi if [ "$DRYRUN" = "false" ]; then # eval to make sure quoted options, possibly with spaces inside, # are treated right Modified: head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl Tue Feb 26 19:23:22 2019 (r344601) +++ head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl Tue Feb 26 19:31:33 2019 (r344602) @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -554,6 +554,7 @@ $code.=<<___; .type _x86_64_AES_encrypt_compact,\@abi-omnipotent .align 16 _x86_64_AES_encrypt_compact: +.cfi_startproc lea 128($sbox),$inp # size optimization mov 0-128($inp),$acc1 # prefetch Te4 mov 32-128($inp),$acc2 @@ -587,6 +588,7 @@ $code.=<<___; xor 8($key),$s2 xor 12($key),$s3 .byte 0xf3,0xc3 # rep ret +.cfi_endproc .size _x86_64_AES_encrypt_compact,.-_x86_64_AES_encrypt_compact ___ @@ -1161,6 +1163,7 @@ $code.=<<___; .type _x86_64_AES_decrypt_compact,\@abi-omnipotent .align 16 _x86_64_AES_decrypt_compact: +.cfi_startproc lea 128($sbox),$inp # size optimization mov 0-128($inp),$acc1 # prefetch Td4 mov 32-128($inp),$acc2 @@ -1203,6 +1206,7 @@ $code.=<<___; xor 8($key),$s2 xor 12($key),$s3 .byte 0xf3,0xc3 # rep ret +.cfi_endproc .size _x86_64_AES_decrypt_compact,.-_x86_64_AES_decrypt_compact ___ @@ -1365,6 +1369,7 @@ AES_set_encrypt_key: .type _x86_64_AES_set_encrypt_key,\@abi-omnipotent .align 16 _x86_64_AES_set_encrypt_key: +.cfi_startproc mov %esi,%ecx # %ecx=bits mov %rdi,%rsi # %rsi=userKey mov %rdx,%rdi # %rdi=key @@ -1546,6 +1551,7 @@ $code.=<<___; mov \$-1,%rax .Lexit: .byte 0xf3,0xc3 # rep ret +.cfi_endproc .size _x86_64_AES_set_encrypt_key,.-_x86_64_AES_set_encrypt_key ___ @@ -1728,7 +1734,9 @@ AES_cbc_encrypt: cmp \$0,%rdx # check length je .Lcbc_epilogue pushfq -.cfi_push 49 # %rflags +# This could be .cfi_push 49, but libunwind fails on registers it does not +# recognize. See https://bugzilla.redhat.com/show_bug.cgi?id=217087. +.cfi_adjust_cfa_offset 8 push %rbx .cfi_push %rbx push %rbp @@ -1751,6 +1759,7 @@ AES_cbc_encrypt: cmp \$0,%r9 cmoveq %r10,$sbox +.cfi_remember_state mov OPENSSL_ia32cap_P(%rip),%r10d cmp \$$speed_limit,%rdx jb .Lcbc_slow_prologue @@ -1986,6 +1995,7 @@ AES_cbc_encrypt: #--------------------------- SLOW ROUTINE ---------------------------# .align 16 .Lcbc_slow_prologue: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Feb 26 19:55:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA6D01501D1B; Tue, 26 Feb 2019 19:55:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6444270A2E; Tue, 26 Feb 2019 19:55:14 +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 548C19F0F; Tue, 26 Feb 2019 19:55:14 +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 x1QJtEUj029665; Tue, 26 Feb 2019 19:55:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QJt31L029584; Tue, 26 Feb 2019 19:55:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902261955.x1QJt31L029584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Feb 2019 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344605 - in head: share/man/man4 sys/conf sys/contrib/xz-embedded/freebsd sys/dev/xz sys/geom/uzip sys/mips/conf sys/modules sys/modules/geom/geom_uzip sys/modules/xz X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/contrib/xz-embedded/freebsd sys/dev/xz sys/geom/uzip sys/mips/conf sys/modules sys/modules/geom/geom_uzip sys/modules/xz X-SVN-Commit-Revision: 344605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6444270A2E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 19:55:15 -0000 Author: kib Date: Tue Feb 26 19:55:03 2019 New Revision: 344605 URL: https://svnweb.freebsd.org/changeset/base/344605 Log: Modularize xz. Embedded lzma decompression library becomes a module usable by other consumers, in addition to geom_uzip. Most important code changes are - removal of XZ_DEC_SINGLE define, we need the code to work with XZ_DEC_DYNALLOC; - xz_crc32_init() call is removed from geom_uzip, xz module handles initialization on its own. xz is no longer embedded into geom_uzip, instead the depend line for the module is provided, and corresponding kernel option is added to each MIPS kernel config file using geom_uzip. The commit also carries unrelated cleanup by removing excess "device geom_uzip" in places which were missed in r344479. Reviewed by: cem, hselasky, ray, slavash (previous versions) Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D19266 MFC after: 3 weeks Added: head/sys/dev/xz/ head/sys/dev/xz/xz_mod.c - copied, changed from r344604, head/sys/contrib/xz-embedded/freebsd/xz_malloc.c head/sys/modules/xz/ head/sys/modules/xz/Makefile (contents, props changed) Deleted: head/sys/contrib/xz-embedded/freebsd/xz_malloc.c Modified: head/share/man/man4/geom_uzip.4 head/sys/conf/NOTES head/sys/conf/files head/sys/contrib/xz-embedded/freebsd/xz_config.h head/sys/geom/uzip/g_uzip.c head/sys/geom/uzip/g_uzip_lzma.c head/sys/mips/conf/ALFA_HORNET_UB head/sys/mips/conf/AP121 head/sys/mips/conf/AP135 head/sys/mips/conf/AP143 head/sys/mips/conf/AP91 head/sys/mips/conf/AP93 head/sys/mips/conf/AP94 head/sys/mips/conf/AP96 head/sys/mips/conf/BCM head/sys/mips/conf/CARAMBOLA2 head/sys/mips/conf/DB120 head/sys/mips/conf/DIR-655A1 head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/ENH200 head/sys/mips/conf/MT7620A_FDT head/sys/mips/conf/MT7620N_FDT head/sys/mips/conf/MT7621_FDT head/sys/mips/conf/MT7628_FDT head/sys/mips/conf/ONIONOMEGA head/sys/mips/conf/PB47 head/sys/mips/conf/PB92 head/sys/mips/conf/PICOSTATION_M2HP head/sys/mips/conf/ROCKET_M2HP head/sys/mips/conf/ROUTERSTATION head/sys/mips/conf/ROUTERSTATION_MFS head/sys/mips/conf/RSPRO head/sys/mips/conf/RSPRO_MFS head/sys/mips/conf/RSPRO_STANDALONE head/sys/mips/conf/RT3050_FDT head/sys/mips/conf/RT3352_FDT head/sys/mips/conf/RT3883_FDT head/sys/mips/conf/RT5350_FDT head/sys/mips/conf/TL-ARCHERC7V2 head/sys/mips/conf/TL-WDR4300 head/sys/mips/conf/TL-WR1043NDv2 head/sys/mips/conf/TL-WR740Nv4 head/sys/mips/conf/TP-MR3040 head/sys/mips/conf/TP-WN1043ND head/sys/mips/conf/WZR-300HP head/sys/mips/conf/WZR-HPAG300H head/sys/mips/conf/std.XLP head/sys/modules/Makefile head/sys/modules/geom/geom_uzip/Makefile Modified: head/share/man/man4/geom_uzip.4 ============================================================================== --- head/share/man/man4/geom_uzip.4 Tue Feb 26 19:36:57 2019 (r344604) +++ head/share/man/man4/geom_uzip.4 Tue Feb 26 19:55:03 2019 (r344605) @@ -36,6 +36,7 @@ To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device xz" .Cd "options GEOM_UZIP" .Ed .Pp Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/conf/NOTES Tue Feb 26 19:55:03 2019 (r344605) @@ -3004,3 +3004,5 @@ device n25q # device spigen # Generic access to SPI devices from userland. # Enable legacy /dev/spigenN name aliases for /dev/spigenX.Y devices. options SPIGEN_LEGACY_CDEVNAME # legacy device names for spigen + +device xz # xz_embedded LZMA de-compression library Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/conf/files Tue Feb 26 19:55:03 2019 (r344605) @@ -636,6 +636,17 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional nga compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" +# xz +dev/xz/xz_mod.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_crc32.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" +contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c optional xz \ + compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" # Zstd contrib/zstd/lib/freebsd/zstd_kmalloc.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/common/zstd_common.c optional zstdio compile-with ${ZSTD_C} @@ -3659,21 +3670,6 @@ geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec geom/stripe/g_stripe.c optional geom_stripe -contrib/xz-embedded/freebsd/xz_malloc.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_crc32.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" -contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \ - optional xz_embedded | geom_uzip \ - compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip geom/uzip/g_uzip_lzma.c optional geom_uzip geom/uzip/g_uzip_wrkthr.c optional geom_uzip Modified: head/sys/contrib/xz-embedded/freebsd/xz_config.h ============================================================================== --- head/sys/contrib/xz-embedded/freebsd/xz_config.h Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/contrib/xz-embedded/freebsd/xz_config.h Tue Feb 26 19:55:03 2019 (r344605) @@ -35,7 +35,6 @@ #include #include "xz_malloc.h" -#define XZ_DEC_SINGLE 1 #define XZ_PREBOOT 1 #undef XZ_EXTERN Copied and modified: head/sys/dev/xz/xz_mod.c (from r344604, head/sys/contrib/xz-embedded/freebsd/xz_malloc.c) ============================================================================== --- head/sys/contrib/xz-embedded/freebsd/xz_malloc.c Tue Feb 26 19:36:57 2019 (r344604, copy source) +++ head/sys/dev/xz/xz_mod.c Tue Feb 26 19:55:03 2019 (r344605) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2010-2012 Aleksandr Rybalko + * Copyright (c) 2019 Mellanox Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,11 +25,16 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include +#include +#include "xz.h" #include "xz_malloc.h" -/* Wraper for XZ decompressor memmory pool */ +/* Wraper for XZ decompressor memory pool */ static MALLOC_DEFINE(XZ_DEC, "XZ_DEC", "XZ decompressor data"); @@ -47,3 +53,38 @@ xz_free(void *addr) free(addr, XZ_DEC); } + +static int +xz_module_event_handler(module_t mod, int what, void *arg) +{ + int error; + + switch (what) { + case MOD_LOAD: +#if XZ_INTERNAL_CRC32 + xz_crc32_init(); +#endif +#if XZ_INTERNAL_CRC64 + xz_crc64_init(); +#endif + error = 0; + break; + case MOD_UNLOAD: + error = 0; + break; + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +static moduledata_t xz_moduledata = { + "xz", + xz_module_event_handler, + NULL +}; + +DECLARE_MODULE(xz, xz_moduledata, SI_SUB_INIT_IF, SI_ORDER_ANY); +MODULE_VERSION(xz, 1); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/geom/uzip/g_uzip.c Tue Feb 26 19:55:03 2019 (r344605) @@ -921,5 +921,6 @@ static struct g_class g_uzip_class = { }; DECLARE_GEOM_CLASS(g_uzip_class, g_uzip); +MODULE_DEPEND(g_uzip, xz, 1, 1, 1); MODULE_DEPEND(g_uzip, zlib, 1, 1, 1); MODULE_VERSION(geom_uzip, 0); Modified: head/sys/geom/uzip/g_uzip_lzma.c ============================================================================== --- head/sys/geom/uzip/g_uzip_lzma.c Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/geom/uzip/g_uzip_lzma.c Tue Feb 26 19:55:03 2019 (r344605) @@ -103,7 +103,6 @@ g_uzip_lzma_ctor(uint32_t blksz) struct g_uzip_lzma *lzp; lzp = malloc(sizeof(struct g_uzip_lzma), M_GEOM_UZIP, M_WAITOK); - xz_crc32_init(); lzp->s = xz_dec_init(XZ_SINGLE, 0); if (lzp->s == NULL) { goto e1; Modified: head/sys/mips/conf/ALFA_HORNET_UB ============================================================================== --- head/sys/mips/conf/ALFA_HORNET_UB Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/ALFA_HORNET_UB Tue Feb 26 19:55:03 2019 (r344605) @@ -49,7 +49,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/AP121 ============================================================================== --- head/sys/mips/conf/AP121 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP121 Tue Feb 26 19:55:03 2019 (r344605) @@ -43,7 +43,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/AP135 ============================================================================== --- head/sys/mips/conf/AP135 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP135 Tue Feb 26 19:55:03 2019 (r344605) @@ -46,7 +46,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/AP143 ============================================================================== --- head/sys/mips/conf/AP143 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP143 Tue Feb 26 19:55:03 2019 (r344605) @@ -43,7 +43,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/AP91 ============================================================================== --- head/sys/mips/conf/AP91 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP91 Tue Feb 26 19:55:03 2019 (r344605) @@ -38,7 +38,7 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP93 Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/AP94 ============================================================================== --- head/sys/mips/conf/AP94 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP94 Tue Feb 26 19:55:03 2019 (r344605) @@ -21,6 +21,7 @@ hints "AP94.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/AP96 Tue Feb 26 19:55:03 2019 (r344605) @@ -27,7 +27,7 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/BCM Tue Feb 26 19:55:03 2019 (r344605) @@ -39,7 +39,7 @@ options SOFTUPDATES #Enable FFS so options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -device geom_uzip +device xz options GEOM_UZIP options GEOM_LABEL # Providers labelization. options ROOTDEVNAME=\"ufs:ufs/FBSD\" # assumes FW built by Modified: head/sys/mips/conf/CARAMBOLA2 ============================================================================== --- head/sys/mips/conf/CARAMBOLA2 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/CARAMBOLA2 Tue Feb 26 19:55:03 2019 (r344605) @@ -48,7 +48,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/DB120 ============================================================================== --- head/sys/mips/conf/DB120 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/DB120 Tue Feb 26 19:55:03 2019 (r344605) @@ -38,7 +38,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/DIR-655A1 ============================================================================== --- head/sys/mips/conf/DIR-655A1 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/DIR-655A1 Tue Feb 26 19:55:03 2019 (r344605) @@ -41,7 +41,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/DIR-825B1 Tue Feb 26 19:55:03 2019 (r344605) @@ -47,6 +47,7 @@ nooptions INET6 # GEOM modules device geom_map # to get access to the SPI flash partitions +device xz options GEOM_UZIP options GEOM_PART_GPT Modified: head/sys/mips/conf/ENH200 ============================================================================== --- head/sys/mips/conf/ENH200 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/ENH200 Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/MT7620A_FDT ============================================================================== --- head/sys/mips/conf/MT7620A_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/MT7620A_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/MT7620N_FDT ============================================================================== --- head/sys/mips/conf/MT7620N_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/MT7620N_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/MT7621_FDT ============================================================================== --- head/sys/mips/conf/MT7621_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/MT7621_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/MT7628_FDT ============================================================================== --- head/sys/mips/conf/MT7628_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/MT7628_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -27,7 +27,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/ONIONOMEGA ============================================================================== --- head/sys/mips/conf/ONIONOMEGA Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/ONIONOMEGA Tue Feb 26 19:55:03 2019 (r344605) @@ -45,7 +45,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/PB47 ============================================================================== --- head/sys/mips/conf/PB47 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/PB47 Tue Feb 26 19:55:03 2019 (r344605) @@ -32,7 +32,7 @@ options AR71XX_REALMEM=64*1024*1024 options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/PB92 Tue Feb 26 19:55:03 2019 (r344605) @@ -55,7 +55,7 @@ options FFS #Berkeley Fast #options UFS_DIRHASH #Improve performance on big directories # Support uncompress lzma rootfs -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/PICOSTATION_M2HP ============================================================================== --- head/sys/mips/conf/PICOSTATION_M2HP Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/PICOSTATION_M2HP Tue Feb 26 19:55:03 2019 (r344605) @@ -38,7 +38,7 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/ROCKET_M2HP ============================================================================== --- head/sys/mips/conf/ROCKET_M2HP Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/ROCKET_M2HP Tue Feb 26 19:55:03 2019 (r344605) @@ -38,7 +38,7 @@ options NO_SWAPPING # options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/ROUTERSTATION ============================================================================== --- head/sys/mips/conf/ROUTERSTATION Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/ROUTERSTATION Tue Feb 26 19:55:03 2019 (r344605) @@ -14,7 +14,7 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem support +device xz options GEOM_UZIP # For DOS Modified: head/sys/mips/conf/ROUTERSTATION_MFS ============================================================================== --- head/sys/mips/conf/ROUTERSTATION_MFS Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/ROUTERSTATION_MFS Tue Feb 26 19:55:03 2019 (r344605) @@ -12,6 +12,7 @@ hints "ROUTERSTATION.hints" # GEOM modules device geom_redboot # to get access to the SPI flash partitions +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Modified: head/sys/mips/conf/RSPRO ============================================================================== --- head/sys/mips/conf/RSPRO Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RSPRO Tue Feb 26 19:55:03 2019 (r344605) @@ -15,7 +15,7 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem support +device xz options GEOM_UZIP # For DOS Modified: head/sys/mips/conf/RSPRO_MFS ============================================================================== --- head/sys/mips/conf/RSPRO_MFS Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RSPRO_MFS Tue Feb 26 19:55:03 2019 (r344605) @@ -15,6 +15,7 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions +device xz options GEOM_UZIP # Boot from the first MFS uzip Modified: head/sys/mips/conf/RSPRO_STANDALONE ============================================================================== --- head/sys/mips/conf/RSPRO_STANDALONE Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RSPRO_STANDALONE Tue Feb 26 19:55:03 2019 (r344605) @@ -14,7 +14,7 @@ device pcf2123_rtc # GEOM modules device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem support +device xz options GEOM_UZIP # For DOS Modified: head/sys/mips/conf/RT3050_FDT ============================================================================== --- head/sys/mips/conf/RT3050_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RT3050_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -27,7 +27,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/RT3352_FDT ============================================================================== --- head/sys/mips/conf/RT3352_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RT3352_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/RT3883_FDT ============================================================================== --- head/sys/mips/conf/RT3883_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RT3883_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -27,7 +27,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/RT5350_FDT ============================================================================== --- head/sys/mips/conf/RT5350_FDT Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/RT5350_FDT Tue Feb 26 19:55:03 2019 (r344605) @@ -26,7 +26,7 @@ makeoptions MODULES_OVERRIDE="" options ROOTDEVNAME=\"ufs:md0.uzip\" # Support geom_uzip(4) compressed disk images -device geom_uzip +device xz options GEOM_UZIP # Support md(4) and md-based rootfs Modified: head/sys/mips/conf/TL-ARCHERC7V2 ============================================================================== --- head/sys/mips/conf/TL-ARCHERC7V2 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/TL-ARCHERC7V2 Tue Feb 26 19:55:03 2019 (r344605) @@ -46,7 +46,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/TL-WDR4300 ============================================================================== --- head/sys/mips/conf/TL-WDR4300 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/TL-WDR4300 Tue Feb 26 19:55:03 2019 (r344605) @@ -39,7 +39,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/TL-WR1043NDv2 ============================================================================== --- head/sys/mips/conf/TL-WR1043NDv2 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/TL-WR1043NDv2 Tue Feb 26 19:55:03 2019 (r344605) @@ -34,7 +34,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/TL-WR740Nv4 ============================================================================== --- head/sys/mips/conf/TL-WR740Nv4 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/TL-WR740Nv4 Tue Feb 26 19:55:03 2019 (r344605) @@ -43,7 +43,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/TP-MR3040 ============================================================================== --- head/sys/mips/conf/TP-MR3040 Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/TP-MR3040 Tue Feb 26 19:55:03 2019 (r344605) @@ -48,7 +48,7 @@ device arswitch options AR71XX_ENV_UBOOT # uzip - to boot read-only lzma natively from flash -device geom_uzip +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/TP-WN1043ND Tue Feb 26 19:55:03 2019 (r344605) @@ -39,7 +39,7 @@ options MSDOSFS options AR71XX_ENV_UBOOT # uncompress - to boot natively from flash -device geom_uzip +device xz options GEOM_UZIP # Used for the static uboot partition map Modified: head/sys/mips/conf/WZR-300HP ============================================================================== --- head/sys/mips/conf/WZR-300HP Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/WZR-300HP Tue Feb 26 19:55:03 2019 (r344605) @@ -26,6 +26,7 @@ options BOOTVERBOSE # GEOM modules device geom_map # to get access to the SPI flash partitions +device xz options GEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" Modified: head/sys/mips/conf/WZR-HPAG300H ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/WZR-HPAG300H Tue Feb 26 19:55:03 2019 (r344605) @@ -25,6 +25,7 @@ options AR71XX_ENV_UBOOT options BOOTVERBOSE # GEOM modules +device xz options GEOM_UZIP device geom_map # to get access to the SPI flash partitions Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/mips/conf/std.XLP Tue Feb 26 19:55:03 2019 (r344605) @@ -56,6 +56,7 @@ options ALT_BREAK_TO_DEBUGGER #options LOCK_DEBUG #options LOCK_PROFILING +device xz options GEOM_UZIP # Device tree Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/modules/Makefile Tue Feb 26 19:55:03 2019 (r344605) @@ -404,6 +404,7 @@ SUBDIR= \ ${_x86bios} \ ${_xe} \ xl \ + xz \ zlib .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES) Modified: head/sys/modules/geom/geom_uzip/Makefile ============================================================================== --- head/sys/modules/geom/geom_uzip/Makefile Tue Feb 26 19:36:57 2019 (r344604) +++ head/sys/modules/geom/geom_uzip/Makefile Tue Feb 26 19:55:03 2019 (r344605) @@ -8,16 +8,10 @@ SRCS+= g_uzip.h g_uzip_dapi.h g_uzip_lzma.h g_uzip_zli g_uzip_wrkthr.h #CFLAGS= -g -DINVARIANT_SUPPORT -DINVARIANTS -.PATH: ${SRCTOP}/sys/contrib/xz-embedded/freebsd/ \ - ${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/ \ - ${SRCTOP}/sys/contrib/xz-embedded/linux/include/linux/ \ - ${SRCTOP}/sys/net +.PATH: ${SRCTOP}/sys/net CFLAGS+= -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/ -SRCS+= xz_crc32.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ - xz_malloc.c -SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h SRCS+= opt_geom.h .include Added: head/sys/modules/xz/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/xz/Makefile Tue Feb 26 19:55:03 2019 (r344605) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/xz +.PATH: ${SRCTOP}/sys/contrib/xz-embedded/freebsd +.PATH: ${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz + +KMOD= xz +SRCS= \ + xz_crc32.c \ + xz_dec_bcj.c \ + xz_dec_lzma2.c \ + xz_dec_stream.c \ + xz_mod.c + +CFLAGS+= \ + -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ + -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ + -I${SRCTOP}/sys/contrib/xz-embedded/linux/include/linux + +.include From owner-svn-src-head@freebsd.org Tue Feb 26 20:50:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A36001503835; Tue, 26 Feb 2019 20:50:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1407286B; Tue, 26 Feb 2019 20:50:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31F11A810; Tue, 26 Feb 2019 20:50:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QKoobv055879; Tue, 26 Feb 2019 20:50:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QKooKQ055878; Tue, 26 Feb 2019 20:50:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262050.x1QKooKQ055878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 20:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344606 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A1407286B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 20:50:50 -0000 Author: ian Date: Tue Feb 26 20:50:49 2019 New Revision: 344606 URL: https://svnweb.freebsd.org/changeset/base/344606 Log: Add support for geom_flashmap by providing a getattr() for "SPI:device". Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Tue Feb 26 19:55:03 2019 (r344605) +++ head/sys/dev/flash/at45d.c Tue Feb 26 20:50:49 2019 (r344606) @@ -119,6 +119,7 @@ static device_probe_t at45d_probe; /* disk routines */ static int at45d_close(struct disk *dp); static int at45d_open(struct disk *dp); +static int at45d_getattr(struct bio *bp); static void at45d_strategy(struct bio *bp); static void at45d_task(void *arg); @@ -338,6 +339,7 @@ at45d_delayed_attach(void *xsc) sc->disk->d_open = at45d_open; sc->disk->d_close = at45d_close; sc->disk->d_strategy = at45d_strategy; + sc->disk->d_getattr = at45d_getattr; sc->disk->d_name = "flash/at45d"; sc->disk->d_drv1 = sc; sc->disk->d_maxsize = DFLTPHYS; @@ -365,6 +367,22 @@ static int at45d_close(struct disk *dp) { + return (0); +} + +static int +at45d_getattr(struct bio *bp) +{ + struct at45d_softc *sc; + + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) + return (ENXIO); + if (strcmp(bp->bio_attribute, "SPI::device") != 0) + return (-1); + sc = bp->bio_disk->d_drv1; + if (bp->bio_length != sizeof(sc->dev)) + return (EFAULT); + bcopy(&sc->dev, bp->bio_data, sizeof(sc->dev)); return (0); } From owner-svn-src-head@freebsd.org Tue Feb 26 20:59:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C558C1503C00; Tue, 26 Feb 2019 20:59:30 +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 1CC8D72E5B; Tue, 26 Feb 2019 20:59:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yjosgLwPKgaEyyjougMuE5; Tue, 26 Feb 2019 13:59:21 -0700 X-Authority-Analysis: v=2.3 cv=QOMWuTDL c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=O9OwvyCs5SItpUZL52UA:9 a=CjuIK1q_8ugA:10 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 D8A5C614; Tue, 26 Feb 2019 12:59:17 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1QKwwmr018231; Tue, 26 Feb 2019 12:58:58 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x1QKwvJn018213; Tue, 26 Feb 2019 12:58:57 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902262058.x1QKwvJn018213@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: John Baldwin cc: rgrimes@freebsd.org, Benjamin Kaduk , Cy Schubert , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: Message from John Baldwin of "Tue, 26 Feb 2019 09:19:02 -0800." <20a4a5ab-f088-537b-8666-e6c6f43170a9@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 26 Feb 2019 12:58:57 -0800 X-CMAE-Envelope: MS4wfNVYaGp+oBhNMMas7s2I3pD6Nt9GQqP6keHzhZOUCA6RNNL8N3CDandIg1/ZBlN2QUPIDEueatdAm6btDZkYrYPi0TLSWCK1jLEdkbFY1VLYTw+wAsie gXJFSWbh5DUBsZeCIrgh+LRBmADsrLuC1uz2xwhVMAV/foXypnbOVSjUtL0GqRA9M5JzKuWGAs2G11qalVoSRrcuFkRW41UWcuho24CPOXlrNFDJHwMKodwu nZN4h7pBBFUUrP3vzBd0lLbOEH180aClQSQJvbT9pJzZptK+bspC5ZjHcQTp66UqARkn65OaTovzURtPA+CnAArENtgwqwj6JhOWa871mH4C++2TcSYL28xm YEkr4s5XskFFMNCz8VK15Sux13u9Tw== X-Rspamd-Queue-Id: 1CC8D72E5B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.15)[ip: (-5.90), ipnet: 64.59.128.0/20(-2.66), asn: 6327(-2.09), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.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: Tue, 26 Feb 2019 20:59:31 -0000 In message <20a4a5ab-f088-537b-8666-e6c6f43170a9@FreeBSD.org>, John Baldwin wri tes: > On 2/26/19 8:59 AM, Rodney W. Grimes wrote: > >> On Tue, Feb 26, 2019 at 10:14 AM Cy Schubert > >> wrote: > >> > >>> On February 26, 2019 7:48:27 AM PST, Cy Schubert < > >>> Cy.Schubert@cschubert.com> wrote: > >>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > >>>> wrote: > >>> > >> > >> [trimming the unneeded pile of commit body] > >> > >> > >>>> This broke my systems, many filesystems fail to mount causing nullfs > >>>> late mounts to fail. No details now until tonight. > >>>> > >>>> Suggest we back this out until it is properly tested. > >>> > >>> Nested zfs filesystems seem not to be handled properly or possibly not > >>> supported any more. This explains my mail gateway also not mounting all > >>> filesystems in /home. It was odd that dovecot stopped working. > >>> > >>> The symptom of the problem is zfs mount -a no longer mounts all > >>> filesystems. Zfs mount fails saying the filesystem is already mounted. Th > e > >>> workaround is to zfs umount each affected zfs dataset by hand and zfs mou > nt > >>> it by hand. > >>> > >>> Generally this has screwed up sites that have hundreds (in my case 122) > >>> zfs datasets. The work around might be to script testing each mount, > >>> unmounting and remounting if necessary. > >>> > >>> I'm being sarcastic about creating an rc script to clean this up. This > >>> needs to be backed out and tested properly before being committed. > >>> > >>> > >> I don't know what you mean by "nested zfs filesystems" -- do you mean a > >> zpool within a zvol? > >> That has been unsupported for a long time, IIRC. And > > That had better not be unsupported, that is the prefered technology > > for all of the virtualization stuff, bhyve, virtualbox, qemu, etc. > > I think Ben is referring to using the nested zpool on the host itself rather > than in the guest. We do actually let you do such crazy things I think (I > use UFS in my VMs usually and fsck on the host against /dev/zvol/bhyve/p > 2 > can be faster than fsck in the booted guest), but normally the host just host > s > the zvol and the guest manages filesystems in the volume. Mounting the > nested zpool on the host is probably best characterized as running with > scissors. I was talking about nested datasets, i.e. tank/freebsd/git/current and tank/freebsd/git/ports are four levels deep. In my case the ports dataset was mounted while the current dataset was not, though zfs believed it was. unmounting the current dataset and remounting it, zfs umount .../current; zfs mount .../current worked around the issue. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Feb 26 21:03:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC821503ED2; Tue, 26 Feb 2019 21:03:25 +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 8269973333; Tue, 26 Feb 2019 21:03:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yjsgg6Nd0vVtryjshg5nWM; Tue, 26 Feb 2019 14:03:17 -0700 X-Authority-Analysis: v=2.3 cv=H9qlPNQi c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=CgiagczvAAAA:8 a=6I5d2MoRAAAA:8 a=DsloTXpuAAAA:20 a=FNC4LJVLAAAA:20 a=YxBL1-UpAAAA:8 a=idK6ELlMs-8AVZOrZyMA:9 a=5rSKgdoh7OZx30Cy:21 a=rsXKCzxhL41DXEsk:21 a=CjuIK1q_8ugA:10 a=ZydqF0V2MF2Cvey6h_li: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 0F713631; Tue, 26 Feb 2019 13:03:14 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1QL2so7032557; Tue, 26 Feb 2019 13:02:55 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x1QL2rIo032528; Tue, 26 Feb 2019 13:02:54 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902262102.x1QL2rIo032528@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: Fatih Acar cc: Cy Schubert , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fatih@gandi.net Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: Message from Fatih Acar of "Tue, 26 Feb 2019 18:37:25 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 26 Feb 2019 13:02:53 -0800 X-CMAE-Envelope: MS4wfJ9VYCg7473CWcyLrTbsCEXeG4OZIWSxXBZ3jK3Yz4uU32uQ4xKHnNVVYj5myk1APkEBA43qKCoR7u8Q3i7aVIzewmHtCwT/VHAWzqjW2EvzsoHPRgK1 nzx3WK2Sf2MuDrBjCj7zHdzsiAZjJS1kopV5OsyylmTQToe1VQQGvXun5GpQnx4QJZYrdkGstFrGXh8PRwmy0iG9W/vyGkoZVwqabQ9dZAis8INEIn3VAbHJ 6tyXO53wW12wj6tUMZIqFdXksAkp/xMqxKbykE4Sa30GyGAmwVxRMSK3dAvEErA0bCHSKBe+/gv82kqYxCJ1dt61x+2Po8nkt6woYSB44LRIdk26k5hQaIz1 CT6U0Odi1XbxqUICAJD+3QcUOowNpA== X-Rspamd-Queue-Id: 8269973333 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.94)[ip: (-4.88), ipnet: 64.59.128.0/20(-2.66), asn: 6327(-2.08), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.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: Tue, 26 Feb 2019 21:03:26 -0000 In message , Fatih Acar writes: > This is a multi-part message in MIME format. > --------------6A54CE5B28D823DCB8C41577 > Content-Type: text/plain; charset=utf-8 > Content-Transfer-Encoding: 8bit > > On 2/26/19 5:36 PM, Cy Schubert wrote: > > On February 26, 2019 8:11:31 AM PST, Baptiste Daroussin > wrote: > >> On Tue, Feb 26, 2019 at 05:04:11PM +0100, Baptiste Daroussin wrote: > >>> On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: > >>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > >> wrote: > >>>>> Author: bapt > >>>>> Date: Tue Feb 26 08:18:34 2019 > >>>>> New Revision: 344569 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/344569 > >>>>> > >>>>> Log: > >>>>> Implement parallel mounting for ZFS filesystem > >>>>> > >>>>> It was first implemented on Illumos and then ported to ZoL. > >>>>> This patch is a port to FreeBSD of the ZoL version. > >>>>> This patch also includes a fix for a race condition that was > >> amended > >>>>> > >>>>> With such patch Delphix has seen a huge decrease in latency of the > >>>>> mount phase > >>>>> (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for > >> details). > >>>>> With that current change Gandi has measured improvments that are > >> on par > >>>>> with > >>>>> those reported by Delphix. > >>>>> > >>>>> Zol commits incorporated: > >>>> > >>> https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70 > c9c9e303 > >>>> > >>> https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d40775 > 67dfea21 > >>>>> > >>>>> Reviewed by: avg, sef > >>>>> Approved by: avg, sef > >>>>> Obtained from: ZoL > >>>>> MFC after: 1 month > >>>>> Relnotes: yes > >>>>> Sponsored by: Gandi.net > >>>>> Differential Revision: https://reviews.freebsd.org/D19098 > >>>>> > >>>>> Modified: > >>>>> head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c > >>>>> > >>>>> Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > >>>> > >>> ========================================================================= > ===== [...] > >>>>> > >>>> > >>>> This broke my systems, many filesystems fail to mount causing > >> nullfs late mounts to fail. No details now until tonight. > >>>> > >>>> Suggest we back this out until it is properly tested. > >>>> > >>> > >>> What fails to mount? what message? can you provide Gandi folks more > >> informations > >>> so they can fix? > >>> > >>> I will revert if we cannot have a quick fix but let s give them a > >> chance to fix > >>> first. > >>> > >> With the proper email in CC there is a better chance to reach at them > >> :) > >> > >> Best regards, > >> Bapt > > > > Sorry about that. I'm terribly frustrated as this broke my mail gateway, ha > ving to fix it using juiceSSH on my phone on the bus. Ssh on the phone makes > for a very grumpy Cy. > > > > I did bring my personal laptop to work, so I'll try to help out testing thi > s at noon here and maybe look at it more. I'll help out any way I can. > > > > > > Sorry about all this... > Could you try the attached patch, it should fix the issue. I don't > understand how this regression happened, it's not present in ZoL... > I'll check with Jack who worked on this when he's back from PTO. > > Thanks. > > -- > Fatih ACAR > Gandi > fatih.acar@gandi.net > > --------------6A54CE5B28D823DCB8C41577 > Content-Type: text/x-patch; > name="mount.patch" > Content-Transfer-Encoding: quoted-printable > Content-Disposition: attachment; > filename="mount.patch" > > Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.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 > --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c (revision 3= > 44590) > +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c (working co= > py) > @@ -1260,11 +1260,11 @@ > if (*a =3D=3D '\0') > return (-1); > if (*b =3D=3D '\0') > - return (-1); > + return (1); > if (*a =3D=3D '/') > return (-1); > if (*b =3D=3D '/') > - return (-1); > + return (1); > return (*a < *b ? -1 : *a > *b); > } > =20 > Thanks. This fixes this particular issue. There is one other minor issues that should also be addressed. The mount message at boot previously displayed: Mounting ZFS filesystems: (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(15 9/159)^M Now it displays: (null): (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(159/159)^M -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Feb 26 21:08:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B681504042 for ; Tue, 26 Feb 2019 21:08:14 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10021901.me.com (pv50p00im-ztdg10021901.me.com [17.58.6.55]) (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 4682A7351A for ; Tue, 26 Feb 2019 21:08:14 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id D85578800A6; Tue, 26 Feb 2019 21:08:03 +0000 (UTC) From: Toomas Soome Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common Date: Tue, 26 Feb 2019 23:08:01 +0200 In-Reply-To: <201902262102.x1QL2rIo032528@slippy.cwsent.com> Cc: Fatih Acar , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fatih@gandi.net To: Cy Schubert References: <201902262102.x1QL2rIo032528@slippy.cwsent.com> X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-26_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1902260144 X-Rspamd-Queue-Id: 4682A7351A X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Tue, 26 Feb 2019 21:08:15 -0000 > On 26 Feb 2019, at 23:02, Cy Schubert = wrote: >=20 > In message , Fatih = Acar=20 > writes: >> This is a multi-part message in MIME format. >> --------------6A54CE5B28D823DCB8C41577 >> Content-Type: text/plain; charset=3Dutf-8 >> Content-Transfer-Encoding: 8bit >>=20 >> On 2/26/19 5:36 PM, Cy Schubert wrote: >>> On February 26, 2019 8:11:31 AM PST, Baptiste Daroussin = =20 >> wrote: >>>> On Tue, Feb 26, 2019 at 05:04:11PM +0100, Baptiste Daroussin wrote: >>>>> On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: >>>>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin >>>> wrote: >>>>>>> Author: bapt >>>>>>> Date: Tue Feb 26 08:18:34 2019 >>>>>>> New Revision: 344569 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/344569 >>>>>>>=20 >>>>>>> Log: >>>>>>> Implement parallel mounting for ZFS filesystem >>>>>>>=20 >>>>>>> It was first implemented on Illumos and then ported to ZoL. >>>>>>> This patch is a port to FreeBSD of the ZoL version. >>>>>>> This patch also includes a fix for a race condition that was >>>> amended >>>>>>>=20 >>>>>>> With such patch Delphix has seen a huge decrease in latency of = the >>>>>>> mount phase >>>>>>> (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for >>>> details). >>>>>>> With that current change Gandi has measured improvments that are >>>> on par >>>>>>> with >>>>>>> those reported by Delphix. >>>>>>>=20 >>>>>>> Zol commits incorporated: >>>>>>=20 >>>>> = https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70 >> c9c9e303 >>>>>>=20 >>>>> = https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d40775 >> 67dfea21 >>>>>>>=20 >>>>>>> Reviewed by: avg, sef >>>>>>> Approved by: avg, sef >>>>>>> Obtained from: ZoL >>>>>>> MFC after: 1 month >>>>>>> Relnotes: yes >>>>>>> Sponsored by: Gandi.net >>>>>>> Differential Revision: https://reviews.freebsd.org/D19098 >>>>>>>=20 >>>>>>> Modified: >>>>>>> head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c >>>>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h >>>>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c >>>>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h >>>>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c >>>>>>>=20 >>>>>>> Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c >>>>>>=20 >>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D > [...] >>>>>>>=20 >>>>>>=20 >>>>>> This broke my systems, many filesystems fail to mount causing >>>> nullfs late mounts to fail. No details now until tonight. >>>>>>=20 >>>>>> Suggest we back this out until it is properly tested. >>>>>>=20 >>>>>=20 >>>>> What fails to mount? what message? can you provide Gandi folks = more >>>> informations >>>>> so they can fix? >>>>>=20 >>>>> I will revert if we cannot have a quick fix but let s give them a >>>> chance to fix >>>>> first. >>>>>=20 >>>> With the proper email in CC there is a better chance to reach at = them >>>> :) >>>>=20 >>>> Best regards, >>>> Bapt >>>=20 >>> Sorry about that. I'm terribly frustrated as this broke my mail = gateway, ha >> ving to fix it using juiceSSH on my phone on the bus. Ssh on the = phone makes=20 >> for a very grumpy Cy. >>>=20 >>> I did bring my personal laptop to work, so I'll try to help out = testing thi >> s at noon here and maybe look at it more. I'll help out any way I = can. >>>=20 >>>=20 >>=20 >> Sorry about all this... >> Could you try the attached patch, it should fix the issue. I don't >> understand how this regression happened, it's not present in ZoL... >> I'll check with Jack who worked on this when he's back from PTO. >>=20 >> Thanks. >>=20 >> --=20 >> Fatih ACAR >> Gandi >> fatih.acar@gandi.net >>=20 >> --------------6A54CE5B28D823DCB8C41577 >> Content-Type: text/x-patch; >> name=3D"mount.patch" >> Content-Transfer-Encoding: quoted-printable >> Content-Disposition: attachment; >> filename=3D"mount.patch" >>=20 >> Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c >> = =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3= D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >> = =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3= D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D= 3D=3D3D=3D3D >> --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c = (revision 3=3D >> 44590) >> +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c = (working co=3D >> py) >> @@ -1260,11 +1260,11 @@ >> if (*a =3D3D=3D3D '\0') >> return (-1); >> if (*b =3D3D=3D3D '\0') >> - return (-1); >> + return (1); >> if (*a =3D3D=3D3D '/') >> return (-1); >> if (*b =3D3D=3D3D '/') >> - return (-1); >> + return (1); >> return (*a < *b ? -1 : *a > *b); >> } >> =3D20 >>=20 >=20 > Thanks. This fixes this particular issue. >=20 > There is one other minor issues that should also be addressed. The = mount message > at boot previously displayed: >=20 > Mounting ZFS filesystems: = (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(15 > 9/159)^M >=20 > Now it displays: >=20 > (null): (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(159/159)^M >=20 >=20 see https://www.illumos.org/issues/10205 = for this one. rgds, toomas= From owner-svn-src-head@freebsd.org Tue Feb 26 21:19:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0A2150440A; Tue, 26 Feb 2019 21:19:05 +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 684E573BD2; Tue, 26 Feb 2019 21:19:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yk7xgM5uvgaEyyk7ygMzyt; Tue, 26 Feb 2019 14:19:02 -0700 X-Authority-Analysis: v=2.3 cv=QOMWuTDL c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=iKhvJSA4AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=enqceGrhu9depbhogb4A:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id B5F78688; Tue, 26 Feb 2019 13:19:00 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1QLIfBt080611; Tue, 26 Feb 2019 13:18:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x1QLIftV080604; Tue, 26 Feb 2019 13:18:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902262118.x1QLIftV080604@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: rgrimes@freebsd.org cc: Benjamin Kaduk , Cy Schubert , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: Message from "Rodney W. Grimes" of "Tue, 26 Feb 2019 08:59:46 -0800." <201902261659.x1QGxkl0046685@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 26 Feb 2019 13:18:41 -0800 X-CMAE-Envelope: MS4wfHJfgG7tadoubtBA2XsAAnLngtY5KOnIeSUGedEO0r6FqaZ517UVCZpENk4DgOHbET/SLAwNV9XWou7B+43/Ak5hfaPc3O9y/8fRNGkFKsJ+PsJp4X+s bPZKO4QnZfmeWRK3ke87qgN75AzIDRv1AY71w46SxFzaCzeYIBdZNEHvZGN7wjAvKVYL3/X4huDyYotvA1NmX85CCFUStjNH2laLXVXXX8P7w5S9p9VPc/Iq FWRdPQFrPDFOfz4MncvSnVqiR20eKYOvUIMB3mjFz5ANceWuJOgnDuTXw4d4cepqxtFgb3+YUInsKjXfyYsw+H0kLrgyF+i583bOrQ9++xXM+PWm7urICgy1 3mbsTdq8 X-Rspamd-Queue-Id: 684E573BD2 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.82 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; RCPT_COUNT_SEVEN(0.00)[7]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.15)[ip: (-5.94), ipnet: 64.59.128.0/20(-2.65), asn: 6327(-2.08), country: CA(-0.09)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 21:19:06 -0000 In message <201902261659.x1QGxkl0046685@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > On Tue, Feb 26, 2019 at 10:14 AM Cy Schubert > > wrote: > > > > > On February 26, 2019 7:48:27 AM PST, Cy Schubert < > > > Cy.Schubert@cschubert.com> wrote: > > > >On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > > > > wrote: > > > > > > > [trimming the unneeded pile of commit body] > > > > > > > >This broke my systems, many filesystems fail to mount causing nullfs > > > >late mounts to fail. No details now until tonight. > > > > > > > >Suggest we back this out until it is properly tested. > > > > > > Nested zfs filesystems seem not to be handled properly or possibly not > > > supported any more. This explains my mail gateway also not mounting all > > > filesystems in /home. It was odd that dovecot stopped working. > > > > > > The symptom of the problem is zfs mount -a no longer mounts all > > > filesystems. Zfs mount fails saying the filesystem is already mounted. Th > e > > > workaround is to zfs umount each affected zfs dataset by hand and zfs mou > nt > > > it by hand. > > > > > > Generally this has screwed up sites that have hundreds (in my case 122) > > > zfs datasets. The work around might be to script testing each mount, > > > unmounting and remounting if necessary. > > > > > > I'm being sarcastic about creating an rc script to clean this up. This > > > needs to be backed out and tested properly before being committed. > > > > > > > > I don't know what you mean by "nested zfs filesystems" -- do you mean a > > zpool within a zvol? > > That has been unsupported for a long time, IIRC. And > That had better not be unsupported, that is the prefered technology > for all of the virtualization stuff, bhyve, virtualbox, qemu, etc. > > I think by nested zfs it sounds like he is talking about datasets > inside of other datasets just from reading "all filesystems in /home" > > > > I'm not sure what else "nested filesystems" would be, since having (e.g.) > > separate zfs filesystems for /usr and /usr/ports is so common that surely > > it has already been tested... > > It might be when the intervening dataset is marked canmount=off? > Though that should fail for the /usr /usr/foo case, as usr is normally > marked this way. Maybe some other special case. I do have some mountpoint=none datasets with mountpoint=/somewhere-else. My tank/var tree is a good example of the complete mix using none, legacy and specified mountpoints. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Feb 26 22:06:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C418B1505682; Tue, 26 Feb 2019 22:06:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE9375808; Tue, 26 Feb 2019 22:06:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 407D4B613; Tue, 26 Feb 2019 22:06:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QM6QSL097494; Tue, 26 Feb 2019 22:06:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QM6QtB097493; Tue, 26 Feb 2019 22:06:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262206.x1QM6QtB097493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 22:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344607 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EE9375808 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 22:06:26 -0000 Author: ian Date: Tue Feb 26 22:06:25 2019 New Revision: 344607 URL: https://svnweb.freebsd.org/changeset/base/344607 Log: Compile fdt_slicer and geom_flashmap when the at45d device is included. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 26 20:50:49 2019 (r344606) +++ head/sys/conf/files Tue Feb 26 22:06:25 2019 (r344607) @@ -1721,7 +1721,7 @@ dev/fdt/fdt_clock_if.m optional fdt fdt_clock dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_pinctrl.c optional fdt fdt_pinctrl dev/fdt/fdt_pinctrl_if.m optional fdt fdt_pinctrl -dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand | fdt mx25l | fdt n25q +dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand | fdt mx25l | fdt n25q | fdt at45d dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "fdt_dtb_file" dev/fdt/simplebus.c optional fdt @@ -3611,7 +3611,7 @@ geom/geom_disk.c standard geom/geom_dump.c standard geom/geom_event.c standard geom/geom_fox.c optional geom_fox -geom/geom_flashmap.c optional fdt cfi | fdt nand | fdt mx25l | mmcsd | fdt n25q +geom/geom_flashmap.c optional fdt cfi | fdt nand | fdt mx25l | mmcsd | fdt n25q | fdt at45d geom/geom_io.c standard geom/geom_kern.c standard geom/geom_map.c optional geom_map From owner-svn-src-head@freebsd.org Tue Feb 26 22:08:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3A83150574C; Tue, 26 Feb 2019 22:07:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 953CC7598F; Tue, 26 Feb 2019 22:07:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A3EB617; Tue, 26 Feb 2019 22:07:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QM7xBb097590; Tue, 26 Feb 2019 22:07:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QM7xN2097589; Tue, 26 Feb 2019 22:07:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262207.x1QM7xN2097589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 22:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344608 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 344608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 953CC7598F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 22:08:00 -0000 Author: ian Date: Tue Feb 26 22:07:59 2019 New Revision: 344608 URL: https://svnweb.freebsd.org/changeset/base/344608 Log: Update a comment to reflect reality; no functional changes. Modified: head/sys/sys/slicer.h Modified: head/sys/sys/slicer.h ============================================================================== --- head/sys/sys/slicer.h Tue Feb 26 22:06:25 2019 (r344607) +++ head/sys/sys/slicer.h Tue Feb 26 22:07:59 2019 (r344608) @@ -58,7 +58,7 @@ typedef int (*flash_slicer_t)(device_t dev, const char #define FLASH_SLICES_TYPE_SPI 2 #define FLASH_SLICES_TYPE_MMC 3 -/* Use NULL for deregistering a slicer */ +/* Use NULL and set force to true for deregistering a slicer */ void flash_register_slicer(flash_slicer_t slicer, u_int type, bool force); #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Tue Feb 26 22:20:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAB1C15059F5 for ; Tue, 26 Feb 2019 22:20:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 3B1AE75EDD for ; Tue, 26 Feb 2019 22:20:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr1-x444.google.com with SMTP id o17so15742995wrw.3 for ; Tue, 26 Feb 2019 14:20:23 -0800 (PST) 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=70YQlstYND8sRNfvbOiBuvwkLBFM3/v6JTdCrdsH6rM=; b=comzZj2EnaPVqD5SjyDcoX9cuBNfiEPyn7gzqj0aSGcaMxAx7CmGfhQj1xrueq7O/x 5/Wlg4NSvOh5OHkhmy+qXHi+Axbi9SI82tsoN9iN18MGR2nQhJNCBmzpMLekT5SqNNpV +dK+XTc3r960wizhGxbifIB6We405/fH998DSQRafuUVTzl9/6Zj16q4rj8OALgw1mkc h2oM77VPgilq+3KWKgWDrqtSDVmptl+v23NMXcZNkjlQAUeT83AWUCOZhPbaqu/s/tu9 xh6y0lLLdkJShnVcykFlx0eUa1qaF6vWlCSMIUdGkNi936SoemwKzi3DaPsL0EB2Aqxr ZVGg== 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=70YQlstYND8sRNfvbOiBuvwkLBFM3/v6JTdCrdsH6rM=; b=Be8RtH5ocOcph5QKHvRtU1OLVL+1owXFUYsGYxskufFiA1DBbedqcdIzHZcjgtgM9c IrjN09di9fgteIiy3wCzV+QFz6kalhr+P4L1FtgdLZ1yXpNYCS23B6UDqQZ9/rA25Hr5 EB4cnmTuhUhmwpU2GPQnIjftUlCfxAkLhH9TL+aVOZNsbDBmWXrLGUm/Y5jp8+BLcg74 KlZlPa0INzPYI8iI2m+fwuOMtP6LsP6ekNEgH3MpC3/jHgHVT6f5KHmCc+IbpmpzXM1F YcdNPhFEbKA9EMPen4lb6bt6u3PXR1k2pLXaqMiUwNWA3MAgirtLULB67YBGp+Q+TB+N JYMA== X-Gm-Message-State: AHQUAuY9FqGkfiohomPmxCl9T/M37LdKPMnLuvVxUBrAM8CpRsNizd2m EA/eX/uL9myorLZKWlOutZsHtA== X-Google-Smtp-Source: AHgI3Ia0j5XcwBOXiACtLP98yqbOjEcSdPEiojRgrtCbzachC2EgYKpO4Csky76xSkoa2Ee4ds5X3Q== X-Received: by 2002:adf:afe3:: with SMTP id y35mr17310614wrd.318.1551219621397; Tue, 26 Feb 2019 14:20:21 -0800 (PST) Received: from mutt-hbsd ([62.102.148.68]) by smtp.gmail.com with ESMTPSA id i16sm10627387wru.16.2019.02.26.14.20.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 14:20:20 -0800 (PST) Date: Tue, 26 Feb 2019 17:19:41 -0500 From: Shawn Webb To: rgrimes@freebsd.org Cc: "K. Macy" , svn-src-head@freebsd.org, Matt Macy , svn-src-all@freebsd.org, Brooks Davis , src-committers Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Message-ID: <20190226221941.zt4y7t2455c5dwlb@mutt-hbsd> References: <20190226154535.q32nwf6xyupexkta@mutt-hbsd> <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2e7hjzos5uhwlegf" Content-Disposition: inline In-Reply-To: <201902261627.x1QGRefq046574@pdx.rh.CN85.dnsmgr.net> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 3B1AE75EDD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 22:20:23 -0000 --2e7hjzos5uhwlegf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 08:27:40AM -0800, Rodney W. Grimes wrote: > > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > > The modest increase in activation energy for that task seems wort= h it > > > > > for the short-term gains of reduced integration cost (this code w= ill > > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > > > license statements. The standard GPL v2.0 boiler plate should be= added > > > > > to this file along side the tag. > > > >=20 > > > > I've copied the full copyright attribution that is in the > > > > corresponding files on Linux. Is there some reason why FreeBSD > > > > requires the files to be inflated with the full license text where = the > > > > original lacks it? > > >=20 > > > I think for a few reasons, I doubt you copied the whole distribution > > > that this file came from, as I am sure that distribution included > > > a LICENSE file. Second if you actually read the GPL v2 documentation > > > and follow what it says it says you must do this, just because some > > > one else does not follow the rules of what the GPL v2 says does not > > > give us to knowingling not do it. Third this is a particular dangeri= ous > > > area for BSD to be mixing a GPL code with its kernel, to my knowlege > > > we have never had any gpl code in the kernel, no have we ever > > > allowed it, but thats a seperate argument, that should be made. > >=20 > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > >=20 > > I, too, would like less GPL in project, both in userland in kernel. > > But, I can understand the desire for gcov. Note that I'm not > > advocating either way that FreeBSD perform an action. ;) >=20 > Didnt we just remove an inbase, compiling BSD licensed chunk of > code called DRM and move it to ports. So if that was possible > this should be very rapidly applied here and this issue goes away. DRM !=3D DTS/DTB --=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 --2e7hjzos5uhwlegf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlx1u3gACgkQaoRlj1JF bu4V+g//SyK0wMt07RJ74BbZUqYJ918yTyPrMyslrErWWUJSKU4EdLKLL64JyWSZ AplfxhJvi22oDguiGOg3aeEr+cpS2AugssfhATsxBD+6ub3Y6uFKm0btDz8M+20r +YrvhKInaRsZDA64T3kGoxSAnaxGOrMFGYNwMPcONzBwvqbrmWbWtkLggDe72TmM 1t7mUQzspwgxFJUWzXpq3AbKnQ01oE2teoY8ziRREO49RC1Vn9cx5fIB5z2lO760 VaLbwdh+agUnqmHxUbImA8KwuQjXT1BK3O5Yr6fnCfI+RwGOyEKAJf/99a3WQkXp F156sZ83ou8+jvgg6ibb0B+VC7i6y+E3Fkiu0nnJhu6iZloX1sC4ewx7YHNK52ft zc7sctKsAmH8aRqqTUOUeLGXln2iaBOcSOD3AhxMouDkIkoOG+bHTVQ40XoRF4OU Q97xmjpTygibMKdQQqnYJyGcxU8hXe7D0OXDmNRU0kJ3E4xte31V2e/5iE2PuMXm H/O/jVo1ryeUaD8YLc0OgrxKva2Yz+e2vMX5WnUAY+2ES7VYYeOkXE0lE6SGAEAU 3IMOKUNmbunzHHQyVbEGmJka8y5kRayGoYwWI96UPKVTrnHWb42Q8h0HU7s3buPo WtJ5+OoGYZ1AIVCY+GFQR17A840FETSfEI37Bp5lxC6ywo+fGcM= =InE5 -----END PGP SIGNATURE----- --2e7hjzos5uhwlegf-- From owner-svn-src-head@freebsd.org Tue Feb 26 22:25:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD7F1505D7B for ; Tue, 26 Feb 2019 22:25:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 7CCBE76534 for ; Tue, 26 Feb 2019 22:25:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-ed1-x544.google.com with SMTP id b20so12183096edw.11 for ; Tue, 26 Feb 2019 14:25:22 -0800 (PST) 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=Sr+8eXL4Q90ovMbKxOJCVxJ4fAGPocR6VNnIK+HG+vQ=; b=J0iUqIx+oqTUxP4tq5dvwh2D1RGLioDfd3XGpU7i4nhbZdRHQvwkVzKf0RuS1tRLLe ddhBtk5OMfIjQsDruvK9z+UytiXFLrn5lk0IbrN5mDE4UNPr/SOQ4BBDd+cXLG/mHkJH CYILSqie1q9knc23XJQZK5Z9nCj6wLGQF94Pi/EDZt7B5ZgYecP/t9YiUJJ7Z4eO6FK6 vOSMcIfcfOKBeU6Hx1hobGoSgvRC+J2EOE0O9doqrk0aQUZilZBm8JKgeeX41utW6J45 mo3dPOsxmf3xLKJ9UISe8wL0zQO8h9r4CyPahPdfz8eZ1LwFCxl2Mtg8kdyB2O8cEKXl ju5w== 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=Sr+8eXL4Q90ovMbKxOJCVxJ4fAGPocR6VNnIK+HG+vQ=; b=HeHyncCXzu8WPZlHpRuNnpSNU51azfsnxVTH1A+xurJTvRw+DRYS5BKhBlkNIucQyZ TYBIdBN5QszM1v7Nklk53oNnnW+jK25Ux7mgACTyKsSd3C+2KBCjKb95ruUXJNJFDX6j VgpYWzWNKErGnMoctZZcmnaALsIMviYR4JYIDwGBQ1TzGXB0Nnta8Fq5NnmHbLsl6Ch4 /pR6eM8aY0siQ0X6nvzH9/pnHKGeCpTk++64brBSROsi16PFS72OSURiENbRzocIX5Mr 9hty6GgM1o2stzNmNCzU1NYSRW34K5iPX2qRBqBWwwEUEIPCaOOMtSnqe/vgPhdiTQiP Gusw== X-Gm-Message-State: AHQUAuaKYhE0x5JycRMHPqEZSgLfxgE+pfT6gp1w578MZz0TwhvrB5vD jjyyoqtkMHmTewYpT3L3Eq8TOw== X-Google-Smtp-Source: AHgI3IbFBkdTkZMXcvQSVOHGIFQhpwHMg6Tk9XolpfIqebS+PMVTzGmKWFdwLflvSu9SKLs3sy7PUA== X-Received: by 2002:a50:ca81:: with SMTP id x1mr6889629edh.106.1551219921406; Tue, 26 Feb 2019 14:25:21 -0800 (PST) Received: from mutt-hbsd ([62.102.148.68]) by smtp.gmail.com with ESMTPSA id 41sm481235edu.85.2019.02.26.14.25.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 14:25:20 -0800 (PST) Date: Tue, 26 Feb 2019 17:24:42 -0500 From: Shawn Webb To: Warner Losh Cc: "Rodney W. Grimes" , "K. Macy" , svn-src-head@freebsd.org, Matt Macy , svn-src-all@freebsd.org, Brooks Davis , src-committers Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Message-ID: <20190226222442.s6u3a637svhn6dn6@mutt-hbsd> References: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> <20190226154535.q32nwf6xyupexkta@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="whlngj6bhwz26t74" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 7CCBE76534 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 22:25:23 -0000 --whlngj6bhwz26t74 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 10:18:45AM -0700, Warner Losh wrote: > On Tue, Feb 26, 2019 at 8:46 AM Shawn Webb > wrote: >=20 > > On Mon, Feb 25, 2019 at 06:18:42PM -0800, Rodney W. Grimes wrote: > > > > > The modest increase in activation energy for that task seems wort= h it > > > > > for the short-term gains of reduced integration cost (this code w= ill > > > > > greatly improve our ZFS-on-Linux test coverage.) > > > > > > > > > > Rod rightly points out that we haven't accepted SPDX tags alone as > > > > > license statements. The standard GPL v2.0 boiler plate should be > > added > > > > > to this file along side the tag. > > > > > > > > I've copied the full copyright attribution that is in the > > > > corresponding files on Linux. Is there some reason why FreeBSD > > > > requires the files to be inflated with the full license text where = the > > > > original lacks it? > > > > > > I think for a few reasons, I doubt you copied the whole distribution > > > that this file came from, as I am sure that distribution included > > > a LICENSE file. Second if you actually read the GPL v2 documentation > > > and follow what it says it says you must do this, just because some > > > one else does not follow the rules of what the GPL v2 says does not > > > give us to knowingling not do it. Third this is a particular dangeri= ous > > > area for BSD to be mixing a GPL code with its kernel, to my knowlege > > > we have never had any gpl code in the kernel, no have we ever > > > allowed it, but thats a seperate argument, that should be made. > > > > Would the arm64 DTS/DTB files count as "GPL code in the kernel?" > > >=20 > No. dts gets compiled into dtb. dtb is a separate work loaded by the boot > loader. While one can compile it into the kernel, we don't ship like that. >=20 > There's also a question as to whether or not these files are text > representation of the hardware, and there being only one way to represent > it (making it not copyrightable under at least US case law since it's a > database). That question hasn't been litigated. Many hardware companies > also dual license the dts. Since we're not incorporating it into the > kernel, but merely using it as a standardized table (there's a separate > group that controls the dts/dtb spec), I think we're safe from that angle > as well. >=20 > There's benefit from having it in-tree because the version of the spec > evolves over time, and having the right version makes it harder to push > this off into a port. Also, having them in-tree makes the project's > compliance with GPL a no-op because it's all there in the open in a tagged > VCS. >=20 > tl;dr: I don't think this is an issue. Awesome. Thanks for the clarification. I'm now curious if this is documented outside of random emails in svn-src-all@. I'm 100% sure I'm not the only one who needed clarification on DTS/DTB licensing, especially in the context of FreeBSD. >=20 >=20 > > I, too, would like less GPL in project, both in userland in kernel. > > But, I can understand the desire for gcov. Note that I'm not > > advocating either way that FreeBSD perform an action. ;) > > >=20 > Given this is for TEST kernels, there's no issue here. While we'd like to > be GPL free, let's not cut off our nose to spite our face. Given the > interactions between different bits, the FreeBSD selling point of "well > integrated" I think trumps the purity arguments because it's not code > anybody would ever ship (and if they did, they'd get the proper warnings). 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 --whlngj6bhwz26t74 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlx1vKkACgkQaoRlj1JF bu4vWg//aAM+W6q6qwGIKtkK31JP5D4o8bn9C32jIvPdxhYkLtFbsgNLTSn3f/ra HKlfdEO3MejWr3vJsTEdvLcfBsPPot7TqiWgdIGNj5Lm2wSdyPumX1MrfFztDLLr qwXQi3qbXrmK77BbWBOU13zhPydSzMiekQg4PyWRSdbN7GcB9WMQr+e6HvR778df gGudDSdG2qzHVd0vNRV53XLBQyfrHigV2g3zWlnEtMgiQFcHZvTLzbW07hz5eME+ 1IIYjuXXsz6D5BdP4v1I4TnIbUGWYcn/DKSZ0Z8nxekSa4HWpEFn1B1y1hHx/uNC 6Qgisgrh5Epx5fIeDH2KCflKEsvfjz8WBviUpN/gzcVNNWNTlNgVUYyuz0XNDUME laC288wEwd+VcAjuzjKb0P/w6Hjj+wwDL6mv71NQm2+uMq44/2soxutIpWwxytMi yEDe23A4JAiw7SNHRj7JZR3VaPt7bmMh460aOG1Oa9trJAZd9EwgmgPN+Pfmg7sE p0s8udmymdt0drt60x64UTJQNzA6533aWmdoSxgbE1B+RUNzHP/3ZqiwSc3A+r0k SfJo0FCsvGQJkVATmNsJP/B7P51MPdwwvxaGqEgEs3sOzCuxnszj/L4zPPeJbdGi oQQFNqJUYBaqfJlHQFC+TaD72IGO2HZuh7A7k6zohudhPkHz0BM= =XmA/ -----END PGP SIGNATURE----- --whlngj6bhwz26t74-- From owner-svn-src-head@freebsd.org Tue Feb 26 22:34:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE0CC150630E; Tue, 26 Feb 2019 22:34:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E04776DF5; Tue, 26 Feb 2019 22:34:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ABADBCCA; Tue, 26 Feb 2019 22:34:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QMYURf013217; Tue, 26 Feb 2019 22:34:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QMYTo7013214; Tue, 26 Feb 2019 22:34:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262234.x1QMYTo7013214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 22:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344609 - in head/sys: dev/fdt modules/fdt modules/fdt/fdt_slicer X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: dev/fdt modules/fdt modules/fdt/fdt_slicer X-SVN-Commit-Revision: 344609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E04776DF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 22:34:31 -0000 Author: ian Date: Tue Feb 26 22:34:29 2019 New Revision: 344609 URL: https://svnweb.freebsd.org/changeset/base/344609 Log: Make it possible to load fdt_slicer as a module (unloading works too fwiw). Added: head/sys/modules/fdt/ head/sys/modules/fdt/Makefile (contents, props changed) head/sys/modules/fdt/fdt_slicer/ head/sys/modules/fdt/fdt_slicer/Makefile (contents, props changed) Modified: head/sys/dev/fdt/fdt_slicer.c Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Tue Feb 26 22:07:59 2019 (r344608) +++ head/sys/dev/fdt/fdt_slicer.c Tue Feb 26 22:34:29 2019 (r344609) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -131,10 +132,37 @@ fdt_slicer_init(void) FALSE); } +static void +fdt_slicer_cleanup(void) +{ + + flash_register_slicer(NULL, FLASH_SLICES_TYPE_NAND, true); + flash_register_slicer(NULL, FLASH_SLICES_TYPE_CFI, true); + flash_register_slicer(NULL, FLASH_SLICES_TYPE_SPI, true); +} + /* * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_FIRST), * i. e. after g_init() is called, due to the use of the GEOM topology_lock * in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE. */ -SYSINIT(fdt_slicer_rootconf, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, - NULL); +SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, NULL); +SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_cleanup, NULL); + +static int +mod_handler(module_t mod, int type, void *data) +{ + + /* + * Nothing to do here: the SYSINIT/SYSUNINIT defined above run + * automatically at module load/unload time. + */ + return (0); +} + +static moduledata_t fdt_slicer_mod = { + "fdt_slicer", mod_handler, NULL +}; + +DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); +MODULE_VERSION(fdt_slicer, 1); Added: head/sys/modules/fdt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/fdt/Makefile Tue Feb 26 22:34:29 2019 (r344609) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# Build dev/fdt modules. + +SUBDIR = \ + fdt_slicer \ + +.include Added: head/sys/modules/fdt/fdt_slicer/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/fdt/fdt_slicer/Makefile Tue Feb 26 22:34:29 2019 (r344609) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/fdt + +KMOD= fdt_slicer +SRCS= fdt_slicer.c + +# Generated files... +SRCS+= \ + ofw_bus_if.h \ + opt_platform.h \ + +.include From owner-svn-src-head@freebsd.org Tue Feb 26 22:50:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE96315067F4; Tue, 26 Feb 2019 22:50:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E50477537; Tue, 26 Feb 2019 22:50:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DCF7BE8F; Tue, 26 Feb 2019 22:50:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QMo2TU018725; Tue, 26 Feb 2019 22:50:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QMo1Nl018723; Tue, 26 Feb 2019 22:50:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262250.x1QMo1Nl018723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 22:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344610 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 344610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E50477537 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 22:50:03 -0000 Author: ian Date: Tue Feb 26 22:50:01 2019 New Revision: 344610 URL: https://svnweb.freebsd.org/changeset/base/344610 Log: Add manpages for at45d(4) and mx25l(4). Added: head/share/man/man4/at45d.4 (contents, props changed) head/share/man/man4/mx25l.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Feb 26 22:34:29 2019 (r344609) +++ head/share/man/man4/Makefile Tue Feb 26 22:50:01 2019 (r344610) @@ -52,6 +52,7 @@ MAN= aac.4 \ ${_apic.4} \ arcmsr.4 \ ${_asmc.4} \ + at45d.4 \ ata.4 \ ath.4 \ ath_ahb.4 \ @@ -301,6 +302,7 @@ MAN= aac.4 \ mvs.4 \ mwl.4 \ mwlfw.4 \ + mx25l.4 \ mxge.4 \ my.4 \ nand.4 \ Added: head/share/man/man4/at45d.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/at45d.4 Tue Feb 26 22:50:01 2019 (r344610) @@ -0,0 +1,176 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 26, 2019 +.Dt AT45D 4 +.Os +.Sh NAME +.Nm at45d +.Nd driver for DataFlash(tm) non-volatile storage devices +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device at45d" +.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 +at45d_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the family of non-volatile storage +devices known collectively as DataFlash(tm). +DataFlash chips typically have part numbers beginning with AT45DB. +The +.Nm +driver supports only the SPI bus versions of each AT45DB device, +indicated by the last digit of the part number being 1 or 2. +.Pp +The +.Nm +driver uses opcode 0x9f to read the manufacturer and device ID +data to determine whether the device is supported. +The device ID is looked up using a table of data within the driver +which describes the attributes of each supported device, +such as block size, sector size, and device capacity. +When a supported device is found, the +.Nm +driver creates a disk device and makes it accessible at +.Pa /dev/flash/at45d? . +The new disk device is then tasted by the available +.Xr geom 4 +modules as with any disk device. +.Sh HARDWARE +The +.Nm +driver provides support for the following devices: +.Pp +.Bl -bullet -compact +.It +AT45DB011B +.It +AT45DB021B +.It +AT45DB041x +.It +AT45DB081B +.It +AT45DB161x +.It +AT45DB321x +.It +AT45DB321x +.It +AT45DB641E +.It +AT45DB642x +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, the +.Nm +device is defined as a slave device subnode +of the SPI bus controller node. +All properties documented in the +.Va spibus.txt +bindings document can be used with the +.Nm +device. +The most commonly-used ones are documented below. +.Pp +The following properties are required in the +.Nm +device subnode: +.Bl -tag -width indent +.It Va compatible +Must be the string "atmel,at45". +.It Va reg +Chip select address of device. +.It Va spi-max-frequency +The maximum bus frequency to use when communicating with this slave device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.El +.Pp +The following properties are optional for the +.Nm +device subnode: +.Bl -tag -width indent +.It Va spi-cpha +Empty property indicating the slave device requires shifted clock +phase (CPHA) mode. +.It Va spi-cpol +Empty property indicating the slave device requires inverse clock +polarity (CPOL) mode. +.It Va spi-cs-high +Empty property indicating the slave device requires chip select active high. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.at45d.%d.at +The spibus the +.Nm +instance is attached to. +.It Va hint.at45d.%d.clock +The maximum bus frequency to use when communicating with this device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.It Va hint.at45d.%d.cs +The chip-select number to assert when performing I/O for this device. +Set the high bit (1 << 31) to invert the logic level of the chip select line. +.It Va hint.at45d.%d.mode +The SPI mode (0-3) to use when communicating with this device. +.El +.Sh FILES +.Bl -tag -width /dev/flash/at45d? +.It Pa /dev/flash/at45d? +Provides read/write access to the storage device. +.It Pa /dev/flash/spi? +An alias for the +.Pa /dev/at45d? +device, for backwards compatibility with older versions of the driver. +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr geom 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 6.0 . Added: head/share/man/man4/mx25l.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mx25l.4 Tue Feb 26 22:50:01 2019 (r344610) @@ -0,0 +1,209 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 26, 2019 +.Dt MX25L 4 +.Os +.Sh NAME +.Nm mx25l +.Nd driver for SpiFlash(tm) compatible non-volatile storage devices +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mx25l" +.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 +mx25l_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the family of non-volatile storage +devices known collectively as SpiFlash(tm). +SpiFlash chips typically have part numbers beginning with EN25, +IS25, MX25, S25, SST25, or W25. +.Pp +The +.Nm +driver uses opcode 0x9f to read the manufacturer and device ID +data to determine whether the device is supported. +The device ID is looked up using a table of data within the driver +which describes the attributes of each supported device, +such as block size, sector size, and device capacity. +When a supported device is found, the +.Nm +driver creates a disk device and makes it accessible at +.Pa /dev/flash/mx25l? . +The new disk device is then tasted by the available +.Xr geom 4 +modules as with any disk device. +.Sh HARDWARE +The +.Nm +driver provides support for the following devices: +.Pp +.Bl -bullet -compact +.It +AT25DF641 +.It +EN25F32 +.It +EN25P32 +.It +EN25P64 +.It +EN25Q32 +.It +EN25Q64 +.It +GD25Q64 +.It +M25P32 +.It +M25P64 +.It +MX25L1606E +.It +MX25LL128 +.It +MX25LL256 +.It +MX25LL32 +.It +MX25LL64 +.It +S25FL032 +.It +S25FL064 +.It +S25FL128 +.It +S25FL256S +.It +SST25VF010A +.It +SST25VF032B +.It +W25Q128 +.It +W25Q256 +.It +W25Q32 +.It +W25Q64 +.It +W25Q64BV +.It +W25X32 +.It +W25X64 +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, the +.Nm +device is defined as a slave device subnode +of the SPI bus controller node. +All properties documented in the +.Va spibus.txt +bindings document can be used with the +.Nm +device. +The most commonly-used ones are documented below. +.Pp +The following properties are required in the +.Nm +device subnode: +.Bl -tag -width indent +.It Va compatible +Must be the string "jedec,spi-nor". +.It Va reg +Chip select address of device. +.It Va spi-max-frequency +The maximum bus frequency to use when communicating with this slave device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.El +.Pp +The following properties are optional for the +.Nm +device subnode: +.Bl -tag -width indent +.It Va spi-cpha +Empty property indicating the slave device requires shifted clock +phase (CPHA) mode. +.It Va spi-cpol +Empty property indicating the slave device requires inverse clock +polarity (CPOL) mode. +.It Va spi-cs-high +Empty property indicating the slave device requires chip select active high. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.mx25l.%d.at +The spibus the +.Nm +instance is attached to. +.It Va hint.mx25l.%d.clock +The maximum bus frequency to use when communicating with this device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.It Va hint.mx25l.%d.cs +The chip-select number to assert when performing I/O for this device. +Set the high bit (1 << 31) to invert the logic level of the chip select line. +.It Va hint.mx25l.%d.mode +The SPI mode (0-3) to use when communicating with this device. +.El +.Sh FILES +.Bl -tag -width /dev/flash/mx25l? +.It Pa /dev/flash/mx25l? +Provides read/write access to the storage device. +.It Pa /dev/flash/spi? +An alias for the +.Pa /dev/mx25l? +device, for backwards compatibility with older versions of the driver. +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr geom 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 8.0 . From owner-svn-src-head@freebsd.org Tue Feb 26 22:52:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D58E1506E2F; Tue, 26 Feb 2019 22:52:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C564677B0D; Tue, 26 Feb 2019 22:52:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7523C016; Tue, 26 Feb 2019 22:52:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QMq8XE021323; Tue, 26 Feb 2019 22:52:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QMq8a4021322; Tue, 26 Feb 2019 22:52:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262252.x1QMq8a4021322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 22:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344611 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C564677B0D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 26 Feb 2019 22:52:09 -0000 Author: ian Date: Tue Feb 26 22:52:08 2019 New Revision: 344611 URL: https://svnweb.freebsd.org/changeset/base/344611 Log: Add a module dependency on fdt_slicer. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Tue Feb 26 22:50:01 2019 (r344610) +++ head/sys/dev/flash/mx25l.c Tue Feb 26 22:52:08 2019 (r344611) @@ -686,5 +686,6 @@ static driver_t mx25l_driver = { DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devclass, 0, 0); MODULE_DEPEND(mx25l, spibus, 1, 1, 1); #ifdef FDT +MODULE_DEPEND(mx25l, fdt_slicer, 1, 1, 1); SPIBUS_PNP_INFO(compat_data); #endif From owner-svn-src-head@freebsd.org Tue Feb 26 22:52:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBEC1506EFA; Tue, 26 Feb 2019 22:52:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1EF177CBE; Tue, 26 Feb 2019 22:52:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5ADDC036; Tue, 26 Feb 2019 22:52:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1QMqfKV023623; Tue, 26 Feb 2019 22:52:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1QMqf8I023622; Tue, 26 Feb 2019 22:52:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902262252.x1QMqf8I023622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Feb 2019 22:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344612 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1EF177CBE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2019 22:52:42 -0000 Author: ian Date: Tue Feb 26 22:52:41 2019 New Revision: 344612 URL: https://svnweb.freebsd.org/changeset/base/344612 Log: Add a module dependency on fdt_slicer. Also, move the PNP_INFO to its more usual location, down near the DRIVER_MODULE() stuff. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Tue Feb 26 22:52:08 2019 (r344611) +++ head/sys/dev/flash/at45d.c Tue Feb 26 22:52:41 2019 (r344612) @@ -60,7 +60,6 @@ static struct ofw_compat_data compat_data[] = { { "atmel,dataflash", 1 }, { NULL, 0 }, }; -SPIBUS_PNP_INFO(compat_data); #endif /* This is the information returned by the MANUFACTURER_ID command. */ @@ -556,3 +555,8 @@ static driver_t at45d_driver = { DRIVER_MODULE(at45d, spibus, at45d_driver, at45d_devclass, NULL, NULL); MODULE_DEPEND(at45d, spibus, 1, 1, 1); +#ifdef FDT +MODULE_DEPEND(at45d, fdt_slicer, 1, 1, 1); +SPIBUS_PNP_INFO(compat_data); +#endif + From owner-svn-src-head@freebsd.org Tue Feb 26 22:53:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C101506F7F; Tue, 26 Feb 2019 22:53:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from ecc03.stack.nl (ecc03.stack.nl [IPv6:2001:610:1108:5010::210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.stack.nl", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B48AC77E4F; Tue, 26 Feb 2019 22:53:10 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail02.stack.nl (blade.stack.nl [51.15.111.152]) by ecc03.stack.nl (Postfix) with ESMTPS id CBB9220137; Tue, 26 Feb 2019 22:52:58 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail02.stack.nl (Postfix) with ESMTP id A76AA242809; Tue, 26 Feb 2019 22:52:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail02 Received: from mail02.stack.nl ([127.0.0.1]) by localhost (mail02.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3TqGJ35HBaom; Tue, 26 Feb 2019 22:52:56 +0000 (UTC) Received: from blade.stack.nl (blade.stack.nl [192.168.122.130]) by mail02.stack.nl (Postfix) with ESMTP id 8266D242807; Tue, 26 Feb 2019 22:52:56 +0000 (UTC) Received: by blade.stack.nl (Postfix, from userid 1677) id 5D77D20962; Tue, 26 Feb 2019 23:52:56 +0100 (CET) Date: Tue, 26 Feb 2019 23:52:56 +0100 From: Jilles Tjoelker To: rgrimes@freebsd.org Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344570 - head/usr.sbin/sysrc Message-ID: <20190226225256.GA31931@stack.nl> References: <201902260928.x1Q9SBp7098439@repo.freebsd.org> <201902261247.x1QClxsH044906@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201902261247.x1QClxsH044906@pdx.rh.CN85.dnsmgr.net> 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: Tue, 26 Feb 2019 22:53:12 -0000 On Tue, Feb 26, 2019 at 04:47:59AM -0800, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: 0mp (ports committer) > > Date: Tue Feb 26 09:28:10 2019 > > New Revision: 344570 > > URL: https://svnweb.freebsd.org/changeset/base/344570 > > Log: > > sysrc.8: Pet igor and mandoc > This only tells the source of why you changed some, > a good commit log entry tells me that, and what it > is that you changed. You normally do not need to > name the file your changed in a commit log as the > log is attached to the file, sometimes it does make > since to mention a file name in a log entry when you > are describing the changes to just that file in a > commit that includes many files. > A better log might of been: > Pet igor and mandoc. Remove unneeded .Li, use .Fx as needed, > escape hard stop, and sort cross references. Naming the affected area, file or directory can be useful to make the commit message understandable outside of its file's context without needing to look at the diff or list of changed files. Even better, there is a convention of making the first line of the commit message a summary. When following this convention, displaying just the first line of each commit's message allows a good overview of recent changes in the whole tree. I'm happy to see that quite a few committers follow this convention. An extended description can follow the summary after an empty line, but I don't think it is necessary for this commit as the information that would be written there is obvious from the diff. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Wed Feb 27 00:38:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 089791509FA8; Wed, 27 Feb 2019 00:38:05 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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 9A2FC83C7F; Wed, 27 Feb 2019 00:38:04 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B7871218FE; Tue, 26 Feb 2019 19:38:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 26 Feb 2019 19:38:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm2; bh=/ aMjbzisyj7LZHret1D5gXCHcXIaZnxmk4aV3mdEabo=; b=VFYph2+VtL5VhUTn9 MBaaem+mtN37F2XOLbzfdQFUCYkndRjMee72SspiEOQ0j6FWtMRZ0OHeZEJzvxxw 3or9nA6g11YnrMzMA/M4fU8j8UvpQ4XDI/aIuY3zKFqQH58RLENJgzMs3b93K9c6 0IxT0kKv179NlhF9ZxjsSubgVwGQzcunzRZTpzAkMVuGd45n7tjIJg09CQt/NnDh F43uCnGycKUa/xYbGvwCGGCGvFU0MI01FE3G7bcc+Xp4C3hkRVLEkTNKEETd24Km edTOH0Vh0zQVFo+ogLyNLDSApi2yGOaGGdL+BtCX/jIZ8FUMtp3zCGgP3MqoLGcs AxEnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=/aMjbzisyj7LZHret1D5gXCHcXIaZnxmk4aV3mdEa bo=; b=ilqtC+RTVA/kjbytjvYCEmB7moCHRTyRC9oNlQ+668pdl561m1y376ofo VVk8SPTi+6fJI7xUS1IAPDqManTm2caOi35qoPBnxjuYY9VHO/DWYK9wqRWG9es5 CUh+B2iSKwRhaVvURoyzrJNhLulZB0FdduGRTZGtvQTSwu4BgUIq2RGeFcgmbdJW PfFVmWaZhEhKxuUv8vBA9BLVgMQmdp3dKy/MnObg1JCLbAvz3EWGUwHNoE7PwMgv spxDHAoGGYjGVS1uKe0HmABDMaWrYeW4+VMJyePYhbWxVKeuhRNYZDR/UdDEYZSC JfJa6592fwlTcm0ZAjslNqkaDYIgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrvddtgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucfkphepvddtledrud efuddrvdefkedrudekheenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehs rghmshgtohdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from travel-mbp.guest.local (unknown [209.131.238.185]) by mail.messagingengine.com (Postfix) with ESMTPA id D024B10335; Tue, 26 Feb 2019 19:38:01 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov From: Scott Long In-Reply-To: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> Date: Tue, 26 Feb 2019 17:38:00 -0700 Cc: "K. Macy" , Brooks Davis , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Transfer-Encoding: quoted-printable Message-Id: <391EEDA1-6C8E-4352-B0E8-0000C43BD882@samsco.org> References: <201902260218.x1Q2Ig4r042692@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 9A2FC83C7F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 00:38:05 -0000 > On Feb 25, 2019, at 7:18 PM, Rodney W. Grimes = wrote: >=20 >=20 > I think for a few reasons, I doubt you copied the whole distribution > that this file came from, as I am sure that distribution included > a LICENSE file. Second if you actually read the GPL v2 documentation > and follow what it says it says you must do this, just because some > one else does not follow the rules of what the GPL v2 says does not > give us to knowingling not do it. Third this is a particular = dangerious > area for BSD to be mixing a GPL code with its kernel, to my knowlege > we have never had any gpl code in the kernel, no have we ever > allowed it, but thats a seperate argument, that should be made. LOL WAT? You, Rod, were around and quite active when GPL code was added to the kernel in 1994-1995, aka the GPL_MATH_EMULATE code and the EXT2FS code. I see plenty of commits from you in nearby code during that era. That code was in LINT until the mid = 2000=E2=80=99s. I also wrote and committed a sound driver in the early 2000=E2=80=99s = that was (unfortunately) GPL-encumbered. I=E2=80=99m pretty sure that there was = one other sound driver from that era that was also in /sys that was GPL encumbered. I volunteered to have my code purged because the hardware it supported was irrelevant. The FPU code was purged as part of purging 80386 support (though partially also to help reduce GPL code in the system), and the EXT2FS code was purged because it was severely crufty and unused. All of this code existed just fine = in FreeBSD, served a useful purpose for its time, was supported and accepted by Core and the community, and was retired for reasons that were more practical than ideological. I have a hard time taking your musings seriously at this point, your understanding of FreeBSD seems to be severely myopic. Scott From owner-svn-src-head@freebsd.org Wed Feb 27 00:49:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F4D150A38B; Wed, 27 Feb 2019 00:49:20 +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 6AE8B8427E; Wed, 27 Feb 2019 00:49:20 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1C6DD3C475F; Wed, 27 Feb 2019 00:49:19 +0000 (UTC) Date: Wed, 27 Feb 2019 00:49:19 +0000 From: Brooks Davis To: "K. Macy" Cc: Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov Message-ID: <20190227004919.GJ47081@spindle.one-eyed-alien.net> References: <201902232114.x1NLE0cH085345@repo.freebsd.org> <20190225175809.GB47081@spindle.one-eyed-alien.net> <20190226175248.GF47081@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JIpyCmsTxyPLrmrM" Content-Disposition: inline In-Reply-To: <20190226175248.GF47081@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 6AE8B8427E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.89)[-0.894,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 00:49:21 -0000 --JIpyCmsTxyPLrmrM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 05:52:48PM +0000, Brooks Davis wrote: > On Mon, Feb 25, 2019 at 05:11:26PM -0800, K. Macy wrote: > > > An additional issue is that the a warning tag was not added to > > > sys/conf/files. A warning along the lines of: > > > > > > warning "kernel contains GPLv2 licensed GCOV" > > > > > > needs to be added. > >=20 > > Yup. > >=20 > > > > > > This commit needed more through review. > >=20 > > How would this be achieved:? I had several people on the review and no > > one had substantive feedback. >=20 > For GPL stuff, add #core to the reviewers list and feel free to drop us > an email to make sure we see it promptly. FYI, we've had phab-admin@ add a herald rule to add #core as a reviewer automatically for changes that add new lines containing either the SPDX tag or the string "GNU General Public License". Hopefully this will limit future drama in this area. Documentation updates are in also in progress. -- Brooks --JIpyCmsTxyPLrmrM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcdd6OAAoJEKzQXbSebgfAizkH/jD7L34cKSRNqhZ2iNmG9FiS oOHhe2f8Q41j9avkM/RzsSH3Z70d9Aub1agsoM0G0dL4AZvF2lp4gYq/iYZKNypA aikEcuJgUQiESuv6LuDk/jU6RRF4uaqswjWiF8XejNReHiwHyTXegVD85sPKQDPu iqju4HAkNP9ekDeZ/mQGZGGi4mDhw0g9xZ7JPv9xDiB0Xr53bLCMhrBjhLPgBsEI AsofBWC2bI30JFbsaVMUTDhbLooXzQuE+/EA/whO07E4xrzrk5x1iRAHQielvDWs y4X14G2b9mQwhDlb/Gv5o1IM0XNcKRs4EM1EXMkbl36Xq21/QVfWQVTvC2JcTZA= =BvMM -----END PGP SIGNATURE----- --JIpyCmsTxyPLrmrM-- From owner-svn-src-head@freebsd.org Wed Feb 27 01:03:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDA98150A93C; Wed, 27 Feb 2019 01:03:56 +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 54D7884B72; Wed, 27 Feb 2019 01:03:56 +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 x1R13sdQ048477; Tue, 26 Feb 2019 17:03:54 -0800 (PST) (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 x1R13rQg048476; Tue, 26 Feb 2019 17:03:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902270103.x1R13rQg048476@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov In-Reply-To: <20190227004919.GJ47081@spindle.one-eyed-alien.net> To: Brooks Davis Date: Tue, 26 Feb 2019 17:03:53 -0800 (PST) CC: "K. Macy" , Matt Macy , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 54D7884B72 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 01:03:57 -0000 > On Tue, Feb 26, 2019 at 05:52:48PM +0000, Brooks Davis wrote: > > On Mon, Feb 25, 2019 at 05:11:26PM -0800, K. Macy wrote: > > > > An additional issue is that the a warning tag was not added to > > > > sys/conf/files. A warning along the lines of: > > > > > > > > warning "kernel contains GPLv2 licensed GCOV" > > > > > > > > needs to be added. > > > > > > Yup. > > > > > > > > > > > This commit needed more through review. > > > > > > How would this be achieved:? I had several people on the review and no > > > one had substantive feedback. > > > > For GPL stuff, add #core to the reviewers list and feel free to drop us > > an email to make sure we see it promptly. > > FYI, we've had phab-admin@ add a herald rule to add #core as a reviewer > automatically for changes that add new lines containing either the SPDX > tag or the string "GNU General Public License". Hopefully this will > limit future drama in this area. Documentation updates are in also in > progress. Thank you! Now can you get phab-admin to respond to my 3 emails, and jhb@'s at least one email on the topic of the #bhyve phab rules that I carry in my personal login. I have made multiple requests to have this handled, with not even a ank from phab-admin. I ask for the 3rd time, is there plans to update the text in the commiters guide to reflect the text of the /internal/ policy document? > -- brooks Thanks again, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 27 03:28:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC400150DE51; Wed, 27 Feb 2019 03:28:08 +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 5AD33896D7; Wed, 27 Feb 2019 03:28:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id ypt4g0bIHYJbBypt6gGIhk; Tue, 26 Feb 2019 20:28:05 -0700 X-Authority-Analysis: v=2.3 cv=H/OlPNQi c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=VxmjJ2MpAAAA:8 a=CgiagczvAAAA:8 a=6I5d2MoRAAAA:8 a=DsloTXpuAAAA:20 a=FNC4LJVLAAAA:20 a=YxBL1-UpAAAA:8 a=W4vuXjRrcZIx3ueIaHIA:9 a=AH9O4czvlS-Q1jQD:21 a=TkqQLVIjEMdcMY2_:21 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=ZydqF0V2MF2Cvey6h_li: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 47FFB1C2; Tue, 26 Feb 2019 19:28:02 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1R3RgsC062954; Tue, 26 Feb 2019 19:27:42 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x1R3RfXn062807; Tue, 26 Feb 2019 19:27:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902270327.x1R3RfXn062807@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: Fatih Acar , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jack@gandi.net, fatih@gandi.net Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: Message from Cy Schubert of "Tue, 26 Feb 2019 13:02:53 -0800." <201902262102.x1QL2rIo032528@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 26 Feb 2019 19:27:41 -0800 X-CMAE-Envelope: MS4wfPrvZfhVl0WvX5742kozPO5jUFwVtulPpHnavJmhd2c1+m4G508livHCAWkAuBP/lIUt8Ui+QIrlhENQ2nXUcpBkDSjDXV5V36X1x1JD/klQFdsABKTJ BEY8CvhUivm3I6/LRsDO1PzxbOcBPHzWM6xxw835TOreVPbizeuVoW6MZnOkp+a52T1CS+rWoJ1AdPEWmxmUiiCCFQeA2O1/PpmbBgwMtpTb96/JCzAQojvA j+yCn8ahbXWUFKqKfZpOme+3bQki6BiTJXA37zZApLFpJ+RwbYvgyc3r/LHI1XPafGrH/veMfbeIgh5zbTB3YXT2OVCE5tlooSDpPXPI3dF79ED/x2mVX/Ca ik72M55++BmDrK3rB24lhSpcu1hkAA== X-Rspamd-Queue-Id: 5AD33896D7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.70 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.85)[-0.850,0]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.14)[ip: (-5.86), ipnet: 64.59.128.0/20(-2.65), asn: 6327(-2.08), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.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: Wed, 27 Feb 2019 03:28:09 -0000 In message <201902262102.x1QL2rIo032528@slippy.cwsent.com>, Cy Schubert writes: > In message , Fatih Acar > writes: > > This is a multi-part message in MIME format. > > --------------6A54CE5B28D823DCB8C41577 > > Content-Type: text/plain; charset=utf-8 > > Content-Transfer-Encoding: 8bit > > > > On 2/26/19 5:36 PM, Cy Schubert wrote: > > > On February 26, 2019 8:11:31 AM PST, Baptiste Daroussin > > > wrote: > > >> On Tue, Feb 26, 2019 at 05:04:11PM +0100, Baptiste Daroussin wrote: > > >>> On Tue, Feb 26, 2019 at 07:48:27AM -0800, Cy Schubert wrote: > > >>>> On February 26, 2019 12:18:35 AM PST, Baptiste Daroussin > > >> wrote: > > >>>>> Author: bapt > > >>>>> Date: Tue Feb 26 08:18:34 2019 > > >>>>> New Revision: 344569 > > >>>>> URL: https://svnweb.freebsd.org/changeset/base/344569 > > >>>>> > > >>>>> Log: > > >>>>> Implement parallel mounting for ZFS filesystem > > >>>>> > > >>>>> It was first implemented on Illumos and then ported to ZoL. > > >>>>> This patch is a port to FreeBSD of the ZoL version. > > >>>>> This patch also includes a fix for a race condition that was > > >> amended > > >>>>> > > >>>>> With such patch Delphix has seen a huge decrease in latency of the > > >>>>> mount phase > > >>>>> (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for > > >> details). > > >>>>> With that current change Gandi has measured improvments that are > > >> on par > > >>>>> with > > >>>>> those reported by Delphix. > > >>>>> > > >>>>> Zol commits incorporated: > > >>>> > > >>> https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c > 70 > > c9c9e303 > > >>>> > > >>> https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d407 > 75 > > 67dfea21 > > >>>>> > > >>>>> Reviewed by: avg, sef > > >>>>> Approved by: avg, sef > > >>>>> Obtained from: ZoL > > >>>>> MFC after: 1 month > > >>>>> Relnotes: yes > > >>>>> Sponsored by: Gandi.net > > >>>>> Differential Revision: https://reviews.freebsd.org/D19098 > > >>>>> > > >>>>> Modified: > > >>>>> head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h > > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h > > >>>>> head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c > > >>>>> > > >>>>> Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > >>>> > > >>> ======================================================================= > == > > ===== > [...] > > >>>>> > > >>>> > > >>>> This broke my systems, many filesystems fail to mount causing > > >> nullfs late mounts to fail. No details now until tonight. > > >>>> > > >>>> Suggest we back this out until it is properly tested. > > >>>> > > >>> > > >>> What fails to mount? what message? can you provide Gandi folks more > > >> informations > > >>> so they can fix? > > >>> > > >>> I will revert if we cannot have a quick fix but let s give them a > > >> chance to fix > > >>> first. > > >>> > > >> With the proper email in CC there is a better chance to reach at them > > >> :) > > >> > > >> Best regards, > > >> Bapt > > > > > > Sorry about that. I'm terribly frustrated as this broke my mail gateway, > ha > > ving to fix it using juiceSSH on my phone on the bus. Ssh on the phone make > s > > for a very grumpy Cy. > > > > > > I did bring my personal laptop to work, so I'll try to help out testing t > hi > > s at noon here and maybe look at it more. I'll help out any way I can. > > > > > > > > > > Sorry about all this... > > Could you try the attached patch, it should fix the issue. I don't > > understand how this regression happened, it's not present in ZoL... > > I'll check with Jack who worked on this when he's back from PTO. > > > > Thanks. > > > > -- > > Fatih ACAR > > Gandi > > fatih.acar@gandi.net > > > > --------------6A54CE5B28D823DCB8C41577 > > Content-Type: text/x-patch; > > name="mount.patch" > > Content-Transfer-Encoding: quoted-printable > > Content-Disposition: attachment; > > filename="mount.patch" > > > > Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.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 > > --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c (revisi > on 3= > > 44590) > > +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c (workin > g co= > > py) > > @@ -1260,11 +1260,11 @@ > > if (*a =3D=3D '\0') > > return (-1); > > if (*b =3D=3D '\0') > > - return (-1); > > + return (1); > > if (*a =3D=3D '/') > > return (-1); > > if (*b =3D=3D '/') > > - return (-1); > > + return (1); > > return (*a < *b ? -1 : *a > *b); > > } > > =20 > > > > Thanks. This fixes this particular issue. Should we consider committing this? -- 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 Feb 27 03:30:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A861150DF62; Wed, 27 Feb 2019 03:30:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CEED898D4; Wed, 27 Feb 2019 03:30:50 +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 EF37EEFEF; Wed, 27 Feb 2019 03:30:49 +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 x1R3UnjI067785; Wed, 27 Feb 2019 03:30:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1R3UnPY067784; Wed, 27 Feb 2019 03:30:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201902270330.x1R3UnPY067784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 27 Feb 2019 03:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344613 - 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: 344613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CEED898D4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 03:30:50 -0000 Author: jhibbits Date: Wed Feb 27 03:30:49 2019 New Revision: 344613 URL: https://svnweb.freebsd.org/changeset/base/344613 Log: powerpc/mpc85xx: Synchronize timebase the platform correct way Summary: To safely synchronize timebase we need to disable the timebase on all cores, set timebase, and resynchronize. This adds two new devices, mutually exclusive, which attach on the SoC simplebus, to freeze and unfreeze the timebase. The devices are singletons, and platform-specific, so no reason to make them optional and in separate files. This was found to be necessary for top(1) to work correctly on an AmigaOne X5000 (P5020 SoC). It also fixes bufdaemon and bufspacedaemon hangs at shutdown. Test Plan: Regression test on various Book-E hardware. Reviewed by: nwhitehorn Tested by: Brandon Bergren (git_bdragon.rtk0.net) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19208 Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Tue Feb 26 22:52:41 2019 (r344612) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed Feb 27 03:30:49 2019 (r344613) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,6 +88,11 @@ vm_size_t ccsrbar_size; static int cpu, maxcpu; +static device_t rcpm_dev; +static void dummy_freeze(device_t, bool); + +static void (*freeze_timebase)(device_t, bool) = dummy_freeze; + static int mpc85xx_probe(platform_t); static void mpc85xx_mem_regions(platform_t, struct mem_region *phys, int *physsz, struct mem_region *avail, int *availsz); @@ -529,7 +535,174 @@ mpc85xx_reset(platform_t plat) static void mpc85xx_smp_timebase_sync(platform_t plat, u_long tb, int ap) { + static volatile bool tb_ready; + static volatile int cpu_done; - mttb(tb); + if (ap) { + /* APs. Hold off until we get a stable timebase. */ + while (!tb_ready) + atomic_thread_fence_seq_cst(); + mttb(tb); + atomic_add_int(&cpu_done, 1); + while (cpu_done < mp_ncpus) + atomic_thread_fence_seq_cst(); + } else { + /* BSP */ + freeze_timebase(rcpm_dev, true); + tb_ready = true; + mttb(tb); + atomic_add_int(&cpu_done, 1); + while (cpu_done < mp_ncpus) + atomic_thread_fence_seq_cst(); + freeze_timebase(rcpm_dev, false); + } } +/* Fallback freeze. In case no real handler is found in the device tree. */ +static void +dummy_freeze(device_t dev, bool freeze) +{ + /* Nothing to do here, move along. */ +} + + +/* QorIQ Run control/power management timebase management. */ + +#define RCPM_CTBENR 0x00000084 +struct mpc85xx_rcpm_softc { + struct resource *sc_mem; +}; + +static void +mpc85xx_rcpm_freeze_timebase(device_t dev, bool freeze) +{ + struct mpc85xx_rcpm_softc *sc; + + sc = device_get_softc(dev); + + if (freeze) + bus_write_4(sc->sc_mem, RCPM_CTBENR, 0); + else + bus_write_4(sc->sc_mem, RCPM_CTBENR, (1 << maxcpu) - 1); +} + +static int +mpc85xx_rcpm_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "fsl,qoriq-rcpm-1.0")) + return (ENXIO); + + device_set_desc(dev, "QorIQ Run control and power management"); + return (BUS_PROBE_GENERIC); +} + +static int +mpc85xx_rcpm_attach(device_t dev) +{ + struct mpc85xx_rcpm_softc *sc; + int rid; + + sc = device_get_softc(dev); + freeze_timebase = mpc85xx_rcpm_freeze_timebase; + rcpm_dev = dev; + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + + return (0); +} + +static device_method_t mpc85xx_rcpm_methods[] = { + DEVMETHOD(device_probe, mpc85xx_rcpm_probe), + DEVMETHOD(device_attach, mpc85xx_rcpm_attach), + DEVMETHOD_END +}; + +static devclass_t mpc85xx_rcpm_devclass; + +static driver_t mpc85xx_rcpm_driver = { + "rcpm", + mpc85xx_rcpm_methods, + sizeof(struct mpc85xx_rcpm_softc) +}; + +EARLY_DRIVER_MODULE(mpc85xx_rcpm, simplebus, mpc85xx_rcpm_driver, + mpc85xx_rcpm_devclass, 0, 0, BUS_PASS_BUS); + + +/* "Global utilities" power management/Timebase management. */ + +#define GUTS_DEVDISR 0x00000070 +#define DEVDISR_TB0 0x00004000 +#define DEVDISR_TB1 0x00001000 + +struct mpc85xx_guts_softc { + struct resource *sc_mem; +}; + +static void +mpc85xx_guts_freeze_timebase(device_t dev, bool freeze) +{ + struct mpc85xx_guts_softc *sc; + uint32_t devdisr; + + sc = device_get_softc(dev); + + devdisr = bus_read_4(sc->sc_mem, GUTS_DEVDISR); + if (freeze) + bus_write_4(sc->sc_mem, GUTS_DEVDISR, + devdisr | (DEVDISR_TB0 | DEVDISR_TB1)); + else + bus_write_4(sc->sc_mem, GUTS_DEVDISR, + devdisr & ~(DEVDISR_TB0 | DEVDISR_TB1)); +} + +static int +mpc85xx_guts_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "fsl,mpc8572-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1020-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1021-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1022-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1023-guts") && + !ofw_bus_is_compatible(dev, "fsl,p2020-guts")) + return (ENXIO); + + device_set_desc(dev, "MPC85xx Global Utilities"); + return (BUS_PROBE_GENERIC); +} + +static int +mpc85xx_guts_attach(device_t dev) +{ + struct mpc85xx_rcpm_softc *sc; + int rid; + + sc = device_get_softc(dev); + freeze_timebase = mpc85xx_guts_freeze_timebase; + rcpm_dev = dev; + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + + return (0); +} + +static device_method_t mpc85xx_guts_methods[] = { + DEVMETHOD(device_probe, mpc85xx_guts_probe), + DEVMETHOD(device_attach, mpc85xx_guts_attach), + DEVMETHOD_END +}; + +static driver_t mpc85xx_guts_driver = { + "guts", + mpc85xx_guts_methods, + sizeof(struct mpc85xx_guts_softc) +}; + +static devclass_t mpc85xx_guts_devclass; + +EARLY_DRIVER_MODULE(mpc85xx_guts, simplebus, mpc85xx_guts_driver, + mpc85xx_guts_devclass, 0, 0, BUS_PASS_BUS); From owner-svn-src-head@freebsd.org Wed Feb 27 03:32:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DDD7150E4FD for ; Wed, 27 Feb 2019 03:32:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 AE34989EF3 for ; Wed, 27 Feb 2019 03:32:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82e.google.com with SMTP id u7so8465177qtg.9 for ; Tue, 26 Feb 2019 19:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jFXkU9Tg+C04zVlgmvvRMp9aLDxmmoxHwec7zAEroi8=; b=xosrBUpbvziYuwWF5ZzOI82pO0u1mvmc8bg9b2L6vcLTg3S7RWHuSFa1N9ur21MwL4 dl2R/Ykl6H6H2jB0CzyjTy3nIaBnzM/E5/U5BNGeyBy1rFof28K+0bh8w/GFTe4YnoV/ KsxpIDLeX01zeSXYTXN7pOSqVKXBcQaErngRXb90ZXh0Bltuh3P1IgI9zzMb1YmVeQTJ NVXoHNZm4Z7oA39z5eMm7ceS0iRvF9UKkgKlAB/EZD9eAQaAtForHXDs3ueInPe3jVY2 hWUGUhC5BI/XUKgVrzFgT4xhbh+rcUx76GVwavBnd5yaQKCULqGayI3VPZaWnLULka8W 7E+Q== 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=jFXkU9Tg+C04zVlgmvvRMp9aLDxmmoxHwec7zAEroi8=; b=klpmMLWF1XaRao+K6Vgx5tzL1dNDRqEGoA9mqxq6xzt3d70cjh5BuDQMGYCiwQplMP XB5TE09rTTyCoF7rds2RLUfnlimBfeOpBtnIeILdZ74gUOaq783BSGLX7Tui5mAzP6Ft A/trIgmiFGlzrVQj7CGjNefyxmQvjQ7mCG7RbMDPcjL7NPXi59KjIVd6M0bo+saVoEk9 VqR0Sm8C97GK7l+8NmhR8AkByiZMiOwGB+QCf1JymusUgJFMS79t/7MlBOI4NjTCw3fF U/J6lIBynSATpWyk3kL17l3bCrw1JJ5DrQibJKwsAk+2seUamWw8rnGtEgjKUAbEsS55 aoBA== X-Gm-Message-State: APjAAAUS47e2qv5WshHP3zacbSIMk+zoNegLw67hhrYflsg3DD3VXvH8 nne5dABGiE8ya3+/ULHSVXsaV6zYdLAElUFRjDct/w== X-Google-Smtp-Source: APXvYqwaTjVdMyfIMgSvzL3hZuiYgXDZNVfzq3zYOZIBGOjTiE4s3owQSgZukaNxp1m+UAzhleBOLidnNR7Bau2zlKE= X-Received: by 2002:a0c:987a:: with SMTP id e55mr219396qvd.21.1551238358844; Tue, 26 Feb 2019 19:32:38 -0800 (PST) MIME-Version: 1.0 References: <20190226173749.A1863@besplex.bde.org> <201902260749.x1Q7n1GI043756@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902260749.x1Q7n1GI043756@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Tue, 26 Feb 2019 20:32:26 -0700 Message-ID: Subject: Re: svn commit: r344562 - head/sys/ufs/ffs To: "Rodney W. Grimes" Cc: Bruce Evans , Jason Harmening , "Jason A. Harmening" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: AE34989EF3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 03:32:40 -0000 On Tue, Feb 26, 2019, 12:49 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Mon, 25 Feb 2019, Jason Harmening wrote: > > > > > On 2/25/19 9:46 PM, Bruce Evans wrote: > > >> > > >> block_size <= PAGE_SIZE is very uncommon for ffs, even on systems > with > > >> large > > >> pages. MINBSIZE is 4096 in ffs (except in my version, it is 512). > The > > >> default is 32768 in newfs. I consider this excessive and only use it > for > > >> file systems with many files larger than 1GB, but it is the most > common > > >> size. > > >> It is larger than the large page size of 8192. > > > > > > I think this is a case of filesystem logical block size vs. media > sector > > > size, right? Here we're checking the devvp's block size, which I > think > > > should correspond to the sector size. I'd expect cases of that being > > > greater than PAGE_SIZE to be uncommon, in fact geli warns when that is > the > > > case. I probably should've made that clearer in the commit message. > > > > Yes, I missed that you are checking devvp. ffs_getpages() also checks > > devvp. > > > > So the bug has nothing to do with file system logical (fragment) or i/o > > (block) block size's, except file systems themselves won't work unless > > their i/o size is a multiple of the underlying devices (sector) i/o size. > > > > Are there physical disk with sector size > PAGE_SIZE now? > > I have been told that there are some sd/flash devices that > have a 16k physical sector size, I have not been able to > confirm that information though. > There are a number of drives that report 16k physical, but 4k sector size. Others vendors have suggested that 32k or 64k may be on the horizon. But all these drives still report an LBA size of 4k. The drive vendors I've talked to have indicated that a larger sector size is in the works, but so far they haven't indicated what that newer size will wind up being, or when it would appear in the market... The timing of when may be unknown, but it's quite likely the future will have to cope with a mismatch. Warner > It is easy to > > create virtual (md) disks with sector size > PAGE_SIZE, and this may even > > be useful for avoiding the related problem of having to access large fs > > blocks to do i/o to small md sectors. I think it is best to use > PAGE_SIZE > > blocks in all layers and sometimes combine these into clusters. > > > > Bruce > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Wed Feb 27 04:16:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69E91150F8CE; Wed, 27 Feb 2019 04:16:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0AC68BA8D; Wed, 27 Feb 2019 04:16:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D24C4F795; Wed, 27 Feb 2019 04:16:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1R4GWJs093377; Wed, 27 Feb 2019 04:16:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1R4GWPc093376; Wed, 27 Feb 2019 04:16:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902270416.x1R4GWPc093376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 27 Feb 2019 04:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344614 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 344614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0AC68BA8D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 04:16:33 -0000 Author: ian Date: Wed Feb 27 04:16:32 2019 New Revision: 344614 URL: https://svnweb.freebsd.org/changeset/base/344614 Log: Rename some functions and variables to have shorter names, which allows unwrapping multiple lines of code. Also, convert some short multiline comments into single-line comments. Change old-school FALSE to false. All in all, no functional changes, it's just more compact and readable. Modified: head/sys/dev/fdt/fdt_slicer.c Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Wed Feb 27 03:30:49 2019 (r344613) +++ head/sys/dev/fdt/fdt_slicer.c Wed Feb 27 04:16:32 2019 (r344614) @@ -46,19 +46,19 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -static int fdt_flash_fill_slices(device_t dev, const char *provider, +static int fill_slices(device_t dev, const char *provider, struct flash_slice *slices, int *slices_num); static void fdt_slicer_init(void); static int -fdt_flash_fill_slices(device_t dev, const char *provider __unused, +fill_slices(device_t dev, const char *provider __unused, struct flash_slice *slices, int *slices_num) { char *slice_name; - phandle_t dt_node, dt_child; + phandle_t node, child; u_long base, size; int i; - ssize_t name_len; + ssize_t nmlen; /* * We assume the caller provides buffer for FLASH_SLICES_MAX_NUM @@ -69,19 +69,17 @@ fdt_flash_fill_slices(device_t dev, const char *provid return (ENOMEM); } - dt_node = ofw_bus_get_node(dev); - for (dt_child = OF_child(dt_node), i = 0; dt_child != 0; - dt_child = OF_peer(dt_child)) { + i = 0; + node = ofw_bus_get_node(dev); + for (child = OF_child(node); child != 0; child = OF_peer(child)) { if (i == FLASH_SLICES_MAX_NUM) { debugf("not enough buffer for slice i=%d\n", i); break; } - /* - * Retrieve start and size of the slice. - */ - if (fdt_regsize(dt_child, &base, &size) != 0) { + /* Retrieve start and size of the slice. */ + if (fdt_regsize(child, &base, &size) != 0) { debugf("error during processing reg property, i=%d\n", i); continue; @@ -92,24 +90,19 @@ fdt_flash_fill_slices(device_t dev, const char *provid continue; } - /* - * Retrieve label. - */ - name_len = OF_getprop_alloc(dt_child, "label", - (void **)&slice_name); - if (name_len <= 0) { + /* Retrieve label. */ + nmlen = OF_getprop_alloc(child, "label", (void **)&slice_name); + if (nmlen <= 0) { /* Use node name if no label defined */ - name_len = OF_getprop_alloc(dt_child, "name", + nmlen = OF_getprop_alloc(child, "name", (void **)&slice_name); - if (name_len <= 0) { + if (nmlen <= 0) { debugf("slice i=%d with no name\n", i); slice_name = NULL; } } - /* - * Fill slice entry data. - */ + /* Fill slice entry data. */ slices[i].base = base; slices[i].size = size; slices[i].label = slice_name; @@ -124,12 +117,9 @@ static void fdt_slicer_init(void) { - flash_register_slicer(fdt_flash_fill_slices, FLASH_SLICES_TYPE_NAND, - FALSE); - flash_register_slicer(fdt_flash_fill_slices, FLASH_SLICES_TYPE_CFI, - FALSE); - flash_register_slicer(fdt_flash_fill_slices, FLASH_SLICES_TYPE_SPI, - FALSE); + flash_register_slicer(fill_slices, FLASH_SLICES_TYPE_NAND, false); + flash_register_slicer(fill_slices, FLASH_SLICES_TYPE_CFI, false); + flash_register_slicer(fill_slices, FLASH_SLICES_TYPE_SPI, false); } static void From owner-svn-src-head@freebsd.org Wed Feb 27 04:17:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C841150F97D for ; Wed, 27 Feb 2019 04:17:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (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 1C1048BBF3 for ; Wed, 27 Feb 2019 04:17:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x841.google.com with SMTP id s1so17770112qte.5 for ; Tue, 26 Feb 2019 20:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X0hLsD4DzO+ybSvEWm8CXZCpnMZdBxh+rETifCfDvo8=; b=bMg5WaNjSJsoJFyNSBRloJP5qShqJ3p1jl5wMHxP0ZvnI2HSX8dTV1A0wJu9GlxwZ+ GKfjY19YN65CRd817BHJ4JyHzby0B/RTWoJg2SAYFTw6j27szxXak46xE0sT7KnqKC05 8qqtYJo4NNKNcyz6SCJdCcYgiRbhIZmjsVC/+EWnYpcBmiaGXzgKLt1w7Mj4bOc3HdGd KleDDB9VwSAks3sCwlAKQuSQLkf577Pzbt3boMrpl13dENJeUq6pDGxroqZoO8uRRHsX qjhhuBf/AgPG5eXnkb2gxizeur0OtT/iMIA4Igo2S796atXV+xTHGl2LfSnVPUVmfDZI ceXA== 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=X0hLsD4DzO+ybSvEWm8CXZCpnMZdBxh+rETifCfDvo8=; b=YQ0EIKA1C6rc+QGVhlxV9jb+oS4zUVDhtKccCh+qag9cWrzrEFKg2iSOrtJ1u0BRod g0pobA/jNJmsI28gUNAzdWBBRBasL7RQUkMfAFL7E1VIFLUROXLMJU5TTSSbsFZ787uf SE0ritDhCcivc/mdLdbr79kfjTOADWuOZ+7XatVhpMjLW0QMyvOSBTZREB2ntYv23VL8 yP/SsrFFQb4sumIgwrr6FHfLXVqr07KiddNQjIlAav6VxvLtPqnAMIuoQg/IK7mfDylt z4y74x0Js/xreppEyqmEs5luU9Gviag93itWeQwWYhpO1vrJukeBtqNvaIH4bGoIWZmf vIrQ== X-Gm-Message-State: AHQUAuYl1L8+/DIqOGGVdw3ZfNUnPz9K/SV9D+CTD+Z2p/yVR85VqSjR sRu1PaXuPqaYdZYB5FLnxZ/KOykjGMlZqPf2Ar0Meg== X-Google-Smtp-Source: AHgI3Ib45eCcwadiYvjSaIEIwIwksFWcd9+2dzgWgsLBhOZVf2dzP9Oq2e6jImglgiYAMdGGFXoJI1J/+OgnF4vyh6U= X-Received: by 2002:ac8:35f8:: with SMTP id l53mr77668qtb.15.1551241040488; Tue, 26 Feb 2019 20:17:20 -0800 (PST) MIME-Version: 1.0 References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> In-Reply-To: <20190226134953.GB39566@FreeBSD.org> From: Warner Losh Date: Tue, 26 Feb 2019 21:17:08 -0700 Message-ID: Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec To: Alexey Dokuchaev Cc: "Rodney W. Grimes" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-Rspamd-Queue-Id: 1C1048BBF3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 04:17:21 -0000 On Tue, Feb 26, 2019, 6:50 AM Alexey Dokuchaev wrote: > On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: > > > Author: sjg > > > Date: Tue Feb 26 06:17:23 2019 > > > New Revision: 344567 > > > URL: https://svnweb.freebsd.org/changeset/base/344567 > > > > > > Log: > > > Add verifying manifest loader for mac_veriexec > > > > > > This tool will verify a signed manifest and load contents into > > > mac_veriexec for storage > > > > > > Sponsored by: Juniper Networks > > > Differential Revision: D16575 > > > > Just a small nit, for future reference, from the template: > > > Differential Revision: https://reviews.freebsd.org/D### > > (*full* phabric URL needed). > > IMHO we should just fix the scripts to accept D#### alone, without > the URL. We don't do that for PR (bugzilla) references, and the fact > that we do for the phab is both needless and confusing. Also, that > URL might change one day while we could probably keep the old numbers > if we move. When this came up before, it was an upstream decision to require the full path. The reasoning is that Dxxxx space isn't unique and the review may happen in a different instance of phab than the default one. When those exact objections were raised, the experience of moving to bugzilla was cited to show the URL can remain stable. And if we went to another system's, we could keep the old in place and then we would need a new URL to disambiguate. There were good reasons we decided this before. So this has been litigated before, and the consensus was we needed to break with the practice of not putting URLs in commit messages for these reasons. Warner > From owner-svn-src-head@freebsd.org Wed Feb 27 04:19:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB6E150FAC4; Wed, 27 Feb 2019 04:19:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9300A8BE0B; Wed, 27 Feb 2019 04:19:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57F42F79A; Wed, 27 Feb 2019 04:19:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1R4JUK1093524; Wed, 27 Feb 2019 04:19:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1R4JUXF093523; Wed, 27 Feb 2019 04:19:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902270419.x1R4JUXF093523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 27 Feb 2019 04:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344615 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 344615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9300A8BE0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 04:19:31 -0000 Author: ian Date: Wed Feb 27 04:19:29 2019 New Revision: 344615 URL: https://svnweb.freebsd.org/changeset/base/344615 Log: Child nodes with a compatible property are not slices, according to the devicetree/bindings/mtd/partitions.txt document, so just ignore them. Modified: head/sys/dev/fdt/fdt_slicer.c Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Wed Feb 27 04:16:32 2019 (r344614) +++ head/sys/dev/fdt/fdt_slicer.c Wed Feb 27 04:19:29 2019 (r344615) @@ -73,6 +73,10 @@ fill_slices(device_t dev, const char *provider __unuse node = ofw_bus_get_node(dev); for (child = OF_child(node); child != 0; child = OF_peer(child)) { + /* Nodes with a compatible property are not slices. */ + if (OF_hasprop(child, "compatible")) + continue; + if (i == FLASH_SLICES_MAX_NUM) { debugf("not enough buffer for slice i=%d\n", i); break; From owner-svn-src-head@freebsd.org Wed Feb 27 04:58:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B38861510769; Wed, 27 Feb 2019 04:58:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2988CEAA; Wed, 27 Feb 2019 04:58:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C591FE49; Wed, 27 Feb 2019 04:58:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1R4wJU7014222; Wed, 27 Feb 2019 04:58:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1R4wJT8014221; Wed, 27 Feb 2019 04:58:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201902270458.x1R4wJT8014221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 27 Feb 2019 04:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344616 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 344616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A2988CEAA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 04:58:19 -0000 Author: ian Date: Wed Feb 27 04:58:18 2019 New Revision: 344616 URL: https://svnweb.freebsd.org/changeset/base/344616 Log: Add support to fdt_slicer for the new style partition data documented in devicetree/bindings/mtd/partition.txt. In the old style, all the children of the device node which did not have a compatible property were the partitions. In the new style, there is a child node of the device which has a compatible string of "fixed-partitions", and its children are the individual partitions. Also, support the read-only property by setting the corresponding slice flag. Modified: head/sys/dev/fdt/fdt_slicer.c Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Wed Feb 27 04:19:29 2019 (r344615) +++ head/sys/dev/fdt/fdt_slicer.c Wed Feb 27 04:58:18 2019 (r344616) @@ -51,27 +51,17 @@ static int fill_slices(device_t dev, const char *provi static void fdt_slicer_init(void); static int -fill_slices(device_t dev, const char *provider __unused, - struct flash_slice *slices, int *slices_num) +fill_slices_from_node(phandle_t node, struct flash_slice *slices, int *count) { - char *slice_name; - phandle_t node, child; + char *label; + phandle_t child; u_long base, size; - int i; + int flags, i; ssize_t nmlen; - /* - * We assume the caller provides buffer for FLASH_SLICES_MAX_NUM - * flash_slice structures. - */ - if (slices == NULL) { - *slices_num = 0; - return (ENOMEM); - } - i = 0; - node = ofw_bus_get_node(dev); for (child = OF_child(node); child != 0; child = OF_peer(child)) { + flags = FLASH_SLICES_FLAG_NONE; /* Nodes with a compatible property are not slices. */ if (OF_hasprop(child, "compatible")) @@ -95,26 +85,59 @@ fill_slices(device_t dev, const char *provider __unuse } /* Retrieve label. */ - nmlen = OF_getprop_alloc(child, "label", (void **)&slice_name); + nmlen = OF_getprop_alloc(child, "label", (void **)&label); if (nmlen <= 0) { /* Use node name if no label defined */ - nmlen = OF_getprop_alloc(child, "name", - (void **)&slice_name); + nmlen = OF_getprop_alloc(child, "name", (void **)&label); if (nmlen <= 0) { debugf("slice i=%d with no name\n", i); - slice_name = NULL; + label = NULL; } } + if (OF_hasprop(child, "read-only")) + flags |= FLASH_SLICES_FLAG_RO; + /* Fill slice entry data. */ slices[i].base = base; slices[i].size = size; - slices[i].label = slice_name; + slices[i].label = label; + slices[i].flags = flags; i++; } - *slices_num = i; + *count = i; return (0); +} + +static int +fill_slices(device_t dev, const char *provider __unused, + struct flash_slice *slices, int *slices_num) +{ + phandle_t child, node; + + /* + * We assume the caller provides buffer for FLASH_SLICES_MAX_NUM + * flash_slice structures. + */ + if (slices == NULL) { + *slices_num = 0; + return (ENOMEM); + } + + node = ofw_bus_get_node(dev); + + /* + * If there is a child node whose compatible is "fixed-partitions" then + * we have new-style data where all partitions are the children of that + * node. Otherwise we have old-style data where all the children of the + * device node are the partitions. + */ + child = fdt_find_compatible(node, "fixed-partitions", false); + if (child == 0) + return fill_slices_from_node(node, slices, slices_num); + else + return fill_slices_from_node(child, slices, slices_num); } static void From owner-svn-src-head@freebsd.org Wed Feb 27 06:50:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EC5415131F6; Wed, 27 Feb 2019 06:50:25 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B73DA6851B; Wed, 27 Feb 2019 06:50: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 A8CA619124; Wed, 27 Feb 2019 06:50: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 x1R6oObn072172; Wed, 27 Feb 2019 06:50:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1R6oOkt072171; Wed, 27 Feb 2019 06:50:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201902270650.x1R6oOkt072171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 27 Feb 2019 06:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344617 - head/contrib/ofed/libcxgb4 X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/contrib/ofed/libcxgb4 X-SVN-Commit-Revision: 344617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B73DA6851B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 06:50:25 -0000 Author: np Date: Wed Feb 27 06:50:24 2019 New Revision: 344617 URL: https://svnweb.freebsd.org/changeset/base/344617 Log: libcxgb4: Don't spam stderr. Write combining is not enabled by default by the FreeBSD driver. Modified: head/contrib/ofed/libcxgb4/dev.c Modified: head/contrib/ofed/libcxgb4/dev.c ============================================================================== --- head/contrib/ofed/libcxgb4/dev.c Wed Feb 27 04:58:18 2019 (r344616) +++ head/contrib/ofed/libcxgb4/dev.c Wed Feb 27 06:50:24 2019 (r344617) @@ -202,8 +202,6 @@ static struct ibv_context *c4iw_alloc_context(struct i * loader tunable "hw.cxl.write_combine=0" */ if (t5_en_wc && !context->status_page->wc_supported) { - fprintf(stderr, "iw_cxgb4 driver doesn't support Write " - "Combine, so regular DB writes will be used\n"); t5_en_wc = 0; } } From owner-svn-src-head@freebsd.org Wed Feb 27 07:17:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94A6215138C7 for ; Wed, 27 Feb 2019 07:17:57 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.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 E32366A713; Wed, 27 Feb 2019 07:17:56 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f53.google.com with SMTP id v185so282644lfa.11; Tue, 26 Feb 2019 23:17:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=6gq6qfs/OdoM+p7b6wbk1ELpqzze2vzVG6/Dpq6urFo=; b=fdzK+cHJB23I1Cj3S/1j3e4BDpLzXkjhHGKLGC5NwnDlCuYSAEte/Sm/5XYV4eoFrk YVycdGzKPM1CpzYvrrilfJ0AFYoAohD7UT1haH/vwl6YVlw8T9ryhVZB3Pmgf7QputNd PtcsJs+LPrznC3NW4Dmx39ZpTlzbJVRLzSPXuC7/Q7h3Tol87ySqm3U3s9Zr1yEPrwPE MNZWt/uM7rLAF+y5eb5SY4ZQGeWLPippaL7MVonZmkQJwseFJmUeoqgBjDVX2uFNlZ6e qxtADz8kSTOXX6fdtYppIHVmjFnjVFUjT5jGaZT2Lp+SGxDjIQquqOWIPbzNI7qErNLJ ekeA== X-Gm-Message-State: AHQUAuY8VWF/UzKedSMprm8x69uZ7U56W6ppjc8X+okK2W2JFq+mpPoN CEWS6bGS7o2a+BALpBdALrU= X-Google-Smtp-Source: AHgI3IZ9QGnljBwpo01eM+aFahjImnWWPduyjq97pveobL1yI71Qm7VqkBw82YTrpVwfFO4Ew4NM/Q== X-Received: by 2002:a19:9104:: with SMTP id t4mr3444549lfd.22.1551251535199; Tue, 26 Feb 2019 23:12:15 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id a18sm1460864lfj.35.2019.02.26.23.12.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 23:12:14 -0800 (PST) Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Cy Schubert Cc: Baptiste Daroussin , src-committers , svn-src-head@FreeBSD.ORG, Jack Halford References: <201902262058.x1QKwvJn018213@slippy.cwsent.com> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <0563e72c-c9e3-a476-ce43-d4a67c454508@FreeBSD.org> Date: Wed, 27 Feb 2019 09:12:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201902262058.x1QKwvJn018213@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E32366A713 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 07:17:57 -0000 On 26/02/2019 22:58, Cy Schubert wrote: > I was talking about nested datasets, i.e. tank/freebsd/git/current and > tank/freebsd/git/ports are four levels deep. We usually don't call them "nested". In fact, I don't think that we call them anything special because having N levels deep datasets (N > 1) is just a common thing. We may call them subordinate or child datasets when mentioning a relation to a parent dataset. > In my case the ports > dataset was mounted while the current dataset was not, though zfs > believed it was. unmounting the current dataset and remounting it, zfs > umount .../current; zfs mount .../current worked around the issue. Are you sure that it was not mounted? Have you checked that by looking at mount output? I suspect that it was mounted, just not where you expected and its mount path was covered by another filesystem. E.g., lets consider this hypothetical case. I have two same level datasets tank/freebsd/src and tank/freebsd/sys where tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at /usr/src/sys (a child directory of /usr/src). If tank/freebsd/src is mounted first, then everything is okay, tank/freebsd/sys would be mounted on top of sys directory in tank/freebsd/src. If, however, tank/freebsd/sys is mounted first (assuming that path /usr/src/sys exists in a root filesystem), then mounting tank/freebsd/src would simply hide tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in tank/freebsd/src. I guess that this is a kind of problem that could be introduced with parallel mounting. And I guess that this is a kind of problem that you might actually have. But it's just a guess. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Feb 27 07:55:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE93115149CF; Wed, 27 Feb 2019 07:55:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 943DA6BE1E; Wed, 27 Feb 2019 07:55:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 847ED19D3A; Wed, 27 Feb 2019 07:55:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1R7trGD009003; Wed, 27 Feb 2019 07:55:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1R7trx6009002; Wed, 27 Feb 2019 07:55:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201902270755.x1R7trx6009002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 27 Feb 2019 07:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344618 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 344618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 943DA6BE1E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 07:55:54 -0000 Author: bapt Date: Wed Feb 27 07:55:53 2019 New Revision: 344618 URL: https://svnweb.freebsd.org/changeset/base/344618 Log: Fix regression introduced in r344569 Reported by: cy Tested by: cy Submitted by: Fatih Acar Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Wed Feb 27 06:50:24 2019 (r344617) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Wed Feb 27 07:55:53 2019 (r344618) @@ -1260,11 +1260,11 @@ mountpoint_cmp(const void *arga, const void *argb) if (*a == '\0') return (-1); if (*b == '\0') - return (-1); + return (1); if (*a == '/') return (-1); if (*b == '/') - return (-1); + return (1); return (*a < *b ? -1 : *a > *b); } From owner-svn-src-head@freebsd.org Wed Feb 27 13:04:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36143151CACB for ; Wed, 27 Feb 2019 13:04:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F36F875ADA; Wed, 27 Feb 2019 13:04:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yyszgmGIqv0Toyyt0gO0oU; Wed, 27 Feb 2019 06:04:36 -0700 X-Authority-Analysis: v=2.3 cv=Iodgj43g c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=uj6YtqYK-R6_gwjFUiwA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA: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 21EF2B46; Wed, 27 Feb 2019 05:04:31 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1RD4TD4051904; Wed, 27 Feb 2019 05:04:29 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x1RD4S6U051477; Wed, 27 Feb 2019 05:04:28 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902271304.x1RD4S6U051477@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: Andriy Gapon cc: Cy Schubert , Baptiste Daroussin , src-committers , svn-src-head@FreeBSD.ORG, Jack Halford Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: Message from Andriy Gapon of "Wed, 27 Feb 2019 09:12:13 +0200." <0563e72c-c9e3-a476-ce43-d4a67c454508@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 27 Feb 2019 05:04:28 -0800 X-CMAE-Envelope: MS4wfGQVuWBPN/nATK74MOclAK5W5NwBDrsQJXZWw2DISiDwBZ7/1PYOV941vHWjvOpbCJM3jbN89OIAI7LO2xLzVe00/3pBlDf6igWoFGBorOIrv6SWYRc+ +C0wm9D2oH8QAQGD9lvREY4+6wlYEgk5wGP7fEF1PB0i7IeiAm/Ba8+pdGOUX9dw+pbl3GvIfFKHhjuABbNrD42dZa4NjzzrmJl8eJ7wtuFUgfsReLOtMvax +E/8WTSUS4XdaZV2evxbNTrzrlbh6mJrRJ26JAM4xfnew3Q7JhtdijbC9JwgqJ6y1RG1YNmsH87pihyyDUPlWQ== X-Rspamd-Queue-Id: F36F875ADA X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.66 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.01)[ip: (-5.22), ipnet: 64.59.128.0/20(-2.66), asn: 6327(-2.08), country: CA(-0.09)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 13:04:41 -0000 In message <0563e72c-c9e3-a476-ce43-d4a67c454508@FreeBSD.org>, Andriy Gapon wri tes: > On 26/02/2019 22:58, Cy Schubert wrote: > > I was talking about nested datasets, i.e. tank/freebsd/git/current and > > tank/freebsd/git/ports are four levels deep. > > We usually don't call them "nested". In fact, I don't think that we call the > m > anything special because having N levels deep datasets (N > 1) is just a comm > on > thing. We may call them subordinate or child datasets when mentioning a > relation to a parent dataset. > > > In my case the ports > > dataset was mounted while the current dataset was not, though zfs > > believed it was. unmounting the current dataset and remounting it, zfs > > umount .../current; zfs mount .../current worked around the issue. > > Are you sure that it was not mounted? Yes. > Have you checked that by looking at mount output? Yes > I suspect that it was mounted, just not where you expected and its mount path > was covered by another filesystem. If you read my original email a zfs umount followed by a zfs mount for each affected filesystem worked around the problem. zfs properties showed that each and every filesystem was mounted. mount(1) and df(1) confirmed they were not. Furthermore nullfs mounts with the late attribute failed to mount because their underlying zfs datasets were not mounted -- this is what clued me into the problem in the first place, a FreeBSD system dropping into single user at boot. And, no, fstab on that machine had not been changed for months, them machine failed to boot. So, no, I was not mistaken. I was rather displeased because I had to try to fix the problem using ssh on a phone to a machine connected to a console server. > > E.g., lets consider this hypothetical case. > I have two same level datasets tank/freebsd/src and tank/freebsd/sys where > tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at > /usr/src/sys (a child directory of /usr/src). > If tank/freebsd/src is mounted first, then everything is okay, tank/freebsd/s > ys > would be mounted on top of sys directory in tank/freebsd/src. > If, however, tank/freebsd/sys is mounted first (assuming that path /usr/src/s > ys > exists in a root filesystem), then mounting tank/freebsd/src would simply hid > e > tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in > tank/freebsd/src. > > I guess that this is a kind of problem that could be introduced with parallel > mounting. And I guess that this is a kind of problem that you might actually > have. But it's just a guess. No. I had not mistakenly mounted the datasets elsewhere, mistakenly deleted them or mistakenly changed their mount attributes. It was a real, not imagined, regression fixed by the patch posted near the end of the email thread. -- 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 Feb 27 13:10:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC794151CBEA for ; Wed, 27 Feb 2019 13:10:10 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 3A38475D52; Wed, 27 Feb 2019 13:10:10 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f174.google.com with SMTP id l5so13939382lje.1; Wed, 27 Feb 2019 05:10:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=69o+or7Zj/0xwOE9iXPQ+Sirao8ymBJxBpN1j0aU0/o=; b=qzeq7Pjf9K7l/CYzN5iueA1UQm/fNnEnnSyKyXI6qzIZm0b1SagBULa72tp5ym/THX dA+OIA/biVhkdtydSFS3Losc2pPurcBzsThqu2sVddWBFdOrcul5Xxq/BTOf+EBDvr9D oA8V53fHKvSoS4uodbH10p4/NsBqpnGeZu9tKKUJSHlCP9dM/j4ujbSCYonINs+uDRGu wvofy6xJQtKG5RO3hCbHRzNiNKtNKVjibHkT+oAEOmiJKetfBDLJMJunASyvBVXgAeGY DtAyT31UX6mpEVMWQ4iwHgwJlbdcZ5pm5w/KA57SjL2MZB1wSGfRrMgcp8wlyh4QynaK ZBfg== X-Gm-Message-State: AHQUAuaLH0xgKuvyNIeHiFWz+jzwPCkyBeDhZpshBJxj+h8gviR6dQan oW0CRqwzCqj4ZZ7SDWiyUQ+6Xwm6 X-Google-Smtp-Source: APXvYqwQFCI/M6C72UACsvs1lAwNmr0cNvDFgBN9HdonR3s9MGsIflhrzeMsMAjkMnBwXL0RxK/WVw== X-Received: by 2002:a2e:9a8b:: with SMTP id p11mr1431082lji.66.1551273002618; Wed, 27 Feb 2019 05:10:02 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id b26sm2083167lfa.5.2019.02.27.05.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 05:10:01 -0800 (PST) Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common To: Cy Schubert Cc: Baptiste Daroussin , src-committers , svn-src-head@FreeBSD.org, Jack Halford References: <201902271304.x1RD4S6U051477@slippy.cwsent.com> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <19c0f590-4327-d2c8-4660-bd9f5df12b50@FreeBSD.org> Date: Wed, 27 Feb 2019 15:10:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201902271304.x1RD4S6U051477@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3A38475D52 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 13:10:11 -0000 On 27/02/2019 15:04, Cy Schubert wrote: > In message <0563e72c-c9e3-a476-ce43-d4a67c454508@FreeBSD.org>, Andriy > Gapon wri > tes: >> On 26/02/2019 22:58, Cy Schubert wrote: >>> I was talking about nested datasets, i.e. tank/freebsd/git/current and >>> tank/freebsd/git/ports are four levels deep. >> >> We usually don't call them "nested". In fact, I don't think that we call the >> m >> anything special because having N levels deep datasets (N > 1) is just a comm >> on >> thing. We may call them subordinate or child datasets when mentioning a >> relation to a parent dataset. >> >>> In my case the ports >>> dataset was mounted while the current dataset was not, though zfs >>> believed it was. unmounting the current dataset and remounting it, zfs >>> umount .../current; zfs mount .../current worked around the issue. >> >> Are you sure that it was not mounted? > > Yes. > >> Have you checked that by looking at mount output? > > Yes > >> I suspect that it was mounted, just not where you expected and its mount path >> was covered by another filesystem. > > If you read my original email Apologies, I failed to read your original email when I first saw it. I pressed Page Down a few times but was still seeing only a quoted text, so I gave up. > a zfs umount followed by a zfs mount for > each affected filesystem worked around the problem. zfs properties > showed that each and every filesystem was mounted. mount(1) and df(1) > confirmed they were not. Furthermore nullfs mounts with the late > attribute failed to mount because their underlying zfs datasets were > not mounted -- this is what clued me into the problem in the first > place, a FreeBSD system dropping into single user at boot. And, no, > fstab on that machine had not been changed for months, them machine > failed to boot. So, no, I was not mistaken. I was rather displeased > because I had to try to fix the problem using ssh on a phone to a > machine connected to a console server. > >> >> E.g., lets consider this hypothetical case. >> I have two same level datasets tank/freebsd/src and tank/freebsd/sys where >> tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at >> /usr/src/sys (a child directory of /usr/src). >> If tank/freebsd/src is mounted first, then everything is okay, tank/freebsd/s >> ys >> would be mounted on top of sys directory in tank/freebsd/src. >> If, however, tank/freebsd/sys is mounted first (assuming that path /usr/src/s >> ys >> exists in a root filesystem), then mounting tank/freebsd/src would simply hid >> e >> tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in >> tank/freebsd/src. >> >> I guess that this is a kind of problem that could be introduced with parallel >> mounting. And I guess that this is a kind of problem that you might actually >> have. But it's just a guess. > > No. I had not mistakenly mounted the datasets elsewhere, mistakenly > deleted them or mistakenly changed their mount attributes. It was a > real, not imagined, regression fixed by the patch posted near the end > of the email thread. Okay. Great that it is fixed and sorry for my noise. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Feb 27 13:24:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85C53151D3A4; Wed, 27 Feb 2019 13:24:43 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 221CF76931; Wed, 27 Feb 2019 13:24:43 +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 109D91D571; Wed, 27 Feb 2019 13:24:43 +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 x1RDOgPi082153; Wed, 27 Feb 2019 13:24:42 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RDOgQX082151; Wed, 27 Feb 2019 13:24:42 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201902271324.x1RDOgQX082151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 27 Feb 2019 13:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344620 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 344620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 221CF76931 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 13:24:43 -0000 Author: luporl Date: Wed Feb 27 13:24:42 2019 New Revision: 344620 URL: https://svnweb.freebsd.org/changeset/base/344620 Log: Fix kldxref on PowerPC64 When using kldxref on kernel modules built with clang8 + lld8, kldxref would be unable to find the modules metadata information, because PowerPC64 was using the ef_nop.c implementation of ef_reloc(). When GNU LD was used, it was also relocating the metadata section of the .ko file. LLD does not do this, but only generate dynamic relocations for it. With minor changes, ef_powerpc.c can now work for PowerPC64 too. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D19370 Modified: head/usr.sbin/kldxref/Makefile head/usr.sbin/kldxref/ef_powerpc.c Modified: head/usr.sbin/kldxref/Makefile ============================================================================== --- head/usr.sbin/kldxref/Makefile Wed Feb 27 13:01:17 2019 (r344619) +++ head/usr.sbin/kldxref/Makefile Wed Feb 27 13:24:42 2019 (r344620) @@ -6,7 +6,7 @@ SRCS= kldxref.c ef.c ef_obj.c WARNS?= 2 -.if exists(ef_${MACHINE_CPUARCH}.c) && ${MACHINE_ARCH} != "powerpc64" +.if exists(ef_${MACHINE_CPUARCH}.c) SRCS+= ef_${MACHINE_CPUARCH}.c .else SRCS+= ef_nop.c Modified: head/usr.sbin/kldxref/ef_powerpc.c ============================================================================== --- head/usr.sbin/kldxref/ef_powerpc.c Wed Feb 27 13:01:17 2019 (r344619) +++ head/usr.sbin/kldxref/ef_powerpc.c Wed Feb 27 13:24:42 2019 (r344620) @@ -34,10 +34,17 @@ #include #include +#include #include #include "ef.h" +#ifdef __powerpc64__ +#define PRI_ELF_SIZE PRIu64 +#else +#define PRI_ELF_SIZE PRIu32 +#endif + /* * Apply relocations to the values obtained from the file. `relbase' is the * target relocation address of the section, and `dataoff/len' is the region @@ -63,11 +70,11 @@ ef_reloc(struct elf_file *ef, const void *reldata, int return (0); switch (rtype) { - case R_PPC_RELATIVE: /* word32 B + A */ + case R_PPC_RELATIVE: /* word32|doubleword64 B + A */ *where = relbase + addend; break; default: - warnx("unhandled relocation type %u", rtype); + warnx("unhandled relocation type %" PRI_ELF_SIZE, rtype); } return (0); } From owner-svn-src-head@freebsd.org Wed Feb 27 13:24:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B460E151D3C6 for ; Wed, 27 Feb 2019 13:24:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 5F36A76946; Wed, 27 Feb 2019 13:24:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id yzCPg88pVzrlPyzCQgvxMw; Wed, 27 Feb 2019 06:24:39 -0700 X-Authority-Analysis: v=2.3 cv=HIC96blv c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=CFTnQlWoA9kA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=J4m5mNcAyt45NkiF-P8A:9 a=g6jMdkWcIO0SC0-6:21 a=HjBQ2OW3PPJyF8c-:21 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 DB71FB94; Wed, 27 Feb 2019 05:24:36 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x1RDOa0h016851; Wed, 27 Feb 2019 05:24:36 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x1RDOaVf016848; Wed, 27 Feb 2019 05:24:36 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201902271324.x1RDOaVf016848@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: Andriy Gapon cc: Cy Schubert , Baptiste Daroussin , src-committers , svn-src-head@FreeBSD.org, Jack Halford Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: Message from Andriy Gapon of "Wed, 27 Feb 2019 15:10:00 +0200." <19c0f590-4327-d2c8-4660-bd9f5df12b50@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 27 Feb 2019 05:24:36 -0800 X-CMAE-Envelope: MS4wfLu4uCz0Kl1Zozn21yHW8Wr65qJM14KGbwfPNAU+HE/1UOdz2GlqhLdTpzp6luOGin6nfCEoEfArTQNXlqDGSCZaNrg928afkPS3Thh/F39UFuj+urC+ 15l+lyyPbMEqaTBuwg1F5D4YiP6Gx6yqgOE0FmzncXdAoURMX+ah+I9VtGA4sMSDShIix5KRUHINGpFA32EpqbpNjM8CjF5zU5G81mb6J3SPZvE0+wAIp8pk 55F0xeD6nie+Jr8NBqN5CWHtjLKkKs+3Bl9R/9MPNJ5yBdgCuWg7CtjOGB+EBNsYEnSrv8sxyLXH6ThxWky+8Q== X-Rspamd-Queue-Id: 5F36A76946 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.67 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.01)[ip: (-5.22), ipnet: 64.59.128.0/20(-2.65), asn: 6327(-2.08), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[9.134.59.64.list.dnswl.org : 127.0.5.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: Wed, 27 Feb 2019 13:24:48 -0000 In message <19c0f590-4327-d2c8-4660-bd9f5df12b50@FreeBSD.org>, Andriy Gapon wri tes: > On 27/02/2019 15:04, Cy Schubert wrote: > > In message <0563e72c-c9e3-a476-ce43-d4a67c454508@FreeBSD.org>, Andriy > > Gapon wri > > tes: > >> On 26/02/2019 22:58, Cy Schubert wrote: > >>> I was talking about nested datasets, i.e. tank/freebsd/git/current and > >>> tank/freebsd/git/ports are four levels deep. > >> > >> We usually don't call them "nested". In fact, I don't think that we call > the > >> m > >> anything special because having N levels deep datasets (N > 1) is just a c > omm > >> on > >> thing. We may call them subordinate or child datasets when mentioning a > >> relation to a parent dataset. > >> > >>> In my case the ports > >>> dataset was mounted while the current dataset was not, though zfs > >>> believed it was. unmounting the current dataset and remounting it, zfs > >>> umount .../current; zfs mount .../current worked around the issue. > >> > >> Are you sure that it was not mounted? > > > > Yes. > > > >> Have you checked that by looking at mount output? > > > > Yes > > > >> I suspect that it was mounted, just not where you expected and its mount p > ath > >> was covered by another filesystem. > > > > If you read my original email > > Apologies, I failed to read your original email when I first saw it. > I pressed Page Down a few times but was still seeing only a quoted text, so I > gave up. That was my fault but given I was using an email client on my phone, removing the quoted text would have taken forever. Usually in that circumstance I wait until I get to a real keyboard before firing off an email. > > > a zfs umount followed by a zfs mount for > > each affected filesystem worked around the problem. zfs properties > > showed that each and every filesystem was mounted. mount(1) and df(1) > > confirmed they were not. Furthermore nullfs mounts with the late > > attribute failed to mount because their underlying zfs datasets were > > not mounted -- this is what clued me into the problem in the first > > place, a FreeBSD system dropping into single user at boot. And, no, > > fstab on that machine had not been changed for months, them machine > > failed to boot. So, no, I was not mistaken. I was rather displeased > > because I had to try to fix the problem using ssh on a phone to a > > machine connected to a console server. > > > >> > >> E.g., lets consider this hypothetical case. > >> I have two same level datasets tank/freebsd/src and tank/freebsd/sys where > >> tank/freebsd/src is mounted at /usr/src and tank/freebsd/sys is mounted at > >> /usr/src/sys (a child directory of /usr/src). > >> If tank/freebsd/src is mounted first, then everything is okay, tank/freebs > d/s > >> ys > >> would be mounted on top of sys directory in tank/freebsd/src. > >> If, however, tank/freebsd/sys is mounted first (assuming that path /usr/sr > c/s > >> ys > >> exists in a root filesystem), then mounting tank/freebsd/src would simply > hid > >> e > >> tank/freebsd/sys "below" it as /usr/src/sys would be sys directory in > >> tank/freebsd/src. > >> > >> I guess that this is a kind of problem that could be introduced with paral > lel > >> mounting. And I guess that this is a kind of problem that you might actua > lly > >> have. But it's just a guess. > > > > No. I had not mistakenly mounted the datasets elsewhere, mistakenly > > deleted them or mistakenly changed their mount attributes. It was a > > real, not imagined, regression fixed by the patch posted near the end > > of the email thread. > > Okay. Great that it is fixed and sorry for my noise. NP. I'm glad it's fixed too. -- 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 Feb 27 13:36:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BAA5151D64D; Wed, 27 Feb 2019 13:36:37 +0000 (UTC) (envelope-from jack@gandi.net) Received: from gandi.net (mail12.gandi.net [IPv6:2001:4b98:dc4:5:ae1f:6bff:fe2d:9fdc]) (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 0F6A57703F; Wed, 27 Feb 2019 13:36:36 +0000 (UTC) (envelope-from jack@gandi.net) Received: from webmail.corp.gandi.net (unknown [10.200.236.10]) by gandi.net (Postfix) with ESMTP id 1B03016051D; Wed, 27 Feb 2019 13:36:34 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 27 Feb 2019 14:36:34 +0100 From: Jack Halford To: Toomas Soome Cc: Cy Schubert , Fatih Acar , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, fatih@gandi.net Subject: Re: svn commit: r344569 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common In-Reply-To: References: <201902262102.x1QL2rIo032528@slippy.cwsent.com> Message-ID: <7e25d58c8b7368af635a03d0a68b9b9c@mail12.gandi.net> X-Sender: jack@gandi.net User-Agent: Roundcube Webmail/1.0.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 13:36:37 -0000 > There is one other minor issues that should also be addressed. The > mount message > at boot previously displayed: > > Mounting ZFS filesystems: > (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(15 > 9/159)^M > > Now it displays: > > (null): (44/159)^H^H^H^H^H^H^H^H(106/159)^H^H^H^H^H^H^H^H^H(159/159)^M > > see https://www.illumos.org/issues/10205 [6] for this one. Thanks Toomas for pointing out the fix in Illumos, I've opened a review here: https://reviews.freebsd.org/D19388 regards, -- Jack From owner-svn-src-head@freebsd.org Wed Feb 27 13:49:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6D75151D8C0; Wed, 27 Feb 2019 13:49:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 404037755D; Wed, 27 Feb 2019 13:49:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 359711D932; Wed, 27 Feb 2019 13:49:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RDng2O092778; Wed, 27 Feb 2019 13:49:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RDng8M092777; Wed, 27 Feb 2019 13:49:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201902271349.x1RDng8M092777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 27 Feb 2019 13:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344621 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 344621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 404037755D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 13:49:42 -0000 Author: bapt Date: Wed Feb 27 13:49:41 2019 New Revision: 344621 URL: https://svnweb.freebsd.org/changeset/base/344621 Log: Fix a regression introduced in r344569 Import a fix from illumos (thanks Toomas Soomas for pointing at it) See https://www.illumos.org/issues/10205 for more details Illumos commit: https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215 Submitted by: jack@gandi.net Reported by: cy Reviewed by: tsoome, cy, bapt Obtained from: Illumos Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Feb 27 13:24:42 2019 (r344620) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Feb 27 13:49:41 2019 (r344621) @@ -6119,9 +6119,6 @@ report_mount_progress(int current, int total) time_t now = time(NULL); char info[32]; - /* report 1..n instead of 0..n-1 */ - ++current; - /* display header if we're here for the first time */ if (current == 1) { set_progress_header(gettext("Mounting ZFS filesystems")); From owner-svn-src-head@freebsd.org Wed Feb 27 14:20:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E90B1151E048; Wed, 27 Feb 2019 14:20:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD0080456; Wed, 27 Feb 2019 14:20:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ABBA1DE7B; Wed, 27 Feb 2019 14:20:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1REKTC0008713; Wed, 27 Feb 2019 14:20:29 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1REKSS0008710; Wed, 27 Feb 2019 14:20:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902271420.x1REKSS0008710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 14:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344623 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8BD0080456 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 14:20:30 -0000 Author: manu Date: Wed Feb 27 14:20:28 2019 New Revision: 344623 URL: https://svnweb.freebsd.org/changeset/base/344623 Log: arm64: rockchip: clk_pll: Multiple improvement Remove the mode_val from the clock definition as it's a bit unreadable. Use mode_shift to represent which bit control the mode in the register. Simplify some case where we can avoid a register read before changing it. Set the PLL back to normal mode after the PLL have stabilized. Discussed with: mmel MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c head/sys/arm64/rockchip/clk/rk_clk_pll.c head/sys/arm64/rockchip/clk/rk_clk_pll.h Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Feb 27 14:01:13 2019 (r344622) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Wed Feb 27 14:20:28 2019 (r344623) @@ -523,7 +523,7 @@ static struct rk_clk_pll_def apll = { .gate_offset = 0x200, .gate_shift = 0, .mode_reg = 0x80, - .mode_val = 0x1, + .mode_shift = 1, .flags = RK_CLK_PLL_HAVE_GATE, .frac_rates = rk3328_pll_frac_rates, }; @@ -539,7 +539,7 @@ static struct rk_clk_pll_def dpll = { .gate_offset = 0x200, .gate_shift = 1, .mode_reg = 0x80, - .mode_val = 0x8, + .mode_shift = 4, .flags = RK_CLK_PLL_HAVE_GATE, }; @@ -552,7 +552,7 @@ static struct rk_clk_pll_def cpll = { }, .base_offset = 0x40, .mode_reg = 0x80, - .mode_val = 0x80, + .mode_shift = 8, .rates = rk3328_pll_rates, }; @@ -567,7 +567,7 @@ static struct rk_clk_pll_def gpll = { .gate_offset = 0x200, .gate_shift = 2, .mode_reg = 0x80, - .mode_val = 0x800, + .mode_shift = 12, .flags = RK_CLK_PLL_HAVE_GATE, .frac_rates = rk3328_pll_frac_rates, }; @@ -583,7 +583,7 @@ static struct rk_clk_pll_def npll = { .gate_offset = 0x200, .gate_shift = 12, .mode_reg = 0x80, - .mode_val = 0x2, + .mode_shift = 1, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3328_pll_rates, }; Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Wed Feb 27 14:01:13 2019 (r344622) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Wed Feb 27 14:20:28 2019 (r344623) @@ -48,7 +48,7 @@ struct rk_clk_pll_sc { uint32_t gate_shift; uint32_t mode_reg; - uint32_t mode_val; + uint32_t mode_shift; uint32_t flags; @@ -120,6 +120,10 @@ rk_clk_pll_set_gate(struct clknode *clk, bool enable) #define RK3328_CLK_PLL_LOCK_MASK 0x400 +#define RK3328_CLK_PLL_MODE_SLOW 0 +#define RK3328_CLK_PLL_MODE_NORMAL 1 +#define RK3328_CLK_PLL_MODE_MASK 0x1 + static int rk3328_clk_pll_init(struct clknode *clk, device_t dev) { @@ -207,7 +211,8 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t DEVICE_LOCK(clk); /* Setting to slow mode during frequency change */ - reg = sc->mode_val << 16; + reg = (RK3328_CLK_PLL_MODE_MASK << sc->mode_shift) << + RK_CLK_PLL_MASK_SHIFT; dprintf("Set PLL_MODEREG to %x\n", reg); WRITE4(clk, sc->mode_reg, reg); @@ -219,13 +224,12 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t WRITE4(clk, sc->base_offset, reg); /* Setting dsmpd, postdiv2 and refdiv */ - READ4(clk, sc->base_offset + 0x4, ®); - reg &= ~(RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK | - RK3328_CLK_PLL_REFDIV_MASK); reg = (rates->dsmpd << RK3328_CLK_PLL_DSMPD_SHIFT) | (rates->postdiv2 << RK3328_CLK_PLL_POSTDIV2_SHIFT) | (rates->refdiv << RK3328_CLK_PLL_REFDIV_SHIFT); - reg |= (RK3328_CLK_PLL_DSMPD_MASK | RK3328_CLK_PLL_POSTDIV2_MASK | RK3328_CLK_PLL_REFDIV_MASK) << 16; + reg |= (RK3328_CLK_PLL_DSMPD_MASK | + RK3328_CLK_PLL_POSTDIV2_MASK | + RK3328_CLK_PLL_REFDIV_MASK) << RK_CLK_PLL_MASK_SHIFT; dprintf("Set PLL_CON1 to %x\n", reg); WRITE4(clk, sc->base_offset + 0x4, reg); @@ -236,11 +240,6 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t dprintf("Set PLL_CON2 to %x\n", reg); WRITE4(clk, sc->base_offset + 0x8, reg); - /* Setting to normal mode */ - reg = sc->mode_val << 16 | sc->mode_val; - dprintf("Set PLL_MODEREG to %x\n", reg); - WRITE4(clk, sc->mode_reg, reg); - /* Reading lock */ for (timeout = 1000; timeout; timeout--) { READ4(clk, sc->base_offset + 0x4, ®); @@ -249,6 +248,13 @@ rk3328_clk_pll_set_freq(struct clknode *clk, uint64_t DELAY(1); } + /* Set back to normal mode */ + reg = (RK3328_CLK_PLL_MODE_NORMAL << sc->mode_shift); + reg |= (RK3328_CLK_PLL_MODE_MASK << sc->mode_shift) << + RK_CLK_PLL_MASK_SHIFT; + dprintf("Set PLL_MODEREG to %x\n", reg); + WRITE4(clk, sc->mode_reg, reg); + DEVICE_UNLOCK(clk); *stop = 1; @@ -284,7 +290,7 @@ rk3328_clk_pll_register(struct clkdom *clkdom, struct sc->gate_offset = clkdef->gate_offset; sc->gate_shift = clkdef->gate_shift; sc->mode_reg = clkdef->mode_reg; - sc->mode_val = clkdef->mode_val; + sc->mode_shift = clkdef->mode_shift; sc->flags = clkdef->flags; sc->rates = clkdef->rates; sc->frac_rates = clkdef->frac_rates; @@ -339,9 +345,8 @@ rk3399_clk_pll_init(struct clknode *clk, device_t dev) sc = clknode_get_softc(clk); /* Setting to normal mode */ - READ4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, ®); - reg &= ~RK3399_CLK_PLL_MODE_MASK; - reg |= RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, reg | RK3399_CLK_PLL_WRITE_MASK); @@ -424,25 +429,23 @@ rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t DEVICE_LOCK(clk); - /* Setting to slow mode during frequency change */ + /* Set to slow mode during frequency change */ reg = RK3399_CLK_PLL_MODE_SLOW << RK3399_CLK_PLL_MODE_SHIFT; reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; WRITE4(clk, sc->base_offset + 0xC, reg); /* Setting fbdiv */ - READ4(clk, sc->base_offset, ®); - reg &= ~RK3399_CLK_PLL_FBDIV_MASK; - reg |= rates->fbdiv << RK3399_CLK_PLL_FBDIV_SHIFT; - WRITE4(clk, sc->base_offset, reg | RK3399_CLK_PLL_WRITE_MASK); + reg = rates->fbdiv << RK3399_CLK_PLL_FBDIV_SHIFT; + reg |= RK3399_CLK_PLL_FBDIV_MASK << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->base_offset, reg); /* Setting postdiv1, postdiv2 and refdiv */ - READ4(clk, sc->base_offset + 0x4, ®); - reg &= ~(RK3399_CLK_PLL_POSTDIV1_MASK | RK3399_CLK_PLL_POSTDIV2_MASK | - RK3399_CLK_PLL_REFDIV_MASK); - reg |= rates->postdiv1 << RK3399_CLK_PLL_POSTDIV1_SHIFT; + reg = rates->postdiv1 << RK3399_CLK_PLL_POSTDIV1_SHIFT; reg |= rates->postdiv2 << RK3399_CLK_PLL_POSTDIV2_SHIFT; reg |= rates->refdiv << RK3399_CLK_PLL_REFDIV_SHIFT; - WRITE4(clk, sc->base_offset + 0x4, reg | RK3399_CLK_PLL_WRITE_MASK); + reg |= (RK3399_CLK_PLL_POSTDIV1_MASK | RK3399_CLK_PLL_POSTDIV2_MASK | + RK3399_CLK_PLL_REFDIV_MASK) << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->base_offset + 0x4, reg); /* Setting frac */ READ4(clk, sc->base_offset + 0x8, ®); @@ -450,12 +453,10 @@ rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t reg |= rates->frac << RK3399_CLK_PLL_FRAC_SHIFT; WRITE4(clk, sc->base_offset + 0x8, reg | RK3399_CLK_PLL_WRITE_MASK); - /* Setting to normal mode and dsmpd */ - READ4(clk, sc->base_offset + 0xC, ®); - reg &= ~RK3399_CLK_PLL_MODE_MASK; - reg |= RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; - reg |= rates->dsmpd << RK3399_CLK_PLL_DSMPD_SHIFT; - WRITE4(clk, sc->base_offset + 0xC, reg | RK3399_CLK_PLL_WRITE_MASK); + /* Set dsmpd */ + reg = rates->dsmpd << RK3399_CLK_PLL_DSMPD_SHIFT; + reg |= RK3399_CLK_PLL_DSMPD_MASK << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->base_offset + 0xC, reg); /* Reading lock */ for (timeout = 1000; timeout; timeout--) { @@ -465,6 +466,11 @@ rk3399_clk_pll_set_freq(struct clknode *clk, uint64_t DELAY(1); } + /* Set back to normal mode */ + reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->base_offset + 0xC, reg); + DEVICE_UNLOCK(clk); *stop = 1; @@ -499,8 +505,6 @@ rk3399_clk_pll_register(struct clkdom *clkdom, struct sc->base_offset = clkdef->base_offset; sc->gate_offset = clkdef->gate_offset; sc->gate_shift = clkdef->gate_shift; - sc->mode_reg = clkdef->mode_reg; - sc->mode_val = clkdef->mode_val; sc->flags = clkdef->flags; sc->rates = clkdef->rates; sc->frac_rates = clkdef->frac_rates; Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.h Wed Feb 27 14:01:13 2019 (r344622) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.h Wed Feb 27 14:20:28 2019 (r344623) @@ -51,7 +51,7 @@ struct rk_clk_pll_def { uint32_t gate_shift; uint32_t mode_reg; - uint32_t mode_val; + uint32_t mode_shift; uint32_t flags; From owner-svn-src-head@freebsd.org Wed Feb 27 17:29:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979B51522C59; Wed, 27 Feb 2019 17:29:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA1387805; Wed, 27 Feb 2019 17:29:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26F5E1FF1F; Wed, 27 Feb 2019 17:29:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RHTcfC008991; Wed, 27 Feb 2019 17:29:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RHTc0u008990; Wed, 27 Feb 2019 17:29:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902271729.x1RHTc0u008990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 17:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344626 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CA1387805 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 17:29:39 -0000 Author: manu Date: Wed Feb 27 17:29:38 2019 New Revision: 344626 URL: https://svnweb.freebsd.org/changeset/base/344626 Log: arm64: rockchip: rk3399_clk: Add sd clock definitions MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Wed Feb 27 17:00:27 2019 (r344625) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Wed Feb 27 17:29:38 2019 (r344626) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #define PCLK_I2C5 344 #define PCLK_I2C6 345 #define PCLK_I2C7 346 +#define HCLK_SDMMC 462 static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON0 */ @@ -99,6 +100,9 @@ static struct rk_cru_gate rk3399_gates[] = { CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive", 0x37c, 3) CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4) CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5) + + /* CRU_CLKGATE_CON33 */ + CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8) }; @@ -1385,6 +1389,60 @@ static struct rk_clk_armclk_def armclk_b = { .nrates = nitems(rk3399_armclkb_rates), }; +/* + * sdmmc + */ + +#define HCLK_SD 461 + +static const char *hclk_sd_parents[] = {"cpll", "gpll"}; + +static struct rk_clk_composite_def hclk_sd = { + .clkdef = { + .id = HCLK_SD, + .name = "hclk_sd", + .parent_names = hclk_sd_parents, + .parent_cnt = nitems(hclk_sd_parents), + }, + + .muxdiv_offset = 0x134, + .mux_shift = 15, + .mux_width = 1, + + .div_shift = 8, + .div_width = 5, + + .gate_offset = 0x330, + .gate_shift = 13, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +#define SCLK_SDMMC 76 + +static const char *sclk_sdmmc_parents[] = {"cpll", "gpll", "npll", "ppll"}; + +static struct rk_clk_composite_def sclk_sdmmc = { + .clkdef = { + .id = SCLK_SDMMC, + .name = "sclk_sdmmc", + .parent_names = sclk_sdmmc_parents, + .parent_cnt = nitems(sclk_sdmmc_parents), + }, + + .muxdiv_offset = 0x140, + .mux_shift = 8, + .mux_width = 3, + + .div_shift = 0, + .div_width = 7, + + .gate_offset = 0x318, + .gate_shift = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + static struct rk_clk rk3399_clks[] = { { .type = RK3399_CLK_PLL, @@ -1483,6 +1541,15 @@ static struct rk_clk rk3399_clks[] = { { .type = RK_CLK_ARMCLK, .clk.armclk = &armclk_b, + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &hclk_sd, + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &sclk_sdmmc, }, }; From owner-svn-src-head@freebsd.org Wed Feb 27 17:30:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 084461522CC4; Wed, 27 Feb 2019 17:30:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A43BA879BB; Wed, 27 Feb 2019 17:30:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 928591FF23; Wed, 27 Feb 2019 17:30:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RHUSO3009100; Wed, 27 Feb 2019 17:30:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RHUScE009099; Wed, 27 Feb 2019 17:30:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902271730.x1RHUScE009099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 17:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344627 - head/sys/dev/mmc/host X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/mmc/host X-SVN-Commit-Revision: 344627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A43BA879BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 17:30:29 -0000 Author: manu Date: Wed Feb 27 17:30:28 2019 New Revision: 344627 URL: https://svnweb.freebsd.org/changeset/base/344627 Log: mmc: dwmmc: Match on "rockchip,rk3288-dw-mshc" compatible This is the common denominator for rockchip compatible from RK3288 to RK3399. The other compatible are generally present in the DTS but the controllers are the same. MFC after: 1 week Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c Modified: head/sys/dev/mmc/host/dwmmc_rockchip.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Feb 27 17:29:38 2019 (r344626) +++ head/sys/dev/mmc/host/dwmmc_rockchip.c Wed Feb 27 17:30:28 2019 (r344627) @@ -49,12 +49,12 @@ __FBSDID("$FreeBSD$"); enum RKTYPE { RK2928 = 1, - RK3328, + RK3288, }; static struct ofw_compat_data compat_data[] = { {"rockchip,rk2928-dw-mshc", RK2928}, - {"rockchip,rk3328-dw-mshc", RK3328}, + {"rockchip,rk3288-dw-mshc", RK3288}, {NULL, 0}, }; From owner-svn-src-head@freebsd.org Wed Feb 27 17:52:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E2CA1500436; Wed, 27 Feb 2019 17:52: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB9F2886F4; Wed, 27 Feb 2019 17:52: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 BC4392044F; Wed, 27 Feb 2019 17:52: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 x1RHqMsn023150; Wed, 27 Feb 2019 17:52:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RHqMh1023149; Wed, 27 Feb 2019 17:52:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201902271752.x1RHqMh1023149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Feb 2019 17:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344628 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 344628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB9F2886F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 17:52:23 -0000 Author: emaste Date: Wed Feb 27 17:52:22 2019 New Revision: 344628 URL: https://svnweb.freebsd.org/changeset/base/344628 Log: poll.2: POLLNVAL is returned also for insufficient rights Reported by: "Bora Özarslan" MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/sys/poll.2 Modified: head/lib/libc/sys/poll.2 ============================================================================== --- head/lib/libc/sys/poll.2 Wed Feb 27 17:30:28 2019 (r344627) +++ head/lib/libc/sys/poll.2 Wed Feb 27 17:52:22 2019 (r344628) @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 1, 2018 +.Dd February 27, 2019 .Dt POLL 2 .Os .Sh NAME @@ -127,7 +127,8 @@ should never be present in the .Fa revents bitmask at the same time. .It POLLNVAL -The file descriptor is not open. +The file descriptor is not open, +or in capability mode the file descriptor has insufficient rights. This flag is always checked, even if not present in the .Fa events From owner-svn-src-head@freebsd.org Wed Feb 27 18:13:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7BC1500F39; Wed, 27 Feb 2019 18:13:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9A8894CC; Wed, 27 Feb 2019 18:13:41 +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 70B4D207DF; Wed, 27 Feb 2019 18:13:41 +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 x1RIDfiZ034824; Wed, 27 Feb 2019 18:13:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RIDf0D034823; Wed, 27 Feb 2019 18:13:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902271813.x1RIDf0D034823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 27 Feb 2019 18:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344629 - 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: 344629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D9A8894CC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 18:13:42 -0000 Author: markj Date: Wed Feb 27 18:13:41 2019 New Revision: 344629 URL: https://svnweb.freebsd.org/changeset/base/344629 Log: rtsol: Use vwarnx(3) to log messages to standard error. This ensures that the program name is included in the output, which makes it easy to identify the source of error messages printed during boot. MFC after: 1 week Modified: head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Wed Feb 27 17:52:22 2019 (r344628) +++ head/usr.sbin/rtsold/rtsold.c Wed Feb 27 18:13:41 2019 (r344629) @@ -787,10 +787,8 @@ warnmsg(int priority, const char *func, const char *ms va_start(ap, msg); if (fflag) { - if (priority <= log_upto) { - (void)vfprintf(stderr, msg, ap); - (void)fprintf(stderr, "\n"); - } + if (priority <= log_upto) + vwarnx(msg, ap); } else { snprintf(buf, sizeof(buf), "<%s> %s", func, msg); msg = buf; From owner-svn-src-head@freebsd.org Wed Feb 27 19:27:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE451502B02; Wed, 27 Feb 2019 19:27:17 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 037FC8BF5B; Wed, 27 Feb 2019 19:27:17 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBAA9213C4; Wed, 27 Feb 2019 19:27:16 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RJRGVi072366; Wed, 27 Feb 2019 19:27:16 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RJRGUY072365; Wed, 27 Feb 2019 19:27:16 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201902271927.x1RJRGUY072365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Wed, 27 Feb 2019 19:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344630 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 344630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 037FC8BF5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 19:27:17 -0000 Author: sef Date: Wed Feb 27 19:27:16 2019 New Revision: 344630 URL: https://svnweb.freebsd.org/changeset/base/344630 Log: Have cryptocheck toggle kern.cryptodevallowsoft if necessary (this requires root access). Reviewed by: cem, jhb Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D19372 Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Wed Feb 27 18:13:41 2019 (r344629) +++ head/tools/tools/crypto/cryptocheck.c Wed Feb 27 19:27:16 2019 (r344630) @@ -111,6 +111,7 @@ */ #include +#include #include #include #include @@ -275,13 +276,41 @@ devcrypto(void) return (fd); } +/* + * Called on exit to change kern.cryptodevallowsoft back to 0 + */ +#define CRYPT_SOFT_ALLOW "kern.cryptodevallowsoft" + +static void +reset_user_soft(void) +{ + int off = 0; + sysctlbyname(CRYPT_SOFT_ALLOW, NULL, NULL, &off, sizeof(off)); +} + +static void +enable_user_soft(void) +{ + int curstate; + int on = 1; + size_t cursize = sizeof(curstate); + + if (sysctlbyname(CRYPT_SOFT_ALLOW, &curstate, &cursize, + &on, sizeof(on)) == 0) { + if (curstate == 0) + atexit(reset_user_soft); + } +} + static int crlookup(const char *devname) { struct crypt_find_op find; - if (strncmp(devname, "soft", 4) == 0) + if (strncmp(devname, "soft", 4) == 0) { + enable_user_soft(); return CRYPTO_FLAG_SOFTWARE; + } find.crid = -1; strlcpy(find.name, devname, sizeof(find.name)); From owner-svn-src-head@freebsd.org Wed Feb 27 20:09:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB611503972; Wed, 27 Feb 2019 20:09:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5C878D602; Wed, 27 Feb 2019 20:09:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C5A921A88; Wed, 27 Feb 2019 20:09:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RK9w4v094078; Wed, 27 Feb 2019 20:09:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RK9wS2094077; Wed, 27 Feb 2019 20:09:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201902272009.x1RK9wS2094077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Feb 2019 20:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344631 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 344631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5C878D602 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 20:09:59 -0000 Author: jhb Date: Wed Feb 27 20:09:58 2019 New Revision: 344631 URL: https://svnweb.freebsd.org/changeset/base/344631 Log: Update review requests for bhyve. - Explicitly mention the #bhyve group on Phabricator. - Request reviews of the userland components (libvmmapi, bhyve, bhyvectl, and bhyveload). Reviewed by: imp, rgrimes Differential Revision: https://reviews.freebsd.org/D17848 Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Feb 27 19:27:16 2019 (r344630) +++ head/MAINTAINERS Wed Feb 27 20:09:58 2019 (r344631) @@ -106,7 +106,12 @@ usr.sbin/bsdconfig dteske Pre-commit phabricator revie usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with libdpv. usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. usr.sbin/sysrc dteske Pre-commit phabricator review requested. Keep in sync with bsdconfig(8) sysrc.subr. -vmm(4) tychon, jhb Pre-commit review requested. +vmm(4) tychon, jhb Pre-commit review requested via #bhyve + phabricator group. +libvmmapi tychon, jhb Pre-commit review requested via #bhyve + phabricator group. +usr.sbin/bhyve* tychon, jhb Pre-commit review requested via #bhyve + phabricator group. autofs(5) trasz Pre-commit review recommended. iscsi(4) trasz Pre-commit review recommended. rctl(8) trasz Pre-commit review recommended. From owner-svn-src-head@freebsd.org Wed Feb 27 20:17:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A4FD1504283; Wed, 27 Feb 2019 20:17:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D132E8DE4A; Wed, 27 Feb 2019 20:17:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 008268E8D; Wed, 27 Feb 2019 20:17:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec From: John Baldwin To: Alexey Dokuchaev Cc: rgrimes@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> <34ecb52f-c89e-0d5e-594e-25b0d045d171@FreeBSD.org> <20190226172358.GA67992@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 27 Feb 2019 12:17:27 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D132E8DE4A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 20:17:37 -0000 On 2/26/19 10:06 AM, John Baldwin wrote: > On 2/26/19 9:23 AM, Alexey Dokuchaev wrote: >> On Tue, Feb 26, 2019 at 09:12:11AM -0800, John Baldwin wrote: >>> On 2/26/19 5:49 AM, Alexey Dokuchaev wrote: >>>> On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: >>>>> ... >>>>> Just a small nit, for future reference, from the template: >>>>>> Differential Revision: https://reviews.freebsd.org/D### >>>>> (*full* phabric URL needed). >>>> >>>> IMHO we should just fix the scripts to accept D#### alone, without >>>> the URL. We don't do that for PR (bugzilla) references, and the fact >>>> that we do for the phab is both needless and confusing. Also, that >>>> URL might change one day while we could probably keep the old numbers >>>> if we move. >>> >>> It makes the review clickable in many mail clients which is very handy. >> >> I understand that, but then again, we don't do that for PRs and people >> don't seem to complain. Accepting D#### would make this all consistent >> and commit messages cleaner. Arguably, if one likes to click the URLs >> in their mail client, why not configure the client to expand the URL in >> place? >> >>> -- >>> John Baldwin >>> >>> \x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a\x9a >> >> Can you do something about this horde of \x9a's appended to your every >> email John? > > Bizarre, that's the first time someone has mentioned that. It appears to > be a misfeature of Thunderbird which I switched to last year after kmail > in kde5 officially moved to "unusable trash fire" status. It doesn't show > up locally, and the signature file I'm using doesn't contain them: > > % hexdump .signature > 0000000 2d 2d 20 0a 4a 6f 68 6e 20 42 61 6c 64 77 69 6e > 0000010 0a > 0000011 > > Switching to using an inline signature instead of a signature file didn't > fix it either. :( I haven't found an existing bug report for this yet. With a tip from cem@ I narrowed the cause of this down to a "Wrap Text" plugin I had been using to annotate where to wrap text in the compose window. I've disabled it, so the spam should be gone. My mails might not wrap sanely though. :-/ -- John Baldwin From owner-svn-src-head@freebsd.org Wed Feb 27 20:24:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED40D150452F; Wed, 27 Feb 2019 20:24:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91EFE8E3E0; Wed, 27 Feb 2019 20:24:23 +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 84BFE21DF6; Wed, 27 Feb 2019 20:24:23 +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 x1RKONRu004405; Wed, 27 Feb 2019 20:24:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RKON8k004404; Wed, 27 Feb 2019 20:24:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201902272024.x1RKON8k004404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Feb 2019 20:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344632 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91EFE8E3E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 20:24:24 -0000 Author: jhb Date: Wed Feb 27 20:24:23 2019 New Revision: 344632 URL: https://svnweb.freebsd.org/changeset/base/344632 Log: Various cleanups to the management of multiple TCP stacks. - Use strlcpy() with sizeof() instead of strncpy(). - Simplify initialization of TCP functions structures. init_tcp_functions() was already called before the first call to register a stack. Just inline the work in the SYSINIT and remove the racy helper variable. Instead, KASSERT that the rw lock is initialized when registering a stack. - Protect the default stack via a direct pointer comparison. The default stack uses the name "freebsd" instead of "default" so this protection wasn't working for the default stack anyway. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19152 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Feb 27 20:09:58 2019 (r344631) +++ head/sys/netinet/tcp_subr.c Wed Feb 27 20:24:23 2019 (r344632) @@ -257,21 +257,10 @@ static struct tcp_function_block tcp_def_funcblk = { .tfb_tcp_fb_fini = tcp_default_fb_fini, }; -int t_functions_inited = 0; static int tcp_fb_cnt = 0; struct tcp_funchead t_functions; static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; -static void -init_tcp_functions(void) -{ - if (t_functions_inited == 0) { - TAILQ_INIT(&t_functions); - rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); - t_functions_inited = 1; - } -} - static struct tcp_function_block * find_tcp_functions_locked(struct tcp_function_set *fs) { @@ -559,13 +548,10 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS) bzero(&tfi, sizeof(tfi)); tfi.tfi_refcnt = f->tf_fb->tfb_refcnt; tfi.tfi_id = f->tf_fb->tfb_id; - (void)strncpy(tfi.tfi_alias, f->tf_name, - TCP_FUNCTION_NAME_LEN_MAX); - tfi.tfi_alias[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; - (void)strncpy(tfi.tfi_name, - f->tf_fb->tfb_tcp_block_name, - TCP_FUNCTION_NAME_LEN_MAX); - tfi.tfi_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; + (void)strlcpy(tfi.tfi_alias, f->tf_name, + sizeof(tfi.tfi_alias)); + (void)strlcpy(tfi.tfi_name, + f->tf_fb->tfb_tcp_block_name, sizeof(tfi.tfi_name)); error = SYSCTL_OUT(req, &tfi, sizeof(tfi)); /* * Don't stop on error, as that is the @@ -781,10 +767,9 @@ register_tcp_functions_as_names(struct tcp_function_bl KASSERT(names != NULL && *num_names > 0, ("%s: Called with 0-length name list", __func__)); KASSERT(names != NULL, ("%s: Called with NULL name list", __func__)); + KASSERT(rw_initialized(&tcp_function_lock), + ("%s: called too early", __func__)); - if (t_functions_inited == 0) { - init_tcp_functions(); - } if ((blk->tfb_tcp_output == NULL) || (blk->tfb_tcp_do_segment == NULL) || (blk->tfb_tcp_ctloutput == NULL) || @@ -824,9 +809,8 @@ register_tcp_functions_as_names(struct tcp_function_bl } n->tf_fb = blk; - (void)strncpy(fs.function_set_name, names[i], - TCP_FUNCTION_NAME_LEN_MAX); - fs.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; + (void)strlcpy(fs.function_set_name, names[i], + sizeof(fs.function_set_name)); rw_wlock(&tcp_function_lock); if (find_tcp_functions_locked(&fs) != NULL) { /* Duplicate name space not allowed */ @@ -835,8 +819,7 @@ register_tcp_functions_as_names(struct tcp_function_bl error = EALREADY; goto cleanup; } - (void)strncpy(n->tf_name, names[i], TCP_FUNCTION_NAME_LEN_MAX); - n->tf_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; + (void)strlcpy(n->tf_name, names[i], sizeof(n->tf_name)); TAILQ_INSERT_TAIL(&t_functions, n, tf_next); tcp_fb_cnt++; rw_wunlock(&tcp_function_lock); @@ -923,8 +906,8 @@ deregister_tcp_functions(struct tcp_function_block *bl bool force) { struct tcp_function *f; - - if (strcmp(blk->tfb_tcp_block_name, "default") == 0) { + + if (blk == &tcp_def_funcblk) { /* You can't un-register the default */ return (EPERM); } @@ -1090,8 +1073,10 @@ tcp_init(void) tcp_rexmit_slop = TCPTV_CPU_VAR; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; + /* Setup the tcp function block list */ - init_tcp_functions(); + TAILQ_INIT(&t_functions); + rw_init(&tcp_function_lock, "tcp_func_lock"); register_tcp_functions(&tcp_def_funcblk, M_WAITOK); #ifdef TCP_BLACKBOX /* Initialize the TCP logging data. */ From owner-svn-src-head@freebsd.org Wed Feb 27 20:52:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E702A1504ECF; Wed, 27 Feb 2019 20:52:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1138F5BC; Wed, 27 Feb 2019 20:52:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EAAE2234B; Wed, 27 Feb 2019 20:52:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RKqaG0020029; Wed, 27 Feb 2019 20:52:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RKqahM020028; Wed, 27 Feb 2019 20:52:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902272052.x1RKqahM020028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 20:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344633 - in head/sys: conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dev/usb/controller X-SVN-Commit-Revision: 344633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A1138F5BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 20:52:37 -0000 Author: manu Date: Wed Feb 27 20:52:35 2019 New Revision: 344633 URL: https://svnweb.freebsd.org/changeset/base/344633 Log: usb_nop_xceiv: Add support for this pseudo device This is a "fake" phy that handle regulator, clocks and reset gpio. Only clock and regulator is supported for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") Added: head/sys/dev/usb/controller/usb_nop_xceiv.c (contents, props changed) Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Feb 27 20:24:23 2019 (r344632) +++ head/sys/conf/files.arm64 Wed Feb 27 20:52:35 2019 (r344633) @@ -234,6 +234,7 @@ dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt dev/usb/controller/xhci_mv.c optional xhci_mv fdt +dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov Added: head/sys/dev/usb/controller/usb_nop_xceiv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/usb_nop_xceiv.c Wed Feb 27 20:52:35 2019 (r344633) @@ -0,0 +1,211 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Rubicon Communications, LLC (Netgate) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include "phynode_if.h" + +struct usb_nop_xceiv_softc { + device_t dev; + regulator_t vcc_supply; + clk_t clk; + uint32_t clk_freq; +}; + +static struct ofw_compat_data compat_data[] = { + {"usb-nop-xceiv", 1}, + {NULL, 0} +}; + +/* Phy class and methods. */ +static int usb_nop_xceiv_phy_enable(struct phynode *phy, bool enable); +static phynode_usb_method_t usb_nop_xceiv_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, usb_nop_xceiv_phy_enable), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_1(usb_nop_xceiv_phynode, usb_nop_xceiv_phynode_class, + usb_nop_xceiv_phynode_methods, + sizeof(struct phynode_usb_sc), phynode_usb_class); + +static int +usb_nop_xceiv_phy_enable(struct phynode *phynode, bool enable) +{ + struct usb_nop_xceiv_softc *sc; + device_t dev; + intptr_t phy; + int error; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != 0) + return (ERANGE); + + /* Enable the phy clock */ + if (sc->clk_freq != 0) { + if (enable) { + error = clk_set_freq(sc->clk, sc->clk_freq, + CLK_SET_ROUND_ANY); + if (error != 0) { + device_printf(dev, "Cannot set clock to %dMhz\n", + sc->clk_freq); + goto fail; + } + + error = clk_enable(sc->clk); + } else + error = clk_disable(sc->clk); + + if (error != 0) { + device_printf(dev, "Cannot %sable the clock\n", + enable ? "En" : "Dis"); + goto fail; + } + } + if (sc->vcc_supply) { + if (enable) + error = regulator_enable(sc->vcc_supply); + else + error = regulator_disable(sc->vcc_supply); + if (error != 0) { + device_printf(dev, "Cannot %sable the regulator\n", + enable ? "En" : "Dis"); + goto fail; + } + } + + return (0); + +fail: + return (ENXIO); +} + +static int +usb_nop_xceiv_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "USB NOP PHY"); + return (BUS_PROBE_DEFAULT); +} + +static int +usb_nop_xceiv_attach(device_t dev) +{ + struct usb_nop_xceiv_softc *sc; + struct phynode *phynode; + struct phynode_init_def phy_init; + phandle_t node; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + /* Parse the optional properties */ + OF_getencprop(node, "clock-frequency", &sc->clk_freq, sizeof(uint32_t)); + + error = clk_get_by_ofw_name(dev, node, "main_clk", &sc->clk); + if (error != 0 && sc->clk_freq != 0) { + device_printf(dev, "clock property is mandatory if clock-frequency is present\n"); + return (ENXIO); + } + + regulator_get_by_ofw_property(dev, node, "vcc-supply", &sc->vcc_supply); + + phy_init.id = 0; + phy_init.ofw_node = node; + phynode = phynode_create(dev, &usb_nop_xceiv_phynode_class, + &phy_init); + if (phynode == NULL) { + device_printf(dev, "failed to create USB NOP PHY\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(dev, "failed to create USB NOP PHY\n"); + return (ENXIO); + } + + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); +} + +static int +usb_nop_xceiv_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t usb_nop_xceiv_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, usb_nop_xceiv_probe), + DEVMETHOD(device_attach, usb_nop_xceiv_attach), + DEVMETHOD(device_detach, usb_nop_xceiv_detach), + + DEVMETHOD_END +}; + +static devclass_t usb_nop_xceiv_devclass; + +static driver_t usb_nop_xceiv_driver = { + "usb_nop_xceiv", + usb_nop_xceiv_methods, + sizeof(struct usb_nop_xceiv_softc), +}; + +EARLY_DRIVER_MODULE(usb_nop_xceiv, simplebus, usb_nop_xceiv_driver, + usb_nop_xceiv_devclass, 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Wed Feb 27 21:04:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7704415052E3; Wed, 27 Feb 2019 21:04:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 073CD8FD15; Wed, 27 Feb 2019 21:04:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E338522553; Wed, 27 Feb 2019 21:04:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RL4fM1025871; Wed, 27 Feb 2019 21:04:41 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RL4fiR025868; Wed, 27 Feb 2019 21:04:41 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902272104.x1RL4fiR025868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 21:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344634 - in head/sys: arm64/conf conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/usb/controller X-SVN-Commit-Revision: 344634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 073CD8FD15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 21:04:42 -0000 Author: manu Date: Wed Feb 27 21:04:40 2019 New Revision: 344634 URL: https://svnweb.freebsd.org/changeset/base/344634 Log: xhci_mv: Move the driver to generic_xhci Marvell XHCI is in fact generic-xhci, so move the driver and add the compatible string. While here, get and enable the phy if the dtb provide one. The xhci bindings state that phys should be in a 'phys' property but Marvell DTS uses 'usb-phy', only add support for 'usb-phy' for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") Added: head/sys/dev/usb/controller/generic_xhci.c - copied, changed from r344633, head/sys/dev/usb/controller/xhci_mv.c Deleted: head/sys/dev/usb/controller/xhci_mv.c Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Feb 27 20:52:35 2019 (r344633) +++ head/sys/arm64/conf/GENERIC Wed Feb 27 21:04:40 2019 (r344634) @@ -196,7 +196,6 @@ device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) device ehci_mv # Marvell EHCI USB interface device xhci # XHCI PCI->USB interface (USB 3.0) -device xhci_mv # Marvell XHCI USB interface device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Feb 27 20:52:35 2019 (r344633) +++ head/sys/conf/files.arm64 Wed Feb 27 21:04:40 2019 (r344634) @@ -233,8 +233,8 @@ dev/usb/controller/ehci_mv.c optional ehci_mv fdt dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt -dev/usb/controller/xhci_mv.c optional xhci_mv fdt dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources +dev/usb/controller/generic_xhci.c optional xhci fdt dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov Copied and modified: head/sys/dev/usb/controller/generic_xhci.c (from r344633, head/sys/dev/usb/controller/xhci_mv.c) ============================================================================== --- head/sys/dev/usb/controller/xhci_mv.c Wed Feb 27 20:52:35 2019 (r344633, copy source) +++ head/sys/dev/usb/controller/generic_xhci.c Wed Feb 27 21:04:40 2019 (r344634) @@ -64,6 +64,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EXT_RESOURCES +#include +#endif + #define XHCI_HC_DEVSTR "Marvell Integrated USB 3.0 controller" #define XHCI_HC_VENDOR "Marvell" @@ -76,6 +80,7 @@ static struct ofw_compat_data compat_data[] = { {"marvell,armada-380-xhci", true}, {"marvell,armada3700-xhci", true}, {"marvell,armada-8k-xhci", true}, + {"generic-xhci", true}, {NULL, false} }; @@ -99,6 +104,10 @@ xhci_attach(device_t dev) { struct xhci_softc *sc = device_get_softc(dev); int err = 0, rid = 0; +#ifdef EXT_RESOURCES + phandle_t node; + phy_t phy; +#endif sc->sc_bus.parent = dev; sc->sc_bus.devices = sc->sc_devices; @@ -123,6 +132,13 @@ xhci_attach(device_t dev) xhci_detach(dev); return (ENXIO); } + +#ifdef EXT_RESOURCES + node = ofw_bus_get_node(dev); + if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0) + if (phy_enable(phy) != 0) + device_printf(dev, "Cannot enable phy\n"); +#endif sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); if (sc->sc_bus.bdev == NULL) { From owner-svn-src-head@freebsd.org Wed Feb 27 21:11:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096BC15053BB; Wed, 27 Feb 2019 21:11:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A36C6900A3; Wed, 27 Feb 2019 21:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C490226A7; Wed, 27 Feb 2019 21:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RLBEE6027801; Wed, 27 Feb 2019 21:11:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RLBE2q027800; Wed, 27 Feb 2019 21:11:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902272111.x1RLBE2q027800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 21:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344635 - in head/sys/dev: drm drm2/i915 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/dev: drm drm2/i915 X-SVN-Commit-Revision: 344635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A36C6900A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 21:11:15 -0000 Author: manu Date: Wed Feb 27 21:11:13 2019 New Revision: 344635 URL: https://svnweb.freebsd.org/changeset/base/344635 Log: drm: Remove empty directories Discussed with: imp Deleted: head/sys/dev/drm/ head/sys/dev/drm2/i915/ From owner-svn-src-head@freebsd.org Wed Feb 27 21:29:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 827521505B11; Wed, 27 Feb 2019 21:29:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BBA190A3B; Wed, 27 Feb 2019 21:29:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED34A22909; Wed, 27 Feb 2019 21:29:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RLTMeN036558; Wed, 27 Feb 2019 21:29:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RLTMpG036553; Wed, 27 Feb 2019 21:29:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902272129.x1RLTMpG036553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 27 Feb 2019 21:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344636 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 344636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BBA190A3B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 21:29:23 -0000 Author: mav Date: Wed Feb 27 21:29:21 2019 New Revision: 344636 URL: https://svnweb.freebsd.org/changeset/base/344636 Log: Refactor command ordering/blocking mechanism in CTL. Replace long per-LUN queue of blocked commands, scanned on each command completion and sometimes even twice, causing up to O(n^^2) processing cost, by much shorter per-command blocked queues, scanned only when respective command completes, and check only commands before the previous blocker, reducing cost to O(n). While there, unblock aborted commands to make them "complete" ASAP to be removed from the OOA queue and so not waste time ordering other commands against them. Aborted commands that were not sent to execution yet should have no visible side effects, so this is safe and easy optimization now, comparing to commands already in processing, which are a still pain. Together those two optimizations should fix quite pathological case, when due to backend slowness CTL accumulated many thousands of blocked requests, partially aborted by initiator and so supposedly not even existing, but still wasting CTL CPU time. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Feb 27 21:11:13 2019 (r344635) +++ head/sys/cam/ctl/ctl.c Wed Feb 27 21:29:21 2019 (r344636) @@ -500,8 +500,11 @@ static ctl_action ctl_extent_check_seq(union ctl_io *i static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *ooa_io); static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, - union ctl_io *starting_io); -static int ctl_check_blocked(struct ctl_lun *lun); + union ctl_io **starting_io); +static void ctl_try_unblock_io(struct ctl_lun *lun, union ctl_io *io, + bool skip); +static void ctl_try_unblock_others(struct ctl_lun *lun, union ctl_io *io, + bool skip); static int ctl_scsiio_lun_check(struct ctl_lun *lun, const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio); @@ -2279,6 +2282,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) union ctl_ha_msg msg_info; struct ctl_lun *lun; const struct ctl_cmd_entry *entry; + union ctl_io *bio; uint32_t targ_lun; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; @@ -2337,12 +2341,11 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) #endif TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); - switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, - (union ctl_io *)TAILQ_PREV(&ctsio->io_hdr, ctl_ooaq, - ooa_links))) { + bio = (union ctl_io *)TAILQ_PREV(&ctsio->io_hdr, ctl_ooaq, ooa_links); + switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, &bio)) { case CTL_ACTION_BLOCK: - ctsio->io_hdr.flags |= CTL_FLAG_BLOCKED; - TAILQ_INSERT_TAIL(&lun->blocked_queue, &ctsio->io_hdr, + ctsio->io_hdr.blocker = bio; + TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr, blocked_links); mtx_unlock(&lun->lun_lock); break; @@ -2424,7 +2427,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_ #endif bcopy(io->scsiio.cdb, entry->cdb, io->scsiio.cdb_len); entry->cdb_len = io->scsiio.cdb_len; - if (io->io_hdr.flags & CTL_FLAG_BLOCKED) + if (io->io_hdr.blocker != NULL) entry->cmd_flags |= CTL_OOACMD_FLAG_BLOCKED; if (io->io_hdr.flags & CTL_FLAG_DMA_INPROG) @@ -3889,6 +3892,7 @@ ctl_alloc_io(void *pool_ref) if (io != NULL) { io->io_hdr.pool = pool_ref; CTL_SOFTC(io) = pool->ctl_softc; + TAILQ_INIT(&io->io_hdr.blocked_queue); } return (io); } @@ -3903,6 +3907,7 @@ ctl_alloc_io_nowait(void *pool_ref) if (io != NULL) { io->io_hdr.pool = pool_ref; CTL_SOFTC(io) = pool->ctl_softc; + TAILQ_INIT(&io->io_hdr.blocked_queue); } return (io); } @@ -3934,6 +3939,7 @@ ctl_zero_io(union ctl_io *io) memset(io, 0, sizeof(*io)); io->io_hdr.pool = pool; CTL_SOFTC(io) = pool->ctl_softc; + TAILQ_INIT(&io->io_hdr.blocked_queue); } int @@ -4696,7 +4702,6 @@ fail: lun->last_busy = getsbinuptime(); #endif TAILQ_INIT(&lun->ooa_queue); - TAILQ_INIT(&lun->blocked_queue); STAILQ_INIT(&lun->error_list); lun->ie_reported = 1; callout_init_mtx(&lun->ie_callout, &lun->lun_lock, 0); @@ -5870,7 +5875,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) ptrlen->ptr = (void *)buf; ptrlen->len = len; ptrlen->flags = byte2; - ctl_check_blocked(lun); + ctl_try_unblock_others(lun, (union ctl_io *)ctsio, FALSE); mtx_unlock(&lun->lun_lock); retval = lun->backend->config_write((union ctl_io *)ctsio); @@ -10759,6 +10764,14 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_ const ctl_serialize_action *serialize_row; /* + * Aborted commands are not going to be executed and may even + * not report completion, so we don't care about their order. + * Let them complete ASAP to clean the OOA queue. + */ + if (pending_io->io_hdr.flags & CTL_FLAG_ABORT) + return (CTL_ACTION_SKIP); + + /* * The initiator attempted multiple untagged commands at the same * time. Can't do that. */ @@ -10888,7 +10901,7 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_ */ static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, - union ctl_io *starting_io) + union ctl_io **starting_io) { union ctl_io *ooa_io; ctl_action action; @@ -10901,150 +10914,152 @@ ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pendi * queue. If starting_io is NULL, we'll just end up returning * CTL_ACTION_PASS. */ - for (ooa_io = starting_io; ooa_io != NULL; + for (ooa_io = *starting_io; ooa_io != NULL; ooa_io = (union ctl_io *)TAILQ_PREV(&ooa_io->io_hdr, ctl_ooaq, ooa_links)){ - - /* - * This routine just checks to see whether - * cur_blocked is blocked by ooa_io, which is ahead - * of it in the queue. It doesn't queue/dequeue - * cur_blocked. - */ action = ctl_check_for_blockage(lun, pending_io, ooa_io); - switch (action) { - case CTL_ACTION_BLOCK: - case CTL_ACTION_OVERLAP: - case CTL_ACTION_OVERLAP_TAG: - case CTL_ACTION_SKIP: - case CTL_ACTION_ERROR: + if (action != CTL_ACTION_PASS) { + *starting_io = ooa_io; return (action); - break; /* NOTREACHED */ - case CTL_ACTION_PASS: - break; - default: - panic("%s: Invalid action %d\n", __func__, action); } } + *starting_io = NULL; return (CTL_ACTION_PASS); } /* - * Assumptions: - * - An I/O has just completed, and has been removed from the per-LUN OOA - * queue, so some items on the blocked queue may now be unblocked. + * Try to unblock the specified I/O. + * + * skip parameter allows explicitly skip present blocker of the I/O, + * starting from the previous one on OOA queue. It can be used when + * we know for sure that the blocker I/O does no longer count. */ -static int -ctl_check_blocked(struct ctl_lun *lun) +static void +ctl_try_unblock_io(struct ctl_lun *lun, union ctl_io *io, bool skip) { struct ctl_softc *softc = lun->ctl_softc; - union ctl_io *cur_blocked, *next_blocked; + union ctl_io *bio, *obio; + const struct ctl_cmd_entry *entry; + union ctl_ha_msg msg_info; + ctl_action action; mtx_assert(&lun->lun_lock, MA_OWNED); - /* - * Run forward from the head of the blocked queue, checking each - * entry against the I/Os prior to it on the OOA queue to see if - * there is still any blockage. - * - * We cannot use the TAILQ_FOREACH() macro, because it can't deal - * with our removing a variable on it while it is traversing the - * list. - */ - for (cur_blocked = (union ctl_io *)TAILQ_FIRST(&lun->blocked_queue); - cur_blocked != NULL; cur_blocked = next_blocked) { - union ctl_io *prev_ooa; - ctl_action action; + if (io->io_hdr.blocker == NULL) + return; - next_blocked = (union ctl_io *)TAILQ_NEXT(&cur_blocked->io_hdr, - blocked_links); + obio = bio = io->io_hdr.blocker; + if (skip) + bio = (union ctl_io *)TAILQ_PREV(&bio->io_hdr, ctl_ooaq, + ooa_links); + action = ctl_check_ooa(lun, io, &bio); + if (action == CTL_ACTION_BLOCK) { + /* Still blocked, but may be by different I/O now. */ + if (bio != obio) { + TAILQ_REMOVE(&obio->io_hdr.blocked_queue, + &io->io_hdr, blocked_links); + TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, + &io->io_hdr, blocked_links); + io->io_hdr.blocker = bio; + } + return; + } - prev_ooa = (union ctl_io *)TAILQ_PREV(&cur_blocked->io_hdr, - ctl_ooaq, ooa_links); + /* No longer blocked, one way or another. */ + TAILQ_REMOVE(&obio->io_hdr.blocked_queue, &io->io_hdr, blocked_links); + io->io_hdr.blocker = NULL; + switch (action) { + case CTL_ACTION_OVERLAP: + ctl_set_overlapped_cmd(&io->scsiio); + goto error; + case CTL_ACTION_OVERLAP_TAG: + ctl_set_overlapped_tag(&io->scsiio, + io->scsiio.tag_num & 0xff); + goto error; + case CTL_ACTION_PASS: + case CTL_ACTION_SKIP: + + /* Serializing commands from the other SC retire there. */ + if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) && + (softc->ha_mode != CTL_HA_MODE_XFER)) { + io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE; + msg_info.hdr.original_sc = io->io_hdr.remote_io; + msg_info.hdr.serializing_sc = io; + msg_info.hdr.msg_type = CTL_MSG_R2R; + ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, + sizeof(msg_info.hdr), M_NOWAIT); + break; + } + /* - * If cur_blocked happens to be the first item in the OOA - * queue now, prev_ooa will be NULL, and the action - * returned will just be CTL_ACTION_PASS. + * Check this I/O for LUN state changes that may have happened + * while this command was blocked. The LUN state may have been + * changed by a command ahead of us in the queue. */ - action = ctl_check_ooa(lun, cur_blocked, prev_ooa); - - switch (action) { - case CTL_ACTION_BLOCK: - /* Nothing to do here, still blocked */ + entry = ctl_get_cmd_entry(&io->scsiio, NULL); + if (ctl_scsiio_lun_check(lun, entry, &io->scsiio) != 0) { + ctl_done(io); break; - case CTL_ACTION_OVERLAP: - case CTL_ACTION_OVERLAP_TAG: - /* - * This shouldn't happen! In theory we've already - * checked this command for overlap... - */ - break; - case CTL_ACTION_PASS: - case CTL_ACTION_SKIP: { - const struct ctl_cmd_entry *entry; + } - /* - * The skip case shouldn't happen, this transaction - * should have never made it onto the blocked queue. - */ - /* - * This I/O is no longer blocked, we can remove it - * from the blocked queue. Since this is a TAILQ - * (doubly linked list), we can do O(1) removals - * from any place on the list. - */ - TAILQ_REMOVE(&lun->blocked_queue, &cur_blocked->io_hdr, - blocked_links); - cur_blocked->io_hdr.flags &= ~CTL_FLAG_BLOCKED; + io->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR; + ctl_enqueue_rtr(io); + break; + case CTL_ACTION_ERROR: + default: + ctl_set_internal_failure(&io->scsiio, + /*sks_valid*/ 0, + /*retry_count*/ 0); - if ((softc->ha_mode != CTL_HA_MODE_XFER) && - (cur_blocked->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC)){ - /* - * Need to send IO back to original side to - * run - */ - union ctl_ha_msg msg_info; +error: + /* Serializing commands from the other SC are done here. */ + if ((io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) && + (softc->ha_mode != CTL_HA_MODE_XFER)) { + ctl_try_unblock_others(lun, io, TRUE); + TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); - cur_blocked->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE; - msg_info.hdr.original_sc = - cur_blocked->io_hdr.remote_io; - msg_info.hdr.serializing_sc = cur_blocked; - msg_info.hdr.msg_type = CTL_MSG_R2R; - ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, - sizeof(msg_info.hdr), M_NOWAIT); - break; - } - entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); - - /* - * Check this I/O for LUN state changes that may - * have happened while this command was blocked. - * The LUN state may have been changed by a command - * ahead of us in the queue, so we need to re-check - * for any states that can be caused by SCSI - * commands. - */ - if (ctl_scsiio_lun_check(lun, entry, - &cur_blocked->scsiio) == 0) { - cur_blocked->io_hdr.flags |= - CTL_FLAG_IS_WAS_ON_RTR; - ctl_enqueue_rtr(cur_blocked); - } else - ctl_done(cur_blocked); + ctl_copy_sense_data_back(io, &msg_info); + msg_info.hdr.original_sc = io->io_hdr.remote_io; + msg_info.hdr.serializing_sc = NULL; + msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; + ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, + sizeof(msg_info.scsi), M_WAITOK); + ctl_free_io(io); break; } - default: - /* - * This probably shouldn't happen -- we shouldn't - * get CTL_ACTION_ERROR, or anything else. - */ - break; - } + + ctl_done(io); + break; } +} - return (CTL_RETVAL_COMPLETE); +/* + * Try to unblock I/Os blocked by the specified I/O. + * + * skip parameter allows explicitly skip the specified I/O as blocker, + * starting from the previous one on the OOA queue. It can be used when + * we know for sure that the specified I/O does no longer count (done). + * It has to be still on OOA queue though so that we know where to start. + */ +static void +ctl_try_unblock_others(struct ctl_lun *lun, union ctl_io *bio, bool skip) +{ + union ctl_io *io, *next_io; + + mtx_assert(&lun->lun_lock, MA_OWNED); + + for (io = (union ctl_io *)TAILQ_FIRST(&bio->io_hdr.blocked_queue); + io != NULL; io = next_io) { + next_io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr, blocked_links); + + KASSERT(io->io_hdr.blocker != NULL, + ("I/O %p on blocked list without blocker", io)); + ctl_try_unblock_io(lun, io, skip); + } + KASSERT(!skip || TAILQ_EMPTY(&bio->io_hdr.blocked_queue), + ("blocked_queue is not empty after skipping %p", bio)); } /* @@ -11212,6 +11227,8 @@ ctl_failover_lun(union ctl_io *rio) if (io->flags & CTL_FLAG_IO_ACTIVE) { io->flags |= CTL_FLAG_ABORT; io->flags |= CTL_FLAG_FAILOVER; + ctl_try_unblock_io(lun, + (union ctl_io *)io, FALSE); } else { /* This can be only due to DATAMOVE */ io->msg_type = CTL_MSG_DATAMOVE_DONE; io->flags &= ~CTL_FLAG_DMA_INPROG; @@ -11219,7 +11236,7 @@ ctl_failover_lun(union ctl_io *rio) io->port_status = 31340; ctl_enqueue_isc((union ctl_io *)io); } - } + } else /* We are slave */ if (io->flags & CTL_FLAG_SENT_2OTHER_SC) { io->flags &= ~CTL_FLAG_SENT_2OTHER_SC; @@ -11233,23 +11250,19 @@ ctl_failover_lun(union ctl_io *rio) } } } else { /* SERIALIZE modes */ - TAILQ_FOREACH_SAFE(io, &lun->blocked_queue, blocked_links, - next_io) { - /* We are master */ - if (io->flags & CTL_FLAG_FROM_OTHER_SC) { - TAILQ_REMOVE(&lun->blocked_queue, io, - blocked_links); - io->flags &= ~CTL_FLAG_BLOCKED; - TAILQ_REMOVE(&lun->ooa_queue, io, ooa_links); - ctl_free_io((union ctl_io *)io); - } - } TAILQ_FOREACH_SAFE(io, &lun->ooa_queue, ooa_links, next_io) { /* We are master */ if (io->flags & CTL_FLAG_FROM_OTHER_SC) { + if (io->blocker != NULL) { + TAILQ_REMOVE(&io->blocker->io_hdr.blocked_queue, + io, blocked_links); + io->blocker = NULL; + } + ctl_try_unblock_others(lun, (union ctl_io *)io, + TRUE); TAILQ_REMOVE(&lun->ooa_queue, io, ooa_links); ctl_free_io((union ctl_io *)io); - } + } else /* We are slave */ if (io->flags & CTL_FLAG_SENT_2OTHER_SC) { io->flags &= ~CTL_FLAG_SENT_2OTHER_SC; @@ -11260,7 +11273,6 @@ ctl_failover_lun(union ctl_io *rio) } } } - ctl_check_blocked(lun); } mtx_unlock(&lun->lun_lock); } @@ -11270,6 +11282,7 @@ ctl_scsiio_precheck(struct ctl_softc *softc, struct ct { struct ctl_lun *lun; const struct ctl_cmd_entry *entry; + union ctl_io *bio; uint32_t initidx, targ_lun; int retval = 0; @@ -11445,12 +11458,11 @@ ctl_scsiio_precheck(struct ctl_softc *softc, struct ct return (retval); } - switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, - (union ctl_io *)TAILQ_PREV(&ctsio->io_hdr, - ctl_ooaq, ooa_links))) { + bio = (union ctl_io *)TAILQ_PREV(&ctsio->io_hdr, ctl_ooaq, ooa_links); + switch (ctl_check_ooa(lun, (union ctl_io *)ctsio, &bio)) { case CTL_ACTION_BLOCK: - ctsio->io_hdr.flags |= CTL_FLAG_BLOCKED; - TAILQ_INSERT_TAIL(&lun->blocked_queue, &ctsio->io_hdr, + ctsio->io_hdr.blocker = bio; + TAILQ_INSERT_TAIL(&bio->io_hdr.blocked_queue, &ctsio->io_hdr, blocked_links); mtx_unlock(&lun->lun_lock); return (retval); @@ -11663,6 +11675,7 @@ ctl_do_lun_reset(struct ctl_lun *lun, uint32_t initidx for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL; xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) { xio->io_hdr.flags |= CTL_FLAG_ABORT | CTL_FLAG_ABORT_STATUS; + ctl_try_unblock_io(lun, xio, FALSE); } /* Clear CA. */ for (i = 0; i < ctl_max_ports; i++) { @@ -11761,6 +11774,7 @@ ctl_abort_tasks_lun(struct ctl_lun *lun, uint32_t targ ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.task), M_NOWAIT); } + ctl_try_unblock_io(lun, xio, FALSE); } } } @@ -11933,6 +11947,7 @@ ctl_abort_task(union ctl_io *io) ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.task), M_NOWAIT); } + ctl_try_unblock_io(lun, xio, FALSE); } } mtx_unlock(&lun->lun_lock); @@ -12108,8 +12123,8 @@ ctl_handle_isc(union ctl_io *io) break; } mtx_lock(&lun->lun_lock); + ctl_try_unblock_others(lun, io, TRUE); TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); - ctl_check_blocked(lun); mtx_unlock(&lun->lun_lock); ctl_free_io(io); break; @@ -12933,6 +12948,13 @@ ctl_process_done(union ctl_io *io) } /* + * Run through the blocked queue of this I/O and see if anything + * can be unblocked, now that this I/O is done and will be removed. + * We need to do it before removal to have OOA position to start. + */ + ctl_try_unblock_others(lun, io, TRUE); + + /* * Remove this from the OOA queue. */ TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); @@ -12942,12 +12964,6 @@ ctl_process_done(union ctl_io *io) #endif /* - * Run through the blocked queue on this LUN and see if anything - * has become unblocked, now that this transaction is done. - */ - ctl_check_blocked(lun); - - /* * If the LUN has been invalidated, free it if there is nothing * left on its OOA queue. */ @@ -13102,7 +13118,7 @@ ctl_serseq_done(union ctl_io *io) return; mtx_lock(&lun->lun_lock); io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE; - ctl_check_blocked(lun); + ctl_try_unblock_others(lun, io, FALSE); mtx_unlock(&lun->lun_lock); } Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Wed Feb 27 21:11:13 2019 (r344635) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Wed Feb 27 21:29:21 2019 (r344636) @@ -620,6 +620,7 @@ ctl_ioctl_io(struct cdev *dev, u_long cmd, caddr_t add memcpy(io, (void *)addr, sizeof(*io)); io->io_hdr.pool = pool_tmp; CTL_SOFTC(io) = sc_tmp; + TAILQ_INIT(&io->io_hdr.blocked_queue); /* * No status yet, so make sure the status is set properly. Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Wed Feb 27 21:11:13 2019 (r344635) +++ head/sys/cam/ctl/ctl_io.h Wed Feb 27 21:29:21 2019 (r344636) @@ -87,7 +87,6 @@ typedef enum { CTL_FLAG_DO_AUTOSENSE = 0x00000020, /* grab sense info */ CTL_FLAG_USER_REQ = 0x00000040, /* request came from userland */ CTL_FLAG_ALLOCATED = 0x00000100, /* data space allocated */ - CTL_FLAG_BLOCKED = 0x00000200, /* on the blocked queue */ CTL_FLAG_ABORT_STATUS = 0x00000400, /* return TASK ABORTED status */ CTL_FLAG_ABORT = 0x00000800, /* this I/O should be aborted */ CTL_FLAG_DMA_INPROG = 0x00001000, /* DMA in progress */ @@ -239,14 +238,13 @@ struct ctl_io_hdr { #endif /* CTL_TIME_IO */ uint32_t num_dmas; /* Number of DMAs */ union ctl_io *remote_io; /* I/O counterpart on remote HA side */ - void *pad1; + union ctl_io *blocker; /* I/O blocking this one */ void *pool; /* I/O pool */ union ctl_priv ctl_private[CTL_NUM_PRIV];/* CTL private area */ - void *pad2; - void *pad3; + TAILQ_HEAD(, ctl_io_hdr) blocked_queue; /* I/Os blocked by this one */ STAILQ_ENTRY(ctl_io_hdr) links; /* linked list pointer */ - TAILQ_ENTRY(ctl_io_hdr) ooa_links; - TAILQ_ENTRY(ctl_io_hdr) blocked_links; + TAILQ_ENTRY(ctl_io_hdr) ooa_links; /* ooa_queue links */ + TAILQ_ENTRY(ctl_io_hdr) blocked_links; /* blocked_queue links */ }; typedef enum { Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Feb 27 21:11:13 2019 (r344635) +++ head/sys/cam/ctl/ctl_private.h Wed Feb 27 21:29:21 2019 (r344636) @@ -390,7 +390,6 @@ struct ctl_lun { sbintime_t last_busy; #endif TAILQ_HEAD(ctl_ooaq, ctl_io_hdr) ooa_queue; - TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue; STAILQ_ENTRY(ctl_lun) links; struct scsi_sense_data **pending_sense; ctl_ua_type **pending_ua; From owner-svn-src-head@freebsd.org Wed Feb 27 21:43:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C613F150603C; Wed, 27 Feb 2019 21:43:57 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B8B591421; Wed, 27 Feb 2019 21:43:57 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from cerise.vangyzen.net (unknown [70.97.188.230]) by smtp.vangyzen.net (Postfix) with ESMTPSA id CB7E056468; Wed, 27 Feb 2019 15:43:48 -0600 (CST) From: Eric van Gyzen Message-Id: <93571A02-D75D-47AB-981F-5312D4B6BEDD@vangyzen.net> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344567 - in head: etc/mtree include sbin sbin/veriexec Date: Wed, 27 Feb 2019 15:43:47 -0600 In-Reply-To: Cc: Alexey Dokuchaev , "Rodney W. Grimes" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org To: Warner Losh References: <201902260617.x1Q6HOra098699@repo.freebsd.org> <201902260619.x1Q6Jjn2043418@pdx.rh.CN85.dnsmgr.net> <20190226134953.GB39566@FreeBSD.org> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 6B8B591421 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 21:43:58 -0000 > On Feb 26, 2019, at 10:17 PM, Warner Losh wrote: >=20 >=20 >=20 > On Tue, Feb 26, 2019, 6:50 AM Alexey Dokuchaev > wrote: > On Mon, Feb 25, 2019 at 10:19:45PM -0800, Rodney W. Grimes wrote: > > > Author: sjg > > > Date: Tue Feb 26 06:17:23 2019 > > > New Revision: 344567 > > > URL: https://svnweb.freebsd.org/changeset/base/344567 = > > >=20 > > > Log: > > > Add verifying manifest loader for mac_veriexec > > > =20 > > > This tool will verify a signed manifest and load contents into > > > mac_veriexec for storage > > > =20 > > > Sponsored by: Juniper Networks > > > Differential Revision: D16575 > >=20 > > Just a small nit, for future reference, from the template: > > > Differential Revision: https://reviews.freebsd.org/D### = > > (*full* phabric URL needed). >=20 > IMHO we should just fix the scripts to accept D#### alone, without > the URL. We don't do that for PR (bugzilla) references, and the fact > that we do for the phab is both needless and confusing. Also, that > URL might change one day while we could probably keep the old numbers > if we move. >=20 > When this came up before, it was an upstream decision to require the = full path. The reasoning is that Dxxxx space isn't unique and the review = may happen in a different instance of phab than the default one. When = those exact objections were raised, the experience of moving to bugzilla = was cited to show the URL can remain stable. And if we went to another = system's, we could keep the old in place and then we would need a new = URL to disambiguate. There were good reasons we decided this before. >=20 > So this has been litigated before, and the consensus was we needed to = break with the practice of not putting URLs in commit messages for these = reasons. I completely agree. In fact, I=E2=80=99d like to see full bugzilla URLs = in commit logs instead of just the bug number. Every app I use to read = commit logs will make URLs clickable, even my terminal emulator. The = fact that I have to manually open bugzilla and copy/type the bug number = is annoying. And yes, I volunteer to make the necessary changes to accept URLs in the = PR field. We just need consensus. Eric= From owner-svn-src-head@freebsd.org Wed Feb 27 21:52:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DC0F150638E; Wed, 27 Feb 2019 21:52:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11A7B91A51; Wed, 27 Feb 2019 21:52:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B8822DF3; Wed, 27 Feb 2019 21:52:08 +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 x1RLq86H050134; Wed, 27 Feb 2019 21:52:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RLq8SF050133; Wed, 27 Feb 2019 21:52:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902272152.x1RLq8SF050133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 27 Feb 2019 21:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344637 - head/sys/dev/drm2/radeon X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/drm2/radeon X-SVN-Commit-Revision: 344637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11A7B91A51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 21:52:09 -0000 Author: imp Date: Wed Feb 27 21:52:08 2019 New Revision: 344637 URL: https://svnweb.freebsd.org/changeset/base/344637 Log: Remove empty directories. Deleted: head/sys/dev/drm2/radeon/ From owner-svn-src-head@freebsd.org Wed Feb 27 22:01:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BEF715064F5; Wed, 27 Feb 2019 22:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4527491F06; Wed, 27 Feb 2019 22:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B15822E81; Wed, 27 Feb 2019 22:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RM1e1B056557; Wed, 27 Feb 2019 22:01:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RM1dPi056227; Wed, 27 Feb 2019 22:01:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201902272201.x1RM1dPi056227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Feb 2019 22:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344638 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 344638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4527491F06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 22:01:40 -0000 Author: manu Date: Wed Feb 27 22:01:39 2019 New Revision: 344638 URL: https://svnweb.freebsd.org/changeset/base/344638 Log: Fix armv6/armv7 build after the move from xhci_mv to generic_xhci Modified: head/sys/arm/mv/files.arm7 head/sys/arm/mv/files.mv Modified: head/sys/arm/mv/files.arm7 ============================================================================== --- head/sys/arm/mv/files.arm7 Wed Feb 27 21:52:08 2019 (r344637) +++ head/sys/arm/mv/files.arm7 Wed Feb 27 22:01:39 2019 (r344638) @@ -34,7 +34,7 @@ dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci -dev/usb/controller/xhci_mv.c optional xhci +dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci kern/kern_clocksource.c standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Wed Feb 27 21:52:08 2019 (r344637) +++ head/sys/arm/mv/files.mv Wed Feb 27 22:01:39 2019 (r344638) @@ -31,7 +31,7 @@ dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci -dev/usb/controller/xhci_mv.c optional xhci +dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci kern/kern_clocksource.c standard From owner-svn-src-head@freebsd.org Wed Feb 27 22:02:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C92E51506653; Wed, 27 Feb 2019 22:02:00 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 9BBEE9206A; Wed, 27 Feb 2019 22:01:59 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-qt1-f175.google.com with SMTP id v10so21182770qtp.8; Wed, 27 Feb 2019 14:01:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zQyWY58L3Lth7S4Qa0YSLUI7mp56Y6p2XEr+niGXIu4=; b=EGWRGPvOa88ewkJIfOc74AYh6q0jOdPUrFlipQ0bWZYnJkACYFeqlEPuqRBYFXIqtp /hjbRBRGaLN7SbUqqoBuxiejaZK5N2HdpF6YySFTPFO1AMJ3+vlSnUSgnOjmeEr4/zps Z6M1m52asylw4Gc6bLMxsblTU3yFL+jfycWQA+i30HjaY0E26PLHgcW/WrbUXtS1Qxpx 71r10OyqDbmGvcUIBST42vaSrUoDdItSwz4jS4ykBTc47CErJrJzgnbZ6jalem2rozbt pegSZoRFXKYtn4cwv1KgB/sx7ZtlXTjx3oHDUmCGJwzKU1SJdCltC34+YC5a10K4ZMh3 pFSw== X-Gm-Message-State: APjAAAVdHp0YdZVuDxBJd48GX3cDRR3+vCnJsebx8kAo0XRGM39X4gCa 3GNsU1SiidHXS70kNOZhJIIf0j2Daj0= X-Google-Smtp-Source: APXvYqzdEUPk+GvIlbZ+DoQQp6zoZAMrK7HgMam5gI4CTMFYx7BKs4s9yf3JoYaceTCuJguLDexcAA== X-Received: by 2002:a0c:98c8:: with SMTP id g8mr3872508qvd.161.1551304913516; Wed, 27 Feb 2019 14:01:53 -0800 (PST) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com. [209.85.222.169]) by smtp.gmail.com with ESMTPSA id u32sm18166764qtc.54.2019.02.27.14.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 14:01:53 -0800 (PST) Received: by mail-qk1-f169.google.com with SMTP id c2so10157385qkb.3; Wed, 27 Feb 2019 14:01:53 -0800 (PST) X-Received: by 2002:a37:c301:: with SMTP id a1mr4130046qkj.76.1551304913048; Wed, 27 Feb 2019 14:01:53 -0800 (PST) MIME-Version: 1.0 References: <201902251503.x1PF3otL011409@repo.freebsd.org> <9F0A25DA-E0D2-4F96-91AF-4648367E3E5F@gmail.com> In-Reply-To: <9F0A25DA-E0D2-4F96-91AF-4648367E3E5F@gmail.com> From: Mateusz Piotrowski <0mp@freebsd.org> Date: Wed, 27 Feb 2019 23:01:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344518 - head/share/man/man9 To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 9BBEE9206A X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-4.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; RCVD_IN_DNSWL_NONE(0.00)[175.160.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER(0.30)[0mp@freebsd.org,mpp302@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@freebsd.org,mpp302@gmail.com]; IP_SCORE(-1.74)[ip: (-2.79), ipnet: 209.85.128.0/17(-3.81), asn: 15169(-2.02), country: US(-0.07)] 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, 27 Feb 2019 22:02:01 -0000 On Mon, 25 Feb 2019 at 16:12, Enji Cooper wrote: > > > On Feb 25, 2019, at 07:03, Mateusz Piotrowski <0mp@freebsd.org> wrote: > > > > Author: 0mp (ports committer) > > Date: Mon Feb 25 15:03:50 2019 > > New Revision: 344518 > > URL: https://svnweb.freebsd.org/changeset/base/344518 > > > > Log: > > Add missing types to the sysctl(9) manual page > > > > Update the diff to include other missing sysctl types found in sysctl.h. > > > > Some of these sysctls are already documented in other pages (e.g > counter(9) > > and ZONE(9)), but they should at least be mentioned here for > completeness. > > > > This patch now documents all of the following: > > - SYSCTL_BOOL/SYSCTL_ADD_BOOL > > - SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64 > > - SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY > > - SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC > > - SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC > > - SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR > > - SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX > [...] > > Modified: > > head/share/man/man9/sysctl.9 > > ... > > > @@ -52,10 +57,15 @@ > > .Nm SYSCTL_ADD_UINT , > > +.Nm SYSCTL_UMA_MAX > > Quick nit: UMA sorts before UQUAD. > > Also, these APIs deserve manpage links via MLINKS. > I'll submit a patch for this soon. Thank you! From owner-svn-src-head@freebsd.org Wed Feb 27 22:05:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE0EC15068E6; Wed, 27 Feb 2019 22:05: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9131192631; Wed, 27 Feb 2019 22:05:02 +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 86F6F22FEA; Wed, 27 Feb 2019 22:05:02 +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 x1RM52Wb057879; Wed, 27 Feb 2019 22:05:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RM52Cc057875; Wed, 27 Feb 2019 22:05:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902272205.x1RM52Cc057875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 27 Feb 2019 22:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344640 - 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: 344640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9131192631 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 22:05:03 -0000 Author: imp Date: Wed Feb 27 22:05:01 2019 New Revision: 344640 URL: https://svnweb.freebsd.org/changeset/base/344640 Log: Remove #ifdef code to support FreeBSD versions that haven't been supported in years. A number of changes have been made to the driver that likely wouldn't work on those older versions that aren't properly ifdef'd and it's project policy to GC such code once it is stale. Modified: head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_test.c Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Wed Feb 27 22:02:46 2019 (r344639) +++ head/sys/dev/nvme/nvme_private.h Wed Feb 27 22:05:01 2019 (r344640) @@ -349,11 +349,6 @@ struct nvme_controller { (val & 0xFFFFFFFF00000000ULL) >> 32); \ } while (0); -#if __FreeBSD_version < 800054 -#define wmb() __asm volatile("sfence" ::: "memory") -#define mb() __asm volatile("mfence" ::: "memory") -#endif - #define nvme_printf(ctrlr, fmt, args...) \ device_printf(ctrlr->dev, fmt, ##args) Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Wed Feb 27 22:02:46 2019 (r344639) +++ head/sys/dev/nvme/nvme_qpair.c Wed Feb 27 22:05:01 2019 (r344640) @@ -823,13 +823,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st ctrlr = qpair->ctrlr; if (req->timeout) -#if __FreeBSD_version >= 800030 callout_reset_curcpu(&tr->timer, ctrlr->timeout_period * hz, nvme_timeout, tr); -#else - callout_reset(&tr->timer, ctrlr->timeout_period * hz, - nvme_timeout, tr); -#endif /* Copy the command from the tracker to the submission queue. */ memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); Modified: head/sys/dev/nvme/nvme_test.c ============================================================================== --- head/sys/dev/nvme/nvme_test.c Wed Feb 27 22:02:46 2019 (r344639) +++ head/sys/dev/nvme/nvme_test.c Wed Feb 27 22:05:01 2019 (r344640) @@ -94,9 +94,7 @@ nvme_ns_bio_test(void *arg) struct timeval t; uint64_t io_completed = 0, offset; uint32_t idx; -#if __FreeBSD_version >= 900017 int ref; -#endif buf = malloc(io_test->size, M_NVME, M_WAITOK); idx = atomic_fetchadd_int(&io_test->td_idx, 1); @@ -118,11 +116,7 @@ nvme_ns_bio_test(void *arg) bio->bio_bcount = io_test->size; if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) { -#if __FreeBSD_version >= 900017 csw = dev_refthread(dev, &ref); -#else - csw = dev_refthread(dev); -#endif } else csw = dev->si_devsw; @@ -133,11 +127,7 @@ nvme_ns_bio_test(void *arg) mtx_unlock(mtx); if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) { -#if __FreeBSD_version >= 900017 dev_relthread(dev, ref); -#else - dev_relthread(dev); -#endif } if ((bio->bio_flags & BIO_ERROR) || (bio->bio_resid > 0)) @@ -166,11 +156,7 @@ nvme_ns_bio_test(void *arg) atomic_subtract_int(&io_test->td_active, 1); mb(); -#if __FreeBSD_version >= 800000 kthread_exit(); -#else - kthread_exit(0); -#endif } static void @@ -246,11 +232,7 @@ nvme_ns_io_test(void *arg) atomic_subtract_int(&io_test->td_active, 1); mb(); -#if __FreeBSD_version >= 800004 kthread_exit(); -#else - kthread_exit(0); -#endif } void @@ -287,13 +269,8 @@ nvme_ns_test(struct nvme_namespace *ns, u_long cmd, ca getmicrouptime(&io_test_internal->start); for (i = 0; i < io_test->num_threads; i++) -#if __FreeBSD_version >= 800004 kthread_add(fn, io_test_internal, NULL, NULL, 0, 0, "nvme_io_test[%d]", i); -#else - kthread_create(fn, io_test_internal, - NULL, 0, 0, "nvme_io_test[%d]", i); -#endif tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz); From owner-svn-src-head@freebsd.org Wed Feb 27 22:17:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C86491506FEB; Wed, 27 Feb 2019 22:17:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F3E0931F0; Wed, 27 Feb 2019 22:17:00 +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 5D0DC23192; Wed, 27 Feb 2019 22:17:00 +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 x1RMH0H6064182; Wed, 27 Feb 2019 22:17:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RMGxjY064173; Wed, 27 Feb 2019 22:16:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902272216.x1RMGxjY064173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 27 Feb 2019 22:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344642 - 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: 344642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F3E0931F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 22:17:01 -0000 Author: imp Date: Wed Feb 27 22:16:59 2019 New Revision: 344642 URL: https://svnweb.freebsd.org/changeset/base/344642 Log: Unconditionally support unmapped BIOs. This was another shim for supporting older kernels. However, all supported versions of FreeBSD have unmapped I/Os (as do several that have gone EOL), remove it. It's unlikely the driver would work on the older kernels anyway at this point. Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ns.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Feb 27 22:12:04 2019 (r344641) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Feb 27 22:16:59 2019 (r344642) @@ -1056,11 +1056,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr buf->b_data = pt->buf; buf->b_bufsize = pt->len; buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; -#ifdef NVME_UNMAPPED_BIO_SUPPORT if (vmapbuf(buf, 1) < 0) { -#else - if (vmapbuf(buf) < 0) { -#endif ret = EFAULT; goto err; } Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Wed Feb 27 22:12:04 2019 (r344641) +++ head/sys/dev/nvme/nvme_ns.c Wed Feb 27 22:16:59 2019 (r344642) @@ -357,10 +357,8 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali caddr_t data; uint32_t rem_bcount; int i; -#ifdef NVME_UNMAPPED_BIO_SUPPORT struct vm_page **ma; uint32_t ma_offset; -#endif *num_bios = nvme_get_num_segments(bp->bio_offset, bp->bio_bcount, alignment); @@ -373,10 +371,8 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali cur_offset = bp->bio_offset; rem_bcount = bp->bio_bcount; data = bp->bio_data; -#ifdef NVME_UNMAPPED_BIO_SUPPORT ma_offset = bp->bio_ma_offset; ma = bp->bio_ma; -#endif for (i = 0; i < *num_bios; i++) { child = child_bios[i]; @@ -386,7 +382,6 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali child->bio_bcount = min(rem_bcount, alignment - (cur_offset & (alignment - 1))); child->bio_flags = bp->bio_flags; -#ifdef NVME_UNMAPPED_BIO_SUPPORT if (bp->bio_flags & BIO_UNMAPPED) { child->bio_ma_offset = ma_offset; child->bio_ma = ma; @@ -398,9 +393,7 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali ma += child->bio_ma_n; if (ma_offset != 0) ma -= 1; - } else -#endif - { + } else { child->bio_data = data; data += child->bio_bcount; } @@ -599,9 +592,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t if (res != 0) return (ENXIO); -#ifdef NVME_UNMAPPED_BIO_SUPPORT ns->cdev->si_flags |= SI_UNMAPPED; -#endif return (0); } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Wed Feb 27 22:12:04 2019 (r344641) +++ head/sys/dev/nvme/nvme_private.h Wed Feb 27 22:16:59 2019 (r344642) @@ -112,16 +112,6 @@ MALLOC_DECLARE(M_NVME); #define CACHE_LINE_SIZE (64) #endif -/* - * Use presence of the BIO_UNMAPPED flag to determine whether unmapped I/O - * support and the bus_dmamap_load_bio API are available on the target - * kernel. This will ease porting back to earlier stable branches at a - * later point. - */ -#ifdef BIO_UNMAPPED -#define NVME_UNMAPPED_BIO_SUPPORT -#endif - extern uma_zone_t nvme_request_zone; extern int32_t nvme_retry_count; @@ -134,9 +124,7 @@ struct nvme_completion_poll_status { #define NVME_REQUEST_VADDR 1 #define NVME_REQUEST_NULL 2 /* For requests with no payload. */ #define NVME_REQUEST_UIO 3 -#ifdef NVME_UNMAPPED_BIO_SUPPORT #define NVME_REQUEST_BIO 4 -#endif #define NVME_REQUEST_CCB 5 struct nvme_request { @@ -506,14 +494,8 @@ nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_ req = _nvme_allocate_request(cb_fn, cb_arg); if (req != NULL) { -#ifdef NVME_UNMAPPED_BIO_SUPPORT req->type = NVME_REQUEST_BIO; req->u.bio = bio; -#else - req->type = NVME_REQUEST_VADDR; - req->u.payload = bio->bio_data; - req->payload_size = bio->bio_bcount; -#endif } return (req); } Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Wed Feb 27 22:12:04 2019 (r344641) +++ head/sys/dev/nvme/nvme_qpair.c Wed Feb 27 22:16:59 2019 (r344642) @@ -954,7 +954,6 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, s case NVME_REQUEST_NULL: nvme_qpair_submit_tracker(tr->qpair, tr); break; -#ifdef NVME_UNMAPPED_BIO_SUPPORT case NVME_REQUEST_BIO: KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, ("bio->bio_bcount (%jd) exceeds max_xfer_size (%d)\n", @@ -966,7 +965,6 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, s nvme_printf(qpair->ctrlr, "bus_dmamap_load_bio returned 0x%x!\n", err); break; -#endif case NVME_REQUEST_CCB: err = bus_dmamap_load_ccb(tr->qpair->dma_tag_payload, tr->payload_dma_map, req->u.payload, From owner-svn-src-head@freebsd.org Wed Feb 27 22:26:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A80615073BA; Wed, 27 Feb 2019 22:26:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B58CC937C7; Wed, 27 Feb 2019 22:26:18 +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 AA94123346; Wed, 27 Feb 2019 22:26:18 +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 x1RMQIJi069173; Wed, 27 Feb 2019 22:26:18 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RMQIf8069172; Wed, 27 Feb 2019 22:26:18 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201902272226.x1RMQIf8069172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 27 Feb 2019 22:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344643 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 344643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B58CC937C7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 27 Feb 2019 22:26:19 -0000 Author: erj Date: Wed Feb 27 22:26:18 2019 New Revision: 344643 URL: https://svnweb.freebsd.org/changeset/base/344643 Log: ixgbe(4): Fix panic triggered by assertion from interrupt r344162 exposed a bug in one of ixgbe's interrupt filters; they are never supposed to return 0. Fix the interrupt filter to return the proper nonzero return value. Reported by: Oleg Ginzburg MFC after: 1 week Sponsored by: Intel Corporation Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Feb 27 22:16:59 2019 (r344642) +++ head/sys/dev/ixgbe/if_ix.c Wed Feb 27 22:26:18 2019 (r344643) @@ -2064,7 +2064,7 @@ ixgbe_msix_que(void *arg) /* Protect against spurious interrupts */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return 0; + return (FILTER_HANDLED); ixgbe_disable_queue(adapter, que->msix); ++que->irqs; From owner-svn-src-head@freebsd.org Wed Feb 27 22:42:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1A3F1507CB0; Wed, 27 Feb 2019 22:42:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 707E1946F0; Wed, 27 Feb 2019 22:42:30 +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 65ABE236B9; Wed, 27 Feb 2019 22:42:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RMgUML078819; Wed, 27 Feb 2019 22:42:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RMgUXS078804; Wed, 27 Feb 2019 22:42:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201902272242.x1RMgUXS078804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 27 Feb 2019 22:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344647 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 344647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 707E1946F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 22:42:31 -0000 Author: mjg Date: Wed Feb 27 22:42:29 2019 New Revision: 344647 URL: https://svnweb.freebsd.org/changeset/base/344647 Log: vm: remove seq.h inclusion made obsolete by NUMA rewrite Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed Feb 27 22:29:37 2019 (r344646) +++ head/sys/vm/vm_phys.c Wed Feb 27 22:42:29 2019 (r344647) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include From owner-svn-src-head@freebsd.org Wed Feb 27 22:56:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF8E15081CC; Wed, 27 Feb 2019 22:56:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8389294EA7; Wed, 27 Feb 2019 22:56:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 573EC23868; Wed, 27 Feb 2019 22:56:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1RMuuF6085220; Wed, 27 Feb 2019 22:56:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1RMutdK085216; Wed, 27 Feb 2019 22:56:55 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201902272256.x1RMutdK085216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 27 Feb 2019 22:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344648 - in head: . sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: . sys/kern sys/sys X-SVN-Commit-Revision: 344648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8389294EA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 22:56:57 -0000 Author: mjg Date: Wed Feb 27 22:56:55 2019 New Revision: 344648 URL: https://svnweb.freebsd.org/changeset/base/344648 Log: Rename seq to seqc to avoid namespace clashes with Linux Linux generates the content of procfs files using a mechanism prefixed with seq_*. This in particular came up with recent gcov import. Sponsored by: The FreeBSD Foundation Added: head/sys/sys/seqc.h (contents, props changed) Deleted: head/sys/sys/seq.h Modified: head/ObsoleteFiles.inc head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Feb 27 22:42:29 2019 (r344647) +++ head/ObsoleteFiles.inc Wed Feb 27 22:56:55 2019 (r344648) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190227: rename seq.h to seqc.h +OLD_FILES+=usr/include/sys/seq.h # 20190222: libifconfig made INTERNALLIB OLD_FILES+=usr/lib/libprivateifconfig.a OLD_FILES+=usr/lib/libprivateifconfig_p.a Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 27 22:42:29 2019 (r344647) +++ head/sys/kern/kern_descrip.c Wed Feb 27 22:56:55 2019 (r344648) @@ -304,11 +304,11 @@ fdfree(struct filedesc *fdp, int fd) fde = &fdp->fd_ofiles[fd]; #ifdef CAPABILITIES - seq_write_begin(&fde->fde_seq); + seqc_write_begin(&fde->fde_seqc); #endif fde->fde_file = NULL; #ifdef CAPABILITIES - seq_write_end(&fde->fde_seq); + seqc_write_end(&fde->fde_seqc); #endif fdefree_last(fde); fdunused(fdp, fd); @@ -908,7 +908,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int * Duplicate the source descriptor. */ #ifdef CAPABILITIES - seq_write_begin(&newfde->fde_seq); + seqc_write_begin(&newfde->fde_seqc); #endif memcpy(newfde, oldfde, fde_change_size); filecaps_copy_finish(&oldfde->fde_caps, &newfde->fde_caps, @@ -918,7 +918,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int else newfde->fde_flags = oldfde->fde_flags & ~UF_EXCLOSE; #ifdef CAPABILITIES - seq_write_end(&newfde->fde_seq); + seqc_write_end(&newfde->fde_seqc); #endif td->td_retval[0] = new; @@ -1876,7 +1876,7 @@ _finstall(struct filedesc *fdp, struct file *fp, int f fde = &fdp->fd_ofiles[fd]; #ifdef CAPABILITIES - seq_write_begin(&fde->fde_seq); + seqc_write_begin(&fde->fde_seqc); #endif fde->fde_file = fp; fde->fde_flags = (flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0; @@ -1885,7 +1885,7 @@ _finstall(struct filedesc *fdp, struct file *fp, int f else filecaps_fill(&fde->fde_caps); #ifdef CAPABILITIES - seq_write_end(&fde->fde_seq); + seqc_write_end(&fde->fde_seqc); #endif } @@ -2567,7 +2567,7 @@ fget_cap(struct thread *td, int fd, cap_rights_t *need filecaps_fill(havecapsp); #else struct file *fp; - seq_t seq; + seqc_t seq; for (;;) { error = fget_unlocked(fdp, fd, needrightsp, &fp, &seq); @@ -2602,7 +2602,7 @@ get_locked: int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - struct file **fpp, seq_t *seqp) + struct file **fpp, seqc_t *seqp) { #ifdef CAPABILITIES const struct filedescent *fde; @@ -2611,7 +2611,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights struct file *fp; u_int count; #ifdef CAPABILITIES - seq_t seq; + seqc_t seq; cap_rights_t haverights; int error; #endif @@ -2629,11 +2629,11 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ for (;;) { #ifdef CAPABILITIES - seq = seq_load(fd_seq(fdt, fd)); + seq = seqc_read(fd_seqc(fdt, fd)); fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; - if (!seq_consistent(fd_seq(fdt, fd), seq)) + if (!seqc_consistent(fd_seqc(fdt, fd), seq)) continue; #else fp = fdt->fdt_ofiles[fd].fde_file; @@ -2664,7 +2664,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights goto retry; fdt = fdp->fd_files; #ifdef CAPABILITIES - if (seq_consistent_nomb(fd_seq(fdt, fd), seq)) + if (seqc_consistent_nomb(fd_seqc(fdt, fd), seq)) #else if (fp == fdt->fdt_ofiles[fd].fde_file) #endif @@ -2695,7 +2695,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ static __inline int _fget(struct thread *td, int fd, struct file **fpp, int flags, - cap_rights_t *needrightsp, seq_t *seqp) + cap_rights_t *needrightsp, seqc_t *seqp) { struct filedesc *fdp; struct file *fp; @@ -2759,7 +2759,7 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig *maxprotp = VM_PROT_ALL; #else struct filedesc *fdp = td->td_proc->p_fd; - seq_t seq; + seqc_t seq; MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); for (;;) { @@ -2802,7 +2802,7 @@ fget_fcntl(struct thread *td, int fd, cap_rights_t *ri return (fget_unlocked(fdp, fd, rightsp, fpp, NULL)); #else int error; - seq_t seq; + seqc_t seq; MPASS(cap_rights_is_set(rightsp, CAP_FCNTL)); for (;;) { @@ -3046,13 +3046,13 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int oldfde = &fdp->fd_ofiles[dfd]; ioctls = filecaps_copy_prep(&oldfde->fde_caps); #ifdef CAPABILITIES - seq_write_begin(&newfde->fde_seq); + seqc_write_begin(&newfde->fde_seqc); #endif memcpy(newfde, oldfde, fde_change_size); filecaps_copy_finish(&oldfde->fde_caps, &newfde->fde_caps, ioctls); #ifdef CAPABILITIES - seq_write_end(&newfde->fde_seq); + seqc_write_end(&newfde->fde_seqc); #endif break; case ENXIO: @@ -3062,13 +3062,13 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int newfde = &fdp->fd_ofiles[indx]; oldfde = &fdp->fd_ofiles[dfd]; #ifdef CAPABILITIES - seq_write_begin(&newfde->fde_seq); + seqc_write_begin(&newfde->fde_seqc); #endif memcpy(newfde, oldfde, fde_change_size); oldfde->fde_file = NULL; fdunused(fdp, dfd); #ifdef CAPABILITIES - seq_write_end(&newfde->fde_seq); + seqc_write_end(&newfde->fde_seqc); #endif break; } Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Wed Feb 27 22:42:29 2019 (r344647) +++ head/sys/sys/filedesc.h Wed Feb 27 22:56:55 2019 (r344648) @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -56,19 +56,19 @@ struct filedescent { struct file *fde_file; /* file structure for open file */ struct filecaps fde_caps; /* per-descriptor rights */ uint8_t fde_flags; /* per-process open file flags */ - seq_t fde_seq; /* keep file and caps in sync */ + seqc_t fde_seqc; /* keep file and caps in sync */ }; #define fde_rights fde_caps.fc_rights #define fde_fcntls fde_caps.fc_fcntls #define fde_ioctls fde_caps.fc_ioctls #define fde_nioctls fde_caps.fc_nioctls -#define fde_change_size (offsetof(struct filedescent, fde_seq)) +#define fde_change_size (offsetof(struct filedescent, fde_seqc)) struct fdescenttbl { int fdt_nfiles; /* number of open files allocated */ struct filedescent fdt_ofiles[0]; /* open files */ }; -#define fd_seq(fdt, fd) (&(fdt)->fdt_ofiles[(fd)].fde_seq) +#define fd_seqc(fdt, fd) (&(fdt)->fdt_ofiles[(fd)].fde_seqc) /* * This structure is used for the management of descriptors. It may be @@ -205,7 +205,7 @@ int fget_cap(struct thread *td, int fd, cap_rights_t * /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, - struct file **fpp, seq_t *seqp); + struct file **fpp, seqc_t *seqp); /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * @@ -239,10 +239,10 @@ fdeget_locked(struct filedesc *fdp, int fd) #ifdef CAPABILITIES static __inline bool -fd_modified(struct filedesc *fdp, int fd, seq_t seq) +fd_modified(struct filedesc *fdp, int fd, seqc_t seqc) { - return (!seq_consistent(fd_seq(fdp->fd_files, fd), seq)); + return (!seqc_consistent(fd_seqc(fdp->fd_files, fd), seqc)); } #endif Added: head/sys/sys/seqc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/seqc.h Wed Feb 27 22:56:55 2019 (r344648) @@ -0,0 +1,156 @@ +/*- + * Copyright (c) 2014 Mateusz Guzik + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_SEQC_H_ +#define _SYS_SEQC_H_ + +#ifdef _KERNEL +#include +#endif +#include + +/* + * seqc_t may be included in structs visible to userspace + */ +typedef uint32_t seqc_t; + +#ifdef _KERNEL + +/* + * seqc allows readers and writers to work with a consistent snapshot. Modifying + * operations must be enclosed within a transaction delineated by + * seqc_write_beg/seqc_write_end. The trick works by having the writer increment + * the seqcuence number twice, at the beginning and end of the transaction. + * The reader detects that the seqcuence number has not changed between its start + * and end, and that the seqcuence number is even, to validate consistency. + * + * Some fencing (both hard fencing and compiler barriers) may be needed, + * depending on the cpu. Modern AMD cpus provide strong enough guarantees to not + * require any fencing by the reader or writer. + * + * Example usage: + * + * writers: + * lock_exclusive(&obj->lock); + * seqc_write_begin(&obj->seqc); + * obj->var1 = ...; + * obj->var2 = ...; + * seqc_write_end(&obj->seqc); + * unlock_exclusive(&obj->lock); + * + * readers: + * int var1, var2; + * seqc_t seqc; + * + * for (;;) { + * seqc = seqc_read(&obj->seqc); + * var1 = obj->var1; + * var2 = obj->var2; + * if (seqc_consistent(&obj->seqc, seqc)) + * break; + * } + * ..... + * + * Writers may not block or sleep in any way. + * + * There are 2 minor caveats in this implementation: + * + * 1. There is no guarantee of progress. That is, a large number of writers can + * interfere with the execution of the readers and cause the code to live-lock + * in a loop trying to acquire a consistent snapshot. + * + * 2. If the reader loops long enough, the counter may overflow and eventually + * wrap back to its initial value, fooling the reader into accepting the + * snapshot. Given that this needs 4 billion transactional writes across a + * single contended reader, it is unlikely to ever happen. + */ + +/* A hack to get MPASS macro */ +#include + +#include + +static __inline bool +seqc_in_modify(seqc_t seqcp) +{ + + return (seqcp & 1); +} + +static __inline void +seqc_write_begin(seqc_t *seqcp) +{ + + critical_enter(); + MPASS(!seqc_in_modify(*seqcp)); + *seqcp += 1; + atomic_thread_fence_rel(); +} + +static __inline void +seqc_write_end(seqc_t *seqcp) +{ + + atomic_store_rel_int(seqcp, *seqcp + 1); + MPASS(!seqc_in_modify(*seqcp)); + critical_exit(); +} + +static __inline seqc_t +seqc_read(const seqc_t *seqcp) +{ + seqc_t ret; + + for (;;) { + ret = atomic_load_acq_int(__DECONST(seqc_t *, seqcp)); + if (seqc_in_modify(ret)) { + cpu_spinwait(); + continue; + } + break; + } + + return (ret); +} + +static __inline seqc_t +seqc_consistent_nomb(const seqc_t *seqcp, seqc_t oldseqc) +{ + + return (*seqcp == oldseqc); +} + +static __inline seqc_t +seqc_consistent(const seqc_t *seqcp, seqc_t oldseqc) +{ + + atomic_thread_fence_acq(); + return (seqc_consistent_nomb(seqcp, oldseqc)); +} + +#endif /* _KERNEL */ +#endif /* _SYS_SEQC_H_ */ From owner-svn-src-head@freebsd.org Thu Feb 28 00:42:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBA3D150AD2B; Thu, 28 Feb 2019 00:42:19 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 DCBDE6A364; Thu, 28 Feb 2019 00:42:18 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-qk1-f177.google.com with SMTP id y15so11084590qki.8; Wed, 27 Feb 2019 16:42:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hwebM+DdxqXJSrkdrzvNzkHlfBgLyneH0jAZbvTtlEw=; b=mO366rCKZQF5ale/BQMUJWs8FA0kZH6BNasJ8f6my5eHGIV4Ib0tGbkQhQFE9LJB52 +Hpan9to5L9r9HeO2kqQ2+lT4hlYBh9jyjO7P61u2fAfdwzHZQfYoVehnLGzX9SEz+Ca MB+jy8JmlOv6skUrm94i5fWiNy7mM8bYlgxdOuIIKEbCBBCroL7ZENEy1XyZeWwLKhWr tJq5xn+DTIWem3CtKR4w442m+C+hDEYrV8ZCPcOpkBnxm7zxy3vRY/R60Tw9GkYRHxin HCi2fLMuEekJ0jINztG4TAhlt7jofTeaQwbOuOMzXZX4fuI64B/LrQ0qCb5xRiDc1xTU Vgrg== X-Gm-Message-State: AHQUAuboNrLWIXsVf7imLe5dlx2aEIt/R4B2TubnuhhjJnSdLwOTtY5o AFJyB3PM5afS4jnaaLkwamPaKXra/CE= X-Google-Smtp-Source: AHgI3IadgJ5FbMg3ja+PmY2jykdCrIF+vsO/GbE7WBF1BwWiriUEpZES9t7wHTxnEeSi4PDIz8uoag== X-Received: by 2002:a37:4b4e:: with SMTP id y75mr4036155qka.158.1551304759932; Wed, 27 Feb 2019 13:59:19 -0800 (PST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com. [209.85.160.178]) by smtp.gmail.com with ESMTPSA id b142sm13623414qka.74.2019.02.27.13.59.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 13:59:19 -0800 (PST) Received: by mail-qt1-f178.google.com with SMTP id s1so21197311qte.5; Wed, 27 Feb 2019 13:59:19 -0800 (PST) X-Received: by 2002:a0c:9e6b:: with SMTP id z43mr3883507qve.131.1551304759479; Wed, 27 Feb 2019 13:59:19 -0800 (PST) MIME-Version: 1.0 References: <201902260928.x1Q9SBp7098439@repo.freebsd.org> <201902261247.x1QClxsH044906@pdx.rh.CN85.dnsmgr.net> <20190226225256.GA31931@stack.nl> In-Reply-To: <20190226225256.GA31931@stack.nl> From: Mateusz Piotrowski <0mp@freebsd.org> Date: Wed, 27 Feb 2019 22:59:06 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344570 - head/usr.sbin/sysrc To: Jilles Tjoelker Cc: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: DCBDE6A364 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-4.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.91)[-0.907,0]; RCVD_IN_DNSWL_NONE(0.00)[177.222.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.18)[ipnet: 209.85.128.0/17(-3.81), asn: 15169(-2.02), country: US(-0.07)]; FORGED_SENDER(0.30)[0mp@freebsd.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[177.222.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+,1:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@freebsd.org,mpp302@gmail.com] 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: Thu, 28 Feb 2019 00:42:20 -0000 On Tue, 26 Feb 2019 at 23:53, Jilles Tjoelker wrote: > On Tue, Feb 26, 2019 at 04:47:59AM -0800, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > Author: 0mp (ports committer) > > > Date: Tue Feb 26 09:28:10 2019 > > > New Revision: 344570 > > > URL: https://svnweb.freebsd.org/changeset/base/344570 > > > > Log: > > > sysrc.8: Pet igor and mandoc > > > This only tells the source of why you changed some, > > a good commit log entry tells me that, and what it > > is that you changed. You normally do not need to > > name the file your changed in a commit log as the > > log is attached to the file, sometimes it does make > > since to mention a file name in a log entry when you > > are describing the changes to just that file in a > > commit that includes many files. > > > A better log might of been: > > Pet igor and mandoc. Remove unneeded .Li, use .Fx as needed, > > escape hard stop, and sort cross references. > Alright! Thank you for a review ;) I'll be more precise next time. Naming the affected area, file or directory can be useful to make the > commit message understandable outside of its file's context without > needing to look at the diff or list of changed files. Even better, there > is a convention of making the first line of the commit message a > summary. When following this convention, displaying just the first line > of each commit's message allows a good overview of recent changes in the > whole tree. > I like it as well. From owner-svn-src-head@freebsd.org Thu Feb 28 02:29:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A010315110EF; Thu, 28 Feb 2019 02:29:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46F1F70214; Thu, 28 Feb 2019 02:29: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 37B14262B3; Thu, 28 Feb 2019 02:29: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 x1S2TnHO001242; Thu, 28 Feb 2019 02:29:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1S2Tn1U001241; Thu, 28 Feb 2019 02:29:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201902280229.x1S2Tn1U001241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 28 Feb 2019 02:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344653 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 344653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46F1F70214 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.86)[-0.864,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 02:29:49 -0000 Author: imp Date: Thu Feb 28 02:29:48 2019 New Revision: 344653 URL: https://svnweb.freebsd.org/changeset/base/344653 Log: Add SPDX tag. Modified: head/sbin/nvmecontrol/nc_util.c Modified: head/sbin/nvmecontrol/nc_util.c ============================================================================== --- head/sbin/nvmecontrol/nc_util.c Thu Feb 28 00:30:34 2019 (r344652) +++ head/sbin/nvmecontrol/nc_util.c Thu Feb 28 02:29:48 2019 (r344653) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2017 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Thu Feb 28 05:45:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EDB41519E66; Thu, 28 Feb 2019 05:45:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0D3277C07; Thu, 28 Feb 2019 05:45:14 +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 BB8BC63A; Thu, 28 Feb 2019 05:45:14 +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 x1S5jELA007183; Thu, 28 Feb 2019 05:45:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1S5jEA4007182; Thu, 28 Feb 2019 05:45:14 GMT (envelope-from np@FreeBSD.org) Message-Id: <201902280545.x1S5jEA4007182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 28 Feb 2019 05:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344654 - 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: 344654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0D3277C07 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 05:45:15 -0000 Author: np Date: Thu Feb 28 05:45:14 2019 New Revision: 344654 URL: https://svnweb.freebsd.org/changeset/base/344654 Log: cxgbe(4): Request high priority filter support explicitly, as required by recent firmwares. MFC after: 1 week 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 Thu Feb 28 02:29:48 2019 (r344653) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 28 05:45:14 2019 (r344654) @@ -608,6 +608,7 @@ static int cfg_itype_and_nqueues(struct adapter *, str static int contact_firmware(struct adapter *); static int partition_resources(struct adapter *); static int get_params__pre_init(struct adapter *); +static int set_params__pre_init(struct adapter *); static int get_params__post_init(struct adapter *); static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); @@ -3955,6 +3956,7 @@ apply_cfg_and_initialize(struct adapter *sc, char *cfg } t4_tweak_chip_settings(sc); + set_params__pre_init(sc); /* get basic stuff going */ rc = -t4_fw_initialize(sc, sc->mbox); @@ -4077,6 +4079,35 @@ get_params__pre_init(struct adapter *sc) } /* + * Any params that need to be set before FW_INITIALIZE. + */ +static int +set_params__pre_init(struct adapter *sc) +{ + int rc = 0; + uint32_t param, val; + + if (chip_id(sc) >= CHELSIO_T6) { + param = FW_PARAM_DEV(HPFILTER_REGION_SUPPORT); + val = 1; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + /* firmwares < 1.20.1.0 do not have this param. */ + if (rc == FW_EINVAL && sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + rc = 0; + } + if (rc != 0) { + device_printf(sc->dev, + "failed to enable high priority filters :%d.\n", + rc); + } + } + + return (rc); +} + +/* * Retrieve various parameters that are of interest to the driver. The device * has been initialized by the firmware at this point. */ @@ -4118,20 +4149,6 @@ get_params__post_init(struct adapter *sc) sc->params.core_vdd = val[6]; if (chip_id(sc) >= CHELSIO_T6) { - -#ifdef INVARIANTS - if (sc->params.fw_vers >= - (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | - V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { - /* - * Note that the code to enable the region should run - * before t4_fw_initialize and not here. This is just a - * reminder to add said code. - */ - device_printf(sc->dev, - "hpfilter region not enabled.\n"); - } -#endif sc->tids.tid_base = t4_read_reg(sc, A_LE_DB_ACTIVE_TABLE_START_INDEX); From owner-svn-src-head@freebsd.org Thu Feb 28 07:47:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE6315201CF; Thu, 28 Feb 2019 07:47:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2187F8503B; Thu, 28 Feb 2019 07:47:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 12F84C7F0; Thu, 28 Feb 2019 07:47:51 +0000 (UTC) Date: Thu, 28 Feb 2019 07:47:51 +0000 From: Alexey Dokuchaev To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys Message-ID: <20190228074750.GA35369@FreeBSD.org> References: <201902272256.x1RMutdK085216@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201902272256.x1RMutdK085216@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 2187F8503B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 07:47:51 -0000 On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > New Revision: 344648 > URL: https://svnweb.freebsd.org/changeset/base/344648 > > Log: > Rename seq to seqc to avoid namespace clashes with Linux > > ... > Added: > head/sys/sys/seqc.h (contents, props changed) > Deleted: > head/sys/sys/seq.h Why it was deleted and added as new file instead of being repocopied? ./danfe From owner-svn-src-head@freebsd.org Thu Feb 28 09:13:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912B215234C8; Thu, 28 Feb 2019 09:13:42 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4608845D; Thu, 28 Feb 2019 09:13:42 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F3232A91; Thu, 28 Feb 2019 09:13:42 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1S9DfuG016523; Thu, 28 Feb 2019 09:13:41 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1S9DfNX016522; Thu, 28 Feb 2019 09:13:41 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <201902280913.x1S9DfNX016522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Thu, 28 Feb 2019 09:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344656 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 344656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F4608845D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 09:13:42 -0000 Author: tmunro Date: Thu Feb 28 09:13:41 2019 New Revision: 344656 URL: https://svnweb.freebsd.org/changeset/base/344656 Log: truss: Add support for fsync(2) and fdatasync(2). The default handling showed the argument as hex. Add explicit handling so we can show it as decimal, since that's how we show file descriptors everywhere else. Approved by: mjg (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19295 Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Feb 28 06:53:18 2019 (r344655) +++ head/usr.bin/truss/syscalls.c Thu Feb 28 09:13:41 2019 (r344656) @@ -231,6 +231,8 @@ static struct syscall decoded_syscalls[] = { { Atflags, 4 } } }, { .name = "fcntl", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } }, + { .name = "fdatasync", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, { .name = "flock", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Flockop, 1 } } }, { .name = "fstat", .ret_type = 1, .nargs = 2, @@ -240,6 +242,8 @@ static struct syscall decoded_syscalls[] = { { Atflags, 3 } } }, { .name = "fstatfs", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { StatFs | OUT, 1 } } }, + { .name = "fsync", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, { .name = "ftruncate", .ret_type = 1, .nargs = 2, .args = { { Int | IN, 0 }, { QuadHex | IN, 1 } } }, { .name = "futimens", .ret_type = 1, .nargs = 2, From owner-svn-src-head@freebsd.org Thu Feb 28 14:40:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BCA71509909; Thu, 28 Feb 2019 14:40: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 034FB6D7AB; Thu, 28 Feb 2019 14:40: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 CFA5B65B8; Thu, 28 Feb 2019 14:40:43 +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 x1SEehnp084057; Thu, 28 Feb 2019 14:40:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SEehMr084056; Thu, 28 Feb 2019 14:40:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201902281440.x1SEehMr084056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 28 Feb 2019 14:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344659 - 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: 344659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 034FB6D7AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 14:40:44 -0000 Author: andrew Date: Thu Feb 28 14:40:43 2019 New Revision: 344659 URL: https://svnweb.freebsd.org/changeset/base/344659 Log: Add the hw.ncpu tunable to arm64. This allows us to limit the number of CPUs to use, e.g. to debug problems seen when enabling multiple clusters. Reviewed by: manu Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19404 Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu Feb 28 09:42:03 2019 (r344658) +++ head/sys/arm64/arm64/mp_machdep.c Thu Feb 28 14:40:43 2019 (r344659) @@ -638,10 +638,11 @@ cpu_find_cpu0_fdt(u_int id, phandle_t node, u_int addr void cpu_mp_setmaxid(void) { -#if defined(DEV_ACPI) || defined(FDT) int cores; -#endif + mp_ncpus = 1; + mp_maxid = 0; + switch(arm64_bus_method) { #ifdef DEV_ACPI case ARM64_BUS_ACPI: @@ -653,7 +654,6 @@ cpu_mp_setmaxid(void) cores); mp_ncpus = cores; mp_maxid = cores - 1; - return; } break; #endif @@ -667,18 +667,21 @@ cpu_mp_setmaxid(void) cores); mp_ncpus = cores; mp_maxid = cores - 1; - return; } break; #endif default: + if (bootverbose) + printf("No CPU data, limiting to 1 core\n"); break; } - if (bootverbose) - printf("No CPU data, limiting to 1 core\n"); - mp_ncpus = 1; - mp_maxid = 0; + if (TUNABLE_INT_FETCH("hw.ncpu", &cores)) { + if (cores > 0 && cores < mp_ncpus) { + mp_ncpus = cores; + mp_maxid = cores - 1; + } + } } /* From owner-svn-src-head@freebsd.org Thu Feb 28 14:47:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B561A150A2AF; Thu, 28 Feb 2019 14:47:16 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 911F06DFC3; Thu, 28 Feb 2019 14:47:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id e1so16813400iok.1; Thu, 28 Feb 2019 06:47:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f7LfJzXWea+VQvR49NTIGXzCgk4hr4ye+W8Cms3/ZJA=; b=eqT9irbFUMkRcA+ElEjlzeWxL6QdYaz8vQl7BmQ1AOKfbejjMTzcqDtmEQvobWXY/L VMu1XHjElBDizIsSknYaC7q+eNF4I0xOKHvPrd4prxJdxfrbxuirZUY3BbpJju9iqafr yGymuH2SV8XS1rdL4H/FzGknHF1TJTKvoZXQP/OUdywrf00FMjjzaxd759JkgK2hL35U fGDeRu0jXQr6US/R/ZggL1jJqRBEKl/aYH+io2YRHZbXzshfIiQTAakiHEEFF5v1Wxba RhZPFpY7MLctT3fILzGlh5NWsF2MmJkT3yjFKJ649YERHp+Xi9stvgA2m0awtV3GNJG+ Rbww== X-Gm-Message-State: APjAAAUy1ZO0iLqRSYbDL5dpxRnMHd9JXiREH/+JKDAeVttayNAdF/G1 zkLfOCUbx0QQwClOdXHiv3uO1/Id/rDMV75svqOqvw== X-Google-Smtp-Source: APXvYqyC2bV1UOb78trQycLQFsvL7Bl+GmU4XjNs04OOQ12bptXHtmjit75p9AjFrMQ7LgFPQnTnc7qaHmllqQwjw1s= X-Received: by 2002:a6b:ee02:: with SMTP id i2mr5178043ioh.294.1551365228656; Thu, 28 Feb 2019 06:47:08 -0800 (PST) MIME-Version: 1.0 References: <201902261746.x1QHkJOI060482@repo.freebsd.org> <201902261803.x1QI3MRh047064@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201902261803.x1QI3MRh047064@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Thu, 28 Feb 2019 09:46:56 -0500 Message-ID: Subject: Re: svn commit: r344594 - head/usr.bin/proccontrol To: "Rodney W. Grimes" Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 911F06DFC3 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.41 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.78)[ip: (-7.98), ipnet: 209.85.128.0/17(-3.81), asn: 15169(-2.02), country: US(-0.07)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.69)[-0.689,0]; RCVD_IN_DNSWL_NONE(0.00)[41.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 14:47:16 -0000 On Tue, 26 Feb 2019 at 13:03, Rodney W. Grimes wrote: > > I thought the foundation updated all its templates and contracts > such that the All rights reserved was no longer needed? Foundation contract templates etc. have been updated to remove the "All rights reserved." text, but it may still exist in existing contracts. In any case I'll be explicit: Foundation staff, contractors, and grant recipients do not need to include the "All rights reserved." statement in new files they create. From owner-svn-src-head@freebsd.org Thu Feb 28 15:24:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6623F150B72E; Thu, 28 Feb 2019 15:24:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D4B16FD4B; Thu, 28 Feb 2019 15:24:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 014E06D84; Thu, 28 Feb 2019 15:24:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SFO0GB009752; Thu, 28 Feb 2019 15:24:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SFO09r009750; Thu, 28 Feb 2019 15:24:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902281524.x1SFO09r009750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Feb 2019 15:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344660 - in head: share/man/man4 sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/isp X-SVN-Commit-Revision: 344660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D4B16FD4B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 15:24:01 -0000 Author: mav Date: Thu Feb 28 15:24:00 2019 New Revision: 344660 URL: https://svnweb.freebsd.org/changeset/base/344660 Log: Add to isp(4) tunables to limit MSI/MSI-X usage. There are some problem reports possibly related to the new driver use of multiple interrupts on older cards. Hopefully this allow to workaround them. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/share/man/man4/isp.4 head/sys/dev/isp/isp_pci.c Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Thu Feb 28 14:40:43 2019 (r344659) +++ head/share/man/man4/isp.4 Thu Feb 28 15:24:00 2019 (r344660) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2018 +.Dd February 28, 2019 .Dt ISP 4 .Os .Sh NAME @@ -163,15 +163,19 @@ The following options are switchable by setting values .Pp They are: .Bl -tag -width indent -.It Va hint.isp.0.fwload_disable +.It Va hint.isp. Ns Ar N Ns Va .msi +Limit on number of Message Signaled Interrupts (MSI) to be used. +.It Va hint.isp. Ns Ar N Ns Va .msix +Limit on number of Extended Message Signaled Interrupts (MSI-X) to be used. +.It Va hint.isp. Ns Ar N Ns Va .fwload_disable A hint value to disable loading of firmware .Xr ispfw 4 . -.It Va hint.isp.0.ignore_nvram +.It Va hint.isp. Ns Ar N Ns Va .ignore_nvram A hint value to ignore board NVRAM settings for. Otherwise use NVRAM settings. -.It Va hint.isp.0.fullduplex +.It Va hint.isp. Ns Ar N Ns Va .fullduplex A hint value to set full duplex mode. -.It Va hint.isp.0.topology +.It Va hint.isp. Ns Ar N Ns Va .topology A hint value to select topology of connection. Supported values are: .Pp @@ -185,48 +189,48 @@ Loopback only. .It Li nport-only Point to point only. .El -.It Va hint.isp.0.portwwn +.It Va hint.isp. Ns Ar N Ns Va .portwwn This should be the full 64 bit World Wide Port Name you would like to use, overriding the value in NVRAM for the card. -.It Va hint.isp.0.nodewwn +.It Va hint.isp. Ns Ar N Ns Va .nodewwn This should be the full 64 bit World Wide Node Name you would like to use, overriding the value in NVRAM for the card. -.It Va hint.isp.0.iid +.It Va hint.isp. Ns Ar N Ns Va .iid A hint to override or set the Initiator ID or Loop ID. For Fibre Channel cards in Local Loop topologies it is .Ar strongly recommended that you set this value to non-zero. -.It Va hint.isp.0.role +.It Va hint.isp. Ns Ar N Ns Va .role A hint to define default role for isp instance (0 -- none, 1 -- target, 2 -- initiator, 3 -- both). -.It Va hint.isp.0.debug +.It Va hint.isp. Ns Ar N Ns Va .debug A hint value for a driver debug level (see the file .Pa /usr/src/sys/dev/isp/ispvar.h for the values. -.It Va hint.isp.0.vports +.It Va hint.isp. Ns Ar N Ns Va .vports A hint to create specified number of additional virtual ports. -.It Va hint.isp.0.nofctape +.It Va hint.isp. Ns Ar N Ns Va .nofctape Set this to 1 to disable FC-Tape operation on the given isp instance. -.It Va hint.isp.0.fctape +.It Va hint.isp. Ns Ar N Ns Va .fctape Set this to 1 to enable FC-Tape operation on the given isp instance for targets that support it. .El .Sh SYSCTL OPTIONS .Bl -tag -width indent -.It Va dev.isp.N.loop_down_limit +.It Va dev.isp. Ns Ar N Ns Va .loop_down_limit This value says how long to wait in seconds after loop has gone down before giving up and expiring all of the devices that were visible. The default is 300 seconds (5 minutes). A separate (nonadjustable) timeout is used when booting to not stop booting on lack of FC connectivity. -.It Va dev.isp.N.gone_device_time +.It Va dev.isp. Ns Ar N Ns Va .gone_device_time This value says how long to wait for devices to reappear if they (temporarily) disappear due to loop or fabric events. While this timeout is running, I/O to those devices will simply be held. -.It Va dev.isp.N.use_gff_id -.It Va dev.isp.N.use_gft_id +.It Va dev.isp. Ns Ar N Ns Va .use_gff_id +.It Va dev.isp. Ns Ar N Ns Va .use_gft_id Setting those options to 0 allows to disable use of GFF_ID and GFT_ID SNS requests during FC fabric scan. It may be useful if switch does not implement them correctly, @@ -234,9 +238,9 @@ preventing some devices from being found. Disabling them may cause unneeded logins to ports not supporting target role or even FCP at all. The default is 1 (enabled). -.It Va dev.isp.N.wwnn +.It Va dev.isp. Ns Ar N Ns Va .wwnn This is the readonly World Wide Node Name value for this port. -.It Va dev.isp.N.wwpn +.It Va dev.isp. Ns Ar N Ns Va .wwpn This is the readonly World Wide Port Name value for this port. .El .Sh SEE ALSO Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Thu Feb 28 14:40:43 2019 (r344659) +++ head/sys/dev/isp/isp_pci.c Thu Feb 28 15:24:00 2019 (r344660) @@ -1910,14 +1910,21 @@ isp_pci_irqsetup(ispsoftc_t *isp) ISP_UNLOCK(isp); if (ISP_CAP_MSIX(isp)) { - max_irq = min(ISP_MAX_IRQS, IS_26XX(isp) ? 3 : 2); + max_irq = IS_26XX(isp) ? 3 : 2; + resource_int_value(device_get_name(dev), + device_get_unit(dev), "msix", &max_irq); + max_irq = imin(ISP_MAX_IRQS, max_irq); pcs->msicount = imin(pci_msix_count(dev), max_irq); if (pcs->msicount > 0 && pci_alloc_msix(dev, &pcs->msicount) != 0) pcs->msicount = 0; } if (pcs->msicount == 0) { - pcs->msicount = imin(pci_msi_count(dev), 1); + max_irq = 1; + resource_int_value(device_get_name(dev), + device_get_unit(dev), "msi", &max_irq); + max_irq = imin(1, max_irq); + pcs->msicount = imin(pci_msi_count(dev), max_irq); if (pcs->msicount > 0 && pci_alloc_msi(dev, &pcs->msicount) != 0) pcs->msicount = 0; From owner-svn-src-head@freebsd.org Thu Feb 28 15:36:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B02150BCE7; Thu, 28 Feb 2019 15:36:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FFCB70651; Thu, 28 Feb 2019 15:36:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E0006F77; Thu, 28 Feb 2019 15:36:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SFa3bO015487; Thu, 28 Feb 2019 15:36:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SFa3Tb015486; Thu, 28 Feb 2019 15:36:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902281536.x1SFa3Tb015486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Feb 2019 15:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344661 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 344661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FFCB70651 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 15:36:04 -0000 Author: mav Date: Thu Feb 28 15:36:03 2019 New Revision: 344661 URL: https://svnweb.freebsd.org/changeset/base/344661 Log: Limit 24xx adapters to only one MSI-X interrupt by default. These are 4Gb/s and pretty old and slow now, so I see no reason to fight for their performance over stability. PR: 233654 MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Thu Feb 28 15:24:00 2019 (r344660) +++ head/sys/dev/isp/isp_pci.c Thu Feb 28 15:36:03 2019 (r344661) @@ -1910,7 +1910,7 @@ isp_pci_irqsetup(ispsoftc_t *isp) ISP_UNLOCK(isp); if (ISP_CAP_MSIX(isp)) { - max_irq = IS_26XX(isp) ? 3 : 2; + max_irq = IS_26XX(isp) ? 3 : (IS_25XX(isp) ? 2 : 1); resource_int_value(device_get_name(dev), device_get_unit(dev), "msix", &max_irq); max_irq = imin(ISP_MAX_IRQS, max_irq); From owner-svn-src-head@freebsd.org Thu Feb 28 15:40:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BCF9150BFEF; Thu, 28 Feb 2019 15:40:33 +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 D291170B12; Thu, 28 Feb 2019 15:40:32 +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 x1SFeVkJ057031; Thu, 28 Feb 2019 07:40:31 -0800 (PST) (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 x1SFeVbD057030; Thu, 28 Feb 2019 07:40:31 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201902281540.x1SFeVbD057030@pdx.rh.CN85.dnsmgr.net> Subject: Foundation staff ... do not need to include the "All rights reserved." In-Reply-To: To: Ed Maste Date: Thu, 28 Feb 2019 07:40:30 -0800 (PST) CC: "Rodney W. Grimes" , Konstantin Belousov , 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-Rspamd-Queue-Id: D291170B12 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 15:40:33 -0000 > On Tue, 26 Feb 2019 at 13:03, Rodney W. Grimes > wrote: > > > > I thought the foundation updated all its templates and contracts > > such that the All rights reserved was no longer needed? > > Foundation contract templates etc. have been updated to remove the > "All rights reserved." text, but it may still exist in existing > contracts. > > In any case I'll be explicit: Foundation staff, contractors, and grant > recipients do not need to include the "All rights reserved." statement > in new files they create. > Thank you for clarity on that. I have re-subjected my reply to make this more visible rather than looking like a reply to a commit. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Feb 28 18:12:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 032681511915; Thu, 28 Feb 2019 18:12:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C10D7779D7; Thu, 28 Feb 2019 18:12:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5CA68B37; Thu, 28 Feb 2019 18:12:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SICFeN099559; Thu, 28 Feb 2019 18:12:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SICFIm099558; Thu, 28 Feb 2019 18:12:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201902281812.x1SICFIm099558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 28 Feb 2019 18:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344662 - in head: share/man/man4 sys/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: share/man/man4 sys/sys X-SVN-Commit-Revision: 344662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C10D7779D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 18:12:16 -0000 Author: ngie Date: Thu Feb 28 18:12:14 2019 New Revision: 344662 URL: https://svnweb.freebsd.org/changeset/base/344662 Log: Remove references to pdwait4(2) and `CAP_PDWAIT` from rights(4) @cem removed references to pdwait4(2) (a nonexistent syscall) in r320058. This change removes references to pdwait4(2) and `CAP_PDWAIT` in rights(4) to not mislead the user into thinking that pdwait4(2)/`CAP_PDWAIT` is actually implemented in the stock FreeBSD kernel. The goal of this functionality was to simplify monitoring/manipulating processes started with `pdfork`, et al, and avoid races with waiting on pids. The syscall was never completed though--just discussed on the capsicum mailing list back in 2015: https://lists.cam.ac.uk/pipermail/cl-capsicum-discuss/2015-May/msg00012.html . That being said, there are members of the project (@rwatson, etc) who have longterm goals to implement this syscall to better secure pdfork(2) calls. PR: 235871 Reviewed by: emaste Discussed with: rwatson Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18950 Modified: head/share/man/man4/rights.4 head/sys/sys/capsicum.h Modified: head/share/man/man4/rights.4 ============================================================================== --- head/share/man/man4/rights.4 Thu Feb 28 15:36:03 2019 (r344661) +++ head/share/man/man4/rights.4 Thu Feb 28 18:12:14 2019 (r344662) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2018 +.Dd February 28, 2019 .Dt RIGHTS 4 .Os .Sh NAME @@ -467,9 +467,6 @@ Permit .It Dv CAP_PDKILL Permit .Xr pdkill 2 . -.It Dv CAP_PDWAIT -Permit -.Xr pdwait4 2 . .It Dv CAP_PEELOFF Permit .Xr sctp_peeloff 2 . Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Thu Feb 28 15:36:03 2019 (r344661) +++ head/sys/sys/capsicum.h Thu Feb 28 18:12:14 2019 (r344662) @@ -246,7 +246,12 @@ /* Process management via process descriptors. */ /* Allows for pdgetpid(2). */ #define CAP_PDGETPID CAPRIGHT(1, 0x0000000000000200ULL) -/* Allows for pdwait4(2). */ +/* + * Allows for pdwait4(2). + * + * XXX: this constant was imported unused, but is targeted to be implemented + * in the future (bug 235871). + */ #define CAP_PDWAIT CAPRIGHT(1, 0x0000000000000400ULL) /* Allows for pdkill(2). */ #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) From owner-svn-src-head@freebsd.org Thu Feb 28 19:19:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE2E3151438F; Thu, 28 Feb 2019 19:19:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91F71832CF; Thu, 28 Feb 2019 19:19:02 +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 848189618; Thu, 28 Feb 2019 19:19:02 +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 x1SJJ2ou035528; Thu, 28 Feb 2019 19:19:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SJJ2eY035527; Thu, 28 Feb 2019 19:19:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201902281919.x1SJJ2eY035527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Feb 2019 19:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344663 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 344663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91F71832CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 19:19:03 -0000 Author: kib Date: Thu Feb 28 19:19:02 2019 New Revision: 344663 URL: https://svnweb.freebsd.org/changeset/base/344663 Log: Invalidate cache for the PDPTE page when using PAE paging but PAT is not supported. According to SDM rev. 69 vol. 3, for PDPTE registers loads: - when PAT is not supported, access to the PDPTE page is performed as UC, see 4.9.1; - when PAT is supported, the access is WB, see 4.9.2. So potentially CPU might load stale memory as PDPTEs if both PAT and self-snoop are not implemented. To be safe, add total local cache flush to pmap_cold() before initial load of cr3, and flush PDPTE page in pmap_pinit(), if PAT is not implemented. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19365 Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Feb 28 18:12:14 2019 (r344662) +++ head/sys/i386/i386/pmap.c Thu Feb 28 19:19:02 2019 (r344663) @@ -564,6 +564,8 @@ __CONCAT(PMTYPE, cold)(void) /* Now enable paging */ #ifdef PMAP_PAE_COMP cr3 = (u_int)IdlePDPT; + if ((cpu_feature & CPUID_PAT) == 0) + wbinvd(); #else cr3 = (u_int)IdlePTD; #endif @@ -2040,6 +2042,14 @@ __CONCAT(PMTYPE, pinit)(pmap_t pmap) } pmap_qenter((vm_offset_t)pmap->pm_pdir, pmap->pm_ptdpg, NPGPTD); +#ifdef PMAP_PAE_COMP + if ((cpu_feature & CPUID_PAT) == 0) { + pmap_invalidate_cache_range( + trunc_page((vm_offset_t)pmap->pm_pdpt), + round_page((vm_offset_t)pmap->pm_pdpt + + NPGPTD * sizeof(pdpt_entry_t))); + } +#endif for (i = 0; i < NPGPTD; i++) if ((pmap->pm_ptdpg[i]->flags & PG_ZERO) == 0) From owner-svn-src-head@freebsd.org Thu Feb 28 20:43:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB2C1517A7E; Thu, 28 Feb 2019 20:43:04 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5F986EB2; Thu, 28 Feb 2019 20:43:04 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F624A5AD; Thu, 28 Feb 2019 20:43:04 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SKh4Xa082390; Thu, 28 Feb 2019 20:43:04 GMT (envelope-from trhodes@FreeBSD.org) Received: (from trhodes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SKh475082389; Thu, 28 Feb 2019 20:43:04 GMT (envelope-from trhodes@FreeBSD.org) Message-Id: <201902282043.x1SKh475082389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trhodes set sender to trhodes@FreeBSD.org using -f From: Tom Rhodes Date: Thu, 28 Feb 2019 20:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344665 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: trhodes X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 344665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D5F986EB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 20:43:04 -0000 Author: trhodes (doc committer) Date: Thu Feb 28 20:43:03 2019 New Revision: 344665 URL: https://svnweb.freebsd.org/changeset/base/344665 Log: Grammar tweaks in ipfw manual page. Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Thu Feb 28 19:27:54 2019 (r344664) +++ head/sbin/ipfw/ipfw.8 Thu Feb 28 20:43:03 2019 (r344665) @@ -233,7 +233,7 @@ or .Cm limit rule, and are typically used to open the firewall on-demand to legitimate traffic only. -Please, note, that +Please note, that .Cm keep-state amd .Cm limit @@ -684,8 +684,8 @@ is set to 0 (default), one can use attached to the .Li ipfw0 pseudo interface. -This pseudo interface can be created after a boot -manually by using the following command: +This pseudo interface can be created manually after a system +boot by using the following command: .Bd -literal -offset indent # ifconfig ipfw0 create .Ed @@ -698,7 +698,7 @@ file: firewall_logif="YES" .Ed .Pp -There is no overhead if no +There is zero overhead when no .Xr bpf 4 is attached to the pseudo interface. .Pp From owner-svn-src-head@freebsd.org Thu Feb 28 20:48:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52DE01517E8B; Thu, 28 Feb 2019 20:48:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E936A8736F; Thu, 28 Feb 2019 20:48:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6254A5BC; Thu, 28 Feb 2019 20:48:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SKmIUn082787; Thu, 28 Feb 2019 20:48:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SKmILE082786; Thu, 28 Feb 2019 20:48:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201902282048.x1SKmILE082786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 28 Feb 2019 20:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344666 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 344666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E936A8736F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 20:48:19 -0000 Author: bdrewery Date: Thu Feb 28 20:48:18 2019 New Revision: 344666 URL: https://svnweb.freebsd.org/changeset/base/344666 Log: bsd.nls.mk isn't optional. It is protected by MK_NLS. If it should really be optional then it needs to be documented as such in share/mk/bsd.README and .sinclude used where needed. This fixes a regression from r335011. PR: 232527 Submitted by: jarrod@downtools.com.au Reported by: ktullavik@gmail.com MFC after: 3 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 28 20:43:03 2019 (r344665) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 28 20:48:18 2019 (r344666) @@ -6603,7 +6603,6 @@ OLD_DIRS+=var/yp .if ${MK_NLS} == no OLD_DIRS+=usr/share/nls/ OLD_DIRS+=usr/share/nls/C -OLD_FILES+=usr/share/mk/bsd.nls.mk OLD_FILES+=usr/share/nls/C/ee.cat OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-1 OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-15 From owner-svn-src-head@freebsd.org Thu Feb 28 21:07:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B8315189FD; Thu, 28 Feb 2019 21:07:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07C6F882E4; Thu, 28 Feb 2019 21:07:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFA4DA937; Thu, 28 Feb 2019 21:07:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SL7GBi093117; Thu, 28 Feb 2019 21:07:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SL7GWa093116; Thu, 28 Feb 2019 21:07:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201902282107.x1SL7GWa093116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 28 Feb 2019 21:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344669 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 344669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07C6F882E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 21:07:17 -0000 Author: mav Date: Thu Feb 28 21:07:16 2019 New Revision: 344669 URL: https://svnweb.freebsd.org/changeset/base/344669 Log: Limit 24xx adapters to only MSI interrupts by default. This was actually the known good configuration we used before. Single MSI-X configuration doesn't even work there on my tests, just due to lack of documentation not sure whether by design or I am doing something wrong. PR: 233654 MFC after: 1 week Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Thu Feb 28 20:57:41 2019 (r344668) +++ head/sys/dev/isp/isp_pci.c Thu Feb 28 21:07:16 2019 (r344669) @@ -1910,7 +1910,7 @@ isp_pci_irqsetup(ispsoftc_t *isp) ISP_UNLOCK(isp); if (ISP_CAP_MSIX(isp)) { - max_irq = IS_26XX(isp) ? 3 : (IS_25XX(isp) ? 2 : 1); + max_irq = IS_26XX(isp) ? 3 : (IS_25XX(isp) ? 2 : 0); resource_int_value(device_get_name(dev), device_get_unit(dev), "msix", &max_irq); max_irq = imin(ISP_MAX_IRQS, max_irq); From owner-svn-src-head@freebsd.org Thu Feb 28 21:44:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D81151A6C4; Thu, 28 Feb 2019 21:44:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 A3B6D8ABE3; Thu, 28 Feb 2019 21:44:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x535.google.com with SMTP id m1so10340664pgq.8; Thu, 28 Feb 2019 13:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oxQAmoi9JosCui8gor/cCpYa0DfwR2ux5G4hapXNM1M=; b=SnAzupOydEshRKtwctitKxT91MugJG3qxiyDty9XgvTGjosWkxajvUl43psSObyo8Q ZFRTa45KpNyLSA26WpnBzCGZsaPcUquf5jaq6sEoIRdohoy79R0xsJH14Qeq7rwgVsS5 dcbXtTEPyLEz4+sv7//u/MLWuyn8PUnZaqX+Q9MiwGiF5HlUHHID5wX/OPXWulFoKPKn wcraqux1zsXrc3/UyFf9PtACKJTCUvebiJMj2NSqBfRkN8GR6t4K8SNt8TP+Bw8HGweW NVMY6h0nAz0NXCONx19AQoivE+yjcHRaslTdMPhKv5vsJaGuOAqv3Lk5DVsflBlmY8zG t2yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=oxQAmoi9JosCui8gor/cCpYa0DfwR2ux5G4hapXNM1M=; b=PI5KRtK2c4JuCyYPS/Xl93SStY7b1rsWgoyxjtXbYPjSe4edwwe1E8vjupzrycVkGm NJ4pY0+fpOolh634koI0YQqSQaX7ljzGMFc8bK6RJWazIK07IVTxDXojJZebvvTtNbcz /NK0p5Kc4j3PKmqH1XgkJZGmQUs/YExxz4CgxiDOyIHy4JZQLoEvo+HFhpJbZymk2ozD SQC6XNphuGFm13XWgrNLs39JIhTtmujUBjeq5/ZW8jDIJ1iCRHhhSLtDkMz56zH7amU/ 5fuTYxQiyoVjW29U1GwnT6lF4VYRhQlWjKa+G7dksmDqo+EYZ2v7kcJlVCIKHxEPA1Jb yTDw== X-Gm-Message-State: APjAAAU2sVugVuF5UpDWM0C/JQ6auK4YXnFnmmMj6Biq3jK2TlPSmqcl yKhlhL+jXU4RWOUpyijiccC5YEBW X-Google-Smtp-Source: APXvYqzQWo+aIfaBWUIe0yoLfE29OhFE2EJaicH4k1J9DNG0GJDw7//TUxXLQgybPhS3lpLIF/Pedg== X-Received: by 2002:a65:654d:: with SMTP id a13mr1317326pgw.181.1551390273259; Thu, 28 Feb 2019 13:44:33 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n6sm28730135pfa.3.2019.02.28.13.44.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 13:44:32 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344666 - head/tools/build/mk From: Enji Cooper In-Reply-To: <201902282048.x1SKmILE082786@repo.freebsd.org> Date: Thu, 28 Feb 2019 13:44:31 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0EC04D65-721E-49F1-9755-7A8FDDE554DB@gmail.com> References: <201902282048.x1SKmILE082786@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: A3B6D8ABE3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 21:44:35 -0000 > On Feb 28, 2019, at 12:48 PM, Bryan Drewery = wrote: >=20 > Author: bdrewery > Date: Thu Feb 28 20:48:18 2019 > New Revision: 344666 > URL: https://svnweb.freebsd.org/changeset/base/344666 >=20 > Log: > bsd.nls.mk isn't optional. >=20 > It is protected by MK_NLS. If it should really be optional then > it needs to be documented as such in share/mk/bsd.README and > .sinclude used where needed. >=20 > This fixes a regression from r335011. >=20 > PR: 232527 > Submitted by: jarrod@downtools.com.au > Reported by: ktullavik@gmail.com > MFC after: 3 days Should bsd.{lib,prog}.mk instead be taught to ignore errors when = including this file? Thanks! -Enji= From owner-svn-src-head@freebsd.org Thu Feb 28 21:47:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3B8C151A821; Thu, 28 Feb 2019 21:47:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9448AE84; Thu, 28 Feb 2019 21:47:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 F20301352B; Thu, 28 Feb 2019 21:47:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id h10so16412476lfc.12; Thu, 28 Feb 2019 13:47:48 -0800 (PST) X-Gm-Message-State: APjAAAXBxfrgs/rB6FZiN+MwY38wK8Bs/K7NyRJ4XhSBjFYgho7WW9E6 KeArfNmlJeJqC/6KCH0MSflcP+pULECXHB0U+Y0= X-Google-Smtp-Source: APXvYqyZOBoERPFmdHtPmOy9k1J5Up6Fb9XE1VVLgLNHC4aHfSE3NkrwnTd/UdZq2aeD2xvgTFJanOckoKzMwphR9EM= X-Received: by 2002:a19:aacc:: with SMTP id t195mr944438lfe.153.1551390467465; Thu, 28 Feb 2019 13:47:47 -0800 (PST) MIME-Version: 1.0 References: <201902282048.x1SKmILE082786@repo.freebsd.org> <0EC04D65-721E-49F1-9755-7A8FDDE554DB@gmail.com> In-Reply-To: <0EC04D65-721E-49F1-9755-7A8FDDE554DB@gmail.com> From: Kyle Evans Date: Thu, 28 Feb 2019 15:47:14 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344666 - head/tools/build/mk To: Enji Cooper Cc: Bryan Drewery , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D9448AE84 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 21:47:49 -0000 On Thu, Feb 28, 2019 at 3:44 PM Enji Cooper wrote: > > > > On Feb 28, 2019, at 12:48 PM, Bryan Drewery wrote: > > > > Author: bdrewery > > Date: Thu Feb 28 20:48:18 2019 > > New Revision: 344666 > > URL: https://svnweb.freebsd.org/changeset/base/344666 > > > > Log: > > bsd.nls.mk isn't optional. > > > > It is protected by MK_NLS. If it should really be optional then > > it needs to be documented as such in share/mk/bsd.README and > > .sinclude used where needed. > > > > This fixes a regression from r335011. > > > > PR: 232527 > > Submitted by: jarrod@downtools.com.au > > Reported by: ktullavik@gmail.com > > MFC after: 3 days > > Should bsd.{lib,prog}.mk instead be taught to ignore errors when including this file? > Thanks! > -Enji If we actually conditionally installed it, sure- it was only removed because of r335011, so it would go through an install/remove dance between installworld and delete-old on WITHOUT_NLS systems. If we're going to make it conditional on MK_NLS, it needs to actually be conditional on MK_NLS the proper way along with an s/.include/.sinclude/. From owner-svn-src-head@freebsd.org Thu Feb 28 21:51:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2E47151AB16; Thu, 28 Feb 2019 21:51:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (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 28E3E8B1F1; Thu, 28 Feb 2019 21:51:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x644.google.com with SMTP id c4so10368026pls.11; Thu, 28 Feb 2019 13:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1fvyOwoVNEyl3i5lV5XiXFYP1F2NPk7+NGBQfDLkxWE=; b=qChzzMJ4RQ/aRZfmvoaYQmTCf2Ua9Cshiu5J2/vhrs9m1l/rF53WAd6aHgXw0/XOUa 0NeRXztCCb3yfxNnY56Uf0C4eTiP7WSs8gs6c/cdIFyPl4D35grGjP9ecH6yL3sK3Wfk gufG+WKgzZzznzpyRNO7E+vRv0NAafhJ3r+OGNYR7suFbLJuWhUpOZJY3+nkXS6tpqAn 4bEaOFoJhRcR61DpkOzDqigosajXNVAuC6GVrDHM4xMbCWR+leTiVR7MzCwqWwk85+rh niGBbQ2xWrG8xYxDEjKbx/mWjQQkuEUEpfyVKFi61qpUqZpXwoO85exwvIO5eHC4Gh8Z IE0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1fvyOwoVNEyl3i5lV5XiXFYP1F2NPk7+NGBQfDLkxWE=; b=S8SS8bckAFDmol5HaSWttwAVq0BwCOoN2uTxKq8pvaX4sWyvzwbBICsIjrkmh6kviZ EwrQlxTmJEAqouaY/oVrgNiKr18pACwHES4JQWpuTeFrEKJ7jM19tB7zIOt0QipaeD+y JLCF0tzlLnxShXzH97FzY7d3KHP0ziyXKZxI3CK915r1TPT/el+fjNC9HbJxOXjiy18C DRDxJmCXLSBYZzzzXUCnXOnz9MMJcdwH/vtI9S/TUsKnI0OCTKIU2ElEg87tAt30t4T9 u1KTLY1uOZWWZTqG0FmprJuXMHIbf7l4PYjjHcP8gbsrG3x2fNEGd/0sy3LHxXzYFrKp Ot8A== X-Gm-Message-State: APjAAAV67YniI2VB0WCdvU5YowNZ7lIr3tM7lmp7jwB+5j+nwSWtq16h zdd8wmElsjjLnXQyQIzJCjSX2Ora X-Google-Smtp-Source: APXvYqzYIEm+F0S76I2XFhRKPSVE4OYsZQXSjE2y4VRimhb1QihUSkuhpTYwJ6mvrBQEFm/Ke1pfQQ== X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr1639418plp.201.1551390678670; Thu, 28 Feb 2019 13:51:18 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id x8sm27923083pfn.137.2019.02.28.13.51.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 13:51:17 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344666 - head/tools/build/mk From: Enji Cooper In-Reply-To: Date: Thu, 28 Feb 2019 13:51:17 -0800 Cc: Bryan Drewery , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5B91E4F8-C563-466D-A8FC-61A26F164109@gmail.com> References: <201902282048.x1SKmILE082786@repo.freebsd.org> <0EC04D65-721E-49F1-9755-7A8FDDE554DB@gmail.com> To: Kyle Evans X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 28E3E8B1F1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 21:51:21 -0000 > On Feb 28, 2019, at 1:47 PM, Kyle Evans wrote: >=20 > On Thu, Feb 28, 2019 at 3:44 PM Enji Cooper = wrote: >>=20 >>=20 >>> On Feb 28, 2019, at 12:48 PM, Bryan Drewery = wrote: >>>=20 >>> Author: bdrewery >>> Date: Thu Feb 28 20:48:18 2019 >>> New Revision: 344666 >>> URL: https://svnweb.freebsd.org/changeset/base/344666 >>>=20 >>> Log: >>> bsd.nls.mk isn't optional. >>>=20 >>> It is protected by MK_NLS. If it should really be optional then ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To paraphrase Faith No More=E2=80=99s - = Epic: =E2=80=9Cwhat is =E2=80=98It=E2=80=99?" = ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > If we actually conditionally installed it, sure- it was only removed > because of r335011, so it would go through an install/remove dance > between installworld and delete-old on WITHOUT_NLS systems. Oh=E2=80=A6 you=E2=80=99re right. The commit message mislead me to think = that it was conditionally installed, but it=E2=80=99s actually always = installed. > If we're going to make it conditional on MK_NLS, it needs to actually > be conditional on MK_NLS the proper way along with an > s/.include/.sinclude/. This is what I was implying ;)=E2=80=A6 Cheers, -Enji From owner-svn-src-head@freebsd.org Thu Feb 28 22:00:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89B52151B2F2; Thu, 28 Feb 2019 22:00:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2952F8BBB5; Thu, 28 Feb 2019 22:00:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D075B23F; Thu, 28 Feb 2019 22:00:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1SM0bPK022552; Thu, 28 Feb 2019 22:00:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SM0aKn022551; Thu, 28 Feb 2019 22:00:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201902282200.x1SM0aKn022551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 28 Feb 2019 22:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344670 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2952F8BBB5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 22:00:37 -0000 Author: markj Date: Thu Feb 28 22:00:36 2019 New Revision: 344670 URL: https://svnweb.freebsd.org/changeset/base/344670 Log: Allow FIONBIO and FIOASYNC ioctls on POSIX shm descriptors. They have no effect, as with filesystem file descriptors. This improves compatibility with some existing userspace code. Submitted by: Greg V Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19330 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Feb 28 21:07:16 2019 (r344669) +++ head/sys/kern/uipc_shm.c Thu Feb 28 22:00:36 2019 (r344670) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,6 +127,7 @@ static int shm_remove(char *path, Fnv32_t fnv, struct static fo_rdwr_t shm_read; static fo_rdwr_t shm_write; static fo_truncate_t shm_truncate; +static fo_ioctl_t shm_ioctl; static fo_stat_t shm_stat; static fo_close_t shm_close; static fo_chmod_t shm_chmod; @@ -139,7 +141,7 @@ struct fileops shm_ops = { .fo_read = shm_read, .fo_write = shm_write, .fo_truncate = shm_truncate, - .fo_ioctl = invfo_ioctl, + .fo_ioctl = shm_ioctl, .fo_poll = invfo_poll, .fo_kqfilter = invfo_kqfilter, .fo_stat = shm_stat, @@ -361,6 +363,24 @@ shm_truncate(struct file *fp, off_t length, struct ucr return (error); #endif return (shm_dotruncate(shmfd, length)); +} + +int +shm_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, + struct thread *td) +{ + + switch (com) { + case FIONBIO: + case FIOASYNC: + /* + * Allow fcntl(fd, F_SETFL, O_NONBLOCK) to work, + * just like it would on an unlinked regular file + */ + return (0); + default: + return (ENOTTY); + } } static int From owner-svn-src-head@freebsd.org Thu Feb 28 22:10:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80328151B80F; Thu, 28 Feb 2019 22:10:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27B938C19A; Thu, 28 Feb 2019 22:10:20 +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 1B741B3F1; Thu, 28 Feb 2019 22:10:20 +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 x1SMAJdB027499; Thu, 28 Feb 2019 22:10:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SMAJAt027498; Thu, 28 Feb 2019 22:10:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201902282210.x1SMAJAt027498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Feb 2019 22:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344671 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 344671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27B938C19A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 22:10:20 -0000 Author: jhb Date: Thu Feb 28 22:10:19 2019 New Revision: 344671 URL: https://svnweb.freebsd.org/changeset/base/344671 Log: Don't assume all children of a nexus are ports. Specifically, ccr(4) devices are also children of cxgbe nexus devices. Rather than making assumptions about the child device's softc, walk the list of ports from the nexus' softc to determine if a child is a port in t4_child_location_str(). This fixes a panic when detaching a ccr device. Reviewed by: np MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D19399 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Feb 28 22:00:36 2019 (r344670) +++ head/sys/dev/cxgbe/t4_main.c Thu Feb 28 22:10:19 2019 (r344671) @@ -1372,10 +1372,19 @@ done: static int t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen) { + struct adapter *sc; struct port_info *pi; + int i; - pi = device_get_softc(dev); - snprintf(buf, buflen, "port=%d", pi->port_id); + sc = device_get_softc(bus); + buf[0] = '\0'; + for_each_port(sc, i) { + pi = sc->port[i]; + if (pi != NULL && pi->dev == dev) { + snprintf(buf, buflen, "port=%d", pi->port_id); + break; + } + } return (0); } From owner-svn-src-head@freebsd.org Thu Feb 28 22:50:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B5DB151CD00; Thu, 28 Feb 2019 22:50:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 55F9B8DCE8; Thu, 28 Feb 2019 22:50:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id p1so16524859lfk.9; Thu, 28 Feb 2019 14:50:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j3u1YswIP1dwU5ahYnuAWHxzn+9GrqWYzUO9CqCjoYo=; b=ggJ+c2w8TwoqdhHs9PW4JHUxLFZm1HAylx3BgWlrt+s0qlOHJbXEQuMss8+wiAL4EJ r7Ghyq4GwPLj05wUjrEuvFoKzm/ivwEcIGJAWL7HeobCXg4YLZ3dS4G2MJz5kEoYBxGW lDNEDH8McVeDtOv6nMoAzXGN8f43SV/0L75l1bhwASg/iLR4XWGidMlOUcwYKCOgaGnl rN5atsQ1jVyTSGFcdcDywGPIaLte4P7niwlHMP4074RAHHeuxBQOMnHIyswCEmNXyFWY 8HJVmvwD/LZMQWW9OyKbomYD3yPDa7+M1WRd2DuyKtGg0ApMgyL86inbwCydETjkcIFv HllQ== X-Gm-Message-State: APjAAAXd4fTDJ0x4gTysQrMAIpw3xIHgEajB2n1pRjee5HXAMy/2saho R8wEdzfqFPQh1WTE2e+wMmXB4EanwhIsAhKHy4WvxQ== X-Google-Smtp-Source: APXvYqxmTfJeY5QXZC2THN8WTwZbIXcTRBQzyPDmEDhk60qwpszi+lNJnsPYkR1EoeOXd9uu18Zku6c3UiFkdzVrnDg= X-Received: by 2002:a19:c1c4:: with SMTP id r187mr1061141lff.10.1551393764414; Thu, 28 Feb 2019 14:42:44 -0800 (PST) MIME-Version: 1.0 References: <201902232114.x1NLE0cH085345@repo.freebsd.org> In-Reply-To: <201902232114.x1NLE0cH085345@repo.freebsd.org> From: Alan Somers Date: Thu, 28 Feb 2019 15:42:32 -0700 Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: Matt Macy Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 55F9B8DCE8 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.45 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.93 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.30)[ip: (-0.58), ipnet: 209.85.128.0/17(-3.81), asn: 15169(-2.03), country: US(-0.07)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.63)[-0.627,0]; RCVD_IN_DNSWL_NONE(0.00)[45.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2019 22:50:22 -0000 On Sat, Feb 23, 2019 at 2:14 PM Matt Macy wrote: > > Author: mmacy > Date: Sat Feb 23 21:14:00 2019 > New Revision: 344487 > URL: https://svnweb.freebsd.org/changeset/base/344487 > > Log: > gcov support > > add gcov support and export results as files in debugfs > > Reviewed by: hps@ > MFC after: 1 week > Sponsored by: iX Systems > Differential Revision: https://reviews.freebsd.org/D19260 > > Added: > head/sys/gnu/gcov/ > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > head/sys/gnu/gcov/gcov.h (contents, props changed) > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/kern.mk > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/conf/kmod.mk > head/sys/conf/options On a more practical note, how does one use this new feature? It looks like it could be quite useful. -Alan From owner-svn-src-head@freebsd.org Thu Feb 28 23:00:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25416151D64A; Thu, 28 Feb 2019 23:00:48 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7B448E9E7; Thu, 28 Feb 2019 23:00:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9E11BE5D; Thu, 28 Feb 2019 23:00:47 +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 x1SN0lJu055795; Thu, 28 Feb 2019 23:00:47 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1SN0l1v055794; Thu, 28 Feb 2019 23:00:47 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201902282300.x1SN0l1v055794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 28 Feb 2019 23:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344675 - head/sys/modules/geom/geom_flashmap X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/modules/geom/geom_flashmap X-SVN-Commit-Revision: 344675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7B448E9E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 28 Feb 2019 23:00:48 -0000 Author: jhibbits Date: Thu Feb 28 23:00:47 2019 New Revision: 344675 URL: https://svnweb.freebsd.org/changeset/base/344675 Log: GEOM: Add fdt_slicer to the GEOM flashmap module for fdt-based platforms geom_flashmap depends on a slicer being available in order to do any work. On fdt platforms this is provided by fdt_slicer, but this needs to be available. Often it's compiled into the kernel for platforms that boot from the relevant media, but this is not always the case. Add the file to the geom_flashmap module so that it can be used on platforms which don't always need this functionality available. Modified: head/sys/modules/geom/geom_flashmap/Makefile Modified: head/sys/modules/geom/geom_flashmap/Makefile ============================================================================== --- head/sys/modules/geom/geom_flashmap/Makefile Thu Feb 28 22:57:09 2019 (r344674) +++ head/sys/modules/geom/geom_flashmap/Makefile Thu Feb 28 23:00:47 2019 (r344675) @@ -5,4 +5,9 @@ KMOD= geom_flashmap SRCS= geom_flashmap.c +.if !empty(OPT_FDT) +.PATH: ${SRCTOP}/sys/dev/fdt +SRCS+= fdt_slicer.c +.endif + .include From owner-svn-src-head@freebsd.org Fri Mar 1 01:18:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DDA41521579; Fri, 1 Mar 2019 01:18:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7DF6C1C3; Fri, 1 Mar 2019 01:18:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30A84D627; Fri, 1 Mar 2019 01:18:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x211Iegw027671; Fri, 1 Mar 2019 01:18:40 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x211IeVj027670; Fri, 1 Mar 2019 01:18:40 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201903010118.x211IeVj027670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 1 Mar 2019 01:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344676 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 344676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F7DF6C1C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 01:18:40 -0000 Author: mw Date: Fri Mar 1 01:18:39 2019 New Revision: 344676 URL: https://svnweb.freebsd.org/changeset/base/344676 Log: Prevent detaching driver if the attach is not finished When the device is in attaching state, detach should return EBUSY instead of success. In other case, there could be race between attach and detach during the driver unloading. If driver goes sleep and releases GIANT lock during attaching, unloading module could start. In such case when attach continues after module unload, page fault "supervisor read instruction, page not present" occurred. This patch works around the real issue, which is a locking deficiency of the busses. Submitted by: Rafal Kozik Reviewed by: imp Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D19375 Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Feb 28 23:00:47 2019 (r344675) +++ head/sys/kern/subr_bus.c Fri Mar 1 01:18:39 2019 (r344676) @@ -3004,6 +3004,10 @@ device_detach(device_t dev) PDEBUG(("%s", DEVICENAME(dev))); if (dev->state == DS_BUSY) return (EBUSY); + if (dev->state == DS_ATTACHING) { + device_printf(dev, "device in attaching state! Deferring detach.\n"); + return (EBUSY); + } if (dev->state != DS_ATTACHED) return (0); From owner-svn-src-head@freebsd.org Fri Mar 1 01:20:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F29815216FF; Fri, 1 Mar 2019 01:20:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9CF56C39B; Fri, 1 Mar 2019 01:20:22 +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 ABFD8D63D; Fri, 1 Mar 2019 01:20:22 +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 x211KMlm027813; Fri, 1 Mar 2019 01:20:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x211KMBb027810; Fri, 1 Mar 2019 01:20:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201903010120.x211KMBb027810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 1 Mar 2019 01:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344677 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 344677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9CF56C39B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 01:20:23 -0000 Author: kevans Date: Fri Mar 1 01:20:21 2019 New Revision: 344677 URL: https://svnweb.freebsd.org/changeset/base/344677 Log: patch(1): Exit successfully if we're fed a 0-length patch This change is made in the name of GNU patch compatibility. If GNU patch is fed a zero-length patch, it will exit successfully with no output. This is used in at least one port to date (comms/wsjtx), and we break on this usage. It seems unlikely that anyone relies on patch(1) calling their completely empty patch garbage and failing, and GNU compatibility is a plus if it helps with porting, so make the switch. Reported by: db MFC after: 2 weeks Modified: head/usr.bin/patch/common.h head/usr.bin/patch/patch.c head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/common.h ============================================================================== --- head/usr.bin/patch/common.h Fri Mar 1 01:18:39 2019 (r344676) +++ head/usr.bin/patch/common.h Fri Mar 1 01:20:21 2019 (r344677) @@ -64,6 +64,7 @@ extern size_t buf_size; /* size of general purpose buf extern bool using_plan_a; /* try to keep everything in memory */ extern bool out_of_mem; /* ran out of memory in plan a */ +extern bool nonempty_patchf_seen; /* seen a non-zero-length patch file? */ #define MAXFILEC 2 Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Fri Mar 1 01:18:39 2019 (r344676) +++ head/usr.bin/patch/patch.c Fri Mar 1 01:20:21 2019 (r344677) @@ -53,6 +53,7 @@ size_t buf_size; /* size of the general purpose buff bool using_plan_a = true; /* try to keep everything in memory */ bool out_of_mem = false; /* ran out of memory in plan a */ +bool nonempty_patchf_seen = false; /* seen nonempty patch file? */ #define MAXFILEC 2 @@ -419,7 +420,7 @@ main(int argc, char *argv[]) set_signals(1); } - if (!patch_seen) + if (!patch_seen && nonempty_patchf_seen) error = 2; my_exit(error); Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Fri Mar 1 01:18:39 2019 (r344676) +++ head/usr.bin/patch/pch.c Fri Mar 1 01:20:21 2019 (r344677) @@ -179,6 +179,9 @@ there_is_another_patch(void) say("done\n"); return false; } + if (p_filesize == 0) + return false; + nonempty_patchf_seen = true; if (verbose) say("Hmm..."); diff_type = intuit_diff_type(); From owner-svn-src-head@freebsd.org Fri Mar 1 01:39:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F2ED1521F6E; Fri, 1 Mar 2019 01:39:56 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A79686CFD2; Fri, 1 Mar 2019 01:39:55 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com [209.85.166.170]) (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: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 7C91D14E1F; Fri, 1 Mar 2019 01:39:55 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it1-f170.google.com with SMTP id v2so17823980ith.3; Thu, 28 Feb 2019 17:39:55 -0800 (PST) X-Gm-Message-State: AHQUAuaOK+3320eOwlo1+JgjXn8OPopeBBk/4k6XvX28c8k19aWRyj6g xtHjvfR3ypvjPzd1fFMEuJSTLm/O9JCKfVOUvOg= X-Google-Smtp-Source: APXvYqwoJUMMgW/KKDvcwXmpfM0vnjYVgKwbdU5Pjc4qmFCF1o2V39xMsQZ2eq6plIQ0tqheb2Lf/XfJnmzb6QBI6i4= X-Received: by 2002:a24:2b0e:: with SMTP id h14mr1594574ita.168.1551404394884; Thu, 28 Feb 2019 17:39:54 -0800 (PST) MIME-Version: 1.0 References: <201902232114.x1NLE0cH085345@repo.freebsd.org> In-Reply-To: From: Matthew Macy Date: Thu, 28 Feb 2019 17:39:43 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A79686CFD2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 01:39:56 -0000 to config add: options LINDEBUGFS options GCOV compile kernel with gcc (otherwise it will be a no-op) sysctl debug.gcov.enable=1 mount -t debugfs debugfs /sys/kernel/debug (or wherever) and the output artifacts will appear under gcov/ - you need to be root to see the artifacts gcov can then generate the results as it would normally from the profiling and the build time artifacts bug reports welcome -M On Thu, Feb 28, 2019 at 2:50 PM Alan Somers wrote: > > On Sat, Feb 23, 2019 at 2:14 PM Matt Macy wrote: > > > > Author: mmacy > > Date: Sat Feb 23 21:14:00 2019 > > New Revision: 344487 > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > Log: > > gcov support > > > > add gcov support and export results as files in debugfs > > > > Reviewed by: hps@ > > MFC after: 1 week > > Sponsored by: iX Systems > > Differential Revision: https://reviews.freebsd.org/D19260 > > > > Added: > > head/sys/gnu/gcov/ > > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > > head/sys/gnu/gcov/gcov.h (contents, props changed) > > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > > Modified: > > head/sys/conf/files > > head/sys/conf/kern.mk > > head/sys/conf/kern.post.mk > > head/sys/conf/kern.pre.mk > > head/sys/conf/kmod.mk > > head/sys/conf/options > > On a more practical note, how does one use this new feature? It looks > like it could be quite useful. > -Alan From owner-svn-src-head@freebsd.org Fri Mar 1 01:57:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08386152278F; Fri, 1 Mar 2019 01:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C55A6D97A; Fri, 1 Mar 2019 01:57:23 +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 8C429DD17; Fri, 1 Mar 2019 01:57:23 +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 x211vNrK048587; Fri, 1 Mar 2019 01:57:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x211vN5w048586; Fri, 1 Mar 2019 01:57:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201903010157.x211vN5w048586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Mar 2019 01:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344678 - head/sys/dev/cxgb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/cxgb X-SVN-Commit-Revision: 344678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C55A6D97A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 01:57:24 -0000 Author: cem Date: Fri Mar 1 01:57:22 2019 New Revision: 344678 URL: https://svnweb.freebsd.org/changeset/base/344678 Log: cxgb(4): Netdump: only reference allocated qsets SGE_QSETS is an upper bound -- fewer qsets may be allocated depending on the number of CPUs. Reviewed by: markj, np, vangyzen X-MFC-With: r333288 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17274 Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Fri Mar 1 01:20:21 2019 (r344677) +++ head/sys/dev/cxgb/cxgb_adapter.h Fri Mar 1 01:57:22 2019 (r344678) @@ -363,6 +363,7 @@ struct adapter { unsigned int slow_intr_mask; unsigned long irq_stats[IRQ_NUM_STATS]; + unsigned nqsets; struct sge sge; struct mc7 pmrx; struct mc7 pmtx; Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Fri Mar 1 01:20:21 2019 (r344677) +++ head/sys/dev/cxgb/cxgb_main.c Fri Mar 1 01:57:22 2019 (r344678) @@ -853,6 +853,8 @@ setup_sge_qsets(adapter_t *sc) } } + sc->nqsets = qset_idx; + return (0); } @@ -3598,7 +3600,7 @@ cxgb_netdump_init(struct ifnet *ifp, int *nrxr, int *n pi = if_getsoftc(ifp); adap = pi->adapter; ADAPTER_LOCK(adap); - *nrxr = SGE_QSETS; + *nrxr = adap->nqsets; *ncl = adap->sge.qs[0].fl[1].size; *clsize = adap->sge.qs[0].fl[1].buf_size; ADAPTER_UNLOCK(adap); @@ -3613,7 +3615,7 @@ cxgb_netdump_event(struct ifnet *ifp, enum netdump_ev pi = if_getsoftc(ifp); if (event == NETDUMP_START) - for (i = 0; i < SGE_QSETS; i++) { + for (i = 0; i < pi->adapter->nqsets; i++) { qs = &pi->adapter->sge.qs[i]; /* Need to reinit after netdump_mbuf_dump(). */ @@ -3650,7 +3652,7 @@ cxgb_netdump_poll(struct ifnet *ifp, int count) return (ENOENT); adap = pi->adapter; - for (i = 0; i < SGE_QSETS; i++) + for (i = 0; i < adap->nqsets; i++) (void)cxgb_netdump_poll_rx(adap, &adap->sge.qs[i]); (void)cxgb_netdump_poll_tx(&adap->sge.qs[pi->first_qset]); return (0); From owner-svn-src-head@freebsd.org Fri Mar 1 02:08:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4E711522FD3; Fri, 1 Mar 2019 02:08:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42B5C6DFFD; Fri, 1 Mar 2019 02:08:13 +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 3214BDECE; Fri, 1 Mar 2019 02:08:13 +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 x2128Dbx053604; Fri, 1 Mar 2019 02:08:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2128D5T053603; Fri, 1 Mar 2019 02:08:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903010208.x2128D5T053603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 1 Mar 2019 02:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344679 - head/sys/modules/geom/geom_flashmap X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/modules/geom/geom_flashmap X-SVN-Commit-Revision: 344679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42B5C6DFFD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 02:08:13 -0000 Author: jhibbits Date: Fri Mar 1 02:08:12 2019 New Revision: 344679 URL: https://svnweb.freebsd.org/changeset/base/344679 Log: Revert r344675 It's an incorrect approach to solve the problem. We already have a fdt/fdt_slicer module, it just needs to be wired into the build. Modified: head/sys/modules/geom/geom_flashmap/Makefile Modified: head/sys/modules/geom/geom_flashmap/Makefile ============================================================================== --- head/sys/modules/geom/geom_flashmap/Makefile Fri Mar 1 01:57:22 2019 (r344678) +++ head/sys/modules/geom/geom_flashmap/Makefile Fri Mar 1 02:08:12 2019 (r344679) @@ -5,9 +5,4 @@ KMOD= geom_flashmap SRCS= geom_flashmap.c -.if !empty(OPT_FDT) -.PATH: ${SRCTOP}/sys/dev/fdt -SRCS+= fdt_slicer.c -.endif - .include From owner-svn-src-head@freebsd.org Fri Mar 1 02:10:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61DA8152311E; Fri, 1 Mar 2019 02:10:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) (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 CAE7F6E2A0; Fri, 1 Mar 2019 02:10:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x533.google.com with SMTP id l11so10629392pgq.10; Thu, 28 Feb 2019 18:10:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=krgJt7W/NA5ytxWlt+nRHtiir+HgnsdsOTVd/LHMEG4=; b=XcxZAJeJPHlrnsogOHWOG/gBMSOActWSSPdqkqBl+Mr/ETSDsPyIHj6LliVA8VY/t+ Ly9YCIrmY4RmrA3Fm4JYIG15x8BhH/sG+UWIM8Vq/D4ep3ampNpLumdUOrvQE2/hEZOs 3/EMS68bmLHQYE2fNv88Gno3Da1xYME4vtsJzz/32BilKwvib0bgYV63YOeqS6INq11c SW28WdLiu7jqknHAbvHzAaGemy024NmIc3C/SkiGmBsGRZ5ZJkMohjTaEfLwJa1jPFJK fCML9VbLYQr4ougPT+U38O4wrWoRM7ugWT/g6sYE/hacaCk2NYGsp23eS+aogtcbsGrZ RJgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=krgJt7W/NA5ytxWlt+nRHtiir+HgnsdsOTVd/LHMEG4=; b=dwV0FuUidRPMTq91Coy1GuXSR1AwDjNQFUBZKbGlq4UbZtiuk3vbwlpSVXwWEDNMz5 Uc1rgfVNbXUBQqszg//ym2f1tdfWqCJO6oUBc7/A9h/ZGiKa0ZTxIUpCYbBz20cuwim1 mwpbm6w/6BHJk3A4mSO62S3+Mf/SplYhJdFhIi/6ml5e+umoxhK4ZkQxAGrZXmISkTu1 KZAaEqeh1OJJqTxjY+TYdVjxTH/EbWo3yfRxKnXKBS11mtIR7RkqZKeVNO3ecZi8fctp qfZMNkv3Hotwp94OT9wUQZqlLwNnQawU8S8yxAsQu2bd61xU+pngVGz29l/4qSae8NuQ x6jg== X-Gm-Message-State: APjAAAXS3kM5MNhCJY3PQEpc8IsRlaUDe/pcfUIu19On/+OsCEMtHqKS fpitDyBVWvrGx/0jtQZh7ON0xGW+ X-Google-Smtp-Source: APXvYqw6A0wIWTCkaZR6/mrl5k+q7G4qDKnw/9+uze7/uZakfZULZtvYzJPEiAokd77tJyWbeahREw== X-Received: by 2002:a65:4608:: with SMTP id v8mr2432953pgq.9.1551406241337; Thu, 28 Feb 2019 18:10:41 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s79sm12374121pfa.61.2019.02.28.18.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 18:10:40 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov From: Enji Cooper In-Reply-To: Date: Thu, 28 Feb 2019 18:10:39 -0800 Cc: Alan Somers , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <710DC3F1-CEBA-4450-B484-7E4A94CDB67D@gmail.com> References: <201902232114.x1NLE0cH085345@repo.freebsd.org> To: Matthew Macy X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: CAE7F6E2A0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 02:10:43 -0000 > On Feb 28, 2019, at 5:39 PM, Matthew Macy wrote: >=20 > to config add: > options LINDEBUGFS > options GCOV >=20 > compile kernel with gcc (otherwise it will be a no-op) >=20 > sysctl debug.gcov.enable=3D1 >=20 > mount -t debugfs debugfs /sys/kernel/debug >=20 > (or wherever) and the output artifacts will appear under gcov/ build path> - you need to be root to see the artifacts >=20 > gcov can then generate the results as it would normally from the > profiling and the build time artifacts >=20 > bug reports welcome Shouldn=E2=80=99t this be documented on the wiki? Thanks! -Enji= From owner-svn-src-head@freebsd.org Fri Mar 1 02:31:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 955621523D00; Fri, 1 Mar 2019 02:31:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36E006F117; Fri, 1 Mar 2019 02:31:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28E91E3AA; Fri, 1 Mar 2019 02:31:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x212VhEj066190; Fri, 1 Mar 2019 02:31:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x212Vhto066189; Fri, 1 Mar 2019 02:31:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201903010231.x212Vhto066189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 1 Mar 2019 02:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344681 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 344681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36E006F117 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 02:31:44 -0000 Author: ian Date: Fri Mar 1 02:31:43 2019 New Revision: 344681 URL: https://svnweb.freebsd.org/changeset/base/344681 Log: Build fdt support modules on systems that use fdt data. kern.opts.mk sets make var OPT_FDT to a non-empty value if platform.h contains OPT_FDT. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Mar 1 02:16:37 2019 (r344680) +++ head/sys/modules/Makefile Fri Mar 1 02:31:43 2019 (r344681) @@ -474,6 +474,10 @@ SUBDIR+= iscsi SUBDIR+= iscsi_initiator .endif +.if !empty(OPT_FDT) +SUBDIR+= fdt +.endif + .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" SUBDIR+= linprocfs @@ -538,7 +542,7 @@ SUBDIR+= zfs .if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "") _hwpmc_mips24k= hwpmc_mips24k -_hwpmc_mips74k= hwpmc_mips74k +_hwpmc_mips74k= hwpmc_mips74kwheel .endif .if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \ From owner-svn-src-head@freebsd.org Fri Mar 1 02:43:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC34C1500135; Fri, 1 Mar 2019 02:43:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59D4A6F6CC; Fri, 1 Mar 2019 02:43:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4609EE5AD; Fri, 1 Mar 2019 02:43:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x212hVB9074267; Fri, 1 Mar 2019 02:43:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x212hVSg074266; Fri, 1 Mar 2019 02:43:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201903010243.x212hVSg074266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 1 Mar 2019 02:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344682 - 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: 344682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59D4A6F6CC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 02:43:31 -0000 Author: np Date: Fri Mar 1 02:43:30 2019 New Revision: 344682 URL: https://svnweb.freebsd.org/changeset/base/344682 Log: cxgbe(4): Don't forget to report link state to the kernel if the link is already up at attach. Reported by: Fabrice Bruel @ Orange Business Service MFC after: 1 week 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 Fri Mar 1 02:31:43 2019 (r344681) +++ head/sys/dev/cxgbe/t4_main.c Fri Mar 1 02:43:30 2019 (r344682) @@ -5074,6 +5074,8 @@ cxgbe_init_synchronized(struct vi_info *vi) callout_reset(&vi->tick, hz, vi_tick, vi); else callout_reset(&pi->tick, hz, cxgbe_tick, pi); + if (pi->link_cfg.link_ok) + t4_os_link_changed(pi); PORT_UNLOCK(pi); done: if (rc != 0) From owner-svn-src-head@freebsd.org Fri Mar 1 02:49:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48CE715003BC; Fri, 1 Mar 2019 02:49:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E02D76F9D8; Fri, 1 Mar 2019 02:49:48 +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 CDA34E5B8; Fri, 1 Mar 2019 02:49:48 +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 x212nmhm074587; Fri, 1 Mar 2019 02:49:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x212nloc074582; Fri, 1 Mar 2019 02:49:47 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903010249.x212nloc074582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 1 Mar 2019 02:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344683 - in head/sys: conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv X-SVN-Commit-Revision: 344683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E02D76F9D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 02:49:49 -0000 Author: jhibbits Date: Fri Mar 1 02:49:47 2019 New Revision: 344683 URL: https://svnweb.freebsd.org/changeset/base/344683 Log: powerpc/powernv: Add asynchronous token management for powernv The OPAL firmware only supports a finite number of in-flight asynchronous operations. Rather than have each subsystem try to manage its own, use a central management service to hand out tokens. More work can be done to improve asynchronous behavior, such as funneling things through a future OPAL heartbeat handler, but capabilities will be added as needed. Augment the existing consumers (i2c and sensors) to use this new API. MFC after: 4 weeks Added: head/sys/powerpc/powernv/opal_async.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_dev.c head/sys/powerpc/powernv/opal_i2c.c head/sys/powerpc/powernv/opal_sensor.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Mar 1 02:43:30 2019 (r344682) +++ head/sys/conf/files.powerpc Fri Mar 1 02:49:47 2019 (r344683) @@ -189,6 +189,7 @@ powerpc/powermac/uninorth.c optional powermac powerpc/powermac/uninorthpci.c optional powermac pci powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv +powerpc/powernv/opal_async.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv powerpc/powernv/opal_i2c.c optional iicbus fdt powernv Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Fri Mar 1 02:43:30 2019 (r344682) +++ head/sys/powerpc/powernv/opal.h Fri Mar 1 02:49:47 2019 (r344683) @@ -168,4 +168,9 @@ struct opal_ipmi_msg { uint8_t data[]; }; +int opal_init_async_tokens(int); +int opal_alloc_async_token(void); +void opal_free_async_token(int); +int opal_wait_completion(void *, uint64_t, uint64_t); + #endif Added: head/sys/powerpc/powernv/opal_async.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_async.c Fri Mar 1 02:49:47 2019 (r344683) @@ -0,0 +1,94 @@ +/*- + * Copyright (C) 2019 Justin Hibbits + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH 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$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include "opal.h" + +/* + * Manage asynchronous tokens for the OPAL abstraction layer. + * + * Only a finite number of in-flight tokens are supported by OPAL, so we must be + * careful managing this. The basic design uses the vmem subsystem as a general + * purpose allocator, with wrappers to manage expected behaviors and + * requirements. + */ +static vmem_t *async_token_pool; + +/* Setup the token pool. */ +int +opal_init_async_tokens(int count) +{ + /* Only allow one initialization */ + if (async_token_pool != NULL) + return (EINVAL); + + async_token_pool = vmem_create("OPAL Async", 0, count, 1, 1, + M_WAITOK | M_FIRSTFIT); + + return (0); +} + +int +opal_alloc_async_token(void) +{ + vmem_addr_t token; + + vmem_alloc(async_token_pool, 1, M_FIRSTFIT | M_WAITOK, &token); + + return (token); +} + +void +opal_free_async_token(int token) +{ + + vmem_free(async_token_pool, token, 1); +} + +/* + * Wait for the operation watched by the token to complete. Return the result + * of the operation, error if it returns early. + */ +int +opal_wait_completion(void *buf, uint64_t size, uint64_t token) +{ + int err; + + do { + err = opal_call(OPAL_CHECK_ASYNC_COMPLETION, + vtophys(buf), size, token); + } while (err == OPAL_BUSY); + + return (err); +} Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Fri Mar 1 02:43:30 2019 (r344682) +++ head/sys/powerpc/powernv/opal_dev.c Fri Mar 1 02:49:47 2019 (r344683) @@ -135,6 +135,7 @@ opaldev_attach(device_t dev) device_t cdev; uint64_t junk; int i, rv; + uint32_t async_count; struct ofw_bus_devinfo *dinfo; struct resource *irq; @@ -158,6 +159,10 @@ opaldev_attach(device_t dev) bus_setup_intr(dev, irq, INTR_TYPE_TTY | INTR_MPSAFE | INTR_ENTROPY, NULL, opal_intr, (void *)rman_get_start(irq), NULL); + + OF_getencprop(ofw_bus_get_node(dev), "opal-msg-async-num", + &async_count, sizeof(async_count)); + opal_init_async_tokens(async_count); for (child = OF_child(ofw_bus_get_node(dev)); child != 0; child = OF_peer(child)) { Modified: head/sys/powerpc/powernv/opal_i2c.c ============================================================================== --- head/sys/powerpc/powernv/opal_i2c.c Fri Mar 1 02:43:30 2019 (r344682) +++ head/sys/powerpc/powernv/opal_i2c.c Fri Mar 1 02:49:47 2019 (r344683) @@ -168,35 +168,28 @@ i2c_opal_send_request(uint32_t bus_id, struct opal_i2c { struct opal_msg msg; uint64_t token; - uint64_t msg_addr; int rc; - /* - * XXX: - * Async tokens should be managed globally. Since there are only a very - * few places now, use a punning of the stack address of the message. - */ - token = (uintptr_t)&msg; + token = opal_alloc_async_token(); memset(&msg, 0, sizeof(msg)); - msg_addr = pmap_kextract((vm_offset_t)&msg); rc = opal_call(OPAL_I2C_REQUEST, token, bus_id, - pmap_kextract((uint64_t)req)); + vtophys(req)); if (rc != OPAL_ASYNC_COMPLETION) - return (rc); + goto out; - do { - rc = opal_call(OPAL_CHECK_ASYNC_COMPLETION, - msg_addr, sizeof(msg), token); - } while (rc == OPAL_BUSY); + rc = opal_wait_completion(&msg, sizeof(msg), token); if (rc != OPAL_SUCCESS) - return (rc); + goto out; rc = opal_get_async_rc(msg); - return rc; +out: + opal_free_async_token(token); + + return (rc); } static int Modified: head/sys/powerpc/powernv/opal_sensor.c ============================================================================== --- head/sys/powerpc/powernv/opal_sensor.c Fri Mar 1 02:43:30 2019 (r344682) +++ head/sys/powerpc/powernv/opal_sensor.c Fri Mar 1 02:49:47 2019 (r344683) @@ -95,33 +95,28 @@ opal_sensor_get_val(uint32_t key, uint64_t *val) { struct opal_msg msg; uint32_t val32; - int i, rv; + int rv, token; - rv = opal_call(OPAL_SENSOR_READ, key, key, vtophys(&val32)); + token = opal_alloc_async_token(); + rv = opal_call(OPAL_SENSOR_READ, key, token, vtophys(&val32)); if (rv == OPAL_ASYNC_COMPLETION) { /* Sleep a little to let things settle. */ DELAY(100); bzero(&msg, sizeof(msg)); - i = 0; - do { - rv = opal_call(OPAL_CHECK_ASYNC_COMPLETION, - vtophys(&msg), sizeof(msg), key); - /* Sleep for ~100us if necessary. */ - if (rv == OPAL_BUSY) - DELAY(100); - } while (rv == OPAL_BUSY && ++i < 10); - if (rv != OPAL_SUCCESS) - return (EIO); - val32 = msg.params[0]; + rv = opal_wait_completion(&msg, sizeof(msg), token); + + if (rv == OPAL_SUCCESS) + val32 = msg.params[0]; } - if (rv != OPAL_SUCCESS) - return (EIO); - - *val = val32; + if (rv == OPAL_SUCCESS) + *val = val32; + else + rv = EIO; - return (0); + opal_free_async_token(token); + return (rv); } static int From owner-svn-src-head@freebsd.org Fri Mar 1 02:53:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B01AE15006B3; Fri, 1 Mar 2019 02:53:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 505676FEE1; Fri, 1 Mar 2019 02:53:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 410E3E768; Fri, 1 Mar 2019 02:53:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x212rtet079956; Fri, 1 Mar 2019 02:53:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x212rt2F079955; Fri, 1 Mar 2019 02:53:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201903010253.x212rt2F079955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 1 Mar 2019 02:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344684 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 344684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 505676FEE1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 02:53:55 -0000 Author: ian Date: Fri Mar 1 02:53:54 2019 New Revision: 344684 URL: https://svnweb.freebsd.org/changeset/base/344684 Log: Undo accidental part of r344681. I think I must have accidentally mouse-click pasted while scrolling and didn't notice it. Reported by: jhibbits@ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Mar 1 02:49:47 2019 (r344683) +++ head/sys/modules/Makefile Fri Mar 1 02:53:54 2019 (r344684) @@ -542,7 +542,7 @@ SUBDIR+= zfs .if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "") _hwpmc_mips24k= hwpmc_mips24k -_hwpmc_mips74k= hwpmc_mips74kwheel +_hwpmc_mips74k= hwpmc_mips74k .endif .if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \ From owner-svn-src-head@freebsd.org Fri Mar 1 03:09:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB0FE1501200; Fri, 1 Mar 2019 03:09:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FD0F70EB8; Fri, 1 Mar 2019 03:09:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F493E9A1; Fri, 1 Mar 2019 03:09:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2139iEm087016; Fri, 1 Mar 2019 03:09:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2139inV087015; Fri, 1 Mar 2019 03:09:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201903010309.x2139inV087015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 1 Mar 2019 03:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344685 - head/sys/modules/fdt/fdt_slicer X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/fdt/fdt_slicer X-SVN-Commit-Revision: 344685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FD0F70EB8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 03:09:44 -0000 Author: ian Date: Fri Mar 1 03:09:43 2019 New Revision: 344685 URL: https://svnweb.freebsd.org/changeset/base/344685 Log: Add required header file to SRCS. Modified: head/sys/modules/fdt/fdt_slicer/Makefile Modified: head/sys/modules/fdt/fdt_slicer/Makefile ============================================================================== --- head/sys/modules/fdt/fdt_slicer/Makefile Fri Mar 1 02:53:54 2019 (r344684) +++ head/sys/modules/fdt/fdt_slicer/Makefile Fri Mar 1 03:09:43 2019 (r344685) @@ -7,6 +7,7 @@ SRCS= fdt_slicer.c # Generated files... SRCS+= \ + device_if.h \ ofw_bus_if.h \ opt_platform.h \ From owner-svn-src-head@freebsd.org Fri Mar 1 03:11:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85522150133D; Fri, 1 Mar 2019 03:11:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 011F4710D4; Fri, 1 Mar 2019 03:11:04 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f52.google.com with SMTP id a8so11106921lfi.7; Thu, 28 Feb 2019 19:11:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mcys8F9sK65mf8u3gIWCIi15AwteAWM5eKjuWna92/Y=; b=WF8arhQ8GSaus8A0wX9t+QxZgdYp/tbgDd5Mqz6vUdzQW7kINQb5d8WFCFeo6Ao/Mh sLJ+gvuJrEJDJgTHEVIR2CqwTncVOwlkMFu8kt8CjzBuPi0V7iHNhXkyoM+BdFvXk5uB UZZEw02r0+TYF/hgoZpxmEQFXtQa568tSOvNMLoRv2pBKe+mfDrd1OBYg2N6QaSBkEH/ DSIW7AKbat2TbSGnw8nUcKr5ptG6E9SBFc37eS/beOdB8jHX1Yb69XZZ9uf/i6Gu4g0i aHQR9OWOAOGq/VuRRGdh9siQW8Jk5q3zupooMEEjlIS/IBaNLjY5KomZiJnTPTViXCI4 RcRQ== X-Gm-Message-State: APjAAAWDbEN89ho6iD39rXXGIllbuEamCR9es4EBeOZI8F4y+Ey6T7AV 70S0va2g574zhsYS1wy3G3E+BC2nbat/TXtKmfAr+KaO X-Google-Smtp-Source: APXvYqwERQBc3schfBl86w5F8YRC+1zuBCoz3J8hw6qpruLqVGYpH8Rj59XKRwS+eRW5nXo4FeL7T5CKT9AYZxp2vK8= X-Received: by 2002:ac2:415a:: with SMTP id c26mr1655356lfi.62.1551409862684; Thu, 28 Feb 2019 19:11:02 -0800 (PST) MIME-Version: 1.0 References: <201902232114.x1NLE0cH085345@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Thu, 28 Feb 2019 20:10:50 -0700 Message-ID: Subject: Re: svn commit: r344487 - in head/sys: conf gnu/gcov To: Matthew Macy Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 011F4710D4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 03:11:05 -0000 On Thu, Feb 28, 2019 at 6:40 PM Matthew Macy wrote: > > to config add: > options LINDEBUGFS > options GCOV > > compile kernel with gcc (otherwise it will be a no-op) > > sysctl debug.gcov.enable=1 > > mount -t debugfs debugfs /sys/kernel/debug > > (or wherever) and the output artifacts will appear under gcov/ build path> - you need to be root to see the artifacts > > gcov can then generate the results as it would normally from the > profiling and the build time artifacts > > bug reports welcome > > > -M Here's a bug report: I rebuilt the kernel but boot fails with this error. Do I need to rebuild world too? Mounting local filesystems:kldload: fdescfs.ko: lost base for reltab linker_load_file: /boot/kernel/fdescfs.ko - unsupported file type mount: fdescfs: Operation not supported by device Mounting /etc/fstab filesystems failed, will retry after root mount hold release kldload: fdescfs.ko: lost base for reltab linker_load_file: /boot/kernel/fdescfs.ko - unsupported file type mount: fdescfs: Operation not supported by device . Mounting /etc/fstab filesystems failed, startup aborted From owner-svn-src-head@freebsd.org Fri Mar 1 04:17:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BDF21503253; Fri, 1 Mar 2019 04:17:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1980973265; Fri, 1 Mar 2019 04:17:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 068C6F607; Fri, 1 Mar 2019 04:17:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x214HhEn023237; Fri, 1 Mar 2019 04:17:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x214Hh5C023236; Fri, 1 Mar 2019 04:17:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201903010417.x214Hh5C023236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 1 Mar 2019 04:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344686 - head/sys/modules/fdt/fdt_slicer X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/fdt/fdt_slicer X-SVN-Commit-Revision: 344686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1980973265 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 04:17:44 -0000 Author: ian Date: Fri Mar 1 04:17:43 2019 New Revision: 344686 URL: https://svnweb.freebsd.org/changeset/base/344686 Log: Add another required header file. For some reason this seems to be required on aarch64, but I can build armv7 from clean without needing this in the list. (The file does get included, so the mystery is why armv7 works.) Modified: head/sys/modules/fdt/fdt_slicer/Makefile Modified: head/sys/modules/fdt/fdt_slicer/Makefile ============================================================================== --- head/sys/modules/fdt/fdt_slicer/Makefile Fri Mar 1 03:09:43 2019 (r344685) +++ head/sys/modules/fdt/fdt_slicer/Makefile Fri Mar 1 04:17:43 2019 (r344686) @@ -7,6 +7,7 @@ SRCS= fdt_slicer.c # Generated files... SRCS+= \ + bus_if.h \ device_if.h \ ofw_bus_if.h \ opt_platform.h \ From owner-svn-src-head@freebsd.org Fri Mar 1 04:36:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 787441503C2B; Fri, 1 Mar 2019 04:36:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15E3073C59; Fri, 1 Mar 2019 04:36: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 F1675F97C; Fri, 1 Mar 2019 04:36:55 +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 x214attY033501; Fri, 1 Mar 2019 04:36:55 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x214at8r033498; Fri, 1 Mar 2019 04:36:55 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903010436.x214at8r033498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 1 Mar 2019 04:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344687 - in head/sys: conf powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/powernv X-SVN-Commit-Revision: 344687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15E3073C59 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 04:36:56 -0000 Author: jhibbits Date: Fri Mar 1 04:36:55 2019 New Revision: 344687 URL: https://svnweb.freebsd.org/changeset/base/344687 Log: powerpc/powernv: Add OPAL flash device driver Firmware needed by petitboot, for example, GPU firmware, can be installed to a partition in the flash filesystem. This driver exposes the full flash given by the device tree, letting the user manage firmware, etc, from FreeBSD. To use the partitions provided by the flash module, the fdt_slicer module is needed, but the module isn't needed for raw access, so there's no direct dependency link in here. MFC after: 2 weeks Added: head/sys/powerpc/powernv/opal_flash.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/powernv/opal.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Mar 1 04:17:43 2019 (r344686) +++ head/sys/conf/files.powerpc Fri Mar 1 04:36:55 2019 (r344687) @@ -192,6 +192,7 @@ powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_async.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv +powerpc/powernv/opal_flash.c optional powernv powerpc/powernv/opal_i2c.c optional iicbus fdt powernv powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv powerpc/powernv/opal_pci.c optional powernv pci Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Fri Mar 1 04:17:43 2019 (r344686) +++ head/sys/powerpc/powernv/opal.h Fri Mar 1 04:36:55 2019 (r344687) @@ -76,6 +76,9 @@ int opal_call(uint64_t token, ...); #define OPAL_IPMI_SEND 107 #define OPAL_IPMI_RECV 108 #define OPAL_I2C_REQUEST 109 +#define OPAL_FLASH_READ 110 +#define OPAL_FLASH_WRITE 111 +#define OPAL_FLASH_ERASE 111 #define OPAL_INT_GET_XIRR 122 #define OPAL_INT_SET_CPPR 123 #define OPAL_INT_EOI 124 Added: head/sys/powerpc/powernv/opal_flash.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powernv/opal_flash.c Fri Mar 1 04:36:55 2019 (r344687) @@ -0,0 +1,372 @@ +/*- + * Copyright (c) 2019 Justin Hibbits + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include "opal.h" + +/* + * OPAL System flash driver, using OPAL firmware calls to access the device. + * + * This just presents the base block interface. The fdt_slicer can be used on + * top to present the partitions listed in the fdt. + * + * There are three OPAL methods used: OPAL_FLASH_READ, OPAL_FLASH_WRITE, and + * OPAL_FLASH_ERASE. At the firmware layer, READ and WRITE can be on arbitrary + * boundaries, but ERASE is only at flash-block-size block alignments and sizes. + * To account for this, the following restrictions are in place: + * + * - Reads are on a 512-byte block boundary and size + * - Writes and Erases are aligned and sized on flash-block-size bytes. + * + * In order to support the fdt_slicer we present a type attribute of + * NAND::device. + */ +struct opalflash_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct disk *sc_disk; + struct proc *sc_p; + struct bio_queue_head sc_bio_queue; + int sc_opal_id; +}; + +#define OPALFLASH_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define OPALFLASH_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) +#define OPALFLASH_LOCK_INIT(sc) \ + mtx_init(&(sc)->sc_mtx, device_get_nameunit((sc)->sc_dev), \ + "opalflash", MTX_DEF) + +#define FLASH_BLOCKSIZE 512 + +static int opalflash_probe(device_t); +static int opalflash_attach(device_t); + +static device_method_t opalflash_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, opalflash_probe), + DEVMETHOD(device_attach, opalflash_attach), + + DEVMETHOD_END +}; + +static driver_t opalflash_driver = { + "opalflash", + opalflash_methods, + sizeof(struct opalflash_softc) +}; + +static devclass_t opalflash_devclass; + +DRIVER_MODULE(opalflash, opal, opalflash_driver, opalflash_devclass, 0, 0); + +/* GEOM Disk interfaces. */ +static int +opalflash_open(struct disk *dp) +{ + + return (0); +} + +static int +opalflash_close(struct disk *dp) +{ + + return (0); +} + +static int +opalflash_ioctl(struct disk *dp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + + return (EINVAL); +} + +/* Handle the one attribute we need to play nice with geom_flashmap. */ +static int +opalflash_getattr(struct bio *bp) +{ + struct opalflash_softc *sc; + device_t dev; + + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) + return (ENXIO); + + sc = bp->bio_disk->d_drv1; + dev = sc->sc_dev; + + if (strcmp(bp->bio_attribute, "NAND::device") == 0) { + if (bp->bio_length != sizeof(dev)) + return (EFAULT); + bcopy(&dev, bp->bio_data, sizeof(dev)); + } else + return (-1); + return (0); +} + +static void +opalflash_strategy(struct bio *bp) +{ + struct opalflash_softc *sc; + + sc = (struct opalflash_softc *)bp->bio_disk->d_drv1; + OPALFLASH_LOCK(sc); + bioq_disksort(&sc->sc_bio_queue, bp); + wakeup(sc); + OPALFLASH_UNLOCK(sc); +} + +static int +opalflash_read(struct opalflash_softc *sc, off_t off, + caddr_t data, off_t count) +{ + struct opal_msg msg; + int rv, size, token; + + /* Ensure we write aligned to a full block size. */ + if (off % sc->sc_disk->d_sectorsize != 0 || + count % sc->sc_disk->d_sectorsize != 0) + return (EIO); + + token = opal_alloc_async_token(); + + /* + * Read one page at a time. It's not guaranteed that the buffer is + * physically contiguous. + */ + while (count > 0) { + size = MIN(count, PAGE_SIZE); + rv = opal_call(OPAL_FLASH_READ, sc->sc_opal_id, off, + vtophys(data), size, token); + if (rv == OPAL_ASYNC_COMPLETION) + rv = opal_wait_completion(&msg, sizeof(msg), token); + if (rv != OPAL_SUCCESS) + break; + count -= size; + off += size; + } + opal_free_async_token(token); + if (rv == OPAL_SUCCESS) + rv = 0; + else + rv = EIO; + + return (rv); +} + +static int +opalflash_erase(struct opalflash_softc *sc, off_t off, off_t count) +{ + struct opal_msg msg; + int rv, token; + + /* Ensure we write aligned to a full block size. */ + if (off % sc->sc_disk->d_stripesize != 0 || + count % sc->sc_disk->d_stripesize != 0) + return (EIO); + + token = opal_alloc_async_token(); + + rv = opal_call(OPAL_FLASH_ERASE, sc->sc_opal_id, off, count, token); + if (rv == OPAL_ASYNC_COMPLETION) + rv = opal_wait_completion(&msg, sizeof(msg), token); + opal_free_async_token(token); + + if (rv == OPAL_SUCCESS) + rv = 0; + else + rv = EIO; + + return (rv); +} + +static int +opalflash_write(struct opalflash_softc *sc, off_t off, + caddr_t data, off_t count) +{ + struct opal_msg msg; + int rv, size, token; + + /* Ensure we write aligned to a full block size. */ + if (off % sc->sc_disk->d_stripesize != 0 || + count % sc->sc_disk->d_stripesize != 0) + return (EIO); + + /* Erase the full block first, then write in page chunks. */ + rv = opalflash_erase(sc, off, count); + if (rv != 0) + return (rv); + + token = opal_alloc_async_token(); + + /* + * Write one page at a time. It's not guaranteed that the buffer is + * physically contiguous. + */ + while (count > 0) { + size = MIN(count, PAGE_SIZE); + rv = opal_call(OPAL_FLASH_WRITE, sc->sc_opal_id, off, + vtophys(data), size, token); + if (rv == OPAL_ASYNC_COMPLETION) + rv = opal_wait_completion(&msg, sizeof(msg), token); + if (rv != OPAL_SUCCESS) + break; + count -= size; + off += size; + } + opal_free_async_token(token); + + if (rv == OPAL_SUCCESS) + rv = 0; + else + rv = EIO; + + return (rv); +} + +/* Main flash handling task. */ +static void +opalflash_task(void *arg) +{ + struct opalflash_softc *sc; + struct bio *bp; + device_t dev; + + sc = arg; + + for (;;) { + dev = sc->sc_dev; + OPALFLASH_LOCK(sc); + do { + bp = bioq_first(&sc->sc_bio_queue); + if (bp == NULL) + msleep(sc, &sc->sc_mtx, PRIBIO, "opalflash", 0); + } while (bp == NULL); + bioq_remove(&sc->sc_bio_queue, bp); + OPALFLASH_UNLOCK(sc); + + switch (bp->bio_cmd) { + case BIO_DELETE: + bp->bio_error = opalflash_erase(sc, bp->bio_offset, + bp->bio_bcount); + break; + case BIO_READ: + bp->bio_error = opalflash_read(sc, bp->bio_offset, + bp->bio_data, bp->bio_bcount); + break; + case BIO_WRITE: + bp->bio_error = opalflash_write(sc, bp->bio_offset, + bp->bio_data, bp->bio_bcount); + break; + default: + bp->bio_error = EINVAL; + } + biodone(bp); + } +} + + +/* Device driver interfaces. */ + +static int +opalflash_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "ibm,opal-flash")) + return (ENXIO); + + device_set_desc(dev, "OPAL System Flash"); + + return (BUS_PROBE_GENERIC); +} + +static int +opalflash_attach(device_t dev) +{ + struct opalflash_softc *sc; + phandle_t node; + cell_t flash_blocksize, opal_id; + uint32_t regs[2]; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + node = ofw_bus_get_node(dev); + OF_getencprop(node, "ibm,opal-id", &opal_id, sizeof(opal_id)); + sc->sc_opal_id = opal_id; + + if (OF_getencprop(node, "ibm,flash-block-size", + &flash_blocksize, sizeof(flash_blocksize)) < 0) { + device_printf(dev, "Cannot determine flash block size.\n"); + return (ENXIO); + } + + OPALFLASH_LOCK_INIT(sc); + + if (OF_getencprop(node, "reg", regs, sizeof(regs)) < 0) { + device_printf(dev, "Unable to get flash size.\n"); + return (ENXIO); + } + + sc->sc_disk = disk_alloc(); + sc->sc_disk->d_name = "opalflash"; + sc->sc_disk->d_open = opalflash_open; + sc->sc_disk->d_close = opalflash_close; + sc->sc_disk->d_strategy = opalflash_strategy; + sc->sc_disk->d_ioctl = opalflash_ioctl; + sc->sc_disk->d_getattr = opalflash_getattr; + sc->sc_disk->d_drv1 = sc; + sc->sc_disk->d_maxsize = DFLTPHYS; + sc->sc_disk->d_mediasize = regs[1]; + sc->sc_disk->d_unit = device_get_unit(sc->sc_dev); + sc->sc_disk->d_sectorsize = FLASH_BLOCKSIZE; + sc->sc_disk->d_stripesize = flash_blocksize; + sc->sc_disk->d_dump = NULL; + + disk_create(sc->sc_disk, DISK_VERSION); + bioq_init(&sc->sc_bio_queue); + + kproc_create(&opalflash_task, sc, &sc->sc_p, 0, 0, "task: OPAL Flash"); + + return (0); +} From owner-svn-src-head@freebsd.org Fri Mar 1 05:54:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F9D715038DA; Fri, 1 Mar 2019 05:54:14 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3FB3845DB; Fri, 1 Mar 2019 05:54:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 755EC187A7; Fri, 1 Mar 2019 05:54:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x215sDOx076723; Fri, 1 Mar 2019 05:54:13 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x215sDi7076722; Fri, 1 Mar 2019 05:54:13 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201903010554.x215sDi7076722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Fri, 1 Mar 2019 05:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344690 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 344690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3FB3845DB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.90)[-0.899,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 05:54:14 -0000 Author: pjd Date: Fri Mar 1 05:54:13 2019 New Revision: 344690 URL: https://svnweb.freebsd.org/changeset/base/344690 Log: Improve readability of the code by making it explicit where the 'c' variable starts. It is also more consistent with similar code in this file. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Mar 1 05:04:29 2019 (r344689) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Mar 1 05:54:13 2019 (r344690) @@ -568,7 +568,7 @@ vdev_raidz_map_alloc(abd_t *abd, uint64_t size, uint64 abd_alloc_linear(rm->rm_col[c].rc_size, B_TRUE); } - for (off = 0; c < acols; c++) { + for (off = 0, c = rm->rm_firstdatacol; c < acols; c++) { rm->rm_col[c].rc_abd = abd_get_offset(abd, off); off += rm->rm_col[c].rc_size; } From owner-svn-src-head@freebsd.org Fri Mar 1 07:37:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE4BF1511A24; Fri, 1 Mar 2019 07:37:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9BB8EA92; Fri, 1 Mar 2019 07:37:46 +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 4EDF519899; Fri, 1 Mar 2019 07:37:46 +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 x217bkVa028786; Fri, 1 Mar 2019 07:37:46 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x217bk6v028785; Fri, 1 Mar 2019 07:37:46 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903010737.x217bk6v028785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 1 Mar 2019 07:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344691 - 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: 344691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F9BB8EA92 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.85)[-0.850,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 07:37:46 -0000 Author: kp Date: Fri Mar 1 07:37:45 2019 New Revision: 344691 URL: https://svnweb.freebsd.org/changeset/base/344691 Log: pf: IPv6 fragments with malformed extension headers could be erroneously passed by pf or cause a panic We mistakenly used the extoff value from the last packet to patch the next_header field. If a malicious host sends a chain of fragmented packets where the first packet and the final packet have different lengths or number of extension headers we'd patch the next_header at the wrong offset. This can potentially lead to panics or rule bypasses. Security: CVE-2019-5597 Obtained from: OpenBSD Reported by: Corentin Bayet, Nicolas Collignon, Luca Moro at Synacktiv Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Mar 1 05:54:13 2019 (r344690) +++ head/sys/netpfil/pf/pf_norm.c Fri Mar 1 07:37:45 2019 (r344691) @@ -836,11 +836,11 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, } /* We have all the data. */ + frent = TAILQ_FIRST(&frag->fr_queue); + KASSERT(frent != NULL, ("frent != NULL")); extoff = frent->fe_extoff; maxlen = frag->fr_maxlen; frag_id = frag->fr_id; - frent = TAILQ_FIRST(&frag->fr_queue); - KASSERT(frent != NULL, ("frent != NULL")); total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; hdrlen = frent->fe_hdrlen - sizeof(struct ip6_frag); From owner-svn-src-head@freebsd.org Fri Mar 1 07:39:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E0BA1511D68; Fri, 1 Mar 2019 07:39:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3D388EBC8; Fri, 1 Mar 2019 07:39:56 +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 A6898198A3; Fri, 1 Mar 2019 07:39:56 +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 x217duZp028945; Fri, 1 Mar 2019 07:39:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x217du5R028943; Fri, 1 Mar 2019 07:39:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903010739.x217du5R028943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 1 Mar 2019 07:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344692 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 344692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3D388EBC8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.85)[-0.851,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 07:39:57 -0000 Author: kp Date: Fri Mar 1 07:39:55 2019 New Revision: 344692 URL: https://svnweb.freebsd.org/changeset/base/344692 Log: pf tests: Test CVE-2019-5597 Generate a fragmented packet with different header chains, to provoke the incorrect behaviour of pf. Without the fix this will trigger a panic. Obtained from: Corentin Bayet, Nicolas Collignon, Luca Moro at Synacktiv Added: head/tests/sys/netpfil/pf/CVE-2019-5597.py (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile head/tests/sys/netpfil/pf/fragmentation.sh Added: head/tests/sys/netpfil/pf/CVE-2019-5597.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/CVE-2019-5597.py Fri Mar 1 07:39:55 2019 (r344692) @@ -0,0 +1,35 @@ +#!/usr/local/bin/python2.7 + +import random +import scapy.all as sp +import sys + +UDP_PROTO = 17 +AH_PROTO = 51 +FRAG_PROTO = 44 + +def main(): + intf = sys.argv[1] + ipv6_src = sys.argv[2] + ipv6_dst = sys.argv[3] + + ipv6_main = sp.IPv6(dst=ipv6_dst, src=ipv6_src) + + padding = 8 + fid = random.randint(0,100000) + frag_0 = sp.IPv6ExtHdrFragment(id=fid, nh=UDP_PROTO, m=1, offset=0) + frag_1 = sp.IPv6ExtHdrFragment(id=fid, nh=UDP_PROTO, m=0, offset=padding/8) + + pkt1_opts = sp.AH(nh=AH_PROTO, payloadlen=200) \ + / sp.Raw('XXXX' * 199) \ + / sp.AH(nh=FRAG_PROTO, payloadlen=1) \ + / frag_1 + + pkt0 = sp.Ether() / ipv6_main / frag_0 / sp.Raw('A' * padding) + pkt1 = sp.Ether() / ipv6_main / pkt1_opts / sp.Raw('B' * padding) + + sp.sendp(pkt0, iface=intf, verbose=False) + sp.sendp(pkt1, iface=intf, verbose=False) + +if __name__ == '__main__': + main() Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Fri Mar 1 07:37:45 2019 (r344691) +++ head/tests/sys/netpfil/pf/Makefile Fri Mar 1 07:39:55 2019 (r344692) @@ -20,8 +20,10 @@ ATF_TESTS_SH+= anchor \ ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ - pft_ping.py + pft_ping.py \ + CVE-2019-5597.py ${PACKAGE}FILESMODE_pft_ping.py= 0555 +${PACKAGE}FILESMODE_CVE-2019-5597.py= 0555 .include Modified: head/tests/sys/netpfil/pf/fragmentation.sh ============================================================================== --- head/tests/sys/netpfil/pf/fragmentation.sh Fri Mar 1 07:37:45 2019 (r344691) +++ head/tests/sys/netpfil/pf/fragmentation.sh Fri Mar 1 07:39:55 2019 (r344692) @@ -104,6 +104,11 @@ v6_body() atf_check -s exit:0 -o ignore\ ping6 -c 1 -b 70000 -s 65000 2001:db8:43::3 + + $(atf_get_srcdir)/CVE-2019-5597.py \ + ${epair_send}a \ + 2001:db8:42::1 \ + 2001:db8:43::3 } v6_cleanup() From owner-svn-src-head@freebsd.org Fri Mar 1 09:10:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C1D15010E7; Fri, 1 Mar 2019 09:10: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9AD36B8DD; Fri, 1 Mar 2019 09:10:16 +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 9D88E1A7F9; Fri, 1 Mar 2019 09:10:16 +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 x219AGdM075773; Fri, 1 Mar 2019 09:10:16 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x219AGSG075772; Fri, 1 Mar 2019 09:10:16 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201903010910.x219AGSG075772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 1 Mar 2019 09:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344696 - 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: 344696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9AD36B8DD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 09:10:17 -0000 Author: vmaffione Date: Fri Mar 1 09:10:16 2019 New Revision: 344696 URL: https://svnweb.freebsd.org/changeset/base/344696 Log: netmap: pkt-gen: fix bug in send_packets() The send_packets() function was using ring->cur as index to scan the transmit ring. This function may also set ring->cur ahead of ring->head, in case no more slots are available. However, the function also uses nm_ring_space() which looks at ring->head to check how many slots are available. If ring->head and ring->cur are different, this results in pkt-gen advancing ring->cur beyond ring->tail. This patch fixes send_packets() (and similar source locations) to use ring->head as a index, rather than using ring->cur. MFC after: 1 week Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Fri Mar 1 08:06:23 2019 (r344695) +++ head/tools/tools/netmap/pkt-gen.c Fri Mar 1 09:10:16 2019 (r344696) @@ -626,10 +626,10 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) char *w, *tok; int i, v; - nmr->nr_tx_rings = nmr->nr_rx_rings = 0; - nmr->nr_tx_slots = nmr->nr_rx_slots = 0; if (conf == NULL || ! *conf) return 0; + nmr->nr_tx_rings = nmr->nr_rx_rings = 0; + nmr->nr_tx_slots = nmr->nr_rx_slots = 0; w = strdup(conf); for (i = 0, tok = strtok(w, ","); tok; i++, tok = strtok(NULL, ",")) { v = atoi(tok); @@ -1158,22 +1158,22 @@ static int send_packets(struct netmap_ring *ring, struct pkt *pkt, void *frame, int size, struct targ *t, u_int count, int options) { - u_int n, sent, cur = ring->cur; + u_int n, sent, head = ring->head; u_int frags = t->frags; u_int frag_size = t->frag_size; - struct netmap_slot *slot = &ring->slot[cur]; + struct netmap_slot *slot = &ring->slot[head]; n = nm_ring_space(ring); #if 0 if (options & (OPT_COPY | OPT_PREFETCH) ) { for (sent = 0; sent < count; sent++) { - struct netmap_slot *slot = &ring->slot[cur]; + struct netmap_slot *slot = &ring->slot[head]; char *p = NETMAP_BUF(ring, slot->buf_idx); __builtin_prefetch(p); - cur = nm_ring_next(ring, cur); + head = nm_ring_next(ring, head); } - cur = ring->cur; + head = ring->head; } #endif for (sent = 0; sent < count && n >= frags; sent++, n--) { @@ -1181,7 +1181,7 @@ send_packets(struct netmap_ring *ring, struct pkt *pkt int buf_changed; u_int tosend = size; - slot = &ring->slot[cur]; + slot = &ring->slot[head]; p = NETMAP_BUF(ring, slot->buf_idx); buf_changed = slot->flags & NS_BUF_CHANGED; @@ -1200,11 +1200,11 @@ send_packets(struct netmap_ring *ring, struct pkt *pkt slot->len = frag_size; slot->flags = NS_MOREFRAG; if (options & OPT_DUMP) - dump_payload(fp, frag_size, ring, cur); + dump_payload(fp, frag_size, ring, head); tosend -= frag_size; f += frag_size; - cur = nm_ring_next(ring, cur); - slot = &ring->slot[cur]; + head = nm_ring_next(ring, head); + slot = &ring->slot[head]; fp = NETMAP_BUF(ring, slot->buf_idx); } n -= (frags - 1); @@ -1223,12 +1223,12 @@ send_packets(struct netmap_ring *ring, struct pkt *pkt } slot->len = tosend; if (options & OPT_DUMP) - dump_payload(p, tosend, ring, cur); - cur = nm_ring_next(ring, cur); + dump_payload(p, tosend, ring, head); + head = nm_ring_next(ring, head); } if (sent) { slot->flags |= NS_REPORT; - ring->head = ring->cur = cur; + ring->head = ring->cur = head; } if (sent < count) { /* tell netmap that we need more slots */ @@ -1329,7 +1329,7 @@ ping_body(void *data) if (n > 0 && n - sent < limit) limit = n - sent; for (m = 0; (unsigned)m < limit; m++) { - slot = &ring->slot[ring->cur]; + slot = &ring->slot[ring->head]; slot->len = size; p = NETMAP_BUF(ring, slot->buf_idx); @@ -1345,7 +1345,7 @@ ping_body(void *data) tp->sec = (uint32_t)ts.tv_sec; tp->nsec = (uint32_t)ts.tv_nsec; sent++; - ring->head = ring->cur = nm_ring_next(ring, ring->cur); + ring->head = ring->cur = nm_ring_next(ring, ring->head); } } if (m > 0) @@ -1381,7 +1381,7 @@ ping_body(void *data) struct tstamp *tp; int pos; - slot = &ring->slot[ring->cur]; + slot = &ring->slot[ring->head]; p = NETMAP_BUF(ring, slot->buf_idx); clock_gettime(CLOCK_REALTIME_PRECISE, &now); @@ -1406,7 +1406,7 @@ ping_body(void *data) pos = msb64(t_cur); buckets[pos]++; /* now store it in a bucket */ - ring->head = ring->cur = nm_ring_next(ring, ring->cur); + ring->head = ring->cur = nm_ring_next(ring, ring->head); rx++; } } @@ -1486,7 +1486,7 @@ pong_body(void *data) D("understood ponger %llu but don't know how to do it", (unsigned long long)n); while (!targ->cancel && (n == 0 || sent < n)) { - uint32_t txcur, txavail; + uint32_t txhead, txavail; //#define BUSYWAIT #ifdef BUSYWAIT ioctl(pfd.fd, NIOCRXSYNC, NULL); @@ -1499,24 +1499,24 @@ pong_body(void *data) } #endif txring = NETMAP_TXRING(nifp, targ->nmd->first_tx_ring); - txcur = txring->cur; + txhead = txring->head; txavail = nm_ring_space(txring); /* see what we got back */ for (i = targ->nmd->first_rx_ring; i <= targ->nmd->last_rx_ring; i++) { rxring = NETMAP_RXRING(nifp, i); while (!nm_ring_empty(rxring)) { uint16_t *spkt, *dpkt; - uint32_t cur = rxring->cur; - struct netmap_slot *slot = &rxring->slot[cur]; + uint32_t head = rxring->head; + struct netmap_slot *slot = &rxring->slot[head]; char *src, *dst; src = NETMAP_BUF(rxring, slot->buf_idx); //D("got pkt %p of size %d", src, slot->len); - rxring->head = rxring->cur = nm_ring_next(rxring, cur); + rxring->head = rxring->cur = nm_ring_next(rxring, head); rx++; if (txavail == 0) continue; dst = NETMAP_BUF(txring, - txring->slot[txcur].buf_idx); + txring->slot[txhead].buf_idx); /* copy... */ dpkt = (uint16_t *)dst; spkt = (uint16_t *)src; @@ -1528,13 +1528,13 @@ pong_body(void *data) dpkt[3] = spkt[0]; dpkt[4] = spkt[1]; dpkt[5] = spkt[2]; - txring->slot[txcur].len = slot->len; - txcur = nm_ring_next(txring, txcur); + txring->slot[txhead].len = slot->len; + txhead = nm_ring_next(txring, txhead); txavail--; sent++; } } - txring->head = txring->cur = txcur; + txring->head = txring->cur = txhead; targ->ctr.pkts = sent; #ifdef BUSYWAIT ioctl(pfd.fd, NIOCTXSYNC, NULL); @@ -1760,30 +1760,30 @@ receive_pcap(u_char *user, const struct pcap_pkthdr * static int receive_packets(struct netmap_ring *ring, u_int limit, int dump, uint64_t *bytes) { - u_int cur, rx, n; + u_int head, rx, n; uint64_t b = 0; u_int complete = 0; if (bytes == NULL) bytes = &b; - cur = ring->cur; + head = ring->head; n = nm_ring_space(ring); if (n < limit) limit = n; for (rx = 0; rx < limit; rx++) { - struct netmap_slot *slot = &ring->slot[cur]; + struct netmap_slot *slot = &ring->slot[head]; char *p = NETMAP_BUF(ring, slot->buf_idx); *bytes += slot->len; if (dump) - dump_payload(p, slot->len, ring, cur); + dump_payload(p, slot->len, ring, head); if (!(slot->flags & NS_MOREFRAG)) complete++; - cur = nm_ring_next(ring, cur); + head = nm_ring_next(ring, head); } - ring->head = ring->cur = cur; + ring->head = ring->cur = head; return (complete); } From owner-svn-src-head@freebsd.org Fri Mar 1 13:05:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 902AF1516B2C; Fri, 1 Mar 2019 13:05:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9F377840; Fri, 1 Mar 2019 13:05:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D4F71D0B8; Fri, 1 Mar 2019 13:05:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21D5bCi008741; Fri, 1 Mar 2019 13:05:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21D5bej008740; Fri, 1 Mar 2019 13:05:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201903011305.x21D5bej008740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 1 Mar 2019 13:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344699 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 344699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D9F377840 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 13:05:38 -0000 Author: manu Date: Fri Mar 1 13:05:37 2019 New Revision: 344699 URL: https://svnweb.freebsd.org/changeset/base/344699 Log: arm64: rockchip: rk3399_pll: Fix the recalc function The plls frequency are now correctly calculated in fractional mode and integer mode. While here add some debug printfs (disabled by default) Tested with powerd on the little cluster on a RockPro64. MFC after: 1 week Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Fri Mar 1 11:30:19 2019 (r344698) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Fri Mar 1 13:05:37 2019 (r344699) @@ -359,43 +359,56 @@ static int rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *freq) { struct rk_clk_pll_sc *sc; - uint64_t rate; uint32_t dsmpd, refdiv, fbdiv; - uint32_t postdiv1, postdiv2, frac; - uint32_t raw1, raw2, raw3, raw4; + uint32_t postdiv1, postdiv2, fracdiv; + uint32_t con1, con2, con3, con4; + uint64_t foutvco; sc = clknode_get_softc(clk); DEVICE_LOCK(clk); - READ4(clk, sc->base_offset, &raw1); - READ4(clk, sc->base_offset + 4, &raw2); - READ4(clk, sc->base_offset + 8, &raw3); - READ4(clk, sc->base_offset + 0xC, &raw4); + READ4(clk, sc->base_offset, &con1); + READ4(clk, sc->base_offset + 4, &con2); + READ4(clk, sc->base_offset + 8, &con3); + READ4(clk, sc->base_offset + 0xC, &con4); DEVICE_UNLOCK(clk); - fbdiv = (raw1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT; + dprintf("con0: %x\n", con1); + dprintf("con1: %x\n", con2); + dprintf("con2: %x\n", con3); + dprintf("con3: %x\n", con4); - postdiv1 = (raw2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT; - postdiv2 = (raw2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT; - refdiv = (raw2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT; + fbdiv = (con1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT; - frac = (raw3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT; + postdiv1 = (con2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT; + postdiv2 = (con2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT; + refdiv = (con2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT; - dsmpd = (raw4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT; + fracdiv = (con3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT; + fracdiv >>= 24; - rate = *freq * fbdiv / refdiv; + dsmpd = (con4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT; + + dprintf("fbdiv: %d\n", fbdiv); + dprintf("postdiv1: %d\n", postdiv1); + dprintf("postdiv2: %d\n", postdiv2); + dprintf("refdiv: %d\n", refdiv); + dprintf("fracdiv: %d\n", fracdiv); + dprintf("dsmpd: %d\n", dsmpd); + + dprintf("parent freq=%lu\n", *freq); + if (dsmpd == 0) { /* Fractional mode */ - uint64_t frac_rate; - - frac_rate = *freq * frac / refdiv; - rate += frac_rate >> 24; + foutvco = *freq / refdiv * (fbdiv + fracdiv); + } else { + /* Integer mode */ + foutvco = *freq / refdiv * fbdiv; } + dprintf("foutvco: %lu\n", foutvco); - *freq = rate / postdiv1 / postdiv2; - - if (*freq % 2) - *freq = *freq + 1; + *freq = foutvco / postdiv1 / postdiv2; + dprintf("freq: %lu\n", *freq); return (0); } From owner-svn-src-head@freebsd.org Fri Mar 1 14:33:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0EA15193CB; Fri, 1 Mar 2019 14:33:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C490382DC6; Fri, 1 Mar 2019 14:33:20 +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 AE1A71E01D; Fri, 1 Mar 2019 14:33:20 +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 x21EXKcP055331; Fri, 1 Mar 2019 14:33:20 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21EXKVB055330; Fri, 1 Mar 2019 14:33:20 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201903011433.x21EXKVB055330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 1 Mar 2019 14:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344700 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 344700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C490382DC6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 14:33:21 -0000 Author: bz Date: Fri Mar 1 14:33:20 2019 New Revision: 344700 URL: https://svnweb.freebsd.org/changeset/base/344700 Log: Add ushort and ulong to linux/types.h. When porting code once written for Linux we find not only uints but also ushort and ulong. Provide central typedefs as part of the linuxkpi for those as well. Reviewed by: hselasky, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19405 Modified: head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Fri Mar 1 13:05:37 2019 (r344699) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Fri Mar 1 14:33:20 2019 (r344700) @@ -53,7 +53,9 @@ typedef uint32_t __be32; typedef uint64_t __le64; typedef uint64_t __be64; +typedef unsigned short ushort; typedef unsigned int uint; +typedef unsigned long ulong; typedef unsigned gfp_t; typedef off_t loff_t; typedef vm_paddr_t resource_size_t; From owner-svn-src-head@freebsd.org Fri Mar 1 14:39:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 453D51519531; Fri, 1 Mar 2019 14:39:16 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE92383038; Fri, 1 Mar 2019 14:39:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE5A01E02D; Fri, 1 Mar 2019 14:39:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21EdFXn055597; Fri, 1 Mar 2019 14:39:15 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21EdFlH055596; Fri, 1 Mar 2019 14:39:15 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201903011439.x21EdFlH055596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 1 Mar 2019 14:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344701 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: smh X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 344701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE92383038 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 14:39:16 -0000 Author: smh Date: Fri Mar 1 14:39:15 2019 New Revision: 344701 URL: https://svnweb.freebsd.org/changeset/base/344701 Log: Fix incorrect / unused sector_count for identify requests Fix incorrect / unused sector_count for identify requests from camcontrol. Submitted by: Alexey Dokuchaev Reported by: Alexey Dokuchaev MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D19408 Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Mar 1 14:33:20 2019 (r344700) +++ head/sbin/camcontrol/camcontrol.c Fri Mar 1 14:39:15 2019 (r344701) @@ -2292,7 +2292,7 @@ ata_do_identify(struct cam_device *device, int retry_c /*command*/command, /*features*/0, /*lba*/0, - /*sector_count*/(u_int8_t)sizeof(struct ata_params), + /*sector_count*/0, /*data_ptr*/(u_int8_t *)ptr, /*dxfer_len*/sizeof(struct ata_params), /*timeout*/timeout ? timeout : 30 * 1000, @@ -2312,8 +2312,7 @@ ata_do_identify(struct cam_device *device, int retry_c /*command*/retry_command, /*features*/0, /*lba*/0, - /*sector_count*/(u_int8_t) - sizeof(struct ata_params), + /*sector_count*/0, /*data_ptr*/(u_int8_t *)ptr, /*dxfer_len*/sizeof(struct ata_params), /*timeout*/timeout ? timeout : 30 * 1000, From owner-svn-src-head@freebsd.org Fri Mar 1 15:00:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7697151A1EA; Fri, 1 Mar 2019 15:00:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C0BE83D12; Fri, 1 Mar 2019 15:00:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E6A21E3A2; Fri, 1 Mar 2019 15:00:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21F0D8T066438; Fri, 1 Mar 2019 15:00:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21F0DlA066437; Fri, 1 Mar 2019 15:00:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201903011500.x21F0DlA066437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 1 Mar 2019 15:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344702 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 344702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C0BE83D12 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 15:00:14 -0000 Author: mav Date: Fri Mar 1 15:00:13 2019 New Revision: 344702 URL: https://svnweb.freebsd.org/changeset/base/344702 Log: There is no `device atacard` but there is `device atapccard`. Reported by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Mar 1 14:39:15 2019 (r344701) +++ head/sys/conf/NOTES Fri Mar 1 15:00:13 2019 (r344702) @@ -1727,7 +1727,7 @@ device ata # Modular ATA #device atacore # Core ATA functionality -#device atacard # CARDBUS support +#device atapccard # CARDBUS support #device ataisa # ISA bus support #device atapci # PCI bus support; only generic chipset support From owner-svn-src-head@freebsd.org Fri Mar 1 15:57:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AA0A151C24A; Fri, 1 Mar 2019 15:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2662886060; Fri, 1 Mar 2019 15:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2CDF1EDFE; Fri, 1 Mar 2019 15:57:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21FvtQx097078; Fri, 1 Mar 2019 15:57:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21FvtLD097077; Fri, 1 Mar 2019 15:57:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903011557.x21FvtLD097077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 1 Mar 2019 15:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344704 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2662886060 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 15:57:56 -0000 Author: tuexen Date: Fri Mar 1 15:57:55 2019 New Revision: 344704 URL: https://svnweb.freebsd.org/changeset/base/344704 Log: Improve consistency, not functional change. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Mar 1 15:49:11 2019 (r344703) +++ head/sys/netinet/sctp_usrreq.c Fri Mar 1 15:57:55 2019 (r344704) @@ -1128,10 +1128,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, actual += sizeof(struct sockaddr_in6); } else { #endif - memcpy(sas, sin, sizeof(*sin)); + memcpy(sas, sin, sizeof(struct sockaddr_in)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; - sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(*sin)); - actual += sizeof(*sin); + sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in)); + actual += sizeof(struct sockaddr_in); #ifdef INET6 } #endif @@ -1182,10 +1182,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { continue; } - memcpy(sas, sin6, sizeof(*sin6)); + memcpy(sas, sin6, sizeof(struct sockaddr_in6)); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; - sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(*sin6)); - actual += sizeof(*sin6); + sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); + actual += sizeof(struct sockaddr_in6); if (actual >= limit) { return (actual); } From owner-svn-src-head@freebsd.org Fri Mar 1 16:16:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC616151CA1A; Fri, 1 Mar 2019 16:16:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D07B86C99; Fri, 1 Mar 2019 16:16:44 +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 6C0A31F188; Fri, 1 Mar 2019 16:16:44 +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 x21GGib8007776; Fri, 1 Mar 2019 16:16:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21GGcps007749; Fri, 1 Mar 2019 16:16:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201903011616.x21GGcps007749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 1 Mar 2019 16:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344705 - in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm64/arm64 arm64/cloudabi32 arm64/cloudabi64 arm64/linux compat/ia... X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/cloudabi32 amd64/cloudabi64 amd64/linux amd64/linux32 arm/arm arm/cloudabi32 arm64/arm64 arm64/cloudabi32 arm64/cloudabi64 arm64/linux compat/ia32 i386/cloudabi32 i386/i... X-SVN-Commit-Revision: 344705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D07B86C99 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 16:16:45 -0000 Author: trasz Date: Fri Mar 1 16:16:38 2019 New Revision: 344705 URL: https://svnweb.freebsd.org/changeset/base/344705 Log: Remove sv_pagesize, originally introduced with r100384. In all of the architectures we have today, we always use PAGE_SIZE. While in theory one could define different things, none of the current architectures do, even the ones that have transitioned from 32-bit to 64-bit like i386 and arm. Some ancient mips binaries on other systems used 8k instead of 4k, but we don't support running those and likely never will due to their age and obscurity. Reviewed by: imp (who also contributed the commit message) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19280 Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/cloudabi32/cloudabi32_sysvec.c head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/arm/cloudabi32/cloudabi32_sysvec.c head/sys/arm64/arm64/elf32_machdep.c head/sys/arm64/arm64/elf_machdep.c head/sys/arm64/cloudabi32/cloudabi32_sysvec.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/ia32/ia32_sysvec.c head/sys/i386/cloudabi32/cloudabi32_sysvec.c head/sys/i386/i386/elf_machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_aout.c head/sys/kern/imgact_elf.c head/sys/kern/init_main.c head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/riscv/riscv/elf_machdep.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/amd64/amd64/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -63,7 +63,6 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -210,7 +210,6 @@ static struct sysentvec cloudabi32_elf_sysvec = { .sv_fixup = cloudabi32_fixup_tcb, .sv_name = "CloudABI ELF32", .sv_coredump = elf32_coredump, - .sv_pagesize = IA32_PAGE_SIZE, .sv_minuser = FREEBSD32_MINUSER, .sv_maxuser = FREEBSD32_MAXUSER, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -197,7 +197,6 @@ static struct sysentvec cloudabi64_elf_sysvec = { .sv_fixup = cloudabi64_fixup_tcb, .sv_name = "CloudABI ELF64", .sv_coredump = elf64_coredump, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, /* Keep top page reserved to work around AMD Ryzen stability issues. */ .sv_maxuser = VM_MAXUSER_ADDRESS - PAGE_SIZE, Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/amd64/linux/linux_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -722,7 +722,6 @@ struct sysentvec elf_linux_sysvec = { .sv_coredump = elf64_coredump, .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -920,7 +920,6 @@ struct sysentvec elf_linux_sysvec = { .sv_coredump = elf32_coredump, .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = LINUX32_MAXUSER, .sv_usrstack = LINUX32_USRSTACK, Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm/arm/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -70,7 +70,6 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/arm/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -174,7 +174,6 @@ static struct sysentvec cloudabi32_elf_sysvec = { .sv_fixup = cloudabi32_fixup, .sv_name = "CloudABI ELF32", .sv_coredump = elf32_coredump, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm64/arm64/elf32_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -87,7 +87,6 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_coredump = elf32_coredump, .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = FREEBSD32_MINUSER, .sv_maxuser = FREEBSD32_MAXUSER, .sv_usrstack = FREEBSD32_USRSTACK, Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm64/arm64/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -69,7 +69,6 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/arm64/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm64/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -182,7 +182,6 @@ static struct sysentvec cloudabi32_elf_sysvec = { .sv_fixup = cloudabi32_fixup, .sv_name = "CloudABI ELF32", .sv_coredump = elf32_coredump, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = (uintmax_t)1 << 32, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -166,7 +166,6 @@ static struct sysentvec cloudabi64_elf_sysvec = { .sv_fixup = cloudabi64_fixup, .sv_name = "CloudABI ELF64", .sv_coredump = elf64_coredump, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/arm64/linux/linux_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -373,7 +373,6 @@ struct sysentvec elf_linux_sysvec = { .sv_coredump = elf64_coredump, .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/compat/ia32/ia32_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -109,7 +109,6 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_coredump = elf32_coredump, .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = IA32_PAGE_SIZE, .sv_minuser = FREEBSD32_MINUSER, .sv_maxuser = FREEBSD32_MAXUSER, .sv_usrstack = FREEBSD32_USRSTACK, Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -185,7 +185,6 @@ static struct sysentvec cloudabi32_elf_sysvec = { .sv_fixup = cloudabi32_fixup_tcb, .sv_name = "CloudABI ELF32", .sv_coredump = elf32_coredump, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/i386/i386/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -65,7 +65,6 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/i386/linux/linux_sysvec.c Fri Mar 1 16:16:38 2019 (r344705) @@ -861,7 +861,6 @@ struct sysentvec linux_sysvec = { .sv_coredump = NULL, .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = LINUX_USRSTACK, @@ -897,7 +896,6 @@ struct sysentvec elf_linux_sysvec = { .sv_coredump = elf32_coredump, .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = LINUX_USRSTACK, Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/kern/imgact_aout.c Fri Mar 1 16:16:38 2019 (r344705) @@ -87,7 +87,6 @@ struct sysentvec aout_sysvec = { .sv_coredump = NULL, .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = AOUT32_USRSTACK, .sv_usrstack = AOUT32_USRSTACK, @@ -129,7 +128,6 @@ struct sysentvec aout_sysvec = { .sv_coredump = NULL, .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = IA32_PAGE_SIZE, .sv_minuser = AOUT32_MINUSER, .sv_maxuser = AOUT32_USRSTACK, .sv_usrstack = AOUT32_USRSTACK, Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/kern/imgact_elf.c Fri Mar 1 16:16:38 2019 (r344705) @@ -90,10 +90,9 @@ static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, const char *interp, int interp_name_len, int32_t *osrel, uint32_t *fctl0); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, - u_long *entry, size_t pagesize); + u_long *entry); static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, - caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, - size_t pagesize); + caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel); @@ -541,8 +540,7 @@ __elfN(map_insert)(struct image_params *imgp, vm_map_t static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, - caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, - size_t pagesize) + caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot) { struct sf_buf *sf; size_t map_len; @@ -570,8 +568,8 @@ __elfN(load_section)(struct image_params *imgp, vm_oof object = imgp->object; map = &imgp->proc->p_vmspace->vm_map; - map_addr = trunc_page_ps((vm_offset_t)vmaddr, pagesize); - file_addr = trunc_page_ps(offset, pagesize); + map_addr = trunc_page_ps((vm_offset_t)vmaddr, PAGE_SIZE); + file_addr = trunc_page_ps(offset, PAGE_SIZE); /* * We have two choices. We can either clear the data in the last page @@ -582,9 +580,9 @@ __elfN(load_section)(struct image_params *imgp, vm_oof if (filsz == 0) map_len = 0; else if (memsz > filsz) - map_len = trunc_page_ps(offset + filsz, pagesize) - file_addr; + map_len = trunc_page_ps(offset + filsz, PAGE_SIZE) - file_addr; else - map_len = round_page_ps(offset + filsz, pagesize) - file_addr; + map_len = round_page_ps(offset + filsz, PAGE_SIZE) - file_addr; if (map_len != 0) { /* cow flags: don't dump readonly sections in core */ @@ -614,9 +612,9 @@ __elfN(load_section)(struct image_params *imgp, vm_oof * to try and save a page, but it's a pain in the behind to implement. */ copy_len = filsz == 0 ? 0 : (offset + filsz) - trunc_page_ps(offset + - filsz, pagesize); - map_addr = trunc_page_ps((vm_offset_t)vmaddr + filsz, pagesize); - map_len = round_page_ps((vm_offset_t)vmaddr + memsz, pagesize) - + filsz, PAGE_SIZE); + map_addr = trunc_page_ps((vm_offset_t)vmaddr + filsz, PAGE_SIZE); + map_len = round_page_ps((vm_offset_t)vmaddr + memsz, PAGE_SIZE) - map_addr; /* This had damn well better be true! */ @@ -633,7 +631,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof return (EIO); /* send the page fragment to user space */ - off = trunc_page_ps(offset + filsz, pagesize) - + off = trunc_page_ps(offset + filsz, PAGE_SIZE) - trunc_page(offset + filsz); error = copyout((caddr_t)sf_buf_kva(sf) + off, (caddr_t)map_addr, copy_len); @@ -667,7 +665,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof */ static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, - u_long *entry, size_t pagesize) + u_long *entry) { struct { struct nameidata nd; @@ -766,7 +764,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_ prot = __elfN(trans_prot)(phdr[i].p_flags); error = __elfN(load_section)(imgp, phdr[i].p_offset, (caddr_t)(uintptr_t)phdr[i].p_vaddr + rbase, - phdr[i].p_memsz, phdr[i].p_filesz, prot, pagesize); + phdr[i].p_memsz, phdr[i].p_filesz, prot); if (error != 0) goto fail; /* @@ -1055,8 +1053,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i prot = __elfN(trans_prot)(phdr[i].p_flags); error = __elfN(load_section)(imgp, phdr[i].p_offset, (caddr_t)(uintptr_t)phdr[i].p_vaddr + et_dyn_addr, - phdr[i].p_memsz, phdr[i].p_filesz, prot, - sv->sv_pagesize); + phdr[i].p_memsz, phdr[i].p_filesz, prot); if (error != 0) goto ret; @@ -1175,7 +1172,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i snprintf(path, MAXPATHLEN, "%s%s", brand_info->emul_path, interp); error = __elfN(load_file)(imgp->proc, path, &addr, - &imgp->entry_addr, sv->sv_pagesize); + &imgp->entry_addr); free(path, M_TEMP); if (error == 0) have_interp = TRUE; @@ -1184,13 +1181,13 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i (brand_info->interp_path == NULL || strcmp(interp, brand_info->interp_path) == 0)) { error = __elfN(load_file)(imgp->proc, newinterp, &addr, - &imgp->entry_addr, sv->sv_pagesize); + &imgp->entry_addr); if (error == 0) have_interp = TRUE; } if (!have_interp) { error = __elfN(load_file)(imgp->proc, interp, &addr, - &imgp->entry_addr, sv->sv_pagesize); + &imgp->entry_addr); } vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) { Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/kern/init_main.c Fri Mar 1 16:16:38 2019 (r344705) @@ -420,7 +420,6 @@ struct sysentvec null_sysvec = { .sv_coredump = NULL, .sv_imgact_try = NULL, .sv_minsigstksz = 0, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/mips/mips/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -66,7 +66,6 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, @@ -121,7 +120,6 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/mips/mips/freebsd32_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -88,7 +88,6 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = ((vm_offset_t)0x80000000), .sv_usrstack = FREEBSD32_USRSTACK, Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/powerpc/powerpc/elf32_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -94,7 +94,6 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_stackprot = VM_PROT_ALL, #ifdef __powerpc64__ Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/powerpc/powerpc/elf64_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -69,7 +69,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, @@ -107,7 +106,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/riscv/riscv/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -72,7 +72,6 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/sparc64/sparc64/elf_machdep.c Fri Mar 1 16:16:38 2019 (r344705) @@ -70,7 +70,6 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, - .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Fri Mar 1 15:57:55 2019 (r344704) +++ head/sys/sys/sysent.h Fri Mar 1 16:16:38 2019 (r344705) @@ -110,7 +110,6 @@ struct sysentvec { /* function to dump core, or NULL */ int (*sv_imgact_try)(struct image_params *); int sv_minsigstksz; /* minimum signal stack size */ - int sv_pagesize; /* pagesize */ vm_offset_t sv_minuser; /* VM_MIN_ADDRESS */ vm_offset_t sv_maxuser; /* VM_MAXUSER_ADDRESS */ vm_offset_t sv_usrstack; /* USRSTACK */ From owner-svn-src-head@freebsd.org Fri Mar 1 18:47:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A12F1520C98; Fri, 1 Mar 2019 18:47:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5B158C688; Fri, 1 Mar 2019 18:47:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8E7820B69; Fri, 1 Mar 2019 18:47:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21Ilfjp086214; Fri, 1 Mar 2019 18:47:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21Ilfhm086213; Fri, 1 Mar 2019 18:47:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903011847.x21Ilfhm086213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 1 Mar 2019 18:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344708 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5B158C688 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 18:47:42 -0000 Author: tuexen Date: Fri Mar 1 18:47:41 2019 New Revision: 344708 URL: https://svnweb.freebsd.org/changeset/base/344708 Log: Honor the memory limits provided when processing the IPPROTO_SCTP level socket option SCTP_GET_LOCAL_ADDRESSES in a getsockopt() call. Thanks to Thomas Barabosch for reporting the issue which was found by running syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Mar 1 18:12:07 2019 (r344707) +++ head/sys/netinet/sctp_usrreq.c Fri Mar 1 18:47:41 2019 (r344708) @@ -1122,12 +1122,18 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, } #ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + if (actual + sizeof(struct sockaddr_in6) > limit) { + return (actual); + } in6_sin_2_v4mapsin6(sin, (struct sockaddr_in6 *)sas); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); actual += sizeof(struct sockaddr_in6); } else { #endif + if (actual + sizeof(struct sockaddr_in) > limit) { + return (actual); + } memcpy(sas, sin, sizeof(struct sockaddr_in)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in)); @@ -1135,9 +1141,6 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, #ifdef INET6 } #endif - if (actual >= limit) { - return (actual); - } } else { continue; } @@ -1182,13 +1185,13 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { continue; } + if (actual + sizeof(struct sockaddr_in6) > limit) { + return (actual); + } memcpy(sas, sin6, sizeof(struct sockaddr_in6)); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); actual += sizeof(struct sockaddr_in6); - if (actual >= limit) { - return (actual); - } } else { continue; } @@ -1202,6 +1205,7 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, } } else { struct sctp_laddr *laddr; + size_t sa_len; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { if (stcb) { @@ -1209,6 +1213,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, continue; } } + sa_len = laddr->ifa->address.sa.sa_len; + if (actual + sa_len > limit) { + return (actual); + } if (sctp_fill_user_address(sas, &laddr->ifa->address.sa)) continue; switch (laddr->ifa->address.sa.sa_family) { @@ -1226,12 +1234,8 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, /* TSNH */ break; } - sas = (struct sockaddr_storage *)((caddr_t)sas + - laddr->ifa->address.sa.sa_len); - actual += laddr->ifa->address.sa.sa_len; - if (actual >= limit) { - return (actual); - } + sas = (struct sockaddr_storage *)((caddr_t)sas + sa_len); + actual += sa_len; } } return (actual); From owner-svn-src-head@freebsd.org Fri Mar 1 19:06:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0DBF1521473; Fri, 1 Mar 2019 19:06:14 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 763B48D1C2; Fri, 1 Mar 2019 19:06:14 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6860120EFE; Fri, 1 Mar 2019 19:06:14 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21J6Ehv096932; Fri, 1 Mar 2019 19:06:14 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21J6EiU096931; Fri, 1 Mar 2019 19:06:14 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201903011906.x21J6EiU096931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Fri, 1 Mar 2019 19:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344709 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 344709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 763B48D1C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 19:06:15 -0000 Author: ygy (doc committer) Date: Fri Mar 1 19:06:13 2019 New Revision: 344709 URL: https://svnweb.freebsd.org/changeset/base/344709 Log: Fix typos and caps for ipfw(8) man page. MFC after: 3 days PR: 236030 Submitted by: olgeni Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Mar 1 18:47:41 2019 (r344708) +++ head/sbin/ipfw/ipfw.8 Fri Mar 1 19:06:13 2019 (r344709) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2018 +.Dd March 1, 2019 .Dt IPFW 8 .Os .Sh NAME @@ -1329,11 +1329,11 @@ its use is discouraged. .Brc .Bl -tag -width indent .It Cm any -matches any IP address. +Matches any IP address. .It Cm me -matches any IP address configured on an interface in the system. +Matches any IP address configured on an interface in the system. .It Cm me6 -matches any IPv6 address configured on an interface in the system. +Matches any IPv6 address configured on an interface in the system. The address list is evaluated at the time the packet is analysed. .It Cm table Ns Pq Ar name Ns Op , Ns Ar value @@ -2083,7 +2083,7 @@ The following table types are supported: .It Ar flow-spec : Ar flow-field Ns Op , Ns Ar flow-spec .It Ar flow-field : src-ip | proto | src-port | dst-ip | dst-port .It Cm addr -matches IPv4 or IPv6 address. +Matches IPv4 or IPv6 address. Each entry is represented by an .Ar addr Ns Op / Ns Ar masklen and will match all addresses with base @@ -2097,11 +2097,11 @@ is not specified, it defaults to 32 for IPv4 and 128 f When looking up an IP address in a table, the most specific entry will match. .It Cm iface -matches interface names. +Matches interface names. Each entry is represented by string treated as interface name. Wildcards are not supported. .It Cm number -maches protocol ports, uids/gids or jail IDs. +Matches protocol ports, uids/gids or jail IDs. Each entry is represented by 32-bit unsigned integer. Ranges are not supported. .It Cm flow @@ -2792,7 +2792,7 @@ specifies the quantum (credit) of the scheduler. .Ar m is the number of bytes a queue can serve before being moved to the tail of old queues list. -The default is 1514 bytes, and the maximum accepable value +The default is 1514 bytes, and the maximum acceptable value is 9000 bytes. .It Cm limit .Ar m @@ -2800,14 +2800,14 @@ specifies the hard size limit (in unit of packets) of instance of the scheduler. The default value of .Ar m -is 10240 packets, and the maximum accepable value is 20480 packets. +is 10240 packets, and the maximum acceptable value is 20480 packets. .It Cm flows .Ar m specifies the total number of flow queues (sub-queues) that fq_* creates and manages. By default, 1024 sub-queues are created when an instance of the fq_{codel/pie} scheduler is created. -The maximum accepable value is +The maximum acceptable value is 65536. .El .Pp @@ -2906,7 +2906,7 @@ is the typical queue size for Ethernet devices. Note that for slow speed links you should keep the queue size short or your traffic might be affected by a significant queueing delay. -E.g., 50 max-sized ethernet packets (1500 bytes) mean 600Kbit +E.g., 50 max-sized Ethernet packets (1500 bytes) mean 600Kbit or 20s of queue on a 30Kbit/s pipe. Even worse effects can result if you get packets from an interface with a much larger MTU, e.g.\& the loopback interface @@ -3053,7 +3053,7 @@ De-randomisation is enabled by default. .It Cm onoff enable turning PIE on and off depending on queue load. If this option is enabled, -PIE turnes on when over 1/3 of queue becomes full. +PIE turns on when over 1/3 of queue becomes full. This option is disabled by default. .It Cm dre | ts @@ -4089,7 +4089,7 @@ by adding the following to the appropriate place in ru If your network has network traffic analyzer connected to your host directly via dedicated interface or remotely via RSPAN vlan, you can selectively mirror -some ethernet layer2 frames to the analyzer. +some Ethernet layer2 frames to the analyzer. .Pp First, make sure your firewall is already configured and runs. Then, enable layer2 processing if not already enabled: @@ -4434,7 +4434,7 @@ or it could be split in: .Dl "ipfw nat 5 config redirect_port tcp" .Dl " 192.168.0.1:80,192.168.0.10:22,192.168.0.20:25 500" .Pp -Sometimes you may want to mix NAT and dynamic rules. It could be achived with +Sometimes you may want to mix NAT and dynamic rules. It could be achieved with .Cm record-state and .Cm defer-action @@ -4447,8 +4447,8 @@ rule will be performed as soon as rule is matched. In .Cm allow rule packet need to be passed to NAT, not allowed as soon is possible. .Pp -There is example of set of rules to achive this. Bear in mind that this -is exmaple only and it is not very usefult by itself. +There is example of set of rules to achieve this. Bear in mind that this +is exmaple only and it is not very useful by itself. .Pp On way out, after all checks place this rules: .Pp From owner-svn-src-head@freebsd.org Fri Mar 1 19:21:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEE71521D4B; Fri, 1 Mar 2019 19:21:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F187A8DC69; Fri, 1 Mar 2019 19:21:45 +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 E4AAC21148; Fri, 1 Mar 2019 19:21:45 +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 x21JLj9Y007173; Fri, 1 Mar 2019 19:21:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21JLjQ8007169; Fri, 1 Mar 2019 19:21:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201903011921.x21JLjQ8007169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Mar 2019 19:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344710 - 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: 344710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F187A8DC69 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 19:21:46 -0000 Author: cem Date: Fri Mar 1 19:21:45 2019 New Revision: 344710 URL: https://svnweb.freebsd.org/changeset/base/344710 Log: Fortuna: push CTR-mode loop down into randomdev hash.h interface As a step towards adding other potential streaming ciphers. As well as just pushing the loop down into the rijndael APIs (basically 128-bit wide AES-ICM mode) to eliminate some excess explicit_bzero(). No functional change intended. Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19411 Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/hash.c head/sys/dev/random/hash.h Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Mar 1 19:06:13 2019 (r344709) +++ head/sys/dev/random/fortuna.c Fri Mar 1 19:21:45 2019 (r344710) @@ -308,20 +308,16 @@ random_fortuna_reseed_internal(uint32_t *entropy_data, static __inline void random_fortuna_genblocks(uint8_t *buf, u_int blockcount) { - u_int i; RANDOM_RESEED_ASSERT_LOCK_OWNED(); KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); - for (i = 0; i < blockcount; i++) { - /*- - * FS&K - r = r|E(K,C) - * - C = C + 1 - */ - randomdev_encrypt(&fortuna_state.fs_key, &fortuna_state.fs_counter, buf, RANDOM_BLOCKSIZE); - buf += RANDOM_BLOCKSIZE; - uint128_increment(&fortuna_state.fs_counter); - } + /* + * Fills buf with RANDOM_BLOCKSIZE * blockcount bytes of keystream. + * Increments fs_counter as it goes. + */ + randomdev_keystream(&fortuna_state.fs_key, &fortuna_state.fs_counter, + buf, blockcount); } /*- Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Fri Mar 1 19:06:13 2019 (r344709) +++ head/sys/dev/random/hash.c Fri Mar 1 19:21:45 2019 (r344710) @@ -88,13 +88,26 @@ randomdev_encrypt_init(struct randomdev_key *context, rijndael_makeKey(&context->key, DIR_ENCRYPT, RANDOM_KEYSIZE*8, data); } -/* Encrypt the supplied data using the key schedule preset in the context. - * bytes are encrypted from <*d_in> to <*d_out>. must be - * a multiple of RANDOM_BLOCKSIZE. +/* + * Create a psuedorandom output stream of 'blockcount' blocks using a CTR-mode + * cipher or similar. The 128-bit counter is supplied in the in-out parmeter + * 'ctr.' The output stream goes to 'd_out.' 'blockcount' RANDOM_BLOCKSIZE + * bytes are generated. */ void -randomdev_encrypt(struct randomdev_key *context, const void *d_in, void *d_out, u_int length) +randomdev_keystream(struct randomdev_key *context, uint128_t *ctr, + void *d_out, u_int blockcount) { + u_int i; - rijndael_blockEncrypt(&context->cipher, &context->key, d_in, length*8, d_out); + for (i = 0; i < blockcount; i++) { + /*- + * FS&K - r = r|E(K,C) + * - C = C + 1 + */ + rijndael_blockEncrypt(&context->cipher, &context->key, + (void *)ctr, RANDOM_BLOCKSIZE * 8, d_out); + d_out = (char *)d_out + RANDOM_BLOCKSIZE; + uint128_increment(ctr); + } } Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Fri Mar 1 19:06:13 2019 (r344709) +++ head/sys/dev/random/hash.h Fri Mar 1 19:21:45 2019 (r344710) @@ -29,6 +29,8 @@ #ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED #define SYS_DEV_RANDOM_HASH_H_INCLUDED +#include + /* Keys are formed from cipher blocks */ #define RANDOM_KEYSIZE 32 /* (in bytes) == 256 bits */ #define RANDOM_KEYSIZE_WORDS (RANDOM_KEYSIZE/sizeof(uint32_t)) @@ -52,6 +54,6 @@ void randomdev_hash_init(struct randomdev_hash *); void randomdev_hash_iterate(struct randomdev_hash *, const void *, size_t); void randomdev_hash_finish(struct randomdev_hash *, void *); void randomdev_encrypt_init(struct randomdev_key *, const void *); -void randomdev_encrypt(struct randomdev_key *context, const void *, void *, u_int); +void randomdev_keystream(struct randomdev_key *context, uint128_t *, void *, u_int); #endif /* SYS_DEV_RANDOM_HASH_H_INCLUDED */ From owner-svn-src-head@freebsd.org Fri Mar 1 20:43:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCD315001C0; Fri, 1 Mar 2019 20:43:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3D790C2F; Fri, 1 Mar 2019 20:43:48 +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 80E322204C; Fri, 1 Mar 2019 20:43:48 +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 x21KhmYE049065; Fri, 1 Mar 2019 20:43:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21Khm6i049064; Fri, 1 Mar 2019 20:43:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201903012043.x21Khm6i049064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 1 Mar 2019 20:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344711 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 344711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E3D790C2F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 01 Mar 2019 20:43:49 -0000 Author: jhb Date: Fri Mar 1 20:43:48 2019 New Revision: 344711 URL: https://svnweb.freebsd.org/changeset/base/344711 Log: Fix missed posted interrupts in VT-x in bhyve. When a vCPU is HLTed, interrupts with a priority below the processor priority (PPR) should not resume the vCPU while interrupts at or above the PPR should. With posted interrupts, bhyve maintains a bitmap of pending interrupts in PIR descriptor along with a single 'pending' bit. This bit is checked by a CPU running in guest mode at various places to determine if it should be checked. In addition, another CPU can force a CPU in guest mode to check for pending interrupts by sending an IPI to a special IDT vector reserved for this purpose. bhyve had a bug in that it would only notify a guest vCPU of an interrupt (e.g. by sending the special IPI or by resuming it if it was idle due to HLT) if an interrupt arrived that was higher priority than PPR and no interrupts were currently pending. This assumed that if the 'pending' bit was set, any needed notification was already in progress. However, if the first interrupt sent to a HLTed vCPU was lower priority than PPR and the second was higher than PPR, the first interrupt would set 'pending' but not notify the vCPU, and the second interrupt would not notify the vCPU because 'pending' was already set. To fix this, track the priority of pending interrupts in a separate per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that is above PPR and higher than any previously-received interrupt. This was found and debugged in the bhyve port to SmartOS maintained by Joyent. Relevant SmartOS bugs with more background: https://smartos.org/bugview/OS-6829 https://smartos.org/bugview/OS-6930 https://smartos.org/bugview/OS-7354 Submitted by: Patrick Mooney Reviewed by: tychon, rgrimes Obtained from: SmartOS / Joyent MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D19299 Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Mar 1 19:21:45 2019 (r344710) +++ head/sys/amd64/vmm/intel/vmx.c Fri Mar 1 20:43:48 2019 (r344711) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2018 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -3402,8 +3403,11 @@ struct vlapic_vtx { struct vlapic vlapic; struct pir_desc *pir_desc; struct vmx *vmx; + u_int pending_prio; }; +#define VPR_PRIO_BIT(vpr) (1 << ((vpr) >> 4)) + #define VMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg) \ do { \ VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \ @@ -3425,7 +3429,7 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, struct vlapic_vtx *vlapic_vtx; struct pir_desc *pir_desc; uint64_t mask; - int idx, notify; + int idx, notify = 0; vlapic_vtx = (struct vlapic_vtx *)vlapic; pir_desc = vlapic_vtx->pir_desc; @@ -3438,8 +3442,38 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, idx = vector / 64; mask = 1UL << (vector % 64); atomic_set_long(&pir_desc->pir[idx], mask); - notify = atomic_cmpset_long(&pir_desc->pending, 0, 1); + /* + * A notification is required whenever the 'pending' bit makes a + * transition from 0->1. + * + * Even if the 'pending' bit is already asserted, notification about + * the incoming interrupt may still be necessary. For example, if a + * vCPU is HLTed with a high PPR, a low priority interrupt would cause + * the 0->1 'pending' transition with a notification, but the vCPU + * would ignore the interrupt for the time being. The same vCPU would + * need to then be notified if a high-priority interrupt arrived which + * satisfied the PPR. + * + * The priorities of interrupts injected while 'pending' is asserted + * are tracked in a custom bitfield 'pending_prio'. Should the + * to-be-injected interrupt exceed the priorities already present, the + * notification is sent. The priorities recorded in 'pending_prio' are + * cleared whenever the 'pending' bit makes another 0->1 transition. + */ + if (atomic_cmpset_long(&pir_desc->pending, 0, 1) != 0) { + notify = 1; + vlapic_vtx->pending_prio = 0; + } else { + const u_int old_prio = vlapic_vtx->pending_prio; + const u_int prio_bit = VPR_PRIO_BIT(vector & APIC_TPR_INT); + + if ((old_prio & prio_bit) == 0 && prio_bit > old_prio) { + atomic_set_int(&vlapic_vtx->pending_prio, prio_bit); + notify = 1; + } + } + VMX_CTR_PIR(vlapic->vm, vlapic->vcpuid, pir_desc, notify, vector, level, "vmx_set_intr_ready"); return (notify); @@ -3504,14 +3538,31 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) VCPU_CTR1(vlapic->vm, vlapic->vcpuid, "HLT with non-zero PPR %d", lapic->ppr); + vpr = 0; for (i = 3; i >= 0; i--) { pirval = pir_desc->pir[i]; if (pirval != 0) { vpr = (i * 64 + flsl(pirval) - 1) & APIC_TPR_INT; - return (vpr > ppr); + break; } } - return (0); + + /* + * If the highest-priority pending interrupt falls short of the + * processor priority of this vCPU, ensure that 'pending_prio' does not + * have any stale bits which would preclude a higher-priority interrupt + * from incurring a notification later. + */ + if (vpr <= ppr) { + const u_int prio_bit = VPR_PRIO_BIT(vpr); + const u_int old = vlapic_vtx->pending_prio; + + if (old > prio_bit && (old & prio_bit) == 0) { + vlapic_vtx->pending_prio = prio_bit; + } + return (0); + } + return (1); } static void From owner-svn-src-head@freebsd.org Fri Mar 1 22:51:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86B691504943; Fri, 1 Mar 2019 22:51:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510E296A80; Fri, 1 Mar 2019 22:51:46 +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 376DE23656; Fri, 1 Mar 2019 22:51:46 +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 x21Mpkl7019531; Fri, 1 Mar 2019 22:51:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21MpkTl019526; Fri, 1 Mar 2019 22:51:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201903012251.x21MpkTl019526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Mar 2019 22:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344713 - 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: 344713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 510E296A80 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 22:51:46 -0000 Author: cem Date: Fri Mar 1 22:51:45 2019 New Revision: 344713 URL: https://svnweb.freebsd.org/changeset/base/344713 Log: fortuna: Deduplicate kernel vs user includes No functional change. Reviewed by: markj, markm Approved by: secteam (delphij), core (brooks) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19409 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Mar 1 22:33:24 2019 (r344712) +++ head/sys/dev/random/fortuna.c Fri Mar 1 22:51:45 2019 (r344713) @@ -35,10 +35,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #ifdef _KERNEL -#include #include #include #include @@ -50,17 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include - -#include -#include - -#include -#include -#include -#include -#include #else /* !_KERNEL */ -#include #include #include #include @@ -69,15 +59,18 @@ __FBSDID("$FreeBSD$"); #include #include "unit_test.h" +#endif /* _KERNEL */ #include #include #include #include +#ifdef _KERNEL +#include +#endif #include #include -#endif /* _KERNEL */ /* Defined in FS&K */ #define RANDOM_FORTUNA_NPOOLS 32 /* The number of accumulation pools */ From owner-svn-src-head@freebsd.org Fri Mar 1 23:30:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 745861505AC7; Fri, 1 Mar 2019 23:30:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1778C97CD3; Fri, 1 Mar 2019 23:30:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0370323BD6; Fri, 1 Mar 2019 23:30:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x21NUNI2036502; Fri, 1 Mar 2019 23:30:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x21NUNMW036500; Fri, 1 Mar 2019 23:30:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201903012330.x21NUNMW036500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Mar 2019 23:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344714 - 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: 344714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1778C97CD3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 23:30:24 -0000 Author: cem Date: Fri Mar 1 23:30:23 2019 New Revision: 344714 URL: https://svnweb.freebsd.org/changeset/base/344714 Log: Embedded chacha: Add 0-bit iv + 128-bit counter mode This mode might be suitable for a Fortuna keystream primitive. Reviewed by: markm Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19410 Modified: head/sys/crypto/chacha20/chacha.c head/sys/crypto/chacha20/chacha.h Modified: head/sys/crypto/chacha20/chacha.c ============================================================================== --- head/sys/crypto/chacha20/chacha.c Fri Mar 1 22:51:45 2019 (r344713) +++ head/sys/crypto/chacha20/chacha.c Fri Mar 1 23:30:23 2019 (r344714) @@ -84,13 +84,33 @@ chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits) LOCAL void chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter) { +#ifndef CHACHA_NONCE0_CTR128 x->input[12] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 0); x->input[13] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 4); x->input[14] = U8TO32_LITTLE(iv + 0); x->input[15] = U8TO32_LITTLE(iv + 4); +#else + // CHACHA_STATELEN + (void)iv; + x->input[12] = U8TO32_LITTLE(counter + 0); + x->input[13] = U8TO32_LITTLE(counter + 4); + x->input[14] = U8TO32_LITTLE(counter + 8); + x->input[15] = U8TO32_LITTLE(counter + 12); +#endif } +#ifdef CHACHA_NONCE0_CTR128 LOCAL void +chacha_ctrsave(const chacha_ctx *x, u8 *counter) +{ + U32TO8_LITTLE(counter + 0, x->input[12]); + U32TO8_LITTLE(counter + 4, x->input[13]); + U32TO8_LITTLE(counter + 8, x->input[14]); + U32TO8_LITTLE(counter + 12, x->input[15]); +} +#endif + +LOCAL void chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) { u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; @@ -192,7 +212,16 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u j12 = PLUSONE(j12); if (!j12) { j13 = PLUSONE(j13); +#ifndef CHACHA_NONCE0_CTR128 /* stopping at 2^70 bytes per nonce is user's responsibility */ +#else + if (!j13) { + j14 = PLUSONE(j14); + if (!j14) { + j15 = PLUSONE(j15); + } + } +#endif } U32TO8_LITTLE(c + 0,x0); @@ -218,6 +247,10 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u } x->input[12] = j12; x->input[13] = j13; +#ifdef CHACHA_NONCE0_CTR128 + x->input[14] = j14; + x->input[15] = j15; +#endif return; } bytes -= 64; Modified: head/sys/crypto/chacha20/chacha.h ============================================================================== --- head/sys/crypto/chacha20/chacha.h Fri Mar 1 22:51:45 2019 (r344713) +++ head/sys/crypto/chacha20/chacha.h Fri Mar 1 23:30:23 2019 (r344714) @@ -26,10 +26,19 @@ Public domain. #define LOCAL #endif +#ifdef CHACHA_NONCE0_CTR128 +#define CHACHA_UNUSED __unused +#else +#define CHACHA_UNUSED +#endif + LOCAL void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits); -LOCAL void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr); +LOCAL void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv CHACHA_UNUSED, + const u_char *ctr); LOCAL void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, u_char *c, u_int bytes); + +#undef CHACHA_UNUSED #endif /* CHACHA_H */ From owner-svn-src-head@freebsd.org Sat Mar 2 01:51:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E64150AFF0; Sat, 2 Mar 2019 01:51:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 860B56F14E; Sat, 2 Mar 2019 01:51:42 +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 78E3F25844; Sat, 2 Mar 2019 01:51:42 +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 x221pgOh014104; Sat, 2 Mar 2019 01:51:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x221pgtX014101; Sat, 2 Mar 2019 01:51:42 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903020151.x221pgtX014101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 2 Mar 2019 01:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344716 - in head/sys: powerpc/powerpc sys X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: powerpc/powerpc sys X-SVN-Commit-Revision: 344716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 860B56F14E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 01:51:43 -0000 Author: jhibbits Date: Sat Mar 2 01:51:41 2019 New Revision: 344716 URL: https://svnweb.freebsd.org/changeset/base/344716 Log: powerpc: Scale intrcnt by mp_ncpus On very large powerpc64 systems (2x22x4 power9) it's very easy to run out of available IRQs and crash the system at boot. Scale the count by mp_ncpus, similar to x86, so this doesn't happen. Further work can be done in the future to scale the I/O IRQs as well, but that's left for the future. Submitted by: mmacy MFC after: 3 weeks Modified: head/sys/powerpc/powerpc/intr_machdep.c head/sys/sys/interrupt.h Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Fri Mar 1 23:53:05 2019 (r344715) +++ head/sys/powerpc/powerpc/intr_machdep.c Sat Mar 2 01:51:41 2019 (r344716) @@ -119,7 +119,7 @@ struct pic { static u_int intrcnt_index = 0; static struct mtx intr_table_lock; -static struct powerpc_intr *powerpc_intrs[INTR_VECTORS]; +static struct powerpc_intr **powerpc_intrs; static struct pic piclist[MAX_PICS]; static u_int nvectors; /* Allocated vectors */ static u_int npics; /* PICs registered */ @@ -130,11 +130,21 @@ static u_int nirqs = 0; /* Allocated IRQs. */ #endif static u_int stray_count; -u_long intrcnt[INTR_VECTORS]; -char intrnames[INTR_VECTORS * (MAXCOMLEN + 1)]; +u_long *intrcnt; +char *intrnames; size_t sintrcnt = sizeof(intrcnt); size_t sintrnames = sizeof(intrnames); +int nintrcnt; +/* + * Just to start + */ +#ifdef __powerpc64__ +u_int num_io_irqs = 768; +#else +u_int num_io_irqs = 256; +#endif + device_t root_pic; #ifdef SMP @@ -142,6 +152,14 @@ static void *ipi_cookie; #endif static void +intrcnt_setname(const char *name, int index) +{ + + snprintf(intrnames + (MAXCOMLEN + 1) * index, MAXCOMLEN + 1, "%-*s", + MAXCOMLEN, name); +} + +static void intr_init(void *dummy __unused) { @@ -149,6 +167,32 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +static void +intr_init_sources(void *arg __unused) +{ + + powerpc_intrs = mallocarray(num_io_irqs, sizeof(*powerpc_intrs), + M_INTR, M_WAITOK | M_ZERO); + nintrcnt = 1 + num_io_irqs * 2 + mp_ncpus * 2; +#ifdef COUNT_IPIS + if (mp_ncpus > 1) + nintrcnt += 8 * mp_ncpus; +#endif + intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTR, M_WAITOK | + M_ZERO); + intrnames = mallocarray(nintrcnt, MAXCOMLEN + 1, M_INTR, M_WAITOK | + M_ZERO); + sintrcnt = nintrcnt * sizeof(u_long); + sintrnames = nintrcnt * (MAXCOMLEN + 1); + + intrcnt_setname("???", 0); + intrcnt_index = 1; +} +/* + * This needs to happen before SI_SUB_CPU + */ +SYSINIT(intr_init_sources, SI_SUB_KLD, SI_ORDER_ANY, intr_init_sources, NULL); + #ifdef SMP static void smp_intr_init(void *dummy __unused) @@ -165,26 +209,19 @@ smp_intr_init(void *dummy __unused) SYSINIT(smp_intr_init, SI_SUB_SMP, SI_ORDER_ANY, smp_intr_init, NULL); #endif -static void -intrcnt_setname(const char *name, int index) -{ - - snprintf(intrnames + (MAXCOMLEN + 1) * index, MAXCOMLEN + 1, "%-*s", - MAXCOMLEN, name); -} - void intrcnt_add(const char *name, u_long **countp) { int idx; idx = atomic_fetchadd_int(&intrcnt_index, 1); - KASSERT(idx < INTR_VECTORS, ("intrcnt_add: Interrupt counter index " - "reached INTR_VECTORS")); + KASSERT(idx < nintrcnt, ("intrcnt_add: Interrupt counter index %d/%d" + "reached nintrcnt : %d", intrcnt_index, idx, nintrcnt)); *countp = &intrcnt[idx]; intrcnt_setname(name, idx); } +extern void kdb_backtrace(void); static struct powerpc_intr * intr_lookup(u_int irq) { @@ -224,7 +261,7 @@ intr_lookup(u_int irq) CPU_SETOF(0, &i->cpu); #endif - for (vector = 0; vector < INTR_VECTORS && vector <= nvectors; + for (vector = 0; vector < num_io_irqs && vector <= nvectors; vector++) { iscan = powerpc_intrs[vector]; if (iscan != NULL && iscan->irq == irq) Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Fri Mar 1 23:53:05 2019 (r344715) +++ head/sys/sys/interrupt.h Sat Mar 2 01:51:41 2019 (r344716) @@ -156,7 +156,7 @@ extern struct intr_event *clk_intr_event; extern void *vm_ih; /* Counts and names for statistics (defined in MD code). */ -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) extern u_long *intrcnt; /* counts for for each device and stray */ extern char *intrnames; /* string table containing device names */ #else From owner-svn-src-head@freebsd.org Sat Mar 2 04:40:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FBE31510CD4; Sat, 2 Mar 2019 04:40:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFA3774EB9; Sat, 2 Mar 2019 04:39:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D20A527858; Sat, 2 Mar 2019 04:39:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x224dxHR000436; Sat, 2 Mar 2019 04:39:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x224dxII000435; Sat, 2 Mar 2019 04:39:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201903020439.x224dxII000435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 2 Mar 2019 04:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344719 - 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: 344719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFA3774EB9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 04:40:00 -0000 Author: np Date: Sat Mar 2 04:39:59 2019 New Revision: 344719 URL: https://svnweb.freebsd.org/changeset/base/344719 Log: cxgbev(4): Enable 32b port capabilities in the VF driver. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Sat Mar 2 04:02:11 2019 (r344718) +++ head/sys/dev/cxgbe/t4_vf.c Sat Mar 2 04:39:59 2019 (r344719) @@ -295,6 +295,12 @@ set_params__post_init(struct adapter *sc) val = 1; (void)t4vf_set_params(sc, 1, ¶m, &val); + /* Enable 32b port caps if the firmware supports it. */ + param = FW_PARAM_PFVF(PORT_CAPS32); + val = 1; + if (t4vf_set_params(sc, 1, ¶m, &val) == 0) + sc->params.port_caps32 = 1; + return (0); } From owner-svn-src-head@freebsd.org Sat Mar 2 04:02:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29C0F150FE51; Sat, 2 Mar 2019 04:02:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF88F73647; Sat, 2 Mar 2019 04:02:11 +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 B21222723F; Sat, 2 Mar 2019 04:02:11 +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 x2242Bdq083004; Sat, 2 Mar 2019 04:02:11 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2242B3V083002; Sat, 2 Mar 2019 04:02:11 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201903020402.x2242B3V083002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Sat, 2 Mar 2019 04:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344718 - in head/stand/efi/loader/arch: arm i386 X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: in head/stand/efi/loader/arch: arm i386 X-SVN-Commit-Revision: 344718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF88F73647 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 04:02:12 -0000 Author: bcran Date: Sat Mar 2 04:02:11 2019 New Revision: 344718 URL: https://svnweb.freebsd.org/changeset/base/344718 Log: EFI: don't call printf after ExitBootServices, since it uses Boot Services ExitBootServices terminates all boot services including console access. Attempting to call printf afterwards can result in a crash, depending on the implementation. Move any printf statements to before we call bi_load, and remove any that depend on calling bi_load first. Reviewed by: imp, tsoome Differential Revision: https://reviews.freebsd.org/D19374 Modified: head/stand/efi/loader/arch/arm/exec.c head/stand/efi/loader/arch/i386/elf32_freebsd.c Modified: head/stand/efi/loader/arch/arm/exec.c ============================================================================== --- head/stand/efi/loader/arch/arm/exec.c Sat Mar 2 03:17:23 2019 (r344717) +++ head/stand/efi/loader/arch/arm/exec.c Sat Mar 2 04:02:11 2019 (r344718) @@ -74,16 +74,19 @@ __elfN(arm_exec)(struct preloaded_file *fp) e = (Elf_Ehdr *)&fmp->md_data; efi_time_fini(); + + entry = efi_translate(e->e_entry); + + printf("Kernel entry at 0x%x...\n", (unsigned)entry); + printf("Kernel args: %s\n", fp->f_args); + if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) { efi_time_init(); return (error); } - entry = efi_translate(e->e_entry); - printf("Kernel entry at 0x%x...\n", (unsigned)entry); - printf("Kernel args: %s\n", fp->f_args); - printf("modulep: %#x\n", modulep); - printf("relocation_offset %llx\n", __elfN(relocation_offset)); + /* At this point we've called ExitBootServices, so we can't call + * printf or any other function that uses Boot Services */ dev_cleanup(); Modified: head/stand/efi/loader/arch/i386/elf32_freebsd.c ============================================================================== --- head/stand/efi/loader/arch/i386/elf32_freebsd.c Sat Mar 2 03:17:23 2019 (r344717) +++ head/stand/efi/loader/arch/i386/elf32_freebsd.c Sat Mar 2 04:02:11 2019 (r344718) @@ -75,14 +75,19 @@ elf32_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); efi_time_fini(); + + entry = ehdr->e_entry & 0xffffff; + + printf("Start @ 0x%x ...\n", entry); + err = bi_load(fp->f_args, &modulep, &kernend); if (err != 0) { efi_time_init(); return(err); } - entry = ehdr->e_entry & 0xffffff; - printf("Start @ 0x%x ...\n", entry); + /* At this point we've called ExitBootServices, so we can't call + * printf or any other function that uses Boot Services */ dev_cleanup(); __exec((void *)entry, boothowto, bootdev, 0, 0, 0, bootinfop, modulep, kernend); From owner-svn-src-head@freebsd.org Sat Mar 2 10:49:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01DB0151D043; Sat, 2 Mar 2019 10:49:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABC388806; Sat, 2 Mar 2019 10:49:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8172ED5E; Sat, 2 Mar 2019 10:49:09 +0000 (UTC) Date: Sat, 2 Mar 2019 10:49:09 +0000 From: Alexey Dokuchaev To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344701 - head/sbin/camcontrol Message-ID: <20190302104909.GA25217@FreeBSD.org> References: <201903011439.x21EdFlH055596@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201903011439.x21EdFlH055596@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 9ABC388806 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.86)[-0.859,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 10:49:10 -0000 On Fri, Mar 01, 2019 at 02:39:15PM +0000, Steven Hartland wrote: > New Revision: 344701 > URL: https://svnweb.freebsd.org/changeset/base/344701 > > Log: > Fix incorrect / unused sector_count for identify requests > > Fix incorrect / unused sector_count for identify requests from camcontrol. > > Submitted by: Alexey Dokuchaev Thanks, although commit message is a bit scarce. Also, for some reason, it consists of two nearly identical lines -- unnoticed copy paste error? ./danfe From owner-svn-src-head@freebsd.org Sat Mar 2 13:12:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21000152264C; Sat, 2 Mar 2019 13:12:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC32D8DADB; Sat, 2 Mar 2019 13:12:37 +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 B029F5475; Sat, 2 Mar 2019 13:12:37 +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 x22DCbml073157; Sat, 2 Mar 2019 13:12:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22DCbWa073156; Sat, 2 Mar 2019 13:12:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903021312.x22DCbWa073156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 2 Mar 2019 13:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344721 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC32D8DADB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 13:12:38 -0000 Author: tuexen Date: Sat Mar 2 13:12:37 2019 New Revision: 344721 URL: https://svnweb.freebsd.org/changeset/base/344721 Log: Report the correct length when using the IPPROTO_SCTP level socket options SCTP_GET_PEER_ADDRESSES and SCTP_GET_LOCAL_ADDRESSES. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Mar 2 12:30:59 2019 (r344720) +++ head/sys/netinet/sctp_usrreq.c Sat Mar 2 13:12:37 2019 (r344721) @@ -2240,8 +2240,8 @@ flags_out: SCTP_FIND_STCB(inp, stcb, saddr->sget_assoc_id); if (stcb) { - left = (*optsize) - sizeof(struct sctp_getaddresses); - *optsize = sizeof(struct sctp_getaddresses); + left = (*optsize) - sizeof(sctp_assoc_t); + *optsize = sizeof(sctp_assoc_t); sas = (struct sockaddr_storage *)&saddr->addr[0]; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -2315,7 +2315,7 @@ flags_out: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - *optsize = sizeof(struct sockaddr_storage) + actual; + *optsize = sizeof(sctp_assoc_t) + actual; break; } case SCTP_PEER_ADDR_PARAMS: From owner-svn-src-head@freebsd.org Sat Mar 2 12:31:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF021520E40; Sat, 2 Mar 2019 12:31:00 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F181B8C5D7; Sat, 2 Mar 2019 12:30:59 +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 E44404C52; Sat, 2 Mar 2019 12:30:59 +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 x22CUxJj047201; Sat, 2 Mar 2019 12:30:59 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22CUxcC047200; Sat, 2 Mar 2019 12:30:59 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201903021230.x22CUxcC047200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 2 Mar 2019 12:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344720 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 344720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F181B8C5D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 12:31:00 -0000 Author: kp Date: Sat Mar 2 12:30:59 2019 New Revision: 344720 URL: https://svnweb.freebsd.org/changeset/base/344720 Log: pf tests: Test for nested inline anchor issue PR: 196314 MFC after: 1 week Modified: head/tests/sys/netpfil/pf/pass_block.sh Modified: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/pf/pass_block.sh Sat Mar 2 04:39:59 2019 (r344719) +++ head/tests/sys/netpfil/pf/pass_block.sh Sat Mar 2 12:30:59 2019 (r344720) @@ -129,9 +129,45 @@ noalias_cleanup() pft_cleanup } +atf_test_case "nested_inline" "cleanup" +nested_inline_head() +{ + atf_set descr "Test nested inline anchors, PR196314" + atf_set require.user root +} + +nested_inline_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block in" \ + "anchor \"an1\" {" \ + "pass in quick proto tcp to port time" \ + "anchor \"an2\" {" \ + "pass in quick proto icmp" \ + "}" \ + "}" + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 +} + +nested_inline_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" atf_add_test_case "noalias" + atf_add_test_case "nested_inline" } From owner-svn-src-head@freebsd.org Sat Mar 2 14:15:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20CB61525142; Sat, 2 Mar 2019 14:15:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B663A6826C; Sat, 2 Mar 2019 14:15:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A52265E85; Sat, 2 Mar 2019 14:15:33 +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 x22EFXm2004290; Sat, 2 Mar 2019 14:15:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22EFXGS004289; Sat, 2 Mar 2019 14:15:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903021415.x22EFXGS004289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 2 Mar 2019 14:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344723 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B663A6826C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 14:15:34 -0000 Author: tuexen Date: Sat Mar 2 14:15:33 2019 New Revision: 344723 URL: https://svnweb.freebsd.org/changeset/base/344723 Log: Handle the case when calling the IPPROTO_SCTP level socket option SCTP_STATUS on an association with no primary path (early state). This issue was found by running syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Mar 2 13:16:01 2019 (r344722) +++ head/sys/netinet/sctp_usrreq.c Sat Mar 2 14:15:33 2019 (r344723) @@ -2644,42 +2644,47 @@ flags_out: sstat->sstat_instrms = stcb->asoc.streamincnt; sstat->sstat_outstrms = stcb->asoc.streamoutcnt; sstat->sstat_fragmentation_point = sctp_get_frag_point(stcb, &stcb->asoc); - memcpy(&sstat->sstat_primary.spinfo_address, - &stcb->asoc.primary_destination->ro._l_addr, - ((struct sockaddr *)(&stcb->asoc.primary_destination->ro._l_addr))->sa_len); net = stcb->asoc.primary_destination; - ((struct sockaddr_in *)&sstat->sstat_primary.spinfo_address)->sin_port = stcb->rport; - /* - * Again the user can get info from sctp_constants.h - * for what the state of the network is. - */ - if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { - /* It's unconfirmed */ - sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; - } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* It's active */ - sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; - } else { - /* It's inactive */ - sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; - } - sstat->sstat_primary.spinfo_cwnd = net->cwnd; - sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; - sstat->sstat_primary.spinfo_rto = net->RTO; - sstat->sstat_primary.spinfo_mtu = net->mtu; - switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) { + if (net != NULL) { + memcpy(&sstat->sstat_primary.spinfo_address, + &stcb->asoc.primary_destination->ro._l_addr, + ((struct sockaddr *)(&stcb->asoc.primary_destination->ro._l_addr))->sa_len); + ((struct sockaddr_in *)&sstat->sstat_primary.spinfo_address)->sin_port = stcb->rport; + /* + * Again the user can get info from + * sctp_constants.h for what the state of + * the network is. + */ + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* It's active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } + sstat->sstat_primary.spinfo_cwnd = net->cwnd; + sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; + sstat->sstat_primary.spinfo_rto = net->RTO; + sstat->sstat_primary.spinfo_mtu = net->mtu; + switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) { #if defined(INET) - case AF_INET: - sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD; + break; #endif #if defined(INET6) - case AF_INET6: - sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD; + break; #endif - default: - break; + default: + break; + } + } else { + memset(&sstat->sstat_primary, 0, sizeof(struct sctp_paddrinfo)); } sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); From owner-svn-src-head@freebsd.org Sat Mar 2 13:16:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A24071522858; Sat, 2 Mar 2019 13:16:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 409128DCC2; Sat, 2 Mar 2019 13:16:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A8B25479; Sat, 2 Mar 2019 13:16:02 +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 x22DG2cq073339; Sat, 2 Mar 2019 13:16:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22DG2oE073338; Sat, 2 Mar 2019 13:16:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903021316.x22DG2oE073338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 2 Mar 2019 13:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344722 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 344722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 409128DCC2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 13:16:02 -0000 Author: tuexen Date: Sat Mar 2 13:16:01 2019 New Revision: 344722 URL: https://svnweb.freebsd.org/changeset/base/344722 Log: Use correct buffer sizes in sctp_get[lp]addrs(). MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sat Mar 2 13:12:37 2019 (r344721) +++ head/lib/libc/net/sctp_sys_calls.c Sat Mar 2 13:16:01 2019 (r344722) @@ -415,7 +415,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockadd return (-1); } /* size required is returned in 'asoc' */ - opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) ((size_t)asoc + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; @@ -475,9 +475,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockadd errno = ENOTCONN; return (-1); } - opt_len = (socklen_t) (size_of_addresses + - sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) (size_of_addresses + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; From owner-svn-src-head@freebsd.org Sat Mar 2 14:30:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9AD915259FB; Sat, 2 Mar 2019 14:30:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB916A158; Sat, 2 Mar 2019 14:30:27 +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 70E496035; Sat, 2 Mar 2019 14:30:27 +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 x22EURiX010144; Sat, 2 Mar 2019 14:30:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22EURAN010143; Sat, 2 Mar 2019 14:30:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903021430.x22EURAN010143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 2 Mar 2019 14:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344724 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DB916A158 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 14:30:28 -0000 Author: tuexen Date: Sat Mar 2 14:30:27 2019 New Revision: 344724 URL: https://svnweb.freebsd.org/changeset/base/344724 Log: Allow SCTP stream reconfiguration operations only in ESTABLISHED state. This issue was found by running syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Mar 2 14:15:33 2019 (r344723) +++ head/sys/netinet/sctp_usrreq.c Sat Mar 2 14:30:27 2019 (r344724) @@ -4631,6 +4631,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_TCB_UNLOCK(stcb); break; } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (sizeof(struct sctp_reset_streams) + strrst->srs_number_streams * sizeof(uint16_t) > optsize) { error = EINVAL; @@ -4745,6 +4751,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_TCB_UNLOCK(stcb); break; } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (stcb->asoc.stream_reset_outstanding) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); error = EALREADY; @@ -4812,6 +4824,12 @@ sctp_setopt(struct socket *so, int optname, void *optv */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); error = EOPNOTSUPP; + SCTP_TCB_UNLOCK(stcb); + break; + } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; SCTP_TCB_UNLOCK(stcb); break; } From owner-svn-src-head@freebsd.org Sat Mar 2 20:59:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E11F150EEF0; Sat, 2 Mar 2019 20:59:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45220830A0; Sat, 2 Mar 2019 20:59:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35FC0A27B; Sat, 2 Mar 2019 20:59:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x22KxJ1b017839; Sat, 2 Mar 2019 20:59:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22KxIDJ017837; Sat, 2 Mar 2019 20:59:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903022059.x22KxIDJ017837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 2 Mar 2019 20:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344729 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 344729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45220830A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 20:59:19 -0000 Author: jhibbits Date: Sat Mar 2 20:59:18 2019 New Revision: 344729 URL: https://svnweb.freebsd.org/changeset/base/344729 Log: powerpc/booke: Depessimize MAS register updates even more Remove isyncs between MAS register updates in the TLB miss handler, since it's only needed before the TLB update instructions. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Mar 2 20:58:51 2019 (r344728) +++ head/sys/powerpc/booke/locore.S Sat Mar 2 20:59:18 2019 (r344729) @@ -252,6 +252,7 @@ __start: isync bl zero_mas7 bl zero_mas8 + isync tlbwe isync msync @@ -505,6 +506,7 @@ bp_kernload: isync bl zero_mas7 bl zero_mas8 + isync tlbwe isync msync @@ -695,6 +697,7 @@ tlb1_temp_mapping_as1: bl zero_mas7 bl zero_mas8 mtlr %r3 + isync tlbwe isync msync @@ -742,7 +745,6 @@ zero_mas7: li %r20, 0 mtspr SPR_MAS7, %r20 - isync 1: blr @@ -759,7 +761,6 @@ zero_mas8: 1: li %r20, 0 mtspr SPR_MAS8, %r20 - isync blr #endif Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Sat Mar 2 20:58:51 2019 (r344728) +++ head/sys/powerpc/booke/trap_subr.S Sat Mar 2 20:59:18 2019 (r344729) @@ -761,17 +761,14 @@ search_failed: /* Load MAS registers. */ mtspr SPR_MAS0, %r29 - isync mtspr SPR_MAS1, %r28 - isync mtspr SPR_MAS2, %r27 - isync mtspr SPR_MAS3, %r23 - isync bl zero_mas7 bl zero_mas8 + isync tlbwe msync isync @@ -906,20 +903,16 @@ tlb_fill_entry: /* Load MAS registers. */ mtspr SPR_MAS0, %r29 - isync mtspr SPR_MAS1, %r28 - isync mtspr SPR_MAS2, %r27 - isync mtspr SPR_MAS3, %r22 - isync mtspr SPR_MAS7, %r23 - isync mflr %r21 bl zero_mas8 mtlr %r21 + isync tlbwe isync msync From owner-svn-src-head@freebsd.org Sat Mar 2 16:10:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C99315036FB; Sat, 2 Mar 2019 16:10:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7246DEF2; Sat, 2 Mar 2019 16:10:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 119387104; Sat, 2 Mar 2019 16:10:12 +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 x22GABga063013; Sat, 2 Mar 2019 16:10:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22GABoj063012; Sat, 2 Mar 2019 16:10:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201903021610.x22GABoj063012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 2 Mar 2019 16:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344726 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 344726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E7246DEF2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 16:10:12 -0000 Author: tuexen Date: Sat Mar 2 16:10:11 2019 New Revision: 344726 URL: https://svnweb.freebsd.org/changeset/base/344726 Log: Remove debug output. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Mar 2 15:32:20 2019 (r344725) +++ head/sys/netinet/sctp_usrreq.c Sat Mar 2 16:10:11 2019 (r344726) @@ -630,7 +630,6 @@ connected_type: /* now what about control */ if (control) { if (inp->control) { - SCTP_PRINTF("huh? control set?\n"); sctp_m_freem(inp->control); inp->control = NULL; } @@ -3751,13 +3750,11 @@ sctp_setopt(struct socket *so, int optname, void *optv uint32_t vrf_id; if (optval == NULL) { - SCTP_PRINTF("optval is NULL\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { - SCTP_PRINTF("inp is NULL?\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } From owner-svn-src-head@freebsd.org Sat Mar 2 21:11:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EEF3150FC70; Sat, 2 Mar 2019 21:11:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33825843D5; Sat, 2 Mar 2019 21:11:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 251AAA496; Sat, 2 Mar 2019 21:11:47 +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 x22LBlKA027137; Sat, 2 Mar 2019 21:11:47 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22LBlGc027136; Sat, 2 Mar 2019 21:11:47 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903022111.x22LBlGc027136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 2 Mar 2019 21:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344730 - 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: 344730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33825843D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 21:11:47 -0000 Author: jhibbits Date: Sat Mar 2 21:11:46 2019 New Revision: 344730 URL: https://svnweb.freebsd.org/changeset/base/344730 Log: powerpc: fix 'show spr' for ELFv1 powerpc64 Update and flush the right cache range for the ELFv1 ABI. MFC after: 1 week Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sat Mar 2 20:59:18 2019 (r344729) +++ head/sys/powerpc/powerpc/machdep.c Sat Mar 2 21:11:46 2019 (r344730) @@ -541,12 +541,16 @@ DB_SHOW_COMMAND(spr, db_show_spr) saved_sprno = sprno = (intptr_t) addr; sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5); p = (uint32_t *)(void *)&get_spr; +#ifdef __powerpc64__ #if defined(_CALL_ELF) && _CALL_ELF == 2 /* Account for ELFv2 function prologue. */ p += 2; +#else + p = *(volatile uint32_t * volatile *)p; #endif +#endif *p = (*p & ~0x001ff800) | (sprno << 11); - __syncicache(get_spr, cacheline_size); + __syncicache(__DEVOLATILE(uint32_t *, p), cacheline_size); spr = get_spr(sprno); db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno, From owner-svn-src-head@freebsd.org Sat Mar 2 21:22:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E313151075E; Sat, 2 Mar 2019 21:22:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9E7F84DDD; Sat, 2 Mar 2019 21:22:56 +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 BB465A790; Sat, 2 Mar 2019 21:22:56 +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 x22LMugb033094; Sat, 2 Mar 2019 21:22:56 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22LMuxB033093; Sat, 2 Mar 2019 21:22:56 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201903022122.x22LMuxB033093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 2 Mar 2019 21:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344731 - head/sbin/tunefs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/tunefs X-SVN-Commit-Revision: 344731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9E7F84DDD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 21:22:57 -0000 Author: mckusick Date: Sat Mar 2 21:22:56 2019 New Revision: 344731 URL: https://svnweb.freebsd.org/changeset/base/344731 Log: The size of the UFS soft-updates journal must be a multiple of the filesystem block size. When a size is specified with the -S flag to tunefs(8), round it up to the filesystem block size. Reported by: Peter Holm Tested by: Peter Holm Sponsored by: Netflix Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sat Mar 2 21:11:46 2019 (r344730) +++ head/sbin/tunefs/tunefs.c Sat Mar 2 21:22:56 2019 (r344731) @@ -971,9 +971,9 @@ journal_alloc(int64_t size) if (size / sblock.fs_fsize > sblock.fs_fpg) size = sblock.fs_fpg * sblock.fs_fsize; size = MAX(SUJ_MIN, size); - /* fsck does not support fragments in journal files. */ - size = roundup(size, sblock.fs_bsize); } + /* fsck does not support fragments in journal files. */ + size = roundup(size, sblock.fs_bsize); resid = blocks = size / sblock.fs_bsize; if (sblock.fs_cstotal.cs_nbfree < blocks) { warn("Insufficient free space for %jd byte journal", size); From owner-svn-src-head@freebsd.org Sat Mar 2 22:28:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BC2151393E; Sat, 2 Mar 2019 22:28:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80D4A87A66; Sat, 2 Mar 2019 22:28:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F52CB20F; Sat, 2 Mar 2019 22:28:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x22MSiLo065057; Sat, 2 Mar 2019 22:28:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22MSiiZ065056; Sat, 2 Mar 2019 22:28:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201903022228.x22MSiiZ065056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 2 Mar 2019 22:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344733 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80D4A87A66 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 02 Mar 2019 22:28:45 -0000 Author: ian Date: Sat Mar 2 22:28:43 2019 New Revision: 344733 URL: https://svnweb.freebsd.org/changeset/base/344733 Log: Add some comments. Give #define'd names to some scattered numbers. Change some #define'd names to be more descriptive. When reporting a post-write compare failure, report the page number, not the byte address of the page. The latter is the only functional change, it makes the number match the words of the error message. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sat Mar 2 21:30:01 2019 (r344732) +++ head/sys/dev/flash/at45d.c Sat Mar 2 22:28:43 2019 (r344733) @@ -129,13 +129,17 @@ static int at45d_get_mfg_info(device_t dev, struct at4 static int at45d_get_status(device_t dev, uint8_t *status); static int at45d_wait_ready(device_t dev, uint8_t *status); -#define BUFFER_TRANSFER 0x53 -#define BUFFER_COMPARE 0x60 +#define PAGE_TO_BUFFER_TRANSFER 0x53 +#define PAGE_TO_BUFFER_COMPARE 0x60 #define PROGRAM_THROUGH_BUFFER 0x82 #define MANUFACTURER_ID 0x9f #define STATUS_REGISTER_READ 0xd7 #define CONTINUOUS_ARRAY_READ 0xe8 +#define STATUS_READY (1u << 7) +#define STATUS_CMPFAIL (1u << 6) +#define STATUS_PAGE2N (1u << 0) + /* * Metadata for supported chips. * @@ -221,7 +225,7 @@ at45d_wait_ready(device_t dev, uint8_t *status) err = ETIMEDOUT; else err = at45d_get_status(dev, status); - } while (err == 0 && (*status & 0x80) == 0); + } while (err == 0 && !(*status & STATUS_READY)); return (err); } @@ -329,7 +333,7 @@ at45d_delayed_attach(void *xsc) sc->pagecount = ident->pagecount; sc->pageoffset = ident->pageoffset; - if (ident->pagesize2n != 0 && (status & 0x01) != 0) { + if (ident->pagesize2n != 0 && (status & STATUS_PAGE2N)) { sc->pageoffset -= 1; pagesize = ident->pagesize2n; } else @@ -378,6 +382,10 @@ at45d_getattr(struct bio *bp) { struct at45d_softc *sc; + /* + * This function exists to support geom_flashmap and fdt_slicer. + */ + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) return (ENXIO); if (strcmp(bp->bio_attribute, "SPI::device") != 0) @@ -434,7 +442,7 @@ at45d_task(void *arg) } bp = bioq_takefirst(&sc->bio_queue); if (bp == NULL) - msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); + msleep(sc, &sc->sc_mtx, PRIBIO, "at45dq", 0); } while (bp == NULL); AT45D_UNLOCK(sc); @@ -473,14 +481,19 @@ at45d_task(void *arg) } addr = page << sc->pageoffset; if (bp->bio_cmd == BIO_WRITE) { + /* + * If writing less than a full page, transfer + * the existing page to the buffer, so that our + * PROGRAM_THROUGH_BUFFER below will preserve + * the parts of the page we're not writing. + */ if (len != sc->pagesize) { - txBuf[0] = BUFFER_TRANSFER; + txBuf[0] = PAGE_TO_BUFFER_TRANSFER; txBuf[1] = ((addr >> 16) & 0xff); txBuf[2] = ((addr >> 8) & 0xff); txBuf[3] = 0; cmd.tx_data_sz = cmd.rx_data_sz = 0; - err = SPIBUS_TRANSFER(pdev, dev, - &cmd); + err = SPIBUS_TRANSFER(pdev, dev, &cmd); if (err == 0) err = at45d_wait_ready(dev, &status); @@ -506,7 +519,7 @@ at45d_task(void *arg) } if (bp->bio_cmd == BIO_WRITE) { addr = page << sc->pageoffset; - txBuf[0] = BUFFER_COMPARE; + txBuf[0] = PAGE_TO_BUFFER_COMPARE; txBuf[1] = ((addr >> 16) & 0xff); txBuf[2] = ((addr >> 8) & 0xff); txBuf[3] = 0; @@ -514,9 +527,9 @@ at45d_task(void *arg) err = SPIBUS_TRANSFER(pdev, dev, &cmd); if (err == 0) err = at45d_wait_ready(dev, &status); - if (err != 0 || (status & 0x40) != 0) { + if (err != 0 || (status & STATUS_CMPFAIL)) { device_printf(dev, "comparing page " - "%d failed (status=0x%x)\n", addr, + "%d failed (status=0x%x)\n", page, status); berr = EIO; goto out; From owner-svn-src-head@freebsd.org Sat Mar 2 20:58:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C93150EE39; Sat, 2 Mar 2019 20:58:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF87382E85; Sat, 2 Mar 2019 20:58:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF0C7A27A; Sat, 2 Mar 2019 20:58:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x22KwpFK017775; Sat, 2 Mar 2019 20:58:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22Kwp5u017774; Sat, 2 Mar 2019 20:58:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201903022058.x22Kwp5u017774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 2 Mar 2019 20:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344728 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 344728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF87382E85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 20:58:52 -0000 Author: ian Date: Sat Mar 2 20:58:51 2019 New Revision: 344728 URL: https://svnweb.freebsd.org/changeset/base/344728 Log: Bugfix: use a dummy buffer for the inactive side of a transfer. This is especially important for writes. SPI is inherently a bidirectional bus; you receive data (even if it's garbage) while writing. We should not receive that data into the same buffer we're writing to the device. When reading it doesn't matter what we send to the device, but using the dummy buffer for that as well is pleasingly symmetrical. Modified: head/sys/dev/flash/at45d.c Modified: head/sys/dev/flash/at45d.c ============================================================================== --- head/sys/dev/flash/at45d.c Sat Mar 2 16:28:29 2019 (r344727) +++ head/sys/dev/flash/at45d.c Sat Mar 2 20:58:51 2019 (r344728) @@ -95,6 +95,7 @@ struct at45d_softc uint16_t pagecount; uint16_t pageoffset; uint16_t pagesize; + void *dummybuf; }; #define TSTATE_STOPPED 0 @@ -285,6 +286,7 @@ at45d_detach(device_t dev) if (err == 0 && sc->taskstate == TSTATE_STOPPED) { disk_destroy(sc->disk); bioq_flush(&sc->bio_queue, NULL, ENXIO); + free(sc->dummybuf, M_DEVBUF); AT45D_LOCK_DESTROY(sc); } return (err); @@ -334,6 +336,8 @@ at45d_delayed_attach(void *xsc) pagesize = ident->pagesize; sc->pagesize = pagesize; + sc->dummybuf = malloc(pagesize, M_DEVBUF, M_WAITOK | M_ZERO); + sc->disk = disk_alloc(); sc->disk->d_open = at45d_open; sc->disk->d_close = at45d_close; @@ -444,11 +448,13 @@ at45d_task(void *arg) case BIO_READ: txBuf[0] = CONTINUOUS_ARRAY_READ; cmd.tx_cmd_sz = cmd.rx_cmd_sz = 8; - cmd.tx_data = cmd.rx_data = buf; + cmd.tx_data = sc->dummybuf; + cmd.rx_data = buf; break; case BIO_WRITE: cmd.tx_cmd_sz = cmd.rx_cmd_sz = 4; - cmd.tx_data = cmd.rx_data = buf; + cmd.tx_data = buf; + cmd.rx_data = sc->dummybuf; if (resid + offset > sc->pagesize) len = sc->pagesize - offset; break; @@ -524,7 +530,10 @@ at45d_task(void *arg) len = sc->pagesize; else len = resid; - cmd.tx_data = cmd.rx_data = buf; + if (bp->bio_cmd == BIO_READ) + cmd.rx_data = buf; + else + cmd.tx_data = buf; } out: if (berr != 0) { From owner-svn-src-head@freebsd.org Sat Mar 2 21:30:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3221510D23; Sat, 2 Mar 2019 21:30:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68B4585218; Sat, 2 Mar 2019 21:30:02 +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 5AB23A79A; Sat, 2 Mar 2019 21:30:02 +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 x22LU246033435; Sat, 2 Mar 2019 21:30:02 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x22LU2Ow033434; Sat, 2 Mar 2019 21:30:02 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201903022130.x22LU2Ow033434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 2 Mar 2019 21:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344732 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 344732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68B4585218 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 21:30:03 -0000 Author: mckusick Date: Sat Mar 2 21:30:01 2019 New Revision: 344732 URL: https://svnweb.freebsd.org/changeset/base/344732 Log: Properly calculate the last used logical block of a file when checking inodes that reference directories. While here tighten the check for comparing the last logical block with the end of the file. Reported by: Peter Holm Tested by: Peter Holm Sponsored by: Netflix Modified: head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/pass1.c Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sat Mar 2 21:22:56 2019 (r344731) +++ head/sbin/fsck_ffs/inode.c Sat Mar 2 21:30:01 2019 (r344732) @@ -127,9 +127,9 @@ ckinode(union dinode *dp, struct inodesc *idesc) ret = iblock(idesc, i + 1, remsize, BT_LEVEL1 + i); if (ret & STOP) return (ret); - } else { + } else if (remsize > 0) { idesc->id_lbn += sizepb / sblock.fs_bsize; - if (idesc->id_type == DATA && remsize > 0) { + if (idesc->id_type == DATA) { /* An empty block in a directory XXX */ getpathname(pathbuf, idesc->id_number, idesc->id_number); Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Sat Mar 2 21:22:56 2019 (r344731) +++ head/sbin/fsck_ffs/pass1.c Sat Mar 2 21:30:01 2019 (r344732) @@ -439,7 +439,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r * at its end. */ if (DIP(dp, di_size) > UFS_NDADDR * sblock.fs_bsize && - idesc->id_lballoc != lblkno(&sblock, DIP(dp, di_size) - 1)) { + idesc->id_lballoc < lblkno(&sblock, DIP(dp, di_size) - 1)) { fixsize = lblktosize(&sblock, idesc->id_lballoc + 1); pwarn("INODE %lu: FILE SIZE %ju BEYOND END OF ALLOCATED FILE, " "SIZE SHOULD BE %ju", (u_long)inumber,