From owner-svn-src-head@freebsd.org Sun Apr 15 01:31:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABDC1F84DD5; Sun, 15 Apr 2018 01:31:18 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 416EB70C9D; Sun, 15 Apr 2018 01:31:18 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22a.google.com with SMTP id h9so630598iob.5; Sat, 14 Apr 2018 18:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=efd/wZu624ts3wSUjJ1tvDijWmJk1wXDx8O7YNzenmo=; b=LpkP+Iv9LhLgydlP7w9rdoLLkANJuea6HCaMAqzm6Xqb045M7yJf+xJu4RiB4pd6WW f0ZJ1sNLuJJWI6+nKo47N/LfZcoN9bG+72dnugZpEK3k/bDcCBcXZxwbCfkYJeXEeAkF SXYxhCTVaHzXvVrYw5nx/4K64/19z66uq5GW5oG/G5D/nh6lpAnSvWiFzjdF6VTrWgGk jUuv/aMxQUi6bpjKbLGH5crDiz/7hegtFw4JLwiCBYrleztyHLmzUnm7fsGnNjZuG1XZ qsskuSNu54edt9KaFiLUGQIuRDXE1mjUUarLpAna/M6pbKG66ff4IWNs36vDmQAbh/Fo B0XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=efd/wZu624ts3wSUjJ1tvDijWmJk1wXDx8O7YNzenmo=; b=EycLuJAwLnvLlwYj6eq5Abm93lOYQVGH9APfnEmp2HojPuxs/a3PG4WbqvB/2ZdAmP JZaa827nCbbrRkoPvO1VS8iaq7FLKRXNUIBBe3dE90olrLLw+XSBw216DfvjE01V+RoP YF2ibCjckVfEMemfZpMmI0j4SnGlMQQSC/xN+qnvB/Go62FLMLsXrS+6nqOJZjbwiwAn VDEpyx2AoiToaugPD3Z/Psp4Ss1myQv6CNiwMCMpdvllt0hPa6tQYTPx9MuSeFete7uz jYmw9XHlZt5R8tWHUOMs43rFTTb/LXME9B5qDXirRaL9crz18iHGOuRbedpruYh6/jDL h5ew== X-Gm-Message-State: ALQs6tA+4p+0t7XBP2UZJDIEgkPi635qgyd6ZNh+7o/ZeIRKtEXwWl2X OHyqoeqBgw9ClPWhH+o5Skxl/7l/thBBSX5yR87OMQ== X-Google-Smtp-Source: AIpwx48p5uS7zhGkFnr93az2WQm7+UFhAI68Ap+DTvm9fbC6Z+LHodncZLOgKoUuCk1icRuPA0I0ELGilbyD33HUy0I= X-Received: by 10.107.134.85 with SMTP id i82mr18027091iod.210.1523755877579; Sat, 14 Apr 2018 18:31:17 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Sat, 14 Apr 2018 18:30:57 -0700 (PDT) In-Reply-To: <201804142214.w3EMEIRu028631@repo.freebsd.org> References: <201804142214.w3EMEIRu028631@repo.freebsd.org> From: Ed Maste Date: Sat, 14 Apr 2018 21:30:57 -0400 X-Google-Sender-Auth: pP-AvvYIEgZQzWnLVGSVp0-9I1c Message-ID: Subject: Re: svn commit: r332509 - head/sys/i386/i386 To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 01:31:18 -0000 On 14 April 2018 at 18:14, Warner Losh wrote: > Author: imp > Date: Sat Apr 14 22:14:18 2018 > New Revision: 332509 > URL: https://svnweb.freebsd.org/changeset/base/332509 > > ... > even though we should eventually migrate to bool > and true/false (though the tables they are in are nicely packed with > short and wouldn't be so nicely packed with bool, another reason > to leave it alone for now). In practice it should be a no-op, replacing the 2-byte short i_has_modrm with the bool followed by a pad byte. From owner-svn-src-head@freebsd.org Sun Apr 15 08:34:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70FA7FA3C4B; Sun, 15 Apr 2018 08:34:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 228A76C350; Sun, 15 Apr 2018 08:34:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D55D49CC; Sun, 15 Apr 2018 08:34:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3F8YHSd038231; Sun, 15 Apr 2018 08:34:17 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3F8YGO3038226; Sun, 15 Apr 2018 08:34:16 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804150834.w3F8YGO3038226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 15 Apr 2018 08:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332510 - in head: usr.bin/wall usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head: usr.bin/wall usr.sbin/syslogd X-SVN-Commit-Revision: 332510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 08:34:17 -0000 Author: ed Date: Sun Apr 15 08:34:16 2018 New Revision: 332510 URL: https://svnweb.freebsd.org/changeset/base/332510 Log: Add RFC 5424 syslog message output to syslogd. - Move all of the code responsible for transmitting log messages into a separate function, fprintlog_write(). - Instead of manually modifying a list of iovecs, add a structure iovlist with some helper functions. - Alter the F_FORW (UDP message forwarding) case to also use iovecs like the other cases. Use sendmsg() instead of sendto(). - In the case of F_FORW, truncate the message to a size dependent on the address family (AF_INET, AF_INET6), as proposed by RFC 5426. - Move all traditional message formatting into fprintlog_bsd(). Get rid of some of the string copying and snprintf()'ing. Simply emit more iovecs to get the job done. - Increase ttymsg()'s limit of 7 iovecs to 32. Add a definition for this limit, so it can be reused by iovlist. - Add fprintlog_rfc5424() to emit RFC 5424 formatted log entries. - Add a "-O" command line option to enable RFC 5424 formatting. It would have been nicer if we supported "-o rfc5424", just like on NetBSD. Unfortunately, the "-o" flag is already used for a different purpose on FreeBSD. - Don't truncate hostnames in the RFC 5424 case, as suggested by that specific RFC. For people interested in using this, this feature can be enabled by adding the following line to /etc/rc.conf: syslogd_flags="-s -O rfc5424" Differential Revision: https://reviews.freebsd.org/D15011 Modified: head/usr.bin/wall/ttymsg.c head/usr.bin/wall/ttymsg.h head/usr.sbin/syslogd/syslogd.8 head/usr.sbin/syslogd/syslogd.c Modified: head/usr.bin/wall/ttymsg.c ============================================================================== --- head/usr.bin/wall/ttymsg.c Sat Apr 14 22:14:18 2018 (r332509) +++ head/usr.bin/wall/ttymsg.c Sun Apr 15 08:34:16 2018 (r332510) @@ -61,7 +61,7 @@ static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkel const char * ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout) { - struct iovec localiov[7]; + struct iovec localiov[TTYMSG_IOV_MAX]; ssize_t left, wret; int cnt, fd; char device[MAXNAMLEN] = _PATH_DEV; Modified: head/usr.bin/wall/ttymsg.h ============================================================================== --- head/usr.bin/wall/ttymsg.h Sat Apr 14 22:14:18 2018 (r332509) +++ head/usr.bin/wall/ttymsg.h Sun Apr 15 08:34:16 2018 (r332510) @@ -1,3 +1,5 @@ /* $FreeBSD$ */ +#define TTYMSG_IOV_MAX 32 + const char *ttymsg(struct iovec *, int, const char *, int); Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Sat Apr 14 22:14:18 2018 (r332509) +++ head/usr.sbin/syslogd/syslogd.8 Sun Apr 15 08:34:16 2018 (r332510) @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 28, 2017 +.Dd April 9, 2018 .Dt SYSLOGD 8 .Os .Sh NAME @@ -42,6 +42,7 @@ .Op Fl f Ar config_file .Op Fl l Oo Ar mode Ns \&: Oc Ns Ar path .Op Fl m Ar mark_interval +.Op Fl O Ar format .Op Fl P Ar pid_file .Op Fl p Ar log_socket .Op Fl S Ar logpriv_socket @@ -242,6 +243,20 @@ Usually the .Dq kern facility is reserved for messages read directly from .Pa /dev/klog . +.It Fl O Ar format +Select the output format of generated log messages. +The values +.Ar bsd +and +.Ar rfc3164 +are used to generate RFC 3164 log messages. +The values +.Ar syslog +and +.Ar rfc5424 +are used to generate RFC 5424 log messages, +having RFC 3339 timestamps with microsecond precision. +The default is to generate RFC 3164 log messages. .It Fl m Ar mark_interval Select the number of minutes between .Dq mark Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Apr 14 22:14:18 2018 (r332509) +++ head/usr.sbin/syslogd/syslogd.c Sun Apr 15 08:34:16 2018 (r332510) @@ -136,6 +136,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -367,9 +368,12 @@ static int KeepKernFac; /* Keep remotely logged kernel static int needdofsync = 0; /* Are any file(s) waiting to be fsynced? */ static struct pidfh *pfh; static int sigpipe[2]; /* Pipe to catch a signal during select(). */ +static bool RFC3164OutputFormat = true; /* Use legacy format by default. */ static volatile sig_atomic_t MarkSet, WantDie, WantInitialize, WantReapchild; +struct iovlist; + static int allowaddr(char *); static int addfile(struct filed *); static int addpeer(struct peer *); @@ -386,6 +390,7 @@ static void dofsync(void); static void domark(int); static void fprintlog_first(struct filed *, const char *, const char *, const char *, const char *, const char *, const char *, int); +static void fprintlog_write(struct filed *, struct iovlist *, int); static void fprintlog_successive(struct filed *, int); static void init(int); static void logerror(const char *); @@ -498,7 +503,7 @@ main(int argc, char *argv[]) if (madvise(NULL, 0, MADV_PROTECT) != 0) dprintf("madvise() failed: %s\n", strerror(errno)); - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:m:nNop:P:sS:Tuv")) + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:m:nNoO:p:P:sS:Tuv")) != -1) switch (ch) { #ifdef INET @@ -621,6 +626,16 @@ main(int argc, char *argv[]) case 'n': resolve = 0; break; + case 'O': + if (strcmp(optarg, "bsd") == 0 || + strcmp(optarg, "rfc3164") == 0) + RFC3164OutputFormat = true; + else if (strcmp(optarg, "syslog") == 0 || + strcmp(optarg, "rfc5424") == 0) + RFC3164OutputFormat = false; + else + usage(); + break; case 'o': use_bootfile = 1; break; @@ -880,12 +895,12 @@ static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", - "usage: syslogd [-468ACcdFHknosTuv] [-a allowed_peer]", - " [-b bind_address] [-f config_file]", - " [-l [mode:]path] [-m mark_interval]", - " [-P pid_file] [-p log_socket]", - " [-S logpriv_socket]"); + fprintf(stderr, + "usage: syslogd [-468ACcdFHknosTuv] [-a allowed_peer]\n" + " [-b bind_address] [-f config_file]\n" + " [-l [mode:]path] [-m mark_interval]\n" + " [-O format] [-P pid_file] [-p log_socket]\n" + " [-S logpriv_socket]\n"); exit(1); } @@ -1558,177 +1573,114 @@ dofsync(void) } } -#define IOV_SIZE 7 +/* + * List of iovecs to which entries can be appended. + * Used for constructing the message to be logged. + */ +struct iovlist { + struct iovec iov[TTYMSG_IOV_MAX]; + size_t iovcnt; + size_t totalsize; +}; + static void -fprintlog_first(struct filed *f, const char *hostname, const char *app_name, - const char *procid, const char *msgid __unused, - const char *structured_data __unused, const char *msg, int flags) +iovlist_init(struct iovlist *il) { - struct iovec iov[IOV_SIZE]; - struct addrinfo *r; - int l, lsent = 0; - char tagged_msg[MAXLINE + 1], line[MAXLINE + 1], greetings[200]; - char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n"; - char timebuf[RFC3164_DATELEN + 1]; - const char *msgret; - if (strftime(timebuf, sizeof(timebuf), RFC3164_DATEFMT, - &f->f_lasttime.tm) == 0) - timebuf[0] = '\0'; - if (f->f_type == F_WALL) { - /* The time displayed is not synchornized with the other log - * destinations (like messages). Following fragment was using - * ctime(&now), which was updating the time every 30 sec. - * With f_lasttime, time is synchronized correctly. - */ - iov[0] = (struct iovec){ - .iov_base = greetings, - .iov_len = snprintf(greetings, sizeof(greetings), - "\r\n\7Message from syslogd@%s " - "at %.24s ...\r\n", hostname, timebuf) + il->iovcnt = 0; + il->totalsize = 0; +} + +static void +iovlist_append(struct iovlist *il, const char *str) +{ + size_t size; + + /* Discard components if we've run out of iovecs. */ + if (il->iovcnt < nitems(il->iov)) { + size = strlen(str); + il->iov[il->iovcnt++] = (struct iovec){ + .iov_base = __DECONST(char *, str), + .iov_len = size, }; - if (iov[0].iov_len >= sizeof(greetings)) - iov[0].iov_len = sizeof(greetings) - 1; - iov[1] = (struct iovec){ - .iov_base = nul, - .iov_len = 0 - }; - } else { - iov[0] = (struct iovec){ - .iov_base = timebuf, - .iov_len = strlen(timebuf) - }; - iov[1] = (struct iovec){ - .iov_base = space, - .iov_len = 1 - }; + il->totalsize += size; } +} - if (LogFacPri) { - static char fp_buf[30]; /* Hollow laugh */ - int fac = f->f_prevpri & LOG_FACMASK; - int pri = LOG_PRI(f->f_prevpri); - const char *f_s = NULL; - char f_n[5]; /* Hollow laugh */ - const char *p_s = NULL; - char p_n[5]; /* Hollow laugh */ +static void +iovlist_truncate(struct iovlist *il, size_t size) +{ + struct iovec *last; + size_t diff; - if (LogFacPri > 1) { - const CODE *c; - - for (c = facilitynames; c->c_name; c++) { - if (c->c_val == fac) { - f_s = c->c_name; - break; - } - } - for (c = prioritynames; c->c_name; c++) { - if (c->c_val == pri) { - p_s = c->c_name; - break; - } - } + while (size > il->totalsize) { + diff = size - il->totalsize; + last = &il->iov[il->iovcnt - 1]; + if (diff >= last->iov_len) { + /* Remove the last iovec entirely. */ + --il->iovcnt; + il->totalsize -= last->iov_len; + } else { + /* Remove the last iovec partially. */ + last->iov_len -= diff; + il->totalsize -= diff; } - if (!f_s) { - snprintf(f_n, sizeof f_n, "%d", LOG_FAC(fac)); - f_s = f_n; - } - if (!p_s) { - snprintf(p_n, sizeof p_n, "%d", pri); - p_s = p_n; - } - snprintf(fp_buf, sizeof fp_buf, "<%s.%s> ", f_s, p_s); - iov[2] = (struct iovec){ - .iov_base = fp_buf, - .iov_len = strlen(fp_buf) - }; - } else { - iov[2] = (struct iovec){ - .iov_base = nul, - .iov_len = 0 - }; } - /* Prepend the application name to the message if provided. */ - if (app_name != NULL) { - if (procid != NULL) - snprintf(tagged_msg, sizeof(tagged_msg), - "%s[%s]: %s", app_name, procid, msg); - else - snprintf(tagged_msg, sizeof(tagged_msg), - "%s: %s", app_name, msg); - msg = tagged_msg; - } - iov[3] = (struct iovec){ - .iov_base = __DECONST(char *, hostname), - .iov_len = strlen(hostname) - }; - iov[4] = (struct iovec){ - .iov_base = space, - .iov_len = 1 - }; - iov[5] = (struct iovec){ - .iov_base = __DECONST(char *, msg), - .iov_len = strlen(msg) - }; - dprintf("Logging to %s", TypeNames[f->f_type]); - f->f_time = now; +} - switch (f->f_type) { - case F_UNUSED: - dprintf("\n"); - break; +static void +fprintlog_write(struct filed *f, struct iovlist *il, int flags) +{ + struct msghdr msghdr; + struct addrinfo *r; + struct socklist *sl; + const char *msgret; + ssize_t lsent; + switch (f->f_type) { case F_FORW: + /* Truncate messages to RFC 5426 recommended size. */ dprintf(" %s", f->fu_forw_hname); switch (f->fu_forw_addr->ai_addr->sa_family) { #ifdef INET case AF_INET: dprintf(":%d\n", ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port)); + iovlist_truncate(il, 480); break; #endif #ifdef INET6 case AF_INET6: dprintf(":%d\n", ntohs(satosin6(f->fu_forw_addr->ai_addr)->sin6_port)); + iovlist_truncate(il, 1180); break; #endif default: dprintf("\n"); } - /* check for local vs remote messages */ - if (strcasecmp(hostname, LocalHostName)) - l = snprintf(line, sizeof line - 1, - "<%d>%.15s Forwarded from %s: %s", - f->f_prevpri, (char *)iov[0].iov_base, - hostname, (char *)iov[5].iov_base); - else - l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", - f->f_prevpri, (char *)iov[0].iov_base, - (char *)iov[5].iov_base); - if (l < 0) - l = 0; - else if (l > MAXLINE) - l = MAXLINE; + lsent = 0; for (r = f->fu_forw_addr; r; r = r->ai_next) { - struct socklist *sl; - + memset(&msghdr, 0, sizeof(msghdr)); + msghdr.msg_name = r->ai_addr; + msghdr.msg_namelen = r->ai_addrlen; + msghdr.msg_iov = il->iov; + msghdr.msg_iovlen = il->iovcnt; STAILQ_FOREACH(sl, &shead, next) { if (sl->sl_ss.ss_family == AF_LOCAL || sl->sl_ss.ss_family == AF_UNSPEC || sl->sl_socket < 0) continue; - lsent = sendto(sl->sl_socket, line, l, 0, - r->ai_addr, r->ai_addrlen); - if (lsent == l) + lsent = sendmsg(sl->sl_socket, &msghdr, 0); + if (lsent == (ssize_t)il->totalsize) break; } - if (lsent == l && !send_to_all) + if (lsent == (ssize_t)il->totalsize && !send_to_all) break; } - dprintf("lsent/l: %d/%d\n", lsent, l); - if (lsent != l) { + dprintf("lsent/totalsize: %zd/%zu\n", lsent, il->totalsize); + if (lsent != (ssize_t)il->totalsize) { int e = errno; logerror("sendto"); errno = e; @@ -1758,11 +1710,8 @@ fprintlog_first(struct filed *f, const char *hostname, case F_FILE: dprintf(" %s\n", f->fu_fname); - iov[6] = (struct iovec){ - .iov_base = lf, - .iov_len = 1 - }; - if (writev(f->f_file, iov, nitems(iov)) < 0) { + iovlist_append(il, "\n"); + if (writev(f->f_file, il->iov, il->iovcnt) < 0) { /* * If writev(2) fails for potentially transient errors * like the filesystem being full, ignore it. @@ -1782,10 +1731,7 @@ fprintlog_first(struct filed *f, const char *hostname, case F_PIPE: dprintf(" %s\n", f->fu_pipe_pname); - iov[6] = (struct iovec){ - .iov_base = lf, - .iov_len = 1 - }; + iovlist_append(il, "\n"); if (f->fu_pipe_pid == 0) { if ((f->f_file = p_open(f->fu_pipe_pname, &f->fu_pipe_pid)) < 0) { @@ -1793,7 +1739,7 @@ fprintlog_first(struct filed *f, const char *hostname, break; } } - if (writev(f->f_file, iov, nitems(iov)) < 0) { + if (writev(f->f_file, il->iov, il->iovcnt) < 0) { int e = errno; deadq_enter(f->fu_pipe_pid, f->fu_pipe_pname); @@ -1812,12 +1758,9 @@ fprintlog_first(struct filed *f, const char *hostname, case F_TTY: dprintf(" %s%s\n", _PATH_DEV, f->fu_fname); - iov[6] = (struct iovec){ - .iov_base = crlf, - .iov_len = 2 - }; + iovlist_append(il, "\r\n"); errno = 0; /* ttymsg() only sometimes returns an errno */ - if ((msgret = ttymsg(iov, nitems(iov), f->fu_fname, 10))) { + if ((msgret = ttymsg(il->iov, il->iovcnt, f->fu_fname, 10))) { f->f_type = F_UNUSED; logerror(msgret); } @@ -1826,14 +1769,190 @@ fprintlog_first(struct filed *f, const char *hostname, case F_USERS: case F_WALL: dprintf("\n"); - iov[6] = (struct iovec){ - .iov_base = crlf, - .iov_len = 2 - }; - wallmsg(f, iov, nitems(iov)); + iovlist_append(il, "\r\n"); + wallmsg(f, il->iov, il->iovcnt); break; } +} + +static void +fprintlog_rfc5424(struct filed *f, const char *hostname, const char *app_name, + const char *procid, const char *msgid, const char *structured_data, + const char *msg, int flags) +{ + struct iovlist il; + suseconds_t usec; + int i; + char timebuf[33], priority_number[5]; + + iovlist_init(&il); + if (f->f_type == F_WALL) + iovlist_append(&il, "\r\n\aMessage from syslogd ...\r\n"); + iovlist_append(&il, "<"); + snprintf(priority_number, sizeof(priority_number), "%d", f->f_prevpri); + iovlist_append(&il, priority_number); + iovlist_append(&il, ">1 "); + if (strftime(timebuf, sizeof(timebuf), "%FT%T.______%z", + &f->f_lasttime.tm) == sizeof(timebuf) - 2) { + /* Add colon to the time zone offset, which %z doesn't do. */ + timebuf[32] = '\0'; + timebuf[31] = timebuf[30]; + timebuf[30] = timebuf[29]; + timebuf[29] = ':'; + + /* Overwrite space for microseconds with actual value. */ + usec = f->f_lasttime.usec; + for (i = 25; i >= 20; --i) { + timebuf[i] = usec % 10 + '0'; + usec /= 10; + } + iovlist_append(&il, timebuf); + } else + iovlist_append(&il, "-"); + iovlist_append(&il, " "); + iovlist_append(&il, hostname); + iovlist_append(&il, " "); + iovlist_append(&il, app_name == NULL ? "-" : app_name); + iovlist_append(&il, " "); + iovlist_append(&il, procid == NULL ? "-" : procid); + iovlist_append(&il, " "); + iovlist_append(&il, msgid == NULL ? "-" : msgid); + iovlist_append(&il, " "); + iovlist_append(&il, structured_data == NULL ? "-" : structured_data); + iovlist_append(&il, " "); + iovlist_append(&il, msg); + + fprintlog_write(f, &il, flags); +} + +static void +fprintlog_rfc3164(struct filed *f, const char *hostname, const char *app_name, + const char *procid, const char *msg, int flags) +{ + struct iovlist il; + const CODE *c; + int facility, priority; + char timebuf[RFC3164_DATELEN + 1], facility_number[5], + priority_number[5]; + bool facility_found, priority_found; + + if (strftime(timebuf, sizeof(timebuf), RFC3164_DATEFMT, + &f->f_lasttime.tm) == 0) + timebuf[0] = '\0'; + + iovlist_init(&il); + switch (f->f_type) { + case F_FORW: + /* Message forwarded over the network. */ + iovlist_append(&il, "<"); + snprintf(priority_number, sizeof(priority_number), "%d", + f->f_prevpri); + iovlist_append(&il, priority_number); + iovlist_append(&il, ">"); + iovlist_append(&il, timebuf); + if (strcasecmp(hostname, LocalHostName) != 0) { + iovlist_append(&il, " Forwarded from "); + iovlist_append(&il, hostname); + iovlist_append(&il, ":"); + } + iovlist_append(&il, " "); + break; + + case F_WALL: + /* Message written to terminals. */ + iovlist_append(&il, "\r\n\aMessage from syslogd@"); + iovlist_append(&il, hostname); + iovlist_append(&il, " at "); + iovlist_append(&il, timebuf); + iovlist_append(&il, " ...\r\n"); + break; + + default: + /* Message written to files. */ + iovlist_append(&il, timebuf); + iovlist_append(&il, " "); + iovlist_append(&il, hostname); + iovlist_append(&il, " "); + + if (LogFacPri) { + iovlist_append(&il, "<"); + + facility = f->f_prevpri & LOG_FACMASK; + facility_found = false; + if (LogFacPri > 1) { + for (c = facilitynames; c->c_name; c++) { + if (c->c_val == facility) { + iovlist_append(&il, c->c_name); + facility_found = true; + break; + } + } + } + if (!facility_found) { + snprintf(facility_number, + sizeof(facility_number), "%d", + LOG_FAC(facility)); + iovlist_append(&il, facility_number); + } + + iovlist_append(&il, "."); + + priority = LOG_PRI(f->f_prevpri); + priority_found = false; + if (LogFacPri > 1) { + for (c = prioritynames; c->c_name; c++) { + if (c->c_val == priority) { + iovlist_append(&il, c->c_name); + priority_found = true; + break; + } + } + } + if (!priority_found) { + snprintf(priority_number, + sizeof(priority_number), "%d", priority); + iovlist_append(&il, priority_number); + } + + iovlist_append(&il, "> "); + } + break; + } + + /* Message body with application name and process ID prefixed. */ + if (app_name != NULL) { + iovlist_append(&il, app_name); + if (procid != NULL) { + iovlist_append(&il, "["); + iovlist_append(&il, procid); + iovlist_append(&il, "]"); + } + iovlist_append(&il, ": "); + } + iovlist_append(&il, msg); + + fprintlog_write(f, &il, flags); +} + +static void +fprintlog_first(struct filed *f, const char *hostname, const char *app_name, + const char *procid, const char *msgid __unused, + const char *structured_data __unused, const char *msg, int flags) +{ + + dprintf("Logging to %s", TypeNames[f->f_type]); + f->f_time = now; f->f_prevcount = 0; + if (f->f_type == F_UNUSED) { + dprintf("\n"); + return; + } + + if (RFC3164OutputFormat) + fprintlog_rfc3164(f, hostname, app_name, procid, msg, flags); + else + fprintlog_rfc5424(f, hostname, app_name, procid, msgid, + structured_data, msg, flags); } /* @@ -2229,8 +2348,10 @@ init(int signo) if (gethostname(LocalHostName, sizeof(LocalHostName))) err(EX_OSERR, "gethostname() failed"); if ((p = strchr(LocalHostName, '.')) != NULL) { - *p++ = '\0'; - LocalDomain = p; + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + *p = '\0'; + LocalDomain = p + 1; } else { LocalDomain = ""; } From owner-svn-src-head@freebsd.org Sun Apr 15 08:44:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FCFFA468A; Sun, 15 Apr 2018 08:44:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5F016CF47; Sun, 15 Apr 2018 08:44:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0DB74B77; Sun, 15 Apr 2018 08:44:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3F8iQQY043393; Sun, 15 Apr 2018 08:44:26 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3F8iQwl043392; Sun, 15 Apr 2018 08:44:26 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804150844.w3F8iQwl043392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 15 Apr 2018 08:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332511 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 08:44:27 -0000 Author: ed Date: Sun Apr 15 08:44:26 2018 New Revision: 332511 URL: https://svnweb.freebsd.org/changeset/base/332511 Log: Use proper alphabetic sorting of options. Modified: head/usr.sbin/syslogd/syslogd.8 Modified: head/usr.sbin/syslogd/syslogd.8 ============================================================================== --- head/usr.sbin/syslogd/syslogd.8 Sun Apr 15 08:34:16 2018 (r332510) +++ head/usr.sbin/syslogd/syslogd.8 Sun Apr 15 08:44:26 2018 (r332511) @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 9, 2018 +.Dd April 15, 2018 .Dt SYSLOGD 8 .Os .Sh NAME @@ -243,20 +243,6 @@ Usually the .Dq kern facility is reserved for messages read directly from .Pa /dev/klog . -.It Fl O Ar format -Select the output format of generated log messages. -The values -.Ar bsd -and -.Ar rfc3164 -are used to generate RFC 3164 log messages. -The values -.Ar syslog -and -.Ar rfc5424 -are used to generate RFC 5424 log messages, -having RFC 3339 timestamps with microsecond precision. -The default is to generate RFC 3164 log messages. .It Fl m Ar mark_interval Select the number of minutes between .Dq mark @@ -274,6 +260,20 @@ This option inherits .Fl s . .It Fl n Disable DNS query for every request. +.It Fl O Ar format +Select the output format of generated log messages. +The values +.Ar bsd +and +.Ar rfc3164 +are used to generate RFC 3164 log messages. +The values +.Ar syslog +and +.Ar rfc5424 +are used to generate RFC 5424 log messages, +having RFC 3339 timestamps with microsecond precision. +The default is to generate RFC 3164 log messages. .It Fl o Prefix kernel messages with the full kernel boot file as determined by .Xr getbootfile 3 . From owner-svn-src-head@freebsd.org Sun Apr 15 15:06:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BD38F9A0FD; Sun, 15 Apr 2018 15:06:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F92581E4F; Sun, 15 Apr 2018 15:06:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AA83107BD; Sun, 15 Apr 2018 15:06:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3FF67sf032679; Sun, 15 Apr 2018 15:06:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3FF67Q9032678; Sun, 15 Apr 2018 15:06:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804151506.w3FF67Q9032678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 15 Apr 2018 15:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332512 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 332512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 15:06:08 -0000 Author: brooks Date: Sun Apr 15 15:06:07 2018 New Revision: 332512 URL: https://svnweb.freebsd.org/changeset/base/332512 Log: Remove device cm which was removed in r332490. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Apr 15 08:44:26 2018 (r332511) +++ head/sys/conf/NOTES Sun Apr 15 15:06:07 2018 (r332512) @@ -2066,11 +2066,6 @@ device xmphy # XaQti XMAC II # Order for ISA devices is important here -device cm -hint.cm.0.at="isa" -hint.cm.0.port="0x2e0" -hint.cm.0.irq="9" -hint.cm.0.maddr="0xdc000" device ep device ex device fe From owner-svn-src-head@freebsd.org Sun Apr 15 15:13:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5179CF9A94F; Sun, 15 Apr 2018 15:13:10 +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 0130082374; Sun, 15 Apr 2018 15:13:09 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 2448F5A9F13; Sun, 15 Apr 2018 15:13:03 +0000 (UTC) Date: Sun, 15 Apr 2018 15:13:03 +0000 From: Brooks Davis To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332512 - head/sys/conf Message-ID: <20180415151303.GA99239@spindle.one-eyed-alien.net> References: <201804151506.w3FF67Q9032678@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <201804151506.w3FF67Q9032678@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 15:13:10 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 15, 2018 at 03:06:07PM +0000, Brooks Davis wrote: > Author: brooks > Date: Sun Apr 15 15:06:07 2018 > New Revision: 332512 > URL: https://svnweb.freebsd.org/changeset/base/332512 >=20 > Log: > Remove device cm which was removed in r332490. I'm quite confused by the fact that tinderbox didn't trip on this when I ran it. Are -DNO_CLEAN tinderbox builds insufficent for device removal? -- Brooks --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa02v+AAoJEKzQXbSebgfAk2AIAIq9pGniyeE63HgTYsHnW0xQ LBFrb6Qeohhb0l5bmEtFkMRT00urJH8pTprgin3n5jLgO6CYuJjfCuPQ9EJOoz2i 6giGsr1480FR4DwRrtovRfZgTBFpphmaMMGctCkP0LX1iYb2brJ7ptx5zNOalGVz lubxUPLrX/IDIMCKUhWA2PW6EFAgRseqFz2WFifDsSPpnrrDaIQl5BT55pHhQ9vB xJX6HhcdFcJ5HsIWyb57ondXOzs7RChABEOMLfjLi2ckHWHY9owP17P/+VP8gadq f41SL+LA5mOAizhayHwopDYBm3T+ZxSng9sIFpiQwoama0bSTLN8COPTAD17E14= =MeWW -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU-- From owner-svn-src-head@freebsd.org Sun Apr 15 15:23:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD828F9B7BD; Sun, 15 Apr 2018 15:23:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54A77849AB; Sun, 15 Apr 2018 15:23:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BAA710ADA; Sun, 15 Apr 2018 15:23:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3FFNmWL042709; Sun, 15 Apr 2018 15:23:48 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3FFNmxG042708; Sun, 15 Apr 2018 15:23:48 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804151523.w3FFNmxG042708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 15 Apr 2018 15:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332514 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 15:23:48 -0000 Author: brooks Date: Sun Apr 15 15:23:47 2018 New Revision: 332514 URL: https://svnweb.freebsd.org/changeset/base/332514 Log: Manpages are .gz files. Reported by: trasz Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Apr 15 15:22:28 2018 (r332513) +++ head/ObsoleteFiles.inc Sun Apr 15 15:23:47 2018 (r332514) @@ -40,7 +40,7 @@ # 20180413: remove Arcnet support OLD_FILES+=usr/include/net/if_arc.h -OLD_FILES+=usr/share/man/man4/cm.4 +OLD_FILES+=usr/share/man/man4/cm.4.gz # 20180409: remove FDDI support OLD_FILES+=usr/include/net/fddi.h OLD_FILES+=usr/share/man/man4/fpa.4.gz From owner-svn-src-head@freebsd.org Sun Apr 15 15:33:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C88F7F9C5D4; Sun, 15 Apr 2018 15:33:19 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x233.google.com (mail-ot0-x233.google.com [IPv6:2607:f8b0:4003:c0f::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA1A86FA6; Sun, 15 Apr 2018 15:33:19 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x233.google.com with SMTP id 23-v6so14773074otj.0; Sun, 15 Apr 2018 08:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ewb96LQ5Ta6eI2oVPrIC4+7x+yDeXc4YDGzZW872KGI=; b=QiJ8MX8d+9Yux26uXqR4eYzBy5BuOKn5VB06MuigmsLzklogOeytNSat2FZ4tQQIUK NZXUiUp64NBn3vo7hsxU519z1Q6Qm1uLAWCygw7XezsgSgqsW6fYG4Ktqdl9wsziEsvJ 8azphvxPpuwpvqLVk0R3KeFbnrr1Sq0V+l5esVm9X23RjLQhW5vMa8eE/UZ8zPiCRSWs AUPyeHX78jUbPuSmfNkMmHmk154hmkLm94XAE2TvWt6RS9REBt5fRhj8Noz5ZgvhwXwj YDgnZX9GO3F39BCeguUjbau0Zwu20ImhZ3Ga4sscc4EojlRjJ+n06Ubz4I7rUJrP4Dzv Zuxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ewb96LQ5Ta6eI2oVPrIC4+7x+yDeXc4YDGzZW872KGI=; b=dsXsI5AAnnPkmp9x/eE6ma3xKk3mnd0F9bOu3IOXzc0r1CaugVoPTQIZ684SP+Gv8Q 8dV7Nji9OOIQQU4WXhGgSOPcDNEfo0B6uCX9GA1oIJkwKijmMijw+sU2n37f2A6piae4 bc2AFXQCrMBA1B5ZPGOsGQYaLzpbsK+FrPBWmRX3c1/TBA0akhQYRVWisoqgGa14x1FN 2JVhOz85EdAWZOgcL9JM8J34vbBG9c2vTBFiu3Ib7oGKmumbf7WcDJVXDqiMiUDI8Ueh 4FGJW7JMydKRJkiUoVov8ND96xOyruvO7WRqKc/ulLLSPU9cY+ei2lnQMdKHplXzGxaF V4/g== X-Gm-Message-State: ALQs6tDjf77Rwv+fs5BYnFjDWf+uBX1BqX5FmUJnAYHsvC+gashKKGxx ZhMISxGzwSBxnt73nVeh2mWNC5s0h7wL8qZMz0I= X-Google-Smtp-Source: AIpwx498crAo49YR6baMSqSGLReOt6LoDEDHWINBqLxNCQce7eZE0T8sU80lyHwcplYf/mMi7sPX2MSk6xZvriNPdnM= X-Received: by 2002:a9d:400d:: with SMTP id m13-v6mr8749495ote.391.1523806398643; Sun, 15 Apr 2018 08:33:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:34b1:0:0:0:0:0 with HTTP; Sun, 15 Apr 2018 08:33:18 -0700 (PDT) In-Reply-To: <20180415151303.GA99239@spindle.one-eyed-alien.net> References: <201804151506.w3FF67Q9032678@repo.freebsd.org> <20180415151303.GA99239@spindle.one-eyed-alien.net> From: Benjamin Kaduk Date: Sun, 15 Apr 2018 10:33:18 -0500 Message-ID: Subject: Re: svn commit: r332512 - head/sys/conf To: Brooks Davis Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 15:33:20 -0000 On Sun, Apr 15, 2018 at 10:13 AM, Brooks Davis wrote: > On Sun, Apr 15, 2018 at 03:06:07PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Sun Apr 15 15:06:07 2018 > > New Revision: 332512 > > URL: https://svnweb.freebsd.org/changeset/base/332512 > > > > Log: > > Remove device cm which was removed in r332490. > > I'm quite confused by the fact that tinderbox didn't trip on this when I > ran it. Are -DNO_CLEAN tinderbox builds insufficent for device removal? > Given that they would leave around the old object files needed to resolve stale references to removed driver components, it seems likely. -Ben From owner-svn-src-head@freebsd.org Sun Apr 15 15:37:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACD4AF9CAF0; Sun, 15 Apr 2018 15:37:24 +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 52EE187221; Sun, 15 Apr 2018 15:37:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 615A85A9F12; Sun, 15 Apr 2018 15:37:23 +0000 (UTC) Date: Sun, 15 Apr 2018 15:37:23 +0000 From: Brooks Davis To: Benjamin Kaduk Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r332512 - head/sys/conf Message-ID: <20180415153723.GC99239@spindle.one-eyed-alien.net> References: <201804151506.w3FF67Q9032678@repo.freebsd.org> <20180415151303.GA99239@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oTHb8nViIGeoXxdp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 15:37:24 -0000 --oTHb8nViIGeoXxdp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 15, 2018 at 10:33:18AM -0500, Benjamin Kaduk wrote: > On Sun, Apr 15, 2018 at 10:13 AM, Brooks Davis wrote: >=20 > > On Sun, Apr 15, 2018 at 03:06:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 15 15:06:07 2018 > > > New Revision: 332512 > > > URL: https://svnweb.freebsd.org/changeset/base/332512 > > > > > > Log: > > > Remove device cm which was removed in r332490. > > > > I'm quite confused by the fact that tinderbox didn't trip on this when I > > ran it. Are -DNO_CLEAN tinderbox builds insufficent for device removal? > > >=20 > Given that they would leave around the old object files needed to resolve > stale > references to removed driver components, it seems likely. The thing is, config should have failed and it always runs in -DNO_CLEAN buildkernel. I expected the same to hold for tinderbox, but apparently not. -- Brooks --oTHb8nViIGeoXxdp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa03GxAAoJEKzQXbSebgfAylQH/3Cg4QjlC6UNJhfbDR61JgD5 to3kxdtuwsDmKHiySniMTghEFM9eVHP1g9JPU/6DRMNsBKCk5krolqDPJxFlZwQ5 7z6O/RIFWSumQzizwYOzKRWhcx+kKD4s2IUNAd5Egfi6c9URO+4OsoI8nUpRtAeV QrzxFvvZ6PD0KyZDS+e3wJf0UJWjhB49z/Fu19RkWgHuHM9OZDMdqA3FABf9Vbb2 7+nLuOmwLWoUoOzrJ6swcUNvY5KyXQRApuTM9Po0fBCUHCi5QwxrthpsBtg2E/pN QUNSeixYwSuMwEzOsn5QEWr1fy7VgfWGrZgLT7JhujglaXd2yPkdmulX0upkpFo= =4zSm -----END PGP SIGNATURE----- --oTHb8nViIGeoXxdp-- From owner-svn-src-head@freebsd.org Sun Apr 15 17:28:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF23FFA43AE; Sun, 15 Apr 2018 17:28:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AEF280F07; Sun, 15 Apr 2018 17:28:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1E97851151; Sun, 15 Apr 2018 19:28:37 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_8CD62151-45F0-4C82-B440-5407527962AD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r332512 - head/sys/conf Date: Sun, 15 Apr 2018 19:28:29 +0200 In-Reply-To: <20180415153723.GC99239@spindle.one-eyed-alien.net> Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers To: Brooks Davis References: <201804151506.w3FF67Q9032678@repo.freebsd.org> <20180415151303.GA99239@spindle.one-eyed-alien.net> <20180415153723.GC99239@spindle.one-eyed-alien.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 17:28:45 -0000 --Apple-Mail=_8CD62151-45F0-4C82-B440-5407527962AD Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 15 Apr 2018, at 17:37, Brooks Davis wrote: > > On Sun, Apr 15, 2018 at 10:33:18AM -0500, Benjamin Kaduk wrote: >> On Sun, Apr 15, 2018 at 10:13 AM, Brooks Davis wrote: >> >>> On Sun, Apr 15, 2018 at 03:06:07PM +0000, Brooks Davis wrote: >>>> Author: brooks >>>> Date: Sun Apr 15 15:06:07 2018 >>>> New Revision: 332512 >>>> URL: https://svnweb.freebsd.org/changeset/base/332512 >>>> >>>> Log: >>>> Remove device cm which was removed in r332490. >>> >>> I'm quite confused by the fact that tinderbox didn't trip on this when I >>> ran it. Are -DNO_CLEAN tinderbox builds insufficent for device removal? >>> >> >> Given that they would leave around the old object files needed to resolve >> stale >> references to removed driver components, it seems likely. > > The thing is, config should have failed and it always runs in > -DNO_CLEAN buildkernel. I expected the same to hold for tinderbox, but > apparently not. But were any of the LINT files updated? I guess not, if you didn't remove anything from NOTES. I think it is likely that config will *not* be run again if the LINT files are older than their respective targets? -Dimitry --Apple-Mail=_8CD62151-45F0-4C82-B440-5407527962AD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWtOLvQAKCRCwXqMKLiCW oy6GAKCpJuC5MwauQfcb4Bg0qIVUUQa8KgCgkcs3xHEdZCOChsZLqn/uZOkwWP0= =WziM -----END PGP SIGNATURE----- --Apple-Mail=_8CD62151-45F0-4C82-B440-5407527962AD-- From owner-svn-src-head@freebsd.org Sun Apr 15 17:37:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E5B0FA4CA4; Sun, 15 Apr 2018 17:37:59 +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 BD56383BB6; Sun, 15 Apr 2018 17:37:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id D34CA5A9F13; Sun, 15 Apr 2018 17:37:57 +0000 (UTC) Date: Sun, 15 Apr 2018 17:37:57 +0000 From: Brooks Davis To: Dimitry Andric Cc: Benjamin Kaduk , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r332512 - head/sys/conf Message-ID: <20180415173757.GA28110@spindle.one-eyed-alien.net> References: <201804151506.w3FF67Q9032678@repo.freebsd.org> <20180415151303.GA99239@spindle.one-eyed-alien.net> <20180415153723.GC99239@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 17:37:59 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 15, 2018 at 07:28:29PM +0200, Dimitry Andric wrote: > On 15 Apr 2018, at 17:37, Brooks Davis wrote: > >=20 > > On Sun, Apr 15, 2018 at 10:33:18AM -0500, Benjamin Kaduk wrote: > >> On Sun, Apr 15, 2018 at 10:13 AM, Brooks Davis wr= ote: > >>=20 > >>> On Sun, Apr 15, 2018 at 03:06:07PM +0000, Brooks Davis wrote: > >>>> Author: brooks > >>>> Date: Sun Apr 15 15:06:07 2018 > >>>> New Revision: 332512 > >>>> URL: https://svnweb.freebsd.org/changeset/base/332512 > >>>>=20 > >>>> Log: > >>>> Remove device cm which was removed in r332490. > >>>=20 > >>> I'm quite confused by the fact that tinderbox didn't trip on this whe= n I > >>> ran it. Are -DNO_CLEAN tinderbox builds insufficent for device remov= al? > >>>=20 > >>=20 > >> Given that they would leave around the old object files needed to reso= lve > >> stale > >> references to removed driver components, it seems likely. > >=20 > > The thing is, config should have failed and it always runs in > > -DNO_CLEAN buildkernel. I expected the same to hold for tinderbox, but > > apparently not. >=20 > But were any of the LINT files updated? I guess not, if you didn't > remove anything from NOTES. I think it is likely that config will *not* > be run again if the LINT files are older than their respective targets? NOTES was updated because I did remove device arcnet, I just somehow failed to find the cm(4) entries. I'll just try to remember to do -DNO_CLEAN kernel builds for future removals. -- Brooks --gKMricLos+KVdGMg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa0431AAoJEKzQXbSebgfADycH/1TNnShgGff4YjIcNquRGL40 bQuOe7f9BRtPzF8giDMQfbutz2WuQfVWjMr1zq15/CwnUh+2+JzGFZU99AAVcLzR m/3siMsLN7jrMRlBIjG99WIE2hqaUgpZPeYvCWcVxK1XVlSaJILHML/tVhffxqC3 qMWGi2uTgmPJNVsU5W678HI1gSprWnitCEve4VkaB2xvCg+7AzwmG3LV4pECheS6 ROqrDTQQTTxVQDyci2V23u9Klj398RD+XTXd31PJoFA3cPU5SernrW9JwdY/lDXc ESDlWfBZ1WE1lgHVbNdGYoZqOigs1q3dQZI+PPbk/1rNO7Epc8Jbt5PrJ/mpxvM= =FqS1 -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- From owner-svn-src-head@freebsd.org Sun Apr 15 19:23:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB3AFF84DA7; Sun, 15 Apr 2018 19:23:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1F87ACE9; Sun, 15 Apr 2018 19:23:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 583521314F; Sun, 15 Apr 2018 19:23:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3FJNbof061984; Sun, 15 Apr 2018 19:23:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3FJNbxn061983; Sun, 15 Apr 2018 19:23:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804151923.w3FJNbxn061983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 15 Apr 2018 19:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332515 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 332515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 19:23:37 -0000 Author: np Date: Sun Apr 15 19:23:37 2018 New Revision: 332515 URL: https://svnweb.freebsd.org/changeset/base/332515 Log: Fix typo in cxgbetool.8. Modified: head/usr.sbin/cxgbetool/cxgbetool.8 Modified: head/usr.sbin/cxgbetool/cxgbetool.8 ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.8 Sun Apr 15 15:23:47 2018 (r332514) +++ head/usr.sbin/cxgbetool/cxgbetool.8 Sun Apr 15 19:23:37 2018 (r332515) @@ -562,7 +562,7 @@ Class Rate Limiting. .It Sy cl-wrr Class Weighted Round Robin. .Pp -.It Sy cl-wrr +.It Sy ch-rl Channel Rate Limiting. .El .It Sy mode Ar scheduler-mode From owner-svn-src-head@freebsd.org Sun Apr 15 21:46:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40DE1F90454; Sun, 15 Apr 2018 21:46: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E599179A6A; Sun, 15 Apr 2018 21:46: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 C682D147D3; Sun, 15 Apr 2018 21:46: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 w3FLk8hm034850; Sun, 15 Apr 2018 21:46:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3FLk85N034848; Sun, 15 Apr 2018 21:46:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804152146.w3FLk85N034848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Apr 2018 21:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332518 - head/usr.sbin/daemon X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/daemon X-SVN-Commit-Revision: 332518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2018 21:46:09 -0000 Author: ian Date: Sun Apr 15 21:46:08 2018 New Revision: 332518 URL: https://svnweb.freebsd.org/changeset/base/332518 Log: Add an option to daemon(8) to specify a delay between restarts of a supervised program. The existing -r option has a hard-coded delay of one second. This change adds a -R option which takes a delay in seconds. This can be used to prevent log spam and rapid restarts, similar to init(8)'s behavior of adding a delay between rapid restarts when it's supervising a program. Modified: head/usr.sbin/daemon/daemon.8 head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Sun Apr 15 20:29:37 2018 (r332517) +++ head/usr.sbin/daemon/daemon.8 Sun Apr 15 21:46:08 2018 (r332518) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2016 +.Dd April 14, 2018 .Dt DAEMON 8 .Os .Sh NAME @@ -44,6 +44,7 @@ .Op Fl s Ar syslog_priority .Op Fl T Ar syslog_tag .Op Fl l Ar syslog_facility +.Op Fl T Ar restart_delay_seconds .Ar command arguments ... .Sh DESCRIPTION The @@ -114,7 +115,11 @@ regardless of whether the .Fl u option is used or not. .It Fl r -Supervise and restart the program if it has been terminated. +Supervise and restart the program after a one-second delay if it has +been terminated. +.It Fl R restart_delay_seconds +Supervise and restart the program after the specified delay +if it has been terminated. .It Fl t Ar title Set the title for the daemon process. The default is the daemonized invocation. Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Sun Apr 15 20:29:37 2018 (r332517) +++ head/usr.sbin/daemon/daemon.c Sun Apr 15 21:46:08 2018 (r332518) @@ -99,7 +99,7 @@ main(int argc, char *argv[]) dosyslog = 0; outfn = NULL; title = NULL; - while ((ch = getopt(argc, argv, "cfSp:P:ru:o:s:l:t:l:m:T:")) != -1) { + while ((ch = getopt(argc, argv, "cfSp:P:ru:o:s:l:t:l:m:R:T:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -130,6 +130,11 @@ main(int argc, char *argv[]) case 'r': restart = 1; break; + case 'R': + restart = strtol(optarg, &p, 0); + if (p == optarg || restart < 1) + errx(6, "invalid restart delay"); + break; case 's': logpri = get_log_mapping(optarg, prioritynames); if (logpri == -1) @@ -359,7 +364,7 @@ restart: goto exit; } if (restart && !terminate) { - daemon_sleep(1, 0); + daemon_sleep(restart, 0); close(pfd[0]); pfd[0] = -1; goto restart; @@ -558,7 +563,7 @@ usage(void) "usage: daemon [-cfrS] [-p child_pidfile] [-P supervisor_pidfile]\n" " [-u user] [-o output_file] [-t title]\n" " [-l syslog_facility] [-s syslog_priority]\n" - " [-T syslog_tag] [-m output_mask]\n" + " [-T syslog_tag] [-m output_mask] [-R restart_delay_secs]\n" "command arguments ...\n"); exit(1); } From owner-svn-src-head@freebsd.org Mon Apr 16 00:54:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E5FF9D393; Mon, 16 Apr 2018 00:54:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA2FB826ED; Mon, 16 Apr 2018 00:54:58 +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 E50571663E; Mon, 16 Apr 2018 00:54:58 +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 w3G0swM6030061; Mon, 16 Apr 2018 00:54:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G0swF1030058; Mon, 16 Apr 2018 00:54:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804160054.w3G0swF1030058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 16 Apr 2018 00:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332523 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 332523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 00:54:59 -0000 Author: mav Date: Mon Apr 16 00:54:58 2018 New Revision: 332523 URL: https://svnweb.freebsd.org/changeset/base/332523 Log: 9433 Fix ARC hit rate When the compressed ARC feature was added in commit d3c2ae1 the method of reference counting in the ARC was modified. As part of this accounting change the arc_buf_add_ref() function was removed entirely. This would have be fine but the arc_buf_add_ref() function served a second undocumented purpose of updating the ARC access information when taking a hold on a dbuf. Without this logic in place a cached dbuf would not migrate its associated arc_buf_hdr_t to the MFU list. This would negatively impact the ARC hit rate, particularly on systems with a small ARC. This change reinstates the missing call to arc_access() from dbuf_hold() by implementing a new arc_buf_access() function. Reviewed-by: Giuseppe Di Natale Reviewed-by: Tony Hutter Reviewed-by: Tim Chase Reviewed by: George Wilson Reviewed-by: George Melikov Signed-off-by: Brian Behlendorf Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Apr 16 00:42:45 2018 (r332522) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Apr 16 00:54:58 2018 (r332523) @@ -540,8 +540,13 @@ typedef struct arc_stats { */ kstat_named_t arcstat_mutex_miss; /* + * Number of buffers skipped when updating the access state due to the + * header having already been released after acquiring the hash lock. + */ + kstat_named_t arcstat_access_skip; + /* * Number of buffers skipped because they have I/O in progress, are - * indrect prefetch buffers that have not lived long enough, or are + * indirect prefetch buffers that have not lived long enough, or are * not from the spa we're trying to evict from. */ kstat_named_t arcstat_evict_skip; @@ -796,6 +801,7 @@ static arc_stats_t arc_stats = { { "allocated", KSTAT_DATA_UINT64 }, { "deleted", KSTAT_DATA_UINT64 }, { "mutex_miss", KSTAT_DATA_UINT64 }, + { "access_skip", KSTAT_DATA_UINT64 }, { "evict_skip", KSTAT_DATA_UINT64 }, { "evict_not_enough", KSTAT_DATA_UINT64 }, { "evict_l2_cached", KSTAT_DATA_UINT64 }, @@ -5063,6 +5069,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) } else { ASSERT(!"invalid arc state"); } +} + +/* + * This routine is called by dbuf_hold() to update the arc_access() state + * which otherwise would be skipped for entries in the dbuf cache. + */ +void +arc_buf_access(arc_buf_t *buf) +{ + mutex_enter(&buf->b_evict_lock); + arc_buf_hdr_t *hdr = buf->b_hdr; + + /* + * Avoid taking the hash_lock when possible as an optimization. + * The header must be checked again under the hash_lock in order + * to handle the case where it is concurrently being released. + */ + if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) { + mutex_exit(&buf->b_evict_lock); + ARCSTAT_BUMP(arcstat_access_skip); + return; + } + + kmutex_t *hash_lock = HDR_LOCK(hdr); + mutex_enter(hash_lock); + + if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) { + mutex_exit(hash_lock); + mutex_exit(&buf->b_evict_lock); + ARCSTAT_BUMP(arcstat_access_skip); + return; + } + + mutex_exit(&buf->b_evict_lock); + + ASSERT(hdr->b_l1hdr.b_state == arc_mru || + hdr->b_l1hdr.b_state == arc_mfu); + + DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr); + arc_access(hdr, hash_lock); + mutex_exit(hash_lock); + + ARCSTAT_BUMP(arcstat_hits); + ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), + demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, hits); } /* a generic arc_done_func_t which you can use */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 16 00:42:45 2018 (r332522) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 16 00:54:58 2018 (r332523) @@ -2579,8 +2579,10 @@ top: return (SET_ERROR(ENOENT)); } - if (db->db_buf != NULL) + if (db->db_buf != NULL) { + arc_buf_access(db->db_buf); ASSERT3P(db->db.db_data, ==, db->db_buf->b_data); + } ASSERT(db->db_buf == NULL || arc_referenced(db->db_buf)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Apr 16 00:42:45 2018 (r332522) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Apr 16 00:54:58 2018 (r332523) @@ -169,6 +169,7 @@ void arc_loan_inuse_buf(arc_buf_t *buf, void *tag); void arc_buf_destroy(arc_buf_t *buf, void *tag); int arc_buf_size(arc_buf_t *buf); int arc_buf_lsize(arc_buf_t *buf); +void arc_buf_access(arc_buf_t *buf); void arc_release(arc_buf_t *buf, void *tag); int arc_released(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); From owner-svn-src-head@freebsd.org Mon Apr 16 03:35:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE2FAF80738; Mon, 16 Apr 2018 03:35:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 914E682B9F; Mon, 16 Apr 2018 03:35:43 +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 8BFE418010; Mon, 16 Apr 2018 03:35:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G3Zhuf010199; Mon, 16 Apr 2018 03:35:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G3ZhlZ010198; Mon, 16 Apr 2018 03:35:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804160335.w3G3ZhlZ010198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 16 Apr 2018 03:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332527 - head/usr.sbin/daemon X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/daemon X-SVN-Commit-Revision: 332527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 03:35:44 -0000 Author: ian Date: Mon Apr 16 03:35:43 2018 New Revision: 332527 URL: https://svnweb.freebsd.org/changeset/base/332527 Log: Fix cut-and-pasted line to have the right option letter. Reported by: 0mp@ Pointy hat: ian@ Modified: head/usr.sbin/daemon/daemon.8 Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Mon Apr 16 03:35:18 2018 (r332526) +++ head/usr.sbin/daemon/daemon.8 Mon Apr 16 03:35:43 2018 (r332527) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2018 +.Dd April 15, 2018 .Dt DAEMON 8 .Os .Sh NAME @@ -44,7 +44,7 @@ .Op Fl s Ar syslog_priority .Op Fl T Ar syslog_tag .Op Fl l Ar syslog_facility -.Op Fl T Ar restart_delay_seconds +.Op Fl R Ar restart_delay_seconds .Ar command arguments ... .Sh DESCRIPTION The From owner-svn-src-head@freebsd.org Mon Apr 16 04:02:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F7CF82DEB; Mon, 16 Apr 2018 04:02:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 818E987D18; Mon, 16 Apr 2018 04:02:53 +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 7C2E5184E6; Mon, 16 Apr 2018 04:02:53 +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 w3G42rd0026168; Mon, 16 Apr 2018 04:02:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G42rvM026167; Mon, 16 Apr 2018 04:02:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804160402.w3G42rvM026167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 16 Apr 2018 04:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332546 - 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: 332546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 04:02:54 -0000 Author: jhibbits Date: Mon Apr 16 04:02:53 2018 New Revision: 332546 URL: https://svnweb.freebsd.org/changeset/base/332546 Log: Use a resource hint instead of environment variable for DIU mode This makes it more consistent with FreeBSD norms, rather than using Linux's norms. Now, instead of needing an environment variable video-mode=fslfb:1280x1024@60 Now one would use a hint: hint.fb.0.mode=1280x1024@60 Modified: head/sys/powerpc/mpc85xx/fsl_diu.c Modified: head/sys/powerpc/mpc85xx/fsl_diu.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_diu.c Mon Apr 16 03:58:08 2018 (r332545) +++ head/sys/powerpc/mpc85xx/fsl_diu.c Mon Apr 16 04:02:53 2018 (r332546) @@ -363,12 +363,9 @@ diu_attach(device_t dev) /* TODO: Eventually, allow EDID to be dynamically provided. */ if (OF_getprop_alloc(node, "edid", &edid_cells) <= 0) { - /* - * u-boot uses the environment variable name 'video-mode', so - * just use the same name here. Should allow another variable - * that better fits our design model, but this is fine. - */ - if ((vm_name = kern_getenv("video-mode")) == NULL) { + /* Get a resource hint: hint.fb.N.mode */ + if (resource_string_value(device_get_name(dev), + device_get_unit(dev), "mode", &vm_name) != 0) { device_printf(dev, "No EDID data and no video-mode env set\n"); return (ENXIO); @@ -383,7 +380,7 @@ diu_attach(device_t dev) videomode = edid.edid_preferred_mode; } else { /* Parse video-mode kenv variable. */ - if ((err = sscanf(vm_name, "fslfb:%dx%d@%d", &w, &h, &r)) != 3) { + if ((err = sscanf(vm_name, "%dx%d@%d", &w, &h, &r)) != 3) { device_printf(dev, "Cannot parse video mode: %s\n", vm_name); return (ENXIO); From owner-svn-src-head@freebsd.org Mon Apr 16 07:26:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912DCF9098D; Mon, 16 Apr 2018 07:26:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 453FD737D0; Mon, 16 Apr 2018 07:26:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BA051A454; Mon, 16 Apr 2018 07:26:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G7QOJ7026330; Mon, 16 Apr 2018 07:26:24 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G7QOoi026329; Mon, 16 Apr 2018 07:26:24 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804160726.w3G7QOoi026329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Apr 2018 07:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332555 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 07:26:24 -0000 Author: tsoome Date: Mon Apr 16 07:26:23 2018 New Revision: 332555 URL: https://svnweb.freebsd.org/changeset/base/332555 Log: loader: provide values in help_getnext() With r328289 we attempt to make sure we free the resources allocated in help_getnext(), however, it is possible that we get no resources allocated and help_getnext() will return early. Make sure we have pointers set to NULL early in help_getnext(). Reported by: Andy Fiddaman Modified: head/stand/common/commands.c Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Mon Apr 16 04:16:46 2018 (r332554) +++ head/stand/common/commands.c Mon Apr 16 07:26:23 2018 (r332555) @@ -64,7 +64,9 @@ static int help_getnext(int fd, char **topic, char **subtopic, char **desc) { char line[81], *cp, *ep; - + + /* Make sure we provide sane values. */ + *topic = *subtopic = *desc = NULL; for (;;) { if (fgetstr(line, 80, fd) < 0) return(0); From owner-svn-src-head@freebsd.org Mon Apr 16 07:36:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45FF1F9149D for ; Mon, 16 Apr 2018 07:36:42 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A961E76917 for ; Mon, 16 Apr 2018 07:36:41 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wr0-x241.google.com with SMTP id v24so5932407wra.8 for ; Mon, 16 Apr 2018 00:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=ENCw/PNP2dDC2OvRdLXb6F38XId+C+xvawrgWmGuIn0=; b=tS5EjC5XkuB0cJ1KKnloQIsba0Ltrc8z9/apT7r6g0fHSEp83ISZvH+yd8vtxEkUP+ 1k3J0ZmMfyl3xiIQcdggsrIzULtzk4z0fKMQ2aWF4nNw/7a7W9kBHcPACnewFKN35cGZ fINitgzKjFcyGIgmpibEa25ynjIuwWsGmfpAimrPM74FS18EIFjehbrKIr9KcFj5D3cC yJ4EO56Yn9x+kQA2KQqXfc1qL4k1QgdIvJDdyv1oWLQwYb1kRNsKDTnw9wIa7GR/Fj54 isoy1BkQVZWqc/fCt1N9YMbajetQXwjvmdsQ0k6KBVpdJz1fizE6PHhfuFDy/a09hTNF KgPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=ENCw/PNP2dDC2OvRdLXb6F38XId+C+xvawrgWmGuIn0=; b=ULC8R/RLqQ+Rra+huuotIak0IeftjpbAqN4dNzkqqYBIn03qcffOF89lZ/2TLonFat K5i5y+8TprKGYBwwcnE+UAryv6hGXavEblKK+W6uag5REOSd4O2FmNIJ/1GJbljNWHuu sNbS/Uca3E6RQzvKcS+etzeyVdTHEvmak4WqAQ2mfw48QR4xWBinkHpAsRvPFErWnGE+ R7e1VMVVEF7CYGiNMiD1M8MMK3TkuaH/rwBs2GGLHDhlYMPg/k4JnSuSqB86KjnTFVrO 5MVTXu3ar/EnFC7pA+CCexlZ5B9g/pVk8rCWZVdYuq1W9e6bKQCySGxnK+sxO8lNTFc8 oOPg== X-Gm-Message-State: ALQs6tB0C/ICDDueVuio02RUNa2d6+kmMXR/4T8vSrUz6mwAolxOxM4Z i35io/rvmFLrvZDugZY1Bo0zPeyCUe4= X-Google-Smtp-Source: AIpwx4+gPMo4VQYJVcgToRdyl+GypojOdWY5Jalv0g7msg1OgBu8e7b4mausO1NAZynVrwIhVda3yQ== X-Received: by 10.28.7.76 with SMTP id 73mr10034363wmh.128.1523864200314; Mon, 16 Apr 2018 00:36:40 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id n49sm18622454wrn.50.2018.04.16.00.36.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 00:36:39 -0700 (PDT) Subject: Re: svn commit: r332523 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804160054.w3G0swF1030058@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Mon, 16 Apr 2018 08:36:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804160054.w3G0swF1030058@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 07:36:42 -0000 Hey Mav, this seems like an important one to get in for 11.2 so just wanted to check if that was your intention as there's no MFC tag on the commit? On 16/04/2018 01:54, Alexander Motin wrote: > Author: mav > Date: Mon Apr 16 00:54:58 2018 > New Revision: 332523 > URL: https://svnweb.freebsd.org/changeset/base/332523 > > Log: > 9433 Fix ARC hit rate > > When the compressed ARC feature was added in commit d3c2ae1 > the method of reference counting in the ARC was modified. As > part of this accounting change the arc_buf_add_ref() function > was removed entirely. > > This would have be fine but the arc_buf_add_ref() function > served a second undocumented purpose of updating the ARC access > information when taking a hold on a dbuf. Without this logic > in place a cached dbuf would not migrate its associated > arc_buf_hdr_t to the MFU list. This would negatively impact > the ARC hit rate, particularly on systems with a small ARC. > > This change reinstates the missing call to arc_access() from > dbuf_hold() by implementing a new arc_buf_access() function. > > Reviewed-by: Giuseppe Di Natale > Reviewed-by: Tony Hutter > Reviewed-by: Tim Chase > Reviewed by: George Wilson > Reviewed-by: George Melikov > Signed-off-by: Brian Behlendorf > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Apr 16 00:42:45 2018 (r332522) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Apr 16 00:54:58 2018 (r332523) > @@ -540,8 +540,13 @@ typedef struct arc_stats { > */ > kstat_named_t arcstat_mutex_miss; > /* > + * Number of buffers skipped when updating the access state due to the > + * header having already been released after acquiring the hash lock. > + */ > + kstat_named_t arcstat_access_skip; > + /* > * Number of buffers skipped because they have I/O in progress, are > - * indrect prefetch buffers that have not lived long enough, or are > + * indirect prefetch buffers that have not lived long enough, or are > * not from the spa we're trying to evict from. > */ > kstat_named_t arcstat_evict_skip; > @@ -796,6 +801,7 @@ static arc_stats_t arc_stats = { > { "allocated", KSTAT_DATA_UINT64 }, > { "deleted", KSTAT_DATA_UINT64 }, > { "mutex_miss", KSTAT_DATA_UINT64 }, > + { "access_skip", KSTAT_DATA_UINT64 }, > { "evict_skip", KSTAT_DATA_UINT64 }, > { "evict_not_enough", KSTAT_DATA_UINT64 }, > { "evict_l2_cached", KSTAT_DATA_UINT64 }, > @@ -5063,6 +5069,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) > } else { > ASSERT(!"invalid arc state"); > } > +} > + > +/* > + * This routine is called by dbuf_hold() to update the arc_access() state > + * which otherwise would be skipped for entries in the dbuf cache. > + */ > +void > +arc_buf_access(arc_buf_t *buf) > +{ > + mutex_enter(&buf->b_evict_lock); > + arc_buf_hdr_t *hdr = buf->b_hdr; > + > + /* > + * Avoid taking the hash_lock when possible as an optimization. > + * The header must be checked again under the hash_lock in order > + * to handle the case where it is concurrently being released. > + */ > + if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) { > + mutex_exit(&buf->b_evict_lock); > + ARCSTAT_BUMP(arcstat_access_skip); > + return; > + } > + > + kmutex_t *hash_lock = HDR_LOCK(hdr); > + mutex_enter(hash_lock); > + > + if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) { > + mutex_exit(hash_lock); > + mutex_exit(&buf->b_evict_lock); > + ARCSTAT_BUMP(arcstat_access_skip); > + return; > + } > + > + mutex_exit(&buf->b_evict_lock); > + > + ASSERT(hdr->b_l1hdr.b_state == arc_mru || > + hdr->b_l1hdr.b_state == arc_mfu); > + > + DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr); > + arc_access(hdr, hash_lock); > + mutex_exit(hash_lock); > + > + ARCSTAT_BUMP(arcstat_hits); > + ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), > + demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, hits); > } > > /* a generic arc_done_func_t which you can use */ > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 16 00:42:45 2018 (r332522) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 16 00:54:58 2018 (r332523) > @@ -2579,8 +2579,10 @@ top: > return (SET_ERROR(ENOENT)); > } > > - if (db->db_buf != NULL) > + if (db->db_buf != NULL) { > + arc_buf_access(db->db_buf); > ASSERT3P(db->db.db_data, ==, db->db_buf->b_data); > + } > > ASSERT(db->db_buf == NULL || arc_referenced(db->db_buf)); > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Apr 16 00:42:45 2018 (r332522) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Apr 16 00:54:58 2018 (r332523) > @@ -169,6 +169,7 @@ void arc_loan_inuse_buf(arc_buf_t *buf, void *tag); > void arc_buf_destroy(arc_buf_t *buf, void *tag); > int arc_buf_size(arc_buf_t *buf); > int arc_buf_lsize(arc_buf_t *buf); > +void arc_buf_access(arc_buf_t *buf); > void arc_release(arc_buf_t *buf, void *tag); > int arc_released(arc_buf_t *buf); > void arc_buf_freeze(arc_buf_t *buf); > From owner-svn-src-head@freebsd.org Mon Apr 16 08:03:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD0E7F93337; Mon, 16 Apr 2018 08:03:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EEBF7CDFA; Mon, 16 Apr 2018 08:03:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 597C31AA99; Mon, 16 Apr 2018 08:03:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G83I3S046365; Mon, 16 Apr 2018 08:03:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G83IgT046364; Mon, 16 Apr 2018 08:03:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804160803.w3G83IgT046364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Apr 2018 08:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332556 - head X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 08:03:18 -0000 Author: trasz Date: Mon Apr 16 08:03:18 2018 New Revision: 332556 URL: https://svnweb.freebsd.org/changeset/base/332556 Log: Fix ObsoleteFiles.inc entry for libstand.3. MFC after: 2 weeks Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Apr 16 07:26:23 2018 (r332555) +++ head/ObsoleteFiles.inc Mon Apr 16 08:03:18 2018 (r332556) @@ -419,7 +419,7 @@ OLD_FILES+=usr/share/man/man9/mbp_sync.9.gz OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a OLD_FILES+=usr/include/stand.h -OLD_FILES+=usr/share/man/man3/libstand.3 +OLD_FILES+=usr/share/man/man3/libstand.3.gz # 20171003: remove RCMDS OLD_FILES+=bin/rcp OLD_FILES+=rescue/rcp From owner-svn-src-head@freebsd.org Mon Apr 16 08:15:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D4F7F94021; Mon, 16 Apr 2018 08:15:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FC477FD24; Mon, 16 Apr 2018 08:15:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AB7D1AC27; Mon, 16 Apr 2018 08:15:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G8FoUh051908; Mon, 16 Apr 2018 08:15:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G8FoYK051907; Mon, 16 Apr 2018 08:15:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804160815.w3G8FoYK051907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Apr 2018 08:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332557 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 08:15:51 -0000 Author: tsoome Date: Mon Apr 16 08:15:50 2018 New Revision: 332557 URL: https://svnweb.freebsd.org/changeset/base/332557 Log: loader: make sure we use snprintf() in commands.c Safeguard against memory corruptions. Modified: head/stand/common/commands.c Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Mon Apr 16 08:03:18 2018 (r332556) +++ head/stand/common/commands.c Mon Apr 16 08:15:50 2018 (r332557) @@ -236,7 +236,7 @@ command_commandlist(int argc, char *argv[]) if (res) break; if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) { - sprintf(name, " %-15s ", (*cmdp)->c_name); + snprintf(name, sizeof(name), " %-15s ", (*cmdp)->c_name); pager_output(name); pager_output((*cmdp)->c_desc); res = pager_output("\n"); @@ -435,12 +435,12 @@ command_more(int argc, char *argv[]) res=0; pager_open(); for (i = 1; (i < argc) && (res == 0); i++) { - sprintf(line, "*** FILE %s BEGIN ***\n", argv[i]); + snprintf(line, sizeof(line), "*** FILE %s BEGIN ***\n", argv[i]); if (pager_output(line)) break; res = page_file(argv[i]); if (!res) { - sprintf(line, "*** FILE %s END ***\n", argv[i]); + snprintf(line, sizeof(line), "*** FILE %s END ***\n", argv[i]); res = pager_output(line); } } @@ -501,7 +501,7 @@ command_lsdev(int argc, char *argv[]) if (devsw[i]->dv_print(verbose)) break; } else { - sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name); + snprintf(line, sizeof(line), "%s: (unknown)\n", devsw[i]->dv_name); if (pager_output(line)) break; } From owner-svn-src-head@freebsd.org Mon Apr 16 08:41:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 807A1F962B7; Mon, 16 Apr 2018 08:41:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32BA78628E; Mon, 16 Apr 2018 08:41:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB501B09B; Mon, 16 Apr 2018 08:41:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G8fjt7063876; Mon, 16 Apr 2018 08:41:45 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G8fijP063874; Mon, 16 Apr 2018 08:41:44 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804160841.w3G8fijP063874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Apr 2018 08:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332558 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 08:41:45 -0000 Author: tsoome Date: Mon Apr 16 08:41:44 2018 New Revision: 332558 URL: https://svnweb.freebsd.org/changeset/base/332558 Log: loader: command_errmsg should be const Use const char * for command_errmsg. Modified: head/stand/common/bootstrap.h head/stand/common/commands.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Mon Apr 16 08:15:50 2018 (r332557) +++ head/stand/common/bootstrap.h Mon Apr 16 08:41:44 2018 (r332558) @@ -36,7 +36,7 @@ /* Commands and return values; nonzero return sets command_errmsg != NULL */ typedef int (bootblk_cmd_t)(int argc, char *argv[]); #define COMMAND_ERRBUFSZ (256) -extern char *command_errmsg; +extern const char *command_errmsg; extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_OK 0 #define CMD_WARN 1 Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Mon Apr 16 08:15:50 2018 (r332557) +++ head/stand/common/commands.c Mon Apr 16 08:41:44 2018 (r332558) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" -char *command_errmsg; +const char *command_errmsg; /* XXX should have procedural interface for setting, size limit? */ char command_errbuf[COMMAND_ERRBUFSZ]; From owner-svn-src-head@freebsd.org Mon Apr 16 09:17:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06102F98885; Mon, 16 Apr 2018 09:17:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A42936C4F0; Mon, 16 Apr 2018 09:17:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 933291B59B; Mon, 16 Apr 2018 09:17:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3G9HafN081291; Mon, 16 Apr 2018 09:17:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3G9HaCN081290; Mon, 16 Apr 2018 09:17:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804160917.w3G9HaCN081290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 16 Apr 2018 09:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332559 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 332559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 09:17:37 -0000 Author: avg Date: Mon Apr 16 09:17:36 2018 New Revision: 332559 URL: https://svnweb.freebsd.org/changeset/base/332559 Log: mountd: fix a crash when getgrouplist reports too many groups Previously the code only warned about the condition and then happily proceeded to use the too large value resulting in the array out-of-bounds access. Obtained from: Panzura (Chuanbo Zheng) MFC after: 10 days Sponsored by: Panzura Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Apr 16 08:41:44 2018 (r332558) +++ head/usr.sbin/mountd/mountd.c Mon Apr 16 09:17:36 2018 (r332559) @@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr) } cr->cr_uid = pw->pw_uid; ngroups = XU_NGROUPS + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { syslog(LOG_ERR, "too many groups"); + ngroups = XU_NGROUPS + 1; + } + /* * Compress out duplicate. */ From owner-svn-src-head@freebsd.org Mon Apr 16 10:56:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A5CEF9F093; Mon, 16 Apr 2018 10:56:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F286481849; Mon, 16 Apr 2018 10:56:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w3GAuBCo031934 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Apr 2018 13:56:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3GAuBCo031934 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3GAuBpK031933; Mon, 16 Apr 2018 13:56:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Apr 2018 13:56:11 +0300 From: Konstantin Belousov To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332559 - head/usr.sbin/mountd Message-ID: <20180416105611.GG1774@kib.kiev.ua> References: <201804160917.w3G9HaCN081290@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804160917.w3G9HaCN081290@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 10:56:22 -0000 On Mon, Apr 16, 2018 at 09:17:36AM +0000, Andriy Gapon wrote: > Author: avg > Date: Mon Apr 16 09:17:36 2018 > New Revision: 332559 > URL: https://svnweb.freebsd.org/changeset/base/332559 > > Log: > mountd: fix a crash when getgrouplist reports too many groups > > Previously the code only warned about the condition and then happily > proceeded to use the too large value resulting in the array > out-of-bounds access. > > Obtained from: Panzura (Chuanbo Zheng) > MFC after: 10 days > Sponsored by: Panzura > > Modified: > head/usr.sbin/mountd/mountd.c > > Modified: head/usr.sbin/mountd/mountd.c > ============================================================================== > --- head/usr.sbin/mountd/mountd.c Mon Apr 16 08:41:44 2018 (r332558) > +++ head/usr.sbin/mountd/mountd.c Mon Apr 16 09:17:36 2018 (r332559) > @@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr) > } > cr->cr_uid = pw->pw_uid; > ngroups = XU_NGROUPS + 1; > - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) > + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { > syslog(LOG_ERR, "too many groups"); > + ngroups = XU_NGROUPS + 1; Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? > + } > + > /* > * Compress out duplicate. > */ From owner-svn-src-head@freebsd.org Mon Apr 16 11:12:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A88CFA0739; Mon, 16 Apr 2018 11:12:42 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8DC887062; Mon, 16 Apr 2018 11:12:41 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f52.google.com with SMTP id r7-v6so14343219lfr.1; Mon, 16 Apr 2018 04:12:41 -0700 (PDT) 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=yfXg6zTFh46QzkgC1anpw+gZ7evT62z2+8FHbE9UDQw=; b=WcbyDQpdd9jOjJIX26ooegsAFkSo1skLOou6MiPXAbHhUjBq5WusofVvMJhGtByFjm hnUY34tcNlHgSlwfpoJwYqHQlmGIF6VL3CZtkoGuhq3PILspWWNHihvNvcd1AywQSGaw PnIupPVNonrYJNvAuhI3txC6YipjlgW1JWDh/cTtuZrSSa28LFjr57GYZWefDZ9QfvUB 8CcBO3X1Gpg7uGoCDqdKXsvbufOsyXmUmqplEl+aUrct9J6XQZr5Plg8gj/Q3CcEynpM 6qCZem08ujMDGCUy/yURlyPzByYAk3PLVoq8hO/g4njmYT+oVjTSVZfWCF++qDD1NUFM cIww== X-Gm-Message-State: ALQs6tCul/lz2779FMQFiXWSyobg4iFFz9EacbEFeWcSqFwUfDCXXfUL tuWGokvEnQOmU8PjEwtbbq+Xv4uD X-Google-Smtp-Source: AIpwx4+c2rMLXYM7nbJxygQZq1+ln7SiBa8DN+9+DTd6sRgDjlbjo2ZEvM2DZ8xvst89cB2J8eLuLg== X-Received: by 2002:a19:4f5e:: with SMTP id a30-v6mr3790504lfk.97.1523876751808; Mon, 16 Apr 2018 04:05:51 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id o203-v6sm2790025lff.25.2018.04.16.04.05.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 04:05:50 -0700 (PDT) Subject: Re: svn commit: r332559 - head/usr.sbin/mountd To: Konstantin Belousov Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201804160917.w3G9HaCN081290@repo.freebsd.org> <20180416105611.GG1774@kib.kiev.ua> 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: <84a443f7-ce41-0de4-cd6e-d7c450eb1460@FreeBSD.org> Date: Mon, 16 Apr 2018 14:05:49 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180416105611.GG1774@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 11:12:42 -0000 On 16/04/2018 13:56, Konstantin Belousov wrote: > On Mon, Apr 16, 2018 at 09:17:36AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Mon Apr 16 09:17:36 2018 >> New Revision: 332559 >> URL: https://svnweb.freebsd.org/changeset/base/332559 >> >> Log: >> mountd: fix a crash when getgrouplist reports too many groups >> >> Previously the code only warned about the condition and then happily >> proceeded to use the too large value resulting in the array >> out-of-bounds access. >> >> Obtained from: Panzura (Chuanbo Zheng) >> MFC after: 10 days >> Sponsored by: Panzura >> >> Modified: >> head/usr.sbin/mountd/mountd.c >> >> Modified: head/usr.sbin/mountd/mountd.c >> ============================================================================== >> --- head/usr.sbin/mountd/mountd.c Mon Apr 16 08:41:44 2018 (r332558) >> +++ head/usr.sbin/mountd/mountd.c Mon Apr 16 09:17:36 2018 (r332559) >> @@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr) >> } >> cr->cr_uid = pw->pw_uid; >> ngroups = XU_NGROUPS + 1; >> - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) >> + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { >> syslog(LOG_ERR, "too many groups"); >> + ngroups = XU_NGROUPS + 1; > Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? Two reasons: 1. it's what the code already used 2. the groups are placed into struct xucred and later that struct is passed to kernel, so in my opinion it's xucred that defines the limit in this case -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Apr 16 11:22:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E243FFA11C6; Mon, 16 Apr 2018 11:22:10 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8094989E9F; Mon, 16 Apr 2018 11:22:10 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (220-253-154-11.dyn.iinet.net.au [220.253.154.11]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w3GBM5hW020092 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 16 Apr 2018 04:22:07 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r332559 - head/usr.sbin/mountd To: Konstantin Belousov , Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804160917.w3G9HaCN081290@repo.freebsd.org> <20180416105611.GG1774@kib.kiev.ua> From: Julian Elischer Message-ID: <5e754f1f-9688-884a-cddd-fa4b65e67f0b@freebsd.org> Date: Mon, 16 Apr 2018 19:21:59 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180416105611.GG1774@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 11:22:11 -0000 On 16/4/18 6:56 pm, Konstantin Belousov wrote: > On Mon, Apr 16, 2018 at 09:17:36AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Mon Apr 16 09:17:36 2018 >> New Revision: 332559 >> URL: https://svnweb.freebsd.org/changeset/base/332559 >> >> Log: >> mountd: fix a crash when getgrouplist reports too many groups >> >> Previously the code only warned about the condition and then happily >> proceeded to use the too large value resulting in the array >> out-of-bounds access. >> >> Obtained from: Panzura (Chuanbo Zheng) >> MFC after: 10 days >> Sponsored by: Panzura >> >> Modified: >> head/usr.sbin/mountd/mountd.c >> >> Modified: head/usr.sbin/mountd/mountd.c >> ============================================================================== >> --- head/usr.sbin/mountd/mountd.c Mon Apr 16 08:41:44 2018 (r332558) >> +++ head/usr.sbin/mountd/mountd.c Mon Apr 16 09:17:36 2018 (r332559) >> @@ -2915,8 +2915,11 @@ parsecred(char *namelist, struct xucred *cr) >> } >> cr->cr_uid = pw->pw_uid; >> ngroups = XU_NGROUPS + 1; >> - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) >> + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { >> syslog(LOG_ERR, "too many groups"); >> + ngroups = XU_NGROUPS + 1; > Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? valid question.. because that is how many are allocated? it was a "minimally invasive patch".. whoever used XU_NGROUPS before should have fixed it. Having said that, thanks for drawing out attention to it.. will probably fix. > >> + } >> + >> /* >> * Compress out duplicate. >> */ > From owner-svn-src-head@freebsd.org Mon Apr 16 11:48:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A001FA2C98 for ; Mon, 16 Apr 2018 11:48:03 +0000 (UTC) (envelope-from oliver.pinter@balabit.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDCE668615 for ; Mon, 16 Apr 2018 11:48:02 +0000 (UTC) (envelope-from oliver.pinter@balabit.com) Received: by mail-io0-x244.google.com with SMTP id c26so5061731iob.3 for ; Mon, 16 Apr 2018 04:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=balabit-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6slhwknvG3Q2AIfsHxRZJ7lB59sPa8abXvYaYlgyFlc=; b=i/Y2w5eG57GmtqbdZi0Jd75r1HJMnCPJ1lS1OLQYfHLLsfeTVRGB09KC5pQmGD6JqN w+KXYnvwJRcgYEOlD23r90CEA85MdqKr4wjuq8Z6YxEtYTAIxAqleo+OQ2ym4IXh2jEz 9xzktW/Iazd3SioYpVMUV0a1h1BGCenImU4BgXmLLfjpR97q6+ga7/fcVFJEUAlQnywJ d4wF9+FWNSal20eJCFWuJzte2zo+idmsO6AbXv0OcvB7ppMYjFJpgGXd+ulSRIPneN20 f0LRFW7jRdVCqod32wlB8CqrbkGQhMwe6UIp9rFhgmQ7Ty/cEBAxXNlkEXhwYHqWEcjg XLEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6slhwknvG3Q2AIfsHxRZJ7lB59sPa8abXvYaYlgyFlc=; b=KQoXm84x9gGVd0tDvf7JQ1oNrN1kek/Mp8w/ev8Ys+3BwNpUxqPCPqAvK4uPlw4ruz rN/Rrg63+yl2DONIiAEPznP/sWCwfMkX/byTcG8Kl4FtJOsRB4yPjrz5QcpmPeNh6c0Q WV0P57AVHmZ7ey4mAsZS1gLxZk/LqvoibH97UKjwWZ/BUiBwFfRxMAL8KFHK51HFC1o/ nUPNSCBw3yCGy+WtqiEfGL+sFPnr0hRF8zFbWXnTIHE5W2MbJHR3ZzZM9EcjdjIDqiHz Pkb5rO9CPpv1ly/R+S4UFfl9Y6DbOXKP20boV9gmtDAGm6dPP7myUbsfCwuxA9dz82YO 9hgw== X-Gm-Message-State: ALQs6tAwunRL9P3wgV0QlygDO8IAOav4mugZd6QT3vC/BPVEvXvlQfQs 2kdpgeY+XS3AzPb26NUwvsub/tYmCvGmVcG2kQVIQE3g X-Google-Smtp-Source: AIpwx49+plWXrqDwidS5U3V8W6CFYjSbZooHLwEgIhkv38sGfkwEJ5eLhCITAFo5u1LAQsHiD9OLz9UJbN87/ODJmQM= X-Received: by 10.107.6.31 with SMTP id 31mr5990760iog.80.1523879281964; Mon, 16 Apr 2018 04:48:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.192.128.68 with HTTP; Mon, 16 Apr 2018 04:48:01 -0700 (PDT) In-Reply-To: <201804150834.w3F8YGO3038226@repo.freebsd.org> References: <201804150834.w3F8YGO3038226@repo.freebsd.org> From: =?UTF-8?B?UGludMOpciwgT2xpdsOpcg==?= Date: Mon, 16 Apr 2018 13:48:01 +0200 Message-ID: Subject: Re: svn commit: r332510 - in head: usr.bin/wall usr.sbin/syslogd To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 11:48:03 -0000 On Sun, Apr 15, 2018 at 10:34 AM, Ed Schouten wrote: > Author: ed > Date: Sun Apr 15 08:34:16 2018 > New Revision: 332510 > URL: https://svnweb.freebsd.org/changeset/base/332510 > > Log: > Add RFC 5424 syslog message output to syslogd. > > - Move all of the code responsible for transmitting log messages into a > separate function, fprintlog_write(). > - Instead of manually modifying a list of iovecs, add a structure > iovlist with some helper functions. > - Alter the F_FORW (UDP message forwarding) case to also use iovecs like > the other cases. Use sendmsg() instead of sendto(). > - In the case of F_FORW, truncate the message to a size dependent on the > address family (AF_INET, AF_INET6), as proposed by RFC 5426. > - Move all traditional message formatting into fprintlog_bsd(). Get rid > of some of the string copying and snprintf()'ing. Simply emit more > iovecs to get the job done. > - Increase ttymsg()'s limit of 7 iovecs to 32. Add a definition for this > limit, so it can be reused by iovlist. > - Add fprintlog_rfc5424() to emit RFC 5424 formatted log entries. > - Add a "-O" command line option to enable RFC 5424 formatting. It would > have been nicer if we supported "-o rfc5424", just like on NetBSD. > Unfortunately, the "-o" flag is already used for a different purpose > on FreeBSD. > - Don't truncate hostnames in the RFC 5424 case, as suggested by that > specific RFC. > > For people interested in using this, this feature can be enabled by > adding the following line to /etc/rc.conf: > > syslogd_flags="-s -O rfc5424" > > Differential Revision: https://reviews.freebsd.org/D15011 Release notes: yes > > > Modified: > head/usr.bin/wall/ttymsg.c > head/usr.bin/wall/ttymsg.h > head/usr.sbin/syslogd/syslogd.8 > head/usr.sbin/syslogd/syslogd.c > > Modified: head/usr.bin/wall/ttymsg.c > ============================================================ > ================== > --- head/usr.bin/wall/ttymsg.c Sat Apr 14 22:14:18 2018 (r332509) > +++ head/usr.bin/wall/ttymsg.c Sun Apr 15 08:34:16 2018 (r332510) > @@ -61,7 +61,7 @@ static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkel > const char * > ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout) > { > - struct iovec localiov[7]; > + struct iovec localiov[TTYMSG_IOV_MAX]; > ssize_t left, wret; > int cnt, fd; > char device[MAXNAMLEN] = _PATH_DEV; > > Modified: head/usr.bin/wall/ttymsg.h > ============================================================ > ================== > --- head/usr.bin/wall/ttymsg.h Sat Apr 14 22:14:18 2018 (r332509) > +++ head/usr.bin/wall/ttymsg.h Sun Apr 15 08:34:16 2018 (r332510) > @@ -1,3 +1,5 @@ > /* $FreeBSD$ */ > > +#define TTYMSG_IOV_MAX 32 > + > const char *ttymsg(struct iovec *, int, const char *, int); > > Modified: head/usr.sbin/syslogd/syslogd.8 > ============================================================ > ================== > --- head/usr.sbin/syslogd/syslogd.8 Sat Apr 14 22:14:18 2018 > (r332509) > +++ head/usr.sbin/syslogd/syslogd.8 Sun Apr 15 08:34:16 2018 > (r332510) > @@ -28,7 +28,7 @@ > .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 > .\" $FreeBSD$ > .\" > -.Dd November 28, 2017 > +.Dd April 9, 2018 > .Dt SYSLOGD 8 > .Os > .Sh NAME > @@ -42,6 +42,7 @@ > .Op Fl f Ar config_file > .Op Fl l Oo Ar mode Ns \&: Oc Ns Ar path > .Op Fl m Ar mark_interval > +.Op Fl O Ar format > .Op Fl P Ar pid_file > .Op Fl p Ar log_socket > .Op Fl S Ar logpriv_socket > @@ -242,6 +243,20 @@ Usually the > .Dq kern > facility is reserved for messages read directly from > .Pa /dev/klog . > +.It Fl O Ar format > +Select the output format of generated log messages. > +The values > +.Ar bsd > +and > +.Ar rfc3164 > +are used to generate RFC 3164 log messages. > +The values > +.Ar syslog > +and > +.Ar rfc5424 > +are used to generate RFC 5424 log messages, > +having RFC 3339 timestamps with microsecond precision. > +The default is to generate RFC 3164 log messages. > .It Fl m Ar mark_interval > Select the number of minutes between > .Dq mark > > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================ > ================== > --- head/usr.sbin/syslogd/syslogd.c Sat Apr 14 22:14:18 2018 > (r332509) > +++ head/usr.sbin/syslogd/syslogd.c Sun Apr 15 08:34:16 2018 > (r332510) > @@ -136,6 +136,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -367,9 +368,12 @@ static int KeepKernFac; /* Keep remotely logged > kernel > static int needdofsync = 0; /* Are any file(s) waiting to be fsynced? > */ > static struct pidfh *pfh; > static int sigpipe[2]; /* Pipe to catch a signal during select(). > */ > +static bool RFC3164OutputFormat = true; /* Use legacy format by > default. */ > > static volatile sig_atomic_t MarkSet, WantDie, WantInitialize, > WantReapchild; > > +struct iovlist; > + > static int allowaddr(char *); > static int addfile(struct filed *); > static int addpeer(struct peer *); > @@ -386,6 +390,7 @@ static void dofsync(void); > static void domark(int); > static void fprintlog_first(struct filed *, const char *, const char *, > const char *, const char *, const char *, const char *, int); > +static void fprintlog_write(struct filed *, struct iovlist *, int); > static void fprintlog_successive(struct filed *, int); > static void init(int); > static void logerror(const char *); > @@ -498,7 +503,7 @@ main(int argc, char *argv[]) > if (madvise(NULL, 0, MADV_PROTECT) != 0) > dprintf("madvise() failed: %s\n", strerror(errno)); > > - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:m:nNop:P: > sS:Tuv")) > + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:m:nNoO:p:P: > sS:Tuv")) > != -1) > switch (ch) { > #ifdef INET > @@ -621,6 +626,16 @@ main(int argc, char *argv[]) > case 'n': > resolve = 0; > break; > + case 'O': > + if (strcmp(optarg, "bsd") == 0 || > + strcmp(optarg, "rfc3164") == 0) > + RFC3164OutputFormat = true; > + else if (strcmp(optarg, "syslog") == 0 || > + strcmp(optarg, "rfc5424") == 0) > + RFC3164OutputFormat = false; > + else > + usage(); > + break; > case 'o': > use_bootfile = 1; > break; > @@ -880,12 +895,12 @@ static void > usage(void) > { > > - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", > - "usage: syslogd [-468ACcdFHknosTuv] [-a allowed_peer]", > - " [-b bind_address] [-f config_file]", > - " [-l [mode:]path] [-m mark_interval]", > - " [-P pid_file] [-p log_socket]", > - " [-S logpriv_socket]"); > + fprintf(stderr, > + "usage: syslogd [-468ACcdFHknosTuv] [-a allowed_peer]\n" > + " [-b bind_address] [-f config_file]\n" > + " [-l [mode:]path] [-m mark_interval]\n" > + " [-O format] [-P pid_file] [-p > log_socket]\n" > + " [-S logpriv_socket]\n"); > exit(1); > } > > @@ -1558,177 +1573,114 @@ dofsync(void) > } > } > > -#define IOV_SIZE 7 > +/* > + * List of iovecs to which entries can be appended. > + * Used for constructing the message to be logged. > + */ > +struct iovlist { > + struct iovec iov[TTYMSG_IOV_MAX]; > + size_t iovcnt; > + size_t totalsize; > +}; > + > static void > -fprintlog_first(struct filed *f, const char *hostname, const char > *app_name, > - const char *procid, const char *msgid __unused, > - const char *structured_data __unused, const char *msg, int flags) > +iovlist_init(struct iovlist *il) > { > - struct iovec iov[IOV_SIZE]; > - struct addrinfo *r; > - int l, lsent = 0; > - char tagged_msg[MAXLINE + 1], line[MAXLINE + 1], greetings[200]; > - char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n"; > - char timebuf[RFC3164_DATELEN + 1]; > - const char *msgret; > > - if (strftime(timebuf, sizeof(timebuf), RFC3164_DATEFMT, > - &f->f_lasttime.tm) == 0) > - timebuf[0] = '\0'; > - if (f->f_type == F_WALL) { > - /* The time displayed is not synchornized with the other > log > - * destinations (like messages). Following fragment was > using > - * ctime(&now), which was updating the time every 30 sec. > - * With f_lasttime, time is synchronized correctly. > - */ > - iov[0] = (struct iovec){ > - .iov_base = greetings, > - .iov_len = snprintf(greetings, sizeof(greetings), > - "\r\n\7Message from syslogd@%s " > - "at %.24s ...\r\n", hostname, timebuf) > + il->iovcnt = 0; > + il->totalsize = 0; > +} > + > +static void > +iovlist_append(struct iovlist *il, const char *str) > +{ > + size_t size; > + > + /* Discard components if we've run out of iovecs. */ > + if (il->iovcnt < nitems(il->iov)) { > + size = strlen(str); > + il->iov[il->iovcnt++] = (struct iovec){ > + .iov_base = __DECONST(char *, str), > + .iov_len = size, > }; > - if (iov[0].iov_len >= sizeof(greetings)) > - iov[0].iov_len = sizeof(greetings) - 1; > - iov[1] = (struct iovec){ > - .iov_base = nul, > - .iov_len = 0 > - }; > - } else { > - iov[0] = (struct iovec){ > - .iov_base = timebuf, > - .iov_len = strlen(timebuf) > - }; > - iov[1] = (struct iovec){ > - .iov_base = space, > - .iov_len = 1 > - }; > + il->totalsize += size; > } > +} > > - if (LogFacPri) { > - static char fp_buf[30]; /* Hollow laugh */ > - int fac = f->f_prevpri & LOG_FACMASK; > - int pri = LOG_PRI(f->f_prevpri); > - const char *f_s = NULL; > - char f_n[5]; /* Hollow laugh */ > - const char *p_s = NULL; > - char p_n[5]; /* Hollow laugh */ > +static void > +iovlist_truncate(struct iovlist *il, size_t size) > +{ > + struct iovec *last; > + size_t diff; > > - if (LogFacPri > 1) { > - const CODE *c; > - > - for (c = facilitynames; c->c_name; c++) { > - if (c->c_val == fac) { > - f_s = c->c_name; > - break; > - } > - } > - for (c = prioritynames; c->c_name; c++) { > - if (c->c_val == pri) { > - p_s = c->c_name; > - break; > - } > - } > + while (size > il->totalsize) { > + diff = size - il->totalsize; > + last = &il->iov[il->iovcnt - 1]; > + if (diff >= last->iov_len) { > + /* Remove the last iovec entirely. */ > + --il->iovcnt; > + il->totalsize -= last->iov_len; > + } else { > + /* Remove the last iovec partially. */ > + last->iov_len -= diff; > + il->totalsize -= diff; > } > - if (!f_s) { > - snprintf(f_n, sizeof f_n, "%d", LOG_FAC(fac)); > - f_s = f_n; > - } > - if (!p_s) { > - snprintf(p_n, sizeof p_n, "%d", pri); > - p_s = p_n; > - } > - snprintf(fp_buf, sizeof fp_buf, "<%s.%s> ", f_s, p_s); > - iov[2] = (struct iovec){ > - .iov_base = fp_buf, > - .iov_len = strlen(fp_buf) > - }; > - } else { > - iov[2] = (struct iovec){ > - .iov_base = nul, > - .iov_len = 0 > - }; > } > - /* Prepend the application name to the message if provided. */ > - if (app_name != NULL) { > - if (procid != NULL) > - snprintf(tagged_msg, sizeof(tagged_msg), > - "%s[%s]: %s", app_name, procid, msg); > - else > - snprintf(tagged_msg, sizeof(tagged_msg), > - "%s: %s", app_name, msg); > - msg = tagged_msg; > - } > - iov[3] = (struct iovec){ > - .iov_base = __DECONST(char *, hostname), > - .iov_len = strlen(hostname) > - }; > - iov[4] = (struct iovec){ > - .iov_base = space, > - .iov_len = 1 > - }; > - iov[5] = (struct iovec){ > - .iov_base = __DECONST(char *, msg), > - .iov_len = strlen(msg) > - }; > - dprintf("Logging to %s", TypeNames[f->f_type]); > - f->f_time = now; > +} > > - switch (f->f_type) { > - case F_UNUSED: > - dprintf("\n"); > - break; > +static void > +fprintlog_write(struct filed *f, struct iovlist *il, int flags) > +{ > + struct msghdr msghdr; > + struct addrinfo *r; > + struct socklist *sl; > + const char *msgret; > + ssize_t lsent; > > + switch (f->f_type) { > case F_FORW: > + /* Truncate messages to RFC 5426 recommended size. */ > dprintf(" %s", f->fu_forw_hname); > switch (f->fu_forw_addr->ai_addr->sa_family) { > #ifdef INET > case AF_INET: > dprintf(":%d\n", > ntohs(satosin(f->fu_forw_addr- > >ai_addr)->sin_port)); > + iovlist_truncate(il, 480); > break; > #endif > #ifdef INET6 > case AF_INET6: > dprintf(":%d\n", > ntohs(satosin6(f->fu_forw_ > addr->ai_addr)->sin6_port)); > + iovlist_truncate(il, 1180); > break; > #endif > default: > dprintf("\n"); > } > - /* check for local vs remote messages */ > - if (strcasecmp(hostname, LocalHostName)) > - l = snprintf(line, sizeof line - 1, > - "<%d>%.15s Forwarded from %s: %s", > - f->f_prevpri, (char *)iov[0].iov_base, > - hostname, (char *)iov[5].iov_base); > - else > - l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", > - f->f_prevpri, (char *)iov[0].iov_base, > - (char *)iov[5].iov_base); > - if (l < 0) > - l = 0; > - else if (l > MAXLINE) > - l = MAXLINE; > > + lsent = 0; > for (r = f->fu_forw_addr; r; r = r->ai_next) { > - struct socklist *sl; > - > + memset(&msghdr, 0, sizeof(msghdr)); > + msghdr.msg_name = r->ai_addr; > + msghdr.msg_namelen = r->ai_addrlen; > + msghdr.msg_iov = il->iov; > + msghdr.msg_iovlen = il->iovcnt; > STAILQ_FOREACH(sl, &shead, next) { > if (sl->sl_ss.ss_family == AF_LOCAL || > sl->sl_ss.ss_family == AF_UNSPEC || > sl->sl_socket < 0) > continue; > - lsent = sendto(sl->sl_socket, line, l, 0, > - r->ai_addr, r->ai_addrlen); > - if (lsent == l) > + lsent = sendmsg(sl->sl_socket, &msghdr, 0); > + if (lsent == (ssize_t)il->totalsize) > break; > } > - if (lsent == l && !send_to_all) > + if (lsent == (ssize_t)il->totalsize && > !send_to_all) > break; > } > - dprintf("lsent/l: %d/%d\n", lsent, l); > - if (lsent != l) { > + dprintf("lsent/totalsize: %zd/%zu\n", lsent, > il->totalsize); > + if (lsent != (ssize_t)il->totalsize) { > int e = errno; > logerror("sendto"); > errno = e; > @@ -1758,11 +1710,8 @@ fprintlog_first(struct filed *f, const char > *hostname, > > case F_FILE: > dprintf(" %s\n", f->fu_fname); > - iov[6] = (struct iovec){ > - .iov_base = lf, > - .iov_len = 1 > - }; > - if (writev(f->f_file, iov, nitems(iov)) < 0) { > + iovlist_append(il, "\n"); > + if (writev(f->f_file, il->iov, il->iovcnt) < 0) { > /* > * If writev(2) fails for potentially transient > errors > * like the filesystem being full, ignore it. > @@ -1782,10 +1731,7 @@ fprintlog_first(struct filed *f, const char > *hostname, > > case F_PIPE: > dprintf(" %s\n", f->fu_pipe_pname); > - iov[6] = (struct iovec){ > - .iov_base = lf, > - .iov_len = 1 > - }; > + iovlist_append(il, "\n"); > if (f->fu_pipe_pid == 0) { > if ((f->f_file = p_open(f->fu_pipe_pname, > &f->fu_pipe_pid)) < 0) { > @@ -1793,7 +1739,7 @@ fprintlog_first(struct filed *f, const char > *hostname, > break; > } > } > - if (writev(f->f_file, iov, nitems(iov)) < 0) { > + if (writev(f->f_file, il->iov, il->iovcnt) < 0) { > int e = errno; > > deadq_enter(f->fu_pipe_pid, f->fu_pipe_pname); > @@ -1812,12 +1758,9 @@ fprintlog_first(struct filed *f, const char > *hostname, > > case F_TTY: > dprintf(" %s%s\n", _PATH_DEV, f->fu_fname); > - iov[6] = (struct iovec){ > - .iov_base = crlf, > - .iov_len = 2 > - }; > + iovlist_append(il, "\r\n"); > errno = 0; /* ttymsg() only sometimes returns an > errno */ > - if ((msgret = ttymsg(iov, nitems(iov), f->fu_fname, 10))) { > + if ((msgret = ttymsg(il->iov, il->iovcnt, f->fu_fname, > 10))) { > f->f_type = F_UNUSED; > logerror(msgret); > } > @@ -1826,14 +1769,190 @@ fprintlog_first(struct filed *f, const char > *hostname, > case F_USERS: > case F_WALL: > dprintf("\n"); > - iov[6] = (struct iovec){ > - .iov_base = crlf, > - .iov_len = 2 > - }; > - wallmsg(f, iov, nitems(iov)); > + iovlist_append(il, "\r\n"); > + wallmsg(f, il->iov, il->iovcnt); > break; > } > +} > + > +static void > +fprintlog_rfc5424(struct filed *f, const char *hostname, const char > *app_name, > + const char *procid, const char *msgid, const char *structured_data, > + const char *msg, int flags) > +{ > + struct iovlist il; > + suseconds_t usec; > + int i; > + char timebuf[33], priority_number[5]; > + > + iovlist_init(&il); > + if (f->f_type == F_WALL) > + iovlist_append(&il, "\r\n\aMessage from syslogd ...\r\n"); > + iovlist_append(&il, "<"); > + snprintf(priority_number, sizeof(priority_number), "%d", > f->f_prevpri); > + iovlist_append(&il, priority_number); > + iovlist_append(&il, ">1 "); > + if (strftime(timebuf, sizeof(timebuf), "%FT%T.______%z", > + &f->f_lasttime.tm) == sizeof(timebuf) - 2) { > + /* Add colon to the time zone offset, which %z doesn't do. > */ > + timebuf[32] = '\0'; > + timebuf[31] = timebuf[30]; > + timebuf[30] = timebuf[29]; > + timebuf[29] = ':'; > + > + /* Overwrite space for microseconds with actual value. */ > + usec = f->f_lasttime.usec; > + for (i = 25; i >= 20; --i) { > + timebuf[i] = usec % 10 + '0'; > + usec /= 10; > + } > + iovlist_append(&il, timebuf); > + } else > + iovlist_append(&il, "-"); > + iovlist_append(&il, " "); > + iovlist_append(&il, hostname); > + iovlist_append(&il, " "); > + iovlist_append(&il, app_name == NULL ? "-" : app_name); > + iovlist_append(&il, " "); > + iovlist_append(&il, procid == NULL ? "-" : procid); > + iovlist_append(&il, " "); > + iovlist_append(&il, msgid == NULL ? "-" : msgid); > + iovlist_append(&il, " "); > + iovlist_append(&il, structured_data == NULL ? "-" : > structured_data); > + iovlist_append(&il, " "); > + iovlist_append(&il, msg); > + > + fprintlog_write(f, &il, flags); > +} > + > +static void > +fprintlog_rfc3164(struct filed *f, const char *hostname, const char > *app_name, > + const char *procid, const char *msg, int flags) > +{ > + struct iovlist il; > + const CODE *c; > + int facility, priority; > + char timebuf[RFC3164_DATELEN + 1], facility_number[5], > + priority_number[5]; > + bool facility_found, priority_found; > + > + if (strftime(timebuf, sizeof(timebuf), RFC3164_DATEFMT, > + &f->f_lasttime.tm) == 0) > + timebuf[0] = '\0'; > + > + iovlist_init(&il); > + switch (f->f_type) { > + case F_FORW: > + /* Message forwarded over the network. */ > + iovlist_append(&il, "<"); > + snprintf(priority_number, sizeof(priority_number), "%d", > + f->f_prevpri); > + iovlist_append(&il, priority_number); > + iovlist_append(&il, ">"); > + iovlist_append(&il, timebuf); > + if (strcasecmp(hostname, LocalHostName) != 0) { > + iovlist_append(&il, " Forwarded from "); > + iovlist_append(&il, hostname); > + iovlist_append(&il, ":"); > + } > + iovlist_append(&il, " "); > + break; > + > + case F_WALL: > + /* Message written to terminals. */ > + iovlist_append(&il, "\r\n\aMessage from syslogd@"); > + iovlist_append(&il, hostname); > + iovlist_append(&il, " at "); > + iovlist_append(&il, timebuf); > + iovlist_append(&il, " ...\r\n"); > + break; > + > + default: > + /* Message written to files. */ > + iovlist_append(&il, timebuf); > + iovlist_append(&il, " "); > + iovlist_append(&il, hostname); > + iovlist_append(&il, " "); > + > + if (LogFacPri) { > + iovlist_append(&il, "<"); > + > + facility = f->f_prevpri & LOG_FACMASK; > + facility_found = false; > + if (LogFacPri > 1) { > + for (c = facilitynames; c->c_name; c++) { > + if (c->c_val == facility) { > + iovlist_append(&il, > c->c_name); > + facility_found = true; > + break; > + } > + } > + } > + if (!facility_found) { > + snprintf(facility_number, > + sizeof(facility_number), "%d", > + LOG_FAC(facility)); > + iovlist_append(&il, facility_number); > + } > + > + iovlist_append(&il, "."); > + > + priority = LOG_PRI(f->f_prevpri); > + priority_found = false; > + if (LogFacPri > 1) { > + for (c = prioritynames; c->c_name; c++) { > + if (c->c_val == priority) { > + iovlist_append(&il, > c->c_name); > + priority_found = true; > + break; > + } > + } > + } > + if (!priority_found) { > + snprintf(priority_number, > + sizeof(priority_number), "%d", > priority); > + iovlist_append(&il, priority_number); > + } > + > + iovlist_append(&il, "> "); > + } > + break; > + } > + > + /* Message body with application name and process ID prefixed. */ > + if (app_name != NULL) { > + iovlist_append(&il, app_name); > + if (procid != NULL) { > + iovlist_append(&il, "["); > + iovlist_append(&il, procid); > + iovlist_append(&il, "]"); > + } > + iovlist_append(&il, ": "); > + } > + iovlist_append(&il, msg); > + > + fprintlog_write(f, &il, flags); > +} > + > +static void > +fprintlog_first(struct filed *f, const char *hostname, const char > *app_name, > + const char *procid, const char *msgid __unused, > + const char *structured_data __unused, const char *msg, int flags) > +{ > + > + dprintf("Logging to %s", TypeNames[f->f_type]); > + f->f_time = now; > f->f_prevcount = 0; > + if (f->f_type == F_UNUSED) { > + dprintf("\n"); > + return; > + } > + > + if (RFC3164OutputFormat) > + fprintlog_rfc3164(f, hostname, app_name, procid, msg, > flags); > + else > + fprintlog_rfc5424(f, hostname, app_name, procid, msgid, > + structured_data, msg, flags); > } > > /* > @@ -2229,8 +2348,10 @@ init(int signo) > if (gethostname(LocalHostName, sizeof(LocalHostName))) > err(EX_OSERR, "gethostname() failed"); > if ((p = strchr(LocalHostName, '.')) != NULL) { > - *p++ = '\0'; > - LocalDomain = p; > + /* RFC 5424 prefers logging FQDNs. */ > + if (RFC3164OutputFormat) > + *p = '\0'; > + LocalDomain = p + 1; > } else { > LocalDomain = ""; > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Mon Apr 16 12:05:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2037FA48F1; Mon, 16 Apr 2018 12:05:53 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660087.outbound.protection.outlook.com [40.107.66.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8A86C5C9; Mon, 16 Apr 2018 12:05:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM (52.132.66.153) by YQBPR0101MB1073.CANPRD01.PROD.OUTLOOK.COM (52.132.66.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.675.9; Mon, 16 Apr 2018 12:05:51 +0000 Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::893c:efc2:d71f:945a]) by YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::893c:efc2:d71f:945a%13]) with mapi id 15.20.0675.015; Mon, 16 Apr 2018 12:05:51 +0000 From: Rick Macklem To: Julian Elischer , Konstantin Belousov , Andriy Gapon CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r332559 - head/usr.sbin/mountd Thread-Topic: svn commit: r332559 - head/usr.sbin/mountd Thread-Index: AQHT1WPJF2YW/FdX9EeBNLw0aDyfeKQDOEiAgAAHNYCAAApiFQ== Date: Mon, 16 Apr 2018 12:05:51 +0000 Message-ID: References: <201804160917.w3G9HaCN081290@repo.freebsd.org> <20180416105611.GG1774@kib.kiev.ua>, <5e754f1f-9688-884a-cddd-fa4b65e67f0b@freebsd.org> In-Reply-To: <5e754f1f-9688-884a-cddd-fa4b65e67f0b@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQBPR0101MB1073; 7:sWuwQzBF1aEi4Ur6w3l4LE4YvAfRCfAfVtYDMi2TMhG0QmlwdLeThonFT84M4GlzEqoUMuwGjHNhzrgFr6aBSnNJcOqJykMA+gB+eJXZIKrMePdx0GyWz6OupKuRMkrVVC1CgSwa/uiZkkso3n93KPkLRBsOPq4bvdo7m6xaK7GLueTwCcX0qzYq9IOeRuMI/+U0e21fiWY4dE5SCTA0whHYdfyU0MXiNzzhJWfODzf6SXF3bEw/zP8z3BjBWtXc x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7153060)(7193020); SRVR:YQBPR0101MB1073; x-ms-traffictypediagnostic: YQBPR0101MB1073: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231232)(944501327)(52105095)(93006095)(93001095)(3002001)(6041310)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:YQBPR0101MB1073; BCL:0; PCL:0; RULEID:; SRVR:YQBPR0101MB1073; x-forefront-prvs: 0644578634 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(39380400002)(396003)(39860400002)(199004)(189003)(316002)(81156014)(81166006)(5660300001)(97736004)(11346002)(86362001)(476003)(8676002)(786003)(68736007)(446003)(106356001)(105586002)(99286004)(2900100001)(3660700001)(25786009)(486006)(186003)(305945005)(26005)(7696005)(76176011)(33656002)(4326008)(6506007)(74316002)(3280700002)(229853002)(110136005)(478600001)(6436002)(54906003)(53936002)(9686003)(59450400001)(74482002)(14454004)(102836004)(55016002)(5250100002)(2906002)(6246003)(8936002)(39060400002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1073; H:YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: jfG+RyR6/D5MfqYCnUmmUYBFK2Q/UgmFGUZWErcvl55yTPXxj+tEn+5kydd+opMGjftCCBigaZnek/rY3pQhhe8YiboEuxTqqzVp+ob1+0E1c5DKc+QLhfxP4aQF27DXEXGVQUrTlXHTkA6LY0eLmsozvGaFezV0HwDMghRGtZLQe+OWvin7yp3U3O0NMjok spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e284a8a6-99c9-40a2-dfc4-08d5a3926615 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: e284a8a6-99c9-40a2-dfc4-08d5a3926615 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2018 12:05:51.5430 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1073 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 12:05:54 -0000 Julian Elischer wrote: >On 16/4/18 6:56 pm, Konstantin Belousov wrote: [stuff snipped] >>> + ngroups =3D XU_NGROUPS + 1; >> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? >valid question.. because that is how many are allocated? >it was a "minimally invasive patch".. whoever used XU_NGROUPS before >should have fixed it. >Having said that, thanks for drawing out attention to it.. will >probably fix. 16 is the limit specified in the RFCs for Sun RPC, so that is the "on the w= ire" limit. I haven't looked at the code. It might make sense to handle more here and t= hen set the limit at 16 after getting rid of duplicates, but I have no idea if = it matters? rick [more stuff snipped] From owner-svn-src-head@freebsd.org Mon Apr 16 12:46:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C97FF8044A; Mon, 16 Apr 2018 12:46:15 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C36F874C79; Mon, 16 Apr 2018 12:46:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDE8A1D73D; Mon, 16 Apr 2018 12:46:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GCkETK087200; Mon, 16 Apr 2018 12:46:14 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GCkEZA087199; Mon, 16 Apr 2018 12:46:14 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804161246.w3GCkEZA087199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Apr 2018 12:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332560 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 12:46:15 -0000 Author: tsoome Date: Mon Apr 16 12:46:14 2018 New Revision: 332560 URL: https://svnweb.freebsd.org/changeset/base/332560 Log: loader: make sure we do not return garbage from help_getnext Since we do free subtopic and desc in help_getnext(), we need to set them also NULL, so we make sure we dont get double free(). Approved by: bapt Differential Revision: https://reviews.freebsd.org/D15082 Modified: head/stand/common/commands.c Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Mon Apr 16 09:17:36 2018 (r332559) +++ head/stand/common/commands.c Mon Apr 16 12:46:14 2018 (r332560) @@ -74,7 +74,6 @@ help_getnext(int fd, char **topic, char **subtopic, ch if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' ')) continue; - *topic = *subtopic = *desc = NULL; cp = line + 2; while((cp != NULL) && (*cp != 0)) { ep = strchr(cp, ' '); @@ -95,6 +94,7 @@ help_getnext(int fd, char **topic, char **subtopic, ch if (*topic == NULL) { free(*subtopic); free(*desc); + *subtopic = *desc = NULL; continue; } return(1); From owner-svn-src-head@freebsd.org Mon Apr 16 13:18:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A178EF82516; Mon, 16 Apr 2018 13:18:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 541597D082; Mon, 16 Apr 2018 13:18:19 +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 43EDD1DC2E; Mon, 16 Apr 2018 13:18:19 +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 w3GDIJuF002358; Mon, 16 Apr 2018 13:18:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GDIJl9002357; Mon, 16 Apr 2018 13:18:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804161318.w3GDIJl9002357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Apr 2018 13:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332561 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 332561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:18:19 -0000 Author: kevans Date: Mon Apr 16 13:18:18 2018 New Revision: 332561 URL: https://svnweb.freebsd.org/changeset/base/332561 Log: Rename volume label for ESP Harry Schmalzbauer reports that some firmware, in his experience, trips over the ESP we install due to the volume label. It has been theorized that this is due to some confusion with the label and the path on the ESP to boot1.efi. Regardless, Harry found that renaming the label seems to fix it. PR: 214282 MFC after: 3 days Modified: head/stand/efi/boot1/generate-fat.sh Modified: head/stand/efi/boot1/generate-fat.sh ============================================================================== --- head/stand/efi/boot1/generate-fat.sh Mon Apr 16 12:46:14 2018 (r332560) +++ head/stand/efi/boot1/generate-fat.sh Mon Apr 16 13:18:18 2018 (r332561) @@ -42,7 +42,7 @@ while read ARCH FILENAME; do dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$FAT_SIZE DEVICE=`mdconfig -a -f $OUTPUT_FILE` - newfs_msdos -F 12 -L EFI $DEVICE + newfs_msdos -F 12 -L EFISYS $DEVICE mkdir stub mount -t msdosfs /dev/$DEVICE stub From owner-svn-src-head@freebsd.org Mon Apr 16 13:31:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AC39F835BE for ; Mon, 16 Apr 2018 13:31:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7DB814B5 for ; Mon, 16 Apr 2018 13:31:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id r19-v6so11377201itc.0 for ; Mon, 16 Apr 2018 06:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HoCxvMSGrUzq4CZxrSeJ+RVsFGGrjSjbzEK829Q/nkA=; b=m9+QhtbGjDLnuTQlhEWd4QlEc9rlpKFuRF7Lv2+UWTdzuWBxIL7jgbpKj1Z7ZU+QTu GwBaJnn0BTp1pcbNOut8nkzZjNCsy1zwAPRGBuw8Q9aW6PKyae1mKfRvk+/Bu9NFpNgF PV6GeQ0xzC2jYe30g1jad81XJqxGc6ErcimTjmnbikfBGF9cZa+m0NxqC3u87Hd1Em+z 3WUHWictv1ZhIuF9Paf7JGoNY/a2D0AAmUOVssIjnlXTJWP1P60tp/EyBBtKyc20qeP/ qvIQWRlNL2h7BA3HcICj+d76n9IpKl5n/o8iUEvdGjCRafl0bjL/DbvL+/69B/mreS3C llvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HoCxvMSGrUzq4CZxrSeJ+RVsFGGrjSjbzEK829Q/nkA=; b=O3RAK8cDQvpfb7DXpDXsDxbza3Okhx0XP9fjE46jQ1bUEW8JExcvBBbdcknziEq27w N7dO+TjDWLfWe/sZ7H2y/G9ZgphoY3HjW47slKPgPAc0nYounUpugTCeKFWevNtXOUMH 43rvn8tAx7nPP0qkoD5aEo4XaNb8YfBpi63onEaPSGYItrcUzdK9u2VEPWcW0qVG1MZY VbLJWdF5ayp8V/Bwd0I+MQF90zNNzkYx8jVRe2flvQ+UgSwgsj/9A7TtgqKH4KTm2xOR Nqgw9TRpdkFmNZXLQVRP9OWsUBbxF+Gl3iQoAqUkSqUBCjq1fe+/sv2sTARMsNLLMTU2 q6ow== X-Gm-Message-State: ALQs6tC/QRGRjLviFSIU3PxaCbCBg0IWGqk9BnLkWTStFHG/NQJV/4qF F2BLnu16asIPe4zyD41Zu2NSnZd38qIxXnH6QYDuUA== X-Google-Smtp-Source: AIpwx4/FaHzAEbnB2rWumHAFHcsBP0lqUw7sCplkb5g2QoFbZYlPsj1J9YQPCwqQXTWkU9T5YJiYCPaGT8Ke2Yiup4I= X-Received: by 2002:a24:e983:: with SMTP id f125-v6mr4927154ith.36.1523885509821; Mon, 16 Apr 2018 06:31:49 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.166.4 with HTTP; Mon, 16 Apr 2018 06:31:49 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201804161318.w3GDIJl9002357@repo.freebsd.org> References: <201804161318.w3GDIJl9002357@repo.freebsd.org> From: Warner Losh Date: Mon, 16 Apr 2018 07:31:49 -0600 X-Google-Sender-Auth: B2yc13EQIrF5CMNoUKaa_6ylQCc Message-ID: Subject: Re: svn commit: r332561 - head/stand/efi/boot1 To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:31:51 -0000 On Mon, Apr 16, 2018 at 7:18 AM, Kyle Evans wrote: > Author: kevans > Date: Mon Apr 16 13:18:18 2018 > New Revision: 332561 > URL: https://svnweb.freebsd.org/changeset/base/332561 > > Log: > Rename volume label for ESP > > Harry Schmalzbauer reports that some firmware, in his experience, trips > over the ESP we install due to the volume label. It has been theorized > that > this is due to some confusion with the label and the path on the ESP to > boot1.efi. > > Regardless, Harry found that renaming the label seems to fix it. > rm -rf boot1.efifat after svn rm is the right answer here. Warner From owner-svn-src-head@freebsd.org Mon Apr 16 13:52:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 857EBF84EB4; Mon, 16 Apr 2018 13:52:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3719185D4B; Mon, 16 Apr 2018 13:52:24 +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 3051B1E359; Mon, 16 Apr 2018 13:52:24 +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 w3GDqOdL021910; Mon, 16 Apr 2018 13:52:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GDqNtM021905; Mon, 16 Apr 2018 13:52:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804161352.w3GDqNtM021905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Apr 2018 13:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332563 - in head/sys: arm/include ddb mips/include powerpc/include sparc64/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/include ddb mips/include powerpc/include sparc64/include X-SVN-Commit-Revision: 332563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:52:24 -0000 Author: imp Date: Mon Apr 16 13:52:23 2018 New Revision: 332563 URL: https://svnweb.freebsd.org/changeset/base/332563 Log: No need to force md code to define a macro that's the same as _BYTE_ORDER. Use that instead. Modified: head/sys/arm/include/db_machdep.h head/sys/ddb/db_access.c head/sys/mips/include/db_machdep.h head/sys/powerpc/include/db_machdep.h head/sys/sparc64/include/db_machdep.h Modified: head/sys/arm/include/db_machdep.h ============================================================================== --- head/sys/arm/include/db_machdep.h Mon Apr 16 13:50:01 2018 (r332562) +++ head/sys/arm/include/db_machdep.h Mon Apr 16 13:52:23 2018 (r332563) @@ -95,7 +95,4 @@ int db_validate_address(vm_offset_t); u_int branch_taken (u_int insn, db_addr_t pc); -#ifdef __ARMEB__ -#define BYTE_MSF (1) -#endif #endif /* !_MACHINE_DB_MACHDEP_H_ */ Modified: head/sys/ddb/db_access.c ============================================================================== --- head/sys/ddb/db_access.c Mon Apr 16 13:50:01 2018 (r332562) +++ head/sys/ddb/db_access.c Mon Apr 16 13:52:23 2018 (r332563) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -51,10 +52,6 @@ static unsigned db_extend[] = { /* table for sign-exte 0xFF800000U }; -#ifndef BYTE_MSF -#define BYTE_MSF 0 -#endif - db_expr_t db_get_value(db_addr_t addr, int size, bool is_signed) { @@ -69,9 +66,9 @@ db_get_value(db_addr_t addr, int size, bool is_signed) } value = 0; -#if BYTE_MSF +#if _BYTE_ORDER == _BIG_ENDIAN for (i = 0; i < size; i++) -#else /* BYTE_LSF */ +#else /* _LITTLE_ENDIAN */ for (i = size - 1; i >= 0; i--) #endif { @@ -91,9 +88,9 @@ db_put_value(db_addr_t addr, int size, db_expr_t value char data[sizeof(int)]; int i; -#if BYTE_MSF +#if _BYTE_ORDER == _BIG_ENDIAN for (i = size - 1; i >= 0; i--) -#else /* BYTE_LSF */ +#else /* _LITTLE_ENDIAN */ for (i = 0; i < size; i++) #endif { Modified: head/sys/mips/include/db_machdep.h ============================================================================== --- head/sys/mips/include/db_machdep.h Mon Apr 16 13:50:01 2018 (r332562) +++ head/sys/mips/include/db_machdep.h Mon Apr 16 13:52:23 2018 (r332563) @@ -41,17 +41,12 @@ #include #include -#include typedef struct trapframe db_regs_t; extern db_regs_t ddb_regs; /* register state */ typedef vm_offset_t db_addr_t; /* address - unsigned */ typedef register_t db_expr_t; /* expression - signed */ - -#if BYTE_ORDER == _BIG_ENDIAN -#define BYTE_MSF (1) -#endif #define SOFTWARE_SSTEP /* Need software single step */ #define SOFTWARE_SSTEP_EMUL /* next_instr_address() emulates 100% */ Modified: head/sys/powerpc/include/db_machdep.h ============================================================================== --- head/sys/powerpc/include/db_machdep.h Mon Apr 16 13:50:01 2018 (r332562) +++ head/sys/powerpc/include/db_machdep.h Mon Apr 16 13:52:23 2018 (r332563) @@ -40,8 +40,6 @@ #define DB_ELF_SYMBOLS #define DB_ELFSIZE __ELF_WORD_SIZE -#define BYTE_MSF (1) - typedef vm_offset_t db_addr_t; /* address - unsigned */ typedef intptr_t db_expr_t; /* expression - signed */ Modified: head/sys/sparc64/include/db_machdep.h ============================================================================== --- head/sys/sparc64/include/db_machdep.h Mon Apr 16 13:50:01 2018 (r332562) +++ head/sys/sparc64/include/db_machdep.h Mon Apr 16 13:52:23 2018 (r332563) @@ -33,8 +33,6 @@ #include #include -#define BYTE_MSF (1) - typedef vm_offset_t db_addr_t; typedef long db_expr_t; From owner-svn-src-head@freebsd.org Mon Apr 16 13:52:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 667F5F84F1B; Mon, 16 Apr 2018 13:52:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 118F78604F; Mon, 16 Apr 2018 13:52:41 +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 0B2001E362; Mon, 16 Apr 2018 13:52:41 +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 w3GDqe5M021967; Mon, 16 Apr 2018 13:52:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GDqeMC021966; Mon, 16 Apr 2018 13:52:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804161352.w3GDqeMC021966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Apr 2018 13:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332564 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 332564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:52:41 -0000 Author: imp Date: Mon Apr 16 13:52:40 2018 New Revision: 332564 URL: https://svnweb.freebsd.org/changeset/base/332564 Log: Use bool instead of boolean_t here. No reason to use boolean_t. Also, stop passing FALSE to a bool parameter. Modified: head/sys/i386/i386/db_trace.c Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Mon Apr 16 13:52:23 2018 (r332563) +++ head/sys/i386/i386/db_trace.c Mon Apr 16 13:52:40 2018 (r332564) @@ -216,7 +216,7 @@ db_numargs(fp) int inst; int args; - argp = (char *)db_get_value((int)&fp->f_retaddr, 4, FALSE); + argp = (char *)db_get_value((int)&fp->f_retaddr, 4, false); /* * XXX etext is wrong for LKMs. We should attempt to interpret * the instruction at the return address in all cases. This @@ -226,7 +226,7 @@ db_numargs(fp) args = -1; } else { retry: - inst = db_get_value((int)argp, 4, FALSE); + inst = db_get_value((int)argp, 4, false); if ((inst & 0xff) == 0x59) /* popl %ecx */ args = 1; else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ @@ -255,7 +255,7 @@ db_print_stack_entry(name, narg, argnp, argp, callpc, while (n) { if (argnp) db_printf("%s=", *argnp++); - db_printf("%r", db_get_value((int)argp, 4, FALSE)); + db_printf("%r", db_get_value((int)argp, 4, false)); argp++; if (--n != 0) db_printf(","); @@ -304,8 +304,8 @@ db_nextframe(struct i386_frame **fp, db_addr_t *ip, st c_db_sym_t sym; const char *name; - eip = db_get_value((int) &(*fp)->f_retaddr, 4, FALSE); - ebp = db_get_value((int) &(*fp)->f_frame, 4, FALSE); + eip = db_get_value((int) &(*fp)->f_retaddr, 4, false); + ebp = db_get_value((int) &(*fp)->f_frame, 4, false); /* * Figure out frame type. We look at the address just before @@ -435,7 +435,7 @@ db_backtrace(struct thread *td, struct trapframe *tf, db_expr_t offset; c_db_sym_t sym; int instr, narg; - boolean_t first; + bool first; if (db_segsize(tf) == 16) { db_printf( @@ -473,13 +473,13 @@ db_backtrace(struct thread *td, struct trapframe *tf, instr = (int)(kdb_frame + 1); else instr = (int)&kdb_frame->tf_esp; - pc = db_get_value(instr, 4, FALSE); + pc = db_get_value(instr, 4, false); } if (count == -1) count = 1024; - first = TRUE; + first = true; while (count-- && !db_pager_quit) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); @@ -497,7 +497,7 @@ db_backtrace(struct thread *td, struct trapframe *tf, */ actframe = frame; if (first) { - first = FALSE; + first = false; if (sym == C_DB_SYM_NULL && sp != 0) { /* * If a symbol couldn't be found, we've probably @@ -506,13 +506,13 @@ db_backtrace(struct thread *td, struct trapframe *tf, */ db_print_stack_entry(name, 0, 0, 0, pc, NULL); - pc = db_get_value(sp, 4, FALSE); + pc = db_get_value(sp, 4, false); if (db_search_symbol(pc, DB_STGY_PROC, &offset) == C_DB_SYM_NULL) break; continue; } else if (tf != NULL) { - instr = db_get_value(pc, 4, FALSE); + instr = db_get_value(pc, 4, false); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ actframe = (void *)(get_esp(tf) - 4); @@ -554,7 +554,7 @@ db_backtrace(struct thread *td, struct trapframe *tf, if (actframe != frame) { /* `frame' belongs to caller. */ pc = (db_addr_t) - db_get_value((int)&actframe->f_retaddr, 4, FALSE); + db_get_value((int)&actframe->f_retaddr, 4, false); continue; } @@ -588,7 +588,7 @@ db_trace_self(void) __asm __volatile("movl %%ebp,%0" : "=r" (ebp)); frame = (struct i386_frame *)ebp; - callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); + callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, false); frame = frame->f_frame; db_backtrace(curthread, NULL, frame, callpc, 0, -1); } From owner-svn-src-head@freebsd.org Mon Apr 16 13:59:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113ADF856F1; Mon, 16 Apr 2018 13:59:36 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw0-x241.google.com (mail-yw0-x241.google.com [IPv6:2607:f8b0:4002:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0E9878F4; Mon, 16 Apr 2018 13:59:35 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw0-x241.google.com with SMTP id q12so6642184ywj.0; Mon, 16 Apr 2018 06:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AcZn+xfACg8anY14gdY0BOMrslEVqv7vPKWDBzt76Dc=; b=XWJSUl9RfV7NbM28Bo0NKANjRSLAsbZJWNtjvKJ97vp8B9DdrBwBhj0sbGPUlujcrb TrM4IBDgYpO5/wFbu9DJ1sN7KiHfgKuDhteh6GGlGOil1kZhKoOlQFLeQg5uclut8Pfa +jfG6CFBYXdNslKxkbDFNka7oyFuzb7XGm/u/xYxv5b8eCxpdXi0ob/MgNTbRWuFQAzl qziANC7J8/f5QhAVY5QJWGPE6poaeRfY3mp2TSiTko9JIp9GUScqwf0GwaSs+8qX29K0 Y7QpveubfTh0XjwYY1i8mJM7I+ZTJtCvLpV1jJYWYKYJ+ZoVvnpG34PnK6E4IUyOU0hO /LNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=AcZn+xfACg8anY14gdY0BOMrslEVqv7vPKWDBzt76Dc=; b=RATXgiiv53/tkXx67hiIW63dAyK87JLCYY1x91Ojhv48vLKctPwsFyr601jduPUilB 8HhHPP6t9PJGgmcMF4RsaRU1FdT1nb6YxF9dN/s6PGFFnZsFMPLnVi2sFzylEhoXyqI9 ydbl74kyOcLIl/Xn3EABON5KCTsG39giVZZiPi39uzQT4HEgsFKjToHGPPgZXClfmrhY uX7X9rq5dNjsvLIepM3/20ydKPb5kAn8MV5TVjU4JGDPg35rL70a0ApZEHNE2uJ8YfF/ u2O9uNoIKrwib0X8PbTSVJ/GmxVx9+fSGUO7BEJVBIOvOFzhrYrHSWlnnfSgpMWSXLsd wriw== X-Gm-Message-State: ALQs6tBlZ84Y90h8RDYOeLQUeL4QfNTC5n+XVXnwus0RS7xaU5FRBCC5 6qy5r2+8svsbEAS53Sx/TZCnfs1L X-Google-Smtp-Source: AIpwx48fgMFGHzRMz1WD4EgmWio4IJDQeuqT44Kk/YFkUq9lPvOBq+vfFs4ncYnloadjDMV4P19YcQ== X-Received: by 10.129.51.196 with SMTP id z187mr4261050ywz.512.1523887174733; Mon, 16 Apr 2018 06:59:34 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.164.17.129]) by smtp.gmail.com with ESMTPSA id p4sm5140018ywb.47.2018.04.16.06.59.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 06:59:34 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r332523 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804160054.w3G0swF1030058@repo.freebsd.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <36d02ae2-0a99-6430-7244-46901268725c@FreeBSD.org> Date: Mon, 16 Apr 2018 09:59:33 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:59:36 -0000 Hi Steve, Yes, I am going to merge it in few days. I am trying to merge everything to keep code in sync. I am just rarely tagging ZFS commits with MFC, since it is hard to forget for too long about that exercise. :) On 16.04.2018 03:36, Steven Hartland wrote: > Hey Mav, this seems like an important one to get in for 11.2 so just > wanted to check if that was your intention as there's no MFC tag on the > commit? > > On 16/04/2018 01:54, Alexander Motin wrote: >> Author: mav >> Date: Mon Apr 16 00:54:58 2018 >> New Revision: 332523 >> URL: https://svnweb.freebsd.org/changeset/base/332523 >> >> Log: >> 9433 Fix ARC hit rate >> >> When the compressed ARC feature was added in commit d3c2ae1 >> the method of reference counting in the ARC was modified. As >> part of this accounting change the arc_buf_add_ref() function >> was removed entirely. >> >> This would have be fine but the arc_buf_add_ref() function >> served a second undocumented purpose of updating the ARC access >> information when taking a hold on a dbuf. Without this logic >> in place a cached dbuf would not migrate its associated >> arc_buf_hdr_t to the MFU list. This would negatively impact >> the ARC hit rate, particularly on systems with a small ARC. >> >> This change reinstates the missing call to arc_access() from >> dbuf_hold() by implementing a new arc_buf_access() function. >> >> Reviewed-by: Giuseppe Di Natale >> Reviewed-by: Tony Hutter >> Reviewed-by: Tim Chase >> Reviewed by: George Wilson >> Reviewed-by: George Melikov >> Signed-off-by: Brian Behlendorf >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Apr 16 00:42:45 2018 (r332522) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Apr 16 00:54:58 2018 (r332523) >> @@ -540,8 +540,13 @@ typedef struct arc_stats { >> */ >> kstat_named_t arcstat_mutex_miss; >> /* >> + * Number of buffers skipped when updating the access state due to the >> + * header having already been released after acquiring the hash lock. >> + */ >> + kstat_named_t arcstat_access_skip; >> + /* >> * Number of buffers skipped because they have I/O in progress, are >> - * indrect prefetch buffers that have not lived long enough, or are >> + * indirect prefetch buffers that have not lived long enough, or are >> * not from the spa we're trying to evict from. >> */ >> kstat_named_t arcstat_evict_skip; >> @@ -796,6 +801,7 @@ static arc_stats_t arc_stats = { >> { "allocated", KSTAT_DATA_UINT64 }, >> { "deleted", KSTAT_DATA_UINT64 }, >> { "mutex_miss", KSTAT_DATA_UINT64 }, >> + { "access_skip", KSTAT_DATA_UINT64 }, >> { "evict_skip", KSTAT_DATA_UINT64 }, >> { "evict_not_enough", KSTAT_DATA_UINT64 }, >> { "evict_l2_cached", KSTAT_DATA_UINT64 }, >> @@ -5063,6 +5069,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock) >> } else { >> ASSERT(!"invalid arc state"); >> } >> +} >> + >> +/* >> + * This routine is called by dbuf_hold() to update the arc_access() state >> + * which otherwise would be skipped for entries in the dbuf cache. >> + */ >> +void >> +arc_buf_access(arc_buf_t *buf) >> +{ >> + mutex_enter(&buf->b_evict_lock); >> + arc_buf_hdr_t *hdr = buf->b_hdr; >> + >> + /* >> + * Avoid taking the hash_lock when possible as an optimization. >> + * The header must be checked again under the hash_lock in order >> + * to handle the case where it is concurrently being released. >> + */ >> + if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) { >> + mutex_exit(&buf->b_evict_lock); >> + ARCSTAT_BUMP(arcstat_access_skip); >> + return; >> + } >> + >> + kmutex_t *hash_lock = HDR_LOCK(hdr); >> + mutex_enter(hash_lock); >> + >> + if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) { >> + mutex_exit(hash_lock); >> + mutex_exit(&buf->b_evict_lock); >> + ARCSTAT_BUMP(arcstat_access_skip); >> + return; >> + } >> + >> + mutex_exit(&buf->b_evict_lock); >> + >> + ASSERT(hdr->b_l1hdr.b_state == arc_mru || >> + hdr->b_l1hdr.b_state == arc_mfu); >> + >> + DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr); >> + arc_access(hdr, hash_lock); >> + mutex_exit(hash_lock); >> + >> + ARCSTAT_BUMP(arcstat_hits); >> + ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), >> + demand, prefetch, !HDR_ISTYPE_METADATA(hdr), data, metadata, hits); >> } >> >> /* a generic arc_done_func_t which you can use */ >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 16 00:42:45 2018 (r332522) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Apr 16 00:54:58 2018 (r332523) >> @@ -2579,8 +2579,10 @@ top: >> return (SET_ERROR(ENOENT)); >> } >> >> - if (db->db_buf != NULL) >> + if (db->db_buf != NULL) { >> + arc_buf_access(db->db_buf); >> ASSERT3P(db->db.db_data, ==, db->db_buf->b_data); >> + } >> >> ASSERT(db->db_buf == NULL || arc_referenced(db->db_buf)); >> >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Apr 16 00:42:45 2018 (r332522) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Apr 16 00:54:58 2018 (r332523) >> @@ -169,6 +169,7 @@ void arc_loan_inuse_buf(arc_buf_t *buf, void *tag); >> void arc_buf_destroy(arc_buf_t *buf, void *tag); >> int arc_buf_size(arc_buf_t *buf); >> int arc_buf_lsize(arc_buf_t *buf); >> +void arc_buf_access(arc_buf_t *buf); >> void arc_release(arc_buf_t *buf, void *tag); >> int arc_released(arc_buf_t *buf); >> void arc_buf_freeze(arc_buf_t *buf); >> > -- Alexander Motin From owner-svn-src-head@freebsd.org Mon Apr 16 14:10:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1AFDF86275; Mon, 16 Apr 2018 14:10:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCDD6A872; Mon, 16 Apr 2018 14:10:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F98F1E51B; Mon, 16 Apr 2018 14:10:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GEAJA8027200; Mon, 16 Apr 2018 14:10:19 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GEAJAL027199; Mon, 16 Apr 2018 14:10:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804161410.w3GEAJAL027199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Apr 2018 14:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332565 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 14:10:20 -0000 Author: tsoome Date: Mon Apr 16 14:10:19 2018 New Revision: 332565 URL: https://svnweb.freebsd.org/changeset/base/332565 Log: loader: cstyle cleanup of command.c just clean it up. no functional changes intended. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15087 Modified: head/stand/common/commands.c Modified: head/stand/common/commands.c ============================================================================== --- head/stand/common/commands.c Mon Apr 16 13:52:40 2018 (r332564) +++ head/stand/common/commands.c Mon Apr 16 14:10:19 2018 (r332565) @@ -61,155 +61,160 @@ here COMMAND_SET(help, "help", "detailed help", command_help); static int -help_getnext(int fd, char **topic, char **subtopic, char **desc) +help_getnext(int fd, char **topic, char **subtopic, char **desc) { - char line[81], *cp, *ep; + char line[81], *cp, *ep; - /* Make sure we provide sane values. */ - *topic = *subtopic = *desc = NULL; - for (;;) { - if (fgetstr(line, 80, fd) < 0) - return(0); - - if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' ')) - continue; + /* Make sure we provide sane values. */ + *topic = *subtopic = *desc = NULL; + for (;;) { + if (fgetstr(line, 80, fd) < 0) + return (0); - cp = line + 2; - while((cp != NULL) && (*cp != 0)) { - ep = strchr(cp, ' '); - if ((*cp == 'T') && (*topic == NULL)) { - if (ep != NULL) - *ep++ = 0; - *topic = strdup(cp + 1); - } else if ((*cp == 'S') && (*subtopic == NULL)) { - if (ep != NULL) - *ep++ = 0; - *subtopic = strdup(cp + 1); - } else if (*cp == 'D') { - *desc = strdup(cp + 1); - ep = NULL; - } - cp = ep; + if (strlen(line) < 3 || line[0] != '#' || line[1] != ' ') + continue; + + cp = line + 2; + while (cp != NULL && *cp != 0) { + ep = strchr(cp, ' '); + if (*cp == 'T' && *topic == NULL) { + if (ep != NULL) + *ep++ = 0; + *topic = strdup(cp + 1); + } else if (*cp == 'S' && *subtopic == NULL) { + if (ep != NULL) + *ep++ = 0; + *subtopic = strdup(cp + 1); + } else if (*cp == 'D') { + *desc = strdup(cp + 1); + ep = NULL; + } + cp = ep; + } + if (*topic == NULL) { + free(*subtopic); + free(*desc); + *subtopic = *desc = NULL; + continue; + } + return (1); } - if (*topic == NULL) { - free(*subtopic); - free(*desc); - *subtopic = *desc = NULL; - continue; - } - return(1); - } } static int help_emitsummary(char *topic, char *subtopic, char *desc) { - int i; - - pager_output(" "); - pager_output(topic); - i = strlen(topic); - if (subtopic != NULL) { - pager_output(" "); - pager_output(subtopic); - i += strlen(subtopic) + 1; - } - if (desc != NULL) { - do { - pager_output(" "); - } while (i++ < 30); - pager_output(desc); - } - return (pager_output("\n")); + int i; + + pager_output(" "); + pager_output(topic); + i = strlen(topic); + if (subtopic != NULL) { + pager_output(" "); + pager_output(subtopic); + i += strlen(subtopic) + 1; + } + if (desc != NULL) { + do { + pager_output(" "); + } while (i++ < 30); + pager_output(desc); + } + return (pager_output("\n")); } - + static int -command_help(int argc, char *argv[]) +command_help(int argc, char *argv[]) { - char buf[81]; /* XXX buffer size? */ - int hfd, matched, doindex; - char *topic, *subtopic, *t, *s, *d; + char buf[81]; /* XXX buffer size? */ + int hfd, matched, doindex; + char *topic, *subtopic, *t, *s, *d; - /* page the help text from our load path */ - snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev")); - if ((hfd = open(buf, O_RDONLY)) < 0) { - printf("Verbose help not available, use '?' to list commands\n"); - return(CMD_OK); - } + /* page the help text from our load path */ + snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev")); + if ((hfd = open(buf, O_RDONLY)) < 0) { + printf("Verbose help not available, " + "use '?' to list commands\n"); + return (CMD_OK); + } - /* pick up request from arguments */ - topic = subtopic = NULL; - switch(argc) { - case 3: - subtopic = strdup(argv[2]); - case 2: - topic = strdup(argv[1]); - break; - case 1: - topic = strdup("help"); - break; - default: - command_errmsg = "usage is 'help []"; - close(hfd); - return(CMD_ERROR); - } + /* pick up request from arguments */ + topic = subtopic = NULL; + switch (argc) { + case 3: + subtopic = strdup(argv[2]); + /* FALLTHROUGH */ + case 2: + topic = strdup(argv[1]); + break; + case 1: + topic = strdup("help"); + break; + default: + command_errmsg = "usage is 'help []"; + close(hfd); + return(CMD_ERROR); + } - /* magic "index" keyword */ - doindex = !strcmp(topic, "index"); - matched = doindex; - - /* Scan the helpfile looking for help matching the request */ - pager_open(); - while(help_getnext(hfd, &t, &s, &d)) { + /* magic "index" keyword */ + doindex = strcmp(topic, "index") == 0? 1 : 0; + matched = doindex; - if (doindex) { /* dink around formatting */ - if (help_emitsummary(t, s, d)) - break; + /* Scan the helpfile looking for help matching the request */ + pager_open(); + while (help_getnext(hfd, &t, &s, &d)) { - } else if (strcmp(topic, t)) { - /* topic mismatch */ - if (matched) /* nothing more on this topic, stop scanning */ - break; + if (doindex) { /* dink around formatting */ + if (help_emitsummary(t, s, d)) + break; - } else { - /* topic matched */ - matched = 1; - if (((subtopic == NULL) && (s == NULL)) || - ((subtopic != NULL) && (s != NULL) && !strcmp(subtopic, s))) { - /* exact match, print text */ - while ((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) { - if (pager_output(buf)) - break; - if (pager_output("\n")) - break; + } else if (strcmp(topic, t)) { + /* topic mismatch */ + if (matched) { + /* nothing more on this topic, stop scanning */ + break; + } + } else { + /* topic matched */ + matched = 1; + if ((subtopic == NULL && s == NULL) || + (subtopic != NULL && s != NULL && + strcmp(subtopic, s) == 0)) { + /* exact match, print text */ + while (fgetstr(buf, 80, hfd) >= 0 && + buf[0] != '#') { + if (pager_output(buf)) + break; + if (pager_output("\n")) + break; + } + } else if (subtopic == NULL && s != NULL) { + /* topic match, list subtopics */ + if (help_emitsummary(t, s, d)) + break; + } } - } else if ((subtopic == NULL) && (s != NULL)) { - /* topic match, list subtopics */ - if (help_emitsummary(t, s, d)) - break; - } + free(t); + free(s); + free(d); + t = s = d = NULL; } free(t); free(s); free(d); - t = s = d = NULL; - } - free(t); - free(s); - free(d); - pager_close(); - close(hfd); - if (!matched) { - snprintf(command_errbuf, sizeof(command_errbuf), - "no help available for '%s'", topic); + pager_close(); + close(hfd); + if (!matched) { + snprintf(command_errbuf, sizeof(command_errbuf), + "no help available for '%s'", topic); + free(topic); + free(subtopic); + return (CMD_ERROR); + } free(topic); free(subtopic); - return(CMD_ERROR); - } - free(topic); - free(subtopic); - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(commandlist, "?", "list commands", command_commandlist); @@ -223,27 +228,28 @@ COMMAND_SET(commandlist, "?", "list commands", command * fixing it. */ static int -command_commandlist(int argc, char *argv[]) +command_commandlist(int argc __unused, char *argv[] __unused) { - struct bootblk_command **cmdp; - int res; - char name[20]; + struct bootblk_command **cmdp; + int res; + char name[20]; - res = 0; - pager_open(); - res = pager_output("Available commands:\n"); - SET_FOREACH(cmdp, Xcommand_set) { - if (res) - break; - if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) { - snprintf(name, sizeof(name), " %-15s ", (*cmdp)->c_name); - pager_output(name); - pager_output((*cmdp)->c_desc); - res = pager_output("\n"); + res = 0; + pager_open(); + res = pager_output("Available commands:\n"); + SET_FOREACH(cmdp, Xcommand_set) { + if (res) + break; + if ((*cmdp)->c_name != NULL && (*cmdp)->c_desc != NULL) { + snprintf(name, sizeof(name), " %-15s ", + (*cmdp)->c_name); + pager_output(name); + pager_output((*cmdp)->c_desc); + res = pager_output("\n"); + } } - } - pager_close(); - return(CMD_OK); + pager_close(); + return (CMD_OK); } /* @@ -256,35 +262,35 @@ COMMAND_SET(show, "show", "show variable(s)", command_ static int command_show(int argc, char *argv[]) { - struct env_var *ev; - char *cp; + struct env_var *ev; + char *cp; - if (argc < 2) { - /* - * With no arguments, print everything. - */ - pager_open(); - for (ev = environ; ev != NULL; ev = ev->ev_next) { - pager_output(ev->ev_name); - cp = getenv(ev->ev_name); - if (cp != NULL) { - pager_output("="); - pager_output(cp); - } - if (pager_output("\n")) - break; - } - pager_close(); - } else { - if ((cp = getenv(argv[1])) != NULL) { - printf("%s\n", cp); + if (argc < 2) { + /* + * With no arguments, print everything. + */ + pager_open(); + for (ev = environ; ev != NULL; ev = ev->ev_next) { + pager_output(ev->ev_name); + cp = getenv(ev->ev_name); + if (cp != NULL) { + pager_output("="); + pager_output(cp); + } + if (pager_output("\n")) + break; + } + pager_close(); } else { - snprintf(command_errbuf, sizeof(command_errbuf), - "variable '%s' not found", argv[1]); - return(CMD_ERROR); + if ((cp = getenv(argv[1])) != NULL) { + printf("%s\n", cp); + } else { + snprintf(command_errbuf, sizeof(command_errbuf), + "variable '%s' not found", argv[1]); + return (CMD_ERROR); + } } - } - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(set, "set", "set a variable", command_set); @@ -292,37 +298,37 @@ COMMAND_SET(set, "set", "set a variable", command_set) static int command_set(int argc, char *argv[]) { - int err; - - if (argc != 2) { - command_errmsg = "wrong number of arguments"; - return(CMD_ERROR); - } else { - if ((err = putenv(argv[1])) != 0) { - command_errmsg = strerror(err); - return(CMD_ERROR); + int err; + + if (argc != 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } else { + if ((err = putenv(argv[1])) != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } } - } - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(unset, "unset", "unset a variable", command_unset); static int -command_unset(int argc, char *argv[]) +command_unset(int argc, char *argv[]) { - int err; - - if (argc != 2) { - command_errmsg = "wrong number of arguments"; - return(CMD_ERROR); - } else { - if ((err = unsetenv(argv[1])) != 0) { - command_errmsg = strerror(err); - return(CMD_ERROR); + int err; + + if (argc != 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } else { + if ((err = unsetenv(argv[1])) != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } } - } - return(CMD_OK); + return (CMD_OK); } COMMAND_SET(echo, "echo", "echo arguments", command_echo); @@ -330,34 +336,34 @@ COMMAND_SET(echo, "echo", "echo arguments", command_ec static int command_echo(int argc, char *argv[]) { - char *s; - int nl, ch; - - nl = 0; - optind = 1; - optreset = 1; - while ((ch = getopt(argc, argv, "n")) != -1) { - switch(ch) { - case 'n': - nl = 1; - break; - case '?': - default: - /* getopt has already reported an error */ - return(CMD_OK); + char *s; + int nl, ch; + + nl = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "n")) != -1) { + switch (ch) { + case 'n': + nl = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return (CMD_OK); + } } - } - argv += (optind); - argc -= (optind); + argv += (optind); + argc -= (optind); - s = unargv(argc, argv); - if (s != NULL) { - printf("%s", s); - free(s); - } - if (!nl) - printf("\n"); - return(CMD_OK); + s = unargv(argc, argv); + if (s != NULL) { + printf("%s", s); + free(s); + } + if (!nl) + printf("\n"); + return (CMD_OK); } /* @@ -369,55 +375,55 @@ COMMAND_SET(read, "read", "read input from the termina static int command_read(int argc, char *argv[]) { - char *prompt; - int timeout; - time_t when; - char *cp; - char *name; - char buf[256]; /* XXX size? */ - int c; + char *prompt; + int timeout; + time_t when; + char *cp; + char *name; + char buf[256]; /* XXX size? */ + int c; - timeout = -1; - prompt = NULL; - optind = 1; - optreset = 1; - while ((c = getopt(argc, argv, "p:t:")) != -1) { - switch(c) { - - case 'p': - prompt = optarg; - break; - case 't': - timeout = strtol(optarg, &cp, 0); - if (cp == optarg) { - snprintf(command_errbuf, sizeof(command_errbuf), - "bad timeout '%s'", optarg); - return(CMD_ERROR); - } - break; - default: - return(CMD_OK); + timeout = -1; + prompt = NULL; + optind = 1; + optreset = 1; + while ((c = getopt(argc, argv, "p:t:")) != -1) { + switch (c) { + case 'p': + prompt = optarg; + break; + case 't': + timeout = strtol(optarg, &cp, 0); + if (cp == optarg) { + snprintf(command_errbuf, + sizeof(command_errbuf), + "bad timeout '%s'", optarg); + return (CMD_ERROR); + } + break; + default: + return (CMD_OK); + } } - } - argv += (optind); - argc -= (optind); - name = (argc > 0) ? argv[0]: NULL; - - if (prompt != NULL) - printf("%s", prompt); - if (timeout >= 0) { - when = time(NULL) + timeout; - while (!ischar()) - if (time(NULL) >= when) - return(CMD_OK); /* is timeout an error? */ - } + argv += (optind); + argc -= (optind); + name = (argc > 0) ? argv[0]: NULL; - ngets(buf, sizeof(buf)); + if (prompt != NULL) + printf("%s", prompt); + if (timeout >= 0) { + when = time(NULL) + timeout; + while (!ischar()) + if (time(NULL) >= when) + return (CMD_OK); /* is timeout an error? */ + } - if (name != NULL) - setenv(name, buf, 1); - return(CMD_OK); + ngets(buf, sizeof(buf)); + + if (name != NULL) + setenv(name, buf, 1); + return (CMD_OK); } /* @@ -428,44 +434,46 @@ COMMAND_SET(more, "more", "show contents of a file", c static int command_more(int argc, char *argv[]) { - int i; - int res; - char line[80]; + int i; + int res; + char line[80]; - res=0; - pager_open(); - for (i = 1; (i < argc) && (res == 0); i++) { - snprintf(line, sizeof(line), "*** FILE %s BEGIN ***\n", argv[i]); - if (pager_output(line)) - break; - res = page_file(argv[i]); - if (!res) { - snprintf(line, sizeof(line), "*** FILE %s END ***\n", argv[i]); - res = pager_output(line); + res = 0; + pager_open(); + for (i = 1; (i < argc) && (res == 0); i++) { + snprintf(line, sizeof(line), "*** FILE %s BEGIN ***\n", + argv[i]); + if (pager_output(line)) + break; + res = page_file(argv[i]); + if (!res) { + snprintf(line, sizeof(line), "*** FILE %s END ***\n", + argv[i]); + res = pager_output(line); + } } - } - pager_close(); + pager_close(); - if (res == 0) - return CMD_OK; - else - return CMD_ERROR; + if (res == 0) + return (CMD_OK); + else + return (CMD_ERROR); } static int page_file(char *filename) { - int result; + int result; - result = pager_file(filename); + result = pager_file(filename); - if (result == -1) { - snprintf(command_errbuf, sizeof(command_errbuf), - "error showing %s", filename); - } + if (result == -1) { + snprintf(command_errbuf, sizeof(command_errbuf), + "error showing %s", filename); + } - return result; -} + return (result); +} /* * List all disk-like devices @@ -475,38 +483,38 @@ COMMAND_SET(lsdev, "lsdev", "list all devices", comman static int command_lsdev(int argc, char *argv[]) { - int verbose, ch, i; - char line[80]; - - verbose = 0; - optind = 1; - optreset = 1; - while ((ch = getopt(argc, argv, "v")) != -1) { - switch(ch) { - case 'v': - verbose = 1; - break; - case '?': - default: - /* getopt has already reported an error */ - return(CMD_OK); + int verbose, ch, i; + char line[80]; + + verbose = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "v")) != -1) { + switch (ch) { + case 'v': + verbose = 1; + break; + case '?': + default: + /* getopt has already reported an error */ + return (CMD_OK); + } } - } - argv += (optind); - argc -= (optind); + argv += (optind); + argc -= (optind); - pager_open(); - for (i = 0; devsw[i] != NULL; i++) { - if (devsw[i]->dv_print != NULL){ - if (devsw[i]->dv_print(verbose)) - break; - } else { - snprintf(line, sizeof(line), "%s: (unknown)\n", devsw[i]->dv_name); - if (pager_output(line)) - break; + pager_open(); + for (i = 0; devsw[i] != NULL; i++) { + if (devsw[i]->dv_print != NULL) { + if (devsw[i]->dv_print(verbose)) + break; + } else { + snprintf(line, sizeof(line), "%s: (unknown)\n", + devsw[i]->dv_name); + if (pager_output(line)) + break; + } } - } - pager_close(); - return(CMD_OK); + pager_close(); + return (CMD_OK); } - From owner-svn-src-head@freebsd.org Mon Apr 16 15:06:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A23F8A593; Mon, 16 Apr 2018 15:06:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5052B7BE50; Mon, 16 Apr 2018 15:06:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x236.google.com with SMTP id d6so18461507iog.1; Mon, 16 Apr 2018 08:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DRwxPxEZUtvzUlcnmMotLxEoMmcuG60Y8BGnE05BpbA=; b=gJvhlxVPEH2+daVqANyGYspXctRuBp8yAXeoAeH6pR12Lp4gBfnmy75+XGVwT1U+fZ /0Q74cpAoMUKz7ABT6ltcoZWa5rCwQnAIb4+yo4mD+5OWzQI+G7loocOv3pvafpcVc8O elphnAh+FSosMVxceXXwaRE51hYq25XE9zAst82JYqafjWcS13oqFrpP5/oax3qhrbh7 z+rhLcXRztKUiEuzwtSKyuAfujAZXdNB0meKdVjET7e5tpLPiFBrlJx/5q/g6iI/U9dF zgAX9nDwVgUvK8IAlFfTwWTYnX6kMWmgjmw5t1UT2iVmrQrnbclsKfMQKiEF4X96yvhi zsow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DRwxPxEZUtvzUlcnmMotLxEoMmcuG60Y8BGnE05BpbA=; b=W+u9hu0+HUv6cUq2cG3t5QXVHUdDmYCHc542UGrI0/pcQf7NowB/jug5NEjxUOY1Zj tZLbokRHPyUghSZC6KuA/znVu4+TKjzK6CsEgFD8cOS1f4jU5ydCzZtYVqixRJsoRLkg qAoDMTLEEjmVY6EYVtBddfI2VIO/PWrOKbrJ82DGV97RkcZLi+fJJvcLJ6u307AnTwyh D5zF2b/0Cfbv5QV39DpuI4PtuTY6rIUt53LVPDN7Ew9OsIRCf8jai08PaWA/Nnild8ki fWKoULhvarDerpeC/H0aiqLUhomVXNRmwJUXYh047ziezdOSAvad6yYVyS+aoOz6CJJz +nhA== X-Gm-Message-State: ALQs6tB4EG2e2AP5fq8Vku7kvU5lAwbYONBhMVMUR9qKRPyu9ZnL6IzW FnDKlZm0jqHlhZfdFRqlWxBh++xniaUfz+owO71JEA== X-Google-Smtp-Source: AIpwx48JQE1GGUiLxkTVfnD51EUKDxExcyNRKzY+1CHjbBuei6yDHkiv4o3bO5/b+J57dTMseNxZfGu6jIVjUqDPCmA= X-Received: by 10.107.83.9 with SMTP id h9mr6391200iob.239.1523891174348; Mon, 16 Apr 2018 08:06:14 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Mon, 16 Apr 2018 08:05:53 -0700 (PDT) In-Reply-To: <201804161318.w3GDIJl9002357@repo.freebsd.org> References: <201804161318.w3GDIJl9002357@repo.freebsd.org> From: Ed Maste Date: Mon, 16 Apr 2018 11:05:53 -0400 X-Google-Sender-Auth: SKXM-oNdrYfAUv5UIvtjeJnVP7A Message-ID: Subject: Re: svn commit: r332561 - head/stand/efi/boot1 To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 15:06:15 -0000 On 16 April 2018 at 09:18, Kyle Evans wrote: > Author: kevans > Date: Mon Apr 16 13:18:18 2018 > New Revision: 332561 > URL: https://svnweb.freebsd.org/changeset/base/332561 > > Log: > Rename volume label for ESP The desire to remove boot1.efifat notwithstanding, you'll also need to regenerate and commit the FAT templates for this change to take effect. From owner-svn-src-head@freebsd.org Mon Apr 16 15:13:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A664F8AD6A; Mon, 16 Apr 2018 15:13:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D217E7EB5B; Mon, 16 Apr 2018 15:13:18 +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 CCAC81F09E; Mon, 16 Apr 2018 15:13:18 +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 w3GFDIDT061901; Mon, 16 Apr 2018 15:13:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GFDI2T061900; Mon, 16 Apr 2018 15:13:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804161513.w3GFDI2T061900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Apr 2018 15:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332573 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 332573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 15:13:19 -0000 Author: kevans Date: Mon Apr 16 15:13:18 2018 New Revision: 332573 URL: https://svnweb.freebsd.org/changeset/base/332573 Log: Regenerate FAT templates after r332561 Modified: head/stand/efi/boot1/fat-amd64.tmpl.xz head/stand/efi/boot1/fat-arm.tmpl.xz head/stand/efi/boot1/fat-arm64.tmpl.xz head/stand/efi/boot1/fat-i386.tmpl.xz Modified: head/stand/efi/boot1/fat-amd64.tmpl.xz ============================================================================== Binary file (source and/or target). No diff available. Modified: head/stand/efi/boot1/fat-arm.tmpl.xz ============================================================================== Binary file (source and/or target). No diff available. Modified: head/stand/efi/boot1/fat-arm64.tmpl.xz ============================================================================== Binary file (source and/or target). No diff available. Modified: head/stand/efi/boot1/fat-i386.tmpl.xz ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-head@freebsd.org Mon Apr 16 17:43:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A701F97879; Mon, 16 Apr 2018 17:43:27 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1F8F83A93; Mon, 16 Apr 2018 17:43:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCFB2208C9; Mon, 16 Apr 2018 17:43:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GHhQZT043010; Mon, 16 Apr 2018 17:43:26 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GHhQhU043009; Mon, 16 Apr 2018 17:43:26 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804161743.w3GHhQhU043009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 16 Apr 2018 17:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332629 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 332629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 17:43:27 -0000 Author: brooks Date: Mon Apr 16 17:43:26 2018 New Revision: 332629 URL: https://svnweb.freebsd.org/changeset/base/332629 Log: Remove unused badaddr() function. Reviewed by: jmallett Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15078 Modified: head/sys/mips/mips/support.S Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Mon Apr 16 17:30:33 2018 (r332628) +++ head/sys/mips/mips/support.S Mon Apr 16 17:43:26 2018 (r332629) @@ -105,38 +105,6 @@ .text /* - * See if access to addr with a len type instruction causes a machine check. - * len is length of access (1=byte, 2=short, 4=int) - * - * badaddr(addr, len) - * char *addr; - * int len; - */ -LEAF(badaddr) - PTR_LA v0, baderr - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - bne a1, 1, 2f - PTR_S v0, U_PCB_ONFAULT(v1) - b 5f - lbu v0, (a0) -2: - bne a1, 2, 4f - nop - b 5f - lhu v0, (a0) -4: - lw v0, (a0) -5: - PTR_S zero, U_PCB_ONFAULT(v1) - j ra - move v0, zero # made it w/o errors -baderr: - j ra - li v0, 1 # trap sends us here -END(badaddr) - -/* * int copystr(void *kfaddr, void *kdaddr, size_t maxlen, size_t *lencopied) * Copy a NIL-terminated string, at most maxlen characters long. Return the * number of characters copied (including the NIL) in *lencopied. If the From owner-svn-src-head@freebsd.org Mon Apr 16 18:07:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B94CF98F14; Mon, 16 Apr 2018 18:07:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDD78720E; Mon, 16 Apr 2018 18:07:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C11320C23; Mon, 16 Apr 2018 18:07:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GI7pdf053268; Mon, 16 Apr 2018 18:07:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GI7p9M053264; Mon, 16 Apr 2018 18:07:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804161807.w3GI7p9M053264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 16 Apr 2018 18:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332630 - in head: lib/libifconfig sbin/devd sbin/etherswitchcfg sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: lib/libifconfig sbin/devd sbin/etherswitchcfg sbin/ifconfig X-SVN-Commit-Revision: 332630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 18:07:52 -0000 Author: brooks Date: Mon Apr 16 18:07:51 2018 New Revision: 332630 URL: https://svnweb.freebsd.org/changeset/base/332630 Log: Remove support for FDDI and token ring media types in userland utilities. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15077 Modified: head/lib/libifconfig/libifconfig_media.c head/sbin/devd/devd.cc head/sbin/etherswitchcfg/ifmedia.c head/sbin/ifconfig/ifmedia.c Modified: head/lib/libifconfig/libifconfig_media.c ============================================================================== --- head/lib/libifconfig/libifconfig_media.c Mon Apr 16 17:43:26 2018 (r332629) +++ head/lib/libifconfig/libifconfig_media.c Mon Apr 16 18:07:51 2018 (r332630) @@ -373,15 +373,6 @@ ifconfig_media_get_status(const struct ifmediareq *ifm } break; - case IFM_FDDI: - case IFM_TOKEN: - if (ifmr->ifm_status & IFM_ACTIVE) { - return ("inserted"); - } else { - return ("no ring"); - } - break; - case IFM_IEEE80211: if (ifmr->ifm_status & IFM_ACTIVE) { /* NB: only sta mode associates */ Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Mon Apr 16 17:43:26 2018 (r332629) +++ head/sbin/devd/devd.cc Mon Apr 16 18:07:51 2018 (r332630) @@ -333,8 +333,6 @@ media::media(config &, const char *var, const char *ty { static struct ifmedia_description media_types[] = { { IFM_ETHER, "Ethernet" }, - { IFM_TOKEN, "Tokenring" }, - { IFM_FDDI, "FDDI" }, { IFM_IEEE80211, "802.11" }, { IFM_ATM, "ATM" }, { -1, "unknown" }, Modified: head/sbin/etherswitchcfg/ifmedia.c ============================================================================== --- head/sbin/etherswitchcfg/ifmedia.c Mon Apr 16 17:43:26 2018 (r332629) +++ head/sbin/etherswitchcfg/ifmedia.c Mon Apr 16 18:07:51 2018 (r332630) @@ -159,14 +159,6 @@ media_status(int s) printf("no carrier"); break; - case IFM_FDDI: - case IFM_TOKEN: - if (ifmr.ifm_status & IFM_ACTIVE) - printf("inserted"); - else - printf("no ring"); - break; - case IFM_IEEE80211: if (ifmr.ifm_status & IFM_ACTIVE) { /* NB: only sta mode associates */ Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Mon Apr 16 17:43:26 2018 (r332629) +++ head/sbin/ifconfig/ifmedia.c Mon Apr 16 18:07:51 2018 (r332630) @@ -168,14 +168,6 @@ media_status(int s) printf("no carrier"); break; - case IFM_FDDI: - case IFM_TOKEN: - if (ifmr.ifm_status & IFM_ACTIVE) - printf("inserted"); - else - printf("no ring"); - break; - case IFM_IEEE80211: if (ifmr.ifm_status & IFM_ACTIVE) { /* NB: only sta mode associates */ From owner-svn-src-head@freebsd.org Mon Apr 16 18:12:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4B8F998A5; Mon, 16 Apr 2018 18:12:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 574578791F; Mon, 16 Apr 2018 18:12:16 +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 524CE20DA4; Mon, 16 Apr 2018 18:12:16 +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 w3GICGDG058177; Mon, 16 Apr 2018 18:12:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GICGZS058174; Mon, 16 Apr 2018 18:12:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201804161812.w3GICGZS058174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 16 Apr 2018 18:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332631 - in head: sys/kern tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/kern tests/sys/aio X-SVN-Commit-Revision: 332631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 18:12:16 -0000 Author: asomers Date: Mon Apr 16 18:12:15 2018 New Revision: 332631 URL: https://svnweb.freebsd.org/changeset/base/332631 Log: lio_listio: return EAGAIN instead of EIO when out of resources This behavior is already documented by the man page, and suggested by POSIX. Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D15099 Modified: head/sys/kern/vfs_aio.c head/tests/sys/aio/Makefile head/tests/sys/aio/lio_test.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Apr 16 18:07:51 2018 (r332630) +++ head/sys/kern/vfs_aio.c Mon Apr 16 18:12:15 2018 (r332631) @@ -2131,7 +2131,7 @@ kern_lio_listio(struct thread *td, int mode, struct ai struct aioliojob *lj; struct kevent kev; int error; - int nerror; + int nagain, nerror; int i; if ((mode != LIO_NOWAIT) && (mode != LIO_WAIT)) @@ -2200,12 +2200,15 @@ kern_lio_listio(struct thread *td, int mode, struct ai /* * Get pointers to the list of I/O requests. */ + nagain = 0; nerror = 0; for (i = 0; i < nent; i++) { job = acb_list[i]; if (job != NULL) { error = aio_aqueue(td, job, lj, LIO_NOP, ops); - if (error != 0) + if (error == EAGAIN) + nagain++; + else if (error != 0) nerror++; } } @@ -2252,7 +2255,10 @@ kern_lio_listio(struct thread *td, int mode, struct ai if (nerror) return (EIO); - return (error); + else if (nagain) + return (EAGAIN); + else + return (error); } /* syscall - list directed I/O (REALTIME) */ Modified: head/tests/sys/aio/Makefile ============================================================================== --- head/tests/sys/aio/Makefile Mon Apr 16 18:07:51 2018 (r332630) +++ head/tests/sys/aio/Makefile Mon Apr 16 18:12:15 2018 (r332631) @@ -6,6 +6,8 @@ ATF_TESTS_C+= aio_test ATF_TESTS_C+= lio_test TEST_METADATA.aio_test+= timeout="30" TEST_METADATA.lio_test+= timeout="10" +# Some lio_test testcases involve system resource limitations, so cannot run concurrently +TEST_METADATA.lio_test+= is_exclusive=true PLAIN_TESTS_C+= aio_kqueue_test PLAIN_TESTS_C+= lio_kqueue_test Modified: head/tests/sys/aio/lio_test.c ============================================================================== --- head/tests/sys/aio/lio_test.c Mon Apr 16 18:07:51 2018 (r332630) +++ head/tests/sys/aio/lio_test.c Mon Apr 16 18:12:15 2018 (r332631) @@ -30,10 +30,13 @@ #include #include +#include #include +#include #include +#include "local.h" #include "freebsd_test_suite/macros.h" static sem_t completions; @@ -51,6 +54,73 @@ thr_handler(union sigval sv __unused) ATF_REQUIRE_EQ(0, sem_post(&completions)); } +/* + * If lio_listio is unable to enqueue any requests at all, it should return + * EAGAIN. + */ +ATF_TC_WITHOUT_HEAD(lio_listio_eagain_kevent); +ATF_TC_BODY(lio_listio_eagain_kevent, tc) +{ + int fd, i, j, kq, max_queue_per_proc, ios_per_call; + size_t max_queue_per_proc_size; + struct aiocb *aiocbs[2]; + struct aiocb **list[2]; + struct sigevent sev[2]; + char *buffer; + const char *path="tempfile"; + void *udata[2]; + + ATF_REQUIRE_KERNEL_MODULE("aio"); + ATF_REQUIRE_UNSAFE_AIO(); + + max_queue_per_proc_size = sizeof(max_queue_per_proc); + ATF_REQUIRE_EQ(sysctlbyname("vfs.aio.max_aio_queue_per_proc", + &max_queue_per_proc, &max_queue_per_proc_size, NULL, 0), 0); + ios_per_call = max_queue_per_proc; + + fd = open(path, O_RDWR|O_CREAT, 0666); + ATF_REQUIRE(fd >= 0); + + kq = kqueue(); + ATF_REQUIRE(kq > 0); + + buffer = calloc(1, 4096); + ATF_REQUIRE(buffer != NULL); + + /* + * Call lio_listio twice, each with the maximum number of operations. + * The first call should succeed and the second should fail. + */ + for (i = 0; i < 2; i++) { + aiocbs[i] = calloc(ios_per_call, sizeof(struct aiocb)); + ATF_REQUIRE(aiocbs[i] != NULL); + list[i] = calloc(ios_per_call, sizeof(struct aiocb*)); + ATF_REQUIRE(list[i] != NULL); + udata[i] = (void*)((caddr_t)0xdead0000 + i); + sev[i].sigev_notify = SIGEV_KEVENT; + sev[i].sigev_notify_kqueue = kq; + sev[i].sigev_value.sival_ptr = udata[i]; + for (j = 0; j < ios_per_call; j++) { + aiocbs[i][j].aio_fildes = fd; + aiocbs[i][j].aio_offset = (i * ios_per_call + j) * 4096; + aiocbs[i][j].aio_buf = buffer; + aiocbs[i][j].aio_nbytes = 4096; + aiocbs[i][j].aio_lio_opcode = LIO_WRITE; + list[i][j] = &aiocbs[i][j]; + } + } + + ATF_REQUIRE_EQ(0, lio_listio(LIO_NOWAIT, list[0], ios_per_call, &sev[0])); + ATF_REQUIRE_EQ(-1, lio_listio(LIO_NOWAIT, list[1], ios_per_call, &sev[1])); + /* + * The second lio_listio call should fail with EAGAIN. Bad timing may + * mean that some requests did get enqueued, but the result should + * still be EAGAIN. + */ + ATF_REQUIRE_EQ(errno, EAGAIN); +} + + /* With LIO_WAIT, an empty lio_listio should return immediately */ ATF_TC_WITHOUT_HEAD(lio_listio_empty_wait); ATF_TC_BODY(lio_listio_empty_wait, tc) @@ -136,6 +206,7 @@ ATF_TC_BODY(lio_listio_empty_nowait_thread, tc) ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, lio_listio_eagain_kevent); ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_kevent); ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_signal); ATF_TP_ADD_TC(tp, lio_listio_empty_nowait_thread); From owner-svn-src-head@freebsd.org Mon Apr 16 18:57:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CD4EF9CCAD; Mon, 16 Apr 2018 18:57:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 497E56D5FC; Mon, 16 Apr 2018 18:57:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0979810AFD2; Mon, 16 Apr 2018 14:57:10 -0400 (EDT) From: John Baldwin To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332498 - head/sys/x86/cpufreq Date: Mon, 16 Apr 2018 10:11:16 -0700 Message-ID: <3726806.j2KQuIGiZ0@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804140315.w3E3F5Id058802@repo.freebsd.org> References: <201804140315.w3E3F5Id058802@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 16 Apr 2018 14:57:10 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 18:57:17 -0000 On Saturday, April 14, 2018 03:15:05 AM Conrad Meyer wrote: > Author: cem > Date: Sat Apr 14 03:15:05 2018 > New Revision: 332498 > URL: https://svnweb.freebsd.org/changeset/base/332498 > > Log: > cpufreq: Remove error-prone table terminators in favor of automatic sizing > > PR: 227388 > Reported by: Vladimir Machulsky > Sponsored by: Dell EMC Isilon Presumably you could use nitems() on ESTprocs as well rather than a terminator? -- John Baldwin From owner-svn-src-head@freebsd.org Mon Apr 16 19:12:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA866F9DF51; Mon, 16 Apr 2018 19:12:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72C416FC76; Mon, 16 Apr 2018 19:12:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id q85-v6so13019829itc.0; Mon, 16 Apr 2018 12:12:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=/hzMjtVg/3c8TAsjmul7YHUki0psZLE3SkecfpBd6lg=; b=oJ0Pn8SGVYegLAieKQ8Owt4rNzhc6Cz6J6ph7B2819GzcwCMDqi/BCNwuhOeMGnGOF OkoJ6UwPNt0eSJeREi5xrr39rh9rR33vLwQ+gPHcPw6CAZykaoOLOR8IBmdM1UyoL85G BRq0CO2iwwAej7XI5PGxX8cyMhbJe3XT3Px7618I83EeimObdQpphJyqRSc5rGm9xXBp iNhTjp6o3SYQ9FIXDmgDgCmuTc/qnY7riIFqayyPn020wIRRJVrP2gUWydoJM6xh6xw9 cLAr4kJ4ztdNQ34c3TA1Ch4fMSKm5RzyB1ukhCLn88XuW7SaRjjTCEZSKwUskombkaJ3 U+9g== X-Gm-Message-State: ALQs6tBQU0+tkzumA3BLm8daa7vnrORwB7wnQo4nd8DgmtkS+tMy3PQ4 QdLLfFg/BAd8wcyWTVLG4qYqmXzq X-Google-Smtp-Source: AIpwx48dGsq2Aez2W1GFPrebM8LW40YkoVx8KewfUNz/JAgpQQcoafLud6kU6OM6Dx46cLTpVB4E8g== X-Received: by 2002:a24:57ce:: with SMTP id u197-v6mr15513648ita.133.1523905972335; Mon, 16 Apr 2018 12:12:52 -0700 (PDT) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id j20sm6254250ioe.67.2018.04.16.12.12.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 12:12:52 -0700 (PDT) Received: by mail-it0-f47.google.com with SMTP id 71-v6so13006530ith.2; Mon, 16 Apr 2018 12:12:52 -0700 (PDT) X-Received: by 2002:a24:5352:: with SMTP id n79-v6mr17556802itb.61.1523905971931; Mon, 16 Apr 2018 12:12:51 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.34.77 with HTTP; Mon, 16 Apr 2018 12:12:51 -0700 (PDT) In-Reply-To: <3726806.j2KQuIGiZ0@ralph.baldwin.cx> References: <201804140315.w3E3F5Id058802@repo.freebsd.org> <3726806.j2KQuIGiZ0@ralph.baldwin.cx> From: Conrad Meyer Date: Mon, 16 Apr 2018 12:12:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332498 - head/sys/x86/cpufreq To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 19:12:54 -0000 On Mon, Apr 16, 2018 at 10:11 AM, John Baldwin wrote: > On Saturday, April 14, 2018 03:15:05 AM Conrad Meyer wrote: >> Author: cem >> Date: Sat Apr 14 03:15:05 2018 >> New Revision: 332498 >> URL: https://svnweb.freebsd.org/changeset/base/332498 >> >> Log: >> cpufreq: Remove error-prone table terminators in favor of automatic sizing >> >> PR: 227388 >> Reported by: Vladimir Machulsky >> Sponsored by: Dell EMC Isilon > > Presumably you could use nitems() on ESTprocs as well rather than a terminator? Yep. From owner-svn-src-head@freebsd.org Mon Apr 16 19:33:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66045F9F9F0; Mon, 16 Apr 2018 19:33:05 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 091DD7336B; Mon, 16 Apr 2018 19:33:05 +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 0084821AB3; Mon, 16 Apr 2018 19:33:05 +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 w3GJX41C001629; Mon, 16 Apr 2018 19:33:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GJX4Yj001628; Mon, 16 Apr 2018 19:33:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804161933.w3GJX4Yj001628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 16 Apr 2018 19:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332632 - head/usr.bin/quota X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/quota X-SVN-Commit-Revision: 332632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 19:33:05 -0000 Author: cem Date: Mon Apr 16 19:33:04 2018 New Revision: 332632 URL: https://svnweb.freebsd.org/changeset/base/332632 Log: quota(1): Fix calculation overflow and underflow For very large quotas, do the multiplication as a 64 bit value to avoid overflow. For very small block sizes (smaller than DEV_BSIZE), multiple first before dividing by block size to avoid underflow. PR: 227496 Submitted by: Per Andersson Sponsored by: Dell EMC Isilon Modified: head/usr.bin/quota/quota.c Modified: head/usr.bin/quota/quota.c ============================================================================== --- head/usr.bin/quota/quota.c Mon Apr 16 18:12:15 2018 (r332631) +++ head/usr.bin/quota/quota.c Mon Apr 16 19:33:04 2018 (r332632) @@ -621,14 +621,14 @@ getnfsquota(struct statfs *fst, struct quotause *qup, gettimeofday(&tv, NULL); /* blocks*/ dqp->dqb_bhardlimit = - gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit * - (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE); + ((uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit * + gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize) / DEV_BSIZE; dqp->dqb_bsoftlimit = - gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit * - (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE); + ((uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit * + gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize) / DEV_BSIZE; dqp->dqb_curblocks = - gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks * - (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE); + ((uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks * + gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize) / DEV_BSIZE; /* inodes */ dqp->dqb_ihardlimit = gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit; From owner-svn-src-head@freebsd.org Tue Apr 17 00:02:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D74AF886BB; Tue, 17 Apr 2018 00:02:08 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670089.outbound.protection.outlook.com [40.107.67.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2548469326; Tue, 17 Apr 2018 00:02:05 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM (52.132.66.153) by YQBPR0101MB1538.CANPRD01.PROD.OUTLOOK.COM (52.132.69.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.9; Tue, 17 Apr 2018 00:02:04 +0000 Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::893c:efc2:d71f:945a]) by YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::893c:efc2:d71f:945a%13]) with mapi id 15.20.0675.015; Tue, 17 Apr 2018 00:02:04 +0000 From: Rick Macklem To: Julian Elischer , Konstantin Belousov , Andriy Gapon CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r332559 - head/usr.sbin/mountd Thread-Topic: svn commit: r332559 - head/usr.sbin/mountd Thread-Index: AQHT1d2LvqfGyf/rSkGmX+1c3ssiQQ== Date: Tue, 17 Apr 2018 00:02:04 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQBPR0101MB1538; 7:/Sm3G+mb+OkUPB+A5r50daALVkqrGa7coSrUa1XZG6iI/d8dteiACea8ffg3uR4P9eiA58XEQjP2fMN677DZ8rUJqlmCz7ptGZxfKEv9aXbygMEwrLsepJj/W7KmtiaA0YWfH/eNeboJ4eb6bDPfWfmiQBuDLl6Wmw9+l0seQOQhKvUL4j6CKfL//c8PMFsFr0Nj+jORWNghfq8zmUxAgzk5O9eVlV8n7p5OoX8QsHa4b/BbqBgaP8FZ/qq61MHs x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7153060)(7193020); SRVR:YQBPR0101MB1538; x-ms-traffictypediagnostic: YQBPR0101MB1538: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231232)(944501351)(52105095)(10201501046)(6041310)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:YQBPR0101MB1538; BCL:0; PCL:0; RULEID:; SRVR:YQBPR0101MB1538; x-forefront-prvs: 0645BEB7AA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39380400002)(396003)(39860400002)(376002)(189003)(199004)(110136005)(54906003)(6246003)(97736004)(106356001)(486006)(316002)(39060400002)(53936002)(786003)(14454004)(81156014)(81166006)(8676002)(2900100001)(9686003)(8936002)(55016002)(33656002)(68736007)(74482002)(105586002)(186003)(86362001)(6436002)(4326008)(5660300001)(5250100002)(99286004)(478600001)(7696005)(25786009)(102836004)(229853002)(59450400001)(26005)(6346003)(305945005)(74316002)(2906002)(476003)(3660700001)(6506007)(3280700002)(299355004); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1538; H:YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-microsoft-antispam-message-info: yGi9dmIPN5AnSKcGhbKKFuOzf7uNUN1GUZ0yTUh9vi8knJ6bKs3kJM3GgyfS3FxH4OYH2XqoKNH3QxOB+lsNk2Rl0oYVJ6H3bOeVvedcoTdsDKbdSmFQxw3d8W/qNP7ye6KJYZ0co8wsnsxKq2PSAgq7I+kKafI4lbElD08MahZPmuBPKlgszEuFT5KX8KEY spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 48b5e24a-aa9f-4df5-ad43-08d5a3f67418 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 48b5e24a-aa9f-4df5-ad43-08d5a3f67418 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2018 00:02:04.7537 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1538 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 00:02:08 -0000 I wrote: >Julian Elischer wrote: >>On 16/4/18 6:56 pm, Konstantin Belousov wrote: >[stuff snipped] >>>> + ngroups =3D3D XU_NGROUPS + 1; >>> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? >>valid question.. because that is how many are allocated? >>it was a "minimally invasive patch".. whoever used XU_NGROUPS before >>should have fixed it. >>Having said that, thanks for drawing out attention to it.. will >>probably fix. >16 is the limit specified in the RFCs for Sun RPC, so that is the "on the = wire" limit. >I haven't looked at the code. It might make sense to handle more here and = then >set the limit at 16 after getting rid of duplicates, but I have no idea if= =3D >it matters? > >rick Correcting my own post. Now that I've looked at the code, this doesn't go o= n the wire. It does go in the exports structure, which means that this struct= ure would have to be revised (along with the syscall and VOP calls and the kern= el code that uses it). These credentials are for the "maproot/mapall" export option and revising the export structure seems like quite a bit of work for= this case. (Until revised XU_NGROUPS is the correct value to set it to, since th= ere is a "struct xucred" in the exports structure.) Since Julian Elischer has been emailing me about adding a "fsid" export opt= ion which allows /etc/exports to set the FSID of the exported fs (which would a= lso need to go in the exports structure), it might be about time to rev. the ex= ports structure? rick= From owner-svn-src-head@freebsd.org Tue Apr 17 02:33:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C6BF99D6F; Tue, 17 Apr 2018 02:33:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D71416EE9F; Tue, 17 Apr 2018 02:33:54 +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 D2120261BF; Tue, 17 Apr 2018 02:33:54 +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 w3H2XsPJ012303; Tue, 17 Apr 2018 02:33:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3H2XsZw012300; Tue, 17 Apr 2018 02:33:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804170233.w3H2XsZw012300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 17 Apr 2018 02:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332641 - in head/cddl/contrib/opensolaris/cmd: zfs zpool X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris/cmd: zfs zpool X-SVN-Commit-Revision: 332641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 02:33:55 -0000 Author: mav Date: Tue Apr 17 02:33:54 2018 New Revision: 332641 URL: https://svnweb.freebsd.org/changeset/base/332641 Log: MFV man pages update from r329502: 7614 zfs device evacuation/removal. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Apr 17 02:18:04 2018 (r332640) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Apr 17 02:33:54 2018 (r332641) @@ -116,6 +116,9 @@ .Oo Fl S Ar property Oc Ns ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot | Ns Ar bookmark Ns ... .Nm +.Cm remap +.Ar filesystem Ns | Ns Ar volume +.Nm .Cm set .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... @@ -2266,6 +2269,17 @@ if the .Fl S option was not specified. .El +.It Xo +.Nm +.Cm remap +.Ar filesystem Ns | Ns Ar volume +.Xc +.Pp +Remap the indirect blocks in the given fileystem or volume so that they no +longer reference blocks on previously removed vdevs and we can eventually +shrink the size of the indirect mapping objects for the previously removed +vdevs. Note that remapping all blocks might not be possible and that +references from snapshots will still exist and cannot be remapped. .It Xo .Nm .Cm upgrade Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Apr 17 02:18:04 2018 (r332640) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Apr 17 02:33:54 2018 (r332641) @@ -448,6 +448,40 @@ when the "zpool checkpoint" command is used to checkpo The feature will only return back to being .Sy enabled when the pool is rewound or the checkpoint has been discarded. +.It Sy device_removal +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:device_removal" +.It GUID Ta com.delphix:device_removal +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature enables the "zpool remove" subcommand to remove top-level +vdevs, evacuating them to reduce the total size of the pool. +.Pp +This feature becomes +.Sy active +when the "zpool remove" command is used +on a top-level vdev, and will never return to being +.Sy enabled . +.It Sy obsolete_counts +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:obsolete_counts" +.It GUID Ta com.delphix:obsolete_counts +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta device_removal +.El +.Pp +This feature is an enhancement of device_removal, which will over time +reduce the memory used to track removed devices. When indirect blocks +are freed or remapped, we note that their part of the indirect mapping +is "obsolete", i.e. no longer needed. See also the "zfs remap" +subcommand in +.Xr zfs 8 . + +This feature becomes +.Sy active +when the "zpool remove" command is +used on a top-level vdev, and will never return to being +.Sy enabled . .It Sy large_blocks .Bl -column "READ\-ONLY COMPATIBLE" "org.open-zfs:large_block" .It GUID Ta org.open-zfs:large_block Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Tue Apr 17 02:18:04 2018 (r332640) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Tue Apr 17 02:33:54 2018 (r332641) @@ -21,7 +21,7 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs .\" Copyright (c) 2012, Glen Barber -.\" Copyright (c) 2013 by Delphix. All Rights Reserved. +.\" Copyright (c) 2012, 2017 by Delphix. All Rights Reserved. .\" Copyright 2017 Nexenta Systems, Inc. .\" Copyright (c) 2017 Datto Inc. .\" @@ -151,8 +151,13 @@ .Ar pool .Nm .Cm remove +.Op Fl np .Ar pool device ... .Nm +.Cm remove +.Fl s +.Ar pool +.Nm .Cm reopen .Ar pool .Nm @@ -510,8 +515,8 @@ Multiple log devices can also be specified, and they c section for an example of mirroring multiple log devices. .Pp Log devices can be added, replaced, attached, detached, imported and exported -as part of the larger pool. Mirrored log devices can be removed by specifying -the top-level mirror for the log. +as part of the larger pool. +Mirrored devices can be removed by specifying the top-level mirror vdev. .Ss Cache devices Devices can be added to a storage pool as "cache devices." These devices provide an additional layer of caching between main memory and disk. For @@ -1604,19 +1609,55 @@ devices in this pool are online and healthy before per .It Xo .Nm .Cm remove +.Op Fl np .Ar pool device ... .Xc .Pp -Removes the specified device from the pool. This command currently only -supports removing hot spares, cache, and log devices. A mirrored log device can -be removed by specifying the top-level mirror for the log. Non-log devices that -are part of a mirrored configuration can be removed using the +Removes the specified device from the pool. +This command currently only supports removing hot spares, cache, log +devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz. +.sp +Removing a top-level vdev reduces the total amount of space in the storage pool. +The specified device will be evacuated by copying all allocated space from it to +the other devices in the pool. +In this case, the +.Nm zpool Cm remove +command initiates the removal and returns, while the evacuation continues in +the background. +The removal progress can be monitored with +.Nm zpool Cm status. +This feature must be enabled to be used, see +.Xr zpool-features 5 +.Pp +A mirrored top-level device (log or data) can be removed by specifying the +top-level mirror for the same. +Non-log devices or data devices that are part of a mirrored configuration can +be removed using the .Qq Nm Cm detach -command. Non-redundant and -.No raidz -devices cannot be removed from a pool. +command. +.Bl -tag -width Ds +.It Fl n +Do not actually perform the removal ("no-op"). +Instead, print the estimated amount of memory that will be used by the +mapping table after the removal completes. +This is nonzero only for top-level vdevs. +.El +.Bl -tag -width Ds +.It Fl p +Used in conjunction with the +.Fl n +flag, displays numbers as parsable (exact) values. +.El .It Xo .Nm +.Cm remove +.Fl s +.Ar pool +.Xc +.Pp +Stops and cancels an in-progress removal of a top-level vdev. +.It Xo +.Nm .Cm reopen .Ar pool .Xc @@ -2098,11 +2139,13 @@ data 23.9G 14.6G 9.30G 48% - 61% .Ed .It Xo .Sy Example 16 -Removing a Mirrored Log Device +Removing a Mirrored top-level (Log or Data) Device .Xc .Pp -The following command removes the mirrored log device -.Em mirror-2 . +The following commands remove the mirrored log device +.Sy mirror-2 +and mirrored top-level data device +.Sy mirror-1 . .Pp Given this configuration: .Bd -literal -offset 2n @@ -2130,6 +2173,13 @@ The command to remove the mirrored log is: .Bd -literal -offset 2n .Li # Ic zpool remove tank mirror-2 +.Ed +.Pp +The command to remove the mirrored data +.Em mirror-1 +is: +.Bd -literal -offset 2n +.Li # Ic zpool remove tank mirror-1 .Ed .It Xo .Sy Example 17 From owner-svn-src-head@freebsd.org Tue Apr 17 09:05:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE066F911B0; Tue, 17 Apr 2018 09:05:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9976F4B7; Tue, 17 Apr 2018 09:05:48 +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 5A8CC2391; Tue, 17 Apr 2018 09:05:48 +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 w3H95mvZ009209; Tue, 17 Apr 2018 09:05:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3H95ljl009197; Tue, 17 Apr 2018 09:05:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804170905.w3H95ljl009197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 Apr 2018 09:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332642 - in head: contrib/bsnmp/snmpd lib/libc/locale lib/libc/stdio lib/libc/stdlib lib/libc/string lib/libc/sys lib/libufs share/man/man7 share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: contrib/bsnmp/snmpd lib/libc/locale lib/libc/stdio lib/libc/stdlib lib/libc/string lib/libc/sys lib/libufs share/man/man7 share/man/man9 X-SVN-Commit-Revision: 332642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 09:05:49 -0000 Author: trasz Date: Tue Apr 17 09:05:46 2018 New Revision: 332642 URL: https://svnweb.freebsd.org/changeset/base/332642 Log: Don't put multiple names on a single .Nm line. This fixes apropos(1) output, from this: strnlen, strlen, strlen,(3) - find length of string │······· ... to this: strlen, strnlen(3) - find length of string PR: 223525 MFC after: 2 weeks Modified: head/contrib/bsnmp/snmpd/snmpmod.3 head/lib/libc/locale/isdigit.3 head/lib/libc/locale/isxdigit.3 head/lib/libc/stdio/printf.3 head/lib/libc/stdlib/qsort.3 head/lib/libc/string/strcpy.3 head/lib/libc/string/strlen.3 head/lib/libc/sys/fsync.2 head/lib/libufs/ufs_disk_close.3 head/share/man/man7/c99.7 head/share/man/man9/OF_device_from_xref.9 head/share/man/man9/printf.9 Modified: head/contrib/bsnmp/snmpd/snmpmod.3 ============================================================================== --- head/contrib/bsnmp/snmpd/snmpmod.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/contrib/bsnmp/snmpd/snmpmod.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -102,35 +102,35 @@ .Nm index_compare , .Nm index_compare_off , .Nm index_append , -.Nm index_append_off, -.Nm snmpd_usmstats, -.Nm bsnmpd_get_usm_stats, -.Nm bsnmpd_reset_usm_stats, -.Nm usm_first_user, -.Nm usm_next_user, -.Nm usm_find_user, -.Nm usm_new_user, -.Nm usm_delete_user, -.Nm usm_flush_users, -.Nm usm_user -.Nm snmpd_target_stat -.Nm bsnmpd_get_target_stats -.Nm target_first_address -.Nm target_next_address -.Nm target_new_address -.Nm target_activate_address -.Nm target_delete_address -.Nm target_first_param -.Nm target_next_param -.Nm target_new_param -.Nm target_delete_param -.Nm target_first_notify -.Nm target_next_notify -.Nm target_new_notify -.Nm target_delete_notify -.Nm target_flush_all -.Nm target_address -.Nm target_param +.Nm index_append_off , +.Nm snmpd_usmstats , +.Nm bsnmpd_get_usm_stats , +.Nm bsnmpd_reset_usm_stats , +.Nm usm_first_user , +.Nm usm_next_user , +.Nm usm_find_user , +.Nm usm_new_user , +.Nm usm_delete_user , +.Nm usm_flush_users , +.Nm usm_user , +.Nm snmpd_target_stat , +.Nm bsnmpd_get_target_stats , +.Nm target_first_address , +.Nm target_next_address , +.Nm target_new_address , +.Nm target_activate_address , +.Nm target_delete_address , +.Nm target_first_param , +.Nm target_next_param , +.Nm target_new_param , +.Nm target_delete_param , +.Nm target_first_notify , +.Nm target_next_notify , +.Nm target_new_notify , +.Nm target_delete_notify , +.Nm target_flush_all , +.Nm target_address , +.Nm target_param , .Nm target_notify .Nd "SNMP daemon loadable module interface" .Sh LIBRARY Modified: head/lib/libc/locale/isdigit.3 ============================================================================== --- head/lib/libc/locale/isdigit.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/locale/isdigit.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -36,7 +36,8 @@ .Dt ISDIGIT 3 .Os .Sh NAME -.Nm isdigit, isnumber +.Nm isdigit , +.Nm isnumber .Nd decimal-digit character test .Sh LIBRARY .Lb libc Modified: head/lib/libc/locale/isxdigit.3 ============================================================================== --- head/lib/libc/locale/isxdigit.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/locale/isxdigit.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -36,7 +36,8 @@ .Dt ISXDIGIT 3 .Os .Sh NAME -.Nm isxdigit, ishexnumber +.Nm isxdigit , +.Nm ishexnumber .Nd hexadecimal-digit character test .Sh LIBRARY .Lb libc Modified: head/lib/libc/stdio/printf.3 ============================================================================== --- head/lib/libc/stdio/printf.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/stdio/printf.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -36,8 +36,18 @@ .Dt PRINTF 3 .Os .Sh NAME -.Nm printf , fprintf , sprintf , snprintf , asprintf , dprintf , -.Nm vprintf , vfprintf, vsprintf , vsnprintf , vasprintf, vdprintf +.Nm printf , +.Nm fprintf , +.Nm sprintf , +.Nm snprintf , +.Nm asprintf , +.Nm dprintf , +.Nm vprintf , +.Nm vfprintf , +.Nm vsprintf , +.Nm vsnprintf , +.Nm vasprintf , +.Nm vdprintf .Nd formatted output conversion .Sh LIBRARY .Lb libc Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/stdlib/qsort.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -36,7 +36,13 @@ .Dt QSORT 3 .Os .Sh NAME -.Nm qsort , qsort_b , qsort_r , heapsort , heapsort_b , mergesort, mergesort_b +.Nm qsort , +.Nm qsort_b , +.Nm qsort_r , +.Nm heapsort , +.Nm heapsort_b , +.Nm mergesort , +.Nm mergesort_b .Nd sort functions .Sh LIBRARY .Lb libc Modified: head/lib/libc/string/strcpy.3 ============================================================================== --- head/lib/libc/string/strcpy.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/string/strcpy.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -36,7 +36,10 @@ .Dt STRCPY 3 .Os .Sh NAME -.Nm stpcpy, stpncpy, strcpy , strncpy +.Nm stpcpy , +.Nm stpncpy , +.Nm strcpy , +.Nm strncpy .Nd copy strings .Sh LIBRARY .Lb libc Modified: head/lib/libc/string/strlen.3 ============================================================================== --- head/lib/libc/string/strlen.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/string/strlen.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -36,7 +36,8 @@ .Dt STRLEN 3 .Os .Sh NAME -.Nm strlen, strnlen +.Nm strlen , +.Nm strnlen .Nd find length of string .Sh LIBRARY .Lb libc Modified: head/lib/libc/sys/fsync.2 ============================================================================== --- head/lib/libc/sys/fsync.2 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libc/sys/fsync.2 Tue Apr 17 09:05:46 2018 (r332642) @@ -38,7 +38,8 @@ .Dt FSYNC 2 .Os .Sh NAME -.Nm fdatasync, fsync +.Nm fdatasync , +.Nm fsync .Nd "synchronise changes to a file" .Sh LIBRARY .Lb libc Modified: head/lib/libufs/ufs_disk_close.3 ============================================================================== --- head/lib/libufs/ufs_disk_close.3 Tue Apr 17 02:33:54 2018 (r332641) +++ head/lib/libufs/ufs_disk_close.3 Tue Apr 17 09:05:46 2018 (r332642) @@ -15,7 +15,10 @@ .Dt UFS_DISK_CLOSE 3 .Os .Sh NAME -.Nm ufs_disk_close , ufs_disk_fillout , ufs_disk_fillout_blank, ufs_disk_write +.Nm ufs_disk_close , +.Nm ufs_disk_fillout , +.Nm ufs_disk_fillout_blank , +.Nm ufs_disk_write .Nd open and close userland UFS disks .Sh LIBRARY .Lb libufs Modified: head/share/man/man7/c99.7 ============================================================================== --- head/share/man/man7/c99.7 Tue Apr 17 02:33:54 2018 (r332641) +++ head/share/man/man7/c99.7 Tue Apr 17 09:05:46 2018 (r332642) @@ -27,7 +27,11 @@ .Dt C 7 .Os .Sh NAME -.Nm c, c78, c89, c90, c99 +.Nm c , +.Nm c78 , +.Nm c89 , +.Nm c90 , +.Nm c99 .Nd The C programming language .Sh DESCRIPTION C is a general purpose programming language, which has a strong connection Modified: head/share/man/man9/OF_device_from_xref.9 ============================================================================== --- head/share/man/man9/OF_device_from_xref.9 Tue Apr 17 02:33:54 2018 (r332641) +++ head/share/man/man9/OF_device_from_xref.9 Tue Apr 17 09:05:46 2018 (r332642) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm OF_device_from_xref , -.Nm OF_xref_from_device, +.Nm OF_xref_from_device , .Nm OF_device_register_xref .Nd "manage mappings between xrefs and devices" .Sh SYNOPSIS Modified: head/share/man/man9/printf.9 ============================================================================== --- head/share/man/man9/printf.9 Tue Apr 17 02:33:54 2018 (r332641) +++ head/share/man/man9/printf.9 Tue Apr 17 09:05:46 2018 (r332642) @@ -30,7 +30,10 @@ .Dt PRINTF 9 .Os .Sh NAME -.Nm printf , uprintf , tprintf, log +.Nm printf , +.Nm uprintf , +.Nm tprintf , +.Nm log .Nd formatted output conversion .Sh SYNOPSIS .In sys/types.h From owner-svn-src-head@freebsd.org Tue Apr 17 12:32:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D87EFA064E; Tue, 17 Apr 2018 12:32:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8B4C7E9A7; Tue, 17 Apr 2018 12:32:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w3HCWDWK076412 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Apr 2018 15:32:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3HCWDWK076412 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3HCWCw8076411; Tue, 17 Apr 2018 15:32:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 Apr 2018 15:32:12 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Julian Elischer , Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r332559 - head/usr.sbin/mountd Message-ID: <20180417123212.GM1774@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 12:32:25 -0000 On Tue, Apr 17, 2018 at 12:02:04AM +0000, Rick Macklem wrote: > I wrote: > >Julian Elischer wrote: > >>On 16/4/18 6:56 pm, Konstantin Belousov wrote: > >[stuff snipped] > >>>> + ngroups =3D XU_NGROUPS + 1; > >>> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? > >>valid question.. because that is how many are allocated? > >>it was a "minimally invasive patch".. whoever used XU_NGROUPS before > >>should have fixed it. > >>Having said that, thanks for drawing out attention to it.. will > >>probably fix. > >16 is the limit specified in the RFCs for Sun RPC, so that is the "on the wire" limit. > >I haven't looked at the code. It might make sense to handle more here and then > >set the limit at 16 after getting rid of duplicates, but I have no idea if = > >it matters? > > > >rick > Correcting my own post. Now that I've looked at the code, this doesn't go on > the wire. It does go in the exports structure, which means that this structure > would have to be revised (along with the syscall and VOP calls and the kernel > code that uses it). These credentials are for the "maproot/mapall" export > option and revising the export structure seems like quite a bit of work for this > case. (Until revised XU_NGROUPS is the correct value to set it to, since there > is a "struct xucred" in the exports structure.) > > Since Julian Elischer has been emailing me about adding a "fsid" export option > which allows /etc/exports to set the FSID of the exported fs (which would also > need to go in the exports structure), it might be about time to rev. the exports > structure? Probably yes, we would need a new variant of the nmount(2) syscall. Existing syscall should use the old layout for compatibility (we care about nmount and COMPAT32 as well). From owner-svn-src-head@freebsd.org Tue Apr 17 12:55:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16D11FA1B94; Tue, 17 Apr 2018 12:55:00 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA9C384712; Tue, 17 Apr 2018 12:54:59 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B15724D0B; Tue, 17 Apr 2018 12:54:59 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HCsxmm024354; Tue, 17 Apr 2018 12:54:59 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HCsxPx024349; Tue, 17 Apr 2018 12:54:59 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201804171254.w3HCsxPx024349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 17 Apr 2018 12:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332645 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 332645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 12:55:00 -0000 Author: gallatin Date: Tue Apr 17 12:54:58 2018 New Revision: 332645 URL: https://svnweb.freebsd.org/changeset/base/332645 Log: Make lagg creation more fault tolerant - Warn, don't exit, when SIOCSLAGGPORT returns an error. When we exit with an error during lagg creation, a single failed NIC (which no longer attaches) can prevent lagg creation and other configuration, such as adding an IPv4 address, and thus leave a machine unreachable. - Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT, in case scripts are looking for it. Hopefully this can be extended if other parts of ifconfig can allow a "soft" failure. - Improve the warning message to mention what lagg and what member are problematic. Reviewed by: jtl, glebius Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15046 Modified: head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifconfig.h head/sbin/ifconfig/ifgroup.c head/sbin/ifconfig/iflagg.c Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Tue Apr 17 12:52:30 2018 (r332644) +++ head/sbin/ifconfig/ifclone.c Tue Apr 17 12:54:58 2018 (r332645) @@ -181,7 +181,7 @@ static void clone_Copt_cb(const char *optarg __unused) { list_cloners(); - exit(0); + exit(exit_code); } static struct option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb }; Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Apr 17 12:52:30 2018 (r332644) +++ head/sbin/ifconfig/ifconfig.c Tue Apr 17 12:54:58 2018 (r332645) @@ -99,6 +99,7 @@ int printifname = 0; int supmedia = 0; int printkeys = 0; /* Print keying material for interfaces. */ +int exit_code = 0; /* Formatter Strings */ char *f_inet, *f_inet6, *f_ether, *f_addr; @@ -485,7 +486,7 @@ main(int argc, char *argv[]) errx(1, "%s: cloning name too long", ifname); ifconfig(argc, argv, 1, NULL); - exit(0); + exit(exit_code); } #ifdef JAIL /* @@ -499,7 +500,7 @@ main(int argc, char *argv[]) errx(1, "%s: interface name too long", ifname); ifconfig(argc, argv, 0, NULL); - exit(0); + exit(exit_code); } #endif errx(1, "interface %s does not exist", ifname); @@ -597,7 +598,7 @@ main(int argc, char *argv[]) freeifaddrs(ifap); freeformat(); - exit(0); + exit(exit_code); } static struct afswtch *afs = NULL; Modified: head/sbin/ifconfig/ifconfig.h ============================================================================== --- head/sbin/ifconfig/ifconfig.h Tue Apr 17 12:52:30 2018 (r332644) +++ head/sbin/ifconfig/ifconfig.h Tue Apr 17 12:54:58 2018 (r332645) @@ -136,6 +136,7 @@ extern int printkeys; extern int newaddr; extern int verbose; extern int printifname; +extern int exit_code; void setifcap(const char *, int value, int s, const struct afswtch *); Modified: head/sbin/ifconfig/ifgroup.c ============================================================================== --- head/sbin/ifconfig/ifgroup.c Tue Apr 17 12:52:30 2018 (r332644) +++ head/sbin/ifconfig/ifgroup.c Tue Apr 17 12:54:58 2018 (r332645) @@ -140,7 +140,7 @@ printgroup(const char *groupname) if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { if (errno == EINVAL || errno == ENOTTY || errno == ENOENT) - exit(0); + exit(exit_code); else err(1, "SIOCGIFGMEMB"); } @@ -159,7 +159,7 @@ printgroup(const char *groupname) } free(ifgr.ifgr_groups); - exit(0); + exit(exit_code); } static struct cmd group_cmds[] = { Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Tue Apr 17 12:52:30 2018 (r332644) +++ head/sbin/ifconfig/iflagg.c Tue Apr 17 12:54:58 2018 (r332645) @@ -41,9 +41,17 @@ setlaggport(const char *val, int d, int s, const struc strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname)); - /* Don't choke if the port is already in this lagg. */ - if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) - err(1, "SIOCSLAGGPORT"); + /* + * Do not exit with an error here. Doing so permits a + * failed NIC to take down an entire lagg. + * + * Don't error at all if the port is already in the lagg. + */ + if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) { + warnx("%s %s: SIOCSLAGGPORT: %s", + name, val, strerror(errno)); + exit_code = 1; + } } static void From owner-svn-src-head@freebsd.org Tue Apr 17 13:47:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ED8AFA4CC9; Tue, 17 Apr 2018 13:47:49 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0739270994; Tue, 17 Apr 2018 13:47:49 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl0-x242.google.com with SMTP id w12-v6so11099199plp.0; Tue, 17 Apr 2018 06:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:openpgp:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Pvm5yiIzcT/AyjHAODlI6YCdYAwjRZdMlXnNKO0g+XU=; b=ZA1u9F016L5AphpUutfa2NW0F11pIVArUgxms+57CLtmb6DJyCUKvBBvywPgWfnn0g iS+0TnEzPCytXl0sLNfx7BDOG1FXq+yeu10yf3FNii94Mktskw1hn1jbB2IWND1ff8jz GGaKnVmfDVzMnw7SFvmyNvebKhwTr9drTqBgUeBu0tqfga0mPtBA3/FYfX2m/PqM9urQ kS/5wIcUtgWsMBZbH2OR/Bcfc6GPCuqMTrX0Fa0e/oKsXWGLp3Dxh0pqZi66iBEgtlmG RnNRG50ZhLz4k+VQjay5EUrkuIhSw/KQsk2GdnrRHGu6iMNTlcm653kpdIe9HDs2wf0+ vMIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :openpgp:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Pvm5yiIzcT/AyjHAODlI6YCdYAwjRZdMlXnNKO0g+XU=; b=IuofoVql0GEe0M40BstF1MSnE84otT4rbKCaIA32HOPdlGdnSePWzDqLsazo6oyOW3 bv1kQU2LhT72Cd9gi84+4/XVTF9CSbAlxv5gPOnBR0fKNxBnIutFyaE7vJEvBgOk65Sp kVzbQWKhjmc82fOKqeAaEmYnlEORi/9l7rGyGMnpqDR5pdjeWp3zj7/zqdqnWokuMnYB cnOqOcMdqZZQu1093Q940tpcFO9mwIvAR1022h8BGdD5fjHTZJNASJVO0+96F6AAJztb 0fy4lVhpLLJGgeGcrHxhANZZv+XfzfjGjxDY9d5BsnsaxfKLKOZC9J9yEuQLGABXTF4/ 5bcg== X-Gm-Message-State: ALQs6tBS3Fmrv9Zl91f2ZEEBKblYDk3c/ZzR8S7s/n63VXSoIdvOWwd2 eMeHhDtsAqAighjY/qSc5Kx+lcV2 X-Google-Smtp-Source: AIpwx49nv4pdDoDqN2GHkra1TsLFTLz/P00N4/Tw1do7sNhq/Yo8pKEviLvTK4gKp+Eki22Dan5/bg== X-Received: by 2002:a17:902:8f95:: with SMTP id z21-v6mr2126931plo.304.1523972867822; Tue, 17 Apr 2018 06:47:47 -0700 (PDT) Received: from [192.168.1.135] (7.69.220.111.sta.wbroadband.net.au. [111.220.69.7]) by smtp.gmail.com with ESMTPSA id f69sm20256257pgc.27.2018.04.17.06.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 06:47:47 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r332645 - head/sbin/ifconfig To: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804171254.w3HCsxPx024349@repo.freebsd.org> From: Kubilay Kocak Openpgp: preference=signencrypt Message-ID: Date: Tue, 17 Apr 2018 23:47:19 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201804171254.w3HCsxPx024349@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 13:47:49 -0000 On 17/04/2018 10:54 pm, Andrew Gallatin wrote: > Author: gallatin > Date: Tue Apr 17 12:54:58 2018 > New Revision: 332645 > URL: https://svnweb.freebsd.org/changeset/base/332645 > > Log: > Make lagg creation more fault tolerant > > - Warn, don't exit, when SIOCSLAGGPORT returns an error. > > When we exit with an error during lagg creation, a single > failed NIC (which no longer attaches) can prevent lagg > creation and other configuration, such as adding an IPv4 > address, and thus leave a machine unreachable. > > - Preserve non-EEXISTS errors for exit status from SIOCSLAGGPORT, > in case scripts are looking for it. Hopefully this can be > extended if other parts of ifconfig can allow a "soft" failure. > > - Improve the warning message to mention what lagg and what > member are problematic. > > Reviewed by: jtl, glebius > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D15046 MFC please? > Modified: > head/sbin/ifconfig/ifclone.c > head/sbin/ifconfig/ifconfig.c > head/sbin/ifconfig/ifconfig.h > head/sbin/ifconfig/ifgroup.c > head/sbin/ifconfig/iflagg.c > > Modified: head/sbin/ifconfig/ifclone.c > ============================================================================== > --- head/sbin/ifconfig/ifclone.c Tue Apr 17 12:52:30 2018 (r332644) > +++ head/sbin/ifconfig/ifclone.c Tue Apr 17 12:54:58 2018 (r332645) > @@ -181,7 +181,7 @@ static void > clone_Copt_cb(const char *optarg __unused) > { > list_cloners(); > - exit(0); > + exit(exit_code); > } > static struct option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb }; > > > Modified: head/sbin/ifconfig/ifconfig.c > ============================================================================== > --- head/sbin/ifconfig/ifconfig.c Tue Apr 17 12:52:30 2018 (r332644) > +++ head/sbin/ifconfig/ifconfig.c Tue Apr 17 12:54:58 2018 (r332645) > @@ -99,6 +99,7 @@ int printifname = 0; > > int supmedia = 0; > int printkeys = 0; /* Print keying material for interfaces. */ > +int exit_code = 0; > > /* Formatter Strings */ > char *f_inet, *f_inet6, *f_ether, *f_addr; > @@ -485,7 +486,7 @@ main(int argc, char *argv[]) > errx(1, "%s: cloning name too long", > ifname); > ifconfig(argc, argv, 1, NULL); > - exit(0); > + exit(exit_code); > } > #ifdef JAIL > /* > @@ -499,7 +500,7 @@ main(int argc, char *argv[]) > errx(1, "%s: interface name too long", > ifname); > ifconfig(argc, argv, 0, NULL); > - exit(0); > + exit(exit_code); > } > #endif > errx(1, "interface %s does not exist", ifname); > @@ -597,7 +598,7 @@ main(int argc, char *argv[]) > freeifaddrs(ifap); > > freeformat(); > - exit(0); > + exit(exit_code); > } > > static struct afswtch *afs = NULL; > > Modified: head/sbin/ifconfig/ifconfig.h > ============================================================================== > --- head/sbin/ifconfig/ifconfig.h Tue Apr 17 12:52:30 2018 (r332644) > +++ head/sbin/ifconfig/ifconfig.h Tue Apr 17 12:54:58 2018 (r332645) > @@ -136,6 +136,7 @@ extern int printkeys; > extern int newaddr; > extern int verbose; > extern int printifname; > +extern int exit_code; > > void setifcap(const char *, int value, int s, const struct afswtch *); > > > Modified: head/sbin/ifconfig/ifgroup.c > ============================================================================== > --- head/sbin/ifconfig/ifgroup.c Tue Apr 17 12:52:30 2018 (r332644) > +++ head/sbin/ifconfig/ifgroup.c Tue Apr 17 12:54:58 2018 (r332645) > @@ -140,7 +140,7 @@ printgroup(const char *groupname) > if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { > if (errno == EINVAL || errno == ENOTTY || > errno == ENOENT) > - exit(0); > + exit(exit_code); > else > err(1, "SIOCGIFGMEMB"); > } > @@ -159,7 +159,7 @@ printgroup(const char *groupname) > } > free(ifgr.ifgr_groups); > > - exit(0); > + exit(exit_code); > } > > static struct cmd group_cmds[] = { > > Modified: head/sbin/ifconfig/iflagg.c > ============================================================================== > --- head/sbin/ifconfig/iflagg.c Tue Apr 17 12:52:30 2018 (r332644) > +++ head/sbin/ifconfig/iflagg.c Tue Apr 17 12:54:58 2018 (r332645) > @@ -41,9 +41,17 @@ setlaggport(const char *val, int d, int s, const struc > strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); > strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname)); > > - /* Don't choke if the port is already in this lagg. */ > - if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) > - err(1, "SIOCSLAGGPORT"); > + /* > + * Do not exit with an error here. Doing so permits a > + * failed NIC to take down an entire lagg. > + * > + * Don't error at all if the port is already in the lagg. > + */ > + if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) { > + warnx("%s %s: SIOCSLAGGPORT: %s", > + name, val, strerror(errno)); > + exit_code = 1; > + } > } > > static void > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Apr 17 15:29:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5009AF83CBD; Tue, 17 Apr 2018 15:29:33 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2CE287F54; Tue, 17 Apr 2018 15:29:32 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECA8C6575; Tue, 17 Apr 2018 15:29:32 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HFTWja000724; Tue, 17 Apr 2018 15:29:32 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HFTWER000722; Tue, 17 Apr 2018 15:29:32 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201804171529.w3HFTWER000722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Tue, 17 Apr 2018 15:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332646 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 332646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 15:29:33 -0000 Author: ram Date: Tue Apr 17 15:29:32 2018 New Revision: 332646 URL: https://svnweb.freebsd.org/changeset/base/332646 Log: Moved opts-stack.h include before all other includes. PR: 227446 Approved by: ken MFC after: 3 days Modified: head/sys/dev/ocs_fc/ocs_os.c head/sys/dev/ocs_fc/ocs_os.h Modified: head/sys/dev/ocs_fc/ocs_os.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_os.c Tue Apr 17 12:54:58 2018 (r332645) +++ head/sys/dev/ocs_fc/ocs_os.c Tue Apr 17 15:29:32 2018 (r332646) @@ -37,10 +37,6 @@ */ #include "ocs.h" -#include "opt_stack.h" -#include -#include -#include /* for debug of memory allocations */ static MALLOC_DEFINE(M_OCS, "OCS", "OneCore Storage data"); Modified: head/sys/dev/ocs_fc/ocs_os.h ============================================================================== --- head/sys/dev/ocs_fc/ocs_os.h Tue Apr 17 12:54:58 2018 (r332645) +++ head/sys/dev/ocs_fc/ocs_os.h Tue Apr 17 15:29:32 2018 (r332646) @@ -39,11 +39,11 @@ #ifndef _OCS_OS_H #define _OCS_OS_H -typedef struct ocs_softc ocs_t; - /*************************************************************************** * OS specific includes */ +#include "opt_stack.h" + #include #include #include @@ -78,6 +78,8 @@ typedef struct ocs_softc ocs_t; #include #include +#include /* for debug of memory allocations */ + /* OCS_OS_MAX_ISR_TIME_MSEC - maximum time driver code should spend in an interrupt * or kernel thread context without yielding */ @@ -151,6 +153,8 @@ typedef struct ocs_softc ocs_t; /*************************************************************************** * Platform specific operations */ + +typedef struct ocs_softc ocs_t; /** * @ingroup os From owner-svn-src-head@freebsd.org Tue Apr 17 15:30:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0145CF83F1E for ; Tue, 17 Apr 2018 15:30:56 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5789B68551 for ; Tue, 17 Apr 2018 15:30:55 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: by mail-lf0-x231.google.com with SMTP id r7-v6so20863340lfr.1 for ; Tue, 17 Apr 2018 08:30:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qqy5m6I7x4BzoeoU3YEaXxk3tPlhW+o/SOhUDn+SOko=; b=BAHA9LCBDa0vtUEVpSRPeCy9IxjYOMMKppnldK1N3t/B+P35rORqHe6VZzVLI/NdzO J8g7sAEdU3dmRhClkiMPz3TmJrnSxeNBZCO/u2IBgKKkqMkK8VUOXuqwsntc/cyuO7rT kzqZFpLU1SCB5lFwGcqhS7e14f4DtJPuRKRjockKTNSbt24N3UAi/+0midwYP3KZCpgy BLn+rEfV5bYsRd1Fj/1tCOqwy2LfFsKfy7/hBKmUGlym1Q5Qdd5gV/VzO61NqFYRvRJF JcrjtHu3OCMnnDdIAP2nhQn2Gfe6fsbgMAOuEo8DuekpznqjI323EkEGcpbV0V23y7Js GdnQ== X-Gm-Message-State: ALQs6tDHrI4dySR0PDyH3ODzYoVAN+n7O1vKo96AB6paXk0NyVd/PvfT EZBk8U3JoqR5vFpHaj+GnFxDQDIXECurEDlHp9Tz+A== X-Google-Smtp-Source: AIpwx4/0iwow87UUeBMSEEvT/8ywSBHINslb2PX+iTfBE39uNGGBPfi4/80Oi1SV4geXfzeWyJ8b3feqxbVlrT8ZMBw= X-Received: by 2002:a19:9b08:: with SMTP id d8-v6mr2053218lfe.66.1523979053708; Tue, 17 Apr 2018 08:30:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.134.205 with HTTP; Tue, 17 Apr 2018 08:30:53 -0700 (PDT) In-Reply-To: References: <201804131331.w3DDVKod044086@repo.freebsd.org> From: Ram Kishore Vegesna Date: Tue, 17 Apr 2018 21:00:53 +0530 Message-ID: Subject: Re: svn commit: r332471 - head/sys/dev/ocs_fc To: Oliver Pinter Cc: Ram Kishore Vegesna , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Bruce Evans Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 15:30:56 -0000 Thanks Oliver, For pointing the issue. Checked in the change. -Ram On Sat, Apr 14, 2018 at 3:32 AM, Oliver Pinter < oliver.pinter@hardenedbsd.org> wrote: > > > On Friday, April 13, 2018, Ram Kishore Vegesna wrote: > >> Author: ram >> Date: Fri Apr 13 13:31:20 2018 >> New Revision: 332471 >> URL: https://svnweb.freebsd.org/changeset/base/332471 >> >> Log: >> Check if STACK is defined before using the stack(9). >> >> PR: 227446 >> Reported by: emaste >> Approved by: ken >> >> Modified: >> head/sys/dev/ocs_fc/ocs_os.c >> >> Modified: head/sys/dev/ocs_fc/ocs_os.c >> ============================================================ >> ================== >> --- head/sys/dev/ocs_fc/ocs_os.c Fri Apr 13 13:23:31 2018 >> (r332470) >> +++ head/sys/dev/ocs_fc/ocs_os.c Fri Apr 13 13:31:20 2018 >> (r332471) >> @@ -37,6 +37,7 @@ >> */ >> >> #include "ocs.h" >> +#include "opt_stack.h" > > > These types of includes - where you includes opts - should go before any > other includes. > > > >> #include >> #include >> #include /* for debug of memory >> allocations */ >> @@ -855,11 +856,13 @@ void ocs_intr_enable(ocs_os_handle_t os) >> >> void ocs_print_stack(void) >> { >> +#if defined(STACK) >> struct stack st; >> >> stack_zero(&st); >> stack_save(&st); >> stack_print(&st); >> +#endif >> } >> >> void ocs_abort(void) >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> > From owner-svn-src-head@freebsd.org Tue Apr 17 15:44:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A383EF84E80; Tue, 17 Apr 2018 15:44:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC416BA17; Tue, 17 Apr 2018 15:44:06 +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 4898668B1; Tue, 17 Apr 2018 15:44:06 +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 w3HFi6rp010437; Tue, 17 Apr 2018 15:44:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HFi6CN010436; Tue, 17 Apr 2018 15:44:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804171544.w3HFi6CN010436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Apr 2018 15:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332648 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 332648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 15:44:06 -0000 Author: imp Date: Tue Apr 17 15:44:05 2018 New Revision: 332648 URL: https://svnweb.freebsd.org/changeset/base/332648 Log: Restore db_radix on parse error, otherwise we'll silently change it to 10 on a botched trace command. Modified: head/sys/ddb/db_command.c Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Tue Apr 17 15:34:08 2018 (r332647) +++ head/sys/ddb/db_command.c Tue Apr 17 15:44:05 2018 (r332648) @@ -812,6 +812,7 @@ db_stack_trace(db_expr_t tid, bool hastid, db_expr_t c if (!db_expression(&count)) { db_printf("Count missing\n"); db_flush_lex(); + db_radix = radix; return; } } else { From owner-svn-src-head@freebsd.org Tue Apr 17 15:51:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E50E5F857B3; Tue, 17 Apr 2018 15:51:23 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A5176E6D5; Tue, 17 Apr 2018 15:51:23 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id B0876270033F; Tue, 17 Apr 2018 11:51:16 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu B0876270033F Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1523980276; bh=zLbM8/P/Tyr1sWGDjJE1DfTnqcSsytSm2eDOAQrc2YQ=; h=Subject:To:From:Date:From; b=VI/oiQ2c9Ej7ULpIliaDBRRPLaYboSLjLquuniS5XtV2I0k5KMqMvRJ+bdvcAfUR1 W35IdWHY59yImaXEOGJEzPq7QzgX6dn7/r34Q4VBiIfQKEe00JEKyr+yO0bTWiQIEW G+X286WddJyNwgMvgxAMHodwUnekeiHHf7m2iZnQvOhm2wO0O5c0ipl1c8f94/CuJu sQpYe2KkbTWBhkeQqNeZCz1ApK2I3z10N7/BWQjNqHqz0Yn/5eZLr2nGoQFnDjzhag 0JRBLE4nwSMNz4VRasZ83OgL+gGVLBxa0tnTkNQLnPMtQZqchxcL/Y8zleiNzOG53e uVjJuC4eNTm/Q== Subject: Re: svn commit: r332645 - head/sbin/ifconfig To: koobs@FreeBSD.org, Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804171254.w3HCsxPx024349@repo.freebsd.org> From: Andrew Gallatin Message-ID: <22c7ff19-f835-c892-69a8-015e7797c08a@cs.duke.edu> Date: Tue, 17 Apr 2018 11:51:15 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 15:51:24 -0000 On 04/17/18 09:47, Kubilay Kocak wrote: >> Log: >> Make lagg creation more fault tolerant >> <...> > > MFC please? > <..> Hmm.. I intentionally did not mark it for MFC, for 2 reasons. I don't run -stable, and I hate to MFC something when I haven't run it. And I'm also worried because it changes (undocumented) ifconfig failure behavior, which I think is more objectionable in -stable than in head. If somebody else would like to MFC it, I certainly would not object. Drew From owner-svn-src-head@freebsd.org Tue Apr 17 16:21:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C671F87A41; Tue, 17 Apr 2018 16:21:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D50875654; Tue, 17 Apr 2018 16:21:24 +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 26BE86DCC; Tue, 17 Apr 2018 16:21:24 +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 w3HGLOQi028638; Tue, 17 Apr 2018 16:21:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HGLOuE028637; Tue, 17 Apr 2018 16:21:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804171621.w3HGLOuE028637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Apr 2018 16:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332649 - head/lib/clang/include/lld/Common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/clang/include/lld/Common X-SVN-Commit-Revision: 332649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 16:21:24 -0000 Author: emaste Date: Tue Apr 17 16:21:23 2018 New Revision: 332649 URL: https://svnweb.freebsd.org/changeset/base/332649 Log: lld: add a __FreeBSD_version-style identifier to version This will faciliate a WITH_SYSTEM_LINKER option. Reviewed by: dim MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15110 Modified: head/lib/clang/include/lld/Common/Version.inc Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Tue Apr 17 15:44:05 2018 (r332648) +++ head/lib/clang/include/lld/Common/Version.inc Tue Apr 17 16:21:23 2018 (r332649) @@ -4,5 +4,7 @@ #define LLD_VERSION_STRING "6.0.0" #define LLD_VERSION_MAJOR 6 #define LLD_VERSION_MINOR 0 -#define LLD_REVISION_STRING "326565" + #define LLD_REPOSITORY_STRING "FreeBSD" +// - +#define LLD_REVISION_STRING "326565-120001" From owner-svn-src-head@freebsd.org Tue Apr 17 16:36:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 832E1F88C31; Tue, 17 Apr 2018 16:36:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 310FE7938A; Tue, 17 Apr 2018 16:36:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DCC170BB; Tue, 17 Apr 2018 16:36:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HGar97035762; Tue, 17 Apr 2018 16:36:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HGarpw035761; Tue, 17 Apr 2018 16:36:53 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804171636.w3HGarpw035761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 17 Apr 2018 16:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332650 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 16:36:54 -0000 Author: brooks Date: Tue Apr 17 16:36:53 2018 New Revision: 332650 URL: https://svnweb.freebsd.org/changeset/base/332650 Log: Stop using fuswintr() and suswintr() in the profiler. Always take the AST path rather than calling MD functions which are often implemented as always failing. The is the case on amd64, arm, i386, and powerpc. This optimization (inherited from 4.4 Lite) is a pessimization on those architectures and is the sole use of these functions. They will be removed in a seperate commit. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15101 Modified: head/sys/kern/subr_prof.c Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Tue Apr 17 16:21:23 2018 (r332649) +++ head/sys/kern/subr_prof.c Tue Apr 17 16:36:53 2018 (r332650) @@ -447,10 +447,9 @@ sys_profil(struct thread *td, struct profil_args *uap) /* * Collect user-level profiling statistics; called on a profiling tick, * when a process is running in user-mode. This routine may be called - * from an interrupt context. We try to update the user profiling buffers - * cheaply with fuswintr() and suswintr(). If that fails, we revert to - * an AST that will vector us to trap() with a context in which copyin - * and copyout will work. Trap will then call addupc_task(). + * from an interrupt context. We perform the update with an AST + * that will vector us to trap() with a context in which copyin and + * copyout will work. Trap will then call addupc_task(). * * Note that we may (rarely) not get around to the AST soon enough, and * lose profile ticks when the next tick overwrites this one, but in this @@ -461,35 +460,28 @@ void addupc_intr(struct thread *td, uintfptr_t pc, u_int ticks) { struct uprof *prof; - caddr_t addr; - u_int i; - int v; if (ticks == 0) return; prof = &td->td_proc->p_stats->p_prof; PROC_PROFLOCK(td->td_proc); - if (pc < prof->pr_off || - (i = PC_TO_INDEX(pc, prof)) >= prof->pr_size) { + if (pc < prof->pr_off || PC_TO_INDEX(pc, prof) >= prof->pr_size) { PROC_PROFUNLOCK(td->td_proc); return; /* out of range; ignore */ } - addr = prof->pr_base + i; PROC_PROFUNLOCK(td->td_proc); - if ((v = fuswintr(addr)) == -1 || suswintr(addr, v + ticks) == -1) { - td->td_profil_addr = pc; - td->td_profil_ticks = ticks; - td->td_pflags |= TDP_OWEUPC; - thread_lock(td); - td->td_flags |= TDF_ASTPENDING; - thread_unlock(td); - } + td->td_profil_addr = pc; + td->td_profil_ticks = ticks; + td->td_pflags |= TDP_OWEUPC; + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); } /* - * Much like before, but we can afford to take faults here. If the - * update fails, we simply turn off profiling. + * Actually update the profiling statistics. If the update fails, we + * simply turn off profiling. */ void addupc_task(struct thread *td, uintfptr_t pc, u_int ticks) From owner-svn-src-head@freebsd.org Tue Apr 17 16:46:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4601DF89640; Tue, 17 Apr 2018 16:46:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA8C87C161; Tue, 17 Apr 2018 16:46:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E534E7257; Tue, 17 Apr 2018 16:46:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HGk1iZ040593; Tue, 17 Apr 2018 16:46:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HGk1CY040592; Tue, 17 Apr 2018 16:46:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804171646.w3HGk1CY040592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Apr 2018 16:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332651 - head/sys/dev/bce X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bce X-SVN-Commit-Revision: 332651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 16:46:02 -0000 Author: imp Date: Tue Apr 17 16:46:01 2018 New Revision: 332651 URL: https://svnweb.freebsd.org/changeset/base/332651 Log: Add PNP info to the bce driver. Submitted by: Lakhan Shiva Kamireddy Pull Request: https://github.com/freebsd/freebsd/pull/136 Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue Apr 17 16:36:53 2018 (r332650) +++ head/sys/dev/bce/if_bce.c Tue Apr 17 16:46:01 2018 (r332651) @@ -529,7 +529,8 @@ MODULE_DEPEND(bce, miibus, 1, 1, 1); DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL); DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL); - +MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, bce, + bce_devs, sizeof(bce_devs[0]), nitems(bce_devs) - 1); /****************************************************************************/ /* Tunable device values */ From owner-svn-src-head@freebsd.org Tue Apr 17 16:46:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B3BFF89686; Tue, 17 Apr 2018 16:46:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3120B7C24B; Tue, 17 Apr 2018 16:46: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 947E97258; Tue, 17 Apr 2018 16:46:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HGk9FD040649; Tue, 17 Apr 2018 16:46:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HGk9vn040646; Tue, 17 Apr 2018 16:46:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804171646.w3HGk9vn040646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Apr 2018 16:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332652 - in head/sys: conf dev/puc modules/puc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/puc modules/puc X-SVN-Commit-Revision: 332652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 16:46:11 -0000 Author: imp Date: Tue Apr 17 16:46:08 2018 New Revision: 332652 URL: https://svnweb.freebsd.org/changeset/base/332652 Log: Add PNP info to the PCI attahement of the puc driver. Adjust sys/conf/files and sys/modules/puc/Makefile to omit pucdata.c now tht it's included by puc_pci.c. Submitted by: Lakhan Shiva Kamireddy (with build fixes by me) Pull Request: https://github.com/freebsd/freebsd/pull/136 Modified: head/sys/conf/files head/sys/dev/puc/puc_pci.c head/sys/modules/puc/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 17 16:46:01 2018 (r332651) +++ head/sys/conf/files Tue Apr 17 16:46:08 2018 (r332652) @@ -2771,7 +2771,6 @@ dev/puc/puc.c optional puc dev/puc/puc_cfg.c optional puc dev/puc/puc_pccard.c optional puc pccard dev/puc/puc_pci.c optional puc pci -dev/puc/pucdata.c optional puc pci dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral Modified: head/sys/dev/puc/puc_pci.c ============================================================================== --- head/sys/dev/puc/puc_pci.c Tue Apr 17 16:46:01 2018 (r332651) +++ head/sys/dev/puc/puc_pci.c Tue Apr 17 16:46:08 2018 (r332652) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static int puc_msi_disable; SYSCTL_INT(_hw_puc, OID_AUTO, msi_disable, CTLFLAG_RDTUN, @@ -198,3 +199,5 @@ static driver_t puc_pci_driver = { }; DRIVER_MODULE(puc, pci, puc_pci_driver, puc_devclass, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, puc, + puc_pci_devices, sizeof(puc_pci_devices[0]), nitems(puc_pci_devices) - 1); Modified: head/sys/modules/puc/Makefile ============================================================================== --- head/sys/modules/puc/Makefile Tue Apr 17 16:46:01 2018 (r332651) +++ head/sys/modules/puc/Makefile Tue Apr 17 16:46:08 2018 (r332652) @@ -4,7 +4,7 @@ .PATH: ${SRCTOP}/sys/dev/puc KMOD= puc -SRCS= puc.c puc_cfg.c puc_pci.c puc_pccard.c pucdata.c +SRCS= puc.c puc_cfg.c puc_pci.c puc_pccard.c SRCS+= bus_if.h device_if.h serdev_if.c serdev_if.h \ card_if.h pci_if.h From owner-svn-src-head@freebsd.org Tue Apr 17 16:51:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62F1BF89C64; Tue, 17 Apr 2018 16:51:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1276C7C621; Tue, 17 Apr 2018 16:51:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7BD172BF; Tue, 17 Apr 2018 16:51:27 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HGpRe8044157; Tue, 17 Apr 2018 16:51:27 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HGpRbj044156; Tue, 17 Apr 2018 16:51:27 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201804171651.w3HGpRbj044156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 17 Apr 2018 16:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332653 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 332653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 16:51:28 -0000 Author: gallatin Date: Tue Apr 17 16:51:27 2018 New Revision: 332653 URL: https://svnweb.freebsd.org/changeset/base/332653 Log: Restore SIOCGI2C functionality to ixgbe When ixgbe was converted to iflib, it lost the SIOCGI2C support that allows ifconfig to print SFP state, optical light levels, etc. Restore this by plugging in to the ifdi_i2c_req iflib method. Note that the sanity checking on dev_addr that used to be done in ixgbe is now done in iflib. Reviewed by: erj, Matthew Macy Sponsored by: Netflix Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Apr 17 16:46:08 2018 (r332652) +++ head/sys/dev/ixgbe/if_ix.c Tue Apr 17 16:51:27 2018 (r332653) @@ -137,7 +137,7 @@ static void ixgbe_if_timer(if_ctx_t ctx, uint16_t); static void ixgbe_if_update_admin_status(if_ctx_t ctx); static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag); static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag); - +static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); int ixgbe_intr(void *arg); /************************************************************************ @@ -270,6 +270,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_vlan_register, ixgbe_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), + DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1232,6 +1233,25 @@ ixgbe_if_get_counter(if_ctx_t ctx, ift_counter cnt) } /* ixgbe_if_get_counter */ /************************************************************************ + * ixgbe_if_i2c_req + ************************************************************************/ +static int +ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct ixgbe_hw *hw = &adapter->hw; + int i; + + + if (hw->phy.ops.read_i2c_byte == NULL) + return (ENXIO); + for (i = 0; i < req->len; i++) + hw->phy.ops.read_i2c_byte(hw, req->offset + i, + req->dev_addr, &req->data[i]); + return (0); +} /* ixgbe_if_i2c_req */ + +/************************************************************************ * ixgbe_add_media_types ************************************************************************/ static void @@ -4547,4 +4567,3 @@ ixgbe_check_fan_failure(struct adapter *adapter, u32 r if (reg & mask) device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n"); } /* ixgbe_check_fan_failure */ - From owner-svn-src-head@freebsd.org Tue Apr 17 17:20:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0AF5F8B929; Tue, 17 Apr 2018 17:20:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2F984EA6; Tue, 17 Apr 2018 17:20:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 151337767; Tue, 17 Apr 2018 17:20:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HHK4N8056655; Tue, 17 Apr 2018 17:20:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HHK4rB056652; Tue, 17 Apr 2018 17:20:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804171720.w3HHK4rB056652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 17 Apr 2018 17:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332654 - in head: share/man/man9 sys/arm/arm sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: share/man/man9 sys/arm/arm sys/mips/mips X-SVN-Commit-Revision: 332654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 17:20:07 -0000 Author: brooks Date: Tue Apr 17 17:20:04 2018 New Revision: 332654 URL: https://svnweb.freebsd.org/changeset/base/332654 Log: Remove unused implementations of copyoutstr(). Also remove the commented out documentation. The documentation arrived with the import of the copy.9 manpage. I suspect the implementations came from NetBSD while bootstrapping the Arm and MIPS ports. Reviewed by: andrew, jmallett Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15108 Modified: head/share/man/man9/copy.9 head/sys/arm/arm/copystr.S head/sys/mips/mips/support.S Modified: head/share/man/man9/copy.9 ============================================================================== --- head/share/man/man9/copy.9 Tue Apr 17 16:51:27 2018 (r332653) +++ head/share/man/man9/copy.9 Tue Apr 17 17:20:04 2018 (r332654) @@ -61,8 +61,6 @@ .Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done" .Ft int .Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done" -.\" .Ft int -.\" .Fn copyoutstr "const void *kaddr" "void *uaddr" "size_t len" "size_t *done" .Sh DESCRIPTION The .Nm @@ -135,15 +133,6 @@ NUL, is returned in .Fa done is .No non- Ns Dv NULL ) . -.\" .It Fn copyoutstr -.\" Copies a NUL-terminated string, at most -.\" bytes long, from kernel-space address -.\" .Fa kaddr -.\" to user-space address -.\" .Fa uaddr . -.\" The number of bytes actually copied, including the terminating -.\" NUL, is returned in -.\" .Fa *done . .Sh RETURN VALUES The .Nm @@ -164,9 +153,6 @@ The .Fn copystr and .Fn copyinstr -.\" .Fn copyinstr , -.\" and -.\" .Fn copyoutstr functions return .Er ENAMETOOLONG if the string is longer than Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Tue Apr 17 16:51:27 2018 (r332653) +++ head/sys/arm/arm/copystr.S Tue Apr 17 17:20:04 2018 (r332654) @@ -149,59 +149,6 @@ ENTRY(copyinstr) RET END(copyinstr) -/* - * r0 - kernel space address - * r1 - user space address - * r2 - maxlens - * r3 - lencopied - * - * Copy string from kernel space to user space - */ -ENTRY(copyoutstr) - SAVE_REGS - - teq r2, #0x00000000 - mov r6, #0x00000000 - moveq r0, #ENAMETOOLONG - beq 2f - - ldr r12, =VM_MAXUSER_ADDRESS - - GET_PCB(r4) - ldr r4, [r4] - -#ifdef DIAGNOSTIC - teq r4, #0x00000000 - beq .Lcopystrpcbfault -#endif - - adr r5, .Lcopystrfault - str r5, [r4, #PCB_ONFAULT] - -1: - cmp r0, r12 - bcs .Lcopystrfault - ldrb r5, [r0], #0x0001 - add r6, r6, #0x00000001 - teq r5, #0x00000000 - strbt r5, [r1], #0x0001 - teqne r6, r2 - bne 1b - - mov r0, #0x00000000 - str r0, [r4, #PCB_ONFAULT] - - teq r5, #0x00000000 - moveq r0, #0x00000000 - movne r0, #ENAMETOOLONG - -2: teq r3, #0x00000000 - strne r6, [r3] - - RESTORE_REGS - RET -END(copyoutstr) - /* A fault occurred during the copy */ .Lcopystrfault: mov r1, #0x00000000 Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Tue Apr 17 16:51:27 2018 (r332653) +++ head/sys/mips/mips/support.S Tue Apr 17 17:20:04 2018 (r332654) @@ -162,34 +162,6 @@ NESTED(copyinstr, CALLFRAME_SIZ, ra) END(copyinstr) /* - * Copy a null terminated string from the kernel address space into - * the user address space. - * - * copyoutstr(fromaddr, toaddr, maxlength, &lencopied) - * caddr_t fromaddr; - * caddr_t toaddr; - * u_int maxlength; - * u_int *lencopied; - */ -NESTED(copyoutstr, CALLFRAME_SIZ, ra) - PTR_SUBU sp, sp, CALLFRAME_SIZ - .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - PTR_LA v0, copyerr - blt a1, zero, _C_LABEL(copyerr) # make sure address is in user space - REG_S ra, CALLFRAME_RA(sp) - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - jal _C_LABEL(copystr) - PTR_S v0, U_PCB_ONFAULT(v1) - REG_L ra, CALLFRAME_RA(sp) - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S zero, U_PCB_ONFAULT(v1) - j ra - PTR_ADDU sp, sp, CALLFRAME_SIZ -END(copyoutstr) - -/* * Copy specified amount of data from user space into the kernel * copyin(from, to, len) * caddr_t *from; (user source address) From owner-svn-src-head@freebsd.org Tue Apr 17 17:23:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA26F8BE57; Tue, 17 Apr 2018 17:23:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A56E853C2; Tue, 17 Apr 2018 17:23:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9557E7900; Tue, 17 Apr 2018 17:23:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HHNlAC061166; Tue, 17 Apr 2018 17:23:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HHNlaA061165; Tue, 17 Apr 2018 17:23:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804171723.w3HHNlaA061165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 17 Apr 2018 17:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332655 - head/lib/libmd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libmd X-SVN-Commit-Revision: 332655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 17:23:48 -0000 Author: cem Date: Tue Apr 17 17:23:47 2018 New Revision: 332655 URL: https://svnweb.freebsd.org/changeset/base/332655 Log: libmd: Remove trailing whitespace from mdXhl.c No functional change. Reported by: me, in a CR from three years ago today Sponsored by: Dell EMC Isilon Modified: head/lib/libmd/mdXhl.c Modified: head/lib/libmd/mdXhl.c ============================================================================== --- head/lib/libmd/mdXhl.c Tue Apr 17 17:20:04 2018 (r332654) +++ head/lib/libmd/mdXhl.c Tue Apr 17 17:23:47 2018 (r332655) @@ -79,11 +79,11 @@ MDXFdChunk(int fd, char *buf, off_t ofs, off_t len) readrv = read(fd, buffer, sizeof(buffer)); else readrv = read(fd, buffer, remain); - if (readrv <= 0) + if (readrv <= 0) break; MDXUpdate(&ctx, buffer, readrv); remain -= readrv; - } + } error: if (readrv < 0) return NULL; From owner-svn-src-head@freebsd.org Tue Apr 17 18:04:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E37F8E825; Tue, 17 Apr 2018 18:04:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 734706D4EC; Tue, 17 Apr 2018 18:04:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E2A27F56; Tue, 17 Apr 2018 18:04:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HI4UeL080894; Tue, 17 Apr 2018 18:04:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HI4SO1080878; Tue, 17 Apr 2018 18:04:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804171804.w3HI4SO1080878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 17 Apr 2018 18:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332656 - in head: . share/man/man9 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/i386/i386 sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man9 sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/i386/i386 sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sparc64/sparc64 sys/sys X-SVN-Commit-Revision: 332656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 18:04:31 -0000 Author: brooks Date: Tue Apr 17 18:04:28 2018 New Revision: 332656 URL: https://svnweb.freebsd.org/changeset/base/332656 Log: Remove the unused fuwintr() and suiwintr() functions. Half of implementations always failed (returned (-1)) and they were previously used in only one place. Reviewed by: kib, andrew Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15102 Deleted: head/sys/powerpc/powerpc/fuswintr.c head/sys/powerpc/powerpc/suswintr.c Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/fetch.9 head/share/man/man9/store.9 head/sys/amd64/amd64/support.S head/sys/arm/arm/fusu.S head/sys/arm64/arm64/support.S head/sys/arm64/arm64/trap.c head/sys/conf/files.powerpc head/sys/i386/i386/support.s head/sys/mips/mips/support.S head/sys/mips/mips/trap.c head/sys/riscv/riscv/support.S head/sys/riscv/riscv/trap.c head/sys/sparc64/sparc64/support.S head/sys/sys/resourcevar.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Apr 17 17:23:47 2018 (r332655) +++ head/ObsoleteFiles.inc Tue Apr 17 18:04:28 2018 (r332656) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180417: remove fuswintr and suswintr +OLD_FILES+=usr/share/man/man9/fuswintr.9.gz +OLD_FILES+=usr/share/man/man9/suswintr.9.gz # 20180413: remove Arcnet support OLD_FILES+=usr/include/net/if_arc.h OLD_FILES+=usr/share/man/man4/cm.4.gz Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Apr 17 17:23:47 2018 (r332655) +++ head/share/man/man9/Makefile Tue Apr 17 18:04:28 2018 (r332656) @@ -960,7 +960,6 @@ MLINKS+=fdt_pinctrl.9 fdt_pinctrl_configure.9 \ fdt_pinctrl.9 fdt_pinctrl_configure_tree.9 \ fdt_pinctrl.9 fdt_pinctrl_register.9 MLINKS+=fetch.9 fubyte.9 \ - fetch.9 fuswintr.9 \ fetch.9 fuword.9 \ fetch.9 fuword16.9 \ fetch.9 fuword32.9 \ @@ -1934,7 +1933,6 @@ MLINKS+=stack.9 stack_copy.9 \ stack.9 stack_sbuf_print_ddb.9 \ stack.9 stack_zero.9 MLINKS+=store.9 subyte.9 \ - store.9 suswintr.9 \ store.9 suword.9 \ store.9 suword16.9 \ store.9 suword32.9 \ Modified: head/share/man/man9/fetch.9 ============================================================================== --- head/share/man/man9/fetch.9 Tue Apr 17 17:23:47 2018 (r332655) +++ head/share/man/man9/fetch.9 Tue Apr 17 18:04:28 2018 (r332656) @@ -34,13 +34,12 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2014 +.Dd April 17, 2018 .Dt FETCH 9 .Os .Sh NAME .Nm fetch , .Nm fubyte , -.Nm fuswintr , .Nm fuword , .Nm fuword16 , .Nm fuword32 , @@ -69,8 +68,6 @@ .Ft int64_t .Fn fueword64 "volatile const void *base" "int64_t *val" .In sys/resourcevar.h -.Ft int -.Fn fuswintr "void *base" .Sh DESCRIPTION The .Nm @@ -100,10 +97,6 @@ Fetches 32 bits of data from the user-space address .It Fn fuword64 Fetches 64 bits of data from the user-space address .Pa base . -.It Fn fuswintr -Fetches a short word of data from the user-space address -.Pa base . -This function is safe to call during an interrupt context. .It Fn fueword Fetches a word of data (long) from the user-space address .Pa base @@ -134,9 +127,8 @@ The .Fn fuword , .Fn fuword16 , .Fn fuword32 , -.Fn fuword64 , and -.Fn fuswintr +.Fn fuword64 functions return the data fetched or -1 on failure. The .Fn fueword , Modified: head/share/man/man9/store.9 ============================================================================== --- head/share/man/man9/store.9 Tue Apr 17 17:23:47 2018 (r332655) +++ head/share/man/man9/store.9 Tue Apr 17 18:04:28 2018 (r332656) @@ -34,13 +34,12 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2014 +.Dd April 17, 2018 .Dt STORE 9 .Os .Sh NAME .Nm store , .Nm subyte , -.Nm suswintr , .Nm suword .Nd store data to user-space .Sh SYNOPSIS @@ -58,8 +57,6 @@ .Ft int .Fn suword64 "volatile void *base" "int64_t word" .In sys/resourcevar.h -.Ft int -.Fn suswintr "void *base" "int word" .Sh DESCRIPTION The .Nm @@ -70,7 +67,7 @@ The data written must be naturally aligned. The .Nm routines provide the following functionality: -.Bl -tag -width "suswintr()" +.Bl -tag -width "suword64()" .It Fn subyte Stores a byte of data to the user-space address .Pa base . @@ -86,10 +83,6 @@ Stores 32 bits of data to the user-space address .It Fn suword64 Stores 64 bits of data to the user-space address .Pa base . -.It Fn suswintr -Stores a short word of data to the user-space address -.Pa base . -This function is safe to call during an interrupt context. .El .Sh RETURN VALUES The Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/amd64/amd64/support.S Tue Apr 17 18:04:28 2018 (r332656) @@ -456,20 +456,6 @@ ENTRY(fueword32) ret END(fueword32) -/* - * fuswintr() and suswintr() are specialized variants of fuword16() and - * suword16(), respectively. They are called from the profiling code, - * potentially at interrupt time. If they fail, that's okay; good things - * will happen later. They always fail for now, until the trap code is - * able to deal with this. - */ -ALTENTRY(suswintr) -ENTRY(fuswintr) - movq $-1,%rax - ret -END(suswintr) -END(fuswintr) - ENTRY(fuword16) PUSH_FRAME_POINTER movq PCPU(CURPCB),%rcx Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/arm/arm/fusu.S Tue Apr 17 18:04:28 2018 (r332656) @@ -176,17 +176,6 @@ ENTRY(fusword) END(fusword) /* - * fuswintr(caddr_t uaddr); - * Fetch a short from the user's address space. Can be called during an - * interrupt. - */ - -ENTRY(fuswintr) - mov r0, #-1 - RET -END(fuswintr) - -/* * fubyte(caddr_t uaddr); * Fetch a byte from the user's address space. */ @@ -271,17 +260,6 @@ EENTRY_NP(suword32) RET EEND(suword32) END(suword) - -/* - * suswintr(caddr_t uaddr, short x); - * Store a short in the user's address space. Can be called during an - * interrupt. - */ - -ENTRY(suswintr) - mov r0, #-1 - RET -END(suswintr) /* * susword(caddr_t uaddr, short x); Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/arm64/arm64/support.S Tue Apr 17 18:04:28 2018 (r332656) @@ -218,51 +218,6 @@ EENTRY(suword64) EEND(suword64) END(suword) -/* - * fuswintr and suswintr are just like fusword and susword except that if - * the page is not in memory or would cause a trap, then we return an error. - * The important thing is to prevent sleep() and switch(). - */ - -/* - * Special handler so the trap code knows not to sleep. - */ -ENTRY(fsu_intr_fault) - SET_FAULT_HANDLER(xzr, x1) /* Reset the handler function */ - EXIT_USER_ACCESS_CHECK(w0, x1) - mov x0, #-1 - ret -END(fsu_fault) - -/* - * int fuswintr(void *) - */ -ENTRY(fuswintr) - ldr x1, =(VM_MAXUSER_ADDRESS-3) - cmp x0, x1 - b.cs fsu_fault_nopcb - adr x6, fsu_intr_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x1) /* And set it */ - ldtr w0, [x0] /* Try loading the data */ - SET_FAULT_HANDLER(xzr, x1) /* Reset the fault handler */ - ret /* Return */ -END(fuswintr) - -/* - * int suswintr(void *base, int word) - */ -ENTRY(suswintr) - ldr x2, =(VM_MAXUSER_ADDRESS-3) - cmp x0, x2 - b.cs fsu_fault_nopcb - adr x6, fsu_intr_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - sttr w1, [x0] /* Try storing the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ - mov x0, #0 /* Success */ - ret /* Return */ -END(suswintr) - ENTRY(setjmp) /* Store the stack pointer */ mov x8, sp Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/arm64/arm64/trap.c Tue Apr 17 18:04:28 2018 (r332656) @@ -172,16 +172,6 @@ data_abort(struct thread *td, struct trapframe *frame, #endif pcb = td->td_pcb; - - /* - * Special case for fuswintr and suswintr. These can't sleep so - * handle them early on in the trap handler. - */ - if (__predict_false(pcb->pcb_onfault == (vm_offset_t)&fsu_intr_fault)) { - frame->tf_elr = pcb->pcb_onfault; - return; - } - p = td->td_proc; if (lower) map = &p->p_vmspace->vm_map; Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/conf/files.powerpc Tue Apr 17 18:04:28 2018 (r332656) @@ -212,7 +212,6 @@ powerpc/powerpc/elf32_machdep.c optional powerpc | pow powerpc/powerpc/elf64_machdep.c optional powerpc64 powerpc/powerpc/exec_machdep.c standard powerpc/powerpc/fpu.c standard -powerpc/powerpc/fuswintr.c standard powerpc/powerpc/gdb_machdep.c optional gdb powerpc/powerpc/in_cksum.c optional inet | inet6 powerpc/powerpc/interrupt.c standard @@ -236,7 +235,6 @@ powerpc/powerpc/sigcode64.S optional powerpc64 powerpc/powerpc/swtch32.S optional powerpc | powerpcspe powerpc/powerpc/swtch64.S optional powerpc64 powerpc/powerpc/stack_machdep.c optional ddb | stack -powerpc/powerpc/suswintr.c standard powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/trap.c standard Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/i386/i386/support.s Tue Apr 17 18:04:28 2018 (r332656) @@ -252,20 +252,6 @@ ENTRY(memcpy) END(memcpy) /* - * fuswintr() and suswintr() are specialized variants of fuword16() and - * suword16(), respectively. They are called from the profiling code, - * potentially at interrupt time. If they fail, that's okay; good things - * will happen later. They always fail for now, until the trap code is - * able to deal with this. - */ -ALTENTRY(suswintr) -ENTRY(fuswintr) - movl $-1,%eax - ret -END(suswintr) -END(fuswintr) - -/* * copystr(from, to, maxlen, int *lencopied) - MP SAFE */ ENTRY(copystr) Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/mips/mips/support.S Tue Apr 17 18:04:28 2018 (r332656) @@ -417,41 +417,6 @@ LEAF(fswberr) END(fswberr) /* - * fuswintr and suswintr are just like fusword and susword except that if - * the page is not in memory or would cause a trap, then we return an error. - * The important thing is to prevent sleep() and switch(). - */ -LEAF(fuswintr) - PTR_LA v0, fswintrberr - blt a0, zero, fswintrberr # make sure address is in user space - nop - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S v0, U_PCB_ONFAULT(v1) - lhu v0, 0(a0) # fetch short - j ra - PTR_S zero, U_PCB_ONFAULT(v1) -END(fuswintr) - -LEAF(suswintr) - PTR_LA v0, fswintrberr - blt a0, zero, fswintrberr # make sure address is in user space - nop - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S v0, U_PCB_ONFAULT(v1) - sh a1, 0(a0) # store short - PTR_S zero, U_PCB_ONFAULT(v1) - j ra - move v0, zero -END(suswintr) - -LEAF(fswintrberr) - j ra - li v0, -1 -END(fswintrberr) - -/* * memset(void *s1, int c, int len) * NetBSD: memset.S,v 1.3 2001/10/16 15:40:53 uch Exp */ Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/mips/mips/trap.c Tue Apr 17 18:04:28 2018 (r332656) @@ -684,14 +684,6 @@ trap(struct trapframe *trapframe) if (td->td_pcb->pcb_onfault == NULL) goto err; - /* check for fuswintr() or suswintr() getting a page fault */ - /* XXX There must be a nicer way to do this. */ - if (td->td_pcb->pcb_onfault == fswintrberr) { - pc = (register_t)(intptr_t)td->td_pcb->pcb_onfault; - td->td_pcb->pcb_onfault = NULL; - return (pc); - } - goto dofault; case T_TLB_LD_MISS + T_USER: Modified: head/sys/riscv/riscv/support.S ============================================================================== --- head/sys/riscv/riscv/support.S Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/riscv/riscv/support.S Tue Apr 17 18:04:28 2018 (r332656) @@ -202,48 +202,6 @@ EENTRY(suword64) EEND(suword64) END(suword) -/* - * fuswintr and suswintr are just like fusword and susword except that if - * the page is not in memory or would cause a trap, then we return an error. - * The important thing is to prevent sleep() and switch(). - */ - -/* - * Special handler so the trap code knows not to sleep. - */ -ENTRY(fsu_intr_fault) - SET_FAULT_HANDLER(x0, a1) /* Reset the handler function */ - li a0, -1 - ret -END(fsu_fault) - -/* - * int fuswintr(void *) - */ -ENTRY(fuswintr) - li a1, (VM_MAXUSER_ADDRESS-3) - bgt a0, a1, fsu_fault_nopcb - la a6, fsu_intr_fault /* Load the fault handler */ - SET_FAULT_HANDLER(a6, a1) /* And set it */ - lw a0, 0(a0) /* Try loading the data */ - SET_FAULT_HANDLER(x0, x1) /* Reset the fault handler */ - ret /* Return */ -END(fuswintr) - -/* - * int suswintr(void *base, int word) - */ -ENTRY(suswintr) - li a2, (VM_MAXUSER_ADDRESS-3) - bgt a0, a2, fsu_fault_nopcb - la a6, fsu_intr_fault /* Load the fault handler */ - SET_FAULT_HANDLER(a6, a2) /* And set it */ - sw a1, 0(a0) /* Try storing the data */ - SET_FAULT_HANDLER(x0, a2) /* Reset the fault handler */ - li a0, 0 /* Success */ - ret /* Return */ -END(suswintr) - ENTRY(setjmp) /* Store the stack pointer */ sd sp, 0(a0) Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/riscv/riscv/trap.c Tue Apr 17 18:04:28 2018 (r332656) @@ -186,16 +186,6 @@ data_abort(struct trapframe *frame, int lower) td = curthread; pcb = td->td_pcb; - - /* - * Special case for fuswintr and suswintr. These can't sleep so - * handle them early on in the trap handler. - */ - if (__predict_false(pcb->pcb_onfault == (vm_offset_t)&fsu_intr_fault)) { - frame->tf_sepc = pcb->pcb_onfault; - return; - } - sbadaddr = frame->tf_sbadaddr; p = td->td_proc; Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/sparc64/sparc64/support.S Tue Apr 17 18:04:28 2018 (r332656) @@ -487,31 +487,6 @@ ENTRY(suword64) clr %o0 END(suword64) - .globl fs_nofault_intr_begin -fs_nofault_intr_begin: - nop - -/* - * int fuswintr(const void *base) - */ -ENTRY(fuswintr) - retl - lduha [%o0] ASI_AIUP, %o0 -END(fuswintr) - -/* - * int suswintr(const void *base, int word) - */ -ENTRY(suswintr) - stha %o1, [%o0] ASI_AIUP - retl - clr %o0 -END(suswintr) - - .globl fs_nofault_intr_end -fs_nofault_intr_end: - nop - .globl fs_nofault_end fs_nofault_end: nop Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Tue Apr 17 17:23:47 2018 (r332655) +++ head/sys/sys/resourcevar.h Tue Apr 17 18:04:28 2018 (r332656) @@ -128,7 +128,6 @@ int chgsbsize(struct uidinfo *uip, u_int *hiwat, u_in rlim_t maxval); int chgptscnt(struct uidinfo *uip, int diff, rlim_t maxval); int chgumtxcnt(struct uidinfo *uip, int diff, rlim_t maxval); -int fuswintr(void *base); int kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which, struct rlimit *limp); struct plimit @@ -152,7 +151,6 @@ void rufetchcalc(struct proc *p, struct rusage *ru, s struct timeval *sp); void rufetchtd(struct thread *td, struct rusage *ru); void ruxagg(struct proc *p, struct thread *td); -int suswintr(void *base, int word); struct uidinfo *uifind(uid_t uid); void uifree(struct uidinfo *uip); From owner-svn-src-head@freebsd.org Tue Apr 17 18:07:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A381F8EB91; Tue, 17 Apr 2018 18:07:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD286EB7B; Tue, 17 Apr 2018 18:07:41 +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 1491E7F6F; Tue, 17 Apr 2018 18:07:41 +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 w3HI7eCU081057; Tue, 17 Apr 2018 18:07:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HI7e4D081051; Tue, 17 Apr 2018 18:07:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804171807.w3HI7e4D081051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 Apr 2018 18:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332657 - in head: etc/mtree sys/kern sys/sys tests/sys tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: etc/mtree sys/kern sys/sys tests/sys tests/sys/capsicum X-SVN-Commit-Revision: 332657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 18:07:41 -0000 Author: jhb Date: Tue Apr 17 18:07:40 2018 New Revision: 332657 URL: https://svnweb.freebsd.org/changeset/base/332657 Log: Properly do a deep copy of the ioctls capability array for fget_cap(). fget_cap() tries to do a cheaper snapshot of a file descriptor without holding the file descriptor lock. This snapshot does not do a deep copy of the ioctls capability array, but instead uses a different return value to inform the caller to retry the copy with the lock held. However, filecaps_copy() was returning 1 to indicate that a retry was required, and fget_cap() was checking for 0 (actually '!filecaps_copy()'). As a result, fget_cap() did not do a deep copy of the ioctls array and just reused the original pointer. This cause multiple file descriptor entries to think they owned the same pointer and eventually resulted in duplicate frees. The only code path that I'm aware of that triggers this is to create a listen socket that has a restricted list of ioctls and then call accept() which calls fget_cap() with a valid filecaps structure from getsock_cap(). To fix, change the return value of filecaps_copy() to return true if it succeeds in copying the caps and false if it fails because the lock is required. I find this more intuitive than fixing the caller in this case. While here, change the return type from 'int' to 'bool'. Finally, make filecaps_copy() more robust in the failure case by not copying any of the source filecaps structure over. This avoids the possibility of leaking a pointer into a structure if a similar future caller doesn't properly handle the return value from filecaps_copy() at the expense of one more branch. I also added a test case that panics before this change and now passes. Reviewed by: kib Discussed with: mjg (not a fan of the extra branch) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15047 Added: head/tests/sys/capsicum/ head/tests/sys/capsicum/Makefile (contents, props changed) head/tests/sys/capsicum/ioctls_test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Apr 17 18:04:28 2018 (r332656) +++ head/etc/mtree/BSD.tests.dist Tue Apr 17 18:07:40 2018 (r332657) @@ -430,6 +430,8 @@ .. aio .. + capsicum + .. cddl zfs bin Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Apr 17 18:04:28 2018 (r332656) +++ head/sys/kern/kern_descrip.c Tue Apr 17 18:07:40 2018 (r332657) @@ -1492,16 +1492,16 @@ filecaps_init(struct filecaps *fcaps) * Note that if the table was not locked, the caller has to check the relevant * sequence counter to determine whether the operation was successful. */ -int +bool filecaps_copy(const struct filecaps *src, struct filecaps *dst, bool locked) { size_t size; + if (src->fc_ioctls != NULL && !locked) + return (false); *dst = *src; if (src->fc_ioctls == NULL) - return (0); - if (!locked) - return (1); + return (true); KASSERT(src->fc_nioctls > 0, ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls)); @@ -1509,7 +1509,7 @@ filecaps_copy(const struct filecaps *src, struct filec size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); bcopy(src->fc_ioctls, dst->fc_ioctls, size); - return (0); + return (true); } static u_long * Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Tue Apr 17 18:04:28 2018 (r332656) +++ head/sys/sys/filedesc.h Tue Apr 17 18:07:40 2018 (r332657) @@ -155,7 +155,7 @@ enum { struct thread; void filecaps_init(struct filecaps *fcaps); -int filecaps_copy(const struct filecaps *src, struct filecaps *dst, +bool filecaps_copy(const struct filecaps *src, struct filecaps *dst, bool locked); void filecaps_move(struct filecaps *src, struct filecaps *dst); void filecaps_free(struct filecaps *fcaps); Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Tue Apr 17 18:04:28 2018 (r332656) +++ head/tests/sys/Makefile Tue Apr 17 18:07:40 2018 (r332657) @@ -6,6 +6,7 @@ TESTSDIR= ${TESTSBASE}/sys TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio +TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= ${_cddl} TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file Added: head/tests/sys/capsicum/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/capsicum/Makefile Tue Apr 17 18:07:40 2018 (r332657) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/capsicum + +ATF_TESTS_C+= ioctls_test + +WARNS?= 6 + +.include Added: head/tests/sys/capsicum/ioctls_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/capsicum/ioctls_test.c Tue Apr 17 18:07:40 2018 (r332657) @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 2018 John Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * A variant of ATF_REQUIRE that is suitable for use in child + * processes. This only works if the parent process is tripped up by + * the early exit and fails some requirement itself. + */ +#define CHILD_REQUIRE(exp) do { \ + if (!(exp)) \ + child_fail_require(__FILE__, __LINE__, \ + #exp " not met"); \ + } while (0) + +static __dead2 void +child_fail_require(const char *file, int line, const char *str) +{ + char buf[128]; + + snprintf(buf, sizeof(buf), "%s:%d: %s\n", file, line, str); + write(2, buf, strlen(buf)); + _exit(32); +} + +/* + * Exercise the edge case of a custom ioctl list being copied from a + * listen socket to an accepted socket. + */ +ATF_TC_WITHOUT_HEAD(cap_ioctls__listen_copy); +ATF_TC_BODY(cap_ioctls__listen_copy, tc) +{ + struct sockaddr_in sin; + cap_rights_t rights; + u_long cmds[] = { FIONREAD }; + socklen_t len; + pid_t pid; + char dummy; + int s[2], status; + + s[0] = socket(AF_INET, SOCK_STREAM, 0); + ATF_REQUIRE(s[0] > 0); + + /* Bind to an arbitrary unused port. */ + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_port = 0; + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + ATF_REQUIRE(bind(s[0], (struct sockaddr *)&sin, sizeof(sin)) == 0); + + CHILD_REQUIRE(listen(s[0], 1) == 0); + + len = sizeof(sin); + ATF_REQUIRE(getsockname(s[0], (struct sockaddr *)&sin, &len) == 0); + ATF_REQUIRE(len == sizeof(sin)); + + cap_rights_init(&rights, CAP_ACCEPT, CAP_IOCTL); + ATF_REQUIRE(cap_rights_limit(s[0], &rights) == 0); + ATF_REQUIRE(cap_ioctls_limit(s[0], cmds, nitems(cmds)) == 0); + + pid = fork(); + if (pid == 0) { + s[1] = accept(s[0], NULL, NULL); + CHILD_REQUIRE(s[1] > 0); + + /* Close both sockets during exit(). */ + exit(0); + } + + ATF_REQUIRE(pid > 0); + + ATF_REQUIRE(close(s[0]) == 0); + s[1] = socket(AF_INET, SOCK_STREAM, 0); + ATF_REQUIRE(s[1] > 0); + ATF_REQUIRE(connect(s[1], (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(read(s[1], &dummy, sizeof(dummy)) == 0); + ATF_REQUIRE(close(s[1]) == 0); + + ATF_REQUIRE(wait(&status) == pid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, cap_ioctls__listen_copy); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Tue Apr 17 18:24:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C47DF90080; Tue, 17 Apr 2018 18:24:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D90BD731AE; Tue, 17 Apr 2018 18:24:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0409510AFD3; Tue, 17 Apr 2018 14:24:47 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332652 - in head/sys: conf dev/puc modules/puc Date: Tue, 17 Apr 2018 10:20:56 -0700 Message-ID: <3010482.A3g1Uy1uGA@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804171646.w3HGk9vn040646@repo.freebsd.org> References: <201804171646.w3HGk9vn040646@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 17 Apr 2018 14:24:47 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 18:24:48 -0000 On Tuesday, April 17, 2018 04:46:09 PM Warner Losh wrote: > Author: imp > Date: Tue Apr 17 16:46:08 2018 > New Revision: 332652 > URL: https://svnweb.freebsd.org/changeset/base/332652 > > Log: > Add PNP info to the PCI attahement of the puc driver. > > Adjust sys/conf/files and sys/modules/puc/Makefile to omit > pucdata.c now tht it's included by puc_pci.c. > > Submitted by: Lakhan Shiva Kamireddy (with build fixes by me) > Pull Request: https://github.com/freebsd/freebsd/pull/136 If you are going to #include it you can remove the terminator entry and use nitems() in puc_pci_match instead. That will also remove the need for the - 1 hack in the MODULE_PNP_INFO line. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 17 18:25:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14912F90169 for ; Tue, 17 Apr 2018 18:25:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2BFC735EA for ; Tue, 17 Apr 2018 18:25:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id a7so7625084ioc.12 for ; Tue, 17 Apr 2018 11:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=RXueKUvQiUsZctaJGoQhq0rXXNPr0SVf6vJEa9/Xb2o=; b=SbrcXfiF38YLnxuaY9ADzE52pMrR9M3pk1ahdX5x+oDYuk4yc2afwWo5NwzPz6IFSt 3anHTP/BoJ4xtzDd7islXeh3io5X7qviLF1KpxzRavs2XPSO65z2i8q8pZN2vt6QxaKt KO/dIziKOi9rYiNTzA9lC/FPN2rJRzMre+vlmFttZdEQ5x1u5PDTjo7E48noEnng7Hb1 whbfyzjAtXVivxz0NeFmAAsmf+xP0fkYpqgrpWeeGNHU2poF+cGLLia9oxwp4l3UCOtV Yeiaji1HlUVWz/8LHkv372lCgdi1F5FZtqTS3a/7m5WKmCithH5hhtbarniKo4nW+qUQ /PKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=RXueKUvQiUsZctaJGoQhq0rXXNPr0SVf6vJEa9/Xb2o=; b=s6jegAAc0fJHcrQ7GfJWtPNLmcgILmnpKJKa8f9mirfWmelPzL+pO2PSQnv/UzUL3R hNQTLnilvuNPmfRSKEq2DQRLeRXZUm6TVbFwAkt462ejVXLhhVvg347yFJ/+iB3jMZEL s8BIlYSAobgV8WeVfItQNIjx9nXGj4oNcHxfsWQ3VXBnojQOVJ1JSQR7lFYAFGEp1uo9 b/JL5+HDVMpqj4RIUX3cxzxFk34p7Uuov0yLU/hKRSY/WeVRA+l2z/FuTYrdPgiGQneJ WIr8fpaT6LUTtEvvnm8eSNeD1QCPKI4z+bI1P+WpAHL62PS11lHr6zLOM9D2pWB1zyBN dqWQ== X-Gm-Message-State: ALQs6tCe95Ec1lOjHXjPT4GRhvk+YNG3s8zuKIuFyhw99K94xfA2ua3L OKck1OzTBL8VholaMLOthcnSm6z9NvFQ2N/Rs7vKqA== X-Google-Smtp-Source: AIpwx4+JO0jM0Fja5x+fE2shxY/g7Be6OfRxe9KxTct3Ggg7cro+Q1I4CLoaEr0l93rDbthOmtU4xsCJVi/RQQMvbyY= X-Received: by 10.107.56.70 with SMTP id f67mr3135728ioa.117.1523989541763; Tue, 17 Apr 2018 11:25:41 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a604:0:0:0:0:0 with HTTP; Tue, 17 Apr 2018 11:25:41 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <3010482.A3g1Uy1uGA@ralph.baldwin.cx> References: <201804171646.w3HGk9vn040646@repo.freebsd.org> <3010482.A3g1Uy1uGA@ralph.baldwin.cx> From: Warner Losh Date: Tue, 17 Apr 2018 12:25:41 -0600 X-Google-Sender-Auth: bYkxuy9VpSG-1_h-t3sRdfAr9qU Message-ID: Subject: Re: svn commit: r332652 - in head/sys: conf dev/puc modules/puc To: John Baldwin Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 18:25:43 -0000 On Tue, Apr 17, 2018 at 11:20 AM, John Baldwin wrote: > On Tuesday, April 17, 2018 04:46:09 PM Warner Losh wrote: > > Author: imp > > Date: Tue Apr 17 16:46:08 2018 > > New Revision: 332652 > > URL: https://svnweb.freebsd.org/changeset/base/332652 > > > > Log: > > Add PNP info to the PCI attahement of the puc driver. > > > > Adjust sys/conf/files and sys/modules/puc/Makefile to omit > > pucdata.c now tht it's included by puc_pci.c. > > > > Submitted by: Lakhan Shiva Kamireddy (with build fixes by me) > > Pull Request: https://github.com/freebsd/freebsd/pull/136 > > If you are going to #include it you can remove the terminator entry > and use nitems() in puc_pci_match instead. That will also remove the > need for the - 1 hack in the MODULE_PNP_INFO line. > Good suggestion... Warner From owner-svn-src-head@freebsd.org Tue Apr 17 18:49:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04363F918C1; Tue, 17 Apr 2018 18:49:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A018978FF5; Tue, 17 Apr 2018 18:49:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B190105D5; Tue, 17 Apr 2018 18:49:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HInHfJ001218; Tue, 17 Apr 2018 18:49:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HInHT3001217; Tue, 17 Apr 2018 18:49:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804171849.w3HInHT3001217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 17 Apr 2018 18:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332658 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 332658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 18:49:18 -0000 Author: markj Date: Tue Apr 17 18:49:17 2018 New Revision: 332658 URL: https://svnweb.freebsd.org/changeset/base/332658 Log: Ensure that m and skip_m belong to the same object. Pages allocated from a given reservation may belong to different objects. It is therefore possible for vm_page_ps_test() to be called with the base page's object unlocked. Check for this case before asserting that the object lock is held. Reported by: jhb Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Apr 17 18:07:40 2018 (r332657) +++ head/sys/vm/vm_page.c Tue Apr 17 18:49:17 2018 (r332658) @@ -4140,6 +4140,8 @@ vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip int i, npages; object = m->object; + if (skip_m != NULL && skip_m->object != object) + return (false); VM_OBJECT_ASSERT_LOCKED(object); npages = atop(pagesizes[m->psind]); From owner-svn-src-head@freebsd.org Tue Apr 17 19:39:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B302F95430; Tue, 17 Apr 2018 19:39:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C11DD87C1F; Tue, 17 Apr 2018 19:39:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AED4010DE2; Tue, 17 Apr 2018 19:39:47 +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 w3HJdl9u029980; Tue, 17 Apr 2018 19:39:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HJdliY029978; Tue, 17 Apr 2018 19:39:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804171939.w3HJdliY029978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 17 Apr 2018 19:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332659 - head/usr.sbin/usbconfig X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/usbconfig X-SVN-Commit-Revision: 332659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 19:39:48 -0000 Author: trasz Date: Tue Apr 17 19:39:47 2018 New Revision: 332659 URL: https://svnweb.freebsd.org/changeset/base/332659 Log: Make it possible to pass the ugenX.Y to usbconfig(8) without using "-d", eg "usbconfig ugen1.2 dump_all_desc". Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/usbconfig/usbconfig.8 head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.8 Tue Apr 17 18:49:17 2018 (r332658) +++ head/usr.sbin/usbconfig/usbconfig.8 Tue Apr 17 19:39:47 2018 (r332659) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 30, 2017 +.Dd April 17, 2018 .Dt USBCONFIG 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Op Fl a Ar addr .Op cmds... .Nm -.Op Fl d Ar [ugen]. +.Op Oo Fl d Oc Ar [ugen]. .Op cmds... .Sh DESCRIPTION The Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Tue Apr 17 18:49:17 2018 (r332658) +++ head/usr.sbin/usbconfig/usbconfig.c Tue Apr 17 19:39:47 2018 (r332659) @@ -820,6 +820,29 @@ main(int argc, char **argv) opt->got_any++; break; default: + if (n == 1) { + ptr = argv[n]; + + if ((ptr[0] == 'u') && + (ptr[1] == 'g') && + (ptr[2] == 'e') && + (ptr[3] == 'n')) + ptr += 4; + + if ((sscanf(ptr, "%d.%d", + &unit, &addr) != 2) || + (unit < 0) || (unit > 65535) || + (addr < 0) || (addr > 65535)) { + usage(); + break; + } + + opt->bus = unit; + opt->addr = addr; + opt->got_bus = 1; + opt->got_addr = 1; + break; + } usage(); break; } From owner-svn-src-head@freebsd.org Tue Apr 17 22:30:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCBEAFA1432; Tue, 17 Apr 2018 22:30:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 807A4712A1; Tue, 17 Apr 2018 22:30:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76CA112911; Tue, 17 Apr 2018 22:30:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HMU02G014809; Tue, 17 Apr 2018 22:30:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HMU0Wi014808; Tue, 17 Apr 2018 22:30:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804172230.w3HMU0Wi014808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 17 Apr 2018 22:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332660 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 332660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 22:30:01 -0000 Author: brooks Date: Tue Apr 17 22:30:00 2018 New Revision: 332660 URL: https://svnweb.freebsd.org/changeset/base/332660 Log: Remove references to fs_nofault_intr_begin/end. These should have removed in r332656. Reported by: mjg, lidl Modified: head/sys/sparc64/sparc64/trap.c Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Tue Apr 17 19:39:47 2018 (r332659) +++ head/sys/sparc64/sparc64/trap.c Tue Apr 17 22:30:00 2018 (r332660) @@ -100,8 +100,6 @@ extern char copy_nofault_end[]; extern char fs_fault[]; extern char fs_nofault_begin[]; extern char fs_nofault_end[]; -extern char fs_nofault_intr_begin[]; -extern char fs_nofault_intr_end[]; extern char fas_fault[]; extern char fas_nofault_begin[]; @@ -478,14 +476,6 @@ trap_pfault(struct thread *td, struct trapframe *tf) } if (ctx != TLB_CTX_KERNEL) { - if ((tf->tf_tstate & TSTATE_PRIV) != 0 && - (tf->tf_tpc >= (u_long)fs_nofault_intr_begin && - tf->tf_tpc <= (u_long)fs_nofault_intr_end)) { - tf->tf_tpc = (u_long)fs_fault; - tf->tf_tnpc = tf->tf_tpc + 4; - return (0); - } - /* This is a fault on non-kernel virtual memory. */ map = &p->p_vmspace->vm_map; } else { From owner-svn-src-head@freebsd.org Tue Apr 17 22:33:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE73FA195A; Tue, 17 Apr 2018 22:33:42 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B493971774; Tue, 17 Apr 2018 22:33:41 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF91D12A95; Tue, 17 Apr 2018 22:33:41 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3HMXfZ0019761; Tue, 17 Apr 2018 22:33:41 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3HMXfqj019760; Tue, 17 Apr 2018 22:33:41 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804172233.w3HMXfqj019760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 17 Apr 2018 22:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332661 - head/release/amd64 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/release/amd64 X-SVN-Commit-Revision: 332661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 22:33:42 -0000 Author: benno Date: Tue Apr 17 22:33:41 2018 New Revision: 332661 URL: https://svnweb.freebsd.org/changeset/base/332661 Log: Generate hybrid ISO images for amd64. This keeps the existing El Torito entries for BIOS and UEFI boot code and adds a GPT in the ISO image's System Area containing boot code for BIOS that will load /boot/loader from the ISO filesystem and execute it. We then use etdump to find the EFI System Partition image in the El Torito catalog and add an entry to the GPT that allows EFI to find it. Reviewed by: gjb, imp Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D15051 Modified: head/release/amd64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Tue Apr 17 22:30:00 2018 (r332660) +++ head/release/amd64/mkisoimages.sh Tue Apr 17 22:33:41 2018 (r332661) @@ -38,7 +38,7 @@ if [ "$1" = "-b" ]; then umount efi rmdir efi mdconfig -d -u $device - bootable="-o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi $bootable" + bootable="$bootable -o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi" shift else @@ -58,3 +58,29 @@ echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/f makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" rm -f "$1/etc/fstab" rm -f efiboot.img + +if [ "$bootable" != "" ]; then + # Look for the EFI System Partition image we dropped in the ISO image. + for entry in `etdump --format shell $NAME`; do + eval $entry + if [ "$et_platform" = "efi" ]; then + espstart=`expr $et_lba \* 2048` + espsize=`expr $et_sectors \* 512` + espparam="-p efi::$espsize:$espstart" + break + fi + done + + # Create a GPT image containing the partitions we need for hybrid boot. + imgsize=`stat -f %z $NAME` + mkimg -s gpt \ + --capacity $imgsize \ + -b $4/boot/pmbr \ + $espparam \ + -p freebsd-boot:=$4/boot/isoboot \ + -o hybrid.img + + # Drop the PMBR, GPT, and boot code into the System Area of the ISO. + dd if=hybrid.img of=$NAME bs=32k count=1 conv=notrunc + rm -f hybrid.img +fi From owner-svn-src-head@freebsd.org Wed Apr 18 02:25:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2070F8651B; Wed, 18 Apr 2018 02:25:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FD4284127; Wed, 18 Apr 2018 02:25:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46A3B14F03; Wed, 18 Apr 2018 02:25:04 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3I2P4F6033279; Wed, 18 Apr 2018 02:25:04 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3I2P4jT033278; Wed, 18 Apr 2018 02:25:04 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201804180225.w3I2P4jT033278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 18 Apr 2018 02:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332662 - head/usr.sbin/iostat X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.sbin/iostat X-SVN-Commit-Revision: 332662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 02:25:04 -0000 Author: allanjude Date: Wed Apr 18 02:25:03 2018 New Revision: 332662 URL: https://svnweb.freebsd.org/changeset/base/332662 Log: Make `iostat -xC` print CPU information on its own line Requested by: mahrens Reviewed by: kenm (maintainer), mahrens MFC after: 1 week Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D15076 Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Tue Apr 17 22:33:41 2018 (r332661) +++ head/usr.sbin/iostat/iostat.c Wed Apr 18 02:25:03 2018 (r332662) @@ -802,11 +802,15 @@ devstats(int perf_select, long double etime, int havel char *devicename; if (xflag > 0) { + if (Cflag > 0) { + printf(" cpu\n"); + printf(" us ni sy in id\n"); + cpustats(); + printf("\n"); + } printf(" extended device statistics "); if (Tflag > 0) printf(" tty "); - if (Cflag > 0) - printf(" cpu "); printf("\n"); if (Iflag == 0) { printf("device r/s w/s kr/s kw/s " @@ -817,8 +821,6 @@ devstats(int perf_select, long double etime, int havel } if (Tflag > 0) printf("tin tout "); - if (Cflag > 0) - printf("us ni sy in id "); printf("\n"); } @@ -922,8 +924,6 @@ devstats(int perf_select, long double etime, int havel printf("%4.0Lf%5.0Lf", cur.tk_nin / etime, cur.tk_nout / etime); - if (Cflag > 0) - cpustats(); } printf("\n"); } From owner-svn-src-head@freebsd.org Wed Apr 18 04:53:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8414F900A8; Wed, 18 Apr 2018 04:53:29 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9177D781; Wed, 18 Apr 2018 04:53:29 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (220-253-154-11.dyn.iinet.net.au [220.253.154.11]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w3I4rNRd029154 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 17 Apr 2018 21:53:26 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r332559 - head/usr.sbin/mountd To: Konstantin Belousov , Rick Macklem Cc: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <20180417123212.GM1774@kib.kiev.ua> From: Julian Elischer Message-ID: Date: Wed, 18 Apr 2018 12:53:18 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180417123212.GM1774@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 04:53:30 -0000 On 17/4/18 8:32 pm, Konstantin Belousov wrote: > On Tue, Apr 17, 2018 at 12:02:04AM +0000, Rick Macklem wrote: >> I wrote: >>> Julian Elischer wrote: >>>> On 16/4/18 6:56 pm, Konstantin Belousov wrote: >>> [stuff snipped] >>>>>> + ngroups =3D XU_NGROUPS + 1; >>>>> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? >>>> valid question.. because that is how many are allocated? >>>> it was a "minimally invasive patch".. whoever used XU_NGROUPS before >>>> should have fixed it. >>>> Having said that, thanks for drawing out attention to it.. will >>>> probably fix. >>> 16 is the limit specified in the RFCs for Sun RPC, so that is the "on the wire" limit. >>> I haven't looked at the code. It might make sense to handle more here and then >>> set the limit at 16 after getting rid of duplicates, but I have no idea if = >>> it matters? >>> >>> rick >> Correcting my own post. Now that I've looked at the code, this doesn't go on >> the wire. It does go in the exports structure, which means that this structure >> would have to be revised (along with the syscall and VOP calls and the kernel >> code that uses it). These credentials are for the "maproot/mapall" export >> option and revising the export structure seems like quite a bit of work for this >> case. (Until revised XU_NGROUPS is the correct value to set it to, since there >> is a "struct xucred" in the exports structure.) >> >> Since Julian Elischer has been emailing me about adding a "fsid" export option >> which allows /etc/exports to set the FSID of the exported fs (which would also >> need to go in the exports structure), it might be about time to rev. the exports >> structure? > Probably yes, we would need a new variant of the nmount(2) syscall. > Existing syscall should use the old layout for compatibility (we care > about nmount and COMPAT32 as well). > our issue is that we make a server that combines CIFS/SMB access (via samba), credential setting from a company wide AD server (windows) via winbindd (samba) via nsswitch.. and NFS. The problem is that when one looks up a user name from the AD server One can get back a credential with a large number of groups, because some companies use windows groups extensively.  SO a sinel user may be in a group for every project they are involved with and a method of giving them access to files related to a project. In this scenario a group manager may be given access to a lot of groups. A user looking at a file via NFS needs to be able to see what he needs and still be blocked as per company policy. I am investigating the new user-manager  daemon may help but I don't fully understand it yet. I gather it maps an incoming request to a set of groups as defined on the server rather than on the client, but I'm not sure yet how that relates to mountd. From owner-svn-src-head@freebsd.org Wed Apr 18 05:58:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D664CF93E6D; Wed, 18 Apr 2018 05:58:27 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 831CE6A063; Wed, 18 Apr 2018 05:58:27 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B564170BB; Wed, 18 Apr 2018 05:58:27 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3I5wRXH038598; Wed, 18 Apr 2018 05:58:27 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3I5wRgg038597; Wed, 18 Apr 2018 05:58:27 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201804180558.w3I5wRgg038597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 18 Apr 2018 05:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332663 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 332663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 05:58:28 -0000 Author: cperciva Date: Wed Apr 18 05:58:27 2018 New Revision: 332663 URL: https://svnweb.freebsd.org/changeset/base/332663 Log: Move debug.{trace,debugger}_on_panic and kern.panic_reboot_wait_time in EC2 instances from sysctl.conf to loader.conf; these can all be set as loader tunables, and setting them in loader.conf gives us the right behaviour in the event of a kernel panic taking place prior to when sysctl.conf is processed. MFC after: 1 week Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Wed Apr 18 02:25:03 2018 (r332662) +++ head/release/tools/ec2.conf Wed Apr 18 05:58:27 2018 (r332663) @@ -60,9 +60,9 @@ vm_extra_pre_umount() { # The EC2 console is output-only, so while printing a backtrace can # be useful, there's no point dropping into a debugger or waiting # for a keypress. - echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf - echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf - echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf + echo 'debug.trace_on_panic=1' >> ${DESTDIR}/boot/loader.conf + echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/boot/loader.conf + echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/boot/loader.conf # The console is not interactive, so we might as well boot quickly. echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf From owner-svn-src-head@freebsd.org Wed Apr 18 07:43:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 526F5F9ACF6 for ; Wed, 18 Apr 2018 07:43:51 +0000 (UTC) (envelope-from bounce-mc.us18_93640249.8461-svn-src-head=freebsd.org@mail78.sea61.rsgsv.net) Received: from mail78.sea61.rsgsv.net (mail78.sea61.rsgsv.net [148.105.14.78]) by mx1.freebsd.org (Postfix) with ESMTP id BF1EA7F253 for ; Wed, 18 Apr 2018 07:43:50 +0000 (UTC) (envelope-from bounce-mc.us18_93640249.8461-svn-src-head=freebsd.org@mail78.sea61.rsgsv.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; d=mail78.sea61.rsgsv.net; h=Subject:From:Reply-To:To:Date:Message-ID:List-ID:List-Unsubscribe:Sender: Content-Type:MIME-Version; i=info=3Ddevdaysvilnius2018.lt@mail78.sea61.rsgsv.net; bh=F+Q6t/LxajX40L4XkALa2c8nSEbG2pHppTsbGH01PiQ=; b=EhL+A5vxl+qQTf333U2dibMFyDQPfSEs1YhQyGozXMk74NmGEIvelSNsczMoIaZsaJzDER56khf2 LnSWaOUHlxHh9RIg7zoPq+mYTTbnhcz29j+VjNhgfqkEKEK94keBuNgJhAL7HsFrYXrWznHSbv6I i2qEzN4S7mnyIl9dtG8= Received: from (127.0.0.1) by mail78.sea61.rsgsv.net id hqrrjc2ddl47 for ; Wed, 18 Apr 2018 07:28:39 +0000 (envelope-from ) Subject: =?utf-8?Q?Just=20a=20few=20days=20left=20to=20secure=20Early=20Bird=20ticket=20for=20#DevDaysVilnius=21?= From: =?utf-8?Q?DevDays=20Vilnius=202018?= Reply-To: =?utf-8?Q?DevDays=20Vilnius=202018?= To: Date: Wed, 18 Apr 2018 07:28:39 +0000 Message-ID: <33d0bcdf51cc41cf6c5949fd3.8c56308cca.20180418072805.89819ad7ed.359ff58c@mail78.sea61.rsgsv.net> X-Mailer: MailChimp Mailer - **CID89819ad7ed8c56308cca** X-Campaign: mailchimp33d0bcdf51cc41cf6c5949fd3.89819ad7ed X-campaignid: mailchimp33d0bcdf51cc41cf6c5949fd3.89819ad7ed X-Report-Abuse: Please report abuse for this campaign here: http://www.mailchimp.com/abuse/abuse.phtml?u=33d0bcdf51cc41cf6c5949fd3&id=89819ad7ed&e=8c56308cca X-MC-User: 33d0bcdf51cc41cf6c5949fd3 Feedback-ID: 93640249:93640249.8461:us18:mc X-Accounttype: pd List-Unsubscribe-Post: List-Unsubscribe=One-Click Sender: "DevDays Vilnius 2018" x-mcda: FALSE MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="fixed" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 07:43:51 -0000 Just a few days left to secure Early Bird ticket for #DevDaysVilnius! View this email in your browser (https://mailchi.mp/2a9344fb212f/devdays-v= ilnius-2018-conference-agenda-is-live-8461?e=3D8c56308cca) DevDays Vilnius ** 3 days left to secure Early Bird ticket for #DevDaysVilnius! ------------------------------------------------------------ Just a quick reminder: you now have 3 days to get the best possible rates= before Friday=2C 20 April and save 30% off the price. Book the ticket now= and join 500+ other developers in Vilnius on May: REGISTER NOW (https://devdays.lt/#tickets) ** Agenda ------------------------------------------------------------ Need to decide if the event is a good fit for you? Click below and check += 35 talks: CHECK THE AGENDA (https://devdays.lt/#schedule) ** NEW: Full-day Pre-Conference Workshops ------------------------------------------------------------ We=E2=80=98ve heard your feedback and are thrilled to announce: all 8 work= shops will take up a whole day. Review the agendas for workshops covering Angular=2C Cloud native applicat= ions development=2C Preact=2C Machine Learning=2C Mob Refactoring=2C relia= ble Web building=2C Docker or effective communication within teams and sel= ect a workshop to participate in: VIEW WORKSHOPS (https://devdays.lt/workshops-list/) Thank you for reading=2C we are all waiting in excitement to welcome you a= t DevDays Vilnius on 22-24 May! Best regards=2C DevDays Vilnius Team https://devdays.lt/ https://www.facebook.com/DevDaysVilnius/ https://twitter.com/DevDaysVilnius =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Want to change how you receive these emails? You can ** update your preferences (https://dataminer.us18.list-manage.com= /profile?u=3D33d0bcdf51cc41cf6c5949fd3&id=3D139c8b764e&e=3D8c56308cca) or ** unsubscribe from this list (https://dataminer.us18.list-manage.com/u= nsubscribe?u=3D33d0bcdf51cc41cf6c5949fd3&id=3D139c8b764e&e=3D8c56308cca&c=3D= 89819ad7ed) =2E From owner-svn-src-head@freebsd.org Wed Apr 18 11:02:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63ED9FA87A8; Wed, 18 Apr 2018 11:02:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16AFB6FD28; Wed, 18 Apr 2018 11:02:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1180C1A22F; Wed, 18 Apr 2018 11:02:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IB2J05094430; Wed, 18 Apr 2018 11:02:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IB2JMH094429; Wed, 18 Apr 2018 11:02:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201804181102.w3IB2JMH094429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 18 Apr 2018 11:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332664 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 332664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 11:02:20 -0000 Author: oshogbo Date: Wed Apr 18 11:02:19 2018 New Revision: 332664 URL: https://svnweb.freebsd.org/changeset/base/332664 Log: Add missing argument in the cnv man page. Reported by: MiÅ‚osz Kaniewski MFC after: 1 week Sponsored by: Wheel Systems Modified: head/share/man/man9/cnv.9 Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Wed Apr 18 05:58:27 2018 (r332663) +++ head/share/man/man9/cnv.9 Wed Apr 18 11:02:19 2018 (r332664) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2017 +.Dd April 18, 2018 .Dt CNV 9 .Os .Sh NAME @@ -66,27 +66,27 @@ .Fn cnvlist_get_descriptor_array "void *cookiep" "size_t *nitemsp" .\" .Ft bool -.Fn cnvlist_take_bool "void *cookiep" +.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookiep" .Ft uint64_t -.Fn cnvlist_take_number "void *cookiep" +.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookiep" .Ft "const char *" -.Fn cnvlist_take_string "void *cookiep" +.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookiep" .Ft "const nvlist_t *" -.Fn cnvlist_take_nvlist "void *cookiep" +.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookiep" .Ft "const void *" -.Fn cnvlist_take_binary "void *cookiep" "size_t *sizep" +.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookiep" "size_t *sizep" .Ft "const bool *" -.Fn cnvlist_take_bool_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" .Ft "const uint64_t *" -.Fn cnvlist_take_number_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" .Ft "const char * const *" -.Fn cnvlist_take_string_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" .Ft "const nvlist_t * const *" -.Fn cnvlist_take_nvlist_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" .Ft int -.Fn cnvlist_take_descriptor "void *cookiep" +.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookiep" .Ft "const int *" -.Fn cnvlist_take_descriptor_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" .\" .Ft void .Fn cnvlist_free_null "nvlist_t *nvl" "void *cookiep" From owner-svn-src-head@freebsd.org Wed Apr 18 13:17:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D67F1F8A582; Wed, 18 Apr 2018 13:17:15 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84BEA6B9C0; Wed, 18 Apr 2018 13:17:15 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DFCC1B6C7; Wed, 18 Apr 2018 13:17:15 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IDHFOQ059592; Wed, 18 Apr 2018 13:17:15 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IDHE2L059588; Wed, 18 Apr 2018 13:17:14 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201804181317.w3IDHE2L059588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 18 Apr 2018 13:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332671 - head/contrib/top X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: head/contrib/top X-SVN-Commit-Revision: 332671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 13:17:16 -0000 Author: lidl Date: Wed Apr 18 13:17:14 2018 New Revision: 332671 URL: https://svnweb.freebsd.org/changeset/base/332671 Log: top: fix warnings from clang/gcc Add includes for and where necessary, and rename a few internal functions to have a "top_" prefix to avoid clashes with standard names from curses.h/termcap.h headers. Top now compiles without warnings on both gcc and clang. Reviewed by: emaste, imp, jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15115 Modified: head/contrib/top/display.c head/contrib/top/screen.c head/contrib/top/screen.h head/contrib/top/top.c Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Wed Apr 18 12:56:17 2018 (r332670) +++ head/contrib/top/display.c Wed Apr 18 13:17:14 2018 (r332671) @@ -32,7 +32,9 @@ #include +#include #include +#include #include #include @@ -255,7 +257,7 @@ double *avenrun; register int i; /* i_loadave also clears the screen, since it is first */ - clear(); + top_clear(); /* mpid == -1 implies this system doesn't have an _mpid */ if (mpid != -1) @@ -796,7 +798,7 @@ i_message() } if (next_msg[0] != '\0') { - standout(next_msg); + top_standout(next_msg); msglen = strlen(next_msg); next_msg[0] = '\0'; } @@ -1076,7 +1078,7 @@ caddr_t a1, a2, a3; i = strlen(next_msg); if ((type & MT_delayed) == 0) { - type & MT_standout ? standout(next_msg) : + type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); (void) clear_eol(msglen - i); msglen = i; @@ -1088,7 +1090,7 @@ caddr_t a1, a2, a3; { if ((type & MT_delayed) == 0) { - type & MT_standout ? standout(next_msg) : fputs(next_msg, stdout); + type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); msglen = strlen(next_msg); next_msg[0] = '\0'; } Modified: head/contrib/top/screen.c ============================================================================== --- head/contrib/top/screen.c Wed Apr 18 12:56:17 2018 (r332670) +++ head/contrib/top/screen.c Wed Apr 18 13:17:14 2018 (r332671) @@ -45,6 +45,8 @@ # endif # endif #endif +#include +#include #include "screen.h" #include "boolean.h" @@ -432,10 +434,7 @@ get_screensize() } void -standout(msg) - -char *msg; - +top_standout(char *msg) { if (smart_terminal) { @@ -450,8 +449,7 @@ char *msg; } void -clear() - +top_clear() { if (smart_terminal) { @@ -460,10 +458,7 @@ clear() } int -clear_eol(len) - -int len; - +clear_eol(int len) { if (smart_terminal && !overstrike && len > 0) { @@ -496,12 +491,8 @@ go_home() /* This has to be defined as a subroutine for tputs (instead of a macro) */ -void -putstdout(ch) - -char ch; - +int +putstdout(int ch) { - putchar(ch); + return putchar(ch); } - Modified: head/contrib/top/screen.h ============================================================================== --- head/contrib/top/screen.h Wed Apr 18 12:56:17 2018 (r332670) +++ head/contrib/top/screen.h Wed Apr 18 13:17:14 2018 (r332671) @@ -28,10 +28,10 @@ extern int screen_length; extern int screen_width; /* a function that puts a single character on stdout */ -void putstdout(char ch); +int putstdout(int ch); int clear_eol(int len); -void standout(char *msg); -void clear(void); +void top_standout(char *msg); +void top_clear(void); void go_home(void); void reinit_screen(void); void get_screensize(void); Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Wed Apr 18 12:56:17 2018 (r332670) +++ head/contrib/top/top.c Wed Apr 18 13:17:14 2018 (r332671) @@ -39,6 +39,7 @@ char *copyright = #include #include +#include #include #include #include @@ -79,7 +80,7 @@ int pcpu_stats = No; sigret_t leave(); sigret_t tstop(); #ifdef SIGWINCH -sigret_t winch(); +sigret_t top_winch(int); #endif volatile sig_atomic_t leaveflag; @@ -682,7 +683,7 @@ char *argv[]; (void) signal(SIGQUIT, leave); (void) signal(SIGTSTP, tstop); #ifdef SIGWINCH - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, top_winch); #endif #ifdef SIGRELSE sigrelse(SIGINT); @@ -897,7 +898,7 @@ restart: max_topn = display_resize(); /* reset the signal handler */ - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, top_winch); reset_display(); winchflag = 0; @@ -971,9 +972,9 @@ restart: case CMD_help1: /* help */ case CMD_help2: reset_display(); - clear(); + top_clear(); show_help(); - standout("Hit any key to continue: "); + top_standout("Hit any key to continue: "); fflush(stdout); (void) read(0, &ch, 1); break; @@ -989,9 +990,9 @@ restart: else { reset_display(); - clear(); + top_clear(); show_errors(); - standout("Hit any key to continue: "); + top_standout("Hit any key to continue: "); fflush(stdout); (void) read(0, &ch, 1); } @@ -1300,10 +1301,7 @@ int i; } #ifdef SIGWINCH -sigret_t winch(i) /* SIGWINCH handler */ - -int i; - +sigret_t top_winch(int i) /* SIGWINCH handler */ { winchflag = 1; } From owner-svn-src-head@freebsd.org Wed Apr 18 13:58:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84659F8CF82; Wed, 18 Apr 2018 13:58:43 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37BCD7395C; Wed, 18 Apr 2018 13:58:43 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 327761BD21; Wed, 18 Apr 2018 13:58:43 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IDwg6S088702; Wed, 18 Apr 2018 13:58:42 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IDwgpq088701; Wed, 18 Apr 2018 13:58:42 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804181358.w3IDwgpq088701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 18 Apr 2018 13:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332672 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 332672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 13:58:43 -0000 Author: br Date: Wed Apr 18 13:58:42 2018 New Revision: 332672 URL: https://svnweb.freebsd.org/changeset/base/332672 Log: Set correct float abi (float abi double) for hard-float build, so __riscv_float_abi_double macro will be defined by compiler. The options are: o lp64 __riscv_float_abi_soft o lp64f __riscv_float_abi_single o lp64d __riscv_float_abi_double Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Apr 18 13:17:14 2018 (r332671) +++ head/share/mk/bsd.cpu.mk Wed Apr 18 13:58:42 2018 (r332672) @@ -370,8 +370,8 @@ CFLAGS += -mcpu=8540 -Wa,-me500 -mspe=yes -mabi=spe -m CFLAGS += -march=rv64imac -mabi=lp64 ACFLAGS += -march=rv64imac -mabi=lp64 .else -CFLAGS += -march=rv64imafdc -mabi=lp64 -ACFLAGS += -march=rv64imafdc -mabi=lp64 +CFLAGS += -march=rv64imafdc -mabi=lp64d +ACFLAGS += -march=rv64imafdc -mabi=lp64d .endif .endif From owner-svn-src-head@freebsd.org Wed Apr 18 14:02:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B85C3F8D4E4; Wed, 18 Apr 2018 14:02:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 644D474F17; Wed, 18 Apr 2018 14:02:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C21D1BEAA; Wed, 18 Apr 2018 14:02:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IE2bYg093660; Wed, 18 Apr 2018 14:02:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IE2bpl093659; Wed, 18 Apr 2018 14:02:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804181402.w3IE2bpl093659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 18 Apr 2018 14:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332673 - head/tools/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools X-SVN-Commit-Revision: 332673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 14:02:37 -0000 Author: emaste Date: Wed Apr 18 14:02:37 2018 New Revision: 332673 URL: https://svnweb.freebsd.org/changeset/base/332673 Log: Remove mention of tools/recoverdisk, now in sbin PR: 227570 MFC after: 3 days Modified: head/tools/tools/README Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Wed Apr 18 13:58:42 2018 (r332672) +++ head/tools/tools/README Wed Apr 18 14:02:37 2018 (r332673) @@ -55,7 +55,6 @@ pciid Generate src/share/misc/pci_vendors. pciroms A tool for dumping PCI ROM images. WARNING: alpha quality. pirtool A tool for dumping the $PIR table on i386 machines at runtime. portsinfo Generate list of new ports for last two weeks. -recoverdisk Copy as much data as possible from a defective disk. scsi-defects Get at the primary or grown defect list of a SCSI disk. sysdoc Build a manual page with available sysctls for a specific kernel configuration. From owner-svn-src-head@freebsd.org Wed Apr 18 14:34:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05497F8FA50; Wed, 18 Apr 2018 14:34:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CE7F7C552; Wed, 18 Apr 2018 14:34:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0941C360; Wed, 18 Apr 2018 14:34:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IEYYH6008774; Wed, 18 Apr 2018 14:34:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IEYY9C008770; Wed, 18 Apr 2018 14:34:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804181434.w3IEYY9C008770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 18 Apr 2018 14:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332674 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 332674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 14:34:35 -0000 Author: gjb Date: Wed Apr 18 14:34:33 2018 New Revision: 332674 URL: https://svnweb.freebsd.org/changeset/base/332674 Log: Increase the msdosfs partition size on arm SoC images where the current size may not be sufficiently large for development and/or testing. PR: 227548 Submitted by: trasz MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/GUMSTIX.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Wed Apr 18 14:02:37 2018 (r332673) +++ head/release/arm/BEAGLEBONE.conf Wed Apr 18 14:34:33 2018 (r332674) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="3072M" KERNEL="GENERIC" Modified: head/release/arm/GUMSTIX.conf ============================================================================== --- head/release/arm/GUMSTIX.conf Wed Apr 18 14:02:37 2018 (r332673) +++ head/release/arm/GUMSTIX.conf Wed Apr 18 14:34:33 2018 (r332674) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="arm" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="3072M" KERNEL="GUMSTIX" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Wed Apr 18 14:02:37 2018 (r332673) +++ head/release/arm/PANDABOARD.conf Wed Apr 18 14:34:33 2018 (r332674) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="3072M" KERNEL="GENERIC" Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Wed Apr 18 14:02:37 2018 (r332673) +++ head/release/arm/RPI-B.conf Wed Apr 18 14:34:33 2018 (r332674) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" -FAT_SIZE="17m" +FAT_SIZE="41m" FAT_TYPE="16" IMAGE_SIZE="3072M" KERNEL="RPI-B" From owner-svn-src-head@freebsd.org Wed Apr 18 15:34:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B24FCF952BD; Wed, 18 Apr 2018 15:34:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB286DB46; Wed, 18 Apr 2018 15:34:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 553451CD46; Wed, 18 Apr 2018 15:34:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IFYJGU040434; Wed, 18 Apr 2018 15:34:19 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IFYJCq040433; Wed, 18 Apr 2018 15:34:19 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804181534.w3IFYJCq040433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 18 Apr 2018 15:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332729 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 15:34:20 -0000 Author: shurd Date: Wed Apr 18 15:34:18 2018 New Revision: 332729 URL: https://svnweb.freebsd.org/changeset/base/332729 Log: iflib: Fix queue distribution when there are no threads Previously, if there are no threads, all queues which targeted cores that share an L2 cache were bound to a single core. The intent is to distribute them across these cores. Reported by: olivier Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15120 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Apr 18 14:55:01 2018 (r332728) +++ head/sys/net/iflib.c Wed Apr 18 15:34:18 2018 (r332729) @@ -5117,13 +5117,18 @@ find_child_with_core(int cpu, struct cpu_group *grp) } /* - * Find the nth thread on the specified core + * Find the nth "close" core to the specified core + * "close" is defined as the deepest level that shares + * at least an L2 cache. With threads, this will be + * threads on the same core. If the sahred cache is L3 + * or higher, simply returns the same core. */ static int -find_thread(int cpu, int thread_num) +find_close_core(int cpu, int core_offset) { struct cpu_group *grp; int i; + int fcpu; cpuset_t cs; grp = cpu_top; @@ -5143,7 +5148,19 @@ find_thread(int cpu, int thread_num) /* Now pick one */ CPU_COPY(&grp->cg_mask, &cs); - for (i = thread_num % grp->cg_count; i > 0; i--) { + + /* Add the selected CPU offset to core offset. */ + for (i = 0; (fcpu = CPU_FFS(&cs)) != 0; i++) { + if (fcpu - 1 == cpu) + break; + CPU_CLR(fcpu - 1, &cs); + } + MPASS(fcpu); + + core_offset += i; + + CPU_COPY(&grp->cg_mask, &cs); + for (i = core_offset % grp->cg_count; i > 0; i--) { MPASS(CPU_FFS(&cs)); CPU_CLR(CPU_FFS(&cs) - 1, &cs); } @@ -5152,31 +5169,31 @@ find_thread(int cpu, int thread_num) } #else static int -find_thread(int cpu, int thread_num __unused) +find_close_core(int cpu, int core_offset __unused) { return cpu; } #endif static int -get_thread_num(if_ctx_t ctx, iflib_intr_type_t type, int qid) +get_core_offset(if_ctx_t ctx, iflib_intr_type_t type, int qid) { switch (type) { case IFLIB_INTR_TX: - /* TX queues get threads on the same core as the corresponding RX queue */ - /* XXX handle multiple RX threads per core and more than two threads per core */ + /* TX queues get cores which share at least an L2 cache with the corresponding RX queue */ + /* XXX handle multiple RX threads per core and more than two core per L2 group */ return qid / CPU_COUNT(&ctx->ifc_cpus) + 1; case IFLIB_INTR_RX: case IFLIB_INTR_RXTX: - /* RX queues get the first thread on their core */ + /* RX queues get the specified core */ return qid / CPU_COUNT(&ctx->ifc_cpus); default: return -1; } } #else -#define get_thread_num(ctx, type, qid) CPU_FIRST() -#define find_thread(cpuid, tid) CPU_FIRST() +#define get_core_offset(ctx, type, qid) CPU_FIRST() +#define find_close_core(cpuid, tid) CPU_FIRST() #define find_nth(ctx, gid) CPU_FIRST() #endif @@ -5189,9 +5206,9 @@ iflib_irq_set_affinity(if_ctx_t ctx, int irq, iflib_in int err, tid; cpuid = find_nth(ctx, qid); - tid = get_thread_num(ctx, type, qid); + tid = get_core_offset(ctx, type, qid); MPASS(tid >= 0); - cpuid = find_thread(cpuid, tid); + cpuid = find_close_core(cpuid, tid); err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, irq, name); if (err) { device_printf(ctx->ifc_dev, "taskqgroup_attach_cpu failed %d\n", err); From owner-svn-src-head@freebsd.org Wed Apr 18 15:44:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C25F95D65; Wed, 18 Apr 2018 15:44:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E5DD70EA7; Wed, 18 Apr 2018 15:44:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 453DC1CEF1; Wed, 18 Apr 2018 15:44:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IFit7W045392; Wed, 18 Apr 2018 15:44:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IFisf7045389; Wed, 18 Apr 2018 15:44:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804181544.w3IFisf7045389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 Apr 2018 15:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332730 - in head/sys: amd64/amd64 i386/i386 powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 powerpc/powerpc X-SVN-Commit-Revision: 332730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 15:44:55 -0000 Author: avg Date: Wed Apr 18 15:44:54 2018 New Revision: 332730 URL: https://svnweb.freebsd.org/changeset/base/332730 Log: don't check for kdb reentry in trap_fatal(), it's impossible trap() checks for it earlier and calls kdb_reentry(). Discussed with: jhb MFC after: 12 days Sponsored by: Panzura Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c head/sys/powerpc/powerpc/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Apr 18 15:34:18 2018 (r332729) +++ head/sys/amd64/amd64/trap.c Wed Apr 18 15:44:54 2018 (r332730) @@ -811,7 +811,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic || kdb_active) + if (debugger_on_panic) if (kdb_trap(type, 0, frame)) return; #endif Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Apr 18 15:34:18 2018 (r332729) +++ head/sys/i386/i386/trap.c Wed Apr 18 15:44:54 2018 (r332730) @@ -937,7 +937,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic || kdb_active) { + if (debugger_on_panic) { frame->tf_err = eva; /* smuggle fault address to ddb */ if (kdb_trap(type, 0, frame)) { frame->tf_err = code; /* restore error code */ Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Wed Apr 18 15:34:18 2018 (r332729) +++ head/sys/powerpc/powerpc/trap.c Wed Apr 18 15:44:54 2018 (r332730) @@ -452,8 +452,7 @@ trap_fatal(struct trapframe *frame) printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if ((debugger_on_panic || kdb_active) && - kdb_trap(frame->exc, 0, frame)) + if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) return; #endif panic("%s trap", trapname(frame->exc)); From owner-svn-src-head@freebsd.org Wed Apr 18 18:36:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BA4FFA11C5; Wed, 18 Apr 2018 18:36:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1EAD77DE7; Wed, 18 Apr 2018 18:36:26 +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 B81CD1EA15; Wed, 18 Apr 2018 18:36:26 +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 w3IIaQ0c032049; Wed, 18 Apr 2018 18:36:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IIaQ6N032048; Wed, 18 Apr 2018 18:36:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804181836.w3IIaQ6N032048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Apr 2018 18:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332733 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 332733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 18:36:27 -0000 Author: jhb Date: Wed Apr 18 18:36:26 2018 New Revision: 332733 URL: https://svnweb.freebsd.org/changeset/base/332733 Log: Workaround fixed I/O port resources encoded as I/O port ranges in _CRS. ACPI I/O port descriptors use _MIN and _MAX fields to specify the set of allowable base (start) addresses for an I/O port resource along with a _LEN field specifying the length. A fixed resource is supposed to be encoded with _MIN == _MAX, but some buggy firmwares instead set _MAX to the end of the fixed range. Relocating I/O ranges only make sense in _PRS (possible resource settings), not in _CRS (current resource settings), so if an I/O port range with _MAX set set to the end of the range is present in _CRS, treat it as a fixed I/O port resource starting at _MIN. PR: 224096 Submitted by: Harald Böhm Pointy hat to: jhb (taking so long to actually commit this) MFC after: 1 week Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Wed Apr 18 16:27:06 2018 (r332732) +++ head/sys/dev/acpica/acpi_resource.c Wed Apr 18 18:36:26 2018 (r332733) @@ -530,6 +530,24 @@ acpi_res_set_iorange(device_t dev, void *context, uint if (cp == NULL) return; + + /* + * XXX: Some BIOSes contain buggy _CRS entries where fixed I/O + * ranges have the maximum base address (_MAX) to the end of the + * I/O range instead of the start. These are then treated as a + * relocatable I/O range rather than a fixed I/O resource. As a + * workaround, treat I/O resources encoded this way as fixed I/O + * ports. + */ + if (high == (low + length)) { + if (bootverbose) + device_printf(dev, + "_CRS has fixed I/O port range defined as relocatable\n"); + + bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); + return; + } + device_printf(dev, "I/O range not supported\n"); } From owner-svn-src-head@freebsd.org Wed Apr 18 18:45:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39DCDFA1C4C; Wed, 18 Apr 2018 18:45:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E202E7ADDC; Wed, 18 Apr 2018 18:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC5381EBB7; Wed, 18 Apr 2018 18:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3IIjYMM037259; Wed, 18 Apr 2018 18:45:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IIjYdt037258; Wed, 18 Apr 2018 18:45:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804181845.w3IIjYdt037258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Apr 2018 18:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332735 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 332735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 18:45:35 -0000 Author: jhb Date: Wed Apr 18 18:45:34 2018 New Revision: 332735 URL: https://svnweb.freebsd.org/changeset/base/332735 Log: Fix two off-by-one errors when allocating MSI and MSI-X interrupts. x86 enforces an (arbitray) limit on the number of available MSI and MSI-X interrupts to simplify code (in particular, interrupt_source[] is statically sized). This means that an attempt to allocate an MSI vector needs to fail if it would go beyond the limit, but the checks for exceeding the limit had an off-by-one error. In the case of MSI-X which allocates interrupts one at a time this meant that IRQ 768 kept getting handed out multiple times for msix_alloc() instead of failing because all MSI IRQs were in use. Tested by: lidl MFC after: 1 week Modified: head/sys/x86/x86/msi.c Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Wed Apr 18 18:45:04 2018 (r332734) +++ head/sys/x86/x86/msi.c Wed Apr 18 18:45:34 2018 (r332735) @@ -404,7 +404,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) { + if (i + (count - cnt) >= FIRST_MSI_INT + NUM_MSI_INTS) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -645,7 +645,7 @@ again: /* Do we need to create a new source? */ if (msi == NULL) { /* If we would exceed the max, give up. */ - if (i + 1 > FIRST_MSI_INT + NUM_MSI_INTS) { + if (i + 1 >= FIRST_MSI_INT + NUM_MSI_INTS) { mtx_unlock(&msi_lock); return (ENXIO); } From owner-svn-src-head@freebsd.org Wed Apr 18 20:07:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43055FA69CB; Wed, 18 Apr 2018 20:07:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E64226F6A2; Wed, 18 Apr 2018 20:07:47 +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 DB2A91F8FD; Wed, 18 Apr 2018 20:07:47 +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 w3IK7lEo077468; Wed, 18 Apr 2018 20:07:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IK7lwN077467; Wed, 18 Apr 2018 20:07:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804182007.w3IK7lwN077467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Apr 2018 20:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332737 - 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: 332737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 20:07:48 -0000 Author: kib Date: Wed Apr 18 20:07:47 2018 New Revision: 332737 URL: https://svnweb.freebsd.org/changeset/base/332737 Log: For fatal traps other than pagefaults, print raw fault error codes. For pagefaults, the error is already decoded and printed. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Apr 18 19:18:14 2018 (r332736) +++ head/sys/i386/i386/trap.c Wed Apr 18 20:07:47 2018 (r332737) @@ -904,6 +904,8 @@ trap_fatal(frame, eva) "", code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); + } else { + printf("error code = %#x\n", code); } printf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip); From owner-svn-src-head@freebsd.org Wed Apr 18 20:09:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D930DFA6ABF; Wed, 18 Apr 2018 20:09:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B6F97062C; Wed, 18 Apr 2018 20:09:26 +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 831441F8FE; Wed, 18 Apr 2018 20:09:26 +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 w3IK9Q6C077567; Wed, 18 Apr 2018 20:09:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IK9QIN077566; Wed, 18 Apr 2018 20:09:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804182009.w3IK9QIN077566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Apr 2018 20:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332738 - 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: 332738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 20:09:27 -0000 Author: kib Date: Wed Apr 18 20:09:26 2018 New Revision: 332738 URL: https://svnweb.freebsd.org/changeset/base/332738 Log: Fix pmap_trm_alloc(M_ZERO). Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Apr 18 20:07:47 2018 (r332737) +++ head/sys/i386/i386/pmap.c Wed Apr 18 20:09:26 2018 (r332738) @@ -5630,6 +5630,8 @@ pmap_trm_alloc(size_t size, int flags) 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags | M_FIRSTFIT, &res); if (error != 0) return (NULL); + if ((flags & M_ZERO) != 0) + bzero((void *)res, size); return ((void *)res); } From owner-svn-src-head@freebsd.org Wed Apr 18 21:15:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F5D0F8118D; Wed, 18 Apr 2018 21:15:38 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660067.outbound.protection.outlook.com [40.107.66.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88FF680AD5; Wed, 18 Apr 2018 21:15:37 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM (52.132.66.153) by YQBPR0101MB1252.CANPRD01.PROD.OUTLOOK.COM (52.132.68.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.12; Wed, 18 Apr 2018 21:15:36 +0000 Received: from YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::893c:efc2:d71f:945a]) by YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM ([fe80::893c:efc2:d71f:945a%13]) with mapi id 15.20.0696.013; Wed, 18 Apr 2018 21:15:36 +0000 From: Rick Macklem To: Julian Elischer , Konstantin Belousov CC: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r332559 - head/usr.sbin/mountd Thread-Topic: svn commit: r332559 - head/usr.sbin/mountd Thread-Index: AQHT1d2LvqfGyf/rSkGmX+1c3ssiQaQE5HwAgAESHgCAAQ1uCQ== Date: Wed, 18 Apr 2018 21:15:36 +0000 Message-ID: References: <20180417123212.GM1774@kib.kiev.ua>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQBPR0101MB1252; 7:S+aUh+9q9NBnYcWyZoI6c/itw8uqd20bJgFNwxuIdmYY9MvM31p28evaoItVXTqpKWj5IGrknCEDmX6oGd0QbXfk53FT+WoWWrULOO/QfsQJijgEJGrXuK0k3LhMQter9wX6yu+ajPDFKFK9utP6tlNhXB5OflUnKKRWOCWaqXUTSb2q7O7loSSLvpNPyxNAKZP1bfLml2knP86rOyVRe2IBcfrrXJvwOPds1BYDBr/DaH7CQj+p1VljLrJpNYML x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7153060)(7193020); SRVR:YQBPR0101MB1252; x-ms-traffictypediagnostic: YQBPR0101MB1252: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231232)(944501327)(52105095)(93006095)(93001095)(6041310)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:YQBPR0101MB1252; BCL:0; PCL:0; RULEID:; SRVR:YQBPR0101MB1252; x-forefront-prvs: 06469BCC91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(376002)(346002)(39860400002)(366004)(186003)(316002)(81166006)(5660300001)(8936002)(786003)(2900100001)(6436002)(86362001)(3280700002)(110136005)(3660700001)(54906003)(33656002)(74482002)(25786009)(6506007)(26005)(102836004)(4326008)(6246003)(39060400002)(446003)(53936002)(476003)(14454004)(11346002)(5250100002)(7696005)(55016002)(229853002)(76176011)(9686003)(478600001)(305945005)(2906002)(8676002)(74316002)(59450400001)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1252; H:YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; MLV:ovrnspm; PTR:InfoNoRecords; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: fvFyXHAhfHoG9pFKqP+9OOY0W+0o7ifrF2tiuMBxvJMAUOeE+TcFLssYKe94gA2uhtNSK6OYh7KbPcVWHrU6KTe/H1p8bZx5jlO6vWAZJ2GaTsWGOU59Vf/4q4eku6/ZMHd+p0nCYpE8p4Ewq1IVDnnBnE8N55KrNM3UNoN8u9cAbZ5C3TIhcVT7MtDGWEY6 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 02ebc62b-a564-46f9-f257-08d5a5718740 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 02ebc62b-a564-46f9-f257-08d5a5718740 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2018 21:15:36.1548 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1252 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 21:15:38 -0000 Julian Elischer wrote: [stuff snipped] >our issue is that we make a server that combines CIFS/SMB access (via >samba), credential setting from a company wide AD server (windows) >via winbindd (samba) via nsswitch.. and NFS. > >The problem is that when one looks up a user name from the AD server >One can get back a credential with a large number of groups, because >some companies use windows groups extensively. SO a sinel user may be >in a group for every project they are involved with and a method of >giving them access to files related to a project. >In this scenario a group manager may be given access to a lot of groups. > >A user looking at a file via NFS needs to be able to see what he needs >and still be blocked as per company policy. >I am investigating the new user-manager daemon may help but I don't >fully understand it yet. >I gather it maps an incoming request to a set of groups as defined on >the server rather than on the client, but I'm not sure yet how that >relates to mountd. I am happy to say I know nothing about AD, but I thought it included an LDAP service? If there is a way to configure FreeBSD so that getgrouplist(3= ) gets this list of AD groups, then "nfsuserd -manage-gids" on the NFS server should do what you want. (It takes the "uid" from the AUTH_SYS RPC request header and then creates a list of groups for that "uid" via getgrouplist(3)= . It basically does a getpwuid() and then uses the pw_name as the first arg to getgrouplist(3). It ignores the list of groups in the RPC header and, therefore, is not limi= ted to 16.) =20 If getgrouplist(3) can't see the set of AD groups, then something needs to = be done to make that work. rick From owner-svn-src-head@freebsd.org Wed Apr 18 21:31:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8903F82366; Wed, 18 Apr 2018 21:31: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BCE2841CF; Wed, 18 Apr 2018 21:31: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 86834205D5; Wed, 18 Apr 2018 21:31: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 w3ILVE6J018067; Wed, 18 Apr 2018 21:31:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ILVDtB018055; Wed, 18 Apr 2018 21:31:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804182131.w3ILVDtB018055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Apr 2018 21:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332740 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/kern X-SVN-Commit-Revision: 332740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 21:31:15 -0000 Author: kib Date: Wed Apr 18 21:31:13 2018 New Revision: 332740 URL: https://svnweb.freebsd.org/changeset/base/332740 Log: Add PROC_PDEATHSIG_SET to procctl interface. Allow processes to request the delivery of a signal upon death of their parent process. Supposed consumer of the feature is PostgreSQL. Submitted by: Thomas Munro Reviewed by: jilles, mjg MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15106 Added: head/tests/sys/kern/pdeathsig.c (contents, props changed) head/tests/sys/kern/pdeathsig_helper.c (contents, props changed) Modified: head/lib/libc/sys/procctl.2 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_procctl.c head/sys/kern/kern_thread.c head/sys/sys/proc.h head/sys/sys/procctl.h head/tests/sys/kern/Makefile Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Wed Apr 18 20:31:42 2018 (r332739) +++ head/lib/libc/sys/procctl.2 Wed Apr 18 21:31:13 2018 (r332740) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2017 +.Dd April 18, 2018 .Dt PROCCTL 2 .Os .Sh NAME @@ -391,6 +391,37 @@ otherwise. See the note about sysctl .Dv kern.trap_enotcap above, which gives independent global control of signal delivery. +.It Dv PROC_PDEATHSIG_SET +Request the delivery of a signal when the parent of the calling +process exits. +.Fa idtype +must be +.Dv P_PID +and +.Fa id +must be the either caller's pid or zero, with no difference in effect. +The value is cleared for child processes +and when executing set-user-ID or set-group-ID binaries. +.Fa arg +must point to a value of type +.Vt int +indicating the signal +that should be delivered to the caller. +Use zero to cancel a previously requested signal delivery. +.It Dv PROC_PDEATHSIG_GET +Query the current signal number that will be delivered when the parent +of the calling process exits. +.Fa idtype +must be +.Dv P_PID +and +.Fa id +must be the either caller's pid or zero, with no difference in effect. +.Fa arg +must point to a memory location that can hold a value of type +.Vt int . +If signal delivery has not been requested, it will contain zero +on return. .El .Sh NOTES Disabling tracing on a process should not be considered a security @@ -487,6 +518,15 @@ parameter for the or .Dv PROC_TRAPCAP_CTL request is invalid. +.It Bq Er EINVAL +The +.Dv PROC_PDEATHSIG_SET +or +.Dv PROC_PDEATHSIG_GET +request referenced an unsupported +.Fa id , +.Fa idtype +or invalid signal number. .El .Sh SEE ALSO .Xr dtrace 1 , @@ -506,3 +546,8 @@ function appeared in The reaper facility is based on a similar feature of Linux and DragonflyBSD, and first appeared in .Fx 10.2 . +The +.Dv PROC_PDEATHSIG_SET +facility is based on the prctl(PR_SET_PDEATHSIG, ...) feature of Linux, +and first appeared in +.Fx 12.0 . Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 18 21:31:13 2018 (r332740) @@ -3352,7 +3352,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ union { struct procctl_reaper_pids32 rp; } x32; - int error, error1, flags; + int error, error1, flags, signum; switch (uap->com) { case PROC_SPROTECT: @@ -3390,6 +3390,15 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ case PROC_TRAPCAP_STATUS: data = &flags; break; + case PROC_PDEATHSIG_SET: + error = copyin(uap->data, &signum, sizeof(signum)); + if (error != 0) + return (error); + data = &signum; + break; + case PROC_PDEATHSIG_GET: + data = &signum; + break; default: return (EINVAL); } @@ -3409,6 +3418,10 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ case PROC_TRAPCAP_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); + break; + case PROC_PDEATHSIG_GET: + if (error == 0) + error = copyout(&signum, uap->data, sizeof(signum)); break; } return (error); Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/kern/kern_exec.c Wed Apr 18 21:31:13 2018 (r332740) @@ -522,6 +522,10 @@ interpret: credential_changing |= will_transition; #endif + /* Don't inherit PROC_PDEATHSIG_SET value if setuid/setgid. */ + if (credential_changing) + imgp->proc->p_pdeathsig = 0; + if (credential_changing && #ifdef CAPABILITY_MODE ((oldcred->cr_flags & CRED_FLAG_CAPMODE) == 0) && Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/kern/kern_exit.c Wed Apr 18 21:31:13 2018 (r332740) @@ -480,6 +480,12 @@ exit1(struct thread *td, int rval, int signo) PROC_LOCK(q->p_reaper); pksignal(q->p_reaper, SIGCHLD, ksi1); PROC_UNLOCK(q->p_reaper); + } else if (q->p_pdeathsig > 0) { + /* + * The child asked to received a signal + * when we exit. + */ + kern_psignal(q, q->p_pdeathsig); } } else { /* @@ -520,6 +526,13 @@ exit1(struct thread *td, int rval, int signo) */ while ((q = LIST_FIRST(&p->p_orphans)) != NULL) { PROC_LOCK(q); + /* + * If we are the real parent of this process + * but it has been reparented to a debugger, then + * check if it asked for a signal when we exit. + */ + if (q->p_pdeathsig > 0) + kern_psignal(q, q->p_pdeathsig); CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid, q->p_pid); clear_orphan(q); Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/kern/kern_procctl.c Wed Apr 18 21:31:13 2018 (r332740) @@ -431,7 +431,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua struct procctl_reaper_pids rp; struct procctl_reaper_kill rk; } x; - int error, error1, flags; + int error, error1, flags, signum; switch (uap->com) { case PROC_SPROTECT: @@ -467,6 +467,15 @@ sys_procctl(struct thread *td, struct procctl_args *ua case PROC_TRAPCAP_STATUS: data = &flags; break; + case PROC_PDEATHSIG_SET: + error = copyin(uap->data, &signum, sizeof(signum)); + if (error != 0) + return (error); + data = &signum; + break; + case PROC_PDEATHSIG_GET: + data = &signum; + break; default: return (EINVAL); } @@ -486,6 +495,10 @@ sys_procctl(struct thread *td, struct procctl_args *ua if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; + case PROC_PDEATHSIG_GET: + if (error == 0) + error = copyout(&signum, uap->data, sizeof(signum)); + break; } return (error); } @@ -527,6 +540,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t struct pgrp *pg; struct proc *p; int error, first_error, ok; + int signum; bool tree_locked; switch (com) { @@ -537,8 +551,31 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t case PROC_REAP_KILL: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: + case PROC_PDEATHSIG_SET: + case PROC_PDEATHSIG_GET: if (idtype != P_PID) return (EINVAL); + } + + switch (com) { + case PROC_PDEATHSIG_SET: + signum = *(int *)data; + p = td->td_proc; + if ((id != 0 && id != p->p_pid) || + (signum != 0 && !_SIG_VALID(signum))) + return (EINVAL); + PROC_LOCK(p); + p->p_pdeathsig = signum; + PROC_UNLOCK(p); + return (0); + case PROC_PDEATHSIG_GET: + p = td->td_proc; + if (id != 0 && id != p->p_pid) + return (EINVAL); + PROC_LOCK(p); + *(int *)data = p->p_pdeathsig; + PROC_UNLOCK(p); + return (0); } switch (com) { Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/kern/kern_thread.c Wed Apr 18 21:31:13 2018 (r332740) @@ -91,7 +91,7 @@ _Static_assert(offsetof(struct proc, p_pid) == 0xbc, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x3d0, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x3e0, +_Static_assert(offsetof(struct proc, p_comm) == 0x3e4, "struct proc KBI p_comm"); _Static_assert(offsetof(struct proc, p_emuldata) == 0x4b8, "struct proc KBI p_emuldata"); @@ -111,9 +111,9 @@ _Static_assert(offsetof(struct proc, p_pid) == 0x74, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x27c, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x288, +_Static_assert(offsetof(struct proc, p_comm) == 0x28c, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x314, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x318, "struct proc KBI p_emuldata"); #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/sys/proc.h Wed Apr 18 21:31:13 2018 (r332740) @@ -624,6 +624,7 @@ struct proc { u_int p_treeflag; /* (e) P_TREE flags */ int p_pendingexits; /* (c) Count of pending thread exits. */ struct filemon *p_filemon; /* (c) filemon-specific data. */ + int p_pdeathsig; /* (c) Signal from parent on exit. */ /* End area that is zeroed on creation. */ #define p_endzero p_magic Modified: head/sys/sys/procctl.h ============================================================================== --- head/sys/sys/procctl.h Wed Apr 18 20:31:42 2018 (r332739) +++ head/sys/sys/procctl.h Wed Apr 18 21:31:13 2018 (r332740) @@ -51,6 +51,8 @@ #define PROC_TRACE_STATUS 8 /* query tracing status */ #define PROC_TRAPCAP_CTL 9 /* trap capability errors */ #define PROC_TRAPCAP_STATUS 10 /* query trap capability status */ +#define PROC_PDEATHSIG_SET 11 /* set parent death signal */ +#define PROC_PDEATHSIG_GET 12 /* get parent death signal */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Wed Apr 18 20:31:42 2018 (r332739) +++ head/tests/sys/kern/Makefile Wed Apr 18 21:31:13 2018 (r332740) @@ -16,11 +16,13 @@ ATF_TESTS_C+= unix_seqpacket_test ATF_TESTS_C+= unix_passfd_test TEST_METADATA.unix_seqpacket_test+= timeout="15" ATF_TESTS_C+= waitpid_nohang +ATF_TESTS_C+= pdeathsig ATF_TESTS_SH+= coredump_phnum_test BINDIR= ${TESTSDIR} PROGS+= coredump_phnum_helper +PROGS+= pdeathsig_helper CFLAGS.sys_getrandom+= -I${SRCTOP}/sys/contrib/zstd/lib LIBADD.sys_getrandom+= zstd Added: head/tests/sys/kern/pdeathsig.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/pdeathsig.c Wed Apr 18 21:31:13 2018 (r332740) @@ -0,0 +1,343 @@ +/*- + * Copyright (c) 2018 Thomas Munro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void +dummy_signal_handler(int signum) +{ +} + +ATF_TC_WITHOUT_HEAD(arg_validation); +ATF_TC_BODY(arg_validation, tc) +{ + int signum; + int rc; + + /* bad signal */ + signum = 8888; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + ATF_CHECK_EQ(-1, rc); + ATF_CHECK_EQ(EINVAL, errno); + + /* bad id type */ + signum = SIGINFO; + rc = procctl(8888, 0, PROC_PDEATHSIG_SET, &signum); + ATF_CHECK_EQ(-1, rc); + ATF_CHECK_EQ(EINVAL, errno); + + /* bad id (pid that doesn't match mine or zero) */ + signum = SIGINFO; + rc = procctl(P_PID, (((getpid() + 1) % 10) + 100), + PROC_PDEATHSIG_SET, &signum); + ATF_CHECK_EQ(-1, rc); + ATF_CHECK_EQ(EINVAL, errno); + + /* null pointer */ + signum = SIGINFO; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, NULL); + ATF_CHECK_EQ(-1, rc); + ATF_CHECK_EQ(EFAULT, errno); + + /* good (pid == 0) */ + signum = SIGINFO; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + ATF_CHECK_EQ(0, rc); + + /* good (pid == my pid) */ + signum = SIGINFO; + rc = procctl(P_PID, getpid(), PROC_PDEATHSIG_SET, &signum); + ATF_CHECK_EQ(0, rc); + + /* check that we can read the signal number back */ + signum = 0xdeadbeef; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_GET, &signum); + ATF_CHECK_EQ(0, rc); + ATF_CHECK_EQ(SIGINFO, signum); +} + +ATF_TC_WITHOUT_HEAD(fork_no_inherit); +ATF_TC_BODY(fork_no_inherit, tc) +{ + int status; + int signum; + int rc; + + /* request a signal on parent death in the parent */ + signum = SIGINFO; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + + rc = fork(); + ATF_REQUIRE(rc != -1); + if (rc == 0) { + /* check that we didn't inherit the setting */ + signum = 0xdeadbeef; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_GET, &signum); + assert(rc == 0); + assert(signum == 0); + _exit(0); + } + + /* wait for the child to exit successfully */ + waitpid(rc, &status, 0); + ATF_CHECK_EQ(0, status); +} + +ATF_TC_WITHOUT_HEAD(exec_inherit); +ATF_TC_BODY(exec_inherit, tc) +{ + int status; + int rc; + + rc = fork(); + ATF_REQUIRE(rc != -1); + if (rc == 0) { + char exec_path[1024]; + int signum; + + /* compute the path of the helper executable */ + snprintf(exec_path, sizeof(exec_path), "%s/pdeathsig_helper", + atf_tc_get_config_var(tc, "srcdir")); + + /* request a signal on parent death and register a handler */ + signum = SIGINFO; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + assert(rc == 0); + + /* execute helper program: it asserts that it has the setting */ + rc = execl(exec_path, exec_path, NULL); + assert(rc == 0); + _exit(0); + } + + /* wait for the child to exit successfully */ + waitpid(rc, &status, 0); + ATF_CHECK_EQ(0, status); +} + +ATF_TC_WITHOUT_HEAD(signal_delivered); +ATF_TC_BODY(signal_delivered, tc) +{ + sigset_t sigset; + int signum; + int rc; + int pipe_ca[2]; + int pipe_cb[2]; + char buffer; + + rc = pipe(pipe_ca); + ATF_REQUIRE(rc == 0); + rc = pipe(pipe_cb); + ATF_REQUIRE(rc == 0); + + rc = fork(); + ATF_REQUIRE(rc != -1); + if (rc == 0) { + rc = fork(); + assert(rc >= 0); + if (rc == 0) { + /* process C */ + signum = SIGINFO; + + /* block signals so we can handle them synchronously */ + rc = sigfillset(&sigset); + assert(rc == 0); + rc = sigprocmask(SIG_SETMASK, &sigset, NULL); + assert(rc == 0); + + /* register a dummy handler or the kernel will not queue it */ + signal(signum, dummy_signal_handler); + + /* request a signal on death of our parent B */ + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + assert(rc == 0); + + /* tell B that we're ready for it to exit now */ + rc = write(pipe_cb[1], ".", 1); + assert(rc == 1); + + /* wait for B to die and signal us... */ + signum = 0xdeadbeef; + rc = sigwait(&sigset, &signum); + assert(rc == 0); + assert(signum == SIGINFO); + + /* tell A the test passed */ + rc = write(pipe_ca[1], ".", 1); + assert(rc == 1); + _exit(0); + } + + /* process B */ + + /* wait for C to tell us it is ready for us to exit */ + rc = read(pipe_cb[0], &buffer, 1); + assert(rc == 1); + + /* now we exit so that C gets a signal */ + _exit(0); + } + /* process A */ + + /* wait for C to tell us the test passed */ + rc = read(pipe_ca[0], &buffer, 1); + ATF_CHECK_EQ(1, rc); +} + +ATF_TC_WITHOUT_HEAD(signal_delivered_ptrace); +ATF_TC_BODY(signal_delivered_ptrace, tc) +{ + sigset_t sigset; + int signum; + int rc; + int pipe_ca[2]; + int pipe_db[2]; + int pipe_cd[2]; + char buffer; + int status; + + rc = pipe(pipe_ca); + ATF_REQUIRE(rc == 0); + rc = pipe(pipe_db); + ATF_REQUIRE(rc == 0); + rc = pipe(pipe_cd); + ATF_REQUIRE(rc == 0); + + rc = fork(); + ATF_REQUIRE(rc != -1); + if (rc == 0) { + pid_t c_pid; + + /* process B */ + + rc = fork(); + assert(rc >= 0); + if (rc == 0) { + /* process C */ + signum = SIGINFO; + + /* block signals so we can handle them synchronously */ + rc = sigfillset(&sigset); + assert(rc == 0); + rc = sigprocmask(SIG_SETMASK, &sigset, NULL); + assert(rc == 0); + + /* register a dummy handler or the kernel will not queue it */ + signal(signum, dummy_signal_handler); + + /* request a signal on parent death and register a handler */ + rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + assert(rc == 0); + + /* tell D we are ready for it to attach */ + rc = write(pipe_cd[1], ".", 1); + assert(rc == 1); + + /* wait for B to die and signal us... */ + signum = 0xdeadbeef; + rc = sigwait(&sigset, &signum); + assert(rc == 0); + assert(signum == SIGINFO); + + /* tell A the test passed */ + rc = write(pipe_ca[1], ".", 1); + assert(rc == 1); + _exit(0); + } + c_pid = rc; + + + /* fork another process to ptrace C */ + rc = fork(); + assert(rc >= 0); + if (rc == 0) { + + /* process D */ + rc = ptrace(PT_ATTACH, c_pid, 0, 0); + assert(rc == 0); + + waitpid(c_pid, &status, 0); + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGSTOP); + + rc = ptrace(PT_CONTINUE, c_pid, (caddr_t) 1, 0); + assert(rc == 0); + + /* tell B that we're ready for it to exit now */ + rc = write(pipe_db[1], ".", 1); + assert(rc == 1); + + waitpid(c_pid, &status, 0); + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGINFO); + + rc = ptrace(PT_CONTINUE, c_pid, (caddr_t) 1, + WSTOPSIG(status)); + assert(rc == 0); + + ptrace(PT_DETACH, c_pid, 0, 0); + + _exit(0); + } + + /* wait for D to tell us it is ready for us to exit */ + rc = read(pipe_db[0], &buffer, 1); + assert(rc == 1); + + /* now we exit so that C gets a signal */ + _exit(0); + } + + /* process A */ + + /* wait for C to tell us the test passed */ + rc = read(pipe_ca[0], &buffer, 1); + ATF_CHECK_EQ(1, rc); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, arg_validation); + ATF_TP_ADD_TC(tp, fork_no_inherit); + ATF_TP_ADD_TC(tp, exec_inherit); + ATF_TP_ADD_TC(tp, signal_delivered); + ATF_TP_ADD_TC(tp, signal_delivered_ptrace); + return (atf_no_error()); +} Added: head/tests/sys/kern/pdeathsig_helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/pdeathsig_helper.c Wed Apr 18 21:31:13 2018 (r332740) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2018 Thomas Munro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +int main(int argc, char **argv) +{ + int signum; + int rc; + + /* + * This program is executed by the pdeathsig test + * to check if the PROC_PDEATHSIG_SET setting was + * inherited. + */ + signum = 0xdeadbeef; + rc = procctl(P_PID, 0, PROC_PDEATHSIG_GET, &signum); + assert(rc == 0); + assert(signum == SIGINFO); + + return 0; +} From owner-svn-src-head@freebsd.org Wed Apr 18 22:24:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CE7AF86E1F; Wed, 18 Apr 2018 22:24:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA6E71E3A; Wed, 18 Apr 2018 22:24:45 +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 13BDF20F39; Wed, 18 Apr 2018 22:24:45 +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 w3IMOi4r047314; Wed, 18 Apr 2018 22:24:44 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IMOi4i047313; Wed, 18 Apr 2018 22:24:44 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804182224.w3IMOi4i047313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 18 Apr 2018 22:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332741 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 332741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 22:24:45 -0000 Author: mckusick Date: Wed Apr 18 22:24:44 2018 New Revision: 332741 URL: https://svnweb.freebsd.org/changeset/base/332741 Log: Check the inode type and only attempt to print block lists for regular files, directories, and symbolic links that require external storage. Correct the handling of files with holes and files that have one or more large blocks and end with a fragment. Reported by: bde Modified: head/tools/diag/prtblknos/prtblknos.c Modified: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- head/tools/diag/prtblknos/prtblknos.c Wed Apr 18 21:31:13 2018 (r332740) +++ head/tools/diag/prtblknos/prtblknos.c Wed Apr 18 22:24:44 2018 (r332741) @@ -49,21 +49,65 @@ prtblknos(disk, dp) struct uufsd *disk; union dinode *dp; { - int i, len, lbn, frags, numblks, blksperindir; + int i, len, lbn, mode, frags, numblks, blksperindir; ufs2_daddr_t blkno; struct fs *fs; off_t size; fs = (struct fs *)&disk->d_sb; - if (fs->fs_magic == FS_UFS1_MAGIC) + if (fs->fs_magic == FS_UFS1_MAGIC) { size = dp->dp1.di_size; - else + mode = dp->dp1.di_mode; + } else { size = dp->dp2.di_size; - numblks = howmany(size, fs->fs_bsize); - if (numblks == 0) { - printf(" empty file\n"); + mode = dp->dp2.di_mode; + } + switch (mode & IFMT) { + case IFIFO: + printf("fifo\n"); return; + case IFCHR: + printf("character device\n"); + return; + case IFBLK: + printf("block device\n"); + return; + case IFSOCK: + printf("socket\n"); + return; + case IFWHT: + printf("whiteout\n"); + return; + case IFLNK: + if (size == 0) { + printf("empty symbolic link\n"); + return; + } + if (size < fs->fs_maxsymlinklen) { + printf("symbolic link referencing %s\n", + (fs->fs_magic == FS_UFS1_MAGIC) ? + (char *)dp->dp1.di_db : + (char *)dp->dp2.di_db); + return; + } + printf("symbolic link\n"); + break; + case IFREG: + if (size == 0) { + printf("empty file\n"); + return; + } + printf("regular file, size %ld\n", size); + break; + case IFDIR: + if (size == 0) { + printf("empty directory\n"); + return; + } + printf("directory, size %ld\n", size); + break; } + numblks = howmany(size, fs->fs_bsize); len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; for (i = 0; i < len; i++) { if (i < numblks - 1) @@ -110,6 +154,11 @@ indirprt(disk, level, blksperindir, lbn, blkno, lastlb int i, last; fs = (struct fs *)&disk->d_sb; + if (blkno == 0) { + printblk(fs, lbn, blkno, + blksperindir * NINDIR(fs) * fs->fs_frag, lastlbn); + return; + } printblk(fs, lbn, blkno, fs->fs_frag, -level); /* read in the indirect block. */ if (bread(disk, fsbtodb(fs, blkno), indir, fs->fs_bsize) == -1) @@ -178,12 +227,12 @@ printblk(fs, lbn, blkno, numblks, lastlbn) if (lastlbn <= 0) goto flush; if (seq == 0) { - seq = 1; + seq = howmany(numblks, fs->fs_frag); firstblk = blkno; return; } if (lbn == 0) { - seq = 1; + seq = howmany(numblks, fs->fs_frag); lastblk = 0; firstblk = blkno; lastindirblk = 0; @@ -192,8 +241,8 @@ printblk(fs, lbn, blkno, numblks, lastlbn) if (lbn < lastlbn && ((firstblk == 0 && blkno == 0) || (firstblk == BLK_NOCOPY && blkno == BLK_NOCOPY) || (firstblk == BLK_SNAP && blkno == BLK_SNAP) || - blkno == firstblk + seq * numblks)) { - seq++; + blkno == firstblk + seq * fs->fs_frag)) { + seq += howmany(numblks, fs->fs_frag); return; } flush: From owner-svn-src-head@freebsd.org Wed Apr 18 23:08:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD8CF8A840; Wed, 18 Apr 2018 23:08:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DF32781A9; Wed, 18 Apr 2018 23:08:10 +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 83C8A215DD; Wed, 18 Apr 2018 23:08:10 +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 w3IN8AOL067790; Wed, 18 Apr 2018 23:08:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3IN8Aro067788; Wed, 18 Apr 2018 23:08:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804182308.w3IN8Aro067788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 18 Apr 2018 23:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332742 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 332742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 23:08:11 -0000 Author: mckusick Date: Wed Apr 18 23:08:10 2018 New Revision: 332742 URL: https://svnweb.freebsd.org/changeset/base/332742 Log: In addition to the existing argument format: prtblknos filesystem_device inode ... add an additional argument format: prtblknos file which is more convenient than figuring out the filesystem and inode number for "file". When given a list of multiple inodes, rather than exiting the program on an error with one of them, skip over it and continue with the next one. Submitted by: bde Modified: head/tools/diag/prtblknos/main.c head/tools/diag/prtblknos/prtblknos.c Modified: head/tools/diag/prtblknos/main.c ============================================================================== --- head/tools/diag/prtblknos/main.c Wed Apr 18 22:24:44 2018 (r332741) +++ head/tools/diag/prtblknos/main.c Wed Apr 18 23:08:10 2018 (r332742) @@ -31,6 +31,7 @@ #include #include #include +#include #include union dinode { @@ -48,11 +49,30 @@ main(argc, argv) struct uufsd disk; union dinode *dp; struct fs *fs; + struct stat sb; + struct statfs sfb; + char *xargv[4]; + char ibuf[64]; char *fsname; int inonum, error; + if (argc == 2) { + if (stat(argv[1], &sb) != 0) + err(1, "stat(%s)", argv[1]); + if (statfs(argv[1], &sfb) != 0) + err(1, "statfs(%s)", argv[1]); + xargv[0] = argv[0]; + xargv[1] = sfb.f_mntfromname; + sprintf(ibuf, "%jd", (intmax_t)sb.st_ino); + xargv[2] = ibuf; + xargv[3] = NULL; + argv = xargv; + argc = 3; + } if (argc < 3) { - (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); + (void)fprintf(stderr, "%s\n%s\n", + "usage: prtblknos filename", + " prtblknos filesystem inode ..."); exit(1); } @@ -60,7 +80,7 @@ main(argc, argv) /* get the superblock. */ if ((error = ufs_disk_fillout(&disk, fsname)) < 0) - errx(1, "Cannot find file system superblock on %s\n", fsname); + err(1, "Cannot access file system superblock on %s", fsname); fs = (struct fs *)&disk.d_sb; /* remaining arguments are inode numbers. */ @@ -68,11 +88,11 @@ main(argc, argv) /* get the inode number. */ if ((inonum = atoi(*argv)) <= 0 || inonum >= fs->fs_ipg * fs->fs_ncg) - errx(1, "%s is not a valid inode number", *argv); - (void)printf("%d:", inonum); + warnx("%s is not a valid inode number", *argv); + (void)printf("%d: ", inonum); if ((error = getino(&disk, (void **)&dp, inonum, NULL)) < 0) - err(1, "Read of inode %d on %s failed", inonum, fsname); + warn("Read of inode %d on %s failed", inonum, fsname); prtblknos(&disk, dp); } Modified: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- head/tools/diag/prtblknos/prtblknos.c Wed Apr 18 22:24:44 2018 (r332741) +++ head/tools/diag/prtblknos/prtblknos.c Wed Apr 18 23:08:10 2018 (r332742) @@ -161,8 +161,13 @@ indirprt(disk, level, blksperindir, lbn, blkno, lastlb } printblk(fs, lbn, blkno, fs->fs_frag, -level); /* read in the indirect block. */ - if (bread(disk, fsbtodb(fs, blkno), indir, fs->fs_bsize) == -1) - err(1, "Read of indirect block %jd failed", (intmax_t)blkno); + if (bread(disk, fsbtodb(fs, blkno), indir, fs->fs_bsize) == -1) { + warn("Read of indirect block %jd failed", (intmax_t)blkno); + /* List the unreadable part as a hole */ + printblk(fs, lbn, 0, + blksperindir * NINDIR(fs) * fs->fs_frag, lastlbn); + return; + } last = howmany(lastlbn - lbn, blksperindir) < NINDIR(fs) ? howmany(lastlbn - lbn, blksperindir) : NINDIR(fs); if (blksperindir == 1) { From owner-svn-src-head@freebsd.org Thu Apr 19 02:06:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1B1F989B7; Thu, 19 Apr 2018 02:06:34 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 37C0C7EB79; Thu, 19 Apr 2018 02:06:33 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (220-253-154-11.dyn.iinet.net.au [220.253.154.11]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w3J26RAq034335 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 18 Apr 2018 19:06:30 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r332559 - head/usr.sbin/mountd To: Rick Macklem , Konstantin Belousov Cc: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <20180417123212.GM1774@kib.kiev.ua> From: Julian Elischer Message-ID: Date: Thu, 19 Apr 2018 10:06:22 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 02:06:35 -0000 On 19/4/18 5:15 am, Rick Macklem wrote: > Julian Elischer wrote: > [stuff snipped] >> our issue is that we make a server that combines CIFS/SMB access (via >> samba), credential setting from a company wide AD server (windows) >> via winbindd (samba) via nsswitch.. and NFS. >> >> The problem is that when one looks up a user name from the AD server >> One can get back a credential with a large number of groups, because >> some companies use windows groups extensively. SO a sinel user may be >> in a group for every project they are involved with and a method of >> giving them access to files related to a project. >> In this scenario a group manager may be given access to a lot of groups. >> >> A user looking at a file via NFS needs to be able to see what he needs >> and still be blocked as per company policy. >> I am investigating the new user-manager daemon may help but I don't >> fully understand it yet. >> I gather it maps an incoming request to a set of groups as defined on >> the server rather than on the client, but I'm not sure yet how that >> relates to mountd. > I am happy to say I know nothing about AD, but I thought it included an > LDAP service? yes and this what is used when  one uses ldap against an AD server. (which seems to work) > If there is a way to configure FreeBSD so that getgrouplist(3) > gets this list of AD groups, then "nfsuserd -manage-gids" on the NFS server > should do what you want. (It takes the "uid" from the AUTH_SYS RPC request > header and then creates a list of groups for that "uid" via getgrouplist(3). > It basically does a getpwuid() and then uses the pw_name as the first arg > to getgrouplist(3). > It ignores the list of groups in the RPC header and, therefore, is not limited > to 16.) yes that is what I was referring to in my previous email getgrouplist(3) does the right thing as far as I know. > > If getgrouplist(3) can't see the set of AD groups, then something needs to be > done to make that work. > > rick > > From owner-svn-src-head@freebsd.org Thu Apr 19 03:38:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A103CFA3FB7; Thu, 19 Apr 2018 03:38:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C906973439; Thu, 19 Apr 2018 03:38:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 78E171C239; Thu, 19 Apr 2018 03:38:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f52.google.com with SMTP id z130-v6so5637928lff.5; Wed, 18 Apr 2018 20:38:00 -0700 (PDT) X-Gm-Message-State: ALQs6tCZwdsKFEYlzweerhk8fqMEZqSiM7IwRxe2j60E8GbGv7z8FQy5 /D03F+kt0d2YOfBOwFO8ZX0HMXh8NS22hVNSHSg= X-Google-Smtp-Source: AIpwx4+4FKb6+06Lhl2BfUIz8N2HqtF7xhmtWEIGaEsY+FgF3x3Iua8v7R+uFkRO+lIwYeXY7FlXF4WHHsdgCd2RyS4= X-Received: by 2002:a19:d850:: with SMTP id p77-v6mr2919878lfg.52.1524109079015; Wed, 18 Apr 2018 20:37:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Wed, 18 Apr 2018 20:37:38 -0700 (PDT) In-Reply-To: <201804190331.w3J3VgaA001507@repo.freebsd.org> References: <201804190331.w3J3VgaA001507@repo.freebsd.org> From: Kyle Evans Date: Wed, 18 Apr 2018 22:37:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332751 - in head/stand/efi: boot1 loader To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 03:38:01 -0000 On Wed, Apr 18, 2018 at 10:31 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Apr 19 03:31:41 2018 > New Revision: 332751 > URL: https://svnweb.freebsd.org/changeset/base/332751 > > Log: > efi loader: Address two nits with recent graphics changes > > - We should be setting a known graphics mode on conout, but we aren't. This should read "known text mode," and mode 0 was chosen simply because it's defined by the standard to be available (and 80x25). > - We shouldn't be setting gop mode if we didn't find a good resolution to > set, but we were. This made efi_max_resolution=1x1 effectively worthless, > since it would always set gop mode 0 if nothing else. > > Modified: > head/stand/efi/boot1/boot1.c > head/stand/efi/loader/framebuffer.c > > Modified: head/stand/efi/boot1/boot1.c From owner-svn-src-head@freebsd.org Thu Apr 19 03:31:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFBD1FA35F4; Thu, 19 Apr 2018 03:31:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F0C77278F; Thu, 19 Apr 2018 03:31:42 +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 6856F242D2; Thu, 19 Apr 2018 03:31:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3J3VgCN001509; Thu, 19 Apr 2018 03:31:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3J3VgaA001507; Thu, 19 Apr 2018 03:31:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804190331.w3J3VgaA001507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 19 Apr 2018 03:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332751 - in head/stand/efi: boot1 loader X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand/efi: boot1 loader X-SVN-Commit-Revision: 332751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 03:31:42 -0000 Author: kevans Date: Thu Apr 19 03:31:41 2018 New Revision: 332751 URL: https://svnweb.freebsd.org/changeset/base/332751 Log: efi loader: Address two nits with recent graphics changes - We should be setting a known graphics mode on conout, but we aren't. - We shouldn't be setting gop mode if we didn't find a good resolution to set, but we were. This made efi_max_resolution=1x1 effectively worthless, since it would always set gop mode 0 if nothing else. Modified: head/stand/efi/boot1/boot1.c head/stand/efi/loader/framebuffer.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Thu Apr 19 02:50:15 2018 (r332750) +++ head/stand/efi/boot1/boot1.c Thu Apr 19 03:31:41 2018 (r332751) @@ -415,6 +415,8 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) */ conout = ST->ConOut; conout->Reset(conout, TRUE); + /* Explicitly set conout to mode 0, 80x25 */ + conout->SetMode(conout, 0); conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); Modified: head/stand/efi/loader/framebuffer.c ============================================================================== --- head/stand/efi/loader/framebuffer.c Thu Apr 19 02:50:15 2018 (r332750) +++ head/stand/efi/loader/framebuffer.c Thu Apr 19 03:31:41 2018 (r332751) @@ -577,12 +577,14 @@ gop_autoresize(EFI_GRAPHICS_OUTPUT *gop) } } - status = gop->SetMode(gop, best_mode); - if (EFI_ERROR(status)) { - snprintf(command_errbuf, sizeof(command_errbuf), - "gop_autoresize: Unable to set mode to %u (error=%lu)", - mode, EFI_ERROR_CODE(status)); - return (CMD_ERROR); + if (maxdim != 0) { + status = gop->SetMode(gop, best_mode); + if (EFI_ERROR(status)) { + snprintf(command_errbuf, sizeof(command_errbuf), + "gop_autoresize: Unable to set mode to %u (error=%lu)", + mode, EFI_ERROR_CODE(status)); + return (CMD_ERROR); + } } return (CMD_OK); } From owner-svn-src-head@freebsd.org Thu Apr 19 05:06:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2F4AFA9D51; Thu, 19 Apr 2018 05:06:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71D96686AC; Thu, 19 Apr 2018 05:06:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AFC02529A; Thu, 19 Apr 2018 05:06:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3J56vit047207; Thu, 19 Apr 2018 05:06:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3J56vg9047202; Thu, 19 Apr 2018 05:06:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804190506.w3J56vg9047202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 19 Apr 2018 05:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332752 - in head/sys: amd64/amd64 i386/i386 powerpc/powerpc sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 powerpc/powerpc sys X-SVN-Commit-Revision: 332752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 05:06:58 -0000 Author: avg Date: Thu Apr 19 05:06:56 2018 New Revision: 332752 URL: https://svnweb.freebsd.org/changeset/base/332752 Log: set kdb_why to "trap" when calling kdb_trap from trap_fatal This will allow to hook a ddb script to "kdb.enter.trap" event. Previously there was no specific name for this event, so it could only be handled by either "kdb.enter.unknown" or "kdb.enter.default" hooks. Both are very unspecific. Having a specific event is useful because the fatal trap condition is very similar to panic but it has an additional property that the current stack frame is the frame where the trap occurred. So, both a register dump and a stack bottom dump have additional information that can help analyze the problem. I have added the event only on architectures that have trap_fatal() function defined. I haven't looked at other architectures. Their maintainers can add support for the event later. Sample script: kdb.enter.trap=bt; show reg; x/aS $rsp,20; x/agx $rsp,20 Reviewed by: kib, jhb, markj MFC after: 11 days Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D15093 Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c head/sys/powerpc/powerpc/trap.c head/sys/sys/kdb.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Apr 19 03:31:41 2018 (r332751) +++ head/sys/amd64/amd64/trap.c Thu Apr 19 05:06:56 2018 (r332752) @@ -761,6 +761,9 @@ trap_fatal(frame, eva) u_int type; struct soft_segment_descriptor softseg; char *msg; +#ifdef KDB + bool handled; +#endif code = frame->tf_err; type = frame->tf_trapno; @@ -811,9 +814,13 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic) - if (kdb_trap(type, 0, frame)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(type, 0, frame); + kdb_why = KDB_WHY_UNSET; + if (handled) return; + } #endif printf("trap number = %d\n", type); if (type <= MAX_TRAP_MSG) Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Apr 19 03:31:41 2018 (r332751) +++ head/sys/i386/i386/trap.c Thu Apr 19 05:06:56 2018 (r332752) @@ -879,6 +879,9 @@ trap_fatal(frame, eva) int code, ss, esp; u_int type; struct soft_segment_descriptor softseg; +#ifdef KDB + bool handled; +#endif code = frame->tf_err; type = frame->tf_trapno; @@ -940,12 +943,13 @@ trap_fatal(frame, eva) #ifdef KDB if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; frame->tf_err = eva; /* smuggle fault address to ddb */ - if (kdb_trap(type, 0, frame)) { - frame->tf_err = code; /* restore error code */ + handled = kdb_trap(type, 0, frame); + frame->tf_err = code; /* restore error code */ + kdb_why = KDB_WHY_UNSET; + if (handled) return; - } - frame->tf_err = code; /* restore error code */ } #endif printf("trap number = %d\n", type); Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Thu Apr 19 03:31:41 2018 (r332751) +++ head/sys/powerpc/powerpc/trap.c Thu Apr 19 05:06:56 2018 (r332752) @@ -449,11 +449,19 @@ trap(struct trapframe *frame) static void trap_fatal(struct trapframe *frame) { +#ifdef KDB + bool handled; +#endif printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if (debugger_on_panic && kdb_trap(frame->exc, 0, frame)) - return; + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(frame->exc, 0, frame); + kdb_why = KDB_WHY_UNSET; + if (handled) + return; + } #endif panic("%s trap", trapname(frame->exc)); } Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Thu Apr 19 03:31:41 2018 (r332751) +++ head/sys/sys/kdb.h Thu Apr 19 05:06:56 2018 (r332752) @@ -101,6 +101,7 @@ extern const char * volatile kdb_why; #define KDB_WHY_UNSET NULL /* No reason set. */ #define KDB_WHY_PANIC "panic" /* panic() was called. */ #define KDB_WHY_KASSERT "kassert" /* kassert failed. */ +#define KDB_WHY_TRAP "trap" /* Fatal trap. */ #define KDB_WHY_SYSCTL "sysctl" /* Sysctl entered debugger. */ #define KDB_WHY_BOOTFLAGS "bootflags" /* Boot flags were set. */ #define KDB_WHY_WITNESS "witness" /* Witness entered debugger. */ From owner-svn-src-head@freebsd.org Thu Apr 19 10:48:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32A46F982C5; Thu, 19 Apr 2018 10:48:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC1CA75587; Thu, 19 Apr 2018 10:48:44 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D0A922914; Thu, 19 Apr 2018 10:48:44 +0000 (UTC) Date: Thu, 19 Apr 2018 10:48:44 +0000 From: Alexey Dokuchaev To: Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, net@FreeBSD.org Subject: Re: svn commit: r332645 - head/sbin/ifconfig Message-ID: <20180419104844.GA8384@FreeBSD.org> References: <201804171254.w3HCsxPx024349@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804171254.w3HCsxPx024349@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 10:48:45 -0000 On Tue, Apr 17, 2018 at 12:54:59PM +0000, Andrew Gallatin wrote: > New Revision: 332645 > URL: https://svnweb.freebsd.org/changeset/base/332645 > > Log: > Make lagg creation more fault tolerant > > - Warn, don't exit, when SIOCSLAGGPORT returns an error. > > When we exit with an error during lagg creation, a single > failed NIC (which no longer attaches) can prevent lagg > creation and other configuration, such as adding an IPv4 > address, and thus leave a machine unreachable. Hey Andrew, Since you're on lagg(4) a bit, could you perhaps have a look at this thread from last year on -net@: https://lists.freebsd.org/pipermail/freebsd-net/2017-June/048284.html I've been asked by several people that were using WiFi-CopperNet failover which worked fine in FreeBSD 10.x but was broken since then. I'm not an src committer nor a network stack expert in this area nor I'm using lagg(4), but perhaps you could expedite on handling this or at least point us to a more appropriate channel (due to lack of interest on -net@). ./danfe From owner-svn-src-head@freebsd.org Thu Apr 19 11:53:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B3C8F9E1AE; Thu, 19 Apr 2018 11:53:16 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 2279D813CC; Thu, 19 Apr 2018 11:53:15 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from Allans-MacBook-Pro.local (unknown [12.206.62.130]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 467DD1998F; Thu, 19 Apr 2018 11:53:09 +0000 (UTC) Subject: Re: svn commit: r332559 - head/usr.sbin/mountd To: Rick Macklem , Julian Elischer , Konstantin Belousov , Andriy Gapon Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: From: Allan Jude Message-ID: <88c5b5a6-86d4-d786-a874-5e21f6204392@freebsd.org> Date: Thu, 19 Apr 2018 07:53:08 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 11:53:16 -0000 On 2018-04-16 8:02 PM, Rick Macklem wrote: > I wrote: >> Julian Elischer wrote: >>> On 16/4/18 6:56 pm, Konstantin Belousov wrote: >> [stuff snipped] >>>>> + ngroups =3D XU_NGROUPS + 1; >>>> Why XU_NGROUPS and not the value of sysctl("kern.ngroups") ? >>> valid question.. because that is how many are allocated? >>> it was a "minimally invasive patch".. whoever used XU_NGROUPS before >>> should have fixed it. >>> Having said that, thanks for drawing out attention to it.. will >>> probably fix. >> 16 is the limit specified in the RFCs for Sun RPC, so that is the "on the wire" limit. >> I haven't looked at the code. It might make sense to handle more here and then >> set the limit at 16 after getting rid of duplicates, but I have no idea if = >> it matters? >> >> rick > Correcting my own post. Now that I've looked at the code, this doesn't go on > the wire. It does go in the exports structure, which means that this structure > would have to be revised (along with the syscall and VOP calls and the kernel > code that uses it). These credentials are for the "maproot/mapall" export > option and revising the export structure seems like quite a bit of work for this > case. (Until revised XU_NGROUPS is the correct value to set it to, since there > is a "struct xucred" in the exports structure.) > > Since Julian Elischer has been emailing me about adding a "fsid" export option > which allows /etc/exports to set the FSID of the exported fs (which would also > need to go in the exports structure), it might be about time to rev. the exports > structure? > > rick > I second the request for FSID as an export option. It is important for having smooth failover between NFS servers. -- Allan Jude From owner-svn-src-head@freebsd.org Thu Apr 19 12:50:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F83FA2FE8; Thu, 19 Apr 2018 12:50:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E59CC6D1D2; Thu, 19 Apr 2018 12:50:49 +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 E09221D05; Thu, 19 Apr 2018 12:50:49 +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 w3JCon2r077219; Thu, 19 Apr 2018 12:50:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JConNX077218; Thu, 19 Apr 2018 12:50:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804191250.w3JConNX077218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Apr 2018 12:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332769 - head/usr.bin/chpass X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/chpass X-SVN-Commit-Revision: 332769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 12:50:50 -0000 Author: emaste Date: Thu Apr 19 12:50:49 2018 New Revision: 332769 URL: https://svnweb.freebsd.org/changeset/base/332769 Log: chpass: reject change/expiry dates beyond y2106 The pwd.db and spwd.db files store the change and expire dates as unsigned 32-bit ints, which overflow in 2106. Reject larger values for now, until the introduction of a v5 password database. i386 has 32-bit time_t and so dates beyond y2038 are already rejected by mktime. PR: 227589 Reviewed by: lidl MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/chpass/util.c Modified: head/usr.bin/chpass/util.c ============================================================================== --- head/usr.bin/chpass/util.c Thu Apr 19 10:16:39 2018 (r332768) +++ head/usr.bin/chpass/util.c Thu Apr 19 12:50:49 2018 (r332769) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -136,6 +137,17 @@ bad: return (1); lt->tm_isdst = -1; if ((tval = mktime(lt)) < 0) return (1); +#ifndef __i386__ + /* + * PR227589: The pwd.db and spwd.db files store the change and expire + * dates as unsigned 32-bit ints which overflow in 2106, so larger + * values must be rejected until the introduction of a v5 password + * database. i386 has 32-bit time_t and so dates beyond y2038 are + * already rejected by mktime above. + */ + if (tval > UINT32_MAX) + return (1); +#endif *store = tval; return (0); } From owner-svn-src-head@freebsd.org Thu Apr 19 13:38:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9A0AFA64FB; Thu, 19 Apr 2018 13:38:00 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8612F766E0; Thu, 19 Apr 2018 13:38:00 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 808FB23DB; Thu, 19 Apr 2018 13:38:00 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JDc0mL002112; Thu, 19 Apr 2018 13:38:00 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JDc0to002106; Thu, 19 Apr 2018 13:38:00 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201804191338.w3JDc0to002106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 19 Apr 2018 13:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332770 - in head/sys: conf netinet netinet/tcp_stacks sys X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: in head/sys: conf netinet netinet/tcp_stacks sys X-SVN-Commit-Revision: 332770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 13:38:01 -0000 Author: rrs Date: Thu Apr 19 13:37:59 2018 New Revision: 332770 URL: https://svnweb.freebsd.org/changeset/base/332770 Log: This commit brings in the TCP high precision timer system (tcp_hpts). It is the forerunner/foundational work of bringing in both Rack and BBR which use hpts for pacing out packets. The feature is optional and requires the TCPHPTS option to be enabled before the feature will be active. TCP modules that use it must assure that the base component is compile in the kernel in which they are loaded. MFC after: Never Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D15020 Added: head/sys/netinet/tcp_hpts.c (contents, props changed) head/sys/netinet/tcp_hpts.h (contents, props changed) head/sys/sys/kern_prefetch.h (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/sys/mbuf.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Apr 19 12:50:49 2018 (r332769) +++ head/sys/conf/files Thu Apr 19 13:37:59 2018 (r332770) @@ -4355,6 +4355,7 @@ netinet/tcp_log_buf.c optional tcp_blackbox inet | tc netinet/tcp_lro.c optional inet | inet6 netinet/tcp_output.c optional inet | inet6 netinet/tcp_offload.c optional tcp_offload inet | tcp_offload inet6 +netinet/tcp_hpts.c optional tcphpts inet | tcphpts inet6 netinet/tcp_pcap.c optional inet tcppcap | inet6 tcppcap netinet/tcp_reass.c optional inet | inet6 netinet/tcp_sack.c optional inet | inet6 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Apr 19 12:50:49 2018 (r332769) +++ head/sys/conf/options Thu Apr 19 13:37:59 2018 (r332770) @@ -218,6 +218,7 @@ SYSVMSG opt_sysvipc.h SYSVSEM opt_sysvipc.h SYSVSHM opt_sysvipc.h SW_WATCHDOG opt_watchdog.h +TCPHPTS opt_inet.h TURNSTILE_PROFILING UMTX_PROFILING UMTX_CHAINS opt_global.h Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Apr 19 12:50:49 2018 (r332769) +++ head/sys/netinet/in_pcb.c Thu Apr 19 13:37:59 2018 (r332770) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,6 +88,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCPHPTS +#include +#endif #include #include #endif @@ -1224,9 +1228,28 @@ in_pcbrele_rlocked(struct inpcb *inp) } return (0); } - + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - +#ifdef TCPHPTS + if (inp->inp_in_hpts || inp->inp_in_input) { + struct tcp_hpts_entry *hpts; + /* + * We should not be on the hpts at + * this point in any form. we must + * get the lock to be sure. + */ + hpts = tcp_hpts_lock(inp); + if (inp->inp_in_hpts) + panic("Hpts:%p inp:%p at free still on hpts", + hpts, inp); + mtx_unlock(&hpts->p_mtx); + hpts = tcp_input_lock(inp); + if (inp->inp_in_input) + panic("Hpts:%p inp:%p at free still on input hpts", + hpts, inp); + mtx_unlock(&hpts->p_mtx); + } +#endif INP_RUNLOCK(inp); pcbinfo = inp->inp_pcbinfo; uma_zfree(pcbinfo->ipi_zone, inp); @@ -1255,7 +1278,26 @@ in_pcbrele_wlocked(struct inpcb *inp) } KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - +#ifdef TCPHPTS + if (inp->inp_in_hpts || inp->inp_in_input) { + struct tcp_hpts_entry *hpts; + /* + * We should not be on the hpts at + * this point in any form. we must + * get the lock to be sure. + */ + hpts = tcp_hpts_lock(inp); + if (inp->inp_in_hpts) + panic("Hpts:%p inp:%p at free still on hpts", + hpts, inp); + mtx_unlock(&hpts->p_mtx); + hpts = tcp_input_lock(inp); + if (inp->inp_in_input) + panic("Hpts:%p inp:%p at free still on input hpts", + hpts, inp); + mtx_unlock(&hpts->p_mtx); + } +#endif INP_WUNLOCK(inp); pcbinfo = inp->inp_pcbinfo; uma_zfree(pcbinfo->ipi_zone, inp); Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Apr 19 12:50:49 2018 (r332769) +++ head/sys/netinet/in_pcb.h Thu Apr 19 13:37:59 2018 (r332770) @@ -156,6 +156,7 @@ struct in_conninfo { * from the global list. * * Key: + * (b) - Protected by the hpts lock. * (c) - Constant after initialization * (g) - Protected by the pcbgroup lock * (i) - Protected by the inpcb lock @@ -164,7 +165,52 @@ struct in_conninfo { * (h) - Protected by the pcbhash lock for the inpcb * (s) - Protected by another subsystem's locks * (x) - Undefined locking + * + * Notes on the tcp_hpts: + * + * First Hpts lock order is + * 1) INP_WLOCK() + * 2) HPTS_LOCK() i.e. hpts->pmtx * + * To insert a TCB on the hpts you *must* be holding the INP_WLOCK(). + * You may check the inp->inp_in_hpts flag without the hpts lock. + * The hpts is the only one that will clear this flag holding + * only the hpts lock. This means that in your tcp_output() + * routine when you test for the inp_in_hpts flag to be 1 + * it may be transitioning to 0 (by the hpts). + * That's ok since that will just mean an extra call to tcp_output + * that most likely will find the call you executed + * (when the mis-match occured) will have put the TCB back + * on the hpts and it will return. If your + * call did not add the inp back to the hpts then you will either + * over-send or the cwnd will block you from sending more. + * + * Note you should also be holding the INP_WLOCK() when you + * call the remove from the hpts as well. Though usually + * you are either doing this from a timer, where you need and have + * the INP_WLOCK() or from destroying your TCB where again + * you should already have the INP_WLOCK(). + * + * The inp_hpts_cpu, inp_hpts_cpu_set, inp_input_cpu and + * inp_input_cpu_set fields are controlled completely by + * the hpts. Do not ever set these. The inp_hpts_cpu_set + * and inp_input_cpu_set fields indicate if the hpts has + * setup the respective cpu field. It is advised if this + * field is 0, to enqueue the packet with the appropriate + * hpts_immediate() call. If the _set field is 1, then + * you may compare the inp_*_cpu field to the curcpu and + * may want to again insert onto the hpts if these fields + * are not equal (i.e. you are not on the expected CPU). + * + * A note on inp_hpts_calls and inp_input_calls, these + * flags are set when the hpts calls either the output + * or do_segment routines respectively. If the routine + * being called wants to use this, then it needs to + * clear the flag before returning. The hpts will not + * clear the flag. The flags can be used to tell if + * the hpts is the function calling the respective + * routine. + * * A few other notes: * * When a read lock is held, stability of the field is guaranteed; to write @@ -190,14 +236,45 @@ struct inpcb { LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ struct rwlock inp_lock; /* Cache line #2 (amd64) */ -#define inp_start_zero inp_refcount +#define inp_start_zero inp_hpts #define inp_zero_size (sizeof(struct inpcb) - \ offsetof(struct inpcb, inp_start_zero)) + TAILQ_ENTRY(inpcb) inp_hpts; /* pacing out queue next lock(b) */ + + uint32_t inp_hpts_request; /* Current hpts request, zero if + * fits in the pacing window (i&b). */ + /* + * Note the next fields are protected by a + * different lock (hpts-lock). This means that + * they must correspond in size to the smallest + * protectable bit field (uint8_t on x86, and + * other platfomrs potentially uint32_t?). Also + * since CPU switches can occur at different times the two + * fields can *not* be collapsed into a signal bit field. + */ +#if defined(__amd64__) || defined(__i386__) + volatile uint8_t inp_in_hpts; /* on output hpts (lock b) */ + volatile uint8_t inp_in_input; /* on input hpts (lock b) */ +#else + volatile uint32_t inp_in_hpts; /* on output hpts (lock b) */ + volatile uint32_t inp_in_input; /* on input hpts (lock b) */ +#endif + volatile uint16_t inp_hpts_cpu; /* Lock (i) */ u_int inp_refcount; /* (i) refcount */ int inp_flags; /* (i) generic IP/datagram flags */ int inp_flags2; /* (i) generic IP/datagram flags #2*/ + volatile uint16_t inp_input_cpu; /* Lock (i) */ + volatile uint8_t inp_hpts_cpu_set :1, /* on output hpts (i) */ + inp_input_cpu_set : 1, /* on input hpts (i) */ + inp_hpts_calls :1, /* (i) from output hpts */ + inp_input_calls :1, /* (i) from input hpts */ + inp_spare_bits2 : 4; + uint8_t inp_spare_byte; /* Compiler hole */ void *inp_ppcb; /* (i) pointer to per-protocol pcb */ struct socket *inp_socket; /* (i) back pointer to socket */ + uint32_t inp_hptsslot; /* Hpts wheel slot this tcb is Lock(i&b) */ + uint32_t inp_hpts_drop_reas; /* reason we are dropping the PCB (lock i&b) */ + TAILQ_ENTRY(inpcb) inp_input; /* pacing in queue next lock(b) */ struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */ struct inpcbgroup *inp_pcbgroup; /* (g/i) PCB group list */ LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/h) group wildcard entry */ @@ -638,6 +715,7 @@ short inp_so_options(const struct inpcb *inp); #define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ #define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ #define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ +#define INP_CANNOT_DO_ECN 0x00001000 /* The stack does not do ECN */ /* * Flags passed to in_pcblookup*() functions. Added: head/sys/netinet/tcp_hpts.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_hpts.c Thu Apr 19 13:37:59 2018 (r332770) @@ -0,0 +1,1964 @@ +/*- + * Copyright (c) 2016-8 + * Netflix Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipsec.h" +#include "opt_tcpdebug.h" +/** + * Some notes about usage. + * + * The tcp_hpts system is designed to provide a high precision timer + * system for tcp. Its main purpose is to provide a mechanism for + * pacing packets out onto the wire. It can be used in two ways + * by a given TCP stack (and those two methods can be used simultaneously). + * + * First, and probably the main thing its used by Rack and BBR for, it can + * be used to call tcp_output() of a transport stack at some time in the future. + * The normal way this is done is that tcp_output() of the stack schedules + * itself to be called again by calling tcp_hpts_insert(tcpcb, slot). The + * slot is the time from now that the stack wants to be called but it + * must be converted to tcp_hpts's notion of slot. This is done with + * one of the macros HPTS_MS_TO_SLOTS or HPTS_USEC_TO_SLOTS. So a typical + * call from the tcp_output() routine might look like: + * + * tcp_hpts_insert(tp, HPTS_USEC_TO_SLOTS(550)); + * + * The above would schedule tcp_ouput() to be called in 550 useconds. + * Note that if using this mechanism the stack will want to add near + * its top a check to prevent unwanted calls (from user land or the + * arrival of incoming ack's). So it would add something like: + * + * if (inp->inp_in_hpts) + * return; + * + * to prevent output processing until the time alotted has gone by. + * Of course this is a bare bones example and the stack will probably + * have more consideration then just the above. + * + * Now the tcp_hpts system will call tcp_output in one of two forms, + * it will first check to see if the stack as defined a + * tfb_tcp_output_wtime() function, if so that is the routine it + * will call, if that function is not defined then it will call the + * tfb_tcp_output() function. The only difference between these + * two calls is that the former passes the time in to the function + * so the function does not have to access the time (which tcp_hpts + * already has). What these functions do is of course totally up + * to the individual tcp stack. + * + * Now the second function (actually two functions I guess :D) + * the tcp_hpts system provides is the ability to either abort + * a connection (later) or process input on a connection. + * Why would you want to do this? To keep processor locality. + * + * So in order to use the input redirection function the + * stack changes its tcp_do_segment() routine to instead + * of process the data call the function: + * + * tcp_queue_pkt_to_input() + * + * You will note that the arguments to this function look + * a lot like tcp_do_segments's arguments. This function + * will assure that the tcp_hpts system will + * call the functions tfb_tcp_hpts_do_segment() from the + * correct CPU. Note that multiple calls can get pushed + * into the tcp_hpts system this will be indicated by + * the next to last argument to tfb_tcp_hpts_do_segment() + * (nxt_pkt). If nxt_pkt is a 1 then another packet is + * coming. If nxt_pkt is a 0 then this is the last call + * that the tcp_hpts system has available for the tcp stack. + * + * The other point of the input system is to be able to safely + * drop a tcp connection without worrying about the recursive + * locking that may be occuring on the INP_WLOCK. So if + * a stack wants to drop a connection it calls: + * + * tcp_set_inp_to_drop(tp, ETIMEDOUT) + * + * To schedule the tcp_hpts system to call + * + * tcp_drop(tp, drop_reason) + * + * at a future point. This is quite handy to prevent locking + * issues when dropping connections. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for proc0 declaration */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define TCPSTATES /* for logging */ + +#include +#include +#include +#include +#include /* required for icmp_var.h */ +#include /* for ICMP_BANDLIM */ +#include +#include +#include +#include +#define TCPOUTFLAGS +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef tcpdebug +#include +#endif /* tcpdebug */ +#ifdef tcp_offload +#include +#endif + +#ifdef ipsec +#include +#include +#endif /* ipsec */ +#include "opt_rss.h" + +MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); +#ifdef RSS +static int tcp_bind_threads = 1; +#else +static int tcp_bind_threads = 0; +#endif +TUNABLE_INT("net.inet.tcp.bind_hptss", &tcp_bind_threads); + +static uint32_t tcp_hpts_logging_size = DEFAULT_HPTS_LOG; + +TUNABLE_INT("net.inet.tcp.hpts_logging_sz", &tcp_hpts_logging_size); + +static struct tcp_hptsi tcp_pace; + +static int +tcp_hptsi_lock_inpinfo(struct inpcb *inp, + struct tcpcb **tp); +static void tcp_wakehpts(struct tcp_hpts_entry *p); +static void tcp_wakeinput(struct tcp_hpts_entry *p); +static void tcp_input_data(struct tcp_hpts_entry *hpts, struct timeval *tv); +static void tcp_hptsi(struct tcp_hpts_entry *hpts, struct timeval *ctick); +static void tcp_hpts_thread(void *ctx); +static void tcp_init_hptsi(void *st); + +int32_t tcp_min_hptsi_time = DEFAULT_MIN_SLEEP; +static int32_t tcp_hpts_callout_skip_swi = 0; + +SYSCTL_DECL(_net_inet_tcp); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hpts, CTLFLAG_RW, 0, "TCP Hpts controls"); + +#define timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) + +static int32_t logging_on = 0; +static int32_t hpts_sleep_max = (NUM_OF_HPTSI_SLOTS - 2); +static int32_t tcp_hpts_precision = 120; + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, precision, CTLFLAG_RW, + &tcp_hpts_precision, 120, + "Value for PRE() precision of callout"); + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, logging, CTLFLAG_RW, + &logging_on, 0, + "Turn on logging if compiled in"); + +counter_u64_t hpts_loops; + +SYSCTL_COUNTER_U64(_net_inet_tcp_hpts, OID_AUTO, loops, CTLFLAG_RD, + &hpts_loops, "Number of times hpts had to loop to catch up"); + +counter_u64_t back_tosleep; + +SYSCTL_COUNTER_U64(_net_inet_tcp_hpts, OID_AUTO, no_tcbsfound, CTLFLAG_RD, + &back_tosleep, "Number of times hpts found no tcbs"); + +static int32_t in_newts_every_tcb = 0; + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, in_tsperpcb, CTLFLAG_RW, + &in_newts_every_tcb, 0, + "Do we have a new cts every tcb we process for input"); +static int32_t in_ts_percision = 0; + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, in_tspercision, CTLFLAG_RW, + &in_ts_percision, 0, + "Do we use percise timestamp for clients on input"); +static int32_t out_newts_every_tcb = 0; + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, out_tsperpcb, CTLFLAG_RW, + &out_newts_every_tcb, 0, + "Do we have a new cts every tcb we process for output"); +static int32_t out_ts_percision = 0; + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, out_tspercision, CTLFLAG_RW, + &out_ts_percision, 0, + "Do we use a percise timestamp for every output cts"); + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, maxsleep, CTLFLAG_RW, + &hpts_sleep_max, 0, + "The maximum time the hpts will sleep <1 - 254>"); + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, minsleep, CTLFLAG_RW, + &tcp_min_hptsi_time, 0, + "The minimum time the hpts must sleep before processing more slots"); + +SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, skip_swi, CTLFLAG_RW, + &tcp_hpts_callout_skip_swi, 0, + "Do we have the callout call directly to the hpts?"); + +static void +__tcp_hpts_log_it(struct tcp_hpts_entry *hpts, struct inpcb *inp, int event, uint32_t slot, + uint32_t ticknow, int32_t line) +{ + struct hpts_log *pl; + + HPTS_MTX_ASSERT(hpts); + if (hpts->p_log == NULL) + return; + pl = &hpts->p_log[hpts->p_log_at]; + hpts->p_log_at++; + if (hpts->p_log_at >= hpts->p_logsize) { + hpts->p_log_at = 0; + hpts->p_log_wrapped = 1; + } + pl->inp = inp; + if (inp) { + pl->t_paceslot = inp->inp_hptsslot; + pl->t_hptsreq = inp->inp_hpts_request; + pl->p_onhpts = inp->inp_in_hpts; + pl->p_oninput = inp->inp_in_input; + } else { + pl->t_paceslot = 0; + pl->t_hptsreq = 0; + pl->p_onhpts = 0; + pl->p_oninput = 0; + } + pl->is_notempty = 1; + pl->event = event; + pl->line = line; + pl->cts = tcp_get_usecs(NULL); + pl->p_curtick = hpts->p_curtick; + pl->p_prevtick = hpts->p_prevtick; + pl->p_on_queue_cnt = hpts->p_on_queue_cnt; + pl->ticknow = ticknow; + pl->slot_req = slot; + pl->p_nxt_slot = hpts->p_nxt_slot; + pl->p_cur_slot = hpts->p_cur_slot; + pl->p_hpts_sleep_time = hpts->p_hpts_sleep_time; + pl->p_flags = (hpts->p_cpu & 0x7f); + pl->p_flags <<= 7; + pl->p_flags |= (hpts->p_num & 0x7f); + pl->p_flags <<= 2; + if (hpts->p_hpts_active) { + pl->p_flags |= HPTS_HPTS_ACTIVE; + } +} + +#define tcp_hpts_log_it(a, b, c, d, e) __tcp_hpts_log_it(a, b, c, d, e, __LINE__) + +static void +hpts_timeout_swi(void *arg) +{ + struct tcp_hpts_entry *hpts; + + hpts = (struct tcp_hpts_entry *)arg; + swi_sched(hpts->ie_cookie, 0); +} + +static void +hpts_timeout_dir(void *arg) +{ + tcp_hpts_thread(arg); +} + +static inline void +hpts_sane_pace_remove(struct tcp_hpts_entry *hpts, struct inpcb *inp, struct hptsh *head, int clear) +{ +#ifdef INVARIANTS + if (mtx_owned(&hpts->p_mtx) == 0) { + /* We don't own the mutex? */ + panic("%s: hpts:%p inp:%p no hpts mutex", __FUNCTION__, hpts, inp); + } + if (hpts->p_cpu != inp->inp_hpts_cpu) { + /* It is not the right cpu/mutex? */ + panic("%s: hpts:%p inp:%p incorrect CPU", __FUNCTION__, hpts, inp); + } + if (inp->inp_in_hpts == 0) { + /* We are not on the hpts? */ + panic("%s: hpts:%p inp:%p not on the hpts?", __FUNCTION__, hpts, inp); + } + if (TAILQ_EMPTY(head) && + (hpts->p_on_queue_cnt != 0)) { + /* We should not be empty with a queue count */ + panic("%s hpts:%p hpts bucket empty but cnt:%d", + __FUNCTION__, hpts, hpts->p_on_queue_cnt); + } +#endif + TAILQ_REMOVE(head, inp, inp_hpts); + hpts->p_on_queue_cnt--; + if (hpts->p_on_queue_cnt < 0) { + /* Count should not go negative .. */ +#ifdef INVARIANTS + panic("Hpts goes negative inp:%p hpts:%p", + inp, hpts); +#endif + hpts->p_on_queue_cnt = 0; + } + if (clear) { + inp->inp_hpts_request = 0; + inp->inp_in_hpts = 0; + } +} + +static inline void +hpts_sane_pace_insert(struct tcp_hpts_entry *hpts, struct inpcb *inp, struct hptsh *head, int line, int noref) +{ +#ifdef INVARIANTS + if (mtx_owned(&hpts->p_mtx) == 0) { + /* We don't own the mutex? */ + panic("%s: hpts:%p inp:%p no hpts mutex", __FUNCTION__, hpts, inp); + } + if (hpts->p_cpu != inp->inp_hpts_cpu) { + /* It is not the right cpu/mutex? */ + panic("%s: hpts:%p inp:%p incorrect CPU", __FUNCTION__, hpts, inp); + } + if ((noref == 0) && (inp->inp_in_hpts == 1)) { + /* We are already on the hpts? */ + panic("%s: hpts:%p inp:%p already on the hpts?", __FUNCTION__, hpts, inp); + } +#endif + TAILQ_INSERT_TAIL(head, inp, inp_hpts); + inp->inp_in_hpts = 1; + hpts->p_on_queue_cnt++; + if (noref == 0) { + in_pcbref(inp); + } +} + +static inline void +hpts_sane_input_remove(struct tcp_hpts_entry *hpts, struct inpcb *inp, int clear) +{ +#ifdef INVARIANTS + if (mtx_owned(&hpts->p_mtx) == 0) { + /* We don't own the mutex? */ + panic("%s: hpts:%p inp:%p no hpts mutex", __FUNCTION__, hpts, inp); + } + if (hpts->p_cpu != inp->inp_input_cpu) { + /* It is not the right cpu/mutex? */ + panic("%s: hpts:%p inp:%p incorrect CPU", __FUNCTION__, hpts, inp); + } + if (inp->inp_in_input == 0) { + /* We are not on the input hpts? */ + panic("%s: hpts:%p inp:%p not on the input hpts?", __FUNCTION__, hpts, inp); + } +#endif + TAILQ_REMOVE(&hpts->p_input, inp, inp_input); + hpts->p_on_inqueue_cnt--; + if (hpts->p_on_inqueue_cnt < 0) { +#ifdef INVARIANTS + panic("Hpts in goes negative inp:%p hpts:%p", + inp, hpts); +#endif + hpts->p_on_inqueue_cnt = 0; + } +#ifdef INVARIANTS + if (TAILQ_EMPTY(&hpts->p_input) && + (hpts->p_on_inqueue_cnt != 0)) { + /* We should not be empty with a queue count */ + panic("%s hpts:%p in_hpts input empty but cnt:%d", + __FUNCTION__, hpts, hpts->p_on_inqueue_cnt); + } +#endif + if (clear) + inp->inp_in_input = 0; +} + +static inline void +hpts_sane_input_insert(struct tcp_hpts_entry *hpts, struct inpcb *inp, int line) +{ +#ifdef INVARIANTS + if (mtx_owned(&hpts->p_mtx) == 0) { + /* We don't own the mutex? */ + panic("%s: hpts:%p inp:%p no hpts mutex", __FUNCTION__, hpts, inp); + } + if (hpts->p_cpu != inp->inp_input_cpu) { + /* It is not the right cpu/mutex? */ + panic("%s: hpts:%p inp:%p incorrect CPU", __FUNCTION__, hpts, inp); + } + if (inp->inp_in_input == 1) { + /* We are already on the input hpts? */ + panic("%s: hpts:%p inp:%p already on the input hpts?", __FUNCTION__, hpts, inp); + } +#endif + TAILQ_INSERT_TAIL(&hpts->p_input, inp, inp_input); + inp->inp_in_input = 1; + hpts->p_on_inqueue_cnt++; + in_pcbref(inp); +} + +static int +sysctl_tcp_hpts_log(SYSCTL_HANDLER_ARGS) +{ + struct tcp_hpts_entry *hpts; + size_t sz; + int32_t logging_was, i; + int32_t error = 0; + + /* + * HACK: Turn off logging so no locks are required this really needs + * a memory barrier :) + */ + logging_was = logging_on; + logging_on = 0; + if (!req->oldptr) { + /* How much? */ + sz = 0; + for (i = 0; i < tcp_pace.rp_num_hptss; i++) { + hpts = tcp_pace.rp_ent[i]; + if (hpts->p_log == NULL) + continue; + sz += (sizeof(struct hpts_log) * hpts->p_logsize); + } + error = SYSCTL_OUT(req, 0, sz); + } else { + for (i = 0; i < tcp_pace.rp_num_hptss; i++) { + hpts = tcp_pace.rp_ent[i]; + if (hpts->p_log == NULL) + continue; + if (hpts->p_log_wrapped) + sz = (sizeof(struct hpts_log) * hpts->p_logsize); + else + sz = (sizeof(struct hpts_log) * hpts->p_log_at); + error = SYSCTL_OUT(req, hpts->p_log, sz); + } + } + logging_on = logging_was; + return error; +} + +SYSCTL_PROC(_net_inet_tcp_hpts, OID_AUTO, log, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, sysctl_tcp_hpts_log, "A", "tcp hptsi log"); + + +/* + * Try to get the INP_INFO lock. + * + * This function always succeeds in getting the lock. It will clear + * *tpp and return (1) if something critical changed while the inpcb + * was unlocked. Otherwise, it will leave *tpp unchanged and return (0). + * + * This function relies on the fact that the hpts always holds a + * reference on the inpcb while the segment is on the hptsi wheel and + * in the input queue. + * + */ +static int +tcp_hptsi_lock_inpinfo(struct inpcb *inp, struct tcpcb **tpp) +{ + struct tcp_function_block *tfb; + struct tcpcb *tp; + void *ptr; + + /* Try the easy way. */ + if (INP_INFO_TRY_RLOCK(&V_tcbinfo)) + return (0); + + /* + * OK, let's try the hard way. We'll save the function pointer block + * to make sure that doesn't change while we aren't holding the + * lock. + */ + tp = *tpp; + tfb = tp->t_fb; + ptr = tp->t_fb_ptr; + INP_WUNLOCK(inp); + INP_INFO_RLOCK(&V_tcbinfo); + INP_WLOCK(inp); + /* If the session went away, return an error. */ + if ((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) || + (inp->inp_flags2 & INP_FREED)) { + *tpp = NULL; + return (1); + } + /* + * If the function block or stack-specific data block changed, + * report an error. + */ + tp = intotcpcb(inp); + if ((tp->t_fb != tfb) && (tp->t_fb_ptr != ptr)) { + *tpp = NULL; + return (1); + } + return (0); +} + + +static void +tcp_wakehpts(struct tcp_hpts_entry *hpts) +{ + HPTS_MTX_ASSERT(hpts); + swi_sched(hpts->ie_cookie, 0); + if (hpts->p_hpts_active == 2) { + /* Rare sleeping on a ENOBUF */ + wakeup_one(hpts); + } +} + +static void +tcp_wakeinput(struct tcp_hpts_entry *hpts) +{ + HPTS_MTX_ASSERT(hpts); + swi_sched(hpts->ie_cookie, 0); + if (hpts->p_hpts_active == 2) { + /* Rare sleeping on a ENOBUF */ + wakeup_one(hpts); + } +} + +struct tcp_hpts_entry * +tcp_cur_hpts(struct inpcb *inp) +{ + int32_t hpts_num; + struct tcp_hpts_entry *hpts; + + hpts_num = inp->inp_hpts_cpu; + hpts = tcp_pace.rp_ent[hpts_num]; + return (hpts); +} + +struct tcp_hpts_entry * +tcp_hpts_lock(struct inpcb *inp) +{ + struct tcp_hpts_entry *hpts; + int32_t hpts_num; + +again: + hpts_num = inp->inp_hpts_cpu; + hpts = tcp_pace.rp_ent[hpts_num]; +#ifdef INVARIANTS + if (mtx_owned(&hpts->p_mtx)) { + panic("Hpts:%p owns mtx prior-to lock line:%d", + hpts, __LINE__); + } +#endif + mtx_lock(&hpts->p_mtx); + if (hpts_num != inp->inp_hpts_cpu) { + mtx_unlock(&hpts->p_mtx); + goto again; + } + return (hpts); +} + +struct tcp_hpts_entry * +tcp_input_lock(struct inpcb *inp) +{ + struct tcp_hpts_entry *hpts; + int32_t hpts_num; + +again: + hpts_num = inp->inp_input_cpu; + hpts = tcp_pace.rp_ent[hpts_num]; +#ifdef INVARIANTS + if (mtx_owned(&hpts->p_mtx)) { + panic("Hpts:%p owns mtx prior-to lock line:%d", + hpts, __LINE__); + } +#endif + mtx_lock(&hpts->p_mtx); + if (hpts_num != inp->inp_input_cpu) { + mtx_unlock(&hpts->p_mtx); + goto again; + } + return (hpts); +} + +static void +tcp_remove_hpts_ref(struct inpcb *inp, struct tcp_hpts_entry *hpts, int line) +{ + int32_t add_freed; + + if (inp->inp_flags2 & INP_FREED) { + /* + * Need to play a special trick so that in_pcbrele_wlocked + * does not return 1 when it really should have returned 0. + */ + add_freed = 1; + inp->inp_flags2 &= ~INP_FREED; + } else { + add_freed = 0; + } +#ifndef INP_REF_DEBUG + if (in_pcbrele_wlocked(inp)) { + /* + * This should not happen. We have the inpcb referred to by + * the main socket (why we are called) and the hpts. It + * should always return 0. + */ + panic("inpcb:%p release ret 1", + inp); + } +#else + if (__in_pcbrele_wlocked(inp, line)) { + /* + * This should not happen. We have the inpcb referred to by + * the main socket (why we are called) and the hpts. It + * should always return 0. + */ + panic("inpcb:%p release ret 1", + inp); + } +#endif + if (add_freed) { + inp->inp_flags2 |= INP_FREED; + } +} + +static void +tcp_hpts_remove_locked_output(struct tcp_hpts_entry *hpts, struct inpcb *inp, int32_t flags, int32_t line) +{ + if (inp->inp_in_hpts) { + hpts_sane_pace_remove(hpts, inp, &hpts->p_hptss[inp->inp_hptsslot], 1); + tcp_remove_hpts_ref(inp, hpts, line); + } +} + +static void +tcp_hpts_remove_locked_input(struct tcp_hpts_entry *hpts, struct inpcb *inp, int32_t flags, int32_t line) +{ + HPTS_MTX_ASSERT(hpts); + if (inp->inp_in_input) { + hpts_sane_input_remove(hpts, inp, 1); + tcp_remove_hpts_ref(inp, hpts, line); + } +} + +/* + * Called normally with the INP_LOCKED but it + * does not matter, the hpts lock is the key + * but the lock order allows us to hold the + * INP lock and then get the hpts lock. + * + * Valid values in the flags are + * HPTS_REMOVE_OUTPUT - remove from the output of the hpts. + * HPTS_REMOVE_INPUT - remove from the input of the hpts. + * Note that you can or both values together and get two + * actions. + */ +void +__tcp_hpts_remove(struct inpcb *inp, int32_t flags, int32_t line) +{ + struct tcp_hpts_entry *hpts; + + INP_WLOCK_ASSERT(inp); + if (flags & HPTS_REMOVE_OUTPUT) { + hpts = tcp_hpts_lock(inp); + tcp_hpts_remove_locked_output(hpts, inp, flags, line); + mtx_unlock(&hpts->p_mtx); + } + if (flags & HPTS_REMOVE_INPUT) { + hpts = tcp_input_lock(inp); + tcp_hpts_remove_locked_input(hpts, inp, flags, line); + mtx_unlock(&hpts->p_mtx); + } +} + +static inline int +hpts_tick(struct tcp_hpts_entry *hpts, int32_t plus) +{ + return ((hpts->p_prevtick + plus) % NUM_OF_HPTSI_SLOTS); +} + +static int +tcp_queue_to_hpts_immediate_locked(struct inpcb *inp, struct tcp_hpts_entry *hpts, int32_t line, int32_t noref) +{ + int32_t need_wake = 0; + uint32_t ticknow = 0; + + HPTS_MTX_ASSERT(hpts); + if (inp->inp_in_hpts == 0) { + /* Ok we need to set it on the hpts in the current slot */ + if (hpts->p_hpts_active == 0) { + /* A sleeping hpts we want in next slot to run */ + if (logging_on) { + tcp_hpts_log_it(hpts, inp, HPTSLOG_INSERT_SLEEPER, 0, + hpts_tick(hpts, 1)); + } + inp->inp_hptsslot = hpts_tick(hpts, 1); + inp->inp_hpts_request = 0; + if (logging_on) { + tcp_hpts_log_it(hpts, inp, HPTSLOG_SLEEP_BEFORE, 1, ticknow); + } + need_wake = 1; + } else if ((void *)inp == hpts->p_inp) { + /* + * We can't allow you to go into the same slot we + * are in. We must put you out. + */ + inp->inp_hptsslot = hpts->p_nxt_slot; + } else + inp->inp_hptsslot = hpts->p_cur_slot; + hpts_sane_pace_insert(hpts, inp, &hpts->p_hptss[inp->inp_hptsslot], line, noref); + inp->inp_hpts_request = 0; + if (logging_on) { + tcp_hpts_log_it(hpts, inp, HPTSLOG_IMMEDIATE, 0, 0); + } + if (need_wake) { + /* + * Activate the hpts if it is sleeping and its + * timeout is not 1. + */ + if (logging_on) { + tcp_hpts_log_it(hpts, inp, HPTSLOG_WAKEUP_HPTS, 0, ticknow); + } + hpts->p_direct_wake = 1; + tcp_wakehpts(hpts); + } + } + return (need_wake); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Apr 19 14:09:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED32FA838C; Thu, 19 Apr 2018 14:09:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80B467C6C8; Thu, 19 Apr 2018 14:09:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B86728C2; Thu, 19 Apr 2018 14:09:45 +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 w3JE9jr9017030; Thu, 19 Apr 2018 14:09:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JE9jvW017026; Thu, 19 Apr 2018 14:09:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804191409.w3JE9jvW017026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 19 Apr 2018 14:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332771 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 332771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 14:09:46 -0000 Author: markj Date: Thu Apr 19 14:09:44 2018 New Revision: 332771 URL: https://svnweb.freebsd.org/changeset/base/332771 Log: Initialize marker pages in vm_page_domain_init(). They were previously initialized by the corresponding page daemon threads, but for vmd_inacthead this may be too late if vm_page_deactivate_noreuse() is called during boot. Reported and tested by: cperciva Reviewed by: alc, kib MFC after: 1 week Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pagequeue.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Apr 19 13:37:59 2018 (r332770) +++ head/sys/vm/vm_page.c Thu Apr 19 14:09:44 2018 (r332771) @@ -437,6 +437,23 @@ sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS) return (error); } +/* + * Initialize a dummy page for use in scans of the specified paging queue. + * In principle, this function only needs to set the flag PG_MARKER. + * Nonetheless, it write busies and initializes the hold count to one as + * safety precautions. + */ +void +vm_page_init_marker(vm_page_t marker, int queue) +{ + + bzero(marker, sizeof(*marker)); + marker->flags = PG_MARKER; + marker->busy_lock = VPB_SINGLE_EXCLUSIVER; + marker->queue = queue; + marker->hold_count = 1; +} + static void vm_page_domain_init(int domain) { @@ -464,9 +481,13 @@ vm_page_domain_init(int domain) TAILQ_INIT(&pq->pq_pl); mtx_init(&pq->pq_mutex, pq->pq_name, "vm pagequeue", MTX_DEF | MTX_DUPOK); + vm_page_init_marker(&vmd->vmd_markers[i], i); } mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF); mtx_init(&vmd->vmd_pageout_mtx, "vm pageout lock", NULL, MTX_DEF); + vm_page_init_marker(&vmd->vmd_inacthead, PQ_INACTIVE); + TAILQ_INSERT_HEAD(&vmd->vmd_pagequeues[PQ_INACTIVE].pq_pl, + &vmd->vmd_inacthead, plinks.q); snprintf(vmd->vmd_name, sizeof(vmd->vmd_name), "%d", domain); } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Apr 19 13:37:59 2018 (r332770) +++ head/sys/vm/vm_page.h Thu Apr 19 14:09:44 2018 (r332771) @@ -490,6 +490,7 @@ void vm_page_free_phys_pglist(struct pglist *tq); bool vm_page_free_prep(vm_page_t m, bool pagequeue_locked); vm_page_t vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_initfake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); +void vm_page_init_marker(vm_page_t m, int queue); int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); void vm_page_launder(vm_page_t m); vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Apr 19 13:37:59 2018 (r332770) +++ head/sys/vm/vm_pageout.c Thu Apr 19 14:09:44 2018 (r332771) @@ -208,23 +208,6 @@ static void vm_pageout_laundry_worker(void *arg); static boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *); /* - * Initialize a dummy page for marking the caller's place in the specified - * paging queue. In principle, this function only needs to set the flag - * PG_MARKER. Nonetheless, it write busies and initializes the hold count - * to one as safety precautions. - */ -static void -vm_pageout_init_marker(vm_page_t marker, u_short queue) -{ - - bzero(marker, sizeof(*marker)); - marker->flags = PG_MARKER; - marker->busy_lock = VPB_SINGLE_EXCLUSIVER; - marker->queue = queue; - marker->hold_count = 1; -} - -/* * vm_pageout_fallback_object_lock: * * Lock vm object currently associated with `m'. VM_OBJECT_TRYWLOCK is @@ -244,11 +227,11 @@ vm_pageout_fallback_object_lock(vm_page_t m, vm_page_t struct vm_page marker; struct vm_pagequeue *pq; boolean_t unchanged; - u_short queue; vm_object_t object; + int queue; queue = m->queue; - vm_pageout_init_marker(&marker, queue); + vm_page_init_marker(&marker, queue); pq = vm_page_pagequeue(m); object = m->object; @@ -293,14 +276,14 @@ vm_pageout_page_lock(vm_page_t m, vm_page_t *next) struct vm_page marker; struct vm_pagequeue *pq; boolean_t unchanged; - u_short queue; + int queue; vm_page_lock_assert(m, MA_NOTOWNED); if (vm_page_trylock(m)) return (TRUE); queue = m->queue; - vm_pageout_init_marker(&marker, queue); + vm_page_init_marker(&marker, queue); pq = vm_page_pagequeue(m); TAILQ_INSERT_AFTER(&pq->pq_pl, m, &marker, plinks.q); @@ -694,8 +677,8 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, { struct vm_pagequeue *pq; vm_object_t object; - vm_page_t m, next; - int act_delta, error, maxscan, numpagedout, starting_target; + vm_page_t m, marker, next; + int act_delta, error, maxscan, numpagedout, queue, starting_target; int vnodes_skipped; bool pageout_ok, queue_locked; @@ -716,11 +699,14 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, * swap devices are configured. */ if (atomic_load_acq_int(&swapdev_enabled)) - pq = &vmd->vmd_pagequeues[PQ_UNSWAPPABLE]; + queue = PQ_UNSWAPPABLE; else - pq = &vmd->vmd_pagequeues[PQ_LAUNDRY]; + queue = PQ_LAUNDRY; scan: + pq = &vmd->vmd_pagequeues[queue]; + marker = &vmd->vmd_markers[queue]; + vm_pagequeue_lock(pq); maxscan = pq->pq_cnt; queue_locked = true; @@ -762,8 +748,7 @@ scan: * Unlock the laundry queue, invalidating the 'next' pointer. * Use a marker to remember our place in the laundry queue. */ - TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_laundry_marker, - plinks.q); + TAILQ_INSERT_AFTER(&pq->pq_pl, m, marker, plinks.q); vm_pagequeue_unlock(pq); queue_locked = false; @@ -889,13 +874,13 @@ relock_queue: vm_pagequeue_lock(pq); queue_locked = true; } - next = TAILQ_NEXT(&vmd->vmd_laundry_marker, plinks.q); - TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_laundry_marker, plinks.q); + next = TAILQ_NEXT(marker, plinks.q); + TAILQ_REMOVE(&pq->pq_pl, marker, plinks.q); } vm_pagequeue_unlock(pq); - if (launder > 0 && pq == &vmd->vmd_pagequeues[PQ_UNSWAPPABLE]) { - pq = &vmd->vmd_pagequeues[PQ_LAUNDRY]; + if (launder > 0 && queue == PQ_UNSWAPPABLE) { + queue = PQ_LAUNDRY; goto scan; } @@ -951,7 +936,6 @@ vm_pageout_laundry_worker(void *arg) vmd = VM_DOMAIN(domain); pq = &vmd->vmd_pagequeues[PQ_LAUNDRY]; KASSERT(vmd->vmd_segs != 0, ("domain without segments")); - vm_pageout_init_marker(&vmd->vmd_laundry_marker, PQ_LAUNDRY); shortfall = 0; in_shortfall = false; @@ -1105,7 +1089,7 @@ dolaundry: static bool vm_pageout_scan(struct vm_domain *vmd, int pass, int shortage) { - vm_page_t m, next; + vm_page_t m, marker, next; struct vm_pagequeue *pq; vm_object_t object; long min_scan; @@ -1159,6 +1143,7 @@ vm_pageout_scan(struct vm_domain *vmd, int pass, int s * decisions for the inactive queue, only for the active queue.) */ pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; + marker = &vmd->vmd_markers[PQ_INACTIVE]; maxscan = pq->pq_cnt; vm_pagequeue_lock(pq); queue_locked = TRUE; @@ -1250,7 +1235,7 @@ unlock_page: * vm_page_free(), or vm_page_launder() is called. Use a * marker to remember our place in the inactive queue. */ - TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_marker, plinks.q); + TAILQ_INSERT_AFTER(&pq->pq_pl, m, marker, plinks.q); vm_page_dequeue_locked(m); vm_pagequeue_unlock(pq); queue_locked = FALSE; @@ -1336,8 +1321,8 @@ drop_page: vm_pagequeue_lock(pq); queue_locked = TRUE; } - next = TAILQ_NEXT(&vmd->vmd_marker, plinks.q); - TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_marker, plinks.q); + next = TAILQ_NEXT(marker, plinks.q); + TAILQ_REMOVE(&pq->pq_pl, marker, plinks.q); } vm_pagequeue_unlock(pq); @@ -1781,10 +1766,6 @@ vm_pageout_worker(void *arg) KASSERT(vmd->vmd_segs != 0, ("domain without segments")); vmd->vmd_last_active_scan = ticks; - vm_pageout_init_marker(&vmd->vmd_marker, PQ_INACTIVE); - vm_pageout_init_marker(&vmd->vmd_inacthead, PQ_INACTIVE); - TAILQ_INSERT_HEAD(&vmd->vmd_pagequeues[PQ_INACTIVE].pq_pl, - &vmd->vmd_inacthead, plinks.q); /* * The pageout daemon worker is never done, so loop forever. Modified: head/sys/vm/vm_pagequeue.h ============================================================================== --- head/sys/vm/vm_pagequeue.h Thu Apr 19 13:37:59 2018 (r332770) +++ head/sys/vm/vm_pagequeue.h Thu Apr 19 14:09:44 2018 (r332771) @@ -107,8 +107,7 @@ struct vm_domain { boolean_t vmd_oom; int vmd_oom_seq; int vmd_last_active_scan; - struct vm_page vmd_laundry_marker; - struct vm_page vmd_marker; /* marker for pagedaemon private use */ + struct vm_page vmd_markers[PQ_COUNT]; /* markers for queue scans */ struct vm_page vmd_inacthead; /* marker for LRU-defeating insertions */ int vmd_pageout_wanted; /* (a, p) pageout daemon wait channel */ From owner-svn-src-head@freebsd.org Thu Apr 19 15:02:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F78F818C5; Thu, 19 Apr 2018 15:02:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C3E85AE1; Thu, 19 Apr 2018 15:02:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4826E3228; Thu, 19 Apr 2018 15:02:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JF2sux051473; Thu, 19 Apr 2018 15:02:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JF2sgQ051472; Thu, 19 Apr 2018 15:02:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804191502.w3JF2sgQ051472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 19 Apr 2018 15:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332773 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 332773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:02:54 -0000 Author: kevans Date: Thu Apr 19 15:02:53 2018 New Revision: 332773 URL: https://svnweb.freebsd.org/changeset/base/332773 Log: Fix ddb rc script r288291 added a call to limits(1), which isn't available before partitions are mounted. This broke the ddb rc script, which does not provide its own start_cmd. Alleviate the situation here by providing a start_cmd. We still have other problems with diskless setups that need to be considered, but this is a start. PR: 206291 Submitted by: cy Discussed with: rgrimes MFC after: 3 days Modified: head/etc/rc.d/ddb Modified: head/etc/rc.d/ddb ============================================================================== --- head/etc/rc.d/ddb Thu Apr 19 15:02:42 2018 (r332772) +++ head/etc/rc.d/ddb Thu Apr 19 15:02:53 2018 (r332773) @@ -15,6 +15,7 @@ desc="DDB kernel debugger" rcvar="ddb_enable" command="/sbin/${name}" start_precmd="ddb_prestart" +start_cmd="ddb_start" stop_cmd=":" ddb_prestart() @@ -23,6 +24,11 @@ ddb_prestart() if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then return 1 fi +} + +ddb_start() +{ + ${command} ${command_args} } load_rc_config $name From owner-svn-src-head@freebsd.org Thu Apr 19 15:03:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C962F81A3F; Thu, 19 Apr 2018 15:03:54 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81CBA86509; Thu, 19 Apr 2018 15:03:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED5D3322B; Thu, 19 Apr 2018 15:03:48 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JF3mGU051561; Thu, 19 Apr 2018 15:03:48 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JF3mlk051559; Thu, 19 Apr 2018 15:03:48 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201804191503.w3JF3mlk051559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 19 Apr 2018 15:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332774 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:03:54 -0000 Author: rrs Date: Thu Apr 19 15:03:48 2018 New Revision: 332774 URL: https://svnweb.freebsd.org/changeset/base/332774 Log: These two modules need the tcp_hpts.h file for when the option is enabled (not sure how LINT/build-universe missed this) opps. Sponsored by: Netflix Inc Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Apr 19 15:02:53 2018 (r332773) +++ head/sys/netinet/tcp_subr.c Thu Apr 19 15:03:48 2018 (r332774) @@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef INET6 #include Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Thu Apr 19 15:02:53 2018 (r332773) +++ head/sys/netinet/tcp_usrreq.c Thu Apr 19 15:03:48 2018 (r332774) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef TCPPCAP #include #endif From owner-svn-src-head@freebsd.org Thu Apr 19 15:16:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A25F82DA2; Thu, 19 Apr 2018 15:16:12 +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 6D70B6A593; Thu, 19 Apr 2018 15:16:11 +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 w3JFG92M066372; Thu, 19 Apr 2018 08:16:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3JFG99V066371; Thu, 19 Apr 2018 08:16:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804191516.w3JFG99V066371@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332773 - head/etc/rc.d In-Reply-To: <201804191502.w3JF2sgQ051472@repo.freebsd.org> To: Kyle Evans Date: Thu, 19 Apr 2018 08:16:09 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:16:12 -0000 > Author: kevans > Date: Thu Apr 19 15:02:53 2018 > New Revision: 332773 > URL: https://svnweb.freebsd.org/changeset/base/332773 > > Log: > Fix ddb rc script > > r288291 added a call to limits(1), which isn't available before partitions > are mounted. This broke the ddb rc script, which does not provide its own > start_cmd. > > Alleviate the situation here by providing a start_cmd. We still have other > problems with diskless setups that need to be considered, but this is a > start. Thanks, Also didn't cy identify a second one of these? Or am I confusing yet another issue? > PR: 206291 > Submitted by: cy > Discussed with: rgrimes > MFC after: 3 days > > Modified: > head/etc/rc.d/ddb > > Modified: head/etc/rc.d/ddb > ============================================================================== > --- head/etc/rc.d/ddb Thu Apr 19 15:02:42 2018 (r332772) > +++ head/etc/rc.d/ddb Thu Apr 19 15:02:53 2018 (r332773) > @@ -15,6 +15,7 @@ desc="DDB kernel debugger" > rcvar="ddb_enable" > command="/sbin/${name}" > start_precmd="ddb_prestart" > +start_cmd="ddb_start" > stop_cmd=":" > > ddb_prestart() > @@ -23,6 +24,11 @@ ddb_prestart() > if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then > return 1 > fi > +} > + > +ddb_start() > +{ > + ${command} ${command_args} > } > > load_rc_config $name > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 19 15:17:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BD71F83039; Thu, 19 Apr 2018 15:17:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 076296A753; Thu, 19 Apr 2018 15:17:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-vk0-f52.google.com (mail-vk0-f52.google.com [209.85.213.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DF3FD20643; Thu, 19 Apr 2018 15:17:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-vk0-f52.google.com with SMTP id d9so3404655vka.4; Thu, 19 Apr 2018 08:17:34 -0700 (PDT) X-Gm-Message-State: ALQs6tD/vIq0qA4vAf/Dfm2Af0GniakSEY9hUUDVWQVZIC4CiLXG+FEP 0zWJHil3OIkeQsnpoZZ6+++v8O78t113JX05ZR0= X-Google-Smtp-Source: AIpwx4/IHt4xgu2PAErBJcdTMd4PNprXhwMfPaIDIlqX4fncWW+sG6SGNk6c2EmPVQkdO/SvH8zMTzlaU4eJsVZ7o90= X-Received: by 10.31.124.131 with SMTP id x125mr4680484vkc.28.1524151054544; Thu, 19 Apr 2018 08:17:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.54.12 with HTTP; Thu, 19 Apr 2018 08:17:14 -0700 (PDT) In-Reply-To: <201804191516.w3JFG99V066371@pdx.rh.CN85.dnsmgr.net> References: <201804191502.w3JF2sgQ051472@repo.freebsd.org> <201804191516.w3JFG99V066371@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 19 Apr 2018 10:17:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332773 - head/etc/rc.d To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:17:35 -0000 On Thu, Apr 19, 2018 at 10:16 AM, Rodney W. Grimes wrote: >> Author: kevans >> Date: Thu Apr 19 15:02:53 2018 >> New Revision: 332773 >> URL: https://svnweb.freebsd.org/changeset/base/332773 >> >> Log: >> Fix ddb rc script >> >> r288291 added a call to limits(1), which isn't available before partitions >> are mounted. This broke the ddb rc script, which does not provide its own >> start_cmd. >> >> Alleviate the situation here by providing a start_cmd. We still have other >> problems with diskless setups that need to be considered, but this is a >> start. > > Thanks, > Also didn't cy identify a second one of these? > Or am I confusing yet another issue? > He identified a second early script that didn't specify start_cmd, but it was a non-issue because it's invoked independently of rc.subr. From owner-svn-src-head@freebsd.org Thu Apr 19 15:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24491F83262 for ; Thu, 19 Apr 2018 15:19:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7F576A93F for ; Thu, 19 Apr 2018 15:19:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id f22-v6so4926805ioc.11 for ; Thu, 19 Apr 2018 08:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QydIaSkqj9SSw6im7p+JHRTBSBHiDnkrTSnkvAkHlCE=; b=G2lOK+cawLbXviSSw72+5yKhrKn9V7rv8X+nrTHPHBZuDGqjBMl5CvYlCcxaznOU+R R92QZffCyaX8FEvDkASFsL6m/kvp0JB85kqBCcer+pp+UBoWEF0/dE3vTuTP8DDdMik3 BmZbbdfXGhbi0JJWRPRVGlOsEB4aG/Kb8xjYrLgLYq5Eeo3xQPd0sGWg8XbFS66hUR4w Mhq7VUsqicplxMfua+GgTYnFUsLX84xNLYT+fYimj7xzVsN46/mIhfgViiMbBpcOGenX 7lOwp6pDPOy9wFIeuZblt5d1JTQSpwGvcNFnwpvuIK30r5LZqJ4oFfdDbnjmJPmj/Goy tpdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=QydIaSkqj9SSw6im7p+JHRTBSBHiDnkrTSnkvAkHlCE=; b=KHuagmAATc7l6NULeUOqSqIp6ErfKbgFkk9ZSEZ9diSnjCdxXiliSBRD0zj2vrkBXX O3intWvAk1A4h2N3KOniHDEvFerAqmwZrwCWyzvxGua7kKBb66Zyr6khaYKVJMLmOqvO 0fpc0zFDD3xjz0JqjJyN38wNQEi3lcP0UGFxEOTJZHZoONLEQKx5EUQbjLqrlJsexuDD TOCBk1im7JQClwP/8StodLiAoaXapFp2m/y2nxvcVg1GkWHeKOZFhq6LDfz6wra9Vkyz xA77plSOe03pRRyyoe7qYR20/LMFoCx2XdAnGM9qidCnaA8JUSZCK1sTaT7fEg01h9HP AdCQ== X-Gm-Message-State: ALQs6tCEtGyMHXoyUn3E4Kg4iCH3tdCzQQHyLezHb5gud8X/4I+2Lohd W+YW5BfTaWBjhNJpY5qKct1r98SFi3bxgLUAnQrbYA== X-Google-Smtp-Source: AIpwx499v69YGtGAiq9RTvIBolVMK53KBFiweHWDknO1jg6CIZ41JaBukVIJprT6iHicM9/A85DkFSiAZiI3dw/7g54= X-Received: by 2002:a6b:12a3:: with SMTP id 35-v6mr6723962ios.168.1524151147850; Thu, 19 Apr 2018 08:19:07 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a604:0:0:0:0:0 with HTTP; Thu, 19 Apr 2018 08:19:07 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201804191502.w3JF2sgQ051472@repo.freebsd.org> <201804191516.w3JFG99V066371@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Thu, 19 Apr 2018 09:19:07 -0600 X-Google-Sender-Auth: At72CJ3unfTlalMv0LY77J8q6m8 Message-ID: Subject: Re: svn commit: r332773 - head/etc/rc.d To: Kyle Evans Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:19:09 -0000 On Thu, Apr 19, 2018 at 9:17 AM, Kyle Evans wrote: > On Thu, Apr 19, 2018 at 10:16 AM, Rodney W. Grimes > wrote: > >> Author: kevans > >> Date: Thu Apr 19 15:02:53 2018 > >> New Revision: 332773 > >> URL: https://svnweb.freebsd.org/changeset/base/332773 > >> > >> Log: > >> Fix ddb rc script > >> > >> r288291 added a call to limits(1), which isn't available before > partitions > >> are mounted. This broke the ddb rc script, which does not provide its > own > >> start_cmd. > >> > >> Alleviate the situation here by providing a start_cmd. We still have > other > >> problems with diskless setups that need to be considered, but this is > a > >> start. > > > > Thanks, > > Also didn't cy identify a second one of these? > > Or am I confusing yet another issue? > > > > He identified a second early script that didn't specify start_cmd, but > it was a non-issue because it's invoked independently of rc.subr. > One would think that it shouldn't invoke limits at all if foo_limits= wasn't specified... Would make the feature much less invasive. Warner From owner-svn-src-head@freebsd.org Thu Apr 19 15:21:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42604F83617; Thu, 19 Apr 2018 15:21:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1E446BA68; Thu, 19 Apr 2018 15:21:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com [209.85.217.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B657F2075E; Thu, 19 Apr 2018 15:21:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-ua0-f181.google.com with SMTP id c3so3693545uae.2; Thu, 19 Apr 2018 08:21:51 -0700 (PDT) X-Gm-Message-State: ALQs6tAHaEFfN6a40KwE951S880BTYs45loFn/M18Hf5F6c1Gu7XvU6u G3O+ojE292DQBR+AehCufUm5re7PZiDNNavV+w4= X-Google-Smtp-Source: AIpwx4/fDkjCh+6XRaiGoYfwAG33eY7CLEz0JZDHHuV7wFShapMf/6OMSl5dsFcEH4GCAxd3/LZg98uuk9uuTrtDQPQ= X-Received: by 10.176.66.165 with SMTP id j34mr4941697uaj.65.1524151311344; Thu, 19 Apr 2018 08:21:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.54.12 with HTTP; Thu, 19 Apr 2018 08:21:30 -0700 (PDT) In-Reply-To: References: <201804191502.w3JF2sgQ051472@repo.freebsd.org> <201804191516.w3JFG99V066371@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 19 Apr 2018 10:21:30 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332773 - head/etc/rc.d To: Warner Losh Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:21:52 -0000 On Thu, Apr 19, 2018 at 10:19 AM, Warner Losh wrote: > > > On Thu, Apr 19, 2018 at 9:17 AM, Kyle Evans wrote: >> >> On Thu, Apr 19, 2018 at 10:16 AM, Rodney W. Grimes >> wrote: >> >> Author: kevans >> >> Date: Thu Apr 19 15:02:53 2018 >> >> New Revision: 332773 >> >> URL: https://svnweb.freebsd.org/changeset/base/332773 >> >> >> >> Log: >> >> Fix ddb rc script >> >> >> >> r288291 added a call to limits(1), which isn't available before >> >> partitions >> >> are mounted. This broke the ddb rc script, which does not provide its >> >> own >> >> start_cmd. >> >> >> >> Alleviate the situation here by providing a start_cmd. We still have >> >> other >> >> problems with diskless setups that need to be considered, but this is >> >> a >> >> start. >> > >> > Thanks, >> > Also didn't cy identify a second one of these? >> > Or am I confusing yet another issue? >> > >> >> He identified a second early script that didn't specify start_cmd, but >> it was a non-issue because it's invoked independently of rc.subr. > > > One would think that it shouldn't invoke limits at all if foo_limits= wasn't > specified... Would make the feature much less invasive. > foo_limits was introduced long after the initial invocation, which was introduced to enforce consistent limits of daemons run from rc.subr. Not doing this due to the lack of foo_flags would certainly kill the original intent, I'm afraid. From owner-svn-src-head@freebsd.org Thu Apr 19 15:24:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D917F83B4E; Thu, 19 Apr 2018 15:24:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F4056D337; Thu, 19 Apr 2018 15:24:22 +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 3884B38E3; Thu, 19 Apr 2018 15:24:22 +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 w3JFOMpD061824; Thu, 19 Apr 2018 15:24:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JFOMoC061823; Thu, 19 Apr 2018 15:24:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804191524.w3JFOMoC061823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 19 Apr 2018 15:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332778 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 332778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:24:22 -0000 Author: cem Date: Thu Apr 19 15:24:21 2018 New Revision: 332778 URL: https://svnweb.freebsd.org/changeset/base/332778 Log: cryptosoft: Do not exceed crd_len around *crypt_multi When a caller passes in a uio or mbuf chain that is longer than crd_len, in tandem with a transform that supports the multi-block interface, swcr_encdec() would process the entire mbuf or uio instead of just the portion indicated by crd_len (+ crd_skip). De/encryption are performed in-place, so this would trash subsequent uio or mbuf contents. This was introduced in r331639 (mea culpa). It only affects the {de,en}crypt_multi() family of interfaces. That interface only has one consumer transform in-tree (for now): Chacha20. PR: 227605 Submitted by: Valentin Vergez Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Thu Apr 19 15:11:18 2018 (r332777) +++ head/sys/opencrypto/cryptosoft.c Thu Apr 19 15:24:21 2018 (r332778) @@ -253,7 +253,8 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data * size_t nb, rem; nb = blks; - rem = uio->uio_iov[ind].iov_len - k; + rem = MIN((size_t)i, + uio->uio_iov[ind].iov_len - (size_t)k); idat = (uint8_t *)uio->uio_iov[ind].iov_base + k; if (exf->reinit) { From owner-svn-src-head@freebsd.org Thu Apr 19 15:27:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE09BF8411F for ; Thu, 19 Apr 2018 15:27:14 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A1A86DCB2 for ; Thu, 19 Apr 2018 15:27:14 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com [209.85.217.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DE29E20763 for ; Thu, 19 Apr 2018 15:27:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-ua0-f181.google.com with SMTP id t4so3701252ual.1 for ; Thu, 19 Apr 2018 08:27:13 -0700 (PDT) X-Gm-Message-State: ALQs6tAg9o3ZUJqhO/lg88D90BPS13tOm4tOzc0IjS6xnrytOk2Z5E8+ 8Jd1C36FVOXdsfQ9qtS/xryPdt1AoeaMOxxcPUo= X-Received: by 10.176.73.176 with SMTP id e45mt5308935uad.167.1524151633519; Thu, 19 Apr 2018 08:27:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.54.12 with HTTP; Thu, 19 Apr 2018 08:26:53 -0700 (PDT) In-Reply-To: References: <201804191502.w3JF2sgQ051472@repo.freebsd.org> <201804191516.w3JFG99V066371@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 19 Apr 2018 10:26:53 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332773 - head/etc/rc.d Cc: Warner Losh , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:27:14 -0000 On Thu, Apr 19, 2018 at 10:21 AM, Kyle Evans wrote: > On Thu, Apr 19, 2018 at 10:19 AM, Warner Losh wrote: >> >> >> On Thu, Apr 19, 2018 at 9:17 AM, Kyle Evans wrote: >>> >>> On Thu, Apr 19, 2018 at 10:16 AM, Rodney W. Grimes >>> wrote: >>> >> Author: kevans >>> >> Date: Thu Apr 19 15:02:53 2018 >>> >> New Revision: 332773 >>> >> URL: https://svnweb.freebsd.org/changeset/base/332773 >>> >> >>> >> Log: >>> >> Fix ddb rc script >>> >> >>> >> r288291 added a call to limits(1), which isn't available before >>> >> partitions >>> >> are mounted. This broke the ddb rc script, which does not provide its >>> >> own >>> >> start_cmd. >>> >> >>> >> Alleviate the situation here by providing a start_cmd. We still have >>> >> other >>> >> problems with diskless setups that need to be considered, but this is >>> >> a >>> >> start. >>> > >>> > Thanks, >>> > Also didn't cy identify a second one of these? >>> > Or am I confusing yet another issue? >>> > >>> >>> He identified a second early script that didn't specify start_cmd, but >>> it was a non-issue because it's invoked independently of rc.subr. >> >> >> One would think that it shouldn't invoke limits at all if foo_limits= wasn't >> specified... Would make the feature much less invasive. >> > > foo_limits was introduced long after the initial invocation, which was > introduced to enforce consistent limits of daemons run from rc.subr. > Not doing this due to the lack of foo_flags would certainly kill the > original intent, I'm afraid. I do wonder if some kind of kenv var or something would be appropriate to disable this whole mess for some setups that it just clearly won't work in, but maybe that's a terrible thought. From owner-svn-src-head@freebsd.org Thu Apr 19 15:29:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A31EF843F7; Thu, 19 Apr 2018 15:29:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D9846DEDB; Thu, 19 Apr 2018 15:29:11 +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 389DE38F2; Thu, 19 Apr 2018 15:29:11 +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 w3JFTBmv062048; Thu, 19 Apr 2018 15:29:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JFTBAx062047; Thu, 19 Apr 2018 15:29:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804191529.w3JFTBAx062047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 Apr 2018 15:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332779 - head/sys/powerpc/powermac X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/powerpc/powermac X-SVN-Commit-Revision: 332779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:29:11 -0000 Author: mav Date: Thu Apr 19 15:29:10 2018 New Revision: 332779 URL: https://svnweb.freebsd.org/changeset/base/332779 Log: Release memory resource on cuda driver attach failure. Submitted by: Dmitry Luhtionov Modified: head/sys/powerpc/powermac/cuda.c Modified: head/sys/powerpc/powermac/cuda.c ============================================================================== --- head/sys/powerpc/powermac/cuda.c Thu Apr 19 15:24:21 2018 (r332778) +++ head/sys/powerpc/powermac/cuda.c Thu Apr 19 15:29:10 2018 (r332779) @@ -165,12 +165,16 @@ cuda_attach(device_t dev) RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, + sc->sc_memr); return (ENXIO); } if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_MISC | INTR_MPSAFE | INTR_ENTROPY, NULL, cuda_intr, dev, &sc->sc_ih) != 0) { device_printf(dev, "could not setup interrupt\n"); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, + sc->sc_memr); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqrid, sc->sc_irq); return (ENXIO); From owner-svn-src-head@freebsd.org Thu Apr 19 15:39:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 081EDF85562; Thu, 19 Apr 2018 15:39:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFDA46F0BC; Thu, 19 Apr 2018 15:39:20 +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 AAB6E3B2C; Thu, 19 Apr 2018 15:39:20 +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 w3JFdK8a067885; Thu, 19 Apr 2018 15:39:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JFdKVQ067884; Thu, 19 Apr 2018 15:39:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804191539.w3JFdKVQ067884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 19 Apr 2018 15:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332780 - 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: 332780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:39:21 -0000 Author: imp Date: Thu Apr 19 15:39:20 2018 New Revision: 332780 URL: https://svnweb.freebsd.org/changeset/base/332780 Log: Intel drives have an optimal alignment for I/O. While they honor I/Os that cross this boundary, they perform better when this isn't the case. Intel uses the 3rd byte in the vendor specific area for this. The DC P3500 was previously listed without any explanation. Add the DC P3520 and DC P4500 to the list. There won't be any others drives needing this quirk. Intel has standardized a field in the namespace data in 1.3 (noiob). A future patch will use that if it exists, with fallback to this method. Submitted by: Keith Busch Reviewed by: jimharris@ Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Thu Apr 19 15:29:10 2018 (r332779) +++ head/sys/dev/nvme/nvme_ns.c Thu Apr 19 15:39:20 2018 (r332780) @@ -505,9 +505,23 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t ns->id = id; ns->stripesize = 0; - if (pci_get_devid(ctrlr->dev) == 0x09538086 && ctrlr->cdata.vs[3] != 0) - ns->stripesize = - (1 << ctrlr->cdata.vs[3]) * ctrlr->min_page_size; + /* + * Some Intel devices advertise an alignment that improves performance, + * but is in it's vendor specific space in the cdata. Use it for these + * drives, if present, to suggest a stripe size. Future versions of + * Intel hardware will use fields standardized in NVMe 1.3 for this. + */ + switch (pci_get_devid(ctrlr->dev)) { + case 0x09538086: /* Intel DC PC3500 */ + case 0x0a538086: /* Intel DC PC3520 */ + case 0x0a548086: /* Intel DC PC4500 */ + if (ctrlr->cdata.vs[3] != 0) + ns->stripesize = + (1 << ctrlr->cdata.vs[3]) * ctrlr->min_page_size; + break; + default: + break; + } /* * Namespaces are reconstructed after a controller reset, so check From owner-svn-src-head@freebsd.org Thu Apr 19 15:40:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6CAF8590C; Thu, 19 Apr 2018 15:40:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9756F89F; Thu, 19 Apr 2018 15:40:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w3JFesws066489; Thu, 19 Apr 2018 08:40:54 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3JFesdQ066488; Thu, 19 Apr 2018 08:40:54 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804191540.w3JFesdQ066488@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332773 - head/etc/rc.d In-Reply-To: To: Kyle Evans Date: Thu, 19 Apr 2018 08:40:54 -0700 (PDT) CC: Warner Losh , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:40:59 -0000 > On Thu, Apr 19, 2018 at 10:21 AM, Kyle Evans wrote: > > On Thu, Apr 19, 2018 at 10:19 AM, Warner Losh wrote: > >> > >> > >> On Thu, Apr 19, 2018 at 9:17 AM, Kyle Evans wrote: > >>> > >>> On Thu, Apr 19, 2018 at 10:16 AM, Rodney W. Grimes > >>> wrote: > >>> >> Author: kevans > >>> >> Date: Thu Apr 19 15:02:53 2018 > >>> >> New Revision: 332773 > >>> >> URL: https://svnweb.freebsd.org/changeset/base/332773 > >>> >> > >>> >> Log: > >>> >> Fix ddb rc script > >>> >> > >>> >> r288291 added a call to limits(1), which isn't available before > >>> >> partitions > >>> >> are mounted. This broke the ddb rc script, which does not provide its > >>> >> own > >>> >> start_cmd. > >>> >> > >>> >> Alleviate the situation here by providing a start_cmd. We still have > >>> >> other > >>> >> problems with diskless setups that need to be considered, but this is > >>> >> a > >>> >> start. > >>> > > >>> > Thanks, > >>> > Also didn't cy identify a second one of these? > >>> > Or am I confusing yet another issue? > >>> > > >>> > >>> He identified a second early script that didn't specify start_cmd, but > >>> it was a non-issue because it's invoked independently of rc.subr. > >> > >> > >> One would think that it shouldn't invoke limits at all if foo_limits= wasn't > >> specified... Would make the feature much less invasive. I agree. This should be implemented, if it isn't already working that way. > >> > > > > foo_limits was introduced long after the initial invocation, which was > > introduced to enforce consistent limits of daemons run from rc.subr. > > Not doing this due to the lack of foo_flags would certainly kill the > > original intent, I'm afraid. > > I do wonder if some kind of kenv var or something would be appropriate > to disable this whole mess for some setups that it just clearly won't > work in, but maybe that's a terrible thought. I think you miss understood Warner. He is saying that if there is no rc var *_limits there should be no invocation of limits(1) at all, making much of this whole mess for many of us a NOP. I actually believe that is how the code already works, but not sure. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 19 15:55:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4698F86E66; Thu, 19 Apr 2018 15:55:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CEE773C50; Thu, 19 Apr 2018 15:55:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 1291E20A3D; Thu, 19 Apr 2018 15:55:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f45.google.com with SMTP id d79-v6so919127lfd.0; Thu, 19 Apr 2018 08:55:34 -0700 (PDT) X-Gm-Message-State: ALQs6tAdX42tIGnje9ygiEq7fC4vAp0eIA8POD1J9N5RBqgSia+mfTME 86ke82Yvi+aMnUTr85B3giFvn4U7yqy2UGmRyFE= X-Google-Smtp-Source: AB8JxZpTw+8FRbsYWmdqtRsDmiYhZaDbUjdZM3VlUb1BHEiEULdb/MeELWqPDSZzQG75IRIGG7FnSJ7q8a6wPRgoAps= X-Received: by 2002:a19:7904:: with SMTP id u4-v6mr388588lfc.129.1524153332640; Thu, 19 Apr 2018 08:55:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Thu, 19 Apr 2018 08:55:12 -0700 (PDT) In-Reply-To: <201804191540.w3JFesdQ066488@pdx.rh.CN85.dnsmgr.net> References: <201804191540.w3JFesdQ066488@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 19 Apr 2018 10:55:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332773 - head/etc/rc.d To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:55:35 -0000 On Thu, Apr 19, 2018 at 10:40 AM, Rodney W. Grimes wrote: >> On Thu, Apr 19, 2018 at 10:21 AM, Kyle Evans wrote: >> > On Thu, Apr 19, 2018 at 10:19 AM, Warner Losh wrote: >> >> >> >> >> >> On Thu, Apr 19, 2018 at 9:17 AM, Kyle Evans wrote: >> >>> >> >>> On Thu, Apr 19, 2018 at 10:16 AM, Rodney W. Grimes >> >>> wrote: >> >>> >> Author: kevans >> >>> >> Date: Thu Apr 19 15:02:53 2018 >> >>> >> New Revision: 332773 >> >>> >> URL: https://svnweb.freebsd.org/changeset/base/332773 >> >>> >> >> >>> >> Log: >> >>> >> Fix ddb rc script >> >>> >> >> >>> >> r288291 added a call to limits(1), which isn't available before >> >>> >> partitions >> >>> >> are mounted. This broke the ddb rc script, which does not provide its >> >>> >> own >> >>> >> start_cmd. >> >>> >> >> >>> >> Alleviate the situation here by providing a start_cmd. We still have >> >>> >> other >> >>> >> problems with diskless setups that need to be considered, but this is >> >>> >> a >> >>> >> start. >> >>> > >> >>> > Thanks, >> >>> > Also didn't cy identify a second one of these? >> >>> > Or am I confusing yet another issue? >> >>> > >> >>> >> >>> He identified a second early script that didn't specify start_cmd, but >> >>> it was a non-issue because it's invoked independently of rc.subr. >> >> >> >> >> >> One would think that it shouldn't invoke limits at all if foo_limits= wasn't >> >> specified... Would make the feature much less invasive. > > I agree. This should be implemented, > if it isn't already working that way. > >> >> >> > >> > foo_limits was introduced long after the initial invocation, which was >> > introduced to enforce consistent limits of daemons run from rc.subr. >> > Not doing this due to the lack of foo_flags would certainly kill the >> > original intent, I'm afraid. >> >> I do wonder if some kind of kenv var or something would be appropriate >> to disable this whole mess for some setups that it just clearly won't >> work in, but maybe that's a terrible thought. > > I think you miss understood Warner. He is saying that if there is no > rc var *_limits there should be no invocation of limits(1) at all, > making much of this whole mess for many of us a NOP. No, I understood that perfectly... the *_limits rc var was introduced much later just so one can add extra flags to this limits(1) invocation. This would be counter-productive to the original intention of the limits(1) invocation, which had no concept of foo_limits until lately and was intended to just generally apply to all rc scripts without a bunch of redundant crud in every rc script that it can apply to. > I actually believe that is how the code already works, but not sure. Negative, as I've already mentioned a couple of times... limits(1) is applied basically unconditionally. From owner-svn-src-head@freebsd.org Thu Apr 19 15:59:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD105F88474 for ; Thu, 19 Apr 2018 15:59:33 +0000 (UTC) (envelope-from erj@erj.cc) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61304750D4 for ; Thu, 19 Apr 2018 15:59:33 +0000 (UTC) (envelope-from erj@erj.cc) Received: by mail-io0-x22a.google.com with SMTP id q84-v6so7171783iod.10 for ; Thu, 19 Apr 2018 08:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=erj.cc; s=ericroxx; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Nh5svpCAyWQDLvkL7pTrP/KQ3+iUeRxam0pCOv61b4E=; b=MYi2H4Uu1ukQScIQ7Xhvf0BgRhAKOQL+JltjtWlQXRk9jQv+FXiYUNIjADvjF3kV48 L5WnFgfmWqXi1cV6dqH0JqQj/i72/ikMmm6Q8UgfwK/YD84vJ7Z1zmaU9STqZBdv3SLt 4kbYnRy0J24pkilQsoulonhaAk9exfDAWzvNU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Nh5svpCAyWQDLvkL7pTrP/KQ3+iUeRxam0pCOv61b4E=; b=TyKDnWvKSGLhRamuQp4hcBVyyZp+KJjJUqW1AUnVpiSQ8wWrYWUxapddGyCACjOlQ3 gnXy0ihzxpDMWmh3n/Dk3MDGNQPa/PnezxoV4cED21eu9f6mohLE+QNWYw3K+N+l5wLU WfOFBDA20i2hswK4VCur7eKtT6cn5Wcb2dw8VEXIRH4OxLG1sFnAJtAXPJD2QAPOsh3x FhZebXptj2/AGikYGzTM7cR7Kfhj7V26QsEWei5ovpgXMhFX6ce9DwSwEsMQ1w1OPF9v g5N2cQdIKuwuoaPpP0SeumSnW7TkKBgATydFAP2IBCah5FD3vdqBPU/wJ2lX2WQPFTAt HeRg== X-Gm-Message-State: ALQs6tB4Z1ZCEbJLRIkFazF/hcrlZsuqRLaM4bQAagjzr1dTN5s7CbOk +UjJZ0ZlmFEMPhdX7P+w8nFvCayDAeEl6QZ8wq+rRQ== X-Google-Smtp-Source: AB8JxZrdHB4vQ/0hm5neqLiko1suvJQtaHBcCVUvYJ06AplFg76SDGGV6m4xPwYL+t8uwoE2tkcewlDXfv5FUqjkbE0= X-Received: by 2002:a6b:8d55:: with SMTP id p82-v6mr6811427iod.57.1524153572686; Thu, 19 Apr 2018 08:59:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:8386:0:0:0:0:0 with HTTP; Thu, 19 Apr 2018 08:59:32 -0700 (PDT) In-Reply-To: <201804181845.w3IIjYdt037258@repo.freebsd.org> References: <201804181845.w3IIjYdt037258@repo.freebsd.org> From: Eric Joyner Date: Thu, 19 Apr 2018 08:59:32 -0700 Message-ID: Subject: Re: svn commit: r332735 - head/sys/x86/x86 To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 15:59:34 -0000 Is the limit going to be increased at some point? Is there a true limit somewhere? On Wed, Apr 18, 2018 at 11:45 AM, John Baldwin wrote: > Author: jhb > Date: Wed Apr 18 18:45:34 2018 > New Revision: 332735 > URL: https://svnweb.freebsd.org/changeset/base/332735 > > Log: > Fix two off-by-one errors when allocating MSI and MSI-X interrupts. > > x86 enforces an (arbitray) limit on the number of available MSI and > MSI-X interrupts to simplify code (in particular, interrupt_source[] > is statically sized). This means that an attempt to allocate an MSI > vector needs to fail if it would go beyond the limit, but the checks > for exceeding the limit had an off-by-one error. In the case of MSI-X > which allocates interrupts one at a time this meant that IRQ 768 kept > getting handed out multiple times for msix_alloc() instead of failing > because all MSI IRQs were in use. > > Tested by: lidl > MFC after: 1 week > > Modified: > head/sys/x86/x86/msi.c > > Modified: head/sys/x86/x86/msi.c > ============================================================ > ================== > --- head/sys/x86/x86/msi.c Wed Apr 18 18:45:04 2018 (r332734) > +++ head/sys/x86/x86/msi.c Wed Apr 18 18:45:34 2018 (r332735) > @@ -404,7 +404,7 @@ again: > /* Do we need to create some new sources? */ > if (cnt < count) { > /* If we would exceed the max, give up. */ > - if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) { > + if (i + (count - cnt) >= FIRST_MSI_INT + NUM_MSI_INTS) { > mtx_unlock(&msi_lock); > free(mirqs, M_MSI); > return (ENXIO); > @@ -645,7 +645,7 @@ again: > /* Do we need to create a new source? */ > if (msi == NULL) { > /* If we would exceed the max, give up. */ > - if (i + 1 > FIRST_MSI_INT + NUM_MSI_INTS) { > + if (i + 1 >= FIRST_MSI_INT + NUM_MSI_INTS) { > mtx_unlock(&msi_lock); > return (ENXIO); > } > > From owner-svn-src-head@freebsd.org Thu Apr 19 16:00:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C8AF885E4; Thu, 19 Apr 2018 16:00:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9524575281; Thu, 19 Apr 2018 16:00:35 +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 8C75F3E9A; Thu, 19 Apr 2018 16:00:35 +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 w3JG0ZHl077997; Thu, 19 Apr 2018 16:00:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JG0Y0w077991; Thu, 19 Apr 2018 16:00:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804191600.w3JG0Y0w077991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 19 Apr 2018 16:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332782 - in head/sys: amd64/linux amd64/linux32 compat/freebsd32 i386/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/freebsd32 i386/linux kern sys X-SVN-Commit-Revision: 332782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 16:00:36 -0000 Author: jhb Date: Thu Apr 19 16:00:34 2018 New Revision: 332782 URL: https://svnweb.freebsd.org/changeset/base/332782 Log: Simplify the code to allocate stack for auxv, argv[], and environment vectors. Remove auxarg_size as it was only used once right after a confusing assignment in each of the variants of exec_copyout_strings(). Reviewed by: emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15123 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/kern_exec.c head/sys/sys/imgact.h Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Thu Apr 19 15:52:45 2018 (r332781) +++ head/sys/amd64/linux/linux_sysvec.c Thu Apr 19 16:00:34 2018 (r332782) @@ -331,31 +331,21 @@ linux_copyout_strings(struct image_params *imgp) roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* If we have a valid auxargs ptr, prepare some room on the stack. */ + vectp = (char **)destp; if (imgp->auxargs) { /* - * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for - * lower compatibility. + * Allocate room on the stack for the ELF auxargs + * array. It has LINUX_AT_COUNT entries. */ - imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size : - (LINUX_AT_COUNT * 2); - - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets,and imgp->auxarg_size is room - * for argument of Runtime loader. - */ - vectp = (char **)(destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size) * sizeof(char *)); - - } else { - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets - */ - vectp = (char **)(destp - (imgp->args->argc + - imgp->args->envc + 2) * sizeof(char *)); + vectp -= howmany(LINUX_AT_COUNT * sizeof(Elf64_Auxinfo), + sizeof(*vectp)); } + + /* + * Allocate room for the argv[] and env vectors including the + * terminating NULL pointers. + */ + vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; /* vectp also becomes our initial stack base. */ stack_base = (register_t *)vectp; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Thu Apr 19 15:52:45 2018 (r332781) +++ head/sys/amd64/linux32/linux32_sysvec.c Thu Apr 19 16:00:34 2018 (r332782) @@ -793,31 +793,21 @@ linux_copyout_strings(struct image_params *imgp) roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* If we have a valid auxargs ptr, prepare some room on the stack. */ + vectp = (uint32_t *)destp; if (imgp->auxargs) { /* - * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for - * lower compatibility. + * Allocate room on the stack for the ELF auxargs + * array. It has LINUX_AT_COUNT entries. */ - imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size : - (LINUX_AT_COUNT * 2); - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets,and imgp->auxarg_size is room - * for argument of Runtime loader. - */ - vectp = (u_int32_t *) (destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size) * - sizeof(u_int32_t)); - - } else { - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets - */ - vectp = (u_int32_t *)(destp - (imgp->args->argc + - imgp->args->envc + 2) * sizeof(u_int32_t)); + vectp -= howmany(LINUX_AT_COUNT * sizeof(Elf32_Auxinfo), + sizeof(*vectp)); } + + /* + * Allocate room for the argv[] and env vectors including the + * terminating NULL pointers. + */ + vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; /* vectp also becomes our initial stack base. */ stack_base = vectp; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Apr 19 15:52:45 2018 (r332781) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Apr 19 16:00:34 2018 (r332782) @@ -3180,33 +3180,21 @@ freebsd32_copyout_strings(struct image_params *imgp) destp -= ARG_MAX - imgp->args->stringspace; destp = rounddown2(destp, sizeof(uint32_t)); - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ + vectp = (uint32_t *)destp; if (imgp->auxargs) { /* - * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for - * lower compatibility. + * Allocate room on the stack for the ELF auxargs + * array. It has up to AT_COUNT entries. */ - imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size - : (AT_COUNT * 2); - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets,and imgp->auxarg_size is room - * for argument of Runtime loader. - */ - vectp = (u_int32_t *) (destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * - sizeof(u_int32_t)); - } else { - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets - */ - vectp = (u_int32_t *)(destp - (imgp->args->argc + - imgp->args->envc + 2) * sizeof(u_int32_t)); + vectp -= howmany(AT_COUNT * sizeof(Elf32_Auxinfo), + sizeof(*vectp)); } + + /* + * Allocate room for the argv[] and env vectors including the + * terminating NULL pointers. + */ + vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; /* * vectp also becomes our initial stack base Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Thu Apr 19 15:52:45 2018 (r332781) +++ head/sys/i386/linux/linux_sysvec.c Thu Apr 19 16:00:34 2018 (r332782) @@ -309,29 +309,21 @@ linux_copyout_strings(struct image_params *imgp) roundup(sizeof(canary), sizeof(char *)); copyout(canary, (void *)imgp->canary, sizeof(canary)); - /* If we have a valid auxargs ptr, prepare some room on the stack. */ + vectp = (char **)destp; if (imgp->auxargs) { /* - * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for - * lower compatibility. + * Allocate room on the stack for the ELF auxargs + * array. It has LINUX_AT_COUNT entries. */ - imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size : - (LINUX_AT_COUNT * 2); - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets,and imgp->auxarg_size is room - * for argument of Runtime loader. - */ - vectp = (char **)(destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size) * sizeof(char *)); - } else { - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets - */ - vectp = (char **)(destp - (imgp->args->argc + imgp->args->envc + 2) * - sizeof(char *)); + vectp -= howmany(LINUX_AT_COUNT * sizeof(Elf32_Auxinfo), + sizeof(*vectp)); } + + /* + * Allocate room for the argv[] and env vectors including the + * terminating NULL pointers. + */ + vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; /* vectp also becomes our initial stack base. */ stack_base = (register_t *)vectp; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Apr 19 15:52:45 2018 (r332781) +++ head/sys/kern/kern_exec.c Thu Apr 19 16:00:34 2018 (r332782) @@ -1537,33 +1537,21 @@ exec_copyout_strings(struct image_params *imgp) destp -= ARG_MAX - imgp->args->stringspace; destp = rounddown2(destp, sizeof(void *)); - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ + vectp = (char **)destp; if (imgp->auxargs) { /* - * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for - * lower compatibility. + * Allocate room on the stack for the ELF auxargs + * array. It has up to AT_COUNT entries. */ - imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size : - (AT_COUNT * 2); - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets,and imgp->auxarg_size is room - * for argument of Runtime loader. - */ - vectp = (char **)(destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size) - * sizeof(char *)); - } else { - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets - */ - vectp = (char **)(destp - (imgp->args->argc + imgp->args->envc - + 2) * sizeof(char *)); + vectp -= howmany(AT_COUNT * sizeof(Elf_Auxinfo), + sizeof(*vectp)); } + + /* + * Allocate room for the argv[] and env vectors including the + * terminating NULL pointers. + */ + vectp -= imgp->args->argc + 1 + imgp->args->envc + 1; /* * vectp also becomes our initial stack base Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Thu Apr 19 15:52:45 2018 (r332781) +++ head/sys/sys/imgact.h Thu Apr 19 16:00:34 2018 (r332782) @@ -75,7 +75,6 @@ struct image_params { void *auxargs; /* ELF Auxinfo structure pointer */ struct sf_buf *firstpage; /* first page that we mapped */ unsigned long ps_strings; /* PS_STRINGS for BSD/OS binaries */ - size_t auxarg_size; struct image_args *args; /* system call arguments */ struct sysentvec *sysent; /* system entry vector */ char *execpath; From owner-svn-src-head@freebsd.org Thu Apr 19 16:05:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BDA5F88E7E; Thu, 19 Apr 2018 16:05:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE17375B33; Thu, 19 Apr 2018 16:05:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3EDF405D; Thu, 19 Apr 2018 16:05:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JG5m2Q082635; Thu, 19 Apr 2018 16:05:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JG5mIY082634; Thu, 19 Apr 2018 16:05:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804191605.w3JG5mIY082634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 19 Apr 2018 16:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332783 - 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: 332783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 16:05:49 -0000 Author: imp Date: Thu Apr 19 16:05:48 2018 New Revision: 332783 URL: https://svnweb.freebsd.org/changeset/base/332783 Log: Reword comment to remove awkward constructs, including an "it's" that shouldn't have been there at all (it wasn't a typo for its, rather a left-over from an older revision of the comment). Noticed by: many Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Thu Apr 19 16:00:34 2018 (r332782) +++ head/sys/dev/nvme/nvme_ns.c Thu Apr 19 16:05:48 2018 (r332783) @@ -506,10 +506,9 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t ns->stripesize = 0; /* - * Some Intel devices advertise an alignment that improves performance, - * but is in it's vendor specific space in the cdata. Use it for these - * drives, if present, to suggest a stripe size. Future versions of - * Intel hardware will use fields standardized in NVMe 1.3 for this. + * Older Intel devices advertise in vendor specific space an alignment + * that improves performance. If present use for the stripe size. NVMe + * 1.3 standardized this as NOIOB, and newer Intel drives use that. */ switch (pci_get_devid(ctrlr->dev)) { case 0x09538086: /* Intel DC PC3500 */ From owner-svn-src-head@freebsd.org Thu Apr 19 16:49:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33617F8C140; Thu, 19 Apr 2018 16:49: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 C87E282AD6; Thu, 19 Apr 2018 16:49:50 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C7D555A9F12; Thu, 19 Apr 2018 16:49:43 +0000 (UTC) Date: Thu, 19 Apr 2018 16:49:43 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332782 - in head/sys: amd64/linux amd64/linux32 compat/freebsd32 i386/linux kern sys Message-ID: <20180419164943.GA84360@spindle.one-eyed-alien.net> References: <201804191600.w3JG0Y0w077991@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <201804191600.w3JG0Y0w077991@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 16:49:51 -0000 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 19, 2018 at 04:00:34PM +0000, John Baldwin wrote: > Author: jhb > Date: Thu Apr 19 16:00:34 2018 > New Revision: 332782 > URL: https://svnweb.freebsd.org/changeset/base/332782 >=20 > Log: > Simplify the code to allocate stack for auxv, argv[], and environment v= ectors. > =20 > Remove auxarg_size as it was only used once right after a confusing > assignment in each of the variants of exec_copyout_strings(). Thanks! I just tripped over auxarg_size's confusing nature in CheriBSD. I do wonder if allocating AT_COUNT entries is quite right since some are emitted only optionally. That said, it's not as though the waste is significant. -- Brooks --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa2MinAAoJEKzQXbSebgfAqncH/1QJGadgYQpo58lkuhbLSgJS LWlPZVVr7vn5+rAOhsODmYaXpJib1Ylukn5ik0yse4YSx8mLoEAIK9ewf7E2Wr67 hnRFeK6SwXFNi2TqqS+mdv/YQ92LrOx57TDywD5dKqTma2sHSwe28NAAICVm4WZG oUuS7NgDYzckQtnJxWqp7tuZsTbzofwMwH5CkzhNmBMj3QAmT60oEqvBFLe55rLE VPqPb1rW8xCiMJIeXLCeynb50YRjAMlZcvKtnFHDVAP+eV0x8fzQqQUPGM3Kp1hX zmsDdeGsPtFN9hNT/yq6Ea1HnpAldoNmfdRyvBSRh0qa7ny92tdIuQlkoIn05N4= =JyDk -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU-- From owner-svn-src-head@freebsd.org Thu Apr 19 18:08:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D83F92115; Thu, 19 Apr 2018 18:08: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95A98744AA; Thu, 19 Apr 2018 18:08:46 +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 8BC0253AE; Thu, 19 Apr 2018 18:08:46 +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 w3JI8kla043864; Thu, 19 Apr 2018 18:08:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JI8k1M043863; Thu, 19 Apr 2018 18:08:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804191808.w3JI8k1M043863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Apr 2018 18:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332786 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 332786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 18:08:47 -0000 Author: kib Date: Thu Apr 19 18:08:46 2018 New Revision: 332786 URL: https://svnweb.freebsd.org/changeset/base/332786 Log: Use symbolic constant, explaining the operation. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/include/asmacros.h Modified: head/sys/i386/include/asmacros.h ============================================================================== --- head/sys/i386/include/asmacros.h Thu Apr 19 17:55:48 2018 (r332785) +++ head/sys/i386/include/asmacros.h Thu Apr 19 18:08:46 2018 (r332786) @@ -190,7 +190,7 @@ movl $TF_SZ, %ecx testl $PSL_VM, TF_EFLAGS(%esp) jz 1001f - addl $(4*4), %ecx + addl $VM86_STACK_SPACE, %ecx 1001: subl %ecx, %edx movl %edx, %edi movl %esp, %esi From owner-svn-src-head@freebsd.org Thu Apr 19 18:10:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F40F92545; Thu, 19 Apr 2018 18:10:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59EDA751A1; Thu, 19 Apr 2018 18:10:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54DCE53C1; Thu, 19 Apr 2018 18:10:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JIAjUQ044076; Thu, 19 Apr 2018 18:10:45 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JIAjub044074; Thu, 19 Apr 2018 18:10:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804191810.w3JIAjub044074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 19 Apr 2018 18:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332787 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 332787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 18:10:45 -0000 Author: np Date: Thu Apr 19 18:10:44 2018 New Revision: 332787 URL: https://svnweb.freebsd.org/changeset/base/332787 Log: cxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag. Retrieve the tag from the correct ifnet and use the provided tag (instead of hardcoded 0xffff, implying no tag) in the routines that process offload policy. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Apr 19 18:08:46 2018 (r332786) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Apr 19 18:10:44 2018 (r332787) @@ -405,7 +405,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct ifnet *ifp = VLAN_COOKIE(rt_ifp); vi = ifp->if_softc; - VLAN_TAG(ifp, &vid); + VLAN_TAG(rt_ifp, &vid); } else if (rt_ifp->if_type == IFT_IEEE8023ADLAG) DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 19 18:08:46 2018 (r332786) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 19 18:10:44 2018 (r332787) @@ -1234,7 +1234,7 @@ lookup_offload_policy(struct adapter *sc, int open_typ switch (open_type) { case OPEN_TYPE_ACTIVE: case OPEN_TYPE_LISTEN: - pkt = prepare_pkt(open_type, 0xffff, inp, &pktlen, &buflen); + pkt = prepare_pkt(open_type, vtag, inp, &pktlen, &buflen); break; case OPEN_TYPE_PASSIVE: MPASS(m != NULL); From owner-svn-src-head@freebsd.org Thu Apr 19 18:34:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E955DF94598; Thu, 19 Apr 2018 18:34:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96AF878CD4; Thu, 19 Apr 2018 18:34:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77A0E5887; Thu, 19 Apr 2018 18:34:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JIYcdc059560; Thu, 19 Apr 2018 18:34:38 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JIYcLx059559; Thu, 19 Apr 2018 18:34:38 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201804191834.w3JIYcLx059559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 19 Apr 2018 18:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332788 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 332788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 18:34:39 -0000 Author: nwhitehorn Date: Thu Apr 19 18:34:38 2018 New Revision: 332788 URL: https://svnweb.freebsd.org/changeset/base/332788 Log: Fix detection of memory overlap with the kernel in the case where a memory region marked "available" by firmware is contained entirely in the kernel. This had a tendency to happen with FDTs passed by loader, though could for other reasons as well, and would result in the kernel slowly cannibalizing itself for other purposes, eventually resulting in a crash. A similar fix is needed for mmu_oea.c and should probably just be rolled at that point into some generic code in platform.c for taking a mem_region list and removing chunks. PR: 226974 Submitted by: leandro.lupori@gmail.com Reviewed by: jhibbits Differential Revision: D15121 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Apr 19 18:10:44 2018 (r332787) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Apr 19 18:34:38 2018 (r332788) @@ -695,12 +695,27 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel unmapped_buf_allowed = hw_direct_map; } +/* Quick sort callout for comparing physical addresses. */ +static int +pa_cmp(const void *a, const void *b) +{ + const vm_paddr_t *pa = a, *pb = b; + + if (*pa < *pb) + return (-1); + else if (*pa > *pb) + return (1); + else + return (0); +} + void moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) { int i, j; vm_size_t physsz, hwphyssz; vm_paddr_t kernelphysstart, kernelphysend; + int rm_pavail; #ifndef __powerpc64__ /* We don't have a direct map since there is no BAT */ @@ -763,10 +778,18 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels } /* Check for overlap with the kernel and exception vectors */ + rm_pavail = 0; for (j = 0; j < 2*phys_avail_count; j+=2) { if (phys_avail[j] < EXC_LAST) phys_avail[j] += EXC_LAST; + if (phys_avail[j] >= kernelphysstart && + phys_avail[j+1] <= kernelphysend) { + phys_avail[j] = phys_avail[j+1] = ~0; + rm_pavail++; + continue; + } + if (kernelphysstart >= phys_avail[j] && kernelphysstart < phys_avail[j+1]) { if (kernelphysend < phys_avail[j+1]) { @@ -792,6 +815,16 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernels phys_avail[j] = (kernelphysend & ~PAGE_MASK) + PAGE_SIZE; } + } + + /* Remove physical available regions marked for removal (~0) */ + if (rm_pavail) { + qsort(phys_avail, 2*phys_avail_count, sizeof(phys_avail[0]), + pa_cmp); + phys_avail_count -= rm_pavail; + for (i = 2*phys_avail_count; + i < 2*(phys_avail_count + rm_pavail); i+=2) + phys_avail[i] = phys_avail[i+1] = 0; } physmem = btoc(physsz); From owner-svn-src-head@freebsd.org Thu Apr 19 20:25:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 755BCF9F149; Thu, 19 Apr 2018 20:25: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 291E875603; Thu, 19 Apr 2018 20:25:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 242BC6A42; Thu, 19 Apr 2018 20:25:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JKPK9t014425; Thu, 19 Apr 2018 20:25:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JKPKPx014424; Thu, 19 Apr 2018 20:25:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804192025.w3JKPKPx014424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Apr 2018 20:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332789 - head/usr.sbin/pwd_mkdb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/pwd_mkdb X-SVN-Commit-Revision: 332789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 20:25:20 -0000 Author: emaste Date: Thu Apr 19 20:25:19 2018 New Revision: 332789 URL: https://svnweb.freebsd.org/changeset/base/332789 Log: pwd_mkdb: warn that legacy support is deprecated (if specified) r283981 switched pwd_mkdb to emit only v4 database entries by default, and introduced a -l (legacy) option emit v3 entries in addition. The commit message claims that legacy support will be removed in 12.0, so emit a warning now if it is used. Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Apr 19 18:34:38 2018 (r332788) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Apr 19 20:25:19 2018 (r332789) @@ -166,6 +166,8 @@ main(int argc, char *argv[]) if (argc != 1 || (username && (*username == '+' || *username == '-'))) usage(); + if (lflag) + warnx("legacy (v3) database format support is deprecated"); /* * This could be changed to allow the user to interrupt. From owner-svn-src-head@freebsd.org Thu Apr 19 20:30:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60975F9F85C; Thu, 19 Apr 2018 20:30:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1642F75A7F; Thu, 19 Apr 2018 20:30:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 113E86B20; Thu, 19 Apr 2018 20:30:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JKUXLI014808; Thu, 19 Apr 2018 20:30:33 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JKUXGD014807; Thu, 19 Apr 2018 20:30:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201804192030.w3JKUXGD014807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 19 Apr 2018 20:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332790 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 332790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 20:30:34 -0000 Author: rmacklem Date: Thu Apr 19 20:30:33 2018 New Revision: 332790 URL: https://svnweb.freebsd.org/changeset/base/332790 Log: Fix OpenDowngrade for NFSv4.1 if a client sets the OPEN_SHARE_ACCESS_WANT* bits. The NFSv4.1 RFC specifies that the OPEN_SHARE_ACCESS_WANT bits can be set in the OpenDowngrade share_access argument and are basically ignored. I do not know of a extant NFSv4.1 client that does this, but this little patch fixes it just in case. It also changes the error from NFSERR_BADXDR to NFSERR_INVAL since the NFSv4.1 RFC specifies this as the error to be returned if bogus bits are set. (The NFSv4.0 RFC didn't specify any error for this, so the error reply can be changed for NFSv4.0 as well.) Found by inspection while looking at a problem with OpenDowngrade reported for the ESXi 6.5 NFSv4.1 client. Reported by: andreas.nagy@frequentis.com PR: 227214 MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Apr 19 20:25:19 2018 (r332789) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Apr 19 20:30:33 2018 (r332790) @@ -3237,6 +3237,8 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus tl += (NFSX_STATEIDOTHER / NFSX_UNSIGNED); stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++); i = fxdr_unsigned(int, *tl++); + if ((nd->nd_flag & ND_NFSV41) != 0) + i &= ~NFSV4OPEN_WANTDELEGMASK; switch (i) { case NFSV4OPEN_ACCESSREAD: stp->ls_flags = (NFSLCK_READACCESS | NFSLCK_DOWNGRADE); @@ -3249,7 +3251,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus NFSLCK_DOWNGRADE); break; default: - nd->nd_repstat = NFSERR_BADXDR; + nd->nd_repstat = NFSERR_INVAL; } i = fxdr_unsigned(int, *tl); switch (i) { @@ -3265,7 +3267,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus stp->ls_flags |= (NFSLCK_READDENY | NFSLCK_WRITEDENY); break; default: - nd->nd_repstat = NFSERR_BADXDR; + nd->nd_repstat = NFSERR_INVAL; } clientid.lval[0] = stp->ls_stateid.other[0]; From owner-svn-src-head@freebsd.org Thu Apr 19 20:31:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBFA0F9FC39; Thu, 19 Apr 2018 20:31:53 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54FF576726; Thu, 19 Apr 2018 20:31:53 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 373716B9B; Thu, 19 Apr 2018 20:31:53 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JKVrZl019042; Thu, 19 Apr 2018 20:31:53 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JKVrXl019041; Thu, 19 Apr 2018 20:31:53 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201804192031.w3JKVrXl019041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Thu, 19 Apr 2018 20:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332791 - head/sys/modules/random X-SVN-Group: head X-SVN-Commit-Author: markm X-SVN-Commit-Paths: head/sys/modules/random X-SVN-Commit-Revision: 332791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 20:31:54 -0000 Author: markm Date: Thu Apr 19 20:31:52 2018 New Revision: 332791 URL: https://svnweb.freebsd.org/changeset/base/332791 Log: Remove empty dir no longer required. Reported by: Jung-uk Kim Deleted: head/sys/modules/random/ From owner-svn-src-head@freebsd.org Thu Apr 19 20:36:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C54A1FA0208; Thu, 19 Apr 2018 20:36:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70D9B78773; Thu, 19 Apr 2018 20:36:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BC646BE2; Thu, 19 Apr 2018 20:36:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JKaGm7019968; Thu, 19 Apr 2018 20:36:16 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JKaFEp019960; Thu, 19 Apr 2018 20:36:15 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804192036.w3JKaFEp019960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 19 Apr 2018 20:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332792 - in head/lib: libc/riscv libc/riscv/gen msun/riscv X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/lib: libc/riscv libc/riscv/gen msun/riscv X-SVN-Commit-Revision: 332792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 20:36:17 -0000 Author: brooks Date: Thu Apr 19 20:36:15 2018 New Revision: 332792 URL: https://svnweb.freebsd.org/changeset/base/332792 Log: Replace SOFTFLOAT with __riscv_float_abi_*. With SOFTFLOAT, libc and libm were built correctly, but any program including fenv.h itself assumed it was on a hardfloat systen and emitted inline fpu instructions for fedisableexcept() and friends. Unlike r315424 which did this for MIPS, I've used riscv_float_abi_soft and riscv_float_abi_double macros as appropriate rather than using __riscv_float_abi_soft exclusively. This ensures that attempts to use an unsupported hardfloat ABI will fail. Reviewed by: br Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10039 Modified: head/lib/libc/riscv/Makefile.inc head/lib/libc/riscv/gen/_setjmp.S head/lib/libc/riscv/gen/fabs.S head/lib/libc/riscv/gen/flt_rounds.c head/lib/libc/riscv/gen/setjmp.S head/lib/msun/riscv/Makefile.inc head/lib/msun/riscv/fenv.c head/lib/msun/riscv/fenv.h Modified: head/lib/libc/riscv/Makefile.inc ============================================================================== --- head/lib/libc/riscv/Makefile.inc Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/libc/riscv/Makefile.inc Thu Apr 19 20:36:15 2018 (r332792) @@ -3,10 +3,6 @@ # Machine dependent definitions for the RISC-V architecture. # -.if ${MACHINE_ARCH:Mriscv*sf} != "" -CFLAGS+=-DSOFTFLOAT -.endif - # Long double is quad precision GDTOASRCS+=strtorQ.c SRCS+=machdep_ldisQ.c Modified: head/lib/libc/riscv/gen/_setjmp.S ============================================================================== --- head/lib/libc/riscv/gen/_setjmp.S Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/libc/riscv/gen/_setjmp.S Thu Apr 19 20:36:15 2018 (r332792) @@ -61,7 +61,7 @@ ENTRY(_setjmp) sd ra, (12 * 8)(a0) addi a0, a0, (13 * 8) -#if !defined(_STANDALONE) && !defined(SOFTFLOAT) +#if !defined(_STANDALONE) && defined(__riscv_float_abi_double) /* Store the fpe registers */ fsd fs0, (0 * 16)(a0) fsd fs1, (1 * 16)(a0) @@ -114,7 +114,7 @@ ENTRY(_longjmp) ld ra, (12 * 8)(a0) addi a0, a0, (13 * 8) -#if !defined(_STANDALONE) && !defined(SOFTFLOAT) +#if !defined(_STANDALONE) && defined(__riscv_float_abi_double) /* Restore the fpe registers */ fld fs0, (0 * 16)(a0) fld fs1, (1 * 16)(a0) Modified: head/lib/libc/riscv/gen/fabs.S ============================================================================== --- head/lib/libc/riscv/gen/fabs.S Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/libc/riscv/gen/fabs.S Thu Apr 19 20:36:15 2018 (r332792) @@ -35,7 +35,7 @@ #include __FBSDID("$FreeBSD$"); -#ifndef SOFTFLOAT +#ifdef __riscv_float_abi_double ENTRY(fabs) fabs.d fa0, fa0 ret Modified: head/lib/libc/riscv/gen/flt_rounds.c ============================================================================== --- head/lib/libc/riscv/gen/flt_rounds.c Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/libc/riscv/gen/flt_rounds.c Thu Apr 19 20:36:15 2018 (r332792) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SOFTFLOAT +#ifdef __riscv_float_abi_soft #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" @@ -51,7 +51,7 @@ __flt_rounds(void) { uint64_t mode; -#ifdef SOFTFLOAT +#ifdef __riscv_float_abi_soft mode = __softfloat_float_rounding_mode; #else __asm __volatile("csrr %0, fcsr" : "=r" (mode)); Modified: head/lib/libc/riscv/gen/setjmp.S ============================================================================== --- head/lib/libc/riscv/gen/setjmp.S Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/libc/riscv/gen/setjmp.S Thu Apr 19 20:36:15 2018 (r332792) @@ -75,7 +75,7 @@ ENTRY(setjmp) sd ra, (12 * 8)(a0) addi a0, a0, (13 * 8) -#ifndef SOFTFLOAT +#ifdef __riscv_float_abi_double /* Store the fpe registers */ fsd fs0, (0 * 16)(a0) fsd fs1, (1 * 16)(a0) @@ -144,7 +144,7 @@ ENTRY(longjmp) ld ra, (12 * 8)(a0) addi a0, a0, (13 * 8) -#ifndef SOFTFLOAT +#ifdef __riscv_float_abi_double /* Restore the fpe registers */ fld fs0, (0 * 16)(a0) fld fs1, (1 * 16)(a0) Modified: head/lib/msun/riscv/Makefile.inc ============================================================================== --- head/lib/msun/riscv/Makefile.inc Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/msun/riscv/Makefile.inc Thu Apr 19 20:36:15 2018 (r332792) @@ -1,8 +1,4 @@ # $FreeBSD$ -.if ${MACHINE_ARCH:Mriscv*sf} != "" -CFLAGS+=-DSOFTFLOAT -.endif - LDBL_PREC = 113 SYM_MAPS += ${.CURDIR}/riscv/Symbol.map Modified: head/lib/msun/riscv/fenv.c ============================================================================== --- head/lib/msun/riscv/fenv.c Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/msun/riscv/fenv.c Thu Apr 19 20:36:15 2018 (r332792) @@ -39,7 +39,7 @@ */ const fenv_t __fe_dfl_env = 0; -#ifdef SOFTFLOAT +#ifdef __riscv_float_abi_soft #define __set_env(env, flags, mask, rnd) env = ((flags) | (rnd) << 5) #define __env_flags(env) ((env) & FE_ALL_EXCEPT) #define __env_mask(env) (0) /* No exception traps. */ Modified: head/lib/msun/riscv/fenv.h ============================================================================== --- head/lib/msun/riscv/fenv.h Thu Apr 19 20:31:52 2018 (r332791) +++ head/lib/msun/riscv/fenv.h Thu Apr 19 20:36:15 2018 (r332792) @@ -73,12 +73,20 @@ __BEGIN_DECLS extern const fenv_t __fe_dfl_env; #define FE_DFL_ENV (&__fe_dfl_env) -#ifndef SOFTFLOAT +#if !defined(__riscv_float_abi_soft) && !defined(__riscv_float_abi_double) +#if defined(__riscv_float_abi_single) +#error single precision floating point ABI not supported +#else +#error compiler did not set soft/hard float macros +#endif +#endif + +#ifndef __riscv_float_abi_soft #define __rfs(__fcsr) __asm __volatile("csrr %0, fcsr" : "=r" (__fcsr)) #define __wfs(__fcsr) __asm __volatile("csrw fcsr, %0" :: "r" (__fcsr)) #endif -#ifdef SOFTFLOAT +#ifdef __riscv_float_abi_soft int feclearexcept(int __excepts); int fegetexceptflag(fexcept_t *__flagp, int __excepts); int fesetexceptflag(const fexcept_t *__flagp, int __excepts); @@ -206,13 +214,13 @@ feupdateenv(const fenv_t *__envp) return (0); } -#endif /* !SOFTFLOAT */ +#endif /* !__riscv_float_abi_soft */ #if __BSD_VISIBLE /* We currently provide no external definitions of the functions below. */ -#ifdef SOFTFLOAT +#ifdef __riscv_float_abi_soft int feenableexcept(int __mask); int fedisableexcept(int __mask); int fegetexcept(void); @@ -243,7 +251,7 @@ fegetexcept(void) return (0); } -#endif /* !SOFTFLOAT */ +#endif /* !__riscv_float_abi_soft */ #endif /* __BSD_VISIBLE */ From owner-svn-src-head@freebsd.org Thu Apr 19 20:50:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5263DFA1370; Thu, 19 Apr 2018 20:50:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA1C07BB30; Thu, 19 Apr 2018 20:50:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x232.google.com with SMTP id c26-v6so8183011iob.3; Thu, 19 Apr 2018 13:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Od2Dxp8OW9CEIDSgPs+z/Je+zESh5m2wSN7fUklZtwM=; b=ds14S+pPlm7SDf00WwXp6O3WvdVlvCpb5bv36g47F8T1NNb32xaJHGwrf6OLjusRxe fyERWygQ+KI2BHfqSUPAph4c7mIZef4fhzUSVqsJ5KAARrMNiAlnnEb/FbeY8wP7JmU8 D5oda0mdkuhxabci4pCS3WcC4E7CNy5bsFXCuqv+fUu7mVTr7wtlzgW3vdJcK9ps4oFT t4HecIemov23zrzPk3eMDdVTQB4t0E3jkBy5fNBeHY+YxzLs5gI0+b/yxpnOjDdzmfLv RgYiDkPF8HJMIwllCQsVNrwOM0/IU7OcviKKR0EHfKCWogGrGkDoeylIjP+X3g9IvLxP +59Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Od2Dxp8OW9CEIDSgPs+z/Je+zESh5m2wSN7fUklZtwM=; b=TNhbFjpiBp3/ZI1RSvpKuPnxYFGDAOwxWw0AlWvcWYKIqOJdDvQ3IVZG32EH2wqCB9 52pUF+d/VsGXJorH3zyZZXdkZVfAq0uhhcp/MgOiz6XIh2FbOaPtVDF3UxXw6s/hQnOi Ys5aq2fnzjhJbDjTRSxNDcpzdX16egTcDdu97LJjhHtnB6cGIcoTKC06zGoCPpulygSL DHJUgMnByfS7N8/Kyli/i6jo9zpf2HN692eOxAVV33QJvDUzRgeZf2VxjcWdngCyJqhv JkCnqyfXfjbUjLKqryiDGiy4DPWW8Ky6EncwVo4usyqvx0S6CM4b2BfiIF8hpE8nE0oP xMmg== X-Gm-Message-State: ALQs6tBaR3GH6msIXRfrmeTtLhqOcs+0H2ta76+gjzM4v/PUidpr1jAI gMuDn1Z/0bbIMkyFuqpBu1RHKX/4d5ugGVpw8lSNOA== X-Google-Smtp-Source: AB8JxZo5aAPYS3DHnPLqdqV8yp/syJa2I4v5/FVLFPO10qTCKDbiNSgi2yWD65t6R93h+DN7QtdbZSCqUqSBxpU4M/M= X-Received: by 2002:a6b:2c9:: with SMTP id 192-v6mr7647889ioc.294.1524171007799; Thu, 19 Apr 2018 13:50:07 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.167 with HTTP; Thu, 19 Apr 2018 13:49:47 -0700 (PDT) In-Reply-To: <20180419164943.GA84360@spindle.one-eyed-alien.net> References: <201804191600.w3JG0Y0w077991@repo.freebsd.org> <20180419164943.GA84360@spindle.one-eyed-alien.net> From: Ed Maste Date: Thu, 19 Apr 2018 16:49:47 -0400 X-Google-Sender-Auth: gLcD3adlFpL5Hm2xA_ErBh4mdPE Message-ID: Subject: Re: svn commit: r332782 - in head/sys: amd64/linux amd64/linux32 compat/freebsd32 i386/linux kern sys To: Brooks Davis Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 20:50:09 -0000 On 19 April 2018 at 12:49, Brooks Davis wrote: > > I do wonder if allocating AT_COUNT entries is quite right since some are > emitted only optionally. That said, it's not as though the waste is > significant. I think it's only a minor concern and not worth worrying about too much, but John and I recently discussed the relationship between sv_copyout_strings and sv_fixup and some more rework in this area could address this too. From owner-svn-src-head@freebsd.org Thu Apr 19 20:58:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8A3BFA1DFE; Thu, 19 Apr 2018 20:58:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 683BE7DA0C; Thu, 19 Apr 2018 20:58:10 +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 633CA6F10; Thu, 19 Apr 2018 20:58:10 +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 w3JKwAHU030359; Thu, 19 Apr 2018 20:58:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JKwAMS030357; Thu, 19 Apr 2018 20:58:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804192058.w3JKwAMS030357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Apr 2018 20:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332794 - in head: share/mk stand/i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: share/mk stand/i386 X-SVN-Commit-Revision: 332794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 20:58:10 -0000 Author: emaste Date: Thu Apr 19 20:58:09 2018 New Revision: 332794 URL: https://svnweb.freebsd.org/changeset/base/332794 Log: Add support for linker-type-specific flags r332090 added a LINKER_TYPE test to add the --no-rosegment flag when linking the i386 loader components with lld. Instead, introduce a general mechanism for setting LDFLAGS for a specific linker type, and use it for --no-rosegment. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14998 Modified: head/share/mk/bsd.sys.mk head/stand/i386/Makefile.inc Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Apr 19 20:47:53 2018 (r332793) +++ head/share/mk/bsd.sys.mk Thu Apr 19 20:58:09 2018 (r332794) @@ -226,6 +226,8 @@ ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} +LDFLAGS+= ${LDFLAGS.${LINKER_TYPE}} + .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs. .if ${.TARGETS:M*install*} == ${.TARGETS} && empty(.MAKE.MODE:Mmeta) Modified: head/stand/i386/Makefile.inc ============================================================================== --- head/stand/i386/Makefile.inc Thu Apr 19 20:47:53 2018 (r332793) +++ head/stand/i386/Makefile.inc Thu Apr 19 20:58:09 2018 (r332794) @@ -2,13 +2,9 @@ # # $FreeBSD$ -.sinclude - LOADER_ADDRESS?=0x200000 LDFLAGS+= -nostdlib -.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld" -LDFLAGS+= -Wl,--no-rosegment -.endif +LDFLAGS.lld+= -Wl,--no-rosegment # BTX components BTXDIR= ${BOOTOBJ}/i386/btx From owner-svn-src-head@freebsd.org Thu Apr 19 21:53:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86EDEFA5FEC; Thu, 19 Apr 2018 21:53:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 390268A24E; Thu, 19 Apr 2018 21:53:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33EFD78EC; Thu, 19 Apr 2018 21:53:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3JLrwpH060202; Thu, 19 Apr 2018 21:53:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JLrvU7060198; Thu, 19 Apr 2018 21:53:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804192153.w3JLrvU7060198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 19 Apr 2018 21:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332796 - head/tools/tools/sortbench X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/tools/tools/sortbench X-SVN-Commit-Revision: 332796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 21:53:58 -0000 Author: brooks Date: Thu Apr 19 21:53:57 2018 New Revision: 332796 URL: https://svnweb.freebsd.org/changeset/base/332796 Log: Add sortbench. This is a set of benchmarks of qsort, mergesort, heapsort, and optionally wikisort and a script to run them. Submitted by: Miles Fertel Sponsored by: Google Summer of Code 2017 Differential Revision: https://reviews.freebsd.org/D12677 Added: head/tools/tools/sortbench/ head/tools/tools/sortbench/Makefile (contents, props changed) head/tools/tools/sortbench/README (contents, props changed) head/tools/tools/sortbench/bench.py (contents, props changed) head/tools/tools/sortbench/sort_bench.c (contents, props changed) Added: head/tools/tools/sortbench/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/sortbench/Makefile Thu Apr 19 21:53:57 2018 (r332796) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +PROG= sort_bench +MAN= + +LIBADD= m + +.ifdef WITH_WIKISORT +CFLAGS= -I${SRCTOP}/lib/libc -DWIKI +.endif + +CLEANDIRS= stats +ELEMENT_BITS= 20 +bench: .PHONY + ${.CURDIR}/bench.py ${ELEMENT_BITS} + @echo "See results in ${.OBJDIR}/stats" + +.include Added: head/tools/tools/sortbench/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/sortbench/README Thu Apr 19 21:53:57 2018 (r332796) @@ -0,0 +1,17 @@ +$FreeBSD$ + +Running: +1. Compile mergesort_bench.c into mergesort_bench +2. Run bench.py with python bench.py [elts] +2a. Bench will optionally run 2 ^ elts elements as the dataset size when provided. Otherwise it will run 2 ^ 20 elements. + +Output: +Files will be output in a new folder called stats with separate files for each statistical comparison and the raw results in a subfolder called data. +This files will contain the results of the running of ministat with time required to sort as the dataset. + +Modifications: +Change bench.py's WIKI variable to be true if you have wiki.c implemented and want to test it. + +As the script runs, it is running each of the stdlib sorting algorithms (and wikisort if provided) with 2 ^ elts elements, +5 trials of the sort time as it's output. That output is saved in the data folder and then passed into the command line +utility ministat which then provides the confidence interval of difference between the data in stats folder. Added: head/tools/tools/sortbench/bench.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/sortbench/bench.py Thu Apr 19 21:53:57 2018 (r332796) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +""" +Copyright (c) 2017 Miles Fertel +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + $FreeBSD$ +""" + +from time import time +import os +import sys + +WIKI = False +sorts=["heap", "merge", "quick"] +if (WIKI): + sorts.append("wiki") +tests=["rand", "sort", "rev", "part"] +runs = 5 +trials = 5 +outdir = "stats" +datadir = '{}/data'.format(outdir) +progname = "sort_bench" +try: + elts = sys.argv[1] +except: + elts = 20 + +if (not os.path.isdir(datadir)): + os.makedirs(datadir) + +for test in tests: + files = [] + for sort in sorts: + filename = '{}/{}{}'.format(datadir, test, sort) + files.append(filename) + with open(filename, 'w+') as f: + for _ in range(trials): + start = time() + ret = os.system('./{} {} {} {} {}'.format(progname, sort, test, runs, elts)) + total = time() - start + if (ret): + sys.exit("Bench program failed. Did you remember to compile it?") + f.write('{}\n'.format(str(total))) + f.close() + with open('{}/{}'.format(outdir, test), 'w+') as f: + command = 'ministat -s -w 60 ' + for filename in files: + command += '{} '.format(filename) + command += '> {}/{}stats'.format(outdir, test) + os.system(command) + Added: head/tools/tools/sortbench/sort_bench.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/sortbench/sort_bench.c Thu Apr 19 21:53:57 2018 (r332796) @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2017 Miles Fertel + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#ifdef WIKI +#include "stdlib/wiki.c" +#endif + +/* + * Integer comparison function for stdlib sorting algorithms + */ +static int +sorthelp(const void *a, const void *b) +{ + if (*(int *)a > *(int *)b) + return 1; + if (*(int *)a < *(int *)b) + return -1; + return 0; +} + +#define NARGS 5 + +/* + * Enumerated types for the different types of tests and sorting algorithms + */ +enum test { RAND, SORT, PART, REV, INVALID_TEST }; + +#ifdef WIKI +enum sort { MERGE, WIKI, QUICK, HEAP, INVALID_ALG }; +#else +enum sort { MERGE, QUICK, HEAP, INVALID_ALG }; +#endif + +/* + * Sort an array with the given algorithm + */ +static void +sort(int *testarray, int elts, enum sort s) +{ + switch (s) { + case MERGE: + mergesort(testarray, (size_t)elts, sizeof(int), sorthelp); + break; +#ifdef WIKI + case WIKI: + WikiSort(testarray, (size_t)elts, sizeof(int), sorthelp); + break; +#endif + case QUICK: + qsort(testarray, (size_t)elts, sizeof(int), sorthelp); + break; + case HEAP: + heapsort(testarray, (size_t)elts, sizeof(int), sorthelp); + break; + // Should never be reached + case INVALID_ALG: + exit(EX_DATAERR); + } +} + +/* + * Sort an array of randomly generated integers + */ +static void +rand_bench(int elts, enum sort s) +{ + size_t size = sizeof(int) * elts; + int *array = malloc(size); + arc4random_buf(array, size); + sort(array, elts, s); + free(array); +} + +/* + * Sort an array of increasing integers + */ +static void +sort_bench(int elts, enum sort s) +{ + size_t size = sizeof(int) * elts; + int *array = malloc(size); + for (int i = 0; i < elts; i++) { + array[i] = i; + } + sort(array, elts, s); + free(array); +} + +/* + * Sort an array of partially increasing, partially random integers + */ +static void +partial_bench(int elts, enum sort s) +{ + size_t size = sizeof(int) * elts; + int *array = malloc(size); + for (int i = 0; i < elts; i++) { + if (i <= elts / 2) + array[i] = i; + else + array[i] = arc4random(); + } + sort(array, elts, s); + free(array); +} + +/* + * Sort an array of decreasing integers + */ +static void +reverse_bench(int elts, enum sort s) +{ + size_t size = sizeof(int) * elts; + int *array = malloc(size); + for (int i = 0; i < elts; i++) { + array[i] = elts - i; + } + sort(array, elts, s); + free(array); +} + +static void +run_bench(enum sort s, enum test t, int runs, int elts) +{ + for (int i = 0; i < runs; i++) { + switch (t) { + case RAND: + rand_bench(elts, s); + break; + case SORT: + sort_bench(elts, s); + break; + case PART: + partial_bench(elts, s); + break; + case REV: + reverse_bench(elts, s); + break; + // Should never be reached + case INVALID_TEST: + exit(EX_DATAERR); + } + } +} + +static enum sort +parse_alg(char *alg) +{ + if (strcmp(alg, "merge") == 0) + return MERGE; +#ifdef WIKI + else if (strcmp(alg, "wiki") == 0) + return WIKI; +#endif + else if (strcmp(alg, "quick") == 0) + return QUICK; + else if (strcmp(alg, "heap") == 0) + return HEAP; + else + return INVALID_ALG; +} + +static enum test +parse_test(char *test) +{ + if (strcmp(test, "rand") == 0) + return RAND; + else if (strcmp(test, "sort") == 0) + return SORT; + else if (strcmp(test, "part") == 0) + return PART; + else if (strcmp(test, "rev") == 0) + return REV; + else + return INVALID_TEST; +} + +static void +usage(const char *progname) +{ + printf("Usage:\n"); + printf("\t%s: [alg] [test] [runs] [elt_power]\n", progname); + printf("\n"); + printf("Valid algs:\n"); +#ifdef WIKI + printf("\theap merge quick wiki\n"); +#else + printf("\theap merge quick\n"); +#endif + printf("Valid tests:\n"); + printf("\trand sort part rev\n"); + printf("\trand: Random element array \n"); + printf("\tsort: Increasing order array \n"); + printf("\tpart: Partially ordered array\n"); + printf("\trev: Decreasing order array\n"); + printf("Run the algorithm [runs] times with 2^[elt_power] elements\n"); + exit(EX_USAGE); +} + +/* + * Runs a sorting algorithm with a provided data configuration according to + * command line arguments + */ +int +main(int argc, char *argv[]) +{ + const char *progname = argv[0]; + int runs, elts; + if (argc != NARGS) + usage(progname); + + enum sort s = parse_alg(argv[1]); + if (s == INVALID_ALG) + usage(progname); + + enum test t = parse_test(argv[2]); + if (t == INVALID_TEST) + usage(progname); + + runs = atoi(argv[3]); + elts = pow(2, atoi(argv[4])); + + run_bench(s, t, runs, elts); +} From owner-svn-src-head@freebsd.org Thu Apr 19 22:43:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A211FA8E97; Thu, 19 Apr 2018 22:43:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D776DA47; Thu, 19 Apr 2018 22:43: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 41A98100E2; Thu, 19 Apr 2018 22:43: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 w3JMhuSB084667; Thu, 19 Apr 2018 22:43:56 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3JMht2S084664; Thu, 19 Apr 2018 22:43:55 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804192243.w3JMht2S084664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 19 Apr 2018 22:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332798 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 332798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 22:43:57 -0000 Author: mckusick Date: Thu Apr 19 22:43:55 2018 New Revision: 332798 URL: https://svnweb.freebsd.org/changeset/base/332798 Log: Fix incorrect output for a file consisting of a single full-size block followed by a discontiguous fragment. Add checks for unallocated inodes and inodes with unknown mode types. Cleanup variable declarations by changing from type `int' to types like ufs_lbn_t, ufs2_daddr_t, etc. Reported by: bde Modified: head/tools/diag/prtblknos/Makefile head/tools/diag/prtblknos/main.c head/tools/diag/prtblknos/prtblknos.c Modified: head/tools/diag/prtblknos/Makefile ============================================================================== --- head/tools/diag/prtblknos/Makefile Thu Apr 19 22:28:41 2018 (r332797) +++ head/tools/diag/prtblknos/Makefile Thu Apr 19 22:43:55 2018 (r332798) @@ -9,6 +9,8 @@ SRCS= main.c prtblknos.c LIBADD+=ufs +WARNS?= 3 + test: ${PROG} ./${PROG} > a Modified: head/tools/diag/prtblknos/main.c ============================================================================== --- head/tools/diag/prtblknos/main.c Thu Apr 19 22:28:41 2018 (r332797) +++ head/tools/diag/prtblknos/main.c Thu Apr 19 22:43:55 2018 (r332798) @@ -53,14 +53,17 @@ main(argc, argv) struct statfs sfb; char *xargv[4]; char ibuf[64]; - char *fsname; - int inonum, error; + char *fsname, *filename; + ino_t inonum; + int error; + filename = NULL; if (argc == 2) { - if (stat(argv[1], &sb) != 0) - err(1, "stat(%s)", argv[1]); - if (statfs(argv[1], &sfb) != 0) - err(1, "statfs(%s)", argv[1]); + filename = argv[1]; + if (lstat(filename, &sb) != 0) + err(1, "stat(%s)", filename); + if (statfs(filename, &sfb) != 0) + err(1, "statfs(%s)", filename); xargv[0] = argv[0]; xargv[1] = sfb.f_mntfromname; sprintf(ibuf, "%jd", (intmax_t)sb.st_ino); @@ -87,12 +90,17 @@ main(argc, argv) while (*++argv) { /* get the inode number. */ if ((inonum = atoi(*argv)) <= 0 || - inonum >= fs->fs_ipg * fs->fs_ncg) + inonum >= (ino_t)fs->fs_ipg * fs->fs_ncg) warnx("%s is not a valid inode number", *argv); - (void)printf("%d: ", inonum); + if (filename == NULL) + (void)printf("inode #%jd: ", (intmax_t)inonum); + else + (void)printf("%s (inode #%jd): ", filename, + (intmax_t)inonum); if ((error = getino(&disk, (void **)&dp, inonum, NULL)) < 0) - warn("Read of inode %d on %s failed", inonum, fsname); + warn("Read of inode %jd on %s failed", + (intmax_t)inonum, fsname); prtblknos(&disk, dp); } Modified: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- head/tools/diag/prtblknos/prtblknos.c Thu Apr 19 22:28:41 2018 (r332797) +++ head/tools/diag/prtblknos/prtblknos.c Thu Apr 19 22:43:55 2018 (r332798) @@ -40,16 +40,18 @@ union dinode { void prtblknos(struct uufsd *disk, union dinode *dp); -static void indirprt(struct uufsd *, int, int, int, ufs2_daddr_t, int); -static char *distance(struct fs *, daddr_t, daddr_t); -static void printblk(struct fs *, int, ufs2_daddr_t, int, int); +static const char *distance(struct fs *, ufs2_daddr_t, ufs2_daddr_t); +static void printblk(struct fs *, ufs_lbn_t, ufs2_daddr_t, int, ufs_lbn_t); +static void indirprt(struct uufsd *, int, ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, + ufs_lbn_t); void prtblknos(disk, dp) struct uufsd *disk; union dinode *dp; { - int i, len, lbn, mode, frags, numblks, blksperindir; + int i, mode, frags; + ufs_lbn_t lbn, lastlbn, len, blksperindir; ufs2_daddr_t blkno; struct fs *fs; off_t size; @@ -63,6 +65,12 @@ prtblknos(disk, dp) mode = dp->dp2.di_mode; } switch (mode & IFMT) { + default: + printf("unknown inode type 0%d\n", (mode & IFMT)); + return; + case 0: + printf("unallocated inode\n"); + return; case IFIFO: printf("fifo\n"); return; @@ -97,20 +105,20 @@ prtblknos(disk, dp) printf("empty file\n"); return; } - printf("regular file, size %ld\n", size); + printf("regular file, size %jd\n", (intmax_t)size); break; case IFDIR: if (size == 0) { printf("empty directory\n"); return; } - printf("directory, size %ld\n", size); + printf("directory, size %jd\n", (intmax_t)size); break; } - numblks = howmany(size, fs->fs_bsize); - len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; + lastlbn = howmany(size, fs->fs_bsize); + len = lastlbn < UFS_NDADDR ? lastlbn : UFS_NDADDR; for (i = 0; i < len; i++) { - if (i < numblks - 1) + if (i < lastlbn - 1) frags = fs->fs_frag; else frags = howmany(size % fs->fs_bsize, @@ -119,39 +127,39 @@ prtblknos(disk, dp) blkno = dp->dp1.di_db[i]; else blkno = dp->dp2.di_db[i]; - printblk(fs, i, blkno, frags, numblks); + printblk(fs, i, blkno, frags, lastlbn); } blksperindir = 1; - len = numblks - UFS_NDADDR; + len = lastlbn - UFS_NDADDR; lbn = UFS_NDADDR; for (i = 0; len > 0 && i < UFS_NIADDR; i++) { if (fs->fs_magic == FS_UFS1_MAGIC) blkno = dp->dp1.di_ib[i]; else blkno = dp->dp2.di_ib[i]; - indirprt(disk, i, blksperindir, lbn, blkno, numblks); + indirprt(disk, i, blksperindir, lbn, blkno, lastlbn); blksperindir *= NINDIR(fs); lbn += blksperindir; len -= blksperindir; } /* dummy print to flush out last extent */ - printblk(fs, numblks, 0, frags, 0); + printblk(fs, lastlbn, 0, frags, 0); } static void indirprt(disk, level, blksperindir, lbn, blkno, lastlbn) struct uufsd *disk; int level; - int blksperindir; - int lbn; + ufs_lbn_t blksperindir; + ufs_lbn_t lbn; ufs2_daddr_t blkno; - int lastlbn; + ufs_lbn_t lastlbn; { char indir[MAXBSIZE]; struct fs *fs; - int i, last; + ufs_lbn_t i, last; fs = (struct fs *)&disk->d_sb; if (blkno == 0) { @@ -190,13 +198,13 @@ indirprt(disk, level, blksperindir, lbn, blkno, lastlb } } -static char * +static const char * distance(fs, lastblk, firstblk) struct fs *fs; - daddr_t lastblk; - daddr_t firstblk; + ufs2_daddr_t lastblk; + ufs2_daddr_t firstblk; { - daddr_t delta; + ufs2_daddr_t delta; int firstcg, lastcg; static char buf[100]; @@ -216,28 +224,30 @@ distance(fs, lastblk, firstblk) } -static char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; +static const char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; static void -printblk(fs, lbn, blkno, numblks, lastlbn) +printblk(fs, lbn, blkno, numfrags, lastlbn) struct fs *fs; - int lbn; + ufs_lbn_t lbn; ufs2_daddr_t blkno; - int numblks; - int lastlbn; + int numfrags; + ufs_lbn_t lastlbn; { static int seq; - static daddr_t lastindirblk, lastblk, firstblk; + static ufs2_daddr_t totfrags, lastindirblk, lastblk, firstblk; if (lastlbn <= 0) goto flush; if (seq == 0) { - seq = howmany(numblks, fs->fs_frag); + seq = howmany(numfrags, fs->fs_frag); + totfrags = numfrags; firstblk = blkno; return; } if (lbn == 0) { - seq = howmany(numblks, fs->fs_frag); + seq = howmany(numfrags, fs->fs_frag); + totfrags = numfrags; lastblk = 0; firstblk = blkno; lastindirblk = 0; @@ -247,7 +257,8 @@ printblk(fs, lbn, blkno, numblks, lastlbn) (firstblk == BLK_NOCOPY && blkno == BLK_NOCOPY) || (firstblk == BLK_SNAP && blkno == BLK_SNAP) || blkno == firstblk + seq * fs->fs_frag)) { - seq += howmany(numblks, fs->fs_frag); + seq += howmany(numfrags, fs->fs_frag); + totfrags += numfrags; return; } flush: @@ -255,35 +266,36 @@ flush: goto prtindir; if (firstblk <= BLK_SNAP) { if (seq == 1) - printf("\tlbn %d %s\n", lbn - seq, + printf("\tlbn %jd %s\n", (intmax_t)(lbn - seq), firstblk == 0 ? "hole" : firstblk == BLK_NOCOPY ? "nocopy" : "snapblk"); else - printf("\tlbn %d-%d %s\n", - lbn - seq, lbn - 1, + printf("\tlbn %jd-%jd %s\n", + (intmax_t)lbn - seq, (intmax_t)lbn - 1, firstblk == 0 ? "hole" : firstblk == BLK_NOCOPY ? "nocopy" : "snapblk"); } else if (seq == 1) { - if (numblks == 1) - printf("\tlbn %d blkno %jd%s\n", lbn - seq, + if (totfrags == 1) + printf("\tlbn %jd blkno %jd%s\n", (intmax_t)(lbn - seq), (intmax_t)firstblk, distance(fs, lastblk, firstblk)); else - printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, - (intmax_t)firstblk, - (intmax_t)(firstblk + numblks - 1), + printf("\tlbn %jd blkno %jd-%jd%s\n", + (intmax_t)(lbn - seq), (intmax_t)firstblk, + (intmax_t)(firstblk + totfrags - 1), distance(fs, lastblk, firstblk)); - lastblk = firstblk + numblks - 1; + lastblk = firstblk + totfrags - 1; } else { - printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, - (intmax_t)firstblk, (intmax_t)(firstblk + - (seq - 1) * fs->fs_frag + numblks - 1), + printf("\tlbn %jd-%jd blkno %jd-%jd%s\n", (intmax_t)(lbn - seq), + (intmax_t)(lbn - 1), (intmax_t)firstblk, + (intmax_t)(firstblk + totfrags - 1), distance(fs, lastblk, firstblk)); - lastblk = firstblk + (seq - 1) * fs->fs_frag + numblks - 1; + lastblk = firstblk + totfrags - 1; } if (lastlbn > 0 || blkno == 0) { seq = 1; + totfrags = numfrags; firstblk = blkno; return; } @@ -291,9 +303,9 @@ prtindir: if (seq != 0 && (fs->fs_metaspace == 0 || lastindirblk == 0)) lastindirblk = lastblk; printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], - (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), + (intmax_t)blkno, (intmax_t)(blkno + numfrags - 1), distance(fs, lastindirblk, blkno)); - lastindirblk = blkno + numblks - 1; + lastindirblk = blkno + numfrags - 1; if (fs->fs_metaspace == 0) lastblk = lastindirblk; seq = 0; From owner-svn-src-head@freebsd.org Thu Apr 19 23:35:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7381F844FD; Thu, 19 Apr 2018 23:35:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F81479A61; Thu, 19 Apr 2018 23:35:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f46.google.com with SMTP id u62-v6so436139ita.5; Thu, 19 Apr 2018 16:35:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Uw+kyuTp/5RJjuLCIossdRMIVYx/I/gu2rcMIbsw4T8=; b=aGfN4hjh/TBAp6WV2fcYN0pk9+l9jg00KzMUcSHshKYnGa6787pa/mxhBw8xM6z0bj 4OwdAwnqc1Yr1wgiMNR4OWxdVErTxm4vRHiuDs+fmmd/c0t1CCM2fHta6vMIPrME2kdt LSQniFbxiqpSNhEy0UenkV4LRxGugp7/Hden1SXkcPXVbTvdupP4S4tgtKjHkUDjy3qM 3EQDzxrZJsTbWHRacbudNxwvmlHqcrOXfOB5KAjA3r1sd6OZWXWVKihzkSYZ//HzZ8hj 0N/BBjwsduxMldn+w4LvwDT9rnIJ3gQ9okzSbq4LtLbcGmQ6AKG2e2YxqjFgqp53PGp/ V9NA== X-Gm-Message-State: ALQs6tDOBhicqO8XYoDdEv4cr09WWT5cBd7qu/LpsxBxiuCqCLyCmGLd ijrOW0za2kyQD0cFg7jbATWGlAjO X-Google-Smtp-Source: AIpwx4/VkOufrQRAMrlLVC/pc/2Nzum5VzQcw5Kx6S1/bX3ineSw7CC9P3pEqthQgR0r2RPa9usjQw== X-Received: by 2002:a24:b210:: with SMTP id u16-v6mr814663ite.15.1524180528656; Thu, 19 Apr 2018 16:28:48 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id 194-v6sm148917itm.15.2018.04.19.16.28.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 16:28:48 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id h143-v6so454740ita.4; Thu, 19 Apr 2018 16:28:48 -0700 (PDT) X-Received: by 2002:a24:2f8d:: with SMTP id j135-v6mr807654itj.53.1524180528240; Thu, 19 Apr 2018 16:28:48 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Thu, 19 Apr 2018 16:28:47 -0700 (PDT) In-Reply-To: <201804192153.w3JLrvU7060198@repo.freebsd.org> References: <201804192153.w3JLrvU7060198@repo.freebsd.org> From: Conrad Meyer Date: Thu, 19 Apr 2018 16:28:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332796 - head/tools/tools/sortbench To: Brooks Davis Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 23:35:44 -0000 The commit log describes what the commit does, but not why it was made. What's the eventual goal / direction that this change leads to? (The Phabricator revision doesn't elaborate further either.) Thanks, Conrad On Thu, Apr 19, 2018 at 2:53 PM, Brooks Davis wrote: > Author: brooks > Date: Thu Apr 19 21:53:57 2018 > New Revision: 332796 > URL: https://svnweb.freebsd.org/changeset/base/332796 > > Log: > Add sortbench. > > This is a set of benchmarks of qsort, mergesort, heapsort, and > optionally wikisort and a script to run them. From owner-svn-src-head@freebsd.org Thu Apr 19 23:47:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADE3AF8531B; Thu, 19 Apr 2018 23:47:36 +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 58BBB7CF59; Thu, 19 Apr 2018 23:47:36 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 2F4075A9F12; Thu, 19 Apr 2018 23:47:35 +0000 (UTC) Date: Thu, 19 Apr 2018 23:47:35 +0000 From: Brooks Davis To: Conrad Meyer Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332796 - head/tools/tools/sortbench Message-ID: <20180419234735.GA1188@spindle.one-eyed-alien.net> References: <201804192153.w3JLrvU7060198@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 23:47:36 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The goal is to replace our merge sort with its weird limitations (you can't sort things smaller than int on amd64 and it doesn't work with pointer integrity schemes) with wikisort. This and improvements to the tests are the first steps in the process. -- Brooks On Thu, Apr 19, 2018 at 04:28:47PM -0700, Conrad Meyer wrote: > The commit log describes what the commit does, but not why it was > made. What's the eventual goal / direction that this change leads to? >=20 > (The Phabricator revision doesn't elaborate further either.) >=20 > Thanks, > Conrad >=20 > On Thu, Apr 19, 2018 at 2:53 PM, Brooks Davis wrote: > > Author: brooks > > Date: Thu Apr 19 21:53:57 2018 > > New Revision: 332796 > > URL: https://svnweb.freebsd.org/changeset/base/332796 > > > > Log: > > Add sortbench. > > > > This is a set of benchmarks of qsort, mergesort, heapsort, and > > optionally wikisort and a script to run them. >=20 --wac7ysb48OaltWcw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa2SqWAAoJEKzQXbSebgfAdr4H/RSBBYjObi2DZ5YD8Dp17mTx +r/QRDVVjD8hzaoSo7oJmKcPI0qvpnfXKz878GXrpRdAs/ZuSr01XVFTdawVgF+h Py9CPZqgADxQxjeAOxjOc+2vV5iyk9cpRXOqxDffIQjRZ3aH9iLj6qaKIeE+iapO hW4j08AZ1sEvbQxDGAHy/d4BVX+QnuLUJiWy7mdpSuzGTxA4Fk22H4+NVjgscIq9 UeNT7OcVNzRC4O4fgO00qN7aI2nDrXc4QGzQrnepo8xOqLE9+i4F0VrmMmtLKzz0 fArU7f8+pkoR9VlcX66r58O5aSBwLQILF83XlANu8ZvFnUphlTpUJpMMq6oVs3I= =t5pZ -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- From owner-svn-src-head@freebsd.org Thu Apr 19 23:53:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFDB0F85B99; Thu, 19 Apr 2018 23:53:05 +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 5821C7D527; Thu, 19 Apr 2018 23:53:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w3JNr3ZF068073; Thu, 19 Apr 2018 16:53:03 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3JNr3Ug068072; Thu, 19 Apr 2018 16:53:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804192353.w3JNr3Ug068072@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332796 - head/tools/tools/sortbench In-Reply-To: <20180419234735.GA1188@spindle.one-eyed-alien.net> To: Brooks Davis Date: Thu, 19 Apr 2018 16:53:03 -0700 (PDT) CC: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 23:53:06 -0000 -- Start of PGP signed section. > The goal is to replace our merge sort with its weird limitations (you > can't sort things smaller than int on amd64 and it doesn't work with > pointer integrity schemes) with wikisort. This and improvements to the > tests are the first steps in the process. > > -- Brooks Couldnt this be a port, as most other benchmarks? Especially since it requires python to run. > > On Thu, Apr 19, 2018 at 04:28:47PM -0700, Conrad Meyer wrote: > > The commit log describes what the commit does, but not why it was > > made. What's the eventual goal / direction that this change leads to? > > > > (The Phabricator revision doesn't elaborate further either.) > > > > Thanks, > > Conrad > > > > On Thu, Apr 19, 2018 at 2:53 PM, Brooks Davis wrote: > > > Author: brooks > > > Date: Thu Apr 19 21:53:57 2018 > > > New Revision: 332796 > > > URL: https://svnweb.freebsd.org/changeset/base/332796 > > > > > > Log: > > > Add sortbench. > > > > > > This is a set of benchmarks of qsort, mergesort, heapsort, and > > > optionally wikisort and a script to run them. > > -- End of PGP section, PGP failed! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Apr 20 00:01:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FF3FF86A45; Fri, 20 Apr 2018 00:01:46 +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 EC99D8037F; Fri, 20 Apr 2018 00:01:45 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 4BD2E5A9F12; Fri, 20 Apr 2018 00:01:45 +0000 (UTC) Date: Fri, 20 Apr 2018 00:01:45 +0000 From: Brooks Davis To: rgrimes@freebsd.org Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332796 - head/tools/tools/sortbench Message-ID: <20180420000145.GB1188@spindle.one-eyed-alien.net> References: <20180419234735.GA1188@spindle.one-eyed-alien.net> <201804192353.w3JNr3Ug068072@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: <201804192353.w3JNr3Ug068072@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.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 00:01:46 -0000 --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 19, 2018 at 04:53:03PM -0700, Rodney W. Grimes wrote: > -- Start of PGP signed section. > > The goal is to replace our merge sort with its weird limitations (you > > can't sort things smaller than int on amd64 and it doesn't work with > > pointer integrity schemes) with wikisort. This and improvements to the > > tests are the first steps in the process. >=20 > Couldnt this be a port, as most other benchmarks? > Especially since it requires python to run. I suppose it could, but it's intended to support and measure our base system. It's tiny, and the python orchestration is optional. If people really dislike the idea, we'll just put it on github. -- Brooks --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJa2S3oAAoJEKzQXbSebgfAs9sH/180z/OMq1BG3zK+Y8hZzDjD /a8f0GUPAVpjHzLQd4mJnNgk09Ddp4WFFoZGZSxEndpyh8/iPMy8FueoeyH3sGj6 nJNNXK1jQWq0BovpiK4Y5uN8fsfqyZ4QlcxsLKFp8ZiT//Y0UA1qy56jbWf67MCA tJuqIeR7Hc01F96RuXDiNn9ITUJkX2ycnnuy2Bcf8Gd8LR/qTq6DUlbXOnkdVq8C 0ViGC0P+Z/ekMkCB6BCVEzkKnNQLRtaWe8vKqEG05u89aylbiGimFZNcx2DpoQYh bGJ5u2m5EgWpZjOKhUVZb7rNl772/5OtJ3L7DARibhaoARvazJHhe9po3E8TS5I= =AvHk -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o-- From owner-svn-src-head@freebsd.org Fri Apr 20 00:59:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB74F8D43E; Fri, 20 Apr 2018 00:59:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29DF86C3AF; Fri, 20 Apr 2018 00:59: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 24D6011621; Fri, 20 Apr 2018 00:59: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 w3K0xsPl049446; Fri, 20 Apr 2018 00:59:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K0xsLA049445; Fri, 20 Apr 2018 00:59:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804200059.w3K0xsLA049445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Apr 2018 00:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332803 - head/lib/clang/include/lld/Common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/clang/include/lld/Common X-SVN-Commit-Revision: 332803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 00:59:54 -0000 Author: emaste Date: Fri Apr 20 00:59:53 2018 New Revision: 332803 URL: https://svnweb.freebsd.org/changeset/base/332803 Log: lld: use correct number of digits in __FreeBSD_version-style ID __FreeBSD_version-style IDs should have 5 digits following the major. Modified: head/lib/clang/include/lld/Common/Version.inc Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Fri Apr 20 00:02:47 2018 (r332802) +++ head/lib/clang/include/lld/Common/Version.inc Fri Apr 20 00:59:53 2018 (r332803) @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "326565-120001" +#define LLD_REVISION_STRING "326565-1200001" From owner-svn-src-head@freebsd.org Fri Apr 20 03:08:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04711F9825A; Fri, 20 Apr 2018 03:08:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABF23856D8; Fri, 20 Apr 2018 03:08:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CA5B12B54; Fri, 20 Apr 2018 03:08:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3K38khe014774; Fri, 20 Apr 2018 03:08:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K38kih014773; Fri, 20 Apr 2018 03:08:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804200308.w3K38kih014773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Apr 2018 03:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332805 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 03:08:47 -0000 Author: kevans Date: Fri Apr 20 03:08:46 2018 New Revision: 332805 URL: https://svnweb.freebsd.org/changeset/base/332805 Log: bsdgrep: Split match processing out of procfile procfile is getting kind of hairy, and it's not going to get better as we correct some more bits that assume we process one line at a time. Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Apr 20 01:25:48 2018 (r332804) +++ head/usr.bin/grep/util.c Fri Apr 20 03:08:46 2018 (r332805) @@ -72,6 +72,18 @@ struct parsec { bool binary; /* Binary file? */ }; +/* + * Match printing context + */ +struct mprintc { + long long tail; /* Number of trailing lines to record */ + int last_outed; /* Number of lines since last output */ + bool doctx; /* Printing context? */ + bool printmatch; /* Printing matches? */ + bool same_file; /* Same file as previously printed? */ +}; + +static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched); #ifdef WITH_INTERNAL_NOSPEC static int litexec(const struct pat *pat, const char *string, size_t nmatch, regmatch_t pmatch[]); @@ -197,6 +209,71 @@ grep_tree(char **argv) } /* + * Process any matches in the current parsing context, return a boolean + * indicating whether we should halt any further processing or not. 'true' to + * continue processing, 'false' to halt. + */ +static bool +procmatches(struct mprintc *mc, struct parsec *pc, bool matched) +{ + + /* Deal with any -B context or context separators */ + if (matched && mc->doctx) { + if (!first_match && (!mc->same_file || mc->last_outed > 0)) + printf("--\n"); + if (Bflag > 0) + printqueue(); + mc->tail = Aflag; + } + + /* Print the matching line, but only if not quiet/binary */ + if (matched && mc->printmatch) { + printline(pc, ':'); + while (pc->matchidx >= MAX_MATCHES) { + /* Reset matchidx and try again */ + pc->matchidx = 0; + if (procline(pc) == 0) + printline(pc, ':'); + else + break; + } + first_match = false; + mc->same_file = true; + mc->last_outed = 0; + } + + if (!matched && mc->doctx) { + /* Deal with any -A context */ + if (mc->tail > 0) { + grep_printline(&pc->ln, '-'); + mc->tail--; + if (Bflag > 0) + clearqueue(); + } else { + /* + * Enqueue non-matching lines for -B context. + * If we're not actually doing -B context or if + * the enqueue resulted in a line being rotated + * out, then go ahead and increment last_outed + * to signify a gap between context/match. + */ + if (Bflag == 0 || (Bflag > 0 && enqueue(&pc->ln))) + ++mc->last_outed; + } + } + + /* Count the matches if we have a match limit */ + if (matched && mflag) { + /* XXX TODO: Decrement by number of matched lines */ + mcount -= 1; + if (mflag && mcount <= 0) + return (false); + } + + return (true); +} + +/* * Opens a file and processes it. Each file is processed line-by-line * passing the lines to procline(). */ @@ -204,13 +281,11 @@ int procfile(const char *fn) { struct parsec pc; - long long tail; + struct mprintc mc; struct file *f; struct stat sb; - struct str *ln; mode_t s; - int c, last_outed, t; - bool doctx, printmatch, same_file; + int c, t; if (strcmp(fn, "-") == 0) { fn = label != NULL ? label : getstr(1); @@ -234,8 +309,6 @@ procfile(const char *fn) return (0); } - /* Convenience */ - ln = &pc.ln; pc.ln.file = grep_malloc(strlen(fn) + 1); strcpy(pc.ln.file, fn); pc.ln.line_no = 0; @@ -243,17 +316,13 @@ procfile(const char *fn) pc.ln.boff = 0; pc.ln.off = -1; pc.binary = f->binary; - pc.printed = 0; - tail = 0; - last_outed = 0; - same_file = false; - doctx = false; - printmatch = true; + memset(&mc, 0, sizeof(mc)); + mc.printmatch = true; if ((pc.binary && binbehave == BINFILE_BIN) || cflag || qflag || lflag || Lflag) - printmatch = false; - if (printmatch && (Aflag != 0 || Bflag != 0)) - doctx = true; + mc.printmatch = false; + if (mc.printmatch && (Aflag != 0 || Bflag != 0)) + mc.doctx = true; mcount = mlimit; for (c = 0; c == 0 || !(lflag || qflag); ) { @@ -282,56 +351,9 @@ procfile(const char *fn) if ((t = procline(&pc)) == 0) ++c; - /* Deal with any -B context or context separators */ - if (t == 0 && doctx) { - if (!first_match && (!same_file || last_outed > 0)) - printf("--\n"); - if (Bflag > 0) - printqueue(); - tail = Aflag; - } - /* Print the matching line, but only if not quiet/binary */ - if (t == 0 && printmatch) { - printline(&pc, ':'); - while (pc.matchidx >= MAX_MATCHES) { - /* Reset matchidx and try again */ - pc.matchidx = 0; - if (procline(&pc) == 0) - printline(&pc, ':'); - else - break; - } - first_match = false; - same_file = true; - last_outed = 0; - } - if (t != 0 && doctx) { - /* Deal with any -A context */ - if (tail > 0) { - grep_printline(&pc.ln, '-'); - tail--; - if (Bflag > 0) - clearqueue(); - } else { - /* - * Enqueue non-matching lines for -B context. - * If we're not actually doing -B context or if - * the enqueue resulted in a line being rotated - * out, then go ahead and increment last_outed - * to signify a gap between context/match. - */ - if (Bflag == 0 || (Bflag > 0 && enqueue(ln))) - ++last_outed; - } - } - - /* Count the matches if we have a match limit */ - if (t == 0 && mflag) { - --mcount; - if (mflag && mcount <= 0) - break; - } - + /* Halt processing if we hit our match limit */ + if (!procmatches(&mc, &pc, t == 0)) + break; } if (Bflag > 0) clearqueue(); From owner-svn-src-head@freebsd.org Fri Apr 20 03:11:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A51DF9870B; Fri, 20 Apr 2018 03:11:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE728629F; Fri, 20 Apr 2018 03:11:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7D2C12CB3; Fri, 20 Apr 2018 03:11:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3K3Bpe3019299; Fri, 20 Apr 2018 03:11:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K3BpXm019298; Fri, 20 Apr 2018 03:11:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804200311.w3K3BpXm019298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Apr 2018 03:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332806 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 03:11:52 -0000 Author: kevans Date: Fri Apr 20 03:11:51 2018 New Revision: 332806 URL: https://svnweb.freebsd.org/changeset/base/332806 Log: bsdgrep: Clean up procmatches a little bit Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Apr 20 03:08:46 2018 (r332805) +++ head/usr.bin/grep/util.c Fri Apr 20 03:11:51 2018 (r332806) @@ -218,32 +218,41 @@ procmatches(struct mprintc *mc, struct parsec *pc, boo { /* Deal with any -B context or context separators */ - if (matched && mc->doctx) { - if (!first_match && (!mc->same_file || mc->last_outed > 0)) - printf("--\n"); - if (Bflag > 0) - printqueue(); - mc->tail = Aflag; - } + if (matched) { + if (mc->doctx) { + if (!first_match && + (!mc->same_file || mc->last_outed > 0)) + printf("--\n"); + if (Bflag > 0) + printqueue(); + mc->tail = Aflag; + } - /* Print the matching line, but only if not quiet/binary */ - if (matched && mc->printmatch) { - printline(pc, ':'); - while (pc->matchidx >= MAX_MATCHES) { - /* Reset matchidx and try again */ - pc->matchidx = 0; - if (procline(pc) == 0) - printline(pc, ':'); - else - break; + /* Print the matching line, but only if not quiet/binary */ + if (mc->printmatch) { + printline(pc, ':'); + while (pc->matchidx >= MAX_MATCHES) { + /* Reset matchidx and try again */ + pc->matchidx = 0; + if (procline(pc) == 0) + printline(pc, ':'); + else + break; + } + first_match = false; + mc->same_file = true; + mc->last_outed = 0; } - first_match = false; - mc->same_file = true; - mc->last_outed = 0; - } - if (!matched && mc->doctx) { - /* Deal with any -A context */ + /* Count the matches if we have a match limit */ + if (mflag) { + /* XXX TODO: Decrement by number of matched lines */ + mcount -= 1; + if (mflag && mcount <= 0) + return (false); + } + } else if (mc->doctx) { + /* Not matching, deal with any -A context as needed */ if (mc->tail > 0) { grep_printline(&pc->ln, '-'); mc->tail--; @@ -260,14 +269,6 @@ procmatches(struct mprintc *mc, struct parsec *pc, boo if (Bflag == 0 || (Bflag > 0 && enqueue(&pc->ln))) ++mc->last_outed; } - } - - /* Count the matches if we have a match limit */ - if (matched && mflag) { - /* XXX TODO: Decrement by number of matched lines */ - mcount -= 1; - if (mflag && mcount <= 0) - return (false); } return (true); From owner-svn-src-head@freebsd.org Fri Apr 20 03:19:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1822BF99184; Fri, 20 Apr 2018 03:19:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF9C5685ED; Fri, 20 Apr 2018 03:19:45 +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 BA86912CF3; Fri, 20 Apr 2018 03:19:45 +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 w3K3JjMl019601; Fri, 20 Apr 2018 03:19:45 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K3JjQp019596; Fri, 20 Apr 2018 03:19:45 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804200319.w3K3JjQp019596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Apr 2018 03:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332807 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 332807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 03:19:46 -0000 Author: jhibbits Date: Fri Apr 20 03:19:44 2018 New Revision: 332807 URL: https://svnweb.freebsd.org/changeset/base/332807 Log: powerpc64: Add DSCR support Summary: Powerpc64 has support for a register called Data Stream Control Register (DSCR), which basically controls how the hardware controls the caching and prefetch for stream operations. Since mfdscr and mtdscr are privileged instructions, we need to emulate them, and keep the custom DSCR configuration per thread. The purpose of this feature is to change DSCR depending on the operation, set to DSCR Default Prefetch Depth to deepest on string operations, as memcpy. Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D15081 Modified: head/sys/powerpc/include/pcb.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Fri Apr 20 03:11:51 2018 (r332806) +++ head/sys/powerpc/include/pcb.h Fri Apr 20 03:19:44 2018 (r332807) @@ -46,14 +46,16 @@ struct pcb { register_t pcb_sp; /* stack pointer */ register_t pcb_toc; /* toc pointer */ register_t pcb_lr; /* link register */ + register_t pcb_dscr; /* dscr value */ struct pmap *pcb_pm; /* pmap of our vmspace */ jmp_buf *pcb_onfault; /* For use during copyin/copyout */ int pcb_flags; -#define PCB_FPU 1 /* Process uses FPU */ -#define PCB_FPREGS 2 /* Process had FPU registers initialized */ -#define PCB_VEC 4 /* Process had Altivec initialized */ -#define PCB_VSX 8 /* Process had VSX initialized */ +#define PCB_FPU 0x1 /* Process uses FPU */ +#define PCB_FPREGS 0x2 /* Process had FPU registers initialized */ +#define PCB_VEC 0x4 /* Process had Altivec initialized */ +#define PCB_VSX 0x8 /* Process had VSX initialized */ +#define PCB_CDSCR 0x10 /* Process had Custom DSCR initialized */ struct fpu { union { double fpr; Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Fri Apr 20 03:11:51 2018 (r332806) +++ head/sys/powerpc/include/spr.h Fri Apr 20 03:19:44 2018 (r332807) @@ -97,6 +97,7 @@ #define SPR_RTCL_R 0x005 /* .6. 601 RTC Lower - Read */ #define SPR_LR 0x008 /* 468 Link Register */ #define SPR_CTR 0x009 /* 468 Count Register */ +#define SPR_DSCR 0x011 /* Data Stream Control Register */ #define SPR_DSISR 0x012 /* .68 DSI exception source */ #define DSISR_DIRECT 0x80000000 /* Direct-store error exception */ #define DSISR_NOTFOUND 0x40000000 /* Translation not found */ Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Fri Apr 20 03:11:51 2018 (r332806) +++ head/sys/powerpc/powerpc/exec_machdep.c Fri Apr 20 03:19:44 2018 (r332807) @@ -1021,11 +1021,46 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * td->td_retval[1] = 0; } +static int +emulate_mfspr(int spr, int reg, struct trapframe *frame){ + struct thread *td; + + td = curthread; + + if (spr == SPR_DSCR) { + // If DSCR was never set, get the default DSCR + if ((td->td_pcb->pcb_flags & PCB_CDSCR) == 0) + td->td_pcb->pcb_dscr = mfspr(SPR_DSCR); + + frame->fixreg[reg] = td->td_pcb->pcb_dscr; + frame->srr0 += 4; + return 0; + } else + return SIGILL; +} + +static int +emulate_mtspr(int spr, int reg, struct trapframe *frame){ + struct thread *td; + + td = curthread; + + if (spr == SPR_DSCR) { + td->td_pcb->pcb_flags |= PCB_CDSCR; + td->td_pcb->pcb_dscr = frame->fixreg[reg]; + frame->srr0 += 4; + return 0; + } else + return SIGILL; +} + +#define XFX 0xFC0007FF int ppc_instr_emulate(struct trapframe *frame, struct pcb *pcb) { uint32_t instr; int reg, sig; + int rs, spr; instr = fuword32((void *)frame->srr0); sig = SIGILL; @@ -1035,9 +1070,15 @@ ppc_instr_emulate(struct trapframe *frame, struct pcb frame->fixreg[reg] = mfpvr(); frame->srr0 += 4; return (0); - } - - if ((instr & 0xfc000ffe) == 0x7c0004ac) { /* various sync */ + } else if ((instr & XFX) == 0x7c0002a6) { /* mfspr */ + rs = (instr & 0x3e00000) >> 21; + spr = (instr & 0x1ff800) >> 16; + return emulate_mfspr(spr, rs, frame); + } else if ((instr & XFX) == 0x7c0003a6) { /* mtspr */ + rs = (instr & 0x3e00000) >> 21; + spr = (instr & 0x1ff800) >> 16; + return emulate_mtspr(spr, rs, frame); + } else if ((instr & 0xfc000ffe) == 0x7c0004ac) { /* various sync */ powerpc_sync(); /* Do a heavy-weight sync */ frame->srr0 += 4; return (0); Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Fri Apr 20 03:11:51 2018 (r332806) +++ head/sys/powerpc/powerpc/genassym.c Fri Apr 20 03:19:44 2018 (r332807) @@ -195,6 +195,7 @@ ASSYM(CF_SIZE, sizeof(struct callframe)); ASSYM(PCB_CONTEXT, offsetof(struct pcb, pcb_context)); ASSYM(PCB_CR, offsetof(struct pcb, pcb_cr)); +ASSYM(PCB_DSCR, offsetof(struct pcb, pcb_dscr)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_TOC, offsetof(struct pcb, pcb_toc)); ASSYM(PCB_LR, offsetof(struct pcb, pcb_lr)); @@ -202,6 +203,7 @@ ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_FPU, PCB_FPU); ASSYM(PCB_VEC, PCB_VEC); +ASSYM(PCB_CDSCR, PCB_CDSCR); ASSYM(PCB_AIM_USR_VSID, offsetof(struct pcb, pcb_cpu.aim.usr_vsid)); ASSYM(PCB_BOOKE_DBCR0, offsetof(struct pcb, pcb_cpu.booke.dbcr0)); Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Fri Apr 20 03:11:51 2018 (r332806) +++ head/sys/powerpc/powerpc/swtch64.S Fri Apr 20 03:19:44 2018 (r332807) @@ -62,6 +62,7 @@ #include #include +#include #include #include @@ -124,6 +125,14 @@ ENTRY(cpu_switch) stdu %r1,-48(%r1) + lwz %r7, PCB_FLAGS(%r17) + andi. %r7, %r7, PCB_CDSCR + beq .L0 + /* Custom DSCR was set. Reseting it to enter kernel */ + li %r7, 0x0 + mtspr SPR_DSCR, %r7 + +.L0: lwz %r7,PCB_FLAGS(%r17) /* Save FPU context if needed */ andi. %r7, %r7, PCB_FPU @@ -188,10 +197,18 @@ blocked_loop: lwz %r6, PCB_FLAGS(%r17) /* Restore Altivec context if needed */ andi. %r6, %r6, PCB_VEC - beq .L4 + beq .L31 mr %r3,%r13 /* Pass curthread to enable_vec */ bl enable_vec nop + +.L31: + lwz %r6, PCB_FLAGS(%r17) + /* Restore Custom DSCR if needed */ + andi. %r6, %r6, PCB_CDSCR + beq .L4 + ld %r6, PCB_DSCR(%r17) /* Load the DSCR register*/ + mtspr SPR_DSCR, %r6 /* thread to restore is in r3 */ .L4: From owner-svn-src-head@freebsd.org Fri Apr 20 03:23:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E695F99785; Fri, 20 Apr 2018 03:23:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEDE168AF9; Fri, 20 Apr 2018 03:23: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 C853112E9B; Fri, 20 Apr 2018 03:23: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 w3K3NJ5G024600; Fri, 20 Apr 2018 03:23:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K3NJXh024599; Fri, 20 Apr 2018 03:23:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804200323.w3K3NJXh024599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Apr 2018 03:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332808 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 332808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 03:23:20 -0000 Author: jhibbits Date: Fri Apr 20 03:23:19 2018 New Revision: 332808 URL: https://svnweb.freebsd.org/changeset/base/332808 Log: powerpc64: Set n_slbs = 32 for POWER9 Summary: POWER9 also contains 32 slbs entries as explained by the POWER9 User Manual: "For HPT translation, the POWER9 core contains a unified (combined for both instruction and data), 32-entry, fully-associative SLB per thread" Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D15128 Modified: head/sys/powerpc/aim/aim_machdep.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Fri Apr 20 03:19:44 2018 (r332807) +++ head/sys/powerpc/aim/aim_machdep.c Fri Apr 20 03:23:19 2018 (r332808) @@ -212,6 +212,7 @@ aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_of case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER9: /* XXX: get from ibm,slb-size in device tree */ n_slbs = 32; break; From owner-svn-src-head@freebsd.org Fri Apr 20 03:29:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C15E0F99E1C; Fri, 20 Apr 2018 03:29:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 736086AF0A; Fri, 20 Apr 2018 03:29:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DC5F12EA8; Fri, 20 Apr 2018 03:29:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3K3T6TT024834; Fri, 20 Apr 2018 03:29:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K3T66M024833; Fri, 20 Apr 2018 03:29:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804200329.w3K3T66M024833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Apr 2018 03:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332809 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 03:29:06 -0000 Author: kevans Date: Fri Apr 20 03:29:06 2018 New Revision: 332809 URL: https://svnweb.freebsd.org/changeset/base/332809 Log: bsdgrep: Add some TODOs for future work on operating on chunks Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Apr 20 03:23:19 2018 (r332808) +++ head/usr.bin/grep/util.c Fri Apr 20 03:29:06 2018 (r332809) @@ -65,6 +65,7 @@ static bool first_match = true; */ struct parsec { regmatch_t matches[MAX_MATCHES]; /* Matches made */ + /* XXX TODO: This should be a chunk, not a line */ struct str ln; /* Current line */ size_t lnstart; /* Position in line */ size_t matchidx; /* Latest match index */ @@ -217,6 +218,10 @@ static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched) { + /* + * XXX TODO: This should loop over pc->matches and handle things on a + * line-by-line basis, setting up a `struct str` as needed. + */ /* Deal with any -B context or context separators */ if (matched) { if (mc->doctx) { @@ -327,12 +332,18 @@ procfile(const char *fn) mcount = mlimit; for (c = 0; c == 0 || !(lflag || qflag); ) { + /* + * XXX TODO: We need to revisit this in a chunking world. We're + * not going to be doing per-line statistics because of the + * overhead involved. procmatches can figure that stuff out as + * needed. */ /* Reset per-line statistics */ pc.printed = 0; pc.matchidx = 0; pc.lnstart = 0; pc.ln.boff = 0; pc.ln.off += pc.ln.len + 1; + /* XXX TODO: Grab a chunk */ if ((pc.ln.dat = grep_fgetln(f, &pc.ln.len)) == NULL || pc.ln.len == 0) break; @@ -587,6 +598,7 @@ procline(struct parsec *pc) continue; } + /* XXX TODO: We will need to keep going, since we're chunky */ /* One pass if we are not recording matches */ if (!wflag && ((color == NULL && !oflag) || qflag || lflag || Lflag)) break; From owner-svn-src-head@freebsd.org Fri Apr 20 09:57:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D795F8D257; Fri, 20 Apr 2018 09:57:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E01A080A70; Fri, 20 Apr 2018 09:57:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAF3316CCA; Fri, 20 Apr 2018 09:57:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3K9vVaU020973; Fri, 20 Apr 2018 09:57:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3K9vVed020972; Fri, 20 Apr 2018 09:57:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804200957.w3K9vVed020972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 20 Apr 2018 09:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332812 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 09:57:32 -0000 Author: ae Date: Fri Apr 20 09:57:31 2018 New Revision: 332812 URL: https://svnweb.freebsd.org/changeset/base/332812 Log: Add dead_bpf_if structure, that should be used as fake bpf_if during ifnet detach. Since destroying interface is not atomic operation and due to the lack of synhronization during destroy, it is possible, that in the time between bpfdetach() and if_free() some queued on destroying interface mbuf will be used by ether_input_internal() and bpf_peers_present() can dereference NULL bpf_if pointer. To protect from this, assign pointer to empty bpf_if_ext structure instead of NULL pointer after bpfdetach(). Reviewed by: melifaro, eugen Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D15083 Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Fri Apr 20 09:54:06 2018 (r332811) +++ head/sys/net/bpf.c Fri Apr 20 09:57:31 2018 (r332812) @@ -98,6 +98,10 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); +static struct bpf_if_ext dead_bpf_if = { + .bif_dlist = LIST_HEAD_INITIALIZER() +}; + struct bpf_if { #define bif_next bif_ext.bif_next #define bif_dlist bif_ext.bif_dlist @@ -2659,7 +2663,7 @@ bpfdetach(struct ifnet *ifp) */ BPFIF_WLOCK(bp); bp->bif_flags |= BPFIF_FLAG_DYING; - *bp->bif_bpf = NULL; + *bp->bif_bpf = (struct bpf_if *)&dead_bpf_if;; BPFIF_WUNLOCK(bp); CTR4(KTR_NET, "%s: sheduling free for encap %d (%p) for if %p", From owner-svn-src-head@freebsd.org Fri Apr 20 11:38:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A0CF95A07; Fri, 20 Apr 2018 11:38:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1926B780CC; Fri, 20 Apr 2018 11:38:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F59117D01; Fri, 20 Apr 2018 11:38:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3KBcT9r070612; Fri, 20 Apr 2018 11:38:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KBcTou070611; Fri, 20 Apr 2018 11:38:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201804201138.w3KBcTou070611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Apr 2018 11:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332813 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 332813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 11:38:30 -0000 Author: rmacklem Date: Fri Apr 20 11:38:29 2018 New Revision: 332813 URL: https://svnweb.freebsd.org/changeset/base/332813 Log: Fix use of pointer after being set NULL. Using a pointer after setting it NULL is probably not a good plan. Spotted by inspection during changes for Flexible File Layout Ioerr handling. This code path obviously isn't normally executed. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Fri Apr 20 09:57:31 2018 (r332812) +++ head/sys/fs/nfsclient/nfs_clport.c Fri Apr 20 11:38:29 2018 (r332813) @@ -1391,8 +1391,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua NFSMNTP_CANCELRPCS); mtx_unlock(&nmp->nm_mtx); } else { - nmp = NULL; mtx_unlock(&nmp->nm_mtx); + nmp = NULL; } break; } From owner-svn-src-head@freebsd.org Fri Apr 20 13:08:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B99D4FA1D66; Fri, 20 Apr 2018 13:08:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5EB6D230; Fri, 20 Apr 2018 13:08:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E71A18B27; Fri, 20 Apr 2018 13:08:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3KD852X015966; Fri, 20 Apr 2018 13:08:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KD849v015961; Fri, 20 Apr 2018 13:08:04 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804201308.w3KD849v015961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 20 Apr 2018 13:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332816 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 13:08:06 -0000 Author: avg Date: Fri Apr 20 13:08:04 2018 New Revision: 332816 URL: https://svnweb.freebsd.org/changeset/base/332816 Log: call racct_proc_ucred_changed() under the proc lock The lock is required to ensure that the switch to the new credentials and the transfer of the process's accounting data from the old credentials to the new ones is done atomically. Otherwise, some updates may be applied to the new credentials and then additionally transferred from the old credentials if the updates happen after proc_set_cred() and before racct_proc_ucred_changed(). The problem is especially pronounced for RACCT_RSS because - there is a strict accounting for this resource (it's reclaimable) - it's updated asynchronously by the vm daemon - it's updated by setting an absolute value instead of applying a delta I had to remove a call to rctl_proc_ucred_changed() from racct_proc_ucred_changed() and make all callers of latter call the former as well. The reason is that rctl_proc_ucred_changed, as it is implemented now, cannot be called while holding the proc lock, so the lock is dropped after calling racct_proc_ucred_changed. Additionally, I've added calls to crhold / crfree around the rctl call, because without the proc lock there is no gurantee that the new credentials, owned by the process, will stay stable. That does not eliminate a possibility that the credentials passed to the rctl will get stale. Ideally, rctl_proc_ucred_changed should be able to work under the proc lock. Many thanks to kib for pointing out the above problems. PR: 222027 Discussed with: kib No comment: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D15048 Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_loginclass.c head/sys/kern/kern_prot.c head/sys/kern/kern_racct.c head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Apr 20 12:40:05 2018 (r332815) +++ head/sys/kern/kern_jail.c Fri Apr 20 13:08:04 2018 (r332816) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2401,10 +2402,15 @@ do_jail_attach(struct thread *td, struct prison *pr) newcred->cr_prison = pr; proc_set_cred(p, newcred); setsugid(p); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); #endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); +#endif prison_deref(oldcred->cr_prison, PD_DEREF | PD_DEUREF); crfree(oldcred); return (0); @@ -3960,6 +3966,7 @@ prison_racct_modify(struct prison *pr) */ racct_move(pr->pr_prison_racct->prr_racct, oldprr->prr_racct); +#ifdef RCTL /* * Force rctl to reattach rules to processes. */ @@ -3967,9 +3974,10 @@ prison_racct_modify(struct prison *pr) PROC_LOCK(p); cred = crhold(p->p_ucred); PROC_UNLOCK(p); - racct_proc_ucred_changed(p, cred, cred); + rctl_proc_ucred_changed(p, cred); crfree(cred); } +#endif sx_sunlock(&allproc_lock); prison_racct_free_locked(oldprr); Modified: head/sys/kern/kern_loginclass.c ============================================================================== --- head/sys/kern/kern_loginclass.c Fri Apr 20 12:40:05 2018 (r332815) +++ head/sys/kern/kern_loginclass.c Fri Apr 20 13:08:04 2018 (r332816) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -230,9 +231,14 @@ sys_setloginclass(struct thread *td, struct setlogincl oldcred = crcopysafe(p, newcred); newcred->cr_loginclass = newlc; proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); +#endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); #endif loginclass_free(oldcred->cr_loginclass); crfree(oldcred); Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Apr 20 12:40:05 2018 (r332815) +++ head/sys/kern/kern_prot.c Fri Apr 20 13:08:04 2018 (r332816) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -575,10 +576,15 @@ sys_setuid(struct thread *td, struct setuid_args *uap) setsugid(p); } proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); #endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); +#endif uifree(uip); crfree(oldcred); return (0); @@ -923,10 +929,15 @@ sys_setreuid(struct thread *td, struct setreuid_args * setsugid(p); } proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); #endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); +#endif uifree(ruip); uifree(euip); crfree(oldcred); @@ -1064,9 +1075,14 @@ sys_setresuid(struct thread *td, struct setresuid_args setsugid(p); } proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); +#endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); #endif uifree(ruip); uifree(euip); Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Fri Apr 20 12:40:05 2018 (r332815) +++ head/sys/kern/kern_racct.c Fri Apr 20 13:08:04 2018 (r332816) @@ -1046,7 +1046,7 @@ racct_proc_ucred_changed(struct proc *p, struct ucred if (!racct_enable) return; - PROC_LOCK_ASSERT(p, MA_NOTOWNED); + PROC_LOCK_ASSERT(p, MA_OWNED); newuip = newcred->cr_ruidinfo; olduip = oldcred->cr_ruidinfo; @@ -1073,10 +1073,6 @@ racct_proc_ucred_changed(struct proc *p, struct ucred p->p_racct); } RACCT_UNLOCK(); - -#ifdef RCTL - rctl_proc_ucred_changed(p, newcred); -#endif } void Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Fri Apr 20 12:40:05 2018 (r332815) +++ head/sys/kern/kern_rctl.c Fri Apr 20 13:08:04 2018 (r332816) @@ -1956,12 +1956,15 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred * struct prison_racct *newprr; int rulecnt, i; - ASSERT_RACCT_ENABLED(); + if (!racct_enable) + return; + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + newuip = newcred->cr_ruidinfo; newlc = newcred->cr_loginclass; newprr = newcred->cr_prison->pr_prison_racct; - + LIST_INIT(&newrules); again: From owner-svn-src-head@freebsd.org Fri Apr 20 15:19:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B353FABB05; Fri, 20 Apr 2018 15:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EE976DF19; Fri, 20 Apr 2018 15:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 303441A004; Fri, 20 Apr 2018 15:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3KFJSuL081847; Fri, 20 Apr 2018 15:19:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KFJRUx081840; Fri, 20 Apr 2018 15:19:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804201519.w3KFJRUx081840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Apr 2018 15:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332825 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/kern X-SVN-Commit-Revision: 332825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 15:19:28 -0000 Author: kib Date: Fri Apr 20 15:19:27 2018 New Revision: 332825 URL: https://svnweb.freebsd.org/changeset/base/332825 Log: Rename PROC_PDEATHSIG_SET -> PROC_PDEATHSIG_CTL and PROC_PDEATHSIG_GET -> PROC_PDEATHSIG_STATUS for consistency with other procctl(2) operations names. Requested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 13 days Modified: head/lib/libc/sys/procctl.2 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_exec.c head/sys/kern/kern_procctl.c head/sys/sys/procctl.h head/tests/sys/kern/pdeathsig.c head/tests/sys/kern/pdeathsig_helper.c Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Fri Apr 20 15:06:47 2018 (r332824) +++ head/lib/libc/sys/procctl.2 Fri Apr 20 15:19:27 2018 (r332825) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2018 +.Dd April 20, 2018 .Dt PROCCTL 2 .Os .Sh NAME @@ -391,7 +391,7 @@ otherwise. See the note about sysctl .Dv kern.trap_enotcap above, which gives independent global control of signal delivery. -.It Dv PROC_PDEATHSIG_SET +.It Dv PROC_PDEATHSIG_CTL Request the delivery of a signal when the parent of the calling process exits. .Fa idtype @@ -408,7 +408,7 @@ must point to a value of type indicating the signal that should be delivered to the caller. Use zero to cancel a previously requested signal delivery. -.It Dv PROC_PDEATHSIG_GET +.It Dv PROC_PDEATHSIG_STATUS Query the current signal number that will be delivered when the parent of the calling process exits. .Fa idtype @@ -520,9 +520,9 @@ or request is invalid. .It Bq Er EINVAL The -.Dv PROC_PDEATHSIG_SET +.Dv PROC_PDEATHSIG_CTL or -.Dv PROC_PDEATHSIG_GET +.Dv PROC_PDEATHSIG_STATUS request referenced an unsupported .Fa id , .Fa idtype @@ -547,7 +547,7 @@ The reaper facility is based on a similar feature of L DragonflyBSD, and first appeared in .Fx 10.2 . The -.Dv PROC_PDEATHSIG_SET +.Dv PROC_PDEATHSIG_CTL facility is based on the prctl(PR_SET_PDEATHSIG, ...) feature of Linux, and first appeared in .Fx 12.0 . Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri Apr 20 15:06:47 2018 (r332824) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri Apr 20 15:19:27 2018 (r332825) @@ -3378,13 +3378,13 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ case PROC_TRAPCAP_STATUS: data = &flags; break; - case PROC_PDEATHSIG_SET: + case PROC_PDEATHSIG_CTL: error = copyin(uap->data, &signum, sizeof(signum)); if (error != 0) return (error); data = &signum; break; - case PROC_PDEATHSIG_GET: + case PROC_PDEATHSIG_STATUS: data = &signum; break; default: @@ -3407,7 +3407,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_ if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; - case PROC_PDEATHSIG_GET: + case PROC_PDEATHSIG_STATUS: if (error == 0) error = copyout(&signum, uap->data, sizeof(signum)); break; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Apr 20 15:06:47 2018 (r332824) +++ head/sys/kern/kern_exec.c Fri Apr 20 15:19:27 2018 (r332825) @@ -522,7 +522,7 @@ interpret: credential_changing |= will_transition; #endif - /* Don't inherit PROC_PDEATHSIG_SET value if setuid/setgid. */ + /* Don't inherit PROC_PDEATHSIG_CTL value if setuid/setgid. */ if (credential_changing) imgp->proc->p_pdeathsig = 0; Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Fri Apr 20 15:06:47 2018 (r332824) +++ head/sys/kern/kern_procctl.c Fri Apr 20 15:19:27 2018 (r332825) @@ -467,13 +467,13 @@ sys_procctl(struct thread *td, struct procctl_args *ua case PROC_TRAPCAP_STATUS: data = &flags; break; - case PROC_PDEATHSIG_SET: + case PROC_PDEATHSIG_CTL: error = copyin(uap->data, &signum, sizeof(signum)); if (error != 0) return (error); data = &signum; break; - case PROC_PDEATHSIG_GET: + case PROC_PDEATHSIG_STATUS: data = &signum; break; default: @@ -495,7 +495,7 @@ sys_procctl(struct thread *td, struct procctl_args *ua if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; - case PROC_PDEATHSIG_GET: + case PROC_PDEATHSIG_STATUS: if (error == 0) error = copyout(&signum, uap->data, sizeof(signum)); break; @@ -551,14 +551,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t case PROC_REAP_KILL: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: - case PROC_PDEATHSIG_SET: - case PROC_PDEATHSIG_GET: + case PROC_PDEATHSIG_CTL: + case PROC_PDEATHSIG_STATUS: if (idtype != P_PID) return (EINVAL); } switch (com) { - case PROC_PDEATHSIG_SET: + case PROC_PDEATHSIG_CTL: signum = *(int *)data; p = td->td_proc; if ((id != 0 && id != p->p_pid) || @@ -568,7 +568,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t p->p_pdeathsig = signum; PROC_UNLOCK(p); return (0); - case PROC_PDEATHSIG_GET: + case PROC_PDEATHSIG_STATUS: p = td->td_proc; if (id != 0 && id != p->p_pid) return (EINVAL); Modified: head/sys/sys/procctl.h ============================================================================== --- head/sys/sys/procctl.h Fri Apr 20 15:06:47 2018 (r332824) +++ head/sys/sys/procctl.h Fri Apr 20 15:19:27 2018 (r332825) @@ -51,8 +51,8 @@ #define PROC_TRACE_STATUS 8 /* query tracing status */ #define PROC_TRAPCAP_CTL 9 /* trap capability errors */ #define PROC_TRAPCAP_STATUS 10 /* query trap capability status */ -#define PROC_PDEATHSIG_SET 11 /* set parent death signal */ -#define PROC_PDEATHSIG_GET 12 /* get parent death signal */ +#define PROC_PDEATHSIG_CTL 11 /* set parent death signal */ +#define PROC_PDEATHSIG_STATUS 12 /* get parent death signal */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) Modified: head/tests/sys/kern/pdeathsig.c ============================================================================== --- head/tests/sys/kern/pdeathsig.c Fri Apr 20 15:06:47 2018 (r332824) +++ head/tests/sys/kern/pdeathsig.c Fri Apr 20 15:19:27 2018 (r332825) @@ -53,42 +53,42 @@ ATF_TC_BODY(arg_validation, tc) /* bad signal */ signum = 8888; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); ATF_CHECK_EQ(-1, rc); ATF_CHECK_EQ(EINVAL, errno); /* bad id type */ signum = SIGINFO; - rc = procctl(8888, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(8888, 0, PROC_PDEATHSIG_CTL, &signum); ATF_CHECK_EQ(-1, rc); ATF_CHECK_EQ(EINVAL, errno); /* bad id (pid that doesn't match mine or zero) */ signum = SIGINFO; rc = procctl(P_PID, (((getpid() + 1) % 10) + 100), - PROC_PDEATHSIG_SET, &signum); + PROC_PDEATHSIG_CTL, &signum); ATF_CHECK_EQ(-1, rc); ATF_CHECK_EQ(EINVAL, errno); /* null pointer */ signum = SIGINFO; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, NULL); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, NULL); ATF_CHECK_EQ(-1, rc); ATF_CHECK_EQ(EFAULT, errno); /* good (pid == 0) */ signum = SIGINFO; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); ATF_CHECK_EQ(0, rc); /* good (pid == my pid) */ signum = SIGINFO; - rc = procctl(P_PID, getpid(), PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, getpid(), PROC_PDEATHSIG_CTL, &signum); ATF_CHECK_EQ(0, rc); /* check that we can read the signal number back */ signum = 0xdeadbeef; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_GET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_STATUS, &signum); ATF_CHECK_EQ(0, rc); ATF_CHECK_EQ(SIGINFO, signum); } @@ -102,14 +102,14 @@ ATF_TC_BODY(fork_no_inherit, tc) /* request a signal on parent death in the parent */ signum = SIGINFO; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); rc = fork(); ATF_REQUIRE(rc != -1); if (rc == 0) { /* check that we didn't inherit the setting */ signum = 0xdeadbeef; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_GET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_STATUS, &signum); assert(rc == 0); assert(signum == 0); _exit(0); @@ -138,7 +138,7 @@ ATF_TC_BODY(exec_inherit, tc) /* request a signal on parent death and register a handler */ signum = SIGINFO; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); assert(rc == 0); /* execute helper program: it asserts that it has the setting */ @@ -186,7 +186,7 @@ ATF_TC_BODY(signal_delivered, tc) signal(signum, dummy_signal_handler); /* request a signal on death of our parent B */ - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); assert(rc == 0); /* tell B that we're ready for it to exit now */ @@ -263,7 +263,7 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) signal(signum, dummy_signal_handler); /* request a signal on parent death and register a handler */ - rc = procctl(P_PID, 0, PROC_PDEATHSIG_SET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); assert(rc == 0); /* tell D we are ready for it to attach */ Modified: head/tests/sys/kern/pdeathsig_helper.c ============================================================================== --- head/tests/sys/kern/pdeathsig_helper.c Fri Apr 20 15:06:47 2018 (r332824) +++ head/tests/sys/kern/pdeathsig_helper.c Fri Apr 20 15:19:27 2018 (r332825) @@ -38,11 +38,11 @@ int main(int argc, char **argv) /* * This program is executed by the pdeathsig test - * to check if the PROC_PDEATHSIG_SET setting was + * to check if the PROC_PDEATHSIG_CTL setting was * inherited. */ signum = 0xdeadbeef; - rc = procctl(P_PID, 0, PROC_PDEATHSIG_GET, &signum); + rc = procctl(P_PID, 0, PROC_PDEATHSIG_STATUS, &signum); assert(rc == 0); assert(signum == SIGINFO); From owner-svn-src-head@freebsd.org Fri Apr 20 17:30:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EBBCF862AC; Fri, 20 Apr 2018 17:30:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 344A16BFD2; Fri, 20 Apr 2018 17:30:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 77D4A10AFD2; Fri, 20 Apr 2018 13:30:00 -0400 (EDT) From: John Baldwin To: Eric Joyner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332735 - head/sys/x86/x86 Date: Fri, 20 Apr 2018 09:57:28 -0700 Message-ID: <1781933.c5USM7Fcyk@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201804181845.w3IIjYdt037258@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 20 Apr 2018 13:30:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 17:30:08 -0000 I need to rework the layout of IRQ values to be more dynamic (per a thread on current@) as I've seen at least a few systems now that have more than 256 I/O APIC pins. Currently we kind of depend on interrupt_sources[] being statically sized, but I could rework this to support dynamic sizing as a result and probably provide a tunable to control the limit on MSI interrupts (and possibly derive the default limit from the number of CPUs). On Thursday, April 19, 2018 08:59:32 AM Eric Joyner wrote: > Is the limit going to be increased at some point? Is there a true limit > somewhere? > > On Wed, Apr 18, 2018 at 11:45 AM, John Baldwin wrote: > > > Author: jhb > > Date: Wed Apr 18 18:45:34 2018 > > New Revision: 332735 > > URL: https://svnweb.freebsd.org/changeset/base/332735 > > > > Log: > > Fix two off-by-one errors when allocating MSI and MSI-X interrupts. > > > > x86 enforces an (arbitray) limit on the number of available MSI and > > MSI-X interrupts to simplify code (in particular, interrupt_source[] > > is statically sized). This means that an attempt to allocate an MSI > > vector needs to fail if it would go beyond the limit, but the checks > > for exceeding the limit had an off-by-one error. In the case of MSI-X > > which allocates interrupts one at a time this meant that IRQ 768 kept > > getting handed out multiple times for msix_alloc() instead of failing > > because all MSI IRQs were in use. > > > > Tested by: lidl > > MFC after: 1 week > > > > Modified: > > head/sys/x86/x86/msi.c > > > > Modified: head/sys/x86/x86/msi.c > > ============================================================ > > ================== > > --- head/sys/x86/x86/msi.c Wed Apr 18 18:45:04 2018 (r332734) > > +++ head/sys/x86/x86/msi.c Wed Apr 18 18:45:34 2018 (r332735) > > @@ -404,7 +404,7 @@ again: > > /* Do we need to create some new sources? */ > > if (cnt < count) { > > /* If we would exceed the max, give up. */ > > - if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) { > > + if (i + (count - cnt) >= FIRST_MSI_INT + NUM_MSI_INTS) { > > mtx_unlock(&msi_lock); > > free(mirqs, M_MSI); > > return (ENXIO); > > @@ -645,7 +645,7 @@ again: > > /* Do we need to create a new source? */ > > if (msi == NULL) { > > /* If we would exceed the max, give up. */ > > - if (i + 1 > FIRST_MSI_INT + NUM_MSI_INTS) { > > + if (i + 1 >= FIRST_MSI_INT + NUM_MSI_INTS) { > > mtx_unlock(&msi_lock); > > return (ENXIO); > > } > > > > -- John Baldwin From owner-svn-src-head@freebsd.org Fri Apr 20 18:06:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5298EF8AEBA; Fri, 20 Apr 2018 18:06:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 018C574A00; Fri, 20 Apr 2018 18:06:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB9CA1BAF1; Fri, 20 Apr 2018 18:06:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3KI630g066819; Fri, 20 Apr 2018 18:06:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KI63Cv066818; Fri, 20 Apr 2018 18:06:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804201806.w3KI63Cv066818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Apr 2018 18:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332832 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 18:06:04 -0000 Author: kevans Date: Fri Apr 20 18:06:03 2018 New Revision: 332832 URL: https://svnweb.freebsd.org/changeset/base/332832 Log: bsdgrep: Break procmatches down a little bit more Split the matching and non-matching cases out into their own functions to reduce future complexity. As the name implies, procmatches will eventually process more than one match itself in the future. Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Apr 20 15:55:09 2018 (r332831) +++ head/usr.bin/grep/util.c Fri Apr 20 18:06:03 2018 (r332832) @@ -84,6 +84,8 @@ struct mprintc { bool same_file; /* Same file as previously printed? */ }; +static void procmatch_match(struct mprintc *mc, struct parsec *pc); +static void procmatch_nomatch(struct mprintc *mc, struct parsec *pc); static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched); #ifdef WITH_INTERNAL_NOSPEC static int litexec(const struct pat *pat, const char *string, @@ -209,6 +211,55 @@ grep_tree(char **argv) return (c); } +static void +procmatch_match(struct mprintc *mc, struct parsec *pc) +{ + + if (mc->doctx) { + if (!first_match && (!mc->same_file || mc->last_outed > 0)) + printf("--\n"); + if (Bflag > 0) + printqueue(); + mc->tail = Aflag; + } + + /* Print the matching line, but only if not quiet/binary */ + if (mc->printmatch) { + printline(pc, ':'); + while (pc->matchidx >= MAX_MATCHES) { + /* Reset matchidx and try again */ + pc->matchidx = 0; + if (procline(pc) == 0) + printline(pc, ':'); + else + break; + } + first_match = false; + mc->same_file = true; + mc->last_outed = 0; + } +} + +static void +procmatch_nomatch(struct mprintc *mc, struct parsec *pc) +{ + + /* Deal with any -A context as needed */ + if (mc->tail > 0) { + grep_printline(&pc->ln, '-'); + mc->tail--; + if (Bflag > 0) + clearqueue(); + } else if (Bflag == 0 || (Bflag > 0 && enqueue(&pc->ln))) + /* + * Enqueue non-matching lines for -B context. If we're not + * actually doing -B context or if the enqueue resulted in a + * line being rotated out, then go ahead and increment + * last_outed to signify a gap between context/match. + */ + ++mc->last_outed; +} + /* * Process any matches in the current parsing context, return a boolean * indicating whether we should halt any further processing or not. 'true' to @@ -224,31 +275,8 @@ procmatches(struct mprintc *mc, struct parsec *pc, boo */ /* Deal with any -B context or context separators */ if (matched) { - if (mc->doctx) { - if (!first_match && - (!mc->same_file || mc->last_outed > 0)) - printf("--\n"); - if (Bflag > 0) - printqueue(); - mc->tail = Aflag; - } + procmatch_match(mc, pc); - /* Print the matching line, but only if not quiet/binary */ - if (mc->printmatch) { - printline(pc, ':'); - while (pc->matchidx >= MAX_MATCHES) { - /* Reset matchidx and try again */ - pc->matchidx = 0; - if (procline(pc) == 0) - printline(pc, ':'); - else - break; - } - first_match = false; - mc->same_file = true; - mc->last_outed = 0; - } - /* Count the matches if we have a match limit */ if (mflag) { /* XXX TODO: Decrement by number of matched lines */ @@ -256,25 +284,8 @@ procmatches(struct mprintc *mc, struct parsec *pc, boo if (mflag && mcount <= 0) return (false); } - } else if (mc->doctx) { - /* Not matching, deal with any -A context as needed */ - if (mc->tail > 0) { - grep_printline(&pc->ln, '-'); - mc->tail--; - if (Bflag > 0) - clearqueue(); - } else { - /* - * Enqueue non-matching lines for -B context. - * If we're not actually doing -B context or if - * the enqueue resulted in a line being rotated - * out, then go ahead and increment last_outed - * to signify a gap between context/match. - */ - if (Bflag == 0 || (Bflag > 0 && enqueue(&pc->ln))) - ++mc->last_outed; - } - } + } else if (mc->doctx) + procmatch_nomatch(mc, pc); return (true); } From owner-svn-src-head@freebsd.org Fri Apr 20 18:20:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9FFEF8C13E; Fri, 20 Apr 2018 18:20:56 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7B4779CE; Fri, 20 Apr 2018 18:20:56 +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 64D201BD89; Fri, 20 Apr 2018 18:20:56 +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 w3KIKuKf073537; Fri, 20 Apr 2018 18:20:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KIKthB073527; Fri, 20 Apr 2018 18:20:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201804201820.w3KIKthB073527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 Apr 2018 18:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332833 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang/Driver contrib/llvm/tool... X-SVN-Commit-Revision: 332833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 18:20:57 -0000 Author: dim Date: Fri Apr 20 18:20:55 2018 New Revision: 332833 URL: https://svnweb.freebsd.org/changeset/base/332833 Log: Recommit r332501, with an additional upstream fix for "Cannot lower EFLAGS copy that lives out of a basic block!" errors on i386. Pull in r325446 from upstream clang trunk (by me): [X86] Add 'sahf' CPU feature to frontend Summary: Make clang accept `-msahf` (and `-mno-sahf`) flags to activate the `+sahf` feature for the backend, for bug 36028 (Incorrect use of pushf/popf enables/disables interrupts on amd64 kernels). This was originally submitted in bug 36037 by Jonathan Looney . As described there, GCC also uses `-msahf` for this feature, and the backend already recognizes the `+sahf` feature. All that is needed is to teach clang to pass this on to the backend. The mapping of feature support onto CPUs may not be complete; rather, it was chosen to match LLVM's idea of which CPUs support this feature (see lib/Target/X86/X86.td). I also updated the affected test case (CodeGen/attr-target-x86.c) to match the emitted output. Reviewers: craig.topper, coby, efriedma, rsmith Reviewed By: craig.topper Subscribers: emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D43394 Pull in r328944 from upstream llvm trunk (by Chandler Carruth): [x86] Expose more of the condition conversion routines in the public API for X86's instruction information. I've now got a second patch under review that needs these same APIs. This bit is nicely orthogonal and obvious, so landing it. NFC. Pull in r329414 from upstream llvm trunk (by Craig Topper): [X86] Merge itineraries for CLC, CMC, and STC. These are very simple flag setting instructions that appear to only be a single uop. They're unlikely to need this separation. Pull in r329657 from upstream llvm trunk (by Chandler Carruth): [x86] Introduce a pass to begin more systematically fixing PR36028 and similar issues. The key idea is to lower COPY nodes populating EFLAGS by scanning the uses of EFLAGS and introducing dedicated code to preserve the necessary state in a GPR. In the vast majority of cases, these uses are cmovCC and jCC instructions. For such cases, we can very easily save and restore the necessary information by simply inserting a setCC into a GPR where the original flags are live, and then testing that GPR directly to feed the cmov or conditional branch. However, things are a bit more tricky if arithmetic is using the flags. This patch handles the vast majority of cases that seem to come up in practice: adc, adcx, adox, rcl, and rcr; all without taking advantage of partially preserved EFLAGS as LLVM doesn't currently model that at all. There are a large number of operations that techinaclly observe EFLAGS currently but shouldn't in this case -- they typically are using DF. Currently, they will not be handled by this approach. However, I have never seen this issue come up in practice. It is already pretty rare to have these patterns come up in practical code with LLVM. I had to resort to writing MIR tests to cover most of the logic in this pass already. I suspect even with its current amount of coverage of arithmetic users of EFLAGS it will be a significant improvement over the current use of pushf/popf. It will also produce substantially faster code in most of the common patterns. This patch also removes all of the old lowering for EFLAGS copies, and the hack that forced us to use a frame pointer when EFLAGS copies were found anywhere in a function so that the dynamic stack adjustment wasn't a problem. None of this is needed as we now lower all of these copies directly in MI and without require stack adjustments. Lots of thanks to Reid who came up with several aspects of this approach, and Craig who helped me work out a couple of things tripping me up while working on this. Differential Revision: https://reviews.llvm.org/D45146 Pull in r329673 from upstream llvm trunk (by Chandler Carruth): [x86] Model the direction flag (DF) separately from the rest of EFLAGS. This cleans up a number of operations that only claimed te use EFLAGS due to using DF. But no instructions which we think of us setting EFLAGS actually modify DF (other than things like popf) and so this needlessly creates uses of EFLAGS that aren't really there. In fact, DF is so restrictive it is pretty easy to model. Only STD, CLD, and the whole-flags writes (WRFLAGS and POPF) need to model this. I've also somewhat cleaned up some of the flag management instruction definitions to be in the correct .td file. Adding this extra register also uncovered a failure to use the correct datatype to hold X86 registers, and I've corrected that as necessary here. Differential Revision: https://reviews.llvm.org/D45154 Pull in r330264 from upstream llvm trunk (by Chandler Carruth): [x86] Fix PR37100 by teaching the EFLAGS copy lowering to rewrite uses across basic blocks in the limited cases where it is very straight forward to do so. This will also be useful for other places where we do some limited EFLAGS propagation across CFG edges and need to handle copy rewrites afterward. I think this is rapidly approaching the maximum we can and should be doing here. Everything else begins to require either heroic analysis to prove how to do PHI insertion manually, or somehow managing arbitrary PHI-ing of EFLAGS with general PHI insertion. Neither of these seem at all promising so if those cases come up, we'll almost certainly need to rewrite the parts of LLVM that produce those patterns. We do now require dominator trees in order to reliably diagnose patterns that would require PHI nodes. This is a bit unfortunate but it seems better than the completely mysterious crash we would get otherwise. Differential Revision: https://reviews.llvm.org/D45673 Together, these should ensure clang does not use pushf/popf sequences to save and restore flags, avoiding problems with unrelated flags (such as the interrupt flag) being restored unexpectedly. Requested by: jtl PR: 225330 MFC after: 1 week Added: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp (contents, props changed) Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h head/lib/clang/freebsd_cc_version.h head/lib/clang/libllvm/Makefile Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Apr 20 18:20:55 2018 (r332833) @@ -449,6 +449,13 @@ class MachineBasicBlock (public) /// Replace successor OLD with NEW and update probability info. void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New); + /// Copy a successor (and any probability info) from original block to this + /// block's. Uses an iterator into the original blocks successors. + /// + /// This is useful when doing a partial clone of successors. Afterward, the + /// probabilities may need to be normalized. + void copySuccessor(MachineBasicBlock *Orig, succ_iterator I); + /// Transfers all the successors from MBB to this machine basic block (i.e., /// copies all the successors FromMBB and remove all the successors from /// FromMBB). Modified: head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Fri Apr 20 18:20:55 2018 (r332833) @@ -646,6 +646,14 @@ void MachineBasicBlock::replaceSuccessor(MachineBasicB removeSuccessor(OldI); } +void MachineBasicBlock::copySuccessor(MachineBasicBlock *Orig, + succ_iterator I) { + if (Orig->Probs.empty()) + addSuccessor(*I, Orig->getSuccProbability(I)); + else + addSuccessorWithoutProb(*I); +} + void MachineBasicBlock::addPredecessor(MachineBasicBlock *Pred) { Predecessors.push_back(Pred); } Modified: head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Fri Apr 20 18:20:55 2018 (r332833) @@ -265,13 +265,10 @@ MCDisassembler::DecodeStatus X86GenericDisassembler::g /// @param reg - The Reg to append. static void translateRegister(MCInst &mcInst, Reg reg) { #define ENTRY(x) X86::x, - uint8_t llvmRegnums[] = { - ALL_REGS - 0 - }; + static constexpr MCPhysReg llvmRegnums[] = {ALL_REGS}; #undef ENTRY - uint8_t llvmRegnum = llvmRegnums[reg]; + MCPhysReg llvmRegnum = llvmRegnums[reg]; mcInst.addOperand(MCOperand::createReg(llvmRegnum)); } Modified: head/contrib/llvm/lib/Target/X86/X86.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86.h Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/Target/X86/X86.h Fri Apr 20 18:20:55 2018 (r332833) @@ -66,6 +66,9 @@ FunctionPass *createX86OptimizeLEAs(); /// Return a pass that transforms setcc + movzx pairs into xor + setcc. FunctionPass *createX86FixupSetCC(); +/// Return a pass that lowers EFLAGS copy pseudo instructions. +FunctionPass *createX86FlagsCopyLoweringPass(); + /// Return a pass that expands WinAlloca pseudo-instructions. FunctionPass *createX86WinAllocaExpander(); Added: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Fri Apr 20 18:20:55 2018 (r332833) @@ -0,0 +1,777 @@ +//====- X86FlagsCopyLowering.cpp - Lowers COPY nodes of EFLAGS ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// +/// Lowers COPY nodes of EFLAGS by directly extracting and preserving individual +/// flag bits. +/// +/// We have to do this by carefully analyzing and rewriting the usage of the +/// copied EFLAGS register because there is no general way to rematerialize the +/// entire EFLAGS register safely and efficiently. Using `popf` both forces +/// dynamic stack adjustment and can create correctness issues due to IF, TF, +/// and other non-status flags being overwritten. Using sequences involving +/// SAHF don't work on all x86 processors and are often quite slow compared to +/// directly testing a single status preserved in its own GPR. +/// +//===----------------------------------------------------------------------===// + +#include "X86.h" +#include "X86InstrBuilder.h" +#include "X86InstrInfo.h" +#include "X86Subtarget.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/ScopeExit.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/SparseBitVector.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineConstantPool.h" +#include "llvm/CodeGen/MachineDominators.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineInstr.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/MachineOperand.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineSSAUpdater.h" +#include "llvm/CodeGen/TargetInstrInfo.h" +#include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/TargetSchedule.h" +#include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/IR/DebugLoc.h" +#include "llvm/MC/MCSchedule.h" +#include "llvm/Pass.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include +#include + +using namespace llvm; + +#define PASS_KEY "x86-flags-copy-lowering" +#define DEBUG_TYPE PASS_KEY + +STATISTIC(NumCopiesEliminated, "Number of copies of EFLAGS eliminated"); +STATISTIC(NumSetCCsInserted, "Number of setCC instructions inserted"); +STATISTIC(NumTestsInserted, "Number of test instructions inserted"); +STATISTIC(NumAddsInserted, "Number of adds instructions inserted"); + +namespace llvm { + +void initializeX86FlagsCopyLoweringPassPass(PassRegistry &); + +} // end namespace llvm + +namespace { + +// Convenient array type for storing registers associated with each condition. +using CondRegArray = std::array; + +class X86FlagsCopyLoweringPass : public MachineFunctionPass { +public: + X86FlagsCopyLoweringPass() : MachineFunctionPass(ID) { + initializeX86FlagsCopyLoweringPassPass(*PassRegistry::getPassRegistry()); + } + + StringRef getPassName() const override { return "X86 EFLAGS copy lowering"; } + bool runOnMachineFunction(MachineFunction &MF) override; + void getAnalysisUsage(AnalysisUsage &AU) const override; + + /// Pass identification, replacement for typeid. + static char ID; + +private: + MachineRegisterInfo *MRI; + const X86InstrInfo *TII; + const TargetRegisterInfo *TRI; + const TargetRegisterClass *PromoteRC; + MachineDominatorTree *MDT; + + CondRegArray collectCondsInRegs(MachineBasicBlock &MBB, + MachineInstr &CopyDefI); + + unsigned promoteCondToReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, X86::CondCode Cond); + std::pair + getCondOrInverseInReg(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + X86::CondCode Cond, CondRegArray &CondRegs); + void insertTest(MachineBasicBlock &MBB, MachineBasicBlock::iterator Pos, + DebugLoc Loc, unsigned Reg); + + void rewriteArithmetic(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &MI, MachineOperand &FlagUse, + CondRegArray &CondRegs); + void rewriteCMov(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &CMovI, MachineOperand &FlagUse, + CondRegArray &CondRegs); + void rewriteCondJmp(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &JmpI, CondRegArray &CondRegs); + void rewriteCopy(MachineInstr &MI, MachineOperand &FlagUse, + MachineInstr &CopyDefI); + void rewriteSetCC(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &SetCCI, MachineOperand &FlagUse, + CondRegArray &CondRegs); +}; + +} // end anonymous namespace + +INITIALIZE_PASS_BEGIN(X86FlagsCopyLoweringPass, DEBUG_TYPE, + "X86 EFLAGS copy lowering", false, false) +INITIALIZE_PASS_END(X86FlagsCopyLoweringPass, DEBUG_TYPE, + "X86 EFLAGS copy lowering", false, false) + +FunctionPass *llvm::createX86FlagsCopyLoweringPass() { + return new X86FlagsCopyLoweringPass(); +} + +char X86FlagsCopyLoweringPass::ID = 0; + +void X86FlagsCopyLoweringPass::getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + MachineFunctionPass::getAnalysisUsage(AU); +} + +namespace { +/// An enumeration of the arithmetic instruction mnemonics which have +/// interesting flag semantics. +/// +/// We can map instruction opcodes into these mnemonics to make it easy to +/// dispatch with specific functionality. +enum class FlagArithMnemonic { + ADC, + ADCX, + ADOX, + RCL, + RCR, + SBB, +}; +} // namespace + +static FlagArithMnemonic getMnemonicFromOpcode(unsigned Opcode) { + switch (Opcode) { + default: + report_fatal_error("No support for lowering a copy into EFLAGS when used " + "by this instruction!"); + +#define LLVM_EXPAND_INSTR_SIZES(MNEMONIC, SUFFIX) \ + case X86::MNEMONIC##8##SUFFIX: \ + case X86::MNEMONIC##16##SUFFIX: \ + case X86::MNEMONIC##32##SUFFIX: \ + case X86::MNEMONIC##64##SUFFIX: + +#define LLVM_EXPAND_ADC_SBB_INSTR(MNEMONIC) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rr) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rr_REV) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rm) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, mr) \ + case X86::MNEMONIC##8ri: \ + case X86::MNEMONIC##16ri8: \ + case X86::MNEMONIC##32ri8: \ + case X86::MNEMONIC##64ri8: \ + case X86::MNEMONIC##16ri: \ + case X86::MNEMONIC##32ri: \ + case X86::MNEMONIC##64ri32: \ + case X86::MNEMONIC##8mi: \ + case X86::MNEMONIC##16mi8: \ + case X86::MNEMONIC##32mi8: \ + case X86::MNEMONIC##64mi8: \ + case X86::MNEMONIC##16mi: \ + case X86::MNEMONIC##32mi: \ + case X86::MNEMONIC##64mi32: \ + case X86::MNEMONIC##8i8: \ + case X86::MNEMONIC##16i16: \ + case X86::MNEMONIC##32i32: \ + case X86::MNEMONIC##64i32: + + LLVM_EXPAND_ADC_SBB_INSTR(ADC) + return FlagArithMnemonic::ADC; + + LLVM_EXPAND_ADC_SBB_INSTR(SBB) + return FlagArithMnemonic::SBB; + +#undef LLVM_EXPAND_ADC_SBB_INSTR + + LLVM_EXPAND_INSTR_SIZES(RCL, rCL) + LLVM_EXPAND_INSTR_SIZES(RCL, r1) + LLVM_EXPAND_INSTR_SIZES(RCL, ri) + return FlagArithMnemonic::RCL; + + LLVM_EXPAND_INSTR_SIZES(RCR, rCL) + LLVM_EXPAND_INSTR_SIZES(RCR, r1) + LLVM_EXPAND_INSTR_SIZES(RCR, ri) + return FlagArithMnemonic::RCR; + +#undef LLVM_EXPAND_INSTR_SIZES + + case X86::ADCX32rr: + case X86::ADCX64rr: + case X86::ADCX32rm: + case X86::ADCX64rm: + return FlagArithMnemonic::ADCX; + + case X86::ADOX32rr: + case X86::ADOX64rr: + case X86::ADOX32rm: + case X86::ADOX64rm: + return FlagArithMnemonic::ADOX; + } +} + +static MachineBasicBlock &splitBlock(MachineBasicBlock &MBB, + MachineInstr &SplitI, + const X86InstrInfo &TII) { + MachineFunction &MF = *MBB.getParent(); + + assert(SplitI.getParent() == &MBB && + "Split instruction must be in the split block!"); + assert(SplitI.isBranch() && + "Only designed to split a tail of branch instructions!"); + assert(X86::getCondFromBranchOpc(SplitI.getOpcode()) != X86::COND_INVALID && + "Must split on an actual jCC instruction!"); + + // Dig out the previous instruction to the split point. + MachineInstr &PrevI = *std::prev(SplitI.getIterator()); + assert(PrevI.isBranch() && "Must split after a branch!"); + assert(X86::getCondFromBranchOpc(PrevI.getOpcode()) != X86::COND_INVALID && + "Must split after an actual jCC instruction!"); + assert(!std::prev(PrevI.getIterator())->isTerminator() && + "Must only have this one terminator prior to the split!"); + + // Grab the one successor edge that will stay in `MBB`. + MachineBasicBlock &UnsplitSucc = *PrevI.getOperand(0).getMBB(); + + // Analyze the original block to see if we are actually splitting an edge + // into two edges. This can happen when we have multiple conditional jumps to + // the same successor. + bool IsEdgeSplit = + std::any_of(SplitI.getIterator(), MBB.instr_end(), + [&](MachineInstr &MI) { + assert(MI.isTerminator() && + "Should only have spliced terminators!"); + return llvm::any_of( + MI.operands(), [&](MachineOperand &MOp) { + return MOp.isMBB() && MOp.getMBB() == &UnsplitSucc; + }); + }) || + MBB.getFallThrough() == &UnsplitSucc; + + MachineBasicBlock &NewMBB = *MF.CreateMachineBasicBlock(); + + // Insert the new block immediately after the current one. Any existing + // fallthrough will be sunk into this new block anyways. + MF.insert(std::next(MachineFunction::iterator(&MBB)), &NewMBB); + + // Splice the tail of instructions into the new block. + NewMBB.splice(NewMBB.end(), &MBB, SplitI.getIterator(), MBB.end()); + + // Copy the necessary succesors (and their probability info) into the new + // block. + for (auto SI = MBB.succ_begin(), SE = MBB.succ_end(); SI != SE; ++SI) + if (IsEdgeSplit || *SI != &UnsplitSucc) + NewMBB.copySuccessor(&MBB, SI); + // Normalize the probabilities if we didn't end up splitting the edge. + if (!IsEdgeSplit) + NewMBB.normalizeSuccProbs(); + + // Now replace all of the moved successors in the original block with the new + // block. This will merge their probabilities. + for (MachineBasicBlock *Succ : NewMBB.successors()) + if (Succ != &UnsplitSucc) + MBB.replaceSuccessor(Succ, &NewMBB); + + // We should always end up replacing at least one successor. + assert(MBB.isSuccessor(&NewMBB) && + "Failed to make the new block a successor!"); + + // Now update all the PHIs. + for (MachineBasicBlock *Succ : NewMBB.successors()) { + for (MachineInstr &MI : *Succ) { + if (!MI.isPHI()) + break; + + for (int OpIdx = 1, NumOps = MI.getNumOperands(); OpIdx < NumOps; + OpIdx += 2) { + MachineOperand &OpV = MI.getOperand(OpIdx); + MachineOperand &OpMBB = MI.getOperand(OpIdx + 1); + assert(OpMBB.isMBB() && "Block operand to a PHI is not a block!"); + if (OpMBB.getMBB() != &MBB) + continue; + + // Replace the operand for unsplit successors + if (!IsEdgeSplit || Succ != &UnsplitSucc) { + OpMBB.setMBB(&NewMBB); + + // We have to continue scanning as there may be multiple entries in + // the PHI. + continue; + } + + // When we have split the edge append a new successor. + MI.addOperand(MF, OpV); + MI.addOperand(MF, MachineOperand::CreateMBB(&NewMBB)); + break; + } + } + } + + return NewMBB; +} + +bool X86FlagsCopyLoweringPass::runOnMachineFunction(MachineFunction &MF) { + DEBUG(dbgs() << "********** " << getPassName() << " : " << MF.getName() + << " **********\n"); + + auto &Subtarget = MF.getSubtarget(); + MRI = &MF.getRegInfo(); + TII = Subtarget.getInstrInfo(); + TRI = Subtarget.getRegisterInfo(); + MDT = &getAnalysis(); + PromoteRC = &X86::GR8RegClass; + + if (MF.begin() == MF.end()) + // Nothing to do for a degenerate empty function... + return false; + + SmallVector Copies; + for (MachineBasicBlock &MBB : MF) + for (MachineInstr &MI : MBB) + if (MI.getOpcode() == TargetOpcode::COPY && + MI.getOperand(0).getReg() == X86::EFLAGS) + Copies.push_back(&MI); + + for (MachineInstr *CopyI : Copies) { + MachineBasicBlock &MBB = *CopyI->getParent(); + + MachineOperand &VOp = CopyI->getOperand(1); + assert(VOp.isReg() && + "The input to the copy for EFLAGS should always be a register!"); + MachineInstr &CopyDefI = *MRI->getVRegDef(VOp.getReg()); + if (CopyDefI.getOpcode() != TargetOpcode::COPY) { + // FIXME: The big likely candidate here are PHI nodes. We could in theory + // handle PHI nodes, but it gets really, really hard. Insanely hard. Hard + // enough that it is probably better to change every other part of LLVM + // to avoid creating them. The issue is that once we have PHIs we won't + // know which original EFLAGS value we need to capture with our setCCs + // below. The end result will be computing a complete set of setCCs that + // we *might* want, computing them in every place where we copy *out* of + // EFLAGS and then doing SSA formation on all of them to insert necessary + // PHI nodes and consume those here. Then hoping that somehow we DCE the + // unnecessary ones. This DCE seems very unlikely to be successful and so + // we will almost certainly end up with a glut of dead setCC + // instructions. Until we have a motivating test case and fail to avoid + // it by changing other parts of LLVM's lowering, we refuse to handle + // this complex case here. + DEBUG(dbgs() << "ERROR: Encountered unexpected def of an eflags copy: "; + CopyDefI.dump()); + report_fatal_error( + "Cannot lower EFLAGS copy unless it is defined in turn by a copy!"); + } + + auto Cleanup = make_scope_exit([&] { + // All uses of the EFLAGS copy are now rewritten, kill the copy into + // eflags and if dead the copy from. + CopyI->eraseFromParent(); + if (MRI->use_empty(CopyDefI.getOperand(0).getReg())) + CopyDefI.eraseFromParent(); + ++NumCopiesEliminated; + }); + + MachineOperand &DOp = CopyI->getOperand(0); + assert(DOp.isDef() && "Expected register def!"); + assert(DOp.getReg() == X86::EFLAGS && "Unexpected copy def register!"); + if (DOp.isDead()) + continue; + + MachineBasicBlock &TestMBB = *CopyDefI.getParent(); + auto TestPos = CopyDefI.getIterator(); + DebugLoc TestLoc = CopyDefI.getDebugLoc(); + + DEBUG(dbgs() << "Rewriting copy: "; CopyI->dump()); + + // Scan for usage of newly set EFLAGS so we can rewrite them. We just buffer + // jumps because their usage is very constrained. + bool FlagsKilled = false; + SmallVector JmpIs; + + // Gather the condition flags that have already been preserved in + // registers. We do this from scratch each time as we expect there to be + // very few of them and we expect to not revisit the same copy definition + // many times. If either of those change sufficiently we could build a map + // of these up front instead. + CondRegArray CondRegs = collectCondsInRegs(TestMBB, CopyDefI); + + // Collect the basic blocks we need to scan. Typically this will just be + // a single basic block but we may have to scan multiple blocks if the + // EFLAGS copy lives into successors. + SmallVector Blocks; + SmallPtrSet VisitedBlocks; + Blocks.push_back(&MBB); + VisitedBlocks.insert(&MBB); + + do { + MachineBasicBlock &UseMBB = *Blocks.pop_back_val(); + + // We currently don't do any PHI insertion and so we require that the + // test basic block dominates all of the use basic blocks. + // + // We could in theory do PHI insertion here if it becomes useful by just + // taking undef values in along every edge that we don't trace this + // EFLAGS copy along. This isn't as bad as fully general PHI insertion, + // but still seems like a great deal of complexity. + // + // Because it is theoretically possible that some earlier MI pass or + // other lowering transformation could induce this to happen, we do + // a hard check even in non-debug builds here. + if (&TestMBB != &UseMBB && !MDT->dominates(&TestMBB, &UseMBB)) { + DEBUG({ + dbgs() << "ERROR: Encountered use that is not dominated by our test " + "basic block! Rewriting this would require inserting PHI " + "nodes to track the flag state across the CFG.\n\nTest " + "block:\n"; + TestMBB.dump(); + dbgs() << "Use block:\n"; + UseMBB.dump(); + }); + report_fatal_error("Cannot lower EFLAGS copy when original copy def " + "does not dominate all uses."); + } + + for (auto MII = &UseMBB == &MBB ? std::next(CopyI->getIterator()) + : UseMBB.instr_begin(), + MIE = UseMBB.instr_end(); + MII != MIE;) { + MachineInstr &MI = *MII++; + MachineOperand *FlagUse = MI.findRegisterUseOperand(X86::EFLAGS); + if (!FlagUse) { + if (MI.findRegisterDefOperand(X86::EFLAGS)) { + // If EFLAGS are defined, it's as-if they were killed. We can stop + // scanning here. + // + // NB!!! Many instructions only modify some flags. LLVM currently + // models this as clobbering all flags, but if that ever changes + // this will need to be carefully updated to handle that more + // complex logic. + FlagsKilled = true; + break; + } + continue; + } + + DEBUG(dbgs() << " Rewriting use: "; MI.dump()); + + // Check the kill flag before we rewrite as that may change it. + if (FlagUse->isKill()) + FlagsKilled = true; + + // Once we encounter a branch, the rest of the instructions must also be + // branches. We can't rewrite in place here, so we handle them below. + // + // Note that we don't have to handle tail calls here, even conditional + // tail calls, as those are not introduced into the X86 MI until post-RA + // branch folding or black placement. As a consequence, we get to deal + // with the simpler formulation of conditional branches followed by tail + // calls. + if (X86::getCondFromBranchOpc(MI.getOpcode()) != X86::COND_INVALID) { + auto JmpIt = MI.getIterator(); + do { + JmpIs.push_back(&*JmpIt); + ++JmpIt; + } while (JmpIt != UseMBB.instr_end() && + X86::getCondFromBranchOpc(JmpIt->getOpcode()) != + X86::COND_INVALID); + break; + } + + // Otherwise we can just rewrite in-place. + if (X86::getCondFromCMovOpc(MI.getOpcode()) != X86::COND_INVALID) { + rewriteCMov(TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs); + } else if (X86::getCondFromSETOpc(MI.getOpcode()) != + X86::COND_INVALID) { + rewriteSetCC(TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs); + } else if (MI.getOpcode() == TargetOpcode::COPY) { + rewriteCopy(MI, *FlagUse, CopyDefI); + } else { + // We assume that arithmetic instructions that use flags also def + // them. + assert(MI.findRegisterDefOperand(X86::EFLAGS) && + "Expected a def of EFLAGS for this instruction!"); + + // NB!!! Several arithmetic instructions only *partially* update + // flags. Theoretically, we could generate MI code sequences that + // would rely on this fact and observe different flags independently. + // But currently LLVM models all of these instructions as clobbering + // all the flags in an undef way. We rely on that to simplify the + // logic. + FlagsKilled = true; + + rewriteArithmetic(TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs); + break; + } + + // If this was the last use of the flags, we're done. + if (FlagsKilled) + break; + } + + // If the flags were killed, we're done with this block. + if (FlagsKilled) + break; + + // Otherwise we need to scan successors for ones where the flags live-in + // and queue those up for processing. + for (MachineBasicBlock *SuccMBB : UseMBB.successors()) + if (SuccMBB->isLiveIn(X86::EFLAGS) && + VisitedBlocks.insert(SuccMBB).second) + Blocks.push_back(SuccMBB); + } while (!Blocks.empty()); + + // Now rewrite the jumps that use the flags. These we handle specially + // because if there are multiple jumps in a single basic block we'll have + // to do surgery on the CFG. + MachineBasicBlock *LastJmpMBB = nullptr; + for (MachineInstr *JmpI : JmpIs) { + // Past the first jump within a basic block we need to split the blocks + // apart. + if (JmpI->getParent() == LastJmpMBB) + splitBlock(*JmpI->getParent(), *JmpI, *TII); + else + LastJmpMBB = JmpI->getParent(); + + rewriteCondJmp(TestMBB, TestPos, TestLoc, *JmpI, CondRegs); + } + + // FIXME: Mark the last use of EFLAGS before the copy's def as a kill if + // the copy's def operand is itself a kill. + } + +#ifndef NDEBUG + for (MachineBasicBlock &MBB : MF) + for (MachineInstr &MI : MBB) + if (MI.getOpcode() == TargetOpcode::COPY && + (MI.getOperand(0).getReg() == X86::EFLAGS || + MI.getOperand(1).getReg() == X86::EFLAGS)) { + DEBUG(dbgs() << "ERROR: Found a COPY involving EFLAGS: "; MI.dump()); + llvm_unreachable("Unlowered EFLAGS copy!"); + } +#endif + + return true; +} + +/// Collect any conditions that have already been set in registers so that we +/// can re-use them rather than adding duplicates. +CondRegArray +X86FlagsCopyLoweringPass::collectCondsInRegs(MachineBasicBlock &MBB, + MachineInstr &CopyDefI) { + CondRegArray CondRegs = {}; + + // Scan backwards across the range of instructions with live EFLAGS. + for (MachineInstr &MI : llvm::reverse( + llvm::make_range(MBB.instr_begin(), CopyDefI.getIterator()))) { + X86::CondCode Cond = X86::getCondFromSETOpc(MI.getOpcode()); + if (Cond != X86::COND_INVALID && MI.getOperand(0).isReg() && + TRI->isVirtualRegister(MI.getOperand(0).getReg())) + CondRegs[Cond] = MI.getOperand(0).getReg(); + + // Stop scanning when we see the first definition of the EFLAGS as prior to + // this we would potentially capture the wrong flag state. + if (MI.findRegisterDefOperand(X86::EFLAGS)) + break; + } + return CondRegs; +} + +unsigned X86FlagsCopyLoweringPass::promoteCondToReg( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, X86::CondCode Cond) { + unsigned Reg = MRI->createVirtualRegister(PromoteRC); + auto SetI = BuildMI(TestMBB, TestPos, TestLoc, + TII->get(X86::getSETFromCond(Cond)), Reg); + (void)SetI; + DEBUG(dbgs() << " save cond: "; SetI->dump()); + ++NumSetCCsInserted; + return Reg; +} + +std::pair X86FlagsCopyLoweringPass::getCondOrInverseInReg( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, X86::CondCode Cond, CondRegArray &CondRegs) { + unsigned &CondReg = CondRegs[Cond]; + unsigned &InvCondReg = CondRegs[X86::GetOppositeBranchCondition(Cond)]; + if (!CondReg && !InvCondReg) + CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); + + if (CondReg) + return {CondReg, false}; + else + return {InvCondReg, true}; +} + +void X86FlagsCopyLoweringPass::insertTest(MachineBasicBlock &MBB, + MachineBasicBlock::iterator Pos, + DebugLoc Loc, unsigned Reg) { + // We emit test instructions as register/immediate test against -1. This + // allows register allocation to fold a memory operand if needed (that will + // happen often due to the places this code is emitted). But hopefully will + // also allow us to select a shorter encoding of `testb %reg, %reg` when that + // would be equivalent. + auto TestI = + BuildMI(MBB, Pos, Loc, TII->get(X86::TEST8ri)).addReg(Reg).addImm(-1); + (void)TestI; + DEBUG(dbgs() << " test cond: "; TestI->dump()); + ++NumTestsInserted; +} + +void X86FlagsCopyLoweringPass::rewriteArithmetic( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, MachineInstr &MI, MachineOperand &FlagUse, + CondRegArray &CondRegs) { + // Arithmetic is either reading CF or OF. Figure out which condition we need + // to preserve in a register. + X86::CondCode Cond; + + // The addend to use to reset CF or OF when added to the flag value. + int Addend; + + switch (getMnemonicFromOpcode(MI.getOpcode())) { + case FlagArithMnemonic::ADC: + case FlagArithMnemonic::ADCX: + case FlagArithMnemonic::RCL: + case FlagArithMnemonic::RCR: + case FlagArithMnemonic::SBB: + Cond = X86::COND_B; // CF == 1 + // Set up an addend that when one is added will need a carry due to not + // having a higher bit available. + Addend = 255; + break; + + case FlagArithMnemonic::ADOX: + Cond = X86::COND_O; // OF == 1 + // Set up an addend that when one is added will turn from positive to + // negative and thus overflow in the signed domain. + Addend = 127; + break; + } + + // Now get a register that contains the value of the flag input to the + // arithmetic. We require exactly this flag to simplify the arithmetic + // required to materialize it back into the flag. + unsigned &CondReg = CondRegs[Cond]; + if (!CondReg) + CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); + + MachineBasicBlock &MBB = *MI.getParent(); + + // Insert an instruction that will set the flag back to the desired value. + unsigned TmpReg = MRI->createVirtualRegister(PromoteRC); + auto AddI = + BuildMI(MBB, MI.getIterator(), MI.getDebugLoc(), TII->get(X86::ADD8ri)) + .addDef(TmpReg, RegState::Dead) + .addReg(CondReg) + .addImm(Addend); + (void)AddI; + DEBUG(dbgs() << " add cond: "; AddI->dump()); + ++NumAddsInserted; + FlagUse.setIsKill(true); +} + +void X86FlagsCopyLoweringPass::rewriteCMov(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, + MachineInstr &CMovI, + MachineOperand &FlagUse, + CondRegArray &CondRegs) { + // First get the register containing this specific condition. + X86::CondCode Cond = X86::getCondFromCMovOpc(CMovI.getOpcode()); + unsigned CondReg; + bool Inverted; + std::tie(CondReg, Inverted) = + getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs); + + MachineBasicBlock &MBB = *CMovI.getParent(); + + // Insert a direct test of the saved register. + insertTest(MBB, CMovI.getIterator(), CMovI.getDebugLoc(), CondReg); + + // Rewrite the CMov to use the !ZF flag from the test (but match register + // size and memory operand), and then kill its use of the flags afterward. + auto &CMovRC = *MRI->getRegClass(CMovI.getOperand(0).getReg()); + CMovI.setDesc(TII->get(X86::getCMovFromCond( + Inverted ? X86::COND_E : X86::COND_NE, TRI->getRegSizeInBits(CMovRC) / 8, + !CMovI.memoperands_empty()))); + FlagUse.setIsKill(true); + DEBUG(dbgs() << " fixed cmov: "; CMovI.dump()); +} + +void X86FlagsCopyLoweringPass::rewriteCondJmp( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, MachineInstr &JmpI, CondRegArray &CondRegs) { + // First get the register containing this specific condition. + X86::CondCode Cond = X86::getCondFromBranchOpc(JmpI.getOpcode()); + unsigned CondReg; + bool Inverted; + std::tie(CondReg, Inverted) = + getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs); + + MachineBasicBlock &JmpMBB = *JmpI.getParent(); + + // Insert a direct test of the saved register. + insertTest(JmpMBB, JmpI.getIterator(), JmpI.getDebugLoc(), CondReg); + + // Rewrite the jump to use the !ZF flag from the test, and kill its use of + // flags afterward. + JmpI.setDesc(TII->get( + X86::GetCondBranchFromCond(Inverted ? X86::COND_E : X86::COND_NE))); + const int ImplicitEFLAGSOpIdx = 1; + JmpI.getOperand(ImplicitEFLAGSOpIdx).setIsKill(true); + DEBUG(dbgs() << " fixed jCC: "; JmpI.dump()); +} + +void X86FlagsCopyLoweringPass::rewriteCopy(MachineInstr &MI, + MachineOperand &FlagUse, + MachineInstr &CopyDefI) { + // Just replace this copy with the the original copy def. + MRI->replaceRegWith(MI.getOperand(0).getReg(), + CopyDefI.getOperand(0).getReg()); + MI.eraseFromParent(); +} + +void X86FlagsCopyLoweringPass::rewriteSetCC(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, + MachineInstr &SetCCI, + MachineOperand &FlagUse, + CondRegArray &CondRegs) { + X86::CondCode Cond = X86::getCondFromSETOpc(SetCCI.getOpcode()); + // Note that we can't usefully rewrite this to the inverse without complex + // analysis of the users of the setCC. Largely we rely on duplicates which + // could have been avoided already being avoided here. + unsigned &CondReg = CondRegs[Cond]; + if (!CondReg) + CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); + + // Rewriting this is trivial: we just replace the register and remove the + // setcc. + MRI->replaceRegWith(SetCCI.getOperand(0).getReg(), CondReg); + SetCCI.eraseFromParent(); +} Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Apr 20 18:20:55 2018 (r332833) @@ -27781,11 +27781,16 @@ X86TargetLowering::EmitInstrWithCustomInserter(Machine MI.getOpcode() == X86::RDFLAGS32 ? X86::PUSHF32 : X86::PUSHF64; unsigned Pop = MI.getOpcode() == X86::RDFLAGS32 ? X86::POP32r : X86::POP64r; MachineInstr *Push = BuildMI(*BB, MI, DL, TII->get(PushF)); - // Permit reads of the FLAGS register without it being defined. + // Permit reads of the EFLAGS and DF registers without them being defined. // This intrinsic exists to read external processor state in flags, such as // the trap flag, interrupt flag, and direction flag, none of which are // modeled by the backend. + assert(Push->getOperand(2).getReg() == X86::EFLAGS && + "Unexpected register in operand!"); Push->getOperand(2).setIsUndef(); + assert(Push->getOperand(3).getReg() == X86::DF && + "Unexpected register in operand!"); + Push->getOperand(3).setIsUndef(); BuildMI(*BB, MI, DL, TII->get(Pop), MI.getOperand(0).getReg()); MI.eraseFromParent(); // The pseudo is gone now. @@ -37827,25 +37832,6 @@ bool X86TargetLowering::isTypeDesirableForOp(unsigned case ISD::XOR: return false; } -} - -/// This function checks if any of the users of EFLAGS copies the EFLAGS. We -/// know that the code that lowers COPY of EFLAGS has to use the stack, and if -/// we don't adjust the stack we clobber the first frame index. -/// See X86InstrInfo::copyPhysReg. -static bool hasCopyImplyingStackAdjustment(const MachineFunction &MF) { - const MachineRegisterInfo &MRI = MF.getRegInfo(); - return any_of(MRI.reg_instructions(X86::EFLAGS), - [](const MachineInstr &RI) { return RI.isCopy(); }); -} - -void X86TargetLowering::finalizeLowering(MachineFunction &MF) const { - if (hasCopyImplyingStackAdjustment(MF)) { - MachineFrameInfo &MFI = MF.getFrameInfo(); - MFI.setHasCopyImplyingStackAdjustment(true); - } - - TargetLoweringBase::finalizeLowering(MF); } /// This method query the target whether it is beneficial for dag combiner to Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.h Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.h Fri Apr 20 18:20:55 2018 (r332833) @@ -1099,9 +1099,6 @@ namespace llvm { bool lowerInterleavedStore(StoreInst *SI, ShuffleVectorInst *SVI, unsigned Factor) const override; - - void finalizeLowering(MachineFunction &MF) const override; - protected: std::pair findRepresentativeClass(const TargetRegisterInfo *TRI, Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Apr 20 18:20:55 2018 (r332833) @@ -473,7 +473,7 @@ let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], usesCustomInserter = 1, Uses = [ESP, SSP] in { def TLS_addr32 : I<0, Pseudo, (outs), (ins i32mem:$sym), "# TLS_addr32", @@ -493,7 +493,7 @@ let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], usesCustomInserter = 1, Uses = [RSP, SSP] in { def TLS_addr64 : I<0, Pseudo, (outs), (ins i64mem:$sym), "# TLS_addr64", @@ -509,7 +509,7 @@ def TLS_base_addr64 : I<0, Pseudo, (outs), (ins i64mem // For i386, the address of the thunk is passed on the stack, on return the // address of the variable is in %eax. %ecx is trashed during the function // call. All other registers are preserved. -let Defs = [EAX, ECX, EFLAGS], +let Defs = [EAX, ECX, EFLAGS, DF], Uses = [ESP, SSP], usesCustomInserter = 1 in def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), @@ -522,7 +522,7 @@ def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym // %rdi. The lowering will do the right thing with RDI. // On return the address of the variable is in %rax. All other // registers are preserved. -let Defs = [RAX, EFLAGS], +let Defs = [RAX, EFLAGS, DF], Uses = [RSP, SSP], usesCustomInserter = 1 in def TLSCall_64 : I<0, Pseudo, (outs), (ins i64mem:$sym), Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Fri Apr 20 18:06:03 2018 (r332832) +++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Fri Apr 20 18:20:55 2018 (r332833) @@ -5782,7 +5782,7 @@ bool X86InstrInfo::findCommutedOpIndices(MachineInstr return false; } -static X86::CondCode getCondFromBranchOpc(unsigned BrOpc) { +X86::CondCode X86::getCondFromBranchOpc(unsigned BrOpc) { switch (BrOpc) { default: return X86::COND_INVALID; case X86::JE_1: return X86::COND_E; @@ -5805,7 +5805,7 @@ static X86::CondCode getCondFromBranchOpc(unsigned BrO } /// Return condition code of a SET opcode. -static X86::CondCode getCondFromSETOpc(unsigned Opc) { +X86::CondCode X86::getCondFromSETOpc(unsigned Opc) { switch (Opc) { default: return X86::COND_INVALID; case X86::SETAr: case X86::SETAm: return X86::COND_A; @@ -6130,7 +6130,7 @@ void X86InstrInfo::replaceBranchWithTailCall( if (!I->isBranch()) assert(0 && "Can't find the branch to replace!"); - X86::CondCode CC = getCondFromBranchOpc(I->getOpcode()); + X86::CondCode CC = X86::getCondFromBranchOpc(I->getOpcode()); assert(BranchCond.size() == 1); if (CC != BranchCond[0].getImm()) continue; @@ -6237,7 +6237,7 @@ bool X86InstrInfo::AnalyzeBranchImpl( } // Handle conditional branches. - X86::CondCode BranchCode = getCondFromBranchOpc(I->getOpcode()); + X86::CondCode BranchCode = X86::getCondFromBranchOpc(I->getOpcode()); if (BranchCode == X86::COND_INVALID) return true; // Can't handle indirect branch. @@ -6433,7 +6433,7 @@ unsigned X86InstrInfo::removeBranch(MachineBasicBlock if (I->isDebugValue()) continue; if (I->getOpcode() != X86::JMP_1 && - getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) + X86::getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) break; // Remove the branch. I->eraseFromParent(); @@ -6710,102 +6710,12 @@ void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB, return; } - bool FromEFLAGS = SrcReg == X86::EFLAGS; - bool ToEFLAGS = DestReg == X86::EFLAGS; - int Reg = FromEFLAGS ? DestReg : SrcReg; - bool is32 = X86::GR32RegClass.contains(Reg); - bool is64 = X86::GR64RegClass.contains(Reg); - - if ((FromEFLAGS || ToEFLAGS) && (is32 || is64)) { - int Mov = is64 ? X86::MOV64rr : X86::MOV32rr; - int Push = is64 ? X86::PUSH64r : X86::PUSH32r; - int PushF = is64 ? X86::PUSHF64 : X86::PUSHF32; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Apr 20 18:57:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18AC7F91F70; Fri, 20 Apr 2018 18:57:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB7BF7F629; Fri, 20 Apr 2018 18:57:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id h143-v6so3766745ita.4; Fri, 20 Apr 2018 11:57:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=slrl8SFk6amIK+OD6cMKVNugV26ixpS6hCGrL2jGXhg=; b=H+H2li7wGbJTx7NN3wD4Txdag8V+Bunyq07xNbDbPtbuuQ0RKYI6hmRlzUW0HIyoU7 2jVDIw2VOZx9aXBWQb/ZKv8QVMlpDwUXEvjto2MrR5fsOQ6nJ4lK3+7AK0RDLHNKq1Ty jOpGU9Ay6I8iORppDZ6EEL1QebnVsdrcKfMmtukDKBJG+8KZow7CD/BcXjCk0LGKMUUr JnbSpOZtT9cAIuhFhTx7FhqlkqGWg0OiAMnEuMSF4fLOeBT9XabbvA5+Qs/BGNA1V6UQ srAxL2FyKn4R6mMlSVS9O5eg5qScBmXzB8Q5ioP1Nn3o1pPGoZSltvuC5aipLs8RL2LX +8iw== X-Gm-Message-State: ALQs6tB9bfrYEiMclzKMxEcAkPmJGMUDe8t9iMQBPP1147Lr7sdNa30n 79Onyiw/7FpTfubvdiK4mQvbNaKT X-Google-Smtp-Source: AIpwx4++Uj2EfRDjstJyjjSWtenMi+eY44R/UXlgTYHkjHDyI5hF+shGcaqKvrM07GHsNKiBPzkuBw== X-Received: by 2002:a24:27c9:: with SMTP id g192-v6mr4238232ita.112.1524250218966; Fri, 20 Apr 2018 11:50:18 -0700 (PDT) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com. [209.85.214.51]) by smtp.gmail.com with ESMTPSA id b3-v6sm3255068iob.55.2018.04.20.11.50.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 11:50:18 -0700 (PDT) Received: by mail-it0-f51.google.com with SMTP id m134-v6so3754081itb.3; Fri, 20 Apr 2018 11:50:18 -0700 (PDT) X-Received: by 2002:a24:4090:: with SMTP id n138-v6mr4284583ita.135.1524250218541; Fri, 20 Apr 2018 11:50:18 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Fri, 20 Apr 2018 11:50:18 -0700 (PDT) In-Reply-To: <201804201138.w3KBcTou070611@repo.freebsd.org> References: <201804201138.w3KBcTou070611@repo.freebsd.org> From: Conrad Meyer Date: Fri, 20 Apr 2018 11:50:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332813 - head/sys/fs/nfsclient To: Rick Macklem Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 18:57:28 -0000 On Fri, Apr 20, 2018 at 4:38 AM, Rick Macklem wrote: > Author: rmacklem > Date: Fri Apr 20 11:38:29 2018 > New Revision: 332813 > URL: https://svnweb.freebsd.org/changeset/base/332813 > > Log: > Fix use of pointer after being set NULL. > > Using a pointer after setting it NULL is probably not a good plan. > Spotted by inspection during changes for Flexible File Layout Ioerr handling. > This code path obviously isn't normally executed. This is definitely the kind of thing that Coverity can catch. I would strongly encourage you to take a look at the Coverity scan output for nfsclient. There are a bunch of reports, many of which I have confirmed are valid. Best, Conrad From owner-svn-src-head@freebsd.org Fri Apr 20 19:37:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCEBAF9603B; Fri, 20 Apr 2018 19:37: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C926685BD; Fri, 20 Apr 2018 19:37:10 +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 733491C93A; Fri, 20 Apr 2018 19:37:10 +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 w3KJbAMA011734; Fri, 20 Apr 2018 19:37:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KJb8ZF011717; Fri, 20 Apr 2018 19:37:08 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804201937.w3KJb8ZF011717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 20 Apr 2018 19:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332839 - in head/sys/gnu/dts: arm include/dt-bindings/bus include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/memory include/dt-bindings/pi... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/bus include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/memory include/dt-bindings/pinctrl include/dt-bindings... X-SVN-Commit-Revision: 332839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 19:37:11 -0000 Author: manu Date: Fri Apr 20 19:37:08 2018 New Revision: 332839 URL: https://svnweb.freebsd.org/changeset/base/332839 Log: gnu/dts: Update our copy of arm dts from Linux 4.16 Added: head/sys/gnu/dts/arm/am572x-idk-common.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/am572x-idk-common.dtsi head/sys/gnu/dts/arm/am574x-idk.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/am574x-idk.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-witherspoon.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-zaius.dts head/sys/gnu/dts/arm/aspeed-bmc-quanta-q71l.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/aspeed-bmc-quanta-q71l.dts head/sys/gnu/dts/arm/at91-natte.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/at91-natte.dtsi head/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/at91-nattis-2-natte-2.dts head/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/at91-sama5d2_ptc_ek.dts head/sys/gnu/dts/arm/gemini-dlink-dns-313.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/gemini-dlink-dns-313.dts head/sys/gnu/dts/arm/imx28-ts4600.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx28-ts4600.dts head/sys/gnu/dts/arm/imx6dl-cubox-i-emmc-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-cubox-i-emmc-som-v15.dts head/sys/gnu/dts/arm/imx6dl-cubox-i-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-cubox-i-som-v15.dts head/sys/gnu/dts/arm/imx6dl-hummingboard-emmc-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-hummingboard-emmc-som-v15.dts head/sys/gnu/dts/arm/imx6dl-hummingboard-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-hummingboard-som-v15.dts head/sys/gnu/dts/arm/imx6dl-hummingboard2-emmc-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-hummingboard2-emmc-som-v15.dts head/sys/gnu/dts/arm/imx6dl-hummingboard2-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-hummingboard2-som-v15.dts head/sys/gnu/dts/arm/imx6dl-hummingboard2.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-hummingboard2.dts head/sys/gnu/dts/arm/imx6dl-ts7970.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6dl-ts7970.dts head/sys/gnu/dts/arm/imx6q-cubox-i-emmc-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-cubox-i-emmc-som-v15.dts head/sys/gnu/dts/arm/imx6q-cubox-i-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-cubox-i-som-v15.dts head/sys/gnu/dts/arm/imx6q-hummingboard-emmc-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-hummingboard-emmc-som-v15.dts head/sys/gnu/dts/arm/imx6q-hummingboard-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-hummingboard-som-v15.dts head/sys/gnu/dts/arm/imx6q-hummingboard2-emmc-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-hummingboard2-emmc-som-v15.dts head/sys/gnu/dts/arm/imx6q-hummingboard2-som-v15.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-hummingboard2-som-v15.dts head/sys/gnu/dts/arm/imx6q-hummingboard2.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-hummingboard2.dts head/sys/gnu/dts/arm/imx6q-ts7970.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-ts7970.dts head/sys/gnu/dts/arm/imx6q-var-dt6customboard.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6q-var-dt6customboard.dts head/sys/gnu/dts/arm/imx6qdl-hummingboard2-emmc.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-hummingboard2-emmc.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard2.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-hummingboard2.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som-brcm.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-sr-som-brcm.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som-emmc.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-sr-som-emmc.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som-ti.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-sr-som-ti.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-sr-som.dtsi head/sys/gnu/dts/arm/imx6qdl-ts7970.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-ts7970.dtsi head/sys/gnu/dts/arm/imx6qdl-var-dart.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx6qdl-var-dart.dtsi head/sys/gnu/dts/arm/imx7d-colibri-emmc-eval-v3.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx7d-colibri-emmc-eval-v3.dts head/sys/gnu/dts/arm/imx7d-colibri-emmc.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx7d-colibri-emmc.dtsi head/sys/gnu/dts/arm/imx7d-pico-pi.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx7d-pico-pi.dts head/sys/gnu/dts/arm/imx7d-pico.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/imx7d-pico.dtsi head/sys/gnu/dts/arm/logicpd-som-lv-35xx-devkit.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/logicpd-som-lv-35xx-devkit.dts head/sys/gnu/dts/arm/logicpd-som-lv-baseboard.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/logicpd-som-lv-baseboard.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-35xx-devkit.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/logicpd-torpedo-35xx-devkit.dts head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/logicpd-torpedo-baseboard.dtsi head/sys/gnu/dts/arm/ls1021a-moxa-uc-8410a.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/ls1021a-moxa-uc-8410a.dts head/sys/gnu/dts/arm/openbmc-flash-layout.dtsi - copied unchanged from r332836, vendor/device-tree/dist/src/arm/openbmc-flash-layout.dtsi head/sys/gnu/dts/arm/owl-s500-sparky.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/owl-s500-sparky.dts head/sys/gnu/dts/arm/ox810se-wd-mbwe.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/ox810se-wd-mbwe.dts head/sys/gnu/dts/arm/ox820-cloudengines-pogoplug-series-3.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/ox820-cloudengines-pogoplug-series-3.dts head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm-dbhd-ca.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/r8a7745-iwg22d-sodimm-dbhd-ca.dts head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-r1.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/sun8i-h2-plus-orangepi-r1.dts head/sys/gnu/dts/arm/sun8i-h3-libretech-all-h3-cc.dts - copied unchanged from r332836, vendor/device-tree/dist/src/arm/sun8i-h3-libretech-all-h3-cc.dts head/sys/gnu/dts/include/dt-bindings/bus/ - copied from r332836, vendor/device-tree/dist/include/dt-bindings/bus/ - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/am3.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/am4.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/aspeed-clock.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/axg-clkc.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/dm814.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/dm816.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/dra7.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/jz4770-cgu.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/omap5.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/clock/sprd,sc9860-clk.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/gpio/aspeed-gpio.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/gpio/meson-axg-gpio.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/memory/tegra186-mc.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/power/mt2712-power.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/power/owl-s700-powergate.h - copied unchanged from r332836, vendor/device-tree/dist/include/dt-bindings/reset/amlogic,meson-axg-reset.h Directory Properties: head/sys/gnu/dts/include/dt-bindings/clock/am3.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/am4.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/aspeed-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/axg-clkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/dm814.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/dm816.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/dra7.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/jz4770-cgu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/omap5.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sprd,sc9860-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/aspeed-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson-axg-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra186-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt2712-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/owl-s700-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-reset.h (props changed) Deleted: head/sys/gnu/dts/arm/cloudengines-pogoplug-series-3.dts head/sys/gnu/dts/arm/imx6qdl-microsom-ar8035.dtsi head/sys/gnu/dts/arm/imx6qdl-microsom.dtsi head/sys/gnu/dts/arm/imx7d-pico.dts head/sys/gnu/dts/arm/wd-mbwe.dts Modified: head/sys/gnu/dts/arm/am335x-bone-common.dtsi head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am335x-evm.dts head/sys/gnu/dts/arm/am335x-evmsk.dts head/sys/gnu/dts/arm/am335x-pepper.dts head/sys/gnu/dts/arm/am33xx-clocks.dtsi head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-idk-evm.dts head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am43xx-clocks.dtsi head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/animeo_ip.dts head/sys/gnu/dts/arm/arm-realview-eb-mp.dtsi head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-ariag25.dts head/sys/gnu/dts/arm/at91-ariettag25.dts head/sys/gnu/dts/arm/at91-cosino.dtsi head/sys/gnu/dts/arm/at91-foxg20.dts head/sys/gnu/dts/arm/at91-kizbox.dts head/sys/gnu/dts/arm/at91-kizbox2.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91-linea.dtsi head/sys/gnu/dts/arm/at91-qil_a9260.dts head/sys/gnu/dts/arm/at91-sam9_l9260.dts head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4_ma5d4.dtsi head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/at91-vinco.dts head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91rm9200ek.dts head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9260ek.dts head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi head/sys/gnu/dts/arm/at91sam9g25ek.dts head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5cm.dtsi head/sys/gnu/dts/arm/axp81x.dtsi head/sys/gnu/dts/arm/bcm11351.dtsi head/sys/gnu/dts/arm/bcm21664.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-a-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-a.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-plus.dts head/sys/gnu/dts/arm/bcm2835-rpi-b-rev2.dts head/sys/gnu/dts/arm/bcm2835-rpi-b.dts head/sys/gnu/dts/arm/bcm2835.dtsi head/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts head/sys/gnu/dts/arm/bcm2836.dtsi head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts head/sys/gnu/dts/arm/bcm2837.dtsi head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/dm814x-clocks.dtsi head/sys/gnu/dts/arm/dm814x.dtsi head/sys/gnu/dts/arm/dm816x-clocks.dtsi head/sys/gnu/dts/arm/dm816x.dtsi head/sys/gnu/dts/arm/dra62x-j5eco-evm.dts head/sys/gnu/dts/arm/dra7-evm-common.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra72-evm-common.dtsi head/sys/gnu/dts/arm/dra72-evm-tps65917.dtsi head/sys/gnu/dts/arm/dra72x.dtsi head/sys/gnu/dts/arm/dra74x.dtsi head/sys/gnu/dts/arm/dra76-evm.dts head/sys/gnu/dts/arm/dra7xx-clocks.dtsi head/sys/gnu/dts/arm/efm32gg-dk3750.dts head/sys/gnu/dts/arm/ethernut5.dts head/sys/gnu/dts/arm/exynos3250-artik5-eval.dts head/sys/gnu/dts/arm/exynos3250-artik5.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-pinctrl.dtsi head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4-cpu-thermal.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4210-smdkv310.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4412-itop-elite.dts head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-odroidu3.dts head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-odroidx2.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4412-ppmu-common.dtsi head/sys/gnu/dts/arm/exynos4412-prime.dtsi head/sys/gnu/dts/arm/exynos4412-smdk4412.dts head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5.dtsi head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5250-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5250-smdk5250.dts head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250-snow-rev5.dts head/sys/gnu/dts/arm/exynos5250-snow.dts head/sys/gnu/dts/arm/exynos5250-spring.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5260-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5260-xyref5260.dts head/sys/gnu/dts/arm/exynos5260.dtsi head/sys/gnu/dts/arm/exynos5410-odroidxu.dts head/sys/gnu/dts/arm/exynos5410-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5410-smdk5410.dts head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420-cpus.dtsi head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5420-smdk5420.dts head/sys/gnu/dts/arm/exynos5420-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/exynos5420-trip-points.dtsi head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-cpus.dtsi head/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi head/sys/gnu/dts/arm/exynos5422-odroidhc1.dts head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-lite.dts head/sys/gnu/dts/arm/exynos5422-odroidxu3.dts head/sys/gnu/dts/arm/exynos5422-odroidxu4.dts head/sys/gnu/dts/arm/exynos5440-sd5v1.dts head/sys/gnu/dts/arm/exynos5440-ssdk5440.dts head/sys/gnu/dts/arm/exynos5440-tmu-sensor-conf.dtsi head/sys/gnu/dts/arm/exynos5440-trip-points.dtsi head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/exynos54xx-odroidxu-leds.dtsi head/sys/gnu/dts/arm/exynos54xx.dtsi head/sys/gnu/dts/arm/ge863-pro3.dtsi head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts head/sys/gnu/dts/arm/gemini-nas4220b.dts head/sys/gnu/dts/arm/gemini-rut1xx.dts head/sys/gnu/dts/arm/gemini-wbd111.dts head/sys/gnu/dts/arm/gemini-wbd222.dts head/sys/gnu/dts/arm/gemini.dtsi head/sys/gnu/dts/arm/imx25.dtsi head/sys/gnu/dts/arm/imx27-pdk.dts head/sys/gnu/dts/arm/imx27-phytec-phycore-rdk.dts head/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi head/sys/gnu/dts/arm/imx28.dtsi head/sys/gnu/dts/arm/imx35.dtsi head/sys/gnu/dts/arm/imx51-babbage.dts head/sys/gnu/dts/arm/imx51-eukrea-mbimxsd51-baseboard.dts head/sys/gnu/dts/arm/imx51-ts4800.dts head/sys/gnu/dts/arm/imx51-zii-rdu1.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-cx9020.dts head/sys/gnu/dts/arm/imx53-m53.dtsi head/sys/gnu/dts/arm/imx53-tx53-x03x.dts head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts head/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx6dl-cubox-i.dts head/sys/gnu/dts/arm/imx6dl-hummingboard.dts head/sys/gnu/dts/arm/imx6dl-icore-rqs.dts head/sys/gnu/dts/arm/imx6dl-pinfunc.h head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-apalis-eval.dts head/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts head/sys/gnu/dts/arm/imx6q-apalis-ixora.dts head/sys/gnu/dts/arm/imx6q-b450v3.dts head/sys/gnu/dts/arm/imx6q-b650v3.dts head/sys/gnu/dts/arm/imx6q-b850v3.dts head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi head/sys/gnu/dts/arm/imx6q-cubox-i.dts head/sys/gnu/dts/arm/imx6q-display5.dtsi head/sys/gnu/dts/arm/imx6q-h100.dts head/sys/gnu/dts/arm/imx6q-hummingboard.dts head/sys/gnu/dts/arm/imx6q-pinfunc.h head/sys/gnu/dts/arm/imx6qdl-apalis.dtsi head/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos2.dtsi head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-cubox-i.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-udoo.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-sdb.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-colibri-eval-v3.dtsi head/sys/gnu/dts/arm/imx7-colibri.dtsi head/sys/gnu/dts/arm/imx7d-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx7d-colibri.dtsi head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/iwg20d-q7-common.dtsi head/sys/gnu/dts/arm/iwg20d-q7-dbcm-ca.dtsi head/sys/gnu/dts/arm/keystone-clocks.dtsi head/sys/gnu/dts/arm/keystone-k2e-clocks.dtsi head/sys/gnu/dts/arm/keystone-k2e-evm.dts head/sys/gnu/dts/arm/keystone-k2e-netcp.dtsi head/sys/gnu/dts/arm/keystone-k2e.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/keystone-k2g-ice.dts head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/keystone-k2hk-clocks.dtsi head/sys/gnu/dts/arm/keystone-k2hk-evm.dts head/sys/gnu/dts/arm/keystone-k2hk-netcp.dtsi head/sys/gnu/dts/arm/keystone-k2hk.dtsi head/sys/gnu/dts/arm/keystone-k2l-clocks.dtsi head/sys/gnu/dts/arm/keystone-k2l-evm.dts head/sys/gnu/dts/arm/keystone-k2l-netcp.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/keystone.dtsi head/sys/gnu/dts/arm/kirkwood-linksys-viper.dts head/sys/gnu/dts/arm/logicpd-som-lv-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/lpc3250-ea3250.dts head/sys/gnu/dts/arm/lpc3250-phy3250.dts head/sys/gnu/dts/arm/lpc4337-ciaa.dts head/sys/gnu/dts/arm/lpc4350-hitex-eval.dts head/sys/gnu/dts/arm/lpc4357-ea4357-devkit.dts head/sys/gnu/dts/arm/ls1021a-qds.dts head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/ls1021a.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/mpa1600.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts head/sys/gnu/dts/arm/mt7623n-rfb-nand.dts head/sys/gnu/dts/arm/omap2420-n8x0-common.dtsi head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi head/sys/gnu/dts/arm/omap3-evm-37xx.dts head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-igep.dtsi head/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi head/sys/gnu/dts/arm/omap3-n9.dts head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap3-n950.dts head/sys/gnu/dts/arm/omap3-pandora-common.dtsi head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap3430-sdp.dts head/sys/gnu/dts/arm/omap34xx.dtsi head/sys/gnu/dts/arm/omap36xx.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap44xx-clocks.dtsi head/sys/gnu/dts/arm/omap5-uevm.dts head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/omap54xx-clocks.dtsi head/sys/gnu/dts/arm/pm9g45.dts head/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts head/sys/gnu/dts/arm/r7s72100-genmai.dts head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts head/sys/gnu/dts/arm/r8a7740.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7778.dtsi head/sys/gnu/dts/arm/r8a7779.dtsi head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3066a-rayeager.dts head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/s3c2416-pinctrl.dtsi head/sys/gnu/dts/arm/s3c2416-smdk2416.dts head/sys/gnu/dts/arm/s3c2416.dtsi head/sys/gnu/dts/arm/s3c24xx.dtsi head/sys/gnu/dts/arm/s3c6400.dtsi head/sys/gnu/dts/arm/s3c6410-mini6410.dts head/sys/gnu/dts/arm/s3c6410-smdk6410.dts head/sys/gnu/dts/arm/s3c6410.dtsi head/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi head/sys/gnu/dts/arm/s3c64xx.dtsi head/sys/gnu/dts/arm/s5pv210-aquila.dts head/sys/gnu/dts/arm/s5pv210-goni.dts head/sys/gnu/dts/arm/s5pv210-pinctrl.dtsi head/sys/gnu/dts/arm/s5pv210-smdkc110.dts head/sys/gnu/dts/arm/s5pv210-smdkv210.dts head/sys/gnu/dts/arm/s5pv210-torbreck.dts head/sys/gnu/dts/arm/s5pv210.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d3_tcb1.dtsi head/sys/gnu/dts/arm/sama5d3xcm.dtsi head/sys/gnu/dts/arm/sama5d3xcm_cmp.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts head/sys/gnu/dts/arm/spear1310-evb.dts head/sys/gnu/dts/arm/spear1340.dtsi head/sys/gnu/dts/arm/spear13xx.dtsi head/sys/gnu/dts/arm/spear600.dtsi head/sys/gnu/dts/arm/ste-nomadik-stn8815.dtsi head/sys/gnu/dts/arm/stih407.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts head/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/tegra20.dtsi head/sys/gnu/dts/arm/tny_a9260_common.dtsi head/sys/gnu/dts/arm/tny_a9263.dts head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/usb_a9260_common.dtsi head/sys/gnu/dts/arm/usb_a9263.dts head/sys/gnu/dts/arm/vf-colibri-eval-v3.dtsi head/sys/gnu/dts/arm/vf500.dtsi head/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts head/sys/gnu/dts/arm/vf610-zii-dev.dtsi head/sys/gnu/dts/arm/vfxxx.dtsi head/sys/gnu/dts/arm/zx296702.dtsi head/sys/gnu/dts/include/dt-bindings/clock/hi3660-clock.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq8074.h head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32-pinfunc.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/include/dt-bindings/bus/ti-sysc.h (props changed) Modified: head/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-bone-common.dtsi Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am335x-bone-common.dtsi Fri Apr 20 19:37:08 2018 (r332839) @@ -409,6 +409,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&clkdiv32k_ick>; + clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -159,6 +159,7 @@ >; }; + /* UT0 */ uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */ @@ -166,6 +167,37 @@ >; }; + /* UT1 */ + uart1_pins: pinmux_uart1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* (D16) uart1_rxd.uart1_rxd */ + AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (D15) uart1_txd.uart1_txd */ + >; + }; + + /* GPS */ + uart2_pins: pinmux_uart2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE1) /* (A17) spi0_sclk.uart2_rxd */ + AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (B17) spi0_d0.uart2_txd */ + >; + }; + + /* DSM2 */ + uart4_pins: pinmux_uart4_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */ + >; + }; + + /* UT5 */ + uart5_pins: pinmux_uart5_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8C4, PIN_INPUT_PULLUP | MUX_MODE4) /* (U2) lcd_data9.uart5_rxd */ + AM33XX_IOPAD(0x8C0, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* (U1) lcd_data8.uart5_txd */ + >; + }; + mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* (C15) spi0_cs1.gpio0[6] */ @@ -216,10 +248,19 @@ wl18xx_pins: pinmux_wl18xx_pins { pinctrl-single,pins = < AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* (K18) gmii1_txclk.gpio3[9] - WL_EN */ - AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (H18) rmii1_refclk.gpio0[29] - WL_IRQ */ + AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (K16) gmii1_txd1.gpio0[21] - WL_IRQ */ AM33XX_IOPAD(0x930, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (L18) gmii1_rxclk.gpio3[10] - LS_BUF_EN */ >; }; + + /* DCAN */ + dcan1_pins: pinmux_dcan1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x96c, PIN_INPUT | MUX_MODE2) /* (E17) uart0_rtsn.dcan1_rx */ + AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE2) /* (E18) uart0_ctsn.dcan1_tx */ + AM33XX_IOPAD(0x940, PIN_OUTPUT | MUX_MODE7) /* (M16) gmii1_rxd0.gpio2[21] */ + >; + }; }; &uart0 { @@ -229,6 +270,34 @@ status = "okay"; }; +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + + status = "okay"; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins>; + + status = "okay"; +}; + +&uart5 { + pinctrl-names = "default"; + pinctrl-0 = <&uart5_pins>; + + status = "okay"; +}; + &usb { status = "okay"; }; @@ -414,7 +483,7 @@ compatible = "ti,wl1835"; reg = <2>; interrupt-parent = <&gpio0>; - interrupts = <29 IRQ_TYPE_EDGE_RISING>; + interrupts = <21 IRQ_TYPE_EDGE_RISING>; }; }; @@ -446,8 +515,14 @@ &rtc { system-power-controller; - clocks = <&clk_32768_ck>, <&clkdiv32k_ick>; + clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; +}; + +&dcan1 { + pinctrl-names = "default"; + pinctrl-0 = <&dcan1_pins>; + status = "okay"; }; &gpio3 { Modified: head/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evm.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am335x-evm.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -790,6 +790,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&clkdiv32k_ick>; + clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: head/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evmsk.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am335x-evmsk.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -722,6 +722,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&clkdiv32k_ick>; + clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: head/sys/gnu/dts/arm/am335x-pepper.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-pepper.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am335x-pepper.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -139,7 +139,7 @@ &audio_codec { status = "okay"; - gpio-reset = <&gpio1 16 GPIO_ACTIVE_LOW>; + reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; AVDD-supply = <&ldo3_reg>; IOVDD-supply = <&ldo3_reg>; DRVDD-supply = <&ldo3_reg>; Modified: head/sys/gnu/dts/arm/am33xx-clocks.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-clocks.dtsi Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am33xx-clocks.dtsi Fri Apr 20 19:37:08 2018 (r332839) @@ -292,14 +292,6 @@ clock-div = <4>; }; - cefuse_fck: cefuse_fck@a20 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&sys_clkin_ck>; - ti,bit-shift = <1>; - reg = <0x0a20>; - }; - clk_24mhz: clk_24mhz { #clock-cells = <0>; compatible = "fixed-factor-clock"; @@ -316,14 +308,6 @@ clock-div = <732>; }; - clkdiv32k_ick: clkdiv32k_ick@14c { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ck>; - ti,bit-shift = <1>; - reg = <0x014c>; - }; - l3_gclk: l3_gclk { #clock-cells = <0>; compatible = "fixed-factor-clock"; @@ -350,49 +334,49 @@ timer1_fck: timer1_fck@528 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&sys_clkin_ck>, <&clkdiv32k_ick>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>; + clocks = <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>; reg = <0x0528>; }; timer2_fck: timer2_fck@508 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x0508>; }; timer3_fck: timer3_fck@50c { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x050c>; }; timer4_fck: timer4_fck@510 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x0510>; }; timer5_fck: timer5_fck@518 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x0518>; }; timer6_fck: timer6_fck@51c { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x051c>; }; timer7_fck: timer7_fck@504 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x0504>; }; @@ -423,7 +407,7 @@ wdt1_fck: wdt1_fck@538 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&clk_rc32k_ck>, <&clkdiv32k_ick>; + clocks = <&clk_rc32k_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x0538>; }; @@ -493,42 +477,10 @@ gpio0_dbclk_mux_ck: gpio0_dbclk_mux_ck@53c { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&clkdiv32k_ick>; + clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; reg = <0x053c>; }; - gpio0_dbclk: gpio0_dbclk@408 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&gpio0_dbclk_mux_ck>; - ti,bit-shift = <18>; - reg = <0x0408>; - }; - - gpio1_dbclk: gpio1_dbclk@ac { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <18>; - reg = <0x00ac>; - }; - - gpio2_dbclk: gpio2_dbclk@b0 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <18>; - reg = <0x00b0>; - }; - - gpio3_dbclk: gpio3_dbclk@b4 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <18>; - reg = <0x00b4>; - }; - lcd_gclk: lcd_gclk@534 { #clock-cells = <0>; compatible = "ti,mux-clock"; @@ -577,70 +529,97 @@ reg = <0x0700>; }; - dbg_sysclk_ck: dbg_sysclk_ck@414 { + clkout2_ck: clkout2_ck@700 { #clock-cells = <0>; compatible = "ti,gate-clock"; - clocks = <&sys_clkin_ck>; - ti,bit-shift = <19>; - reg = <0x0414>; + clocks = <&clkout2_div_ck>; + ti,bit-shift = <7>; + reg = <0x0700>; }; +}; - dbg_clka_ck: dbg_clka_ck@414 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&dpll_core_m4_ck>; - ti,bit-shift = <30>; - reg = <0x0414>; - }; +&prcm { + l4_per_cm: l4_per_cm@0 { + compatible = "ti,omap4-cm"; + reg = <0x0 0x200>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x0 0x200>; - stm_pmd_clock_mux_ck: stm_pmd_clock_mux_ck@414 { - #clock-cells = <0>; - compatible = "ti,mux-clock"; - clocks = <&dbg_sysclk_ck>, <&dbg_clka_ck>; - ti,bit-shift = <22>; - reg = <0x0414>; + l4_per_clkctrl: clk@14 { + compatible = "ti,clkctrl"; + reg = <0x14 0x13c>; + #clock-cells = <2>; + }; }; - trace_pmd_clk_mux_ck: trace_pmd_clk_mux_ck@414 { - #clock-cells = <0>; - compatible = "ti,mux-clock"; - clocks = <&dbg_sysclk_ck>, <&dbg_clka_ck>; - ti,bit-shift = <20>; - reg = <0x0414>; + l4_wkup_cm: l4_wkup_cm@400 { + compatible = "ti,omap4-cm"; + reg = <0x400 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x400 0x100>; + + l4_wkup_clkctrl: clk@4 { + compatible = "ti,clkctrl"; + reg = <0x4 0xd4>; + #clock-cells = <2>; + }; }; - stm_clk_div_ck: stm_clk_div_ck@414 { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&stm_pmd_clock_mux_ck>; - ti,bit-shift = <27>; - ti,max-div = <64>; - reg = <0x0414>; - ti,index-power-of-two; + mpu_cm: mpu_cm@600 { + compatible = "ti,omap4-cm"; + reg = <0x600 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x600 0x100>; + + mpu_clkctrl: clk@4 { + compatible = "ti,clkctrl"; + reg = <0x4 0x4>; + #clock-cells = <2>; + }; }; - trace_clk_div_ck: trace_clk_div_ck@414 { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&trace_pmd_clk_mux_ck>; - ti,bit-shift = <24>; - ti,max-div = <64>; - reg = <0x0414>; - ti,index-power-of-two; + l4_rtc_cm: l4_rtc_cm@800 { + compatible = "ti,omap4-cm"; + reg = <0x800 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x800 0x100>; + + l4_rtc_clkctrl: clk@0 { + compatible = "ti,clkctrl"; + reg = <0x0 0x4>; + #clock-cells = <2>; + }; }; - clkout2_ck: clkout2_ck@700 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkout2_div_ck>; - ti,bit-shift = <7>; - reg = <0x0700>; + gfx_l3_cm: gfx_l3_cm@900 { + compatible = "ti,omap4-cm"; + reg = <0x900 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x900 0x100>; + + gfx_l3_clkctrl: clk@4 { + compatible = "ti,clkctrl"; + reg = <0x4 0x4>; + #clock-cells = <2>; + }; }; -}; -&prcm_clockdomains { - clk_24mhz_clkdm: clk_24mhz_clkdm { - compatible = "ti,clockdomain"; - clocks = <&clkdiv32k_ick>; + l4_cefuse_cm: l4_cefuse_cm@a00 { + compatible = "ti,omap4-cm"; + reg = <0xa00 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xa00 0x100>; + + l4_cefuse_clkctrl: clk@20 { + compatible = "ti,clkctrl"; + reg = <0x20 0x4>; + #clock-cells = <2>; + }; }; }; Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am33xx.dtsi Fri Apr 20 19:37:08 2018 (r332839) @@ -10,6 +10,7 @@ #include #include +#include / { compatible = "ti,am33xx"; @@ -179,8 +180,11 @@ }; prcm: prcm@200000 { - compatible = "ti,am3-prcm"; + compatible = "ti,am3-prcm", "simple-bus"; reg = <0x200000 0x4000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x200000 0x4000>; prcm_clocks: clocks { #address-cells = <1>; @@ -496,7 +500,7 @@ status = "disabled"; }; - mailbox: mailbox@480C8000 { + mailbox: mailbox@480c8000 { compatible = "ti,omap4-mailbox"; reg = <0x480C8000 0x200>; interrupts = <77>; @@ -517,6 +521,8 @@ interrupts = <67>; ti,hwmods = "timer1"; ti,timer-alwon; + clocks = <&timer1_fck>; + clock-names = "fck"; }; timer2: timer@48040000 { @@ -524,6 +530,8 @@ reg = <0x48040000 0x400>; interrupts = <68>; ti,hwmods = "timer2"; + clocks = <&timer2_fck>; + clock-names = "fck"; }; timer3: timer@48042000 { @@ -571,7 +579,7 @@ interrupts = <75 76>; ti,hwmods = "rtc"; - clocks = <&clkdiv32k_ick>; + clocks = <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; clock-names = "int-clk"; }; @@ -991,7 +999,7 @@ dma-names = "tx", "rx"; }; - mcasp1: mcasp@4803C000 { + mcasp1: mcasp@4803c000 { compatible = "ti,am33xx-mcasp-audio"; ti,hwmods = "mcasp1"; reg = <0x4803C000 0x2000>, @@ -1014,4 +1022,4 @@ }; }; -/include/ "am33xx-clocks.dtsi" +#include "am33xx-clocks.dtsi" Modified: head/sys/gnu/dts/arm/am3517.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am3517.dtsi Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am3517.dtsi Fri Apr 20 19:37:08 2018 (r332839) @@ -26,7 +26,7 @@ interrupt-names = "mc"; }; - davinci_emac: ethernet@0x5c000000 { + davinci_emac: ethernet@5c000000 { compatible = "ti,am3517-emac"; ti,hwmods = "davinci_emac"; status = "disabled"; @@ -41,7 +41,7 @@ local-mac-address = [ 00 00 00 00 00 00 ]; }; - davinci_mdio: ethernet@0x5c030000 { + davinci_mdio: ethernet@5c030000 { compatible = "ti,davinci_mdio"; ti,hwmods = "davinci_mdio"; status = "disabled"; @@ -96,10 +96,6 @@ }; &mmu_isp { - status = "disabled"; -}; - -&smartreflex_mpu_iva { status = "disabled"; }; Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am4372.dtsi Fri Apr 20 19:37:08 2018 (r332839) @@ -10,6 +10,7 @@ #include #include +#include / { compatible = "ti,am4372", "ti,am43"; @@ -163,9 +164,12 @@ }; prcm: prcm@1f0000 { - compatible = "ti,am4-prcm"; + compatible = "ti,am4-prcm", "simple-bus"; reg = <0x1f0000 0x11000>; interrupts = ; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1f0000 0x11000>; prcm_clocks: clocks { #address-cells = <1>; @@ -325,7 +329,7 @@ status = "disabled"; }; - mailbox: mailbox@480C8000 { + mailbox: mailbox@480c8000 { compatible = "ti,omap4-mailbox"; reg = <0x480C8000 0x200>; interrupts = ; @@ -346,6 +350,8 @@ interrupts = ; ti,timer-alwon; ti,hwmods = "timer1"; + clocks = <&timer1_fck>; + clock-names = "fck"; }; timer2: timer@48040000 { @@ -353,6 +359,8 @@ reg = <0x48040000 0x400>; interrupts = ; ti,hwmods = "timer2"; + clocks = <&timer2_fck>; + clock-names = "fck"; }; timer3: timer@48042000 { @@ -936,7 +944,7 @@ dma-names = "tx", "rx"; }; - mcasp1: mcasp@4803C000 { + mcasp1: mcasp@4803c000 { compatible = "ti,am33xx-mcasp-audio"; ti,hwmods = "mcasp1"; reg = <0x4803C000 0x2000>, @@ -993,7 +1001,7 @@ reg = <0x483a8000 0x8000>; syscon-phy-power = <&scm_conf 0x620>; clocks = <&usb_phy0_always_on_clk32k>, - <&usb_otg_ss0_refclk960m>; + <&l4_per_clkctrl AM4_USB_OTG_SS0_CLKCTRL 8>; clock-names = "wkupclk", "refclk"; #phy-cells = <0>; status = "disabled"; @@ -1012,7 +1020,7 @@ reg = <0x483e8000 0x8000>; syscon-phy-power = <&scm_conf 0x628>; clocks = <&usb_phy1_always_on_clk32k>, - <&usb_otg_ss1_refclk960m>; + <&l4_per_clkctrl AM4_USB_OTG_SS1_CLKCTRL 8>; clock-names = "wkupclk", "refclk"; #phy-cells = <0>; status = "disabled"; @@ -1175,4 +1183,4 @@ }; }; -/include/ "am43xx-clocks.dtsi" +#include "am43xx-clocks.dtsi" Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -55,7 +55,7 @@ enable-active-high; }; - backlight { + lcd_bl: backlight { compatible = "pwm-backlight"; pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>; brightness-levels = <0 51 53 56 62 75 101 152 255>; @@ -85,6 +85,8 @@ lcd0: display { compatible = "osddisplays,osd057T0559-34ts", "panel-dpi"; label = "lcd"; + + backlight = <&lcd_bl>; panel-timing { clock-frequency = <33000000>; Modified: head/sys/gnu/dts/arm/am437x-idk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-idk-evm.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am437x-idk-evm.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -519,3 +519,17 @@ &cpu { cpu0-supply = <&tps>; }; + +&cpu0_opp_table { + /* + * Supply voltage supervisor on board will not allow opp50 so + * disable it and set opp100 as suspend OPP. + */ + opp50@300000000 { + status = "disabled"; + }; + + opp100@600000000 { + opp-suspend; + }; +}; Modified: head/sys/gnu/dts/arm/am437x-sk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-sk-evm.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am437x-sk-evm.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -35,7 +35,7 @@ clock-frequency = <32768>; }; - backlight { + lcd_bl: backlight { compatible = "pwm-backlight"; pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>; brightness-levels = <0 51 53 56 62 75 101 152 255>; @@ -131,6 +131,8 @@ pinctrl-names = "default"; pinctrl-0 = <&lcd_pins>; + + backlight = <&lcd_bl>; enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -48,6 +48,8 @@ compatible = "osddisplays,osd057T0559-34ts", "panel-dpi"; label = "lcd"; + backlight = <&lcd_bl>; + panel-timing { clock-frequency = <33000000>; hactive = <800>; @@ -107,7 +109,7 @@ 0x03030069>; /* LEFT */ }; - backlight { + lcd_bl: backlight { compatible = "pwm-backlight"; pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>; brightness-levels = <0 51 53 56 62 75 101 152 255>; @@ -985,7 +987,11 @@ rx-num-evt = <32>; }; -&synctimer_32kclk { +&mux_synctimer32k_ck { assigned-clocks = <&mux_synctimer32k_ck>; assigned-clock-parents = <&clkdiv32k_ick>; +}; + +&cpu { + cpu0-supply = <&dcdc2>; }; Modified: head/sys/gnu/dts/arm/am43xx-clocks.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am43xx-clocks.dtsi Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am43xx-clocks.dtsi Fri Apr 20 19:37:08 2018 (r332839) @@ -524,54 +524,6 @@ reg = <0x4240>; }; - gpio0_dbclk: gpio0_dbclk@2b68 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&gpio0_dbclk_mux_ck>; - ti,bit-shift = <8>; - reg = <0x2b68>; - }; - - gpio1_dbclk: gpio1_dbclk@8c78 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <8>; - reg = <0x8c78>; - }; - - gpio2_dbclk: gpio2_dbclk@8c80 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <8>; - reg = <0x8c80>; - }; - - gpio3_dbclk: gpio3_dbclk@8c88 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <8>; - reg = <0x8c88>; - }; - - gpio4_dbclk: gpio4_dbclk@8c90 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <8>; - reg = <0x8c90>; - }; - - gpio5_dbclk: gpio5_dbclk@8c98 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkdiv32k_ick>; - ti,bit-shift = <8>; - reg = <0x8c98>; - }; - mmc_clk: mmc_clk { #clock-cells = <0>; compatible = "fixed-factor-clock"; @@ -629,14 +581,6 @@ reg = <0x4230>; }; - synctimer_32kclk: synctimer_32kclk@2a30 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&mux_synctimer32k_ck>; - ti,bit-shift = <8>; - reg = <0x2a30>; - }; - timer8_fck: timer8_fck@421c { #clock-cells = <0>; compatible = "ti,mux-clock"; @@ -763,110 +707,76 @@ ti,bit-shift = <8>; reg = <0x2a48>; }; +}; - usb_otg_ss0_refclk960m: usb_otg_ss0_refclk960m@8a60 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&dpll_per_clkdcoldo>; - ti,bit-shift = <8>; - reg = <0x8a60>; - }; +&prcm { + l4_wkup_cm: l4_wkup_cm@2800 { + compatible = "ti,omap4-cm"; + reg = <0x2800 0x400>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x2800 0x400>; - usb_otg_ss1_refclk960m: usb_otg_ss1_refclk960m@8a68 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&dpll_per_clkdcoldo>; - ti,bit-shift = <8>; - reg = <0x8a68>; + l4_wkup_clkctrl: clk@20 { + compatible = "ti,clkctrl"; + reg = <0x20 0x34c>; + #clock-cells = <2>; + }; }; - clkout1_osc_div_ck: clkout1_osc_div_ck { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&sys_clkin_ck>; - ti,bit-shift = <20>; - ti,max-div = <4>; - reg = <0x4100>; - }; + mpu_cm: mpu_cm@8300 { + compatible = "ti,omap4-cm"; + reg = <0x8300 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x8300 0x100>; - clkout1_src2_mux_ck: clkout1_src2_mux_ck { - #clock-cells = <0>; - compatible = "ti,mux-clock"; - clocks = <&clk_rc32k_ck>, <&sysclk_div>, <&dpll_ddr_m2_ck>, - <&dpll_per_m2_ck>, <&dpll_disp_m2_ck>, - <&dpll_mpu_m2_ck>; - reg = <0x4100>; + mpu_clkctrl: clk@20 { + compatible = "ti,clkctrl"; + reg = <0x20 0x4>; + #clock-cells = <2>; + }; }; - clkout1_src2_pre_div_ck: clkout1_src2_pre_div_ck { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&clkout1_src2_mux_ck>; - ti,bit-shift = <4>; - ti,max-div = <8>; - reg = <0x4100>; - }; + gfx_l3_cm: gfx_l3_cm@8400 { + compatible = "ti,omap4-cm"; + reg = <0x8400 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x8400 0x100>; - clkout1_src2_post_div_ck: clkout1_src2_post_div_ck { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&clkout1_src2_pre_div_ck>; - ti,bit-shift = <8>; - ti,max-div = <32>; - ti,index-power-of-two; - reg = <0x4100>; + gfx_l3_clkctrl: clk@20 { + compatible = "ti,clkctrl"; + reg = <0x20 0x4>; + #clock-cells = <2>; + }; }; - clkout1_mux_ck: clkout1_mux_ck { - #clock-cells = <0>; - compatible = "ti,mux-clock"; - clocks = <&clkout1_osc_div_ck>, <&clk_rc32k_ck>, - <&clkout1_src2_post_div_ck>, <&dpll_extdev_m2_ck>; - ti,bit-shift = <16>; - reg = <0x4100>; - }; + l4_rtc_cm: l4_rtc_cm@8500 { + compatible = "ti,omap4-cm"; + reg = <0x8500 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x8500 0x100>; - clkout1_ck: clkout1_ck { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkout1_mux_ck>; - ti,bit-shift = <23>; - reg = <0x4100>; + l4_rtc_clkctrl: clk@20 { + compatible = "ti,clkctrl"; + reg = <0x20 0x4>; + #clock-cells = <2>; + }; }; - clkout2_src_mux_ck: clkout2_src_mux_ck { - #clock-cells = <0>; - compatible = "ti,mux-clock"; - clocks = <&clk_rc32k_ck>, <&sysclk_div>, <&dpll_ddr_m2_ck>, - <&dpll_per_m2_ck>, <&dpll_disp_m2_ck>, - <&dpll_mpu_m2_ck>, <&dpll_extdev_ck>; - reg = <0x4108>; - }; + l4_per_cm: l4_per_cm@8800 { + compatible = "ti,omap4-cm"; + reg = <0x8800 0xc00>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x8800 0xc00>; - clkout2_pre_div_ck: clkout2_pre_div_ck { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&clkout2_src_mux_ck>; - ti,bit-shift = <4>; - ti,max-div = <8>; - reg = <0x4108>; - }; - - clkout2_post_div_ck: clkout2_post_div_ck { - #clock-cells = <0>; - compatible = "ti,divider-clock"; - clocks = <&clkout2_pre_div_ck>; - ti,bit-shift = <8>; - ti,max-div = <32>; - ti,index-power-of-two; - reg = <0x4108>; - }; - - clkout2_ck: clkout2_ck { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&clkout2_post_div_ck>; - ti,bit-shift = <16>; - reg = <0x4108>; + l4_per_clkctrl: clk@20 { + compatible = "ti,clkctrl"; + reg = <0x20 0xb04>; + #clock-cells = <2>; + }; }; }; Modified: head/sys/gnu/dts/arm/am571x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am571x-idk.dts Fri Apr 20 18:46:06 2018 (r332838) +++ head/sys/gnu/dts/arm/am571x-idk.dts Fri Apr 20 19:37:08 2018 (r332839) @@ -117,3 +117,7 @@ pinctrl-1 = <&mmc2_pins_hs>; pinctrl-2 = <&mmc2_pins_ddr_rev20 &mmc2_iodelay_ddr_conf>; }; + +&cpu0 { + vdd-supply = <&smps12_reg>; +}; Copied: head/sys/gnu/dts/arm/am572x-idk-common.dtsi (from r332836, vendor/device-tree/dist/src/arm/am572x-idk-common.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am572x-idk-common.dtsi Fri Apr 20 19:37:08 2018 (r332839, copy of r332836, vendor/device-tree/dist/src/arm/am572x-idk-common.dtsi) @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + */ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Apr 20 20:30:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15DD1F9E581; Fri, 20 Apr 2018 20:30:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFA11734AA; Fri, 20 Apr 2018 20:30:33 +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 B662D1D18B; Fri, 20 Apr 2018 20:30:33 +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 w3KKUXcn037051; Fri, 20 Apr 2018 20:30:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KKUXHs037049; Fri, 20 Apr 2018 20:30:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804202030.w3KKUXHs037049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 20 Apr 2018 20:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332843 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 332843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 20:30:34 -0000 Author: manu Date: Fri Apr 20 20:30:33 2018 New Revision: 332843 URL: https://svnweb.freebsd.org/changeset/base/332843 Log: regulator: Check status before disabling When disabling regulator when they are unused, check before is they are enabled. While here don't check the enable_cnt on the regulator entry as it is checked by regnode_stop. This solve the panic on any board using a fixed regulator that is driven by a gpio when the regulator is unused. Tested On: OrangePi One Pointy Hat to: myself Reported by: kevans, Milan Obuch (freebsd-arm@dino.sk) Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Fri Apr 20 20:18:10 2018 (r332842) +++ head/sys/dev/extres/regulator/regulator.c Fri Apr 20 20:30:33 2018 (r332843) @@ -166,17 +166,19 @@ static void regulator_shutdown(void *dummy) { struct regnode *entry; + int status, ret; int disable = 1; REG_TOPO_SLOCK(); TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable); TAILQ_FOREACH(entry, ®node_list, reglist_link) { - if (entry->enable_cnt == 0 && - entry->std_param.always_on == 0 && disable) { + if (entry->std_param.always_on == 0 && disable) { if (bootverbose) printf("regulator: shuting down %s\n", entry->name); - regnode_stop(entry, 0); + ret = regnode_status(entry, &status); + if (ret == 0 && status == REGULATOR_STATUS_ENABLED) + regnode_stop(entry, 0); } } REG_TOPO_UNLOCK(); From owner-svn-src-head@freebsd.org Fri Apr 20 20:35:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA88F9ECB4; Fri, 20 Apr 2018 20:35:51 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FDF573D96; Fri, 20 Apr 2018 20:35:50 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-f175.google.com with SMTP id q3-v6so16021712wrj.6; Fri, 20 Apr 2018 13:35:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YXyIurVF9nW8x6gh3Gozy+aDxM/rCgxGP7hJaALbEUw=; b=eFdnp8cp/ywplAcA0hHQZ4LMgIBPjK3kGtcRymcBGE3EY9k6/JywW6ipzEY3qOo7DF iIgEk/k9lWJlns2Ywdqx1QP3H/dJD0nPlbyYWcaR4KQ2SmmUTm4kxDHiKaAojATOteZU ePUpBU5PqijXMK6XhjFX+Dup0R4HrUl1dKf8iu9XrQHsI0NLyLfo8ytLGXhd312VYAQd Vp6epBdo09xIvuTP7IKpLumiIj9EKnoVABYYn3la9z9Esb7l6ccVuFEWF/3VuXDenhLF wtYa8XR3PHnPaBkkFafKUp/58lvIL26IX05397/o8OFcKVyE8inmyic1lerMexXaqN5O oYdw== X-Gm-Message-State: ALQs6tDty7k6AFQrmH/d0/5+7Dbn1aKJ/FVnsHV4QU0uofv+mNs4M27l EBOAf2OYa6wmPefOvpCT9zrM0LKg X-Google-Smtp-Source: AIpwx4/rjhpyYqokKURVxH2OfwyoKhN/SGCFPXgTFltZUp7TjFGvIJU9kAVBuFfBG7XeGwnxjS9TbA== X-Received: by 10.80.167.4 with SMTP id h4mr15804326edc.239.1524256544394; Fri, 20 Apr 2018 13:35:44 -0700 (PDT) Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com. [209.85.128.182]) by smtp.gmail.com with ESMTPSA id o6sm3993416edj.31.2018.04.20.13.35.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 13:35:44 -0700 (PDT) Received: by mail-wr0-f182.google.com with SMTP id h3-v6so26063469wrh.5; Fri, 20 Apr 2018 13:35:44 -0700 (PDT) X-Received: by 2002:adf:ab56:: with SMTP id r22-v6mr9434526wrc.228.1524256544095; Fri, 20 Apr 2018 13:35:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Fri, 20 Apr 2018 13:35:43 -0700 (PDT) In-Reply-To: <201804201820.w3KIKthB073527@repo.freebsd.org> References: <201804201820.w3KIKthB073527@repo.freebsd.org> From: "Jonathan T. Looney" Date: Fri, 20 Apr 2018 16:35:43 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332833 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 20:35:52 -0000 On Fri, Apr 20, 2018 at 2:20 PM, Dimitry Andric wrote: > > Author: dim > Date: Fri Apr 20 18:20:55 2018 > New Revision: 332833 > URL: https://svnweb.freebsd.org/changeset/base/332833 > > Log: > Recommit r332501, with an additional upstream fix for "Cannot lower > EFLAGS copy that lives out of a basic block!" errors on i386. > > [...] > > Together, these should ensure clang does not use pushf/popf sequences to > save and restore flags, avoiding problems with unrelated flags (such as > the interrupt flag) being restored unexpectedly. > > Requested by: jtl > PR: 225330 > MFC after: 1 week Thanks (again)! Jonathan From owner-svn-src-head@freebsd.org Fri Apr 20 22:23:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC53FA78E1; Fri, 20 Apr 2018 22:23:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E38076D947; Fri, 20 Apr 2018 22:23:38 +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 DE70E1E455; Fri, 20 Apr 2018 22:23:38 +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 w3KMNcHA096235; Fri, 20 Apr 2018 22:23:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3KMNcnT096231; Fri, 20 Apr 2018 22:23:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804202223.w3KMNcnT096231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Apr 2018 22:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332844 - in head/usr.sbin/makefs: . cd9660 ffs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.sbin/makefs: . cd9660 ffs X-SVN-Commit-Revision: 332844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2018 22:23:39 -0000 Author: emaste Date: Fri Apr 20 22:23:38 2018 New Revision: 332844 URL: https://svnweb.freebsd.org/changeset/base/332844 Log: makefs: tidy up reach-over source - cd9660 relies on an #include "iso.h" but does not build any .c files out of source, so remove reach-over .PATH - ffs does not rely on any sys/ headers, so remove -I from CFLAGS. - ffs_tables from sys/ is used by ffs; move the SRCS entry from the top- level Makefile to ffs' Makefile.inc. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/Makefile head/usr.sbin/makefs/cd9660/Makefile.inc head/usr.sbin/makefs/ffs/Makefile.inc Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Fri Apr 20 20:30:33 2018 (r332843) +++ head/usr.sbin/makefs/Makefile Fri Apr 20 22:23:38 2018 (r332844) @@ -29,9 +29,6 @@ SRCS+= getid.c misc.c spec.c CFLAGS+=-I${SRCTOP}/contrib/mknod SRCS+= pack_dev.c -.PATH: ${SRCTOP}/sys/ufs/ffs -SRCS+= ffs_tables.c - CFLAGS+= -I${SRCTOP}/lib/libnetbsd LIBADD= netbsd util sbuf Modified: head/usr.sbin/makefs/cd9660/Makefile.inc ============================================================================== --- head/usr.sbin/makefs/cd9660/Makefile.inc Fri Apr 20 20:30:33 2018 (r332843) +++ head/usr.sbin/makefs/cd9660/Makefile.inc Fri Apr 20 22:23:38 2018 (r332844) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.PATH: ${SRCDIR}/cd9660 ${SRCTOP}/sys/fs/cd9660/ +.PATH: ${SRCDIR}/cd9660 CFLAGS+=-I${SRCTOP}/sys/fs/cd9660/ Modified: head/usr.sbin/makefs/ffs/Makefile.inc ============================================================================== --- head/usr.sbin/makefs/ffs/Makefile.inc Fri Apr 20 20:30:33 2018 (r332843) +++ head/usr.sbin/makefs/ffs/Makefile.inc Fri Apr 20 22:23:38 2018 (r332844) @@ -2,8 +2,8 @@ # .PATH: ${SRCDIR}/ffs ${SRCTOP}/sys/ufs/ffs - -CFLAGS+= -I${SRCTOP}/sys/ufs/ffs - SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c SRCS+= buf.c mkfs.c + +# Reach-over source from sys/ufs/ffs +SRCS+= ffs_tables.c From owner-svn-src-head@freebsd.org Sat Apr 21 00:34:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84526FAF72F; Sat, 21 Apr 2018 00:34:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 386DB6BB9F; Sat, 21 Apr 2018 00:34:47 +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 2C5FE1F8B9; Sat, 21 Apr 2018 00:34:47 +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 w3L0Ykwt061068; Sat, 21 Apr 2018 00:34:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3L0Yk1L061067; Sat, 21 Apr 2018 00:34:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804210034.w3L0Yk1L061067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 21 Apr 2018 00:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332849 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Commit-Revision: 332849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 00:34:47 -0000 Author: emaste Date: Sat Apr 21 00:34:46 2018 New Revision: 332849 URL: https://svnweb.freebsd.org/changeset/base/332849 Log: lldb: propagate error to user if memory read fails Previously, an attempt to read an unreadable access reported zeros: (lldb) memory read -format hex -size 8 0 0x00000000: 0x0000000000000000 0x0000000000000000 0x00000010: 0x0000000000000000 0x0000000000000000 ... Now, if DoReadMemory encounters error then return 0 (bytes read) so we report the error to the user: (lldb) memory read -format hex -size 8 0 error: Bad address LLVM PR: 37190 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Sat Apr 21 00:27:35 2018 (r332848) +++ head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Sat Apr 21 00:34:46 2018 (r332849) @@ -163,8 +163,10 @@ static size_t DoReadMemory(lldb::pid_t pid, lldb::addr pi_desc.piod_addr = buf; pi_desc.piod_len = size; - if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) + if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) { error.SetErrorToErrno(); + return 0; + } return pi_desc.piod_len; } From owner-svn-src-head@freebsd.org Sat Apr 21 01:02:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B56B9FB14C7; Sat, 21 Apr 2018 01:02:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF3896FF46; Sat, 21 Apr 2018 01:02:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A98BC1FD68; Sat, 21 Apr 2018 01:02:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3L12Zwt075849; Sat, 21 Apr 2018 01:02:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3L12ZUg075848; Sat, 21 Apr 2018 01:02:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804210102.w3L12ZUg075848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 21 Apr 2018 01:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332850 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 01:02:36 -0000 Author: kevans Date: Sat Apr 21 01:02:35 2018 New Revision: 332850 URL: https://svnweb.freebsd.org/changeset/base/332850 Log: bsdgrep: Some light cleanup There's no point checking for a bunch of file modes if we're not a practicing believer of DIR_SKIP or DEV_SKIP. This also reduces some style violations that were particularly ugly looking when browsing through. Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sat Apr 21 00:34:46 2018 (r332849) +++ head/usr.bin/grep/util.c Sat Apr 21 01:02:35 2018 (r332850) @@ -308,14 +308,14 @@ procfile(const char *fn) fn = label != NULL ? label : getstr(1); f = grep_open(NULL); } else { - if (!stat(fn, &sb)) { + if (stat(fn, &sb) == 0) { /* Check if we need to process the file */ s = sb.st_mode & S_IFMT; - if (s == S_IFDIR && dirbehave == DIR_SKIP) + if (dirbehave == DIR_SKIP && s == S_IFDIR) return (0); - if ((s == S_IFIFO || s == S_IFCHR || s == S_IFBLK - || s == S_IFSOCK) && devbehave == DEV_SKIP) - return (0); + if (devbehave == DEV_SKIP && (s == S_IFIFO || + s == S_IFCHR || s == S_IFBLK || s == S_IFSOCK)) + return (0); } f = grep_open(fn); } From owner-svn-src-head@freebsd.org Sat Apr 21 01:42:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37202FB416C; Sat, 21 Apr 2018 01:42:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDABF782D0; Sat, 21 Apr 2018 01:42:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D752A20521; Sat, 21 Apr 2018 01:42:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3L1g2ge094660; Sat, 21 Apr 2018 01:42:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3L1g27q094659; Sat, 21 Apr 2018 01:42:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804210142.w3L1g27q094659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 21 Apr 2018 01:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332852 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 01:42:03 -0000 Author: kevans Date: Sat Apr 21 01:42:02 2018 New Revision: 332852 URL: https://svnweb.freebsd.org/changeset/base/332852 Log: bsdgrep: if chain => switch This makes some of this a little easier to follow (in my opinion). Modified: head/usr.bin/grep/file.c Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Sat Apr 21 01:33:13 2018 (r332851) +++ head/usr.bin/grep/file.c Sat Apr 21 01:42:02 2018 (r332852) @@ -86,6 +86,9 @@ static inline int grep_refill(struct file *f) { ssize_t nr; +#ifndef WITHOUT_LZMA + lzma_ret lzmaret; +#endif if (filebehave == FILE_MMAP) return (0); @@ -93,41 +96,52 @@ grep_refill(struct file *f) bufpos = buffer; bufrem = 0; - if (filebehave == FILE_GZIP) { + switch (filebehave) { + case FILE_GZIP: nr = gzread(gzbufdesc, buffer, MAXBUFSIZ); + break; #ifndef WITHOUT_BZIP2 - } else if (filebehave == FILE_BZIP && bzbufdesc != NULL) { - int bzerr; + case FILE_BZIP: + if (bzbufdesc != NULL) { + int bzerr; - nr = BZ2_bzRead(&bzerr, bzbufdesc, buffer, MAXBUFSIZ); - switch (bzerr) { - case BZ_OK: - case BZ_STREAM_END: - /* No problem, nr will be okay */ - break; - case BZ_DATA_ERROR_MAGIC: + nr = BZ2_bzRead(&bzerr, bzbufdesc, buffer, MAXBUFSIZ); + switch (bzerr) { + case BZ_OK: + case BZ_STREAM_END: + /* No problem, nr will be okay */ + break; + case BZ_DATA_ERROR_MAGIC: + /* + * As opposed to gzread(), which simply returns the + * plain file data, if it is not in the correct + * compressed format, BZ2_bzRead() instead aborts. + * + * So, just restart at the beginning of the file again, + * and use plain reads from now on. + */ + BZ2_bzReadClose(&bzerr, bzbufdesc); + bzbufdesc = NULL; + if (lseek(f->fd, 0, SEEK_SET) == -1) + return (-1); + nr = read(f->fd, buffer, MAXBUFSIZ); + break; + default: + /* Make sure we exit with an error */ + nr = -1; + } + } else /* - * As opposed to gzread(), which simply returns the - * plain file data, if it is not in the correct - * compressed format, BZ2_bzRead() instead aborts. - * - * So, just restart at the beginning of the file again, - * and use plain reads from now on. + * Also an error case; we should never have a scenario + * where we have an open file but no bzip descriptor + * at this point. See: grep_open */ - BZ2_bzReadClose(&bzerr, bzbufdesc); - bzbufdesc = NULL; - if (lseek(f->fd, 0, SEEK_SET) == -1) - return (-1); - nr = read(f->fd, buffer, MAXBUFSIZ); - break; - default: - /* Make sure we exit with an error */ nr = -1; - } + break; #endif #ifndef WITHOUT_LZMA - } else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { - lzma_ret ret; + case FILE_XZ: + case FILE_LZMA: lstrm.next_out = buffer; do { @@ -143,23 +157,23 @@ grep_refill(struct file *f) lstrm.avail_in = nr; } - ret = lzma_code(&lstrm, laction); + lzmaret = lzma_code(&lstrm, laction); - if (ret != LZMA_OK && ret != LZMA_STREAM_END) + if (lzmaret != LZMA_OK && lzmaret != LZMA_STREAM_END) return (-1); - if (lstrm.avail_out == 0 || ret == LZMA_STREAM_END) { + if (lstrm.avail_out == 0 || lzmaret == LZMA_STREAM_END) { bufrem = MAXBUFSIZ - lstrm.avail_out; lstrm.next_out = buffer; lstrm.avail_out = MAXBUFSIZ; } - } while (bufrem == 0 && ret != LZMA_STREAM_END); + } while (bufrem == 0 && lzmaret != LZMA_STREAM_END); return (0); -#endif /* WIHTOUT_LZMA */ - } else +#endif /* WITHOUT_LZMA */ + default: nr = read(f->fd, buffer, MAXBUFSIZ); - + } if (nr < 0) return (-1); @@ -255,6 +269,9 @@ struct file * grep_open(const char *path) { struct file *f; +#ifndef WITHOUT_LZMA + lzma_ret lzmaret; +#endif f = grep_malloc(sizeof *f); memset(f, 0, sizeof *f); @@ -292,30 +309,34 @@ grep_open(const char *path) if ((buffer == NULL) || (buffer == MAP_FAILED)) buffer = grep_malloc(MAXBUFSIZ); - if (filebehave == FILE_GZIP && - (gzbufdesc = gzdopen(f->fd, "r")) == NULL) - goto error2; - + switch (filebehave) { + case FILE_GZIP: + if ((gzbufdesc = gzdopen(f->fd, "r")) == NULL) + goto error2; + break; #ifndef WITHOUT_BZIP2 - if (filebehave == FILE_BZIP && - (bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL) - goto error2; + case FILE_BZIP: + if ((bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL) + goto error2; + break; #endif #ifndef WITHOUT_LZMA - else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { - lzma_ret ret; + case FILE_XZ: + case FILE_LZMA: - ret = (filebehave == FILE_XZ) ? - lzma_stream_decoder(&lstrm, UINT64_MAX, - LZMA_CONCATENATED) : - lzma_alone_decoder(&lstrm, UINT64_MAX); + if (filebehave == FILE_XZ) + lzmaret = lzma_stream_decoder(&lstrm, UINT64_MAX, + LZMA_CONCATENATED); + else + lzmaret = lzma_alone_decoder(&lstrm, UINT64_MAX); - if (ret != LZMA_OK) + if (lzmaret != LZMA_OK) goto error2; lstrm.avail_in = 0; lstrm.avail_out = MAXBUFSIZ; laction = LZMA_RUN; + break; } #endif @@ -326,7 +347,7 @@ grep_open(const char *path) /* Check for binary stuff, if necessary */ if (binbehave != BINFILE_TEXT && fileeol != '\0' && memchr(bufpos, '\0', bufrem) != NULL) - f->binary = true; + f->binary = true; return (f); From owner-svn-src-head@freebsd.org Sat Apr 21 01:33:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B54FB35EE; Sat, 21 Apr 2018 01:33:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 836C9755A0; Sat, 21 Apr 2018 01:33: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 7D72420312; Sat, 21 Apr 2018 01:33: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 w3L1XD5g090487; Sat, 21 Apr 2018 01:33:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3L1XDgv090486; Sat, 21 Apr 2018 01:33:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804210133.w3L1XDgv090486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 21 Apr 2018 01:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332851 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 01:33:14 -0000 Author: kevans Date: Sat Apr 21 01:33:13 2018 New Revision: 332851 URL: https://svnweb.freebsd.org/changeset/base/332851 Log: bsdgrep: More trivial cleanup/style cleanup We can avoid branching for these easily reduced patterns Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sat Apr 21 01:02:35 2018 (r332850) +++ head/usr.bin/grep/util.c Sat Apr 21 01:33:13 2018 (r332851) @@ -110,11 +110,8 @@ file_matching(const char *fname) for (unsigned int i = 0; i < fpatterns; ++i) { if (fnmatch(fpattern[i].pat, fname, 0) == 0 || fnmatch(fpattern[i].pat, fname_base, 0) == 0) { - if (fpattern[i].mode == EXCL_PAT) { - ret = false; - break; - } else - ret = true; + ret = (fpattern[i].mode != EXCL_PAT); + break; } } free(fname_buf); @@ -129,13 +126,8 @@ dir_matching(const char *dname) ret = dinclude ? false : true; for (unsigned int i = 0; i < dpatterns; ++i) { - if (dname != NULL && - fnmatch(dpattern[i].pat, dname, 0) == 0) { - if (dpattern[i].mode == EXCL_PAT) - return (false); - else - ret = true; - } + if (dname != NULL && fnmatch(dpattern[i].pat, dname, 0) == 0) + return (dpattern[i].mode != EXCL_PAT); } return (ret); } @@ -164,7 +156,6 @@ grep_tree(char **argv) break; default: fts_flags = FTS_LOGICAL; - } fts_flags |= FTS_NOSTAT | FTS_NOCHDIR; @@ -193,7 +184,7 @@ grep_tree(char **argv) case FTS_DC: /* Print a warning for recursive directory loop */ warnx("warning: %s: recursive directory loop", - p->fts_path); + p->fts_path); break; default: /* Check for file exclusion/inclusion */ From owner-svn-src-head@freebsd.org Sat Apr 21 02:08:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 012C9F86876; Sat, 21 Apr 2018 02:08:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A99477E163; Sat, 21 Apr 2018 02:08:56 +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 A48BB20954; Sat, 21 Apr 2018 02:08:56 +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 w3L28uOT005675; Sat, 21 Apr 2018 02:08:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3L28uCk005672; Sat, 21 Apr 2018 02:08:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804210208.w3L28uCk005672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 21 Apr 2018 02:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332853 - in head/sys: conf modules/blake2 modules/crypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf modules/blake2 modules/crypto X-SVN-Commit-Revision: 332853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 02:08:57 -0000 Author: cem Date: Sat Apr 21 02:08:56 2018 New Revision: 332853 URL: https://svnweb.freebsd.org/changeset/base/332853 Log: blake2: Disable warnings (not just error) for code we will not modify Leave libb2 pristine and silence the warnings for mjg. Modified: head/sys/conf/files head/sys/modules/blake2/Makefile head/sys/modules/crypto/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Apr 21 01:42:02 2018 (r332852) +++ head/sys/conf/files Sat Apr 21 02:08:56 2018 (r332853) @@ -653,11 +653,11 @@ contrib/zstd/lib/decompress/zstd_decompress.c standard contrib/zstd/lib/decompress/huf_decompress.c standard compile-with ${ZSTD_C} # Blake 2 contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support \ - compile-with "${NORMAL_C} -I$S/crypto/blake2 ${NO_WCAST_QUAL} -DSUFFIX=_ref" + compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" contrib/libb2/blake2s-ref.c optional crypto | ipsec | ipsec_support \ - compile-with "${NORMAL_C} -I$S/crypto/blake2 ${NO_WCAST_QUAL} -DSUFFIX=_ref" + compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" crypto/blake2/blake2-sw.c optional crypto | ipsec | ipsec_support \ - compile-with "${NORMAL_C} -I$S/crypto/blake2 ${NO_WCAST_QUAL}" + compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual" crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support Modified: head/sys/modules/blake2/Makefile ============================================================================== --- head/sys/modules/blake2/Makefile Sat Apr 21 01:42:02 2018 (r332852) +++ head/sys/modules/blake2/Makefile Sat Apr 21 02:08:56 2018 (r332853) @@ -61,7 +61,7 @@ CFLAGS.blake2s-xop.c += -DSUFFIX=_xop -msse2 -mssse3 - .for src in ${SRCS_IN} ${src:S/.c/.o/}: ${src} ${CC} -c ${CFLAGS:N-nostdinc} ${CFLAGS.${src}} ${WERROR} ${PROF} \ - -D_MM_MALLOC_H_INCLUDED ${.IMPSRC} + -D_MM_MALLOC_H_INCLUDED -Wno-unused-function ${.IMPSRC} ${CTFCONVERT_CMD} ${src:S/.c/.o/}: intrin.h emmintrin.h tmmintrin.h smmintrin.h immintrin.h \ @@ -86,5 +86,5 @@ WARNS ?= 6 .include -CWARNFLAGS.blake2-dispatch.c += -Wno-error=unused-const-variable -CWARNFLAGS += ${NO_WCAST_QUAL} +CWARNFLAGS.blake2-dispatch.c += -Wno-unused-const-variable +CWARNFLAGS += -Wno-cast-qual Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Sat Apr 21 01:42:02 2018 (r332852) +++ head/sys/modules/crypto/Makefile Sat Apr 21 02:08:56 2018 (r332853) @@ -40,8 +40,8 @@ SRCS += blake2-sw.c CFLAGS.blake2b-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref CFLAGS.blake2s-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref CFLAGS.blake2-sw.c += -I${SRCTOP}/sys/crypto/blake2 -CWARNFLAGS.blake2b-ref.c += ${NO_WCAST_QUAL} -CWARNFLAGS.blake2s-ref.c += ${NO_WCAST_QUAL} +CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual +CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual SRCS += chacha.c SRCS += chacha-sw.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h From owner-svn-src-head@freebsd.org Sat Apr 21 04:18:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39171F9820E; Sat, 21 Apr 2018 04:18:18 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAAA27B122; Sat, 21 Apr 2018 04:18:17 +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 D5A462209C; Sat, 21 Apr 2018 04:18:17 +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 w3L4IHRb071357; Sat, 21 Apr 2018 04:18:17 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3L4IHaB071355; Sat, 21 Apr 2018 04:18:17 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804210418.w3L4IHaB071355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 21 Apr 2018 04:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332854 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 332854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 04:18:18 -0000 Author: jhibbits Date: Sat Apr 21 04:18:17 2018 New Revision: 332854 URL: https://svnweb.freebsd.org/changeset/base/332854 Log: Sync powerpc feature flags with Linux Not all feature flags are synced. Those for processors we don't currently support are ignored currently. Those that are supported are synced best I can tell. One flag was renamed to match the Linux flag name (PPC_FEATURE2_VCRYPTO -> PPC_FEATURE2_VEC_CRYPTO). Modified: head/sys/powerpc/include/cpu.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Sat Apr 21 02:08:56 2018 (r332853) +++ head/sys/powerpc/include/cpu.h Sat Apr 21 04:18:17 2018 (r332854) @@ -54,6 +54,7 @@ extern int cpu_features2; #define PPC_FEATURE_32 0x80000000 /* Always true */ #define PPC_FEATURE_64 0x40000000 /* Defined on a 64-bit CPU */ +#define PPC_FEATURE_601_INSTR 0x20000000 /* Defined on a 64-bit CPU */ #define PPC_FEATURE_HAS_ALTIVEC 0x10000000 #define PPC_FEATURE_HAS_FPU 0x08000000 #define PPC_FEATURE_HAS_MMU 0x04000000 @@ -61,26 +62,45 @@ extern int cpu_features2; #define PPC_FEATURE_HAS_SPE 0x00800000 #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 +#define PPC_FEATURE_NO_TB 0x00100000 +#define PPC_FEATURE_POWER4 0x00080000 +#define PPC_FEATURE_POWER5 0x00040000 +#define PPC_FEATURE_POWER5_PLUS 0x00020000 +#define PPC_FEATURE_CELL 0x00010000 #define PPC_FEATURE_BOOKE 0x00008000 #define PPC_FEATURE_SMT 0x00004000 +#define PPC_FEATURE_ICACHE_SNOOP 0x00002000 #define PPC_FEATURE_ARCH_2_05 0x00001000 #define PPC_FEATURE_HAS_DFP 0x00000400 +#define PPC_FEATURE_POWER6_EXT 0x00000200 #define PPC_FEATURE_ARCH_2_06 0x00000100 #define PPC_FEATURE_HAS_VSX 0x00000080 +#define PPC_FEATURE_TRUE_LE 0x00000002 +#define PPC_FEATURE_PPC_LE 0x00000001 #define PPC_FEATURE2_ARCH_2_07 0x80000000 -#define PPC_FEATURE2_HAS_HTM 0x40000000 +#define PPC_FEATURE2_HTM 0x40000000 +#define PPC_FEATURE2_DSCR 0x20000000 #define PPC_FEATURE2_ISEL 0x08000000 -#define PPC_FEATURE2_HAS_VCRYPTO 0x02000000 +#define PPC_FEATURE2_TAR 0x04000000 +#define PPC_FEATURE2_HAS_VEC_CRYPTO 0x02000000 +#define PPC_FEATURE2_HTM_NOSC 0x01000000 +#define PPC_FEATURE2_ARCH_3_00 0x00800000 +#define PPC_FEATURE2_HAS_IEEE128 0x00400000 +#define PPC_FEATURE2_DARN 0x00200000 +#define PPC_FEATURE2_SCV 0x00100000 +#define PPC_FEATURE2_HTM_NOSUSPEND 0x01000000 #define PPC_FEATURE_BITMASK \ "\20" \ - "\040PPC32\037PPC64\035ALTIVEC\034FPU\033MMU\031UNIFIEDCACHE" \ - "\030SPE\027SPESFP\026DPESFP\020BOOKE\017SMT\015ARCH205\013DFP" \ - "\011ARCH206\010VSX" + "\040PPC32\037PPC64\036PPC601\035ALTIVEC\034FPU\033MMU\031UNIFIEDCACHE" \ + "\030SPE\027SPESFP\026DPESFP\025NOTB\024POWER4\023POWER5\022P5PLUS\021CELL"\ + "\020BOOKE\017SMT\016ISNOOP\015ARCH205\013DFP\011ARCH206\010VSX"\ + "\002TRUELE\001PPCLE" #define PPC_FEATURE2_BITMASK \ "\20" \ - "\040ARCH207\037HTM\034ISEL\032VCRYPTO" + "\040ARCH207\037HTM\036DSCR\034ISEL\033TAR\032VCRYPTO\031HTMNOSC" \ + "\030ARCH300\027IEEE128\026DARN\025SCV\024HTMNOSUSP" #define TRAPF_USERMODE(frame) (((frame)->srr1 & PSL_PR) != 0) #define TRAPF_PC(frame) ((frame)->srr0) Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat Apr 21 02:08:56 2018 (r332853) +++ head/sys/powerpc/powerpc/cpu.c Sat Apr 21 04:18:17 2018 (r332854) @@ -139,42 +139,49 @@ static const struct cputab models[] = { PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, 0, cpu_970_setup }, { "IBM POWER4", IBMPOWER4, REVFMT_MAJMIN, - PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, 0, NULL }, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_POWER4, 0, NULL }, { "IBM POWER4+", IBMPOWER4PLUS, REVFMT_MAJMIN, - PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, 0, NULL }, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_POWER4, 0, NULL }, { "IBM POWER5", IBMPOWER5, REVFMT_MAJMIN, - PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT, 0, NULL }, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_POWER4 | + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP, 0, NULL }, { "IBM POWER5+", IBMPOWER5PLUS, REVFMT_MAJMIN, - PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT, 0, NULL }, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_POWER5_PLUS | + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP, 0, NULL }, { "IBM POWER6", IBMPOWER6, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | - PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05, 0, NULL }, + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_TRUE_LE, 0, NULL }, { "IBM POWER7", IBMPOWER7, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | - PPC_FEATURE_HAS_VSX, 0, NULL }, + PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, PPC_FEATURE2_DSCR, NULL }, { "IBM POWER7+", IBMPOWER7PLUS, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | - PPC_FEATURE_HAS_VSX, 0, NULL }, + PPC_FEATURE_HAS_VSX, PPC_FEATURE2_DSCR, NULL }, { "IBM POWER8E", IBMPOWER8E, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | - PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | - PPC_FEATURE_HAS_VSX, - PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL | - PPC_FEATURE2_HAS_VCRYPTO, cpu_powerx_setup }, + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | + PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | + PPC_FEATURE2_HTM_NOSC, cpu_powerx_setup }, { "IBM POWER8", IBMPOWER8, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | - PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | - PPC_FEATURE_HAS_VSX, - PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL | - PPC_FEATURE2_HAS_VCRYPTO, cpu_powerx_setup }, + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | + PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | + PPC_FEATURE2_HTM_NOSC, cpu_powerx_setup }, { "IBM POWER9", IBMPOWER9, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | - PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | - PPC_FEATURE_HAS_VSX, - PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL | - PPC_FEATURE2_HAS_VCRYPTO, NULL }, + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | + PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | + PPC_FEATURE2_ARCH_3_00 | PPC_FEATURE2_HAS_IEEE128 | + PPC_FEATURE2_DARN, NULL }, { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN, PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, 0, cpu_6xx_setup }, { "Motorola PowerPC 7410", MPC7410, REVFMT_MAJMIN, @@ -194,24 +201,27 @@ static const struct cputab models[] = { { "Motorola PowerPC 8245", MPC8245, REVFMT_MAJMIN, PPC_FEATURE_HAS_FPU, 0, cpu_6xx_setup }, { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_SPE | PPC_FEATURE_HAS_EFP_SINGLE, + PPC_FEATURE_HAS_SPE | PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_BOOKE, PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_SPE | + PPC_FEATURE_HAS_SPE | PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE, PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e500mc core", FSL_E500mc, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_FPU, PPC_FEATURE2_ISEL, + PPC_FEATURE_HAS_FPU | PPC_FEATURE_BOOKE | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_ARCH_2_06, PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e5500 core", FSL_E5500, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_BOOKE | + PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06, PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e6500 core", FSL_E6500, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | - PPC_FEATURE_HAS_FPU, PPC_FEATURE2_ISEL, cpu_booke_setup }, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | + PPC_FEATURE_BOOKE | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06, + PPC_FEATURE2_ISEL, cpu_booke_setup }, { "IBM Cell Broadband Engine", IBMCELLBE, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | - PPC_FEATURE_SMT, 0, NULL}, + PPC_FEATURE_CELL | PPC_FEATURE_SMT, 0, NULL}, { "Unknown PowerPC CPU", 0, REVFMT_HEX, 0, 0, NULL }, }; From owner-svn-src-head@freebsd.org Sat Apr 21 13:46:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B68AFA6E7B; Sat, 21 Apr 2018 13:46:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ECA87B283; Sat, 21 Apr 2018 13:46:08 +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 2AA7B27B2D; Sat, 21 Apr 2018 13:46:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3LDk7YY056253; Sat, 21 Apr 2018 13:46:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3LDk7YM056252; Sat, 21 Apr 2018 13:46:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804211346.w3LDk7YM056252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 21 Apr 2018 13:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332856 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 13:46:08 -0000 Author: kevans Date: Sat Apr 21 13:46:07 2018 New Revision: 332856 URL: https://svnweb.freebsd.org/changeset/base/332856 Log: bsdgrep: Fix --include/--exclude ordering issues Prior to r332851: * --exclude always win out over --include * --exclude-dir always wins out over --include-dir r332851 broke that behavior, resulting in: * First of --exclude, --include wins * First of --exclude-dir, --include-dir wins As it turns out, both behaviors are wrong by modern grep standards- the latest rule wins. e.g.: `grep --exclude foo --include foo 'thing' foo` foo is included `grep --include foo --exclude foo 'thing' foo` foo is excluded As tested with GNU grep 3.1. This commit makes bsdgrep follow this behavior. Reported by: se Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sat Apr 21 09:58:00 2018 (r332855) +++ head/usr.bin/grep/util.c Sat Apr 21 13:46:07 2018 (r332856) @@ -109,10 +109,12 @@ file_matching(const char *fname) for (unsigned int i = 0; i < fpatterns; ++i) { if (fnmatch(fpattern[i].pat, fname, 0) == 0 || - fnmatch(fpattern[i].pat, fname_base, 0) == 0) { + fnmatch(fpattern[i].pat, fname_base, 0) == 0) + /* + * The last pattern matched wins exclusion/inclusion + * rights, so we can't reasonably bail out early here. + */ ret = (fpattern[i].mode != EXCL_PAT); - break; - } } free(fname_buf); return (ret); @@ -127,7 +129,11 @@ dir_matching(const char *dname) for (unsigned int i = 0; i < dpatterns; ++i) { if (dname != NULL && fnmatch(dpattern[i].pat, dname, 0) == 0) - return (dpattern[i].mode != EXCL_PAT); + /* + * The last pattern matched wins exclusion/inclusion + * rights, so we can't reasonably bail out early here. + */ + ret = (dpattern[i].mode != EXCL_PAT); } return (ret); } From owner-svn-src-head@freebsd.org Sat Apr 21 13:48:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700D6FA7154; Sat, 21 Apr 2018 13:48:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4547B495; Sat, 21 Apr 2018 13:48:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C66A111635; Sat, 21 Apr 2018 13:48:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f50.google.com with SMTP id o123-v6so6252642lfe.8; Sat, 21 Apr 2018 06:48:42 -0700 (PDT) X-Gm-Message-State: ALQs6tD4YQgYAofoXGJREdez8WOKKqAbopZi/OLwt9DjB451uvZZM+jT OCir2iMlFmB9O59bcPglcAZgEqRJTzrJelw3R/g= X-Google-Smtp-Source: AB8JxZrRObniNcXMRDL8S2l1wngT1rFQjmrP6BltmzUWoMUlv+cCkU7CNpAAgxHGAPU1jWL38XT9KC9z/6H33ExDL78= X-Received: by 2002:a19:2902:: with SMTP id p2-v6mr1624876lfp.99.1524318521160; Sat, 21 Apr 2018 06:48:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Sat, 21 Apr 2018 06:48:20 -0700 (PDT) In-Reply-To: <201804211346.w3LDk7YM056252@repo.freebsd.org> References: <201804211346.w3LDk7YM056252@repo.freebsd.org> From: Kyle Evans Date: Sat, 21 Apr 2018 08:48:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332856 - head/usr.bin/grep To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 13:48:43 -0000 On Sat, Apr 21, 2018 at 8:46 AM, Kyle Evans wrote: > Author: kevans > Date: Sat Apr 21 13:46:07 2018 > New Revision: 332856 > URL: https://svnweb.freebsd.org/changeset/base/332856 > > Log: > bsdgrep: Fix --include/--exclude ordering issues > > Prior to r332851: > * --exclude always win out over --include > * --exclude-dir always wins out over --include-dir > > r332851 broke that behavior, resulting in: > * First of --exclude, --include wins > * First of --exclude-dir, --include-dir wins > > As it turns out, both behaviors are wrong by modern grep standards- the > latest rule wins. e.g.: > > `grep --exclude foo --include foo 'thing' foo` > foo is included > > `grep --include foo --exclude foo 'thing' foo` > foo is excluded > > As tested with GNU grep 3.1. > > This commit makes bsdgrep follow this behavior. > > Reported by: se > Just to be clear, because I don't want to mislead- se's report was specifically that I broke the previous behavior. Later investigation found that both behaviors were wrong. From owner-svn-src-head@freebsd.org Sat Apr 21 14:56:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F5C5FAB0BF; Sat, 21 Apr 2018 14:56:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C6B788299; Sat, 21 Apr 2018 14:56:42 +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 31658690; Sat, 21 Apr 2018 14:56:42 +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 w3LEugo1091533; Sat, 21 Apr 2018 14:56:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3LEufpK091527; Sat, 21 Apr 2018 14:56:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804211456.w3LEufpK091527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 21 Apr 2018 14:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332857 - in head: etc/defaults etc/rc.d share/man/man4 share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: etc/defaults etc/rc.d share/man/man4 share/man/man5 X-SVN-Commit-Revision: 332857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 14:56:42 -0000 Author: trasz Date: Sat Apr 21 14:56:41 2018 New Revision: 332857 URL: https://svnweb.freebsd.org/changeset/base/332857 Log: Add cfumass rc script, to create a LUN for cfumass(4). MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14844 Added: head/etc/rc.d/cfumass (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/share/man/man4/cfumass.4 head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Apr 21 13:46:07 2018 (r332856) +++ head/etc/defaults/rc.conf Sat Apr 21 14:56:41 2018 (r332857) @@ -592,6 +592,9 @@ cron_enable="YES" # Run the periodic job daemon. cron_program="/usr/sbin/cron" # Which cron executable to run (if enabled). cron_dst="YES" # Handle DST transitions intelligently (YES/NO) cron_flags="" # Which options to pass to the cron daemon. +cfumass_enable="NO" # Create default LUN for cfumass(4). +cfumass_dir="/var/cfumass" # File to LUN's contents. +cfumass_image="/var/tmp/cfumass.img" # LUN's backing file path. lpd_enable="NO" # Run the line printer daemon. lpd_program="/usr/sbin/lpd" # path to lpd, if you want a different one. lpd_flags="" # Flags to lpd (if enabled). Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Apr 21 13:46:07 2018 (r332856) +++ head/etc/rc.d/Makefile Sat Apr 21 14:56:41 2018 (r332857) @@ -21,6 +21,7 @@ FILES= DAEMON \ ${_bluetooth} \ bridge \ ${_bthidd} \ + cfumass \ cleanvar \ cleartmp \ cron \ Added: head/etc/rc.d/cfumass ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/cfumass Sat Apr 21 14:56:41 2018 (r332857) @@ -0,0 +1,125 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: cfumass +# REQUIRE: var +# KEYWORD: nojail + +. /etc/rc.subr + +name="cfumass" +desc="Configure the LUN for device mode USB mass storage" +rcvar="cfumass_enable" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" + +extra_commands="reload" +reload_cmd="${name}_start" + +: ${cfumass_dir:=/var/cfumass} +: ${cfumass_image:=/var/tmp/cfumass.img} +: ${cfumass_vendor:="FreeBSD"} +: ${cfumass_product:="cfumass(4)"} + +remove_luns() +{ + local _lun _luns + + _luns=`ctladm devlist -b block -v | awk ' + + $1 ~ /^[0-9]+$/ { + lun = $1 + } + + $1 == "file='"${cfumass_image}"'" { + print lun + }'` + + for _lun in ${_luns}; do + ctladm remove -b block -l "${_lun}" > /dev/null + done +} + +cfumass_start() +{ + local err _files _template + + if [ ! -d "${cfumass_dir}" ]; then + warn "${cfumass_dir} does not exist" + return 1 + fi + + _files=`find "${cfumass_dir}" -newer "${cfumass_image}" -print 2> /dev/null` + if [ ! -e "${cfumass_image}" -o -n "${_files}" ]; then + # The image doesn't exist or is out of date. + makefs -t cd9660 -o rockridge "${cfumass_image}" "${cfumass_dir}" + err=$? + if [ "${err}" -ne 0 ]; then + warn "unable to create ${cfumass_image}" + return "${err}" + fi + fi + + remove_luns + + ctladm create -b block -o file="${cfumass_image}" -o readonly=on \ + -o vendor="${cfumass_vendor}" -o product="${cfumass_product}" \ + -t 5 -S 0 > /dev/null + err=$? + if [ "${err}" -ne 0 ]; then + warn "unable to create CTL LUN" + return "${err}" + fi + + load_kld -e cfumass cfumass + + # If the template is already switched to Mass Storage, then reset + # it to -1 to force the host to reenumerate it; otherwise it might + # not notice the new LUN. + _template=`sysctl -n hw.usb.template` + if [ "${_template}" -eq 0 ]; then + sysctl hw.usb.template=-1 > /dev/null + err=$? + if [ "${err}" -ne 0 ]; then + warn "unable to set hw.usb.template sysctl" + return "${err}" + fi + fi + + _template=`sysctl -n hw.usb.template` + if [ "${_template}" -lt 0 ]; then + sysctl hw.usb.template=0 > /dev/null + err=$? + if [ "${err}" -ne 0 ]; then + warn "unable to set hw.usb.template sysctl" + return "${err}" + fi + else + # Otherwise don't touch the sysctl - we could lock the user + # out of the machine otherwise. + warn "hw.usb.template sysctl set to neither -1 nor 0" + fi +} + +cfumass_stop() +{ + local err _template + + _template=`sysctl -n hw.usb.template` + if [ "${_template}" -eq 0 ]; then + sysctl hw.usb.template=-1 > /dev/null + err=$? + if [ "${err}" -ne 0 ]; then + warn "unable to set hw.usb.template sysctl" + return "${err}" + fi + fi + + remove_luns +} + +load_rc_config $name +run_rc_command "$1" Modified: head/share/man/man4/cfumass.4 ============================================================================== --- head/share/man/man4/cfumass.4 Sat Apr 21 13:46:07 2018 (r332856) +++ head/share/man/man4/cfumass.4 Sat Apr 21 14:56:41 2018 (r332857) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 9, 2018 +.Dd April 21, 2018 .Dt CFUMASS 4 .Os .Sh NAME @@ -88,6 +88,14 @@ See and .Xr ctld 8 for details on configuring the LUN. +See the +.Cm cfumass_enable +and +.Cm cfumass_dir +.Xr rc 8 +variables in +.Xr rc.conf 5 +for an automated way to configure it at boot. .Sh SYSCTL VARIABLES These variables are available as both .Xr sysctl 8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Apr 21 13:46:07 2018 (r332856) +++ head/share/man/man5/rc.conf.5 Sat Apr 21 14:56:41 2018 (r332857) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2018 +.Dd April 21, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -4482,6 +4482,18 @@ The default is which configures sessions based on the .Pa /etc/iscsi.conf configuration file. +.It Va cfumass_enable +.Pq Vt bool +If set to +.Dq Li YES , +create and export an USB LUN using +.Xr cfumass 4 +at boot time. +.It Va cfumass_dir +.Pq Vt str +The directory where the files exported by USB LUN are located. +The default directory is +.Pa /var/cfumass . .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact From owner-svn-src-head@freebsd.org Sat Apr 21 14:58:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E22D5FAB32F; Sat, 21 Apr 2018 14:58:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94CE3895EF; Sat, 21 Apr 2018 14:58:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E0C66A1; Sat, 21 Apr 2018 14:58:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3LEwjjv091643; Sat, 21 Apr 2018 14:58:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3LEwjdt091642; Sat, 21 Apr 2018 14:58:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804211458.w3LEwjdt091642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 21 Apr 2018 14:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332858 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 14:58:46 -0000 Author: kevans Date: Sat Apr 21 14:58:45 2018 New Revision: 332858 URL: https://svnweb.freebsd.org/changeset/base/332858 Log: bsdgrep: Use grep_strdup instead of grep_malloc+strcpy Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sat Apr 21 14:56:41 2018 (r332857) +++ head/usr.bin/grep/util.c Sat Apr 21 14:58:45 2018 (r332858) @@ -323,8 +323,7 @@ procfile(const char *fn) return (0); } - pc.ln.file = grep_malloc(strlen(fn) + 1); - strcpy(pc.ln.file, fn); + pc.ln.file = grep_strdup(fn); pc.ln.line_no = 0; pc.ln.len = 0; pc.ln.boff = 0; From owner-svn-src-head@freebsd.org Sat Apr 21 15:15:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F1FFAC5EB; Sat, 21 Apr 2018 15:15: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBDC58B25C; Sat, 21 Apr 2018 15:15: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 D6DFB9C8; Sat, 21 Apr 2018 15:15: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 w3LFFlr8002079; Sat, 21 Apr 2018 15:15:47 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3LFFlV3002077; Sat, 21 Apr 2018 15:15:47 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804211515.w3LFFlV3002077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 21 Apr 2018 15:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332859 - 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: 332859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 15:15:48 -0000 Author: jhibbits Date: Sat Apr 21 15:15:47 2018 New Revision: 332859 URL: https://svnweb.freebsd.org/changeset/base/332859 Log: Export powerpc CPU features for auxvec FreeBSD exports the AT_HWCAP* auxvec items if provided by the ELF sysentvec structure. Add the CPU features to be exported, so user space can more easily check for them without using the hw.cpu_features and hw.cpu_features2 sysctls. Modified: head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Sat Apr 21 14:58:45 2018 (r332858) +++ head/sys/powerpc/powerpc/elf32_machdep.c Sat Apr 21 15:15:47 2018 (r332859) @@ -123,6 +123,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &cpu_features, + .sv_hwcap2 = &cpu_features2, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Sat Apr 21 14:58:45 2018 (r332858) +++ head/sys/powerpc/powerpc/elf64_machdep.c Sat Apr 21 15:15:47 2018 (r332859) @@ -88,6 +88,8 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &cpu_features, + .sv_hwcap2 = &cpu_features2, }; INIT_SYSENTVEC(elf64_sysvec_v1, &elf64_freebsd_sysvec_v1); From owner-svn-src-head@freebsd.org Sat Apr 21 17:05:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FF6FB3571; Sat, 21 Apr 2018 17:05:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB877DA2E; Sat, 21 Apr 2018 17:05:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 954841B3B; Sat, 21 Apr 2018 17:05:00 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3LH50lT056340; Sat, 21 Apr 2018 17:05:00 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3LH50Dk056339; Sat, 21 Apr 2018 17:05:00 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804211705.w3LH50Dk056339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 21 Apr 2018 17:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332860 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 17:05:01 -0000 Author: jtl Date: Sat Apr 21 17:05:00 2018 New Revision: 332860 URL: https://svnweb.freebsd.org/changeset/base/332860 Log: When running with INVARIANTS, the kernel contains extra checks. However, these assumptions may not hold true once we've panic'd. Therefore, the checks hold less value after a panic. Additionally, if one of the checks fails while we are already panic'd, this creates a double-panic which can interfere with debugging the original panic. Therefore, this commit allows an administrator to suppress a response to KASSERT checks after a panic by setting a tunable/sysctl. The tunable/sysctl (debug.kassert.suppress_in_panic) defaults to being enabled. Reviewed by: kib Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D12920 Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Apr 21 15:15:47 2018 (r332859) +++ head/sys/kern/kern_shutdown.c Sat Apr 21 17:05:00 2018 (r332860) @@ -642,6 +642,7 @@ static int kassert_do_log = 1; static int kassert_log_pps_limit = 4; static int kassert_log_mute_at = 0; static int kassert_log_panic_at = 0; +static int kassert_suppress_in_panic = 1; static int kassert_warnings = 0; SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options"); @@ -676,6 +677,10 @@ SYSCTL_INT(_debug_kassert, OID_AUTO, log_pps_limit, CT SYSCTL_INT(_debug_kassert, OID_AUTO, log_mute_at, CTLFLAG_RWTUN, &kassert_log_mute_at, 0, "max number of KASSERTS to log"); +SYSCTL_INT(_debug_kassert, OID_AUTO, suppress_in_panic, CTLFLAG_RWTUN, + &kassert_suppress_in_panic, 0, + "KASSERTs will be suppressed while handling a panic"); + static int kassert_sysctl_kassert(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_debug_kassert, OID_AUTO, kassert, @@ -707,6 +712,10 @@ kassert_panic(const char *fmt, ...) { static char buf[256]; va_list ap; + + /* If we already panic'd, don't create a double-fault. */ + if (panicstr != NULL && kassert_suppress_in_panic) + return; va_start(ap, fmt); (void)vsnprintf(buf, sizeof(buf), fmt, ap); From owner-svn-src-head@freebsd.org Sat Apr 21 17:41:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 271F8FB5B02; Sat, 21 Apr 2018 17:41:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6AED287445; Sat, 21 Apr 2018 17:41:24 +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 mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 82749D4FD11; Sun, 22 Apr 2018 03:41:16 +1000 (AEST) Date: Sun, 22 Apr 2018 03:41:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Jonathan T. Looney" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332860 - head/sys/kern In-Reply-To: <201804211705.w3LH50Dk056339@repo.freebsd.org> Message-ID: <20180422032027.D1653@besplex.bde.org> References: <201804211705.w3LH50Dk056339@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=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=5cUxu2C0Djz_aW9bb3oA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 17:41:26 -0000 On Sat, 21 Apr 2018, Jonathan T. Looney wrote: > Log: > When running with INVARIANTS, the kernel contains extra checks. However, > these assumptions may not hold true once we've panic'd. Therefore, the > checks hold less value after a panic. Additionally, if one of the checks > fails while we are already panic'd, this creates a double-panic which can > interfere with debugging the original panic. > > Therefore, this commit allows an administrator to suppress a response to > KASSERT checks after a panic by setting a tunable/sysctl. The > tunable/sysctl (debug.kassert.suppress_in_panic) defaults to being > enabled. > ... > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Sat Apr 21 15:15:47 2018 (r332859) > +++ head/sys/kern/kern_shutdown.c Sat Apr 21 17:05:00 2018 (r332860) > @@ -642,6 +642,7 @@ static int kassert_do_log = 1; > static int kassert_log_pps_limit = 4; > static int kassert_log_mute_at = 0; > static int kassert_log_panic_at = 0; > +static int kassert_suppress_in_panic = 1; > static int kassert_warnings = 0; > > SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options"); > @@ -676,6 +677,10 @@ SYSCTL_INT(_debug_kassert, OID_AUTO, log_pps_limit, CT > SYSCTL_INT(_debug_kassert, OID_AUTO, log_mute_at, CTLFLAG_RWTUN, > &kassert_log_mute_at, 0, "max number of KASSERTS to log"); > > +SYSCTL_INT(_debug_kassert, OID_AUTO, suppress_in_panic, CTLFLAG_RWTUN, > + &kassert_suppress_in_panic, 0, > + "KASSERTs will be suppressed while handling a panic"); > + > static int kassert_sysctl_kassert(SYSCTL_HANDLER_ARGS); > > SYSCTL_PROC(_debug_kassert, OID_AUTO, kassert, > @@ -707,6 +712,10 @@ kassert_panic(const char *fmt, ...) > { > static char buf[256]; > va_list ap; > + > + /* If we already panic'd, don't create a double-fault. */ > + if (panicstr != NULL && kassert_suppress_in_panic) > + return; > > va_start(ap, fmt); > (void)vsnprintf(buf, sizeof(buf), fmt, ap); panic() can't return, but I see that KASSERT() has already been broken to use kassert_panic() which does return in some cases including this new one. KASSERT(9) is still documented to call panic(), and none of the options to break it including this new one, or kassert_panic() itself are documented in KASSERT(9) or in any other section 9 man page. Lots of code was and still is written under the assumption that KASSERT() works as documented. E.g., after a null pointer check using KASSERT(), the pointer is normally used and the page fault for this should cause a panic anyway. This is actually a feature -- it works around KASSERT() breaking restartability of the fault. Other cases are not so good. There man be a cascade of KASSERT() failures, and the new option prevents even printing a message about even one of them. If you are lucky then you get a clean null pointer recursive panic. The only example in KASSERT(9) is to give the worst use of it (for breaking clean null pointer panics when KASSERT() works as documented, but now doesn't even break them when KASSERT() returns). Bruce From owner-svn-src-head@freebsd.org Sat Apr 21 17:53:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED886FB67E7; Sat, 21 Apr 2018 17:53:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88B7B6A303; Sat, 21 Apr 2018 17:53:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f46.google.com with SMTP id u62-v6so6042539ita.5; Sat, 21 Apr 2018 10:53:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=gmEOZhUas7+Jr1TXOutPCyWtThxkIkjbET9E1YpwAIE=; b=E8UUb33a0iO21SlA6AZ+NtQ6XuXd3hgyyzjv0viJF4xG701kF2mazhleVLpkcfFX9s WTFOWuOHgWq9lgsGwWaay41pmf5Mtiw9oCNnlQ0oGGRmW1ND415zr9/r9rky4cVVn5ej G83oRdoHVWI32ZHrg4Z8gez8++VTKHyzxs6msywTkvichoA5zDfEKyYI0Zuunipq33Xx fuMqnfIPydBQ8tjqxuXw9GYmNOcVM4d3FGCe27V9PDPI88rwkiR6ble+sDlxEhi/BtbN M3Nnis3hDPrg9fbqc3iL3XkjYdLjHFK0g79Z2yzaq7oNa0FENIbWj/4hd5lV+4SvHLnh 6PNw== X-Gm-Message-State: ALQs6tC1xloGatvc5thvOlWKp3fEd2OzKQqw56lqCb9CqPjgYC7dJAlg C3eVC4PSIqj+zCFzobYLjv787dSU X-Google-Smtp-Source: AIpwx49fn3rXj+12z9Ax1Q06eMg6an2xMD7hgM832hMGUjIr85kwNw9ovfoew/SYHpGTHpINNz7GsA== X-Received: by 2002:a24:2ec8:: with SMTP id i191-v6mr7532840ita.149.1524333222307; Sat, 21 Apr 2018 10:53:42 -0700 (PDT) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id s142-v6sm2144368itb.4.2018.04.21.10.53.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Apr 2018 10:53:41 -0700 (PDT) Received: by mail-io0-f172.google.com with SMTP id d26-v6so13956652ioc.2; Sat, 21 Apr 2018 10:53:41 -0700 (PDT) X-Received: by 2002:a6b:da04:: with SMTP id x4-v6mr6398772iob.19.1524333221780; Sat, 21 Apr 2018 10:53:41 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Sat, 21 Apr 2018 10:53:41 -0700 (PDT) In-Reply-To: <201804211705.w3LH50Dk056339@repo.freebsd.org> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> From: Conrad Meyer Date: Sat, 21 Apr 2018 10:53:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: "Jonathan T. Looney" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 17:53:49 -0000 On Sat, Apr 21, 2018 at 10:05 AM, Jonathan T. Looney wrote: > Author: jtl > Date: Sat Apr 21 17:05:00 2018 > New Revision: 332860 > URL: https://svnweb.freebsd.org/changeset/base/332860 > > Log: > When running with INVARIANTS, the kernel contains extra checks. However, > these assumptions may not hold true once we've panic'd. Therefore, the > checks hold less value after a panic. Additionally, if one of the checks > fails while we are already panic'd, this creates a double-panic which can > interfere with debugging the original panic. > > Therefore, this commit allows an administrator to suppress a response to > KASSERT checks after a panic by setting a tunable/sysctl. The > tunable/sysctl (debug.kassert.suppress_in_panic) defaults to being > enabled. Hi Jonathan, I don't think this should be enabled by default. Can we leave it disabled by default and let consumers opt-in? To expand on this a little: this is a big hammer. We already disable specific invariants in a few cases during panic (lock assertions come to mind). If there are specific assertions that do not hold during panic, we can/should selectively weaken them. But in general, invariants are invariant, and we should not proceed past violated ones by default. Thanks, Conrad From owner-svn-src-head@freebsd.org Sat Apr 21 17:59:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB86FB6C1D; Sat, 21 Apr 2018 17:59:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57BEC6A576; Sat, 21 Apr 2018 17:59:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id v13-v6so13959294iob.6; Sat, 21 Apr 2018 10:59:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ulRyKD0u8kkCGd7g+chbmF/j4icsVSqoiChkW9Td2Wc=; b=NmsS6lFjo3gOhL3PRVLYvzRnLfcroXQD5j15rID0KUcP6Ue68TAxfjsNIsrrvKR5PD xCVECHjuJsbFZxplEm7a83AzlAlur7BqLnuVVZwEAQ7IKPn65qi8C4tXrEBQe5JPrEQK +qT/tx4ECCq95IeM4uGj2bLYaOY2JPMWcSPqpnXiQ3qLjdmll7xzI2NV2FGDf+9z+RAD h3NAvlh8B17UmxzHSgOlPYgsutuu+94DGObzdMfwDvuNyQbA944l+g72DyRcVFajapUC MAys3Nqub8GUj2ueod5xun99FE9VQd2OIqBWLtHBYJX8y05PYIn1Vz8lFkudXdEH0sWq +eXw== X-Gm-Message-State: ALQs6tD0JJPfjlgwcbKKqSIf05RCtqkUxZbsISCZtCAGukszt9fxvpJr EZT6kyskR6/BEHTl787xkM08yF9c X-Google-Smtp-Source: AIpwx49bvg8k0NL4q+VT4XLtnjoRe995sAxlR/cqx8nK216CH01Fj9KdbjSQmE1G/FxyuS/NfdXViQ== X-Received: by 2002:a6b:e815:: with SMTP id f21-v6mr8976736ioh.244.1524333540325; Sat, 21 Apr 2018 10:59:00 -0700 (PDT) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com. [209.85.223.170]) by smtp.gmail.com with ESMTPSA id o187-v6sm1434866ioo.65.2018.04.21.10.58.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Apr 2018 10:59:00 -0700 (PDT) Received: by mail-io0-f170.google.com with SMTP id r22-v6so4892052ioc.12; Sat, 21 Apr 2018 10:58:59 -0700 (PDT) X-Received: by 2002:a6b:545:: with SMTP id 66-v6mr15145876iof.173.1524333539841; Sat, 21 Apr 2018 10:58:59 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Sat, 21 Apr 2018 10:58:59 -0700 (PDT) In-Reply-To: <20180422032027.D1653@besplex.bde.org> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180422032027.D1653@besplex.bde.org> From: Conrad Meyer Date: Sat, 21 Apr 2018 10:58:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 17:59:07 -0000 On Sat, Apr 21, 2018 at 10:41 AM, Bruce Evans wrote: > panic() can't return, but I see that KASSERT() has already been broken > to use kassert_panic() which does return in some cases including this > new one. Oddly enough, I find myself agreeing with Bruce on this. That kassert_panic does not always assert, during ordinary (non-panic) runtime, based on a runtime configurable toggle breaks the concept of invariants and confuses the heck out of static analyzers like Coverity. Ideally, we just remove it. IMO it is a crappy hack that should have remained in iX's local tree. If we want to be really generous, we can make it an off-by-default build option. Is anyone clamoring for allowing violation of multiple assertions without panic, other than Linus Torvalds? > KASSERT(9) is still documented to call panic(), and none of the options > to break it including this new one, or kassert_panic() itself are > documented in KASSERT(9) or in any other section 9 man page. Yeah. This is unfortunate :-(. Best, Conrad From owner-svn-src-head@freebsd.org Sat Apr 21 18:31:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1979FFB8D91 for ; Sat, 21 Apr 2018 18:31:37 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0D9772E39 for ; Sat, 21 Apr 2018 18:31:36 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x231.google.com with SMTP id i17-v6so3775720ywg.13 for ; Sat, 21 Apr 2018 11:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pj6sYxA9m7yqraLYRDjzuE31ChH+9piaowmKqemEjH8=; b=om5u/BXoMun5g5rKUboQUV0t97a95Dr1Z4XbFPjTwxAcxkpcZc78xjKeR8m7lkiHZ8 3L42wZu0k6WI8xay1ZfezdXXE3B7e7B+pKs0ipk/FYVLN1l8n22JS+P9z7zNLEgiJN5l 5cHXb/+gIfSL/QPm4B8oQPNZHH9V3m9RdFNUo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pj6sYxA9m7yqraLYRDjzuE31ChH+9piaowmKqemEjH8=; b=RCbj8L6TLXUi7dfCN50OZfiq1gzw9cLVj3sKyHLD77PFSSZYIHzJwWkP7XzxfKnLAn c1jJql0kFGSfangVz/RhUzDSs+bb3A1aPltiImlAsVbhKinEh2yWPa2rYN+CMZP3XrWO e68VYI266BHD16RkN7KkSrrpDA4/kbUHEDMuLXc8KsLmBX+qJTHnh9XdjEMNLC3T5J4I FXsTWmXnl7dZYBdGLe3JWJG0Eq7RW+//BRiTp+tB7RF2Zy4jUYS6UEPLeaXkGM2C++Ud +VqBtjSKoZfFi82yTQOFONNNhM5grTqWrxXJopPF4Sw1Kvflm/0zdN2v5gzZ4c8UYGpb RyTA== X-Gm-Message-State: ALQs6tAm/Z0FlRn4dVEu0dpAbbX8vwbSjRetpCGFb2kJcK7OIk0W1F4o cEoRmxgKECg3gLx8/vfY5PpSpai5cjzqBIyG7RUY6A== X-Google-Smtp-Source: AIpwx485PdRkOhJUaTE2HQlzERMBg4mNVcUIEzCK2vaEYj3kxWxMfbNsevcz4dV4P74xZqa4aFBx+T0MvIteCVxNLec= X-Received: by 2002:a0d:c446:: with SMTP id g67-v6mr8121098ywd.387.1524335495835; Sat, 21 Apr 2018 11:31:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:c709:0:0:0:0:0 with HTTP; Sat, 21 Apr 2018 11:31:05 -0700 (PDT) In-Reply-To: <201804211705.w3LH50Dk056339@repo.freebsd.org> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> From: Eitan Adler Date: Sat, 21 Apr 2018 11:31:05 -0700 Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: "Jonathan T. Looney" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 18:31:37 -0000 On 21 April 2018 at 10:05, Jonathan T. Looney wrote: > Author: jtl > Date: Sat Apr 21 17:05:00 2018 > New Revision: 332860 > URL: https://svnweb.freebsd.org/changeset/base/332860 > > Log: > When running with INVARIANTS, the kernel contains extra checks. However, > these assumptions may not hold true once we've panic'd. Therefore, the > checks hold less value after a panic. Additionally, if one of the checks > fails while we are already panic'd, this creates a double-panic which can > interfere with debugging the original panic. Rather than do this I'd rather we modify the invariants to more explicitly state under what conditions it holds. This might be something like KASSERT(!panic && ...) or KASSERT_NOT_IN_PANIC(...) or some other spelling. -- Eitan Adler From owner-svn-src-head@freebsd.org Sat Apr 21 18:43:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C504FFB9A17; Sat, 21 Apr 2018 18:43:09 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78C5574F0E; Sat, 21 Apr 2018 18:43:09 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 735F52B01; Sat, 21 Apr 2018 18:43:09 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3LIh9eC005615; Sat, 21 Apr 2018 18:43:09 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3LIh9nO005614; Sat, 21 Apr 2018 18:43:09 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201804211843.w3LIh9nO005614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Sat, 21 Apr 2018 18:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332861 - head/sys/dev/bktr X-SVN-Group: head X-SVN-Commit-Author: riggs X-SVN-Commit-Paths: head/sys/dev/bktr X-SVN-Commit-Revision: 332861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 18:43:10 -0000 Author: riggs (ports committer) Date: Sat Apr 21 18:43:09 2018 New Revision: 332861 URL: https://svnweb.freebsd.org/changeset/base/332861 Log: Remove unused definition bl_dfp; fix build with bktr compiled into kernel PR: 216566 Submitted by: mail@fbsd.e4m.org Reviewed by: riggs, cognet Approved by: cognet MFC after: 3 days Modified: head/sys/dev/bktr/msp34xx.c Modified: head/sys/dev/bktr/msp34xx.c ============================================================================== --- head/sys/dev/bktr/msp34xx.c Sat Apr 21 17:05:00 2018 (r332860) +++ head/sys/dev/bktr/msp34xx.c Sat Apr 21 18:43:09 2018 (r332861) @@ -111,10 +111,6 @@ #define VIDEO_SOUND_LANG2 8 #define DFP_COUNT 0x41 -static const int bl_dfp[] = { - 0x00, 0x01, 0x02, 0x03, 0x06, 0x08, 0x09, 0x0a, - 0x0b, 0x0d, 0x0e, 0x10 -}; struct msp3400c { int simple; From owner-svn-src-head@freebsd.org Sat Apr 21 20:33:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FA9FFA13FE; Sat, 21 Apr 2018 20:33:36 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-x236.google.com (mail-wr0-x236.google.com [IPv6:2a00:1450:400c:c0c::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C37F66CA2E; Sat, 21 Apr 2018 20:33:35 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-x236.google.com with SMTP id w3-v6so31123758wrg.2; Sat, 21 Apr 2018 13:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GIiSBvhBpP8Sg0eFCbK7058qGvK+RzUmcW2rlTQI/s0=; b=QOlVozQ2ZIJULndDbU28+ELCB51EFlDIIFVpxP9aRizD88tfo+UFQoGPToLzfCpZvp F+0KIWk/+oBRmZ/TLWF7inN9AhoOfX6tDP0oSCR3S17zcNFMRIax/6wPd9h0myDm8XS1 dEw9UxLP0oyHH6BOeYsp5D9w87N4LCwWhzAIafNqcdFXp882I1fpof5ziowJ8IjbcFAY ZBBMNQCl8JotabvA8qOAAtB7d41vA/H1DxZrBYgTB4STqNdN9jGFDEWBjTpTr9pN5MSw e+FPHfhzq6+xHaWdjb1NSyk1ds14bkSHSJt0fzInZTN5MPRCDl6pYR2tq62d1fyLuCfS eNOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GIiSBvhBpP8Sg0eFCbK7058qGvK+RzUmcW2rlTQI/s0=; b=VSyY0ldNMx7pwDof/NE31WrglaOwvq0DCfgWkq0zbyaeMxgptOd2+On/JqVH+f8Y6s ELmEnTSEreNRB+DqJhO4k8SVFm3qbProR//gV299b6Wf3fFXgFZUKqhXKRewRIRYeQsF bjWSg8vNMCITh/4fcvoEgqXaoH9QtnyPHZbOnghdct45i8c7ld4Z45mwtu0S/ew/rjC1 O+x+yxH/e3B3tDaZ6KWHyqslBCtT0VYV27OXCcLnyuVxT+/9vNaHQ9WJ2CTv061FsgZO kQFSkdUSIxHrvpeQlQ6x3VMsfbgVMNm1xwj+ycAzwHm2I5nI91R2B+LytDjGdWNdE5kG MC0w== X-Gm-Message-State: ALQs6tBPJ0FCyLQbvUn8QVzfPWplNZzvVvFst4AD8fFVZVLxzovoSn+Y PXuADWB01xeSEa74ZDOfRLl1fHrmAXxMUMVPcd/uGGnt X-Google-Smtp-Source: AIpwx49UdZjJEZAFsq5orZ2Mja+s6d29EIlvQlrGqD06DrFguK5wKkSSM0q54IC1WkLUzZLSoCUDw5NB1ZVxlIUvRZ4= X-Received: by 10.28.112.3 with SMTP id l3mr5504289wmc.90.1524342814084; Sat, 21 Apr 2018 13:33:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Sat, 21 Apr 2018 13:33:33 -0700 (PDT) In-Reply-To: References: <201804211705.w3LH50Dk056339@repo.freebsd.org> From: Jonathan Looney Date: Sat, 21 Apr 2018 16:33:33 -0400 Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 20:33:36 -0000 On Sat, Apr 21, 2018 at 1:53 PM, Conrad Meyer wrote: > > I don't think this should be enabled by default. Can we leave it > disabled by default and let consumers opt-in? I'm willing to change the default if there's a good reason or consensus for that. However, it is not obvious to me that the default is actually wrong. I think its important that we remember where we are when we hit this code. By the time we hit this code, we've already panic'd (whether due to a "true" panic or a violated assertion). At this point, the system is already in an unknown/unexpected state and we want to preserve our ability to troubleshoot and/or recover. (And, since we're running a system with INVARIANTS, presumably the ability to troubleshoot is important.) We may well violate a second assertion simply because the system is in an unknown/unexpected state. Once we do that, the question is whether we should try to preserve the ability to troubleshoot, or should give up and reset the system. All too often, my ability to debug assertion violations is hindered because the system trips over yet another assertion while dumping the core. If we skip the assertion, nothing bad happens. (The post-panic debugging code already needs to deal with systems that are inconsistent, and it does a pretty good job at it.) On the other hand, I really am not sure what you are worried might happen if we skip checking assertions after we've already panic'd. As far as I can tell, the likely worst case is that we hit a true panic of some kind. In that case, we're no worse off than before. I think the one obvious exception is when we're purposely trying to validate the post-panic debugging code. In that case, you can change the sysctl/tunable to enable troubleshooting. I would honestly appreciate someone explaining the dangers in disabling a response to assertion violations after we've already panic'd and are simply trying to troubleshoot, because they are not obvious to me. But, I could simply be missing them. Jonathan