From owner-svn-src-head@freebsd.org Sun Oct 25 03:16:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 450B8A18BDE; Sun, 25 Oct 2015 03:16:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 118401F60; Sun, 25 Oct 2015 03:16:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9P3G9nM073582; Sun, 25 Oct 2015 03:16:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9P3G92N073581; Sun, 25 Oct 2015 03:16:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510250316.t9P3G92N073581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 25 Oct 2015 03:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289913 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 03:16:10 -0000 Author: ngie Date: Sun Oct 25 03:16:08 2015 New Revision: 289913 URL: https://svnweb.freebsd.org/changeset/base/289913 Log: Use 't' (bits) not 'i' (bytes) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database as the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is 4 bits wide, not 4 bytes wide 1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf Bug 200619 MFC after: 1 week Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division Modified: head/share/misc/scsi_modes Modified: head/share/misc/scsi_modes ============================================================================== --- head/share/misc/scsi_modes Sat Oct 24 23:46:32 2015 (r289912) +++ head/share/misc/scsi_modes Sun Oct 25 03:16:08 2015 (r289913) @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } From owner-svn-src-head@freebsd.org Sun Oct 25 03:22:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB9D5A18D93; Sun, 25 Oct 2015 03:22:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B864E672; Sun, 25 Oct 2015 03:22:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9P3MLU2076367; Sun, 25 Oct 2015 03:22:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9P3ML14076366; Sun, 25 Oct 2015 03:22:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510250322.t9P3ML14076366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 25 Oct 2015 03:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289914 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 03:22:23 -0000 Author: ngie Date: Sun Oct 25 03:22:21 2015 New Revision: 289914 URL: https://svnweb.freebsd.org/changeset/base/289914 Log: Revert r289913 -- I botched up the commit message by accident Will redo the commit shortly Modified: head/share/misc/scsi_modes Modified: head/share/misc/scsi_modes ============================================================================== --- head/share/misc/scsi_modes Sun Oct 25 03:16:08 2015 (r289913) +++ head/share/misc/scsi_modes Sun Oct 25 03:22:21 2015 (r289914) @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} t4 + {MRIE} b4 {Interval Timer} i4 {Report Count} i4 } From owner-svn-src-head@freebsd.org Sun Oct 25 04:04:26 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A59C5A1C50B; Sun, 25 Oct 2015 04:04:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70E4861F; Sun, 25 Oct 2015 04:04:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9P44PlE088266; Sun, 25 Oct 2015 04:04:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9P44PqD088265; Sun, 25 Oct 2015 04:04:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510250404.t9P44PqD088265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 25 Oct 2015 04:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289915 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 04:04:26 -0000 Author: ngie Date: Sun Oct 25 04:04:25 2015 New Revision: 289915 URL: https://svnweb.freebsd.org/changeset/base/289915 Log: Use 't' (bit-field) not 'b' (bit-sized integral type) for describing MRIE (aka "Method of Reporting Informational Exceptions") in the SCSI mode database. T10/04-371 revision 2 (revision 4; page 2, table 1) describes it as a bit-field of 4 bits wide. 1. http://www.t10.org/ftp/t10/document.04/04-371r2.pdf This a recommit of head@r289913 to fix the original commit message, in particular: - I incorrectly claimed that unit change was 'i' -> 't'. - The spec I reference in this commit is 2 decades newer than the one noted in r289913. The fields in the SCSI mode database are more complete in the newer spec, so it'll be easier for someone to decipher this commit if need be later. - I screwed up the bug entry in the previous commit message Pointyhat to: ngie (for botching up r289913) PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Divisionf Modified: head/share/misc/scsi_modes Modified: head/share/misc/scsi_modes ============================================================================== --- head/share/misc/scsi_modes Sun Oct 25 03:22:21 2015 (r289914) +++ head/share/misc/scsi_modes Sun Oct 25 04:04:25 2015 (r289915) @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } From owner-svn-src-head@freebsd.org Sun Oct 25 04:37:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E729A1CA98; Sun, 25 Oct 2015 04:37:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BCA81; Sun, 25 Oct 2015 04:37:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9P4b0po097538; Sun, 25 Oct 2015 04:37:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9P4b0Yl097537; Sun, 25 Oct 2015 04:37:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510250437.t9P4b0Yl097537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 25 Oct 2015 04:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289916 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 04:37:02 -0000 Author: ngie Date: Sun Oct 25 04:37:00 2015 New Revision: 289916 URL: https://svnweb.freebsd.org/changeset/base/289916 Log: Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the mode value isn't always clipped to -1 when (resolution * size) == 32, which would have been the case with values => {4i,32b,32t}. This seems to have been broken in r64382. MFC after: 1 week X-MFC with: r289915 PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Sun Oct 25 04:04:25 2015 (r289915) +++ head/sbin/camcontrol/modeedit.c Sun Oct 25 04:37:00 2015 (r289916) @@ -246,7 +246,7 @@ editentry_set(char *name, char *newvalue * currently workaround it (even for int64's), so we have to kludge it. */ #define RESOLUTION_MAX(size) ((resolution * (size) == 32)? \ - (int)0xffffffff: (1 << (resolution * (size))) - 1) + INT_MAX: (1 << (resolution * (size))) - 1) assert(newvalue != NULL); if (*newvalue == '\0') From owner-svn-src-head@freebsd.org Sun Oct 25 04:51:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8021A1CE74; Sun, 25 Oct 2015 04:51:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (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 9925D899; Sun, 25 Oct 2015 04:51:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by oiad129 with SMTP id d129so84905846oia.0; Sat, 24 Oct 2015 21:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=l4b9t1LZrRwT8QdK7Gi3nVbfAwqPWt9puxpCGwqCVrk=; b=L0/FIdSOighW5HCGkz7WpSuMMajRWknrK/RK/yVZj/TvCZ8uBL9+uUxCr+Dmzl9x4F VNUyqryZUVqN6RxJKPuj8JmWD79KWCuDdGvMI3aHPdqgnOk6SAw1Jm2MQv9Yf235cGRs JIV+R7xDCWGee86gb4CTsnGhRxqPWZvHXegHX+AA32tNLQ+hzZYgewicm5ANi1eXX3G3 5PypTt+rWRgqMK+UHwq5anBaBVhrsbo2kxcKmyHNf+QyWLThjszs+XA2FVXsi3aYzw1S 4JxzGbUII2/y1b+Qw6I0ARwZmIwBErFv4mohHK9lNHaEfCRU/8iessiCug/zR4Weomrq Ppqg== X-Received: by 10.202.71.9 with SMTP id u9mr13907823oia.118.1445748663592; Sat, 24 Oct 2015 21:51:03 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:6c5b:a5fd:aec8:13bf? ([2601:601:800:126d:6c5b:a5fd:aec8:13bf]) by smtp.gmail.com with ESMTPSA id t192sm12092639oie.29.2015.10.24.21.51.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Oct 2015 21:51:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r282145 - head/etc/rc.d From: NGie Cooper In-Reply-To: <201504281313.t3SDDOr1074557@svn.freebsd.org> Date: Sat, 24 Oct 2015 21:51:01 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5B403542-1277-4D18-9B4B-92A1EA1A6F96@gmail.com> References: <201504281313.t3SDDOr1074557@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 04:51:04 -0000 > On Apr 28, 2015, at 06:13, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Tue Apr 28 13:13:23 2015 > New Revision: 282145 > URL: https://svnweb.freebsd.org/changeset/base/282145 >=20 > Log: > Require "ldconfig" for "devd". It is possible that user puts into > devd.conf execution of third-party software, that needs libraries > from /usr/local. Since devd is launched before ldconfig script, if > the hardware that has associated software is attached on boot, then > execution would fail. >=20 > Differential Revision: https://reviews.freebsd.org/D2332 > Reviewed by: imp This broke rcorder. With my custom knobs it breaks with: rcorder: Circular dependency on provision `ldconfig' in file `devd=E2=80=99= . With the defaults knobs, it breaks like this: rcorder: Circular dependency on provision `mountcritremote' in file = `ldconfig'. Repro: (cd /usr/src/etc/rc.d; rcorder `SRCCONF=3D/dev/null make -VFILES` 2>&1)= From owner-svn-src-head@freebsd.org Sun Oct 25 07:42:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0768C8192; Sun, 25 Oct 2015 07:42:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B834A1C1D; Sun, 25 Oct 2015 07:42:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9P7guWi056062; Sun, 25 Oct 2015 07:42:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9P7gu04056060; Sun, 25 Oct 2015 07:42:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510250742.t9P7gu04056060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 25 Oct 2015 07:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289925 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 07:42:58 -0000 Author: ngie Date: Sun Oct 25 07:42:56 2015 New Revision: 289925 URL: https://svnweb.freebsd.org/changeset/base/289925 Log: Fix compiling with gcc [4.2.1] after r287797 when MK_HESOID == no and MK_NIS == no by converting `i` back to an int, and instead cast the loop comparison to `int` The loop comparison is iterating the len(ns_dtab)-1, because the last element is the sentinel tuple { NULL, NULL, NULL, }, so when both HESOID and NIS are off, len(ns_dtab)-1 == 1 - 1 == 0, and the loop is skipped because the expression is tautologically false While here, convert `(sizeof(x) / sizeof(x[0]))` to `nitems(x)` Tested with: clang 3.7.0, gcc 4.2.1, and gcc 4.9.4 [*] with MK_NIS={no,yes} and by running bash -lc 'id -u && id -g && id' * gcc 4.9.4 needs another patch in order for the compile to succeed with -Werror with lib/libc/gen/getgrent.c Reported by: jhibbits Modified: head/lib/libc/gen/getgrent.c head/lib/libc/gen/getpwent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Sun Oct 25 07:26:12 2015 (r289924) +++ head/lib/libc/gen/getgrent.c Sun Oct 25 07:42:56 2015 (r289925) @@ -1239,14 +1239,13 @@ compat_setgrent(void *retval, void *mdat int rv, stayopen; #define set_setent(x, y) do { \ - unsigned int i; \ - \ - for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \ + int i; \ + for (i = 0; i < (int)(nitems(x) - 1); i++) \ x[i].mdata = (void *)y; \ } while (0) rv = compat_getstate(&st); - if (rv != 0) + if (rv != 0) return (NS_UNAVAIL); switch ((enum constants)mdata) { case SETGRENT: @@ -1309,9 +1308,8 @@ compat_group(void *retval, void *mdata, int rv, stayopen, *errnop; #define set_lookup_type(x, y) do { \ - unsigned int i; \ - \ - for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \ + int i; \ + for (i = 0; i < (int)(nitems(x) - 1); i++) \ x[i].mdata = (void *)y; \ } while (0) Modified: head/lib/libc/gen/getpwent.c ============================================================================== --- head/lib/libc/gen/getpwent.c Sun Oct 25 07:26:12 2015 (r289924) +++ head/lib/libc/gen/getpwent.c Sun Oct 25 07:42:56 2015 (r289925) @@ -1607,10 +1607,9 @@ compat_redispatch(struct compat_state *s { NULL, NULL, NULL } }; void *discard; - int rv, e; - unsigned int i; + int e, i, rv; - for (i = 0; i < sizeof(dtab)/sizeof(dtab[0]) - 1; i++) + for (i = 0; i < (int)(nitems(dtab) - 1); i++) dtab[i].mdata = (void *)lookup_how; more: pwd_init(pwd); @@ -1703,9 +1702,8 @@ compat_setpwent(void *retval, void *mdat int rv, stayopen; #define set_setent(x, y) do { \ - unsigned int i; \ - \ - for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++) \ + int i; \ + for (i = 0; i < (int)(nitems(x) - 1); i++) \ x[i].mdata = (void *)y; \ } while (0) From owner-svn-src-head@freebsd.org Sun Oct 25 10:49:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B87A8BFE; Sun, 25 Oct 2015 10:49:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id D99C41FF0; Sun, 25 Oct 2015 10:49:06 +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 t9PAn5Of011229; Sun, 25 Oct 2015 10:49:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PAn5LI011225; Sun, 25 Oct 2015 10:49:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510251049.t9PAn5LI011225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Oct 2015 10:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289930 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 10:49:07 -0000 Author: mav Date: Sun Oct 25 10:49:05 2015 New Revision: 289930 URL: https://svnweb.freebsd.org/changeset/base/289930 Log: Formalize/unify chip (re-)inits. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_sbus.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Oct 25 09:16:20 2015 (r289929) +++ head/sys/dev/isp/isp.c Sun Oct 25 10:49:05 2015 (r289930) @@ -1368,6 +1368,8 @@ isp_scsi_init(ispsoftc_t *isp) sdparam *sdp_chan0, *sdp_chan1; mbreg_t mbs; + isp->isp_state = ISP_INITSTATE; + sdp_chan0 = SDPARAM(isp, 0); sdp_chan1 = sdp_chan0; if (IS_DUALBUS(isp)) { @@ -1543,7 +1545,7 @@ isp_scsi_init(ispsoftc_t *isp) } } - isp->isp_state = ISP_INITSTATE; + isp->isp_state = ISP_RUNSTATE; } static void @@ -1673,11 +1675,10 @@ isp_fibre_init(ispsoftc_t *isp) * We only support one channel on non-24XX cards */ fcp = FCPARAM(isp, 0); - if (fcp->role == ISP_ROLE_NONE) { - isp->isp_state = ISP_INITSTATE; + if (fcp->role == ISP_ROLE_NONE) return; - } + isp->isp_state = ISP_INITSTATE; ISP_MEMZERO(icbp, sizeof (*icbp)); icbp->icb_version = ICB_VERSION1; icbp->icb_fwoptions = fcp->isp_fwoptions; @@ -1978,7 +1979,7 @@ isp_fibre_init(ispsoftc_t *isp) /* * Whatever happens, we're now committed to being here. */ - isp->isp_state = ISP_INITSTATE; + isp->isp_state = ISP_RUNSTATE; } static void @@ -2001,10 +2002,11 @@ isp_fibre_init_2400(ispsoftc_t *isp) } if (chan == isp->isp_nchan) { isp_prt(isp, ISP_LOG_WARN1, "all %d channels with role 'none'", chan); - isp->isp_state = ISP_INITSTATE; return; } + isp->isp_state = ISP_INITSTATE; + /* * Start with channel 0. */ @@ -2285,7 +2287,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) /* * Whatever happens, we're now committed to being here. */ - isp->isp_state = ISP_INITSTATE; + isp->isp_state = ISP_RUNSTATE; } static void @@ -4349,16 +4351,6 @@ isp_start(XS_T *xs) isp = XS_ISP(xs); /* - * Now make sure we're running. - */ - - if (isp->isp_state != ISP_RUNSTATE) { - isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE"); - XS_SETERR(xs, HBA_BOTCH); - return (CMD_COMPLETE); - } - - /* * Check command CDB length, etc.. We really are limited to 16 bytes * for Fibre Channel, but can do up to 44 bytes in parallel SCSI, * but probably only if we're running fairly new firmware (we'll @@ -4387,6 +4379,12 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } + if (isp->isp_state != ISP_RUNSTATE) { + isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE"); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } + /* * Try again later. */ @@ -4423,6 +4421,13 @@ isp_start(XS_T *xs) XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } + + if (isp->isp_state != ISP_RUNSTATE) { + isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE"); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } + if (sdp->update) { isp_spi_update(isp, XS_CHANNEL(xs)); } @@ -7915,7 +7920,8 @@ isp_reinit(ispsoftc_t *isp, int do_load_ { int i, res = 0; - isp_reset(isp, do_load_defaults); + if (isp->isp_state != ISP_RESETSTATE) + isp_reset(isp, do_load_defaults); if (isp->isp_state != ISP_RESETSTATE) { res = EIO; isp_prt(isp, ISP_LOGERR, "%s: cannot reset card", __func__); @@ -7924,15 +7930,10 @@ isp_reinit(ispsoftc_t *isp, int do_load_ } isp_init(isp); - if (isp->isp_state == ISP_INITSTATE) { - isp->isp_state = ISP_RUNSTATE; - } - - if (isp->isp_state != ISP_RUNSTATE) { + if (isp->isp_state > ISP_RESETSTATE && + isp->isp_state != ISP_RUNSTATE) { res = EIO; -#ifndef ISP_TARGET_MODE - isp_prt(isp, ISP_LOGWARN, "%s: not at runstate", __func__); -#endif + isp_prt(isp, ISP_LOGERR, "%s: cannot init card", __func__); ISP_DISABLE_INTS(isp); if (IS_FC(isp)) { /* Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Oct 25 09:16:20 2015 (r289929) +++ head/sys/dev/isp/isp_freebsd.c Sun Oct 25 10:49:05 2015 (r289930) @@ -4029,19 +4029,6 @@ isp_action(struct cam_sim *sim, union cc isp_prt(isp, ISP_LOGDEBUG2, "isp_action code %x", ccb->ccb_h.func_code); ISP_PCMD(ccb) = NULL; - if (isp->isp_state != ISP_RUNSTATE && ccb->ccb_h.func_code == XPT_SCSI_IO) { - isp_init(isp); - if (isp->isp_state != ISP_INITSTATE) { - /* - * Lie. Say it was a selection timeout. - */ - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - isp_done((struct ccb_scsiio *) ccb); - return; - } - isp->isp_state = ISP_RUNSTATE; - } - switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: /* Execute the requested I/O operation */ bus = XS_CHANNEL(ccb); Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Oct 25 09:16:20 2015 (r289929) +++ head/sys/dev/isp/isp_pci.c Sun Oct 25 10:49:05 2015 (r289930) @@ -991,15 +991,10 @@ isp_pci_attach(device_t dev) * Make sure we're in reset state. */ ISP_LOCK(isp); - isp_reset(isp, 1); - if (isp->isp_state != ISP_RESETSTATE) { + if (isp_reinit(isp, 1) != 0) { ISP_UNLOCK(isp); goto bad; } - isp_init(isp); - if (isp->isp_state == ISP_INITSTATE) { - isp->isp_state = ISP_RUNSTATE; - } ISP_UNLOCK(isp); if (isp_attach(isp)) { ISP_LOCK(isp); Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Sun Oct 25 09:16:20 2015 (r289929) +++ head/sys/dev/isp/isp_sbus.c Sun Oct 25 10:49:05 2015 (r289930) @@ -313,16 +313,11 @@ isp_sbus_attach(device_t dev) * Make sure we're in reset state. */ ISP_LOCK(isp); - isp_reset(isp, 1); - if (isp->isp_state != ISP_RESETSTATE) { + if (isp_reinit(isp, 1) != 0) { isp_uninit(isp); ISP_UNLOCK(isp); goto bad; } - isp_init(isp); - if (isp->isp_state == ISP_INITSTATE) { - isp->isp_state = ISP_RUNSTATE; - } ISP_UNLOCK(isp); if (isp_attach(isp)) { ISP_LOCK(isp); From owner-svn-src-head@freebsd.org Sun Oct 25 12:09:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5708B80E7; Sun, 25 Oct 2015 12:09:29 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2620C1062; Sun, 25 Oct 2015 12:09:29 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PC9ShM033910; Sun, 25 Oct 2015 12:09:28 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PC9SRg033909; Sun, 25 Oct 2015 12:09:28 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201510251209.t9PC9SRg033909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 25 Oct 2015 12:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289931 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 12:09:29 -0000 Author: ache Date: Sun Oct 25 12:09:28 2015 New Revision: 289931 URL: https://svnweb.freebsd.org/changeset/base/289931 Log: According to POSIX, a write operation shall start at the current size of the stream (if mode had 'a' as the first character). MFC after: 1 week Modified: head/lib/libc/stdio/fmemopen.c Modified: head/lib/libc/stdio/fmemopen.c ============================================================================== --- head/lib/libc/stdio/fmemopen.c Sun Oct 25 10:49:05 2015 (r289930) +++ head/lib/libc/stdio/fmemopen.c Sun Oct 25 12:09:28 2015 (r289931) @@ -149,6 +149,9 @@ fmemopen(void * __restrict buf, size_t s return (NULL); } + if (mode[0] == 'a') + f->_flags |= __SAPP; + /* * Turn off buffering, so a write past the end of the buffer * correctly returns a short object count. From owner-svn-src-head@freebsd.org Sun Oct 25 13:14:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3441E8D57; Sun, 25 Oct 2015 13:14:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00C331A5C; Sun, 25 Oct 2015 13:14:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PDEscM053441; Sun, 25 Oct 2015 13:14:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PDEsV6053440; Sun, 25 Oct 2015 13:14:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201510251314.t9PDEsV6053440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 25 Oct 2015 13:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289932 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 13:14:55 -0000 Author: kp Date: Sun Oct 25 13:14:53 2015 New Revision: 289932 URL: https://svnweb.freebsd.org/changeset/base/289932 Log: PF_ANEQ() macro will in most situations returns TRUE comparing two identical IPv4 packets (when it should return FALSE). It happens because PF_ANEQ() doesn't stop if first 32 bits of IPv4 packets are equal and starts to check next 3*32 bits (like for IPv6 packet). Those bits containt some garbage and in result PF_ANEQ() wrongly returns TRUE. Fix: Check if packet is of AF_INET type and if it is then compare only first 32 bits of data. PR: 204005 Submitted by: MiƂosz Kaniewski Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Oct 25 12:09:28 2015 (r289931) +++ head/sys/net/pfvar.h Sun Oct 25 13:14:53 2015 (r289932) @@ -198,10 +198,11 @@ extern struct rwlock pf_rules_lock; (a)->addr32[0] == (b)->addr32[0])) \ #define PF_ANEQ(a, b, c) \ - ((a)->addr32[0] != (b)->addr32[0] || \ + ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \ + (c == AF_INET6 && (a)->addr32[3] != (b)->addr32[3] && \ (a)->addr32[1] != (b)->addr32[1] || \ (a)->addr32[2] != (b)->addr32[2] || \ - (a)->addr32[3] != (b)->addr32[3]) \ + (a)->addr32[3] != (b)->addr32[3])) \ #define PF_AZERO(a, c) \ ((c == AF_INET && !(a)->addr32[0]) || \ From owner-svn-src-head@freebsd.org Sun Oct 25 14:34:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E5AD891B; Sun, 25 Oct 2015 14:34:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 30BF213F0; Sun, 25 Oct 2015 14:34:09 +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 t9PEY8B2075978; Sun, 25 Oct 2015 14:34:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PEY8Sf075976; Sun, 25 Oct 2015 14:34:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510251434.t9PEY8Sf075976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Oct 2015 14:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289933 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 14:34:09 -0000 Author: mav Date: Sun Oct 25 14:34:07 2015 New Revision: 289933 URL: https://svnweb.freebsd.org/changeset/base/289933 Log: Improve Port Database Changed handling and reporting. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Oct 25 13:14:53 2015 (r289932) +++ head/sys/dev/isp/isp.c Sun Oct 25 14:34:07 2015 (r289933) @@ -6074,21 +6074,22 @@ isp_parse_async_fc(ispsoftc_t *isp, uint case ASYNC_PDB_CHANGED: { - int nphdl, nlstate, reason; - /* - * We *should* get a channel out of the 24XX, but we don't seem - * to get more than a PDB CHANGED on channel 0, so turn it into - * a broadcast event. - */ + int echan, nphdl, nlstate, reason; + if (IS_24XX(isp)) { nphdl = ISP_READ(isp, OUTMAILBOX1); nlstate = ISP_READ(isp, OUTMAILBOX2); - reason = ISP_READ(isp, OUTMAILBOX3) >> 8; + reason = ISP_READ(isp, OUTMAILBOX3); + chan = reason & 0xff; + echan = (nphdl == NIL_HANDLE) ? + isp->isp_nchan - 1 : chan; + reason = reason >> 8; } else { nphdl = NIL_HANDLE; nlstate = reason = 0; + chan = echan = 0; } - for (chan = 0; chan < isp->isp_nchan; chan++) { + for (; chan <= echan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) { Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Oct 25 13:14:53 2015 (r289932) +++ head/sys/dev/isp/isp_freebsd.c Sun Oct 25 14:34:07 2015 (r289933) @@ -382,14 +382,16 @@ isp_freeze_loopdown(ispsoftc_t *isp, int if (IS_FC(isp)) { struct isp_fc *fc = ISP_FC_PC(isp, chan); if (fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGDEBUG0, "%s: freeze simq (loopdown) chan %d", msg, chan); + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d %s -- freeze simq (loopdown)", chan, msg); fc->simqfrozen = SIMQFRZ_LOOPDOWN; #if __FreeBSD_version >= 1000039 xpt_hold_boot(); #endif xpt_freeze_simq(fc->sim, 1); } else { - isp_prt(isp, ISP_LOGDEBUG0, "%s: mark frozen (loopdown) chan %d", msg, chan); + isp_prt(isp, ISP_LOGDEBUG0, + "Chan %d %s -- mark frozen (loopdown)", chan, msg); fc->simqfrozen |= SIMQFRZ_LOOPDOWN; } } @@ -4988,11 +4990,11 @@ changed: fc = ISP_FC_PC(isp, bus); if (evt == ISPASYNC_CHANGE_PDB) { - msg = "Chan %d Port Database Changed"; + msg = "Port Database Changed"; } else if (evt == ISPASYNC_CHANGE_SNS) { - msg = "Chan %d Name Server Database Changed"; + msg = "Name Server Database Changed"; } else { - msg = "Chan %d Other Change Notify"; + msg = "Other Change Notify"; } /* @@ -5002,7 +5004,7 @@ changed: isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Stopping Loop Down Timer @ %lu", (unsigned long) time_uptime); callout_stop(&fc->ldt); } - isp_prt(isp, ISP_LOGINFO, msg, bus); + isp_prt(isp, ISP_LOGINFO, "Chan %d %s", bus, msg); if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, bus, msg); } From owner-svn-src-head@freebsd.org Sun Oct 25 14:42:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FCE8A44; Sun, 25 Oct 2015 14:42:58 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 86AF71914; Sun, 25 Oct 2015 14:42:57 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PEguhA078812; Sun, 25 Oct 2015 14:42:56 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PEguU7078810; Sun, 25 Oct 2015 14:42:56 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201510251442.t9PEguU7078810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sun, 25 Oct 2015 14:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289934 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 14:42:58 -0000 Author: dumbbell Date: Sun Oct 25 14:42:56 2015 New Revision: 289934 URL: https://svnweb.freebsd.org/changeset/base/289934 Log: drm/i915: Reduce diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. MFC after: 2 months Modified: head/sys/dev/drm2/i915/i915_irq.c head/sys/dev/drm2/i915/intel_display.c Modified: head/sys/dev/drm2/i915/i915_irq.c ============================================================================== --- head/sys/dev/drm2/i915/i915_irq.c Sun Oct 25 14:34:07 2015 (r289933) +++ head/sys/dev/drm2/i915/i915_irq.c Sun Oct 25 14:42:56 2015 (r289934) @@ -132,8 +132,7 @@ i915_pipe_enabled(struct drm_device *dev /* Called from drm generic code, passed a 'crtc', which * we use as a pipe index */ -static u32 -i915_get_vblank_counter(struct drm_device *dev, int pipe) +static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; unsigned long high_frame; @@ -141,7 +140,7 @@ i915_get_vblank_counter(struct drm_devic u32 high1, high2, low; if (!i915_pipe_enabled(dev, pipe)) { - DRM_DEBUG("trying to get vblank count for disabled " + DRM_DEBUG_DRIVER("trying to get vblank count for disabled " "pipe %c\n", pipe_name(pipe)); return 0; } @@ -165,14 +164,13 @@ i915_get_vblank_counter(struct drm_devic return (high1 << 8) | low; } -static u32 -gm45_get_vblank_counter(struct drm_device *dev, int pipe) +static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int reg = PIPE_FRMCOUNT_GM45(pipe); if (!i915_pipe_enabled(dev, pipe)) { - DRM_DEBUG("i915: trying to get vblank count for disabled " + DRM_DEBUG_DRIVER("trying to get vblank count for disabled " "pipe %c\n", pipe_name(pipe)); return 0; } @@ -180,9 +178,8 @@ gm45_get_vblank_counter(struct drm_devic return I915_READ(reg); } -static int -i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, - int *vpos, int *hpos) +static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, + int *vpos, int *hpos) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; u32 vbl = 0, position = 0; @@ -191,7 +188,7 @@ i915_get_crtc_scanoutpos(struct drm_devi int ret = 0; if (!i915_pipe_enabled(dev, pipe)) { - DRM_DEBUG("i915: trying to get scanoutpos for disabled " + DRM_DEBUG_DRIVER("trying to get scanoutpos for disabled " "pipe %c\n", pipe_name(pipe)); return 0; } @@ -247,9 +244,10 @@ i915_get_crtc_scanoutpos(struct drm_devi return ret; } -static int -i915_get_vblank_timestamp(struct drm_device *dev, int pipe, int *max_error, - struct timeval *vblank_time, unsigned flags) +static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe, + int *max_error, + struct timeval *vblank_time, + unsigned flags) { struct drm_i915_private *dev_priv = dev->dev_private; struct drm_crtc *crtc; @@ -268,7 +266,7 @@ i915_get_vblank_timestamp(struct drm_dev if (!crtc->enabled) { #if 0 - DRM_DEBUG("crtc %d is disabled\n", pipe); + DRM_DEBUG_KMS("crtc %d is disabled\n", pipe); #endif return -EBUSY; } @@ -282,19 +280,14 @@ i915_get_vblank_timestamp(struct drm_dev /* * Handle hotplug events outside the interrupt handler proper. */ -static void -i915_hotplug_work_func(void *context, int pending) +static void i915_hotplug_work_func(void *context, int pending) { drm_i915_private_t *dev_priv = context; struct drm_device *dev = dev_priv->dev; - struct drm_mode_config *mode_config; + struct drm_mode_config *mode_config = &dev->mode_config; struct intel_encoder *encoder; DRM_DEBUG("running encoder hotplug functions\n"); - dev_priv = context; - dev = dev_priv->dev; - - mode_config = &dev->mode_config; sx_xlock(&mode_config->mutex); DRM_DEBUG_KMS("running encoder hotplug functions\n"); @@ -350,29 +343,25 @@ static void notify_ring(struct drm_devic if (ring->obj == NULL) return; - CTR2(KTR_DRM, "request_complete %s %d", ring->name, - ring->get_seqno(ring)); + CTR2(KTR_DRM, "request_complete %s %d", ring->name, ring->get_seqno(ring)); mtx_lock(&dev_priv->irq_lock); wakeup(ring); mtx_unlock(&dev_priv->irq_lock); - if (i915_enable_hangcheck) { dev_priv->hangcheck_count = 0; callout_schedule(&dev_priv->hangcheck_timer, - DRM_I915_HANGCHECK_PERIOD); + DRM_I915_HANGCHECK_PERIOD); } } -static void -gen6_pm_rps_work_func(void *arg, int pending) +static void gen6_pm_rps_work(void *context, int pending) { struct drm_device *dev; - drm_i915_private_t *dev_priv; - u8 new_delay; + drm_i915_private_t *dev_priv = context; u32 pm_iir, pm_imr; + u8 new_delay; - dev_priv = (drm_i915_private_t *)arg; dev = dev_priv->dev; new_delay = dev_priv->cur_delay; @@ -467,7 +456,7 @@ static void gen6_queue_rps_work(struct d taskqueue_enqueue(dev_priv->tq, &dev_priv->rps_task); } -static void valleyview_irq_handler(void *arg) +static void valleyview_irq_handler(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -518,7 +507,7 @@ static void valleyview_irq_handler(void hotplug_status); if (hotplug_status & dev_priv->hotplug_supported_mask) taskqueue_enqueue(dev_priv->tq, - &dev_priv->hotplug_task); + &dev_priv->hotplug_task); I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); I915_READ(PORT_HOTPLUG_STAT); @@ -548,7 +537,8 @@ static void valleyview_irq_handler(void I915_WRITE(VLV_IIR, iir); } -out:; +out: + return; } static void pch_irq_handler(struct drm_device *dev, u32 pch_iir) @@ -557,42 +547,41 @@ static void pch_irq_handler(struct drm_d int pipe; if (pch_iir & SDE_AUDIO_POWER_MASK) - DRM_DEBUG("i915: PCH audio power change on port %d\n", + DRM_DEBUG_DRIVER("PCH audio power change on port %d\n", (pch_iir & SDE_AUDIO_POWER_MASK) >> SDE_AUDIO_POWER_SHIFT); if (pch_iir & SDE_GMBUS) - DRM_DEBUG("i915: PCH GMBUS interrupt\n"); + DRM_DEBUG_DRIVER("PCH GMBUS interrupt\n"); if (pch_iir & SDE_AUDIO_HDCP_MASK) - DRM_DEBUG("i915: PCH HDCP audio interrupt\n"); + DRM_DEBUG_DRIVER("PCH HDCP audio interrupt\n"); if (pch_iir & SDE_AUDIO_TRANS_MASK) - DRM_DEBUG("i915: PCH transcoder audio interrupt\n"); + DRM_DEBUG_DRIVER("PCH transcoder audio interrupt\n"); if (pch_iir & SDE_POISON) - DRM_ERROR("i915: PCH poison interrupt\n"); + DRM_ERROR("PCH poison interrupt\n"); if (pch_iir & SDE_FDI_MASK) for_each_pipe(pipe) - DRM_DEBUG(" pipe %c FDI IIR: 0x%08x\n", + DRM_DEBUG_DRIVER(" pipe %c FDI IIR: 0x%08x\n", pipe_name(pipe), I915_READ(FDI_RX_IIR(pipe))); if (pch_iir & (SDE_TRANSB_CRC_DONE | SDE_TRANSA_CRC_DONE)) - DRM_DEBUG("i915: PCH transcoder CRC done interrupt\n"); + DRM_DEBUG_DRIVER("PCH transcoder CRC done interrupt\n"); if (pch_iir & (SDE_TRANSB_CRC_ERR | SDE_TRANSA_CRC_ERR)) - DRM_DEBUG("i915: PCH transcoder CRC error interrupt\n"); + DRM_DEBUG_DRIVER("PCH transcoder CRC error interrupt\n"); if (pch_iir & SDE_TRANSB_FIFO_UNDER) - DRM_DEBUG("i915: PCH transcoder B underrun interrupt\n"); + DRM_DEBUG_DRIVER("PCH transcoder B underrun interrupt\n"); if (pch_iir & SDE_TRANSA_FIFO_UNDER) - DRM_DEBUG("PCH transcoder A underrun interrupt\n"); + DRM_DEBUG_DRIVER("PCH transcoder A underrun interrupt\n"); } -static void -ivybridge_irq_handler(void *arg) +static void ivybridge_irq_handler(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -606,7 +595,7 @@ ivybridge_irq_handler(void *arg) I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL); POSTING_READ(DEIER); - gt_iir = I915_READ(GTIIR); + gt_iir = I915_READ(GTIIR); if (gt_iir) { snb_gt_irq_handler(dev, dev_priv, gt_iir); I915_WRITE(GTIIR, gt_iir); @@ -666,10 +655,9 @@ static void ilk_gt_irq_handler(struct dr notify_ring(dev, &dev_priv->rings[VCS]); } -static void -ironlake_irq_handler(void *arg) +static void ironlake_irq_handler(DRM_IRQ_ARGS) { - struct drm_device *dev = arg; + struct drm_device *dev = (struct drm_device *) arg; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; u32 de_iir, gt_iir, de_ier, pch_iir, pm_iir; u32 hotplug_mask; @@ -703,9 +691,8 @@ ironlake_irq_handler(void *arg) else snb_gt_irq_handler(dev, dev_priv, gt_iir); - if (de_iir & DE_GSE) { + if (de_iir & DE_GSE) intel_opregion_gse_intr(dev); - } if (de_iir & DE_PLANEA_FLIP_DONE) { intel_prepare_page_flip(dev, 0); @@ -757,8 +744,7 @@ done: * Fire an error uevent so userspace can see that a hang or error * was detected. */ -static void -i915_error_work_func(void *context, int pending) +static void i915_error_work_func(void *context, int pending) { drm_i915_private_t *dev_priv = context; struct drm_device *dev = dev_priv->dev; @@ -766,7 +752,7 @@ i915_error_work_func(void *context, int /* kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event); */ if (atomic_load_acq_int(&dev_priv->mm.wedged)) { - DRM_DEBUG("i915: resetting chip\n"); + DRM_DEBUG_DRIVER("resetting chip\n"); /* kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event); */ if (!i915_reset(dev)) { atomic_store_rel_int(&dev_priv->mm.wedged, 0); @@ -779,1192 +765,1381 @@ i915_error_work_func(void *context, int } } -#define pr_err(...) printf(__VA_ARGS__) - -static void i915_report_and_clear_eir(struct drm_device *dev) +static struct drm_i915_error_object * +i915_error_object_create(struct drm_i915_private *dev_priv, + struct drm_i915_gem_object *src) { - struct drm_i915_private *dev_priv = dev->dev_private; - u32 eir = I915_READ(EIR); - int pipe; + struct drm_i915_error_object *dst; + struct sf_buf *sf; + void *d, *s; + int page, page_count; + u32 reloc_offset; - if (!eir) - return; + if (src == NULL || src->pages == NULL) + return NULL; - printf("i915: render error detected, EIR: 0x%08x\n", eir); + page_count = src->base.size / PAGE_SIZE; - if (IS_G4X(dev)) { - if (eir & (GM45_ERROR_MEM_PRIV | GM45_ERROR_CP_PRIV)) { - u32 ipeir = I915_READ(IPEIR_I965); + dst = malloc(sizeof(*dst) + page_count * sizeof(u32 *), DRM_I915_GEM, + M_NOWAIT); + if (dst == NULL) + return (NULL); - pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965)); - pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965)); - pr_err(" INSTDONE: 0x%08x\n", - I915_READ(INSTDONE_I965)); - pr_err(" INSTPS: 0x%08x\n", I915_READ(INSTPS)); - pr_err(" INSTDONE1: 0x%08x\n", I915_READ(INSTDONE1)); - pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965)); - I915_WRITE(IPEIR_I965, ipeir); - POSTING_READ(IPEIR_I965); - } - if (eir & GM45_ERROR_PAGE_TABLE) { - u32 pgtbl_err = I915_READ(PGTBL_ER); - pr_err("page table error\n"); - pr_err(" PGTBL_ER: 0x%08x\n", pgtbl_err); - I915_WRITE(PGTBL_ER, pgtbl_err); - POSTING_READ(PGTBL_ER); - } - } + reloc_offset = src->gtt_offset; + for (page = 0; page < page_count; page++) { + d = malloc(PAGE_SIZE, DRM_I915_GEM, M_NOWAIT); + if (d == NULL) + goto unwind; - if (!IS_GEN2(dev)) { - if (eir & I915_ERROR_PAGE_TABLE) { - u32 pgtbl_err = I915_READ(PGTBL_ER); - pr_err("page table error\n"); - pr_err(" PGTBL_ER: 0x%08x\n", pgtbl_err); - I915_WRITE(PGTBL_ER, pgtbl_err); - POSTING_READ(PGTBL_ER); + if (reloc_offset < dev_priv->mm.gtt_mappable_end && + src->has_global_gtt_mapping) { + /* Simply ignore tiling or any overlapping fence. + * It's part of the error state, and this hopefully + * captures what the GPU read. + */ + s = pmap_mapdev_attr(src->base.dev->agp->base + + reloc_offset, PAGE_SIZE, PAT_WRITE_COMBINING); + memcpy(d, s, PAGE_SIZE); + pmap_unmapdev((vm_offset_t)s, PAGE_SIZE); + } else { + drm_clflush_pages(&src->pages[page], 1); + + sched_pin(); + sf = sf_buf_alloc(src->pages[page], SFB_CPUPRIVATE | + SFB_NOWAIT); + if (sf != NULL) { + s = (void *)(uintptr_t)sf_buf_kva(sf); + memcpy(d, s, PAGE_SIZE); + sf_buf_free(sf); + } else { + bzero(d, PAGE_SIZE); + strcpy(d, "XXXKIB"); + } + sched_unpin(); + + drm_clflush_pages(&src->pages[page], 1); } - } - if (eir & I915_ERROR_MEMORY_REFRESH) { - pr_err("memory refresh error:\n"); - for_each_pipe(pipe) - pr_err("pipe %c stat: 0x%08x\n", - pipe_name(pipe), I915_READ(PIPESTAT(pipe))); - /* pipestat has already been acked */ + dst->pages[page] = d; + + reloc_offset += PAGE_SIZE; } - if (eir & I915_ERROR_INSTRUCTION) { - pr_err("instruction error\n"); - pr_err(" INSTPM: 0x%08x\n", I915_READ(INSTPM)); - if (INTEL_INFO(dev)->gen < 4) { - u32 ipeir = I915_READ(IPEIR); + dst->page_count = page_count; + dst->gtt_offset = src->gtt_offset; - pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR)); - pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR)); - pr_err(" INSTDONE: 0x%08x\n", I915_READ(INSTDONE)); - pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD)); - I915_WRITE(IPEIR, ipeir); - POSTING_READ(IPEIR); - } else { - u32 ipeir = I915_READ(IPEIR_I965); + return dst; - pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965)); - pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965)); - pr_err(" INSTDONE: 0x%08x\n", - I915_READ(INSTDONE_I965)); - pr_err(" INSTPS: 0x%08x\n", I915_READ(INSTPS)); - pr_err(" INSTDONE1: 0x%08x\n", I915_READ(INSTDONE1)); - pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965)); - I915_WRITE(IPEIR_I965, ipeir); - POSTING_READ(IPEIR_I965); - } - } +unwind: + while (page--) + free(dst->pages[page], DRM_I915_GEM); + free(dst, DRM_I915_GEM); + return NULL; +} - I915_WRITE(EIR, eir); - POSTING_READ(EIR); - eir = I915_READ(EIR); - if (eir) { - /* - * some errors might have become stuck, - * mask them. - */ - DRM_ERROR("EIR stuck: 0x%08x, masking\n", eir); - I915_WRITE(EMR, I915_READ(EMR) | eir); - I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); - } +static void +i915_error_object_free(struct drm_i915_error_object *obj) +{ + int page; + + if (obj == NULL) + return; + + for (page = 0; page < obj->page_count; page++) + free(obj->pages[page], DRM_I915_GEM); + + free(obj, DRM_I915_GEM); } -/** - * i915_handle_error - handle an error interrupt - * @dev: drm device - * - * Do some basic checking of regsiter state at error interrupt time and - * dump it to the syslog. Also call i915_capture_error_state() to make - * sure we get a record and make it available in debugfs. Fire a uevent - * so userspace knows something bad happened (should trigger collection - * of a ring dump etc.). - */ -void i915_handle_error(struct drm_device *dev, bool wedged) +void +i915_error_state_free(struct drm_i915_error_state *error) { - struct drm_i915_private *dev_priv = dev->dev_private; - struct intel_ring_buffer *ring; int i; - i915_capture_error_state(dev); - i915_report_and_clear_eir(dev); + for (i = 0; i < ARRAY_SIZE(error->ring); i++) { + i915_error_object_free(error->ring[i].batchbuffer); + i915_error_object_free(error->ring[i].ringbuffer); + free(error->ring[i].requests, DRM_I915_GEM); + } - if (wedged) { - mtx_lock(&dev_priv->error_completion_lock); - dev_priv->error_completion = 0; - dev_priv->mm.wedged = 1; - /* unlock acts as rel barrier for store to wedged */ - mtx_unlock(&dev_priv->error_completion_lock); + free(error->active_bo, DRM_I915_GEM); + free(error->overlay, DRM_I915_GEM); + free(error, DRM_I915_GEM); +} - /* - * Wakeup waiting processes so they don't hang - */ - for_each_ring(ring, dev_priv, i) { - mtx_lock(&dev_priv->irq_lock); - wakeup(ring); - mtx_unlock(&dev_priv->irq_lock); - } +static void capture_bo(struct drm_i915_error_buffer *err, + struct drm_i915_gem_object *obj) +{ + err->size = obj->base.size; + err->name = obj->base.name; + err->seqno = obj->last_rendering_seqno; + err->gtt_offset = obj->gtt_offset; + err->read_domains = obj->base.read_domains; + err->write_domain = obj->base.write_domain; + err->fence_reg = obj->fence_reg; + err->pinned = 0; + if (obj->pin_count > 0) + err->pinned = 1; + if (obj->user_pin_count > 0) + err->pinned = -1; + err->tiling = obj->tiling_mode; + err->dirty = obj->dirty; + err->purgeable = obj->madv != I915_MADV_WILLNEED; + err->ring = obj->ring ? obj->ring->id : -1; + err->cache_level = obj->cache_level; +} + +static u32 capture_active_bo(struct drm_i915_error_buffer *err, + int count, struct list_head *head) +{ + struct drm_i915_gem_object *obj; + int i = 0; + + list_for_each_entry(obj, head, mm_list) { + capture_bo(err++, obj); + if (++i == count) + break; } - taskqueue_enqueue(dev_priv->tq, &dev_priv->error_task); + return i; } -static void i915_pageflip_stall_check(struct drm_device *dev, int pipe) +static u32 capture_pinned_bo(struct drm_i915_error_buffer *err, + int count, struct list_head *head) { - drm_i915_private_t *dev_priv = dev->dev_private; - struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct drm_i915_gem_object *obj; - struct intel_unpin_work *work; - bool stall_detected; + int i = 0; - /* Ignore early vblank irqs */ - if (intel_crtc == NULL) - return; + list_for_each_entry(obj, head, gtt_list) { + if (obj->pin_count == 0) + continue; - mtx_lock(&dev->event_lock); - work = intel_crtc->unpin_work; - - if (work == NULL || work->pending || !work->enable_stall_check) { - /* Either the pending flip IRQ arrived, or we're too early. Don't check */ - mtx_unlock(&dev->event_lock); - return; - } - - /* Potential stall - if we see that the flip has happened, assume a missed interrupt */ - obj = work->pending_flip_obj; - if (INTEL_INFO(dev)->gen >= 4) { - int dspsurf = DSPSURF(intel_crtc->plane); - stall_detected = I915_HI_DISPBASE(I915_READ(dspsurf)) == - obj->gtt_offset; - } else { - int dspaddr = DSPADDR(intel_crtc->plane); - stall_detected = I915_READ(dspaddr) == (obj->gtt_offset + - crtc->y * crtc->fb->pitches[0] + - crtc->x * crtc->fb->bits_per_pixel/8); + capture_bo(err++, obj); + if (++i == count) + break; } - mtx_unlock(&dev->event_lock); - - if (stall_detected) { - DRM_DEBUG("Pageflip stall detected\n"); - intel_prepare_page_flip(dev, intel_crtc->plane); - } + return i; } -/* Called from drm generic code, passed 'crtc' which - * we use as a pipe index - */ -static int -i915_enable_vblank(struct drm_device *dev, int pipe) +static void i915_gem_record_fences(struct drm_device *dev, + struct drm_i915_error_state *error) { - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - - if (!i915_pipe_enabled(dev, pipe)) - return -EINVAL; - - mtx_lock(&dev_priv->irq_lock); - if (INTEL_INFO(dev)->gen >= 4) - i915_enable_pipestat(dev_priv, pipe, - PIPE_START_VBLANK_INTERRUPT_ENABLE); - else - i915_enable_pipestat(dev_priv, pipe, - PIPE_VBLANK_INTERRUPT_ENABLE); + struct drm_i915_private *dev_priv = dev->dev_private; + int i; - /* maintain vblank delivery even in deep C-states */ - if (dev_priv->info->gen == 3) - I915_WRITE(INSTPM, _MASKED_BIT_DISABLE(INSTPM_AGPBUSY_DIS)); - mtx_unlock(&dev_priv->irq_lock); - CTR1(KTR_DRM, "i915_enable_vblank %d", pipe); + /* Fences */ + switch (INTEL_INFO(dev)->gen) { + case 7: + case 6: + for (i = 0; i < 16; i++) + error->fence[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8)); + break; + case 5: + case 4: + for (i = 0; i < 16; i++) + error->fence[i] = I915_READ64(FENCE_REG_965_0 + (i * 8)); + break; + case 3: + if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) + for (i = 0; i < 8; i++) + error->fence[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4)); + case 2: + for (i = 0; i < 8; i++) + error->fence[i] = I915_READ(FENCE_REG_830_0 + (i * 4)); + break; - return 0; + } } -static int -ironlake_enable_vblank(struct drm_device *dev, int pipe) +static struct drm_i915_error_object * +i915_error_first_batchbuffer(struct drm_i915_private *dev_priv, + struct intel_ring_buffer *ring) { - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - - if (!i915_pipe_enabled(dev, pipe)) - return -EINVAL; + struct drm_i915_gem_object *obj; + u32 seqno; - mtx_lock(&dev_priv->irq_lock); - ironlake_enable_display_irq(dev_priv, (pipe == 0) ? - DE_PIPEA_VBLANK : DE_PIPEB_VBLANK); - mtx_unlock(&dev_priv->irq_lock); - CTR1(KTR_DRM, "ironlake_enable_vblank %d", pipe); + if (!ring->get_seqno) + return NULL; - return 0; -} + seqno = ring->get_seqno(ring); + list_for_each_entry(obj, &dev_priv->mm.active_list, mm_list) { + if (obj->ring != ring) + continue; -static int -ivybridge_enable_vblank(struct drm_device *dev, int pipe) -{ - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + if (i915_seqno_passed(seqno, obj->last_rendering_seqno)) + continue; - if (!i915_pipe_enabled(dev, pipe)) - return -EINVAL; + if ((obj->base.read_domains & I915_GEM_DOMAIN_COMMAND) == 0) + continue; - mtx_lock(&dev_priv->irq_lock); - ironlake_enable_display_irq(dev_priv, - DE_PIPEA_VBLANK_IVB << (5 * pipe)); - mtx_unlock(&dev_priv->irq_lock); - CTR1(KTR_DRM, "ivybridge_enable_vblank %d", pipe); + /* We need to copy these to an anonymous buffer as the simplest + * method to avoid being overwritten by userspace. + */ + return i915_error_object_create(dev_priv, obj); + } - return 0; + return NULL; } -static int valleyview_enable_vblank(struct drm_device *dev, int pipe) +static void i915_record_ring_state(struct drm_device *dev, + struct drm_i915_error_state *error, + struct intel_ring_buffer *ring) { - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - u32 dpfl, imr; + struct drm_i915_private *dev_priv = dev->dev_private; - if (!i915_pipe_enabled(dev, pipe)) - return -EINVAL; + if (INTEL_INFO(dev)->gen >= 6) { + error->fault_reg[ring->id] = I915_READ(RING_FAULT_REG(ring)); + error->semaphore_mboxes[ring->id][0] + = I915_READ(RING_SYNC_0(ring->mmio_base)); + error->semaphore_mboxes[ring->id][1] + = I915_READ(RING_SYNC_1(ring->mmio_base)); + } - mtx_lock(&dev_priv->irq_lock); - dpfl = I915_READ(VLV_DPFLIPSTAT); - imr = I915_READ(VLV_IMR); - if (pipe == 0) { - dpfl |= PIPEA_VBLANK_INT_EN; - imr &= ~I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT; + if (INTEL_INFO(dev)->gen >= 4) { + error->faddr[ring->id] = I915_READ(RING_DMA_FADD(ring->mmio_base)); + error->ipeir[ring->id] = I915_READ(RING_IPEIR(ring->mmio_base)); + error->ipehr[ring->id] = I915_READ(RING_IPEHR(ring->mmio_base)); + error->instdone[ring->id] = I915_READ(RING_INSTDONE(ring->mmio_base)); + error->instps[ring->id] = I915_READ(RING_INSTPS(ring->mmio_base)); + if (ring->id == RCS) { + error->instdone1 = I915_READ(INSTDONE1); + error->bbaddr = I915_READ64(BB_ADDR); + } } else { - dpfl |= PIPEA_VBLANK_INT_EN; - imr &= ~I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT; + error->faddr[ring->id] = I915_READ(DMA_FADD_I8XX); + error->ipeir[ring->id] = I915_READ(IPEIR); + error->ipehr[ring->id] = I915_READ(IPEHR); + error->instdone[ring->id] = I915_READ(INSTDONE); } - I915_WRITE(VLV_DPFLIPSTAT, dpfl); - I915_WRITE(VLV_IMR, imr); - mtx_unlock(&dev_priv->irq_lock); - return 0; + sleepq_lock(ring); + error->waiting[ring->id] = sleepq_sleepcnt(ring, 0) != 0; + sleepq_release(ring); + error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base)); + error->seqno[ring->id] = ring->get_seqno(ring); + error->acthd[ring->id] = intel_ring_get_active_head(ring); + error->head[ring->id] = I915_READ_HEAD(ring); + error->tail[ring->id] = I915_READ_TAIL(ring); + + error->cpu_ring_head[ring->id] = ring->head; + error->cpu_ring_tail[ring->id] = ring->tail; } -/* Called from drm generic code, passed 'crtc' which - * we use as a pipe index - */ -static void -i915_disable_vblank(struct drm_device *dev, int pipe) +static void i915_gem_record_rings(struct drm_device *dev, + struct drm_i915_error_state *error) { - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_ring_buffer *ring; + struct drm_i915_gem_request *request; + int i, count; - mtx_lock(&dev_priv->irq_lock); - if (dev_priv->info->gen == 3) - I915_WRITE(INSTPM, _MASKED_BIT_ENABLE(INSTPM_AGPBUSY_DIS)); + for_each_ring(ring, dev_priv, i) { + i915_record_ring_state(dev, error, ring); - i915_disable_pipestat(dev_priv, pipe, - PIPE_VBLANK_INTERRUPT_ENABLE | - PIPE_START_VBLANK_INTERRUPT_ENABLE); - mtx_unlock(&dev_priv->irq_lock); - CTR1(KTR_DRM, "i915_disable_vblank %d", pipe); -} + error->ring[i].batchbuffer = + i915_error_first_batchbuffer(dev_priv, ring); -static void -ironlake_disable_vblank(struct drm_device *dev, int pipe) -{ - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + error->ring[i].ringbuffer = + i915_error_object_create(dev_priv, ring->obj); - mtx_lock(&dev_priv->irq_lock); - ironlake_disable_display_irq(dev_priv, (pipe == 0) ? - DE_PIPEA_VBLANK : DE_PIPEB_VBLANK); - mtx_unlock(&dev_priv->irq_lock); - CTR1(KTR_DRM, "ironlake_disable_vblank %d", pipe); -} + count = 0; + list_for_each_entry(request, &ring->request_list, list) + count++; -static void -ivybridge_disable_vblank(struct drm_device *dev, int pipe) -{ - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + error->ring[i].num_requests = count; + error->ring[i].requests = + malloc(count*sizeof(struct drm_i915_error_request), + DRM_I915_GEM, M_WAITOK); + if (error->ring[i].requests == NULL) { + error->ring[i].num_requests = 0; + continue; + } - mtx_lock(&dev_priv->irq_lock); - ironlake_disable_display_irq(dev_priv, - DE_PIPEA_VBLANK_IVB << (pipe * 5)); - mtx_unlock(&dev_priv->irq_lock); - CTR1(KTR_DRM, "ivybridge_disable_vblank %d", pipe); + count = 0; + list_for_each_entry(request, &ring->request_list, list) { + struct drm_i915_error_request *erq; + + erq = &error->ring[i].requests[count++]; + erq->seqno = request->seqno; + erq->jiffies = request->emitted_jiffies; + erq->tail = request->tail; + } + } } -static void valleyview_disable_vblank(struct drm_device *dev, int pipe) +static void i915_capture_error_state(struct drm_device *dev) { - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - u32 dpfl, imr; + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_i915_gem_object *obj; + struct drm_i915_error_state *error; + int i, pipe; - mtx_lock(&dev_priv->irq_lock); - dpfl = I915_READ(VLV_DPFLIPSTAT); - imr = I915_READ(VLV_IMR); - if (pipe == 0) { - dpfl &= ~PIPEA_VBLANK_INT_EN; - imr |= I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT; - } else { - dpfl &= ~PIPEB_VBLANK_INT_EN; - imr |= I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT; + mtx_lock(&dev_priv->error_lock); + error = dev_priv->first_error; + mtx_unlock(&dev_priv->error_lock); + if (error) + return; + + /* Account for pipe specific data like PIPE*STAT */ + error = malloc(sizeof(*error), DRM_I915_GEM, M_NOWAIT | M_ZERO); + if (!error) { + DRM_DEBUG_DRIVER("out of memory, not capturing error state\n"); + return; } - I915_WRITE(VLV_IMR, imr); - I915_WRITE(VLV_DPFLIPSTAT, dpfl); - mtx_unlock(&dev_priv->irq_lock); -} -static u32 -ring_last_seqno(struct intel_ring_buffer *ring) -{ + DRM_INFO("capturing error event; look for more information in sysctl hw.dri.%d.info.i915_error_state\n", + dev->sysctl_node_idx); - if (list_empty(&ring->request_list)) - return (0); - else - return (list_entry(ring->request_list.prev, - struct drm_i915_gem_request, list)->seqno); -} + refcount_init(&error->ref, 1); + error->eir = I915_READ(EIR); + error->pgtbl_er = I915_READ(PGTBL_ER); -static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err) -{ - if (list_empty(&ring->request_list) || - i915_seqno_passed(ring->get_seqno(ring), ring_last_seqno(ring))) { - /* Issue a wake-up to catch stuck h/w. */ - sleepq_lock(ring); - if (sleepq_sleepcnt(ring, 0) != 0) { - sleepq_release(ring); - DRM_ERROR("Hangcheck timer elapsed... %s idle\n", - ring->name); - wakeup(ring); - *err = true; - } else - sleepq_release(ring); - return true; - } - return false; -} - -static bool kick_ring(struct intel_ring_buffer *ring) -{ - struct drm_device *dev = ring->dev; - struct drm_i915_private *dev_priv = dev->dev_private; - u32 tmp = I915_READ_CTL(ring); - if (tmp & RING_WAIT) { - DRM_ERROR("Kicking stuck wait on %s\n", - ring->name); - I915_WRITE_CTL(ring, tmp); - return true; - } - return false; -} - -static bool i915_hangcheck_hung(struct drm_device *dev) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - - if (dev_priv->hangcheck_count++ > 1) { - bool hung = true; - - DRM_ERROR("Hangcheck timer elapsed... GPU hung\n"); - i915_handle_error(dev, true); - - if (!IS_GEN2(dev)) { - struct intel_ring_buffer *ring; - int i; + if (HAS_PCH_SPLIT(dev)) + error->ier = I915_READ(DEIER) | I915_READ(GTIER); + else if (IS_VALLEYVIEW(dev)) + error->ier = I915_READ(GTIER) | I915_READ(VLV_IER); + else if (IS_GEN2(dev)) + error->ier = I915_READ16(IER); + else + error->ier = I915_READ(IER); - /* Is the chip hanging on a WAIT_FOR_EVENT? - * If so we can simply poke the RB_WAIT bit - * and break the hang. This should work on - * all but the second generation chipsets. - */ - for_each_ring(ring, dev_priv, i) - hung &= !kick_ring(ring); - } + for_each_pipe(pipe) + error->pipestat[pipe] = I915_READ(PIPESTAT(pipe)); - return hung; + if (INTEL_INFO(dev)->gen >= 6) { + error->error = I915_READ(ERROR_GEN6); + error->done_reg = I915_READ(DONE_REG); } - return false; -} + i915_gem_record_fences(dev, error); + i915_gem_record_rings(dev, error); -/** - * This is called when the chip hasn't reported back with completed - * batchbuffers in a long time. The first time this is called we simply record - * ACTHD. If ACTHD hasn't changed by the time the hangcheck timer elapses - * again, we assume the chip is wedged and try to fix it. - */ -void -i915_hangcheck_elapsed(void *context) -{ - struct drm_device *dev = (struct drm_device *)context; - drm_i915_private_t *dev_priv = dev->dev_private; - uint32_t acthd[I915_NUM_RINGS], instdone, instdone1; - struct intel_ring_buffer *ring; - bool err = false, idle; - int i; + /* Record buffers on the active and pinned lists. */ + error->active_bo = NULL; + error->pinned_bo = NULL; - if (!i915_enable_hangcheck) - return; + i = 0; + list_for_each_entry(obj, &dev_priv->mm.active_list, mm_list) + i++; + error->active_bo_count = i; + list_for_each_entry(obj, &dev_priv->mm.gtt_list, mm_list) + if (obj->pin_count) + i++; + error->pinned_bo_count = i - error->active_bo_count; - memset(acthd, 0, sizeof(acthd)); - idle = true; - for_each_ring(ring, dev_priv, i) { - idle &= i915_hangcheck_ring_idle(ring, &err); - acthd[i] = intel_ring_get_active_head(ring); + error->active_bo = NULL; + error->pinned_bo = NULL; + if (i) { + error->active_bo = malloc(sizeof(*error->active_bo)*i, + DRM_I915_GEM, M_NOWAIT); + if (error->active_bo) + error->pinned_bo = + error->active_bo + error->active_bo_count; } - /* If all work is done then ACTHD clearly hasn't advanced. */ - if (idle) { - if (err) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 25 14:52:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF3878D19; Sun, 25 Oct 2015 14:52:17 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 95A8C1FD0; Sun, 25 Oct 2015 14:52:17 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PEqGAr081797; Sun, 25 Oct 2015 14:52:16 GMT (envelope-from theraven@FreeBSD.org) Received: (from theraven@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PEqGip081790; Sun, 25 Oct 2015 14:52:16 GMT (envelope-from theraven@FreeBSD.org) Message-Id: <201510251452.t9PEqGip081790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: theraven set sender to theraven@FreeBSD.org using -f From: David Chisnall Date: Sun, 25 Oct 2015 14:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289935 - in head/usr.bin: . dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 14:52:17 -0000 Author: theraven Date: Sun Oct 25 14:52:16 2015 New Revision: 289935 URL: https://svnweb.freebsd.org/changeset/base/289935 Log: Lots of improvements to the BSD-licensed dtc - Various fixes to includes (including recursive includes) - Lots of testing that the output exactly matches GPL'd dtc - Lots of bug fixes to merging - Fix incorrect mmap usage - Ad-hoc memory management replaced with C++11 unique_ptr and similar Patrick Wildt has successfully run many (all?) of the GPL dtc test suite. Modified: head/usr.bin/Makefile head/usr.bin/dtc/checking.cc head/usr.bin/dtc/checking.hh head/usr.bin/dtc/dtb.cc head/usr.bin/dtc/dtc.cc head/usr.bin/dtc/fdt.cc head/usr.bin/dtc/fdt.hh head/usr.bin/dtc/input_buffer.cc head/usr.bin/dtc/input_buffer.hh head/usr.bin/dtc/string.hh Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sun Oct 25 14:42:56 2015 (r289934) +++ head/usr.bin/Makefile Sun Oct 25 14:52:16 2015 (r289935) @@ -210,8 +210,10 @@ SUBDIR.${MK_GAMES}+= pom SUBDIR.${MK_GAMES}+= primes SUBDIR.${MK_GAMES}+= random .if ${MK_GPL_DTC} != "yes" +.if ${COMPILER_FEATURES:Mc++11} SUBDIR+= dtc .endif +.endif SUBDIR.${MK_GROFF}+= vgrind SUBDIR.${MK_HESIOD}+= hesinfo SUBDIR.${MK_ICONV}+= iconv Modified: head/usr.bin/dtc/checking.cc ============================================================================== --- head/usr.bin/dtc/checking.cc Sun Oct 25 14:42:56 2015 (r289934) +++ head/usr.bin/dtc/checking.cc Sun Oct 25 14:52:16 2015 (r289935) @@ -51,7 +51,7 @@ namespace struct address_cells_checker : public checker { address_cells_checker(const char *name) : checker(name) {} - virtual bool check_node(device_tree *tree, node *n) + virtual bool check_node(device_tree *tree, const node_ptr &n) { // If this has no children, it trivially meets the // conditions. @@ -61,8 +61,7 @@ namespace } bool found_address = false; bool found_size = false; - for (node::property_iterator i=n->property_begin(), - e=n->property_end() ; i!=e ; ++i) + for (auto i=n->property_begin(), e=n->property_end() ; i!=e ; ++i) { if (!found_address) { @@ -91,7 +90,7 @@ namespace } // anonymous namespace bool -checker::visit_node(device_tree *tree, node *n) +checker::visit_node(device_tree *tree, const node_ptr &n) { path.push_back(std::make_pair(n->name, n->unit_address)); // Check this node @@ -100,8 +99,7 @@ checker::visit_node(device_tree *tree, n return false; } // Now check its properties - for (node::property_iterator i=n->property_begin(), e=n->property_end() - ; i!=e ; ++i) + for (auto i=n->property_begin(), e=n->property_end() ; i!=e ; ++i) { if (!check_property(tree, n, *i)) { @@ -125,22 +123,21 @@ void checker::report_error(const char *errmsg) { fprintf(stderr, "Error: %s, while checking node: ", errmsg); - for (device_tree::node_path::iterator p=path.begin()+1, pe=path.end() ; - p!=pe ; ++p) + for (auto &p : path) { putc('/', stderr); - p->first.dump(); - if (!(p->second.empty())) + p.first.dump(); + if (!(p.second.empty())) { putc('@', stderr); - p->second.dump(); + p.second.dump(); } } fprintf(stderr, " [-W%s]\n", checker_name); } bool -property_checker::check_property(device_tree *tree, node *n, property *p) +property_checker::check_property(device_tree *tree, const node_ptr &n, property_ptr p) { if (p->get_key() == key) { @@ -154,7 +151,7 @@ property_checker::check_property(device_ } bool -property_size_checker::check(device_tree *tree, node *n, property *p) +property_size_checker::check(device_tree *tree, const node_ptr &n, property_ptr p) { uint32_t psize = 0; for (property::value_iterator i=p->begin(),e=p->end() ; i!=e ; ++i) @@ -216,10 +213,9 @@ bool check_manager::run_checks(device_tree *tree, bool keep_going) { bool success = true; - for (std::map::iterator i=checkers.begin(), - e=checkers.end() ; i!=e ; ++i) + for (auto &i : checkers) { - success &= i->second->check_tree(tree); + success &= i.second->check_tree(tree); if (!(success || keep_going)) { break; @@ -231,7 +227,7 @@ check_manager::run_checks(device_tree *t bool check_manager::disable_checker(string name) { - std::map::iterator checker = checkers.find(name); + auto checker = checkers.find(name); if (checker != checkers.end()) { disabled_checkers.insert(std::make_pair(name, @@ -245,8 +241,7 @@ check_manager::disable_checker(string na bool check_manager::enable_checker(string name) { - std::map::iterator checker = - disabled_checkers.find(name); + auto checker = disabled_checkers.find(name); if (checker != disabled_checkers.end()) { checkers.insert(std::make_pair(name, checker->second)); Modified: head/usr.bin/dtc/checking.hh ============================================================================== --- head/usr.bin/dtc/checking.hh Sun Oct 25 14:42:56 2015 (r289934) +++ head/usr.bin/dtc/checking.hh Sun Oct 25 14:52:16 2015 (r289935) @@ -65,7 +65,7 @@ class checker * Visits each node, calling the checker functions on properties and * nodes. */ - bool visit_node(device_tree *tree, node *n); + bool visit_node(device_tree *tree, const node_ptr &n); protected: /** * Prints the error message, along with the path to the node that @@ -86,7 +86,7 @@ class checker * Method for checking that a node is valid. The root class version * does nothing, subclasses should override this. */ - virtual bool check_node(device_tree *tree, node *n) + virtual bool check_node(device_tree *tree, const node_ptr &n) { return true; } @@ -94,7 +94,7 @@ class checker * Method for checking that a property is valid. The root class * version does nothing, subclasses should override this. */ - virtual bool check_property(device_tree *tree, node *n, property *p) + virtual bool check_property(device_tree *tree, const node_ptr &n, property_ptr p) { return true; } @@ -124,7 +124,7 @@ class property_checker : public checker * Implementation of the generic property-checking method that checks * for a property with the name specified in the constructor */ - virtual bool check_property(device_tree *tree, node *n, property *p); + virtual bool check_property(device_tree *tree, const node_ptr &n, property_ptr p); /** * Constructor. Takes the name of the checker and the name of the * property to check. @@ -134,7 +134,7 @@ class property_checker : public checker /** * The check method, which subclasses should implement. */ - virtual bool check(device_tree *tree, node *n, property *p) = 0; + virtual bool check(device_tree *tree, const node_ptr &n, property_ptr p) = 0; }; /** @@ -149,7 +149,7 @@ struct property_type_checker : public pr */ property_type_checker(const char* name, string property_name) : property_checker(name, property_name) {} - virtual bool check(device_tree *tree, node *n, property *p) = 0; + virtual bool check(device_tree *tree, const node_ptr &n, property_ptr p) = 0; }; /** @@ -160,7 +160,7 @@ struct property_type_checker begin() == p->end(); } @@ -175,7 +175,7 @@ struct property_type_checker begin() + 1 == p->end()) && p->begin()->is_string(); } @@ -190,7 +190,7 @@ struct property_type_checker begin(),e=p->end() ; i!=e ; ++i) @@ -213,7 +213,7 @@ struct property_type_checker begin() + 1 == p->end()) && (tree->referenced_node(*p->begin()) != 0); @@ -239,7 +239,7 @@ struct property_size_checker : public pr /** * Check, validates that the property has the correct size. */ - virtual bool check(device_tree *tree, node *n, property *p); + virtual bool check(device_tree *tree, const node_ptr &n, property_ptr p); }; @@ -254,12 +254,12 @@ class check_manager * disabling checkers from the command line. When this manager runs, * it will only run the checkers from this map. */ - std::map checkers; + std::unordered_map checkers; /** * The disabled checkers. Moving checkers to this list disables them, * but allows them to be easily moved back. */ - std::map disabled_checkers; + std::unordered_map disabled_checkers; /** * Helper function for adding a property value checker. */ Modified: head/usr.bin/dtc/dtb.cc ============================================================================== --- head/usr.bin/dtc/dtb.cc Sun Oct 25 14:42:56 2015 (r289934) +++ head/usr.bin/dtc/dtb.cc Sun Oct 25 14:52:16 2015 (r289935) @@ -44,9 +44,9 @@ namespace dtb void output_writer::write_data(byte_buffer b) { - for (byte_buffer::iterator i=b.begin(), e=b.end(); i!=e ; i++) + for (auto i : b) { - write_data(*i); + write_data(i); } } @@ -277,7 +277,7 @@ header::read_dtb(input_buffer &input) uint32_t string_table::add_string(string str) { - std::map::iterator old = string_offsets.find(str); + auto old = string_offsets.find(str); if (old == string_offsets.end()) { uint32_t start = size; @@ -298,10 +298,9 @@ string_table::write(dtb::output_writer & { writer.write_comment(string("Strings table.")); writer.write_label(string("dt_strings_start")); - for (std::vector::iterator i=strings.begin(), e=strings.end() ; - i!=e ; ++i) + for (auto &i : strings) { - writer.write_string(*i); + writer.write_string(i); } writer.write_label(string("dt_strings_end")); } Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Sun Oct 25 14:42:56 2015 (r289934) +++ head/usr.bin/dtc/dtc.cc Sun Oct 25 14:52:16 2015 (r289935) @@ -67,7 +67,7 @@ static void usage(const char* argv0) "[-O output_format]\n" "\t\t[-o output_file] [-R entries] [-S bytes] [-p bytes]" "[-V blob_version]\n" - "\t\t-W [no-]checker_name] input_file\n", basename(argv0)); + "\t\t-W [no-]checker_name] input_file\n", basename((char*)argv0)); } /** Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Sun Oct 25 14:42:56 2015 (r289934) +++ head/usr.bin/dtc/fdt.cc Sun Oct 25 14:52:16 2015 (r289935) @@ -33,8 +33,10 @@ #define __STDC_LIMIT_MACROS 1 #include "fdt.hh" +#include "dtb.hh" #include + #include #include #include @@ -44,7 +46,7 @@ #include #include #include -#include "dtb.hh" +#include namespace dtc { @@ -126,13 +128,25 @@ property_value::resolve_type() bool is_all_printable = true; int nuls = 0; int bytes = 0; - for (byte_buffer::iterator i=byte_data.begin(), e=byte_data.end()-1; i nuls)) || bytes == 0) { type = STRING; - if (nuls > 0) + if (nuls > 1) { type = STRING_LIST; } @@ -162,15 +176,25 @@ property_value::write_as_string(FILE *fi } else { - for (byte_buffer::iterator i=byte_data.begin(), e=byte_data.end()-1; i!=e ; ++i) + bool hasNull = (byte_data.back() == '\0'); + // Remove trailing null bytes from the string before printing as dts. + if (hasNull) + { + byte_data.pop_back(); + } + for (auto i : byte_data) { // FIXME Escape tabs, newlines, and so on. - if (*i == '\0') + if (i == '\0') { fputs("\", \"", file); continue; } - putc(*i, file); + putc(i, file); + } + if (hasNull) + { + byte_data.push_back('\0'); } } putc('"', file); @@ -181,7 +205,7 @@ property_value::write_as_cells(FILE *fil { putc('<', file); assert((byte_data.size() % 4) == 0); - for (byte_buffer::iterator i=byte_data.begin(), e=byte_data.end(); i!=e ; ++i) + for (auto i=byte_data.begin(), e=byte_data.end(); i!=e ; ++i) { uint32_t v = 0; v = (v << 8) | *i; @@ -204,7 +228,7 @@ void property_value::write_as_bytes(FILE *file) { putc('[', file); - for (byte_buffer::iterator i=byte_data.begin(), e=byte_data.end(); i!=e ; i++) + for (auto i=byte_data.begin(), e=byte_data.end(); i!=e ; i++) { fprintf(file, "%02hhx", *i); if (i+1 != e) @@ -238,8 +262,26 @@ property::parse_string(input_buffer &inp } void -property::parse_cells(input_buffer &input) +property::parse_cells(input_buffer &input, int cell_size) { + unsigned long long cell_max; + switch (cell_size) + { + case 8: + cell_max = UINT8_MAX; + break; + case 16: + cell_max = UINT16_MAX; + break; + case 32: + cell_max = UINT32_MAX; + break; + case 64: + cell_max = UINT64_MAX; + break; + default: + assert(0 && "Invalid cell size!"); + } assert(input[0] == '<'); ++input; property_value v; @@ -251,6 +293,12 @@ property::parse_cells(input_buffer &inpu // referenced node if (input.consume('&')) { + if (cell_size != 32) + { + input.parse_error("reference only permitted in 32-bit arrays"); + valid = false; + return; + } input.next_token(); // FIXME: We should support full paths here, but we // don't. @@ -278,20 +326,37 @@ property::parse_cells(input_buffer &inpu { //FIXME: We should support labels in the middle //of these, but we don't. - long long val; + unsigned long long val; if (!input.consume_integer(val)) { input.parse_error("Expected numbers in array of cells"); valid = false; return; } - if ((val < 0) || (val > UINT32_MAX)) + if (val > cell_max) { + fprintf(stderr, "%lld > %lld\n", val, cell_max); input.parse_error("Value out of range"); valid = false; return; } - push_big_endian(v.byte_data, (uint32_t)val); + switch (cell_size) + { + case 8: + v.byte_data.push_back(val); + break; + case 16: + push_big_endian(v.byte_data, (uint16_t)val); + break; + case 32: + push_big_endian(v.byte_data, (uint32_t)val); + break; + case 64: + push_big_endian(v.byte_data, (uint64_t)val); + break; + default: + assert(0 && "Invalid cell size!"); + } input.next_token(); } } @@ -432,11 +497,35 @@ property::property(input_buffer &input, input.parse_error("Invalid property value."); valid = false; return; + case '/': + { + unsigned long long bits = 0; + valid = input.consume("/bits/"); + input.next_token(); + valid &= input.consume_integer(bits); + if ((bits != 8) && + (bits != 16) && + (bits != 32) && + (bits != 64)) { + input.parse_error("Invalid size for elements"); + valid = false; + } + if (!valid) return; + input.next_token(); + if (input[0] != '<') + { + input.parse_error("/bits/ directive is only valid on arrays"); + valid = false; + return; + } + parse_cells(input, bits); + break; + } case '"': parse_string(input); break; case '<': - parse_cells(input); + parse_cells(input, 32); break; case '[': parse_bytes(input); @@ -458,27 +547,25 @@ property::property(input_buffer &input, } } -property* +property_ptr property::parse_dtb(input_buffer &structs, input_buffer &strings) { - property *p = new property(structs, strings); + property_ptr p(new property(structs, strings)); if (!p->valid) { - delete p; - p = 0; + p = nullptr; } return p; } -property* +property_ptr property::parse(input_buffer &input, string key, string label, bool semicolonTerminated, define_map *defines) { - property *p = new property(input, key, label, semicolonTerminated, defines); + property_ptr p(new property(input, key, label, semicolonTerminated, defines)); if (!p->valid) { - delete p; - p = 0; + p = nullptr; } return p; } @@ -498,6 +585,35 @@ property::write(dtb::output_writer &writ writer.write_data(value_buffer); } +bool +property_value::try_to_merge(property_value &other) +{ + resolve_type(); + switch (type) + { + case UNKNOWN: + __builtin_unreachable(); + assert(0); + return false; + case EMPTY: + *this = other; + case STRING: + case STRING_LIST: + case CROSS_REFERENCE: + return false; + case PHANDLE: + case BINARY: + if (other.type == PHANDLE || other.type == BINARY) + { + type = BINARY; + byte_data.insert(byte_data.end(), other.byte_data.begin(), + other.byte_data.end()); + return true; + } + } + return false; +} + void property::write_dts(FILE *file, int indent) { @@ -516,8 +632,23 @@ property::write_dts(FILE *file, int inde } if (!values.empty()) { + std::vector *vals = &values; + std::vector v; + // If we've got multiple values then try to merge them all together. + if (values.size() > 1) + { + vals = &v; + v.push_back(values.front()); + for (auto i=(++begin()), e=end() ; i!=e ; ++i) + { + if (!v.back().try_to_merge(*i)) + { + v.push_back(*i); + } + } + } fputs(" = ", file); - for (value_iterator i=begin(), e=end() ; i!=e ; ++i) + for (auto i=vals->begin(), e=vals->end() ; i!=e ; ++i) { i->write_dts(file); if (i+1 != e) @@ -590,13 +721,13 @@ node::node(input_buffer &structs, input_ // Child node, parse it. case dtb::FDT_BEGIN_NODE: { - node *child = node::parse_dtb(structs, strings); + node_ptr child = node::parse_dtb(structs, strings); if (child == 0) { valid = false; return; } - children.push_back(child); + children.push_back(std::move(child)); break; } // End of this node, no errors. @@ -605,7 +736,7 @@ node::node(input_buffer &structs, input_ // Property, parse it. case dtb::FDT_PROP: { - property *prop = property::parse_dtb(structs, strings); + property_ptr prop = property::parse_dtb(structs, strings); if (prop == 0) { valid = false; @@ -667,7 +798,7 @@ node::node(input_buffer &input, string n // If we're parsing a property, then we must actually do that. if (input.consume('=')) { - property *p= property::parse(input, child_name, + property_ptr p = property::parse(input, child_name, child_label, true, defines); if (p == 0) { @@ -680,11 +811,11 @@ node::node(input_buffer &input, string n } else if (!is_property && input[0] == ('{')) { - node *child = node::parse(input, child_name, + node_ptr child = node::parse(input, child_name, child_label, child_address, defines); if (child) { - children.push_back(child); + children.push_back(std::move(child)); } else { @@ -693,7 +824,7 @@ node::node(input_buffer &input, string n } else if (input.consume(';')) { - properties.push_back(new property(child_name, child_label)); + properties.push_back(property_ptr(new property(child_name, child_label))); } else { @@ -706,13 +837,13 @@ node::node(input_buffer &input, string n } bool -node::cmp_properties(property *p1, property *p2) +node::cmp_properties(property_ptr &p1, property_ptr &p2) { return p1->get_key() < p2->get_key(); } bool -node::cmp_children(node *c1, node *c2) +node::cmp_children(node_ptr &c1, node_ptr &c2) { if (c1->name == c2->name) { @@ -732,63 +863,47 @@ node::sort() } } -node* +node_ptr node::parse(input_buffer &input, string name, string label, string address, define_map *defines) { - node *n = new node(input, name, label, address, defines); + node_ptr n(new node(input, name, label, address, defines)); if (!n->valid) { - delete n; n = 0; } return n; } -node* +node_ptr node::parse_dtb(input_buffer &structs, input_buffer &strings) { - node *n = new node(structs, strings); + node_ptr n(new node(structs, strings)); if (!n->valid) { - delete n; n = 0; } return n; } -node::~node() -{ - while (!children.empty()) - { - delete children.back(); - children.pop_back(); - } - while (!properties.empty()) - { - delete properties.back(); - properties.pop_back(); - } -} - -property* +property_ptr node::get_property(string key) { - for (property_iterator i=property_begin(), e=property_end() ; i!=e ; ++i) + for (auto &i : properties) { - if ((*i)->get_key() == key) + if (i->get_key() == key) { - return *i; + return i; } } return 0; } void -node::merge_node(node *other) +node::merge_node(node_ptr other) { if (!other->label.empty()) { @@ -799,40 +914,39 @@ node::merge_node(node *other) // large numbers of properties, but for typical usage the // entire vector will fit (easily) into cache, so iterating // over it repeatedly isn't that expensive. - while (!other->properties.empty()) + for (auto &p : other->properties) { - property *p = other->properties.front(); - for (property_iterator i=property_begin(), e=property_end() ; i!=e ; ++i) + bool found = false; + for (auto i=property_begin(), e=property_end() ; i!=e ; ++i) { if ((*i)->get_key() == p->get_key()) { - delete *i; - properties.erase(i); + *i = p; + found = true; break; } } - add_property(p); - other->properties.erase(other->properties.begin()); + if (!found) + { + add_property(p); + } } - while (!other->children.empty()) + for (auto &c : other->children) { - node *c = other->children.front(); bool found = false; - for (child_iterator i=child_begin(), e=child_end() ; i!=e ; ++i) + for (auto &i : children) { - if ((*i)->name == c->name && (*i)->unit_address == c->unit_address) + if (i->name == c->name && i->unit_address == c->unit_address) { - (*i)->merge_node(c); - delete c; + i->merge_node(std::move(c)); found = true; break; } } if (!found) { - children.push_back(c); + children.push_back(std::move(c)); } - other->children.erase(other->children.begin()); } } @@ -850,7 +964,7 @@ node::write(dtb::output_writer &writer, writer.write_comment(name); writer.write_data(name_buffer); writer.write_data((uint8_t)0); - for (property_iterator i=property_begin(), e=property_end() ; i!=e ; ++i) + for (auto i=property_begin(), e=property_end() ; i!=e ; ++i) { (*i)->write(writer, strings); } @@ -868,11 +982,13 @@ node::write_dts(FILE *file, int indent) { putc('\t', file); } +#ifdef PRINT_LABELS if (label != string()) { label.print(file); fputs(": ", file); } +#endif if (name != string()) { name.print(file); @@ -883,7 +999,7 @@ node::write_dts(FILE *file, int indent) unit_address.print(file); } fputs(" {\n\n", file); - for (property_iterator i=property_begin(), e=property_end() ; i!=e ; ++i) + for (auto i=property_begin(), e=property_end() ; i!=e ; ++i) { (*i)->write_dts(file, indent+1); } @@ -899,7 +1015,7 @@ node::write_dts(FILE *file, int indent) } void -device_tree::collect_names_recursive(node* n, node_path &path) +device_tree::collect_names_recursive(node_ptr &n, node_path &path) { string name = n->label; path.push_back(std::make_pair(n->name, n->unit_address)); @@ -907,13 +1023,13 @@ device_tree::collect_names_recursive(nod { if (node_names.find(name) == node_names.end()) { - node_names.insert(std::make_pair(name, n)); + node_names.insert(std::make_pair(name, n.get())); node_paths.insert(std::make_pair(name, path)); } else { node_names[name] = (node*)-1; - std::map::iterator i = node_paths.find(name); + auto i = node_paths.find(name); if (i != node_paths.end()) { node_paths.erase(name); @@ -930,7 +1046,7 @@ device_tree::collect_names_recursive(nod path.pop_back(); // Now we collect the phandles and properties that reference // other nodes. - for (node::property_iterator i=n->property_begin(), e=n->property_end() ; i!=e ; ++i) + for (auto i=n->property_begin(), e=n->property_end() ; i!=e ; ++i) { for (property::value_iterator p=(*i)->begin(),pe=(*i)->end() ; p!=pe ; ++p) { @@ -956,7 +1072,7 @@ device_tree::collect_names_recursive(nod else { uint32_t phandle = (*i)->begin()->get_as_uint32(); - used_phandles.insert(std::make_pair(phandle, n)); + used_phandles.insert(std::make_pair(phandle, n.get())); } } } @@ -966,18 +1082,21 @@ void device_tree::collect_names() { node_path p; + node_names.clear(); + node_paths.clear(); + cross_references.clear(); + phandles.clear(); collect_names_recursive(root, p); } void device_tree::resolve_cross_references() { - for (std::vector::iterator i=cross_references.begin(), e=cross_references.end() ; i!=e ; ++i) + for (auto *pv : cross_references) { - property_value* pv = *i; node_path path = node_paths[pv->string_data]; // Skip the first name in the path. It's always "", and implicitly / - for (node_path::iterator p=path.begin()+1, pe=path.end() ; p!=pe ; ++p) + for (auto p=path.begin()+1, pe=path.end() ; p!=pe ; ++p) { pv->byte_data.push_back('/'); p->first.push_to_buffer(pv->byte_data); @@ -987,23 +1106,22 @@ device_tree::resolve_cross_references() p->second.push_to_buffer(pv->byte_data); } } - pv->byte_data.push_back(0); } uint32_t phandle = 1; - for (std::vector::iterator i=phandles.begin(), e=phandles.end() ; i!=e ; ++i) + for (auto &i : phandles) { - string target_name = (*i)->string_data; + string target_name = i->string_data; node *target = node_names[target_name]; if (target == 0) { - fprintf(stderr, "Failed to find node with label:"); + fprintf(stderr, "Failed to find node with label: "); target_name.dump(); fprintf(stderr, "\n"); valid = 0; return; } // If there is an existing phandle, use it - property *p = target->get_property("phandle"); + property_ptr p = target->get_property("phandle"); if (p == 0) { p = target->get_property("linux,phandle"); @@ -1029,33 +1147,140 @@ device_tree::resolve_cross_references() push_big_endian(v.byte_data, phandle++); if (phandle_node_name == BOTH || phandle_node_name == LINUX) { - p = new property(string("linux,phandle")); + p.reset(new property(string("linux,phandle"))); p->add_value(v); target->add_property(p); } if (phandle_node_name == BOTH || phandle_node_name == EPAPR) { - p = new property(string("phandle")); + p.reset(new property(string("phandle"))); p->add_value(v); target->add_property(p); } } - p->begin()->push_to_buffer((*i)->byte_data); - assert((*i)->byte_data.size() == 4); + p->begin()->push_to_buffer(i->byte_data); + assert(i->byte_data.size() == 4); } } void -device_tree::parse_roots(input_buffer &input, std::vector &roots) +device_tree::parse_file(input_buffer &input, + const std::string &dir, + std::vector &roots, + FILE *depfile, + bool &read_header) { input.next_token(); - while (valid && input.consume('/')) + // Read the header + if (input.consume("/dts-v1/;")) + { + read_header = true; + } + input.next_token(); + while(input.consume("/include/")) + { + bool reallyInclude = true; + if (input.consume("if ")) + { + input.next_token(); + string name = string::parse_property_name(input); + // XXX: Error handling + if (defines.find(name) == defines.end()) + { + reallyInclude = false; + } + input.consume('/'); + } + input.next_token(); + if (!input.consume('"')) + { + input.parse_error("Expected quoted filename"); + valid = false; + return; + } + int length = 0; + while (input[length] != '"') length++; + + std::string file((const char*)input, length); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 25 14:57:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98FE98E07; Sun, 25 Oct 2015 14:57:54 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 4766412C7; Sun, 25 Oct 2015 14:57:54 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PEvrdA082032; Sun, 25 Oct 2015 14:57:53 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PEvr9f082031; Sun, 25 Oct 2015 14:57:53 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201510251457.t9PEvr9f082031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sun, 25 Oct 2015 14:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289936 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 14:57:54 -0000 Author: dumbbell Date: Sun Oct 25 14:57:53 2015 New Revision: 289936 URL: https://svnweb.freebsd.org/changeset/base/289936 Log: drm/i915: Reduce diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. MFC after: 2 month Modified: head/sys/dev/drm2/i915/intel_crt.c Modified: head/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- head/sys/dev/drm2/i915/intel_crt.c Sun Oct 25 14:52:16 2015 (r289935) +++ head/sys/dev/drm2/i915/intel_crt.c Sun Oct 25 14:57:53 2015 (r289936) @@ -498,16 +498,16 @@ static int intel_crt_get_modes(struct dr struct drm_device *dev = connector->dev; struct drm_i915_private *dev_priv = dev->dev_private; int ret; - device_t iic; + device_t i2c; - iic = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin); - ret = intel_ddc_get_modes(connector, iic); + i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->crt_ddc_pin); + ret = intel_ddc_get_modes(connector, i2c); if (ret || !IS_G4X(dev)) return ret; /* Try to probe digital port for output in DVI-I -> VGA mode. */ - iic = intel_gmbus_get_adapter(dev_priv, GMBUS_PORT_DPB); - return intel_ddc_get_modes(connector, iic); + i2c = intel_gmbus_get_adapter(dev_priv, GMBUS_PORT_DPB); + return intel_ddc_get_modes(connector, i2c); } static int intel_crt_set_property(struct drm_connector *connector, @@ -522,8 +522,9 @@ static void intel_crt_reset(struct drm_c struct drm_device *dev = connector->dev; struct intel_crt *crt = intel_attached_crt(connector); - if (HAS_PCH_SPLIT(dev)) + if (HAS_PCH_SPLIT(dev)) { crt->force_hotplug_required = 1; + } } /* @@ -596,6 +597,7 @@ void intel_crt_init(struct drm_device *d return; crt = malloc(sizeof(struct intel_crt), DRM_MEM_KMS, M_WAITOK | M_ZERO); + intel_connector = malloc(sizeof(struct intel_connector), DRM_MEM_KMS, M_WAITOK | M_ZERO); From owner-svn-src-head@freebsd.org Sun Oct 25 16:04:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD46B8943; Sun, 25 Oct 2015 16:04:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 941B6112E; Sun, 25 Oct 2015 16:04:32 +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 t9PG4VCQ001876; Sun, 25 Oct 2015 16:04:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PG4VmN001874; Sun, 25 Oct 2015 16:04:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510251604.t9PG4VmN001874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Oct 2015 16:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289937 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 16:04:33 -0000 Author: mav Date: Sun Oct 25 16:04:31 2015 New Revision: 289937 URL: https://svnweb.freebsd.org/changeset/base/289937 Log: Try to keep Loop IDs persistent across chip reinits. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Oct 25 14:57:53 2015 (r289936) +++ head/sys/dev/isp/isp.c Sun Oct 25 16:04:31 2015 (r289937) @@ -1669,7 +1669,6 @@ isp_fibre_init(ispsoftc_t *isp) fcparam *fcp; isp_icb_t local, *icbp = &local; mbreg_t mbs; - int ownloopid; /* * We only support one channel on non-24XX cards @@ -1743,19 +1742,12 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; - icbp->icb_hardaddr = fcp->isp_loopid; - ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; - if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = 0; - ownloopid = 0; - } - - /* - * Our life seems so much better with 2200s and later with - * the latest f/w if we set Hard Address. - */ - if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) { - icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + else + icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS; } /* @@ -1989,7 +1981,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp_icb_2400_t local, *icbp = &local; mbreg_t mbs; int chan; - int ownloopid = 0; /* * Check to see whether all channels have *some* kind of role @@ -2024,16 +2015,20 @@ isp_fibre_init_2400(ispsoftc_t *isp) ISP_MEMZERO(icbp, sizeof (*icbp)); icbp->icb_fwoptions1 = fcp->isp_fwoptions; - if (fcp->role & ISP_ROLE_TARGET) { - icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; - } else { - icbp->icb_fwoptions1 &= ~ICB2400_OPT1_TGT_ENABLE; - } - - if (fcp->role & ISP_ROLE_INITIATOR) { + icbp->icb_fwoptions2 = fcp->isp_xfwoptions; + icbp->icb_fwoptions3 = fcp->isp_zfwoptions; + if (isp->isp_nchan > 1 && (isp->isp_fwattr & ISP2400_FW_ATTR_VP0)) { icbp->icb_fwoptions1 &= ~ICB2400_OPT1_INI_DISABLE; + icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; } else { - icbp->icb_fwoptions1 |= ICB2400_OPT1_INI_DISABLE; + if (fcp->role & ISP_ROLE_TARGET) + icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; + else + icbp->icb_fwoptions1 &= ~ICB2400_OPT1_TGT_ENABLE; + if (fcp->role & ISP_ROLE_INITIATOR) + icbp->icb_fwoptions1 &= ~ICB2400_OPT1_INI_DISABLE; + else + icbp->icb_fwoptions1 |= ICB2400_OPT1_INI_DISABLE; } icbp->icb_version = ICB_VERSION1; @@ -2058,18 +2053,14 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_xchgcnt >>= 1; } - - ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; - icbp->icb_hardaddr = fcp->isp_loopid; - if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = 0; - ownloopid = 0; + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; + else + icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS; } - if (ownloopid) - icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - - icbp->icb_fwoptions2 = fcp->isp_xfwoptions; if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2113,7 +2104,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } - icbp->icb_fwoptions3 = fcp->isp_zfwoptions; if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) { icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24; } @@ -2129,9 +2119,6 @@ isp_fibre_init_2400(ispsoftc_t *isp) } else { icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO; } - if (ownloopid == 0) { - icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID; - } icbp->icb_logintime = ICB_LOGIN_TOV; if (fcp->isp_wwnn && fcp->isp_wwpn) { @@ -2238,6 +2225,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; } + if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { + pi.vp_port_loopid = fcp2->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; + else + pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS; + } MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Sun Oct 25 14:57:53 2015 (r289936) +++ head/sys/dev/isp/ispmbox.h Sun Oct 25 16:04:31 2015 (r289937) @@ -928,7 +928,7 @@ typedef struct { #define ICBOPT_BOTH_WWNS 0x4000 #define ICBOPT_FULL_LOGIN 0x2000 #define ICBOPT_STOP_ON_QFULL 0x1000 /* 2200/2100 only */ -#define ICBOPT_PREVLOOP 0x0800 +#define ICBOPT_PREV_ADDRESS 0x0800 #define ICBOPT_SRCHDOWN 0x0400 #define ICBOPT_NOLIP 0x0200 #define ICBOPT_PDBCHANGE_AE 0x0100 @@ -982,7 +982,7 @@ typedef struct { /* 2400 F/W options */ #define ICB2400_OPT1_BOTH_WWNS 0x00004000 #define ICB2400_OPT1_FULL_LOGIN 0x00002000 -#define ICB2400_OPT1_PREVLOOP 0x00000800 +#define ICB2400_OPT1_PREV_ADDRESS 0x00000800 #define ICB2400_OPT1_SRCHDOWN 0x00000400 #define ICB2400_OPT1_NOLIP 0x00000200 #define ICB2400_OPT1_INI_DISABLE 0x00000020 @@ -1144,7 +1144,7 @@ typedef struct { #define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* Initiator Mode Enabled */ #define ICB2400_VPOPT_ENABLED 0x00000008 /* VP Enabled */ #define ICB2400_VPOPT_NOPLAY 0x00000004 /* ID Not Acquired */ -#define ICB2400_VPOPT_PREVLOOP 0x00000002 /* Previously Assigned ID */ +#define ICB2400_VPOPT_PREV_ADDRESS 0x00000002 /* Previously Assigned ID */ #define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 /* Hard Assigned ID */ #define ICB2400_VPOPT_WRITE_SIZE 20 From owner-svn-src-head@freebsd.org Sun Oct 25 16:48:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 007418FA3 for ; Sun, 25 Oct 2015 16:48:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 D4D031F48 for ; Sun, 25 Oct 2015 16:48:37 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 25 Oct 2015 16:48:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t9PGmUJd025700; Sun, 25 Oct 2015 10:48:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1445791710.91534.51.camel@freebsd.org> Subject: Re: svn commit: r289932 - head/sys/net From: Ian Lepore To: Kristof Provost , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 25 Oct 2015 10:48:30 -0600 In-Reply-To: <201510251314.t9PDEsV6053440@repo.freebsd.org> References: <201510251314.t9PDEsV6053440@repo.freebsd.org> Content-Type: text/plain; charset="iso-8859-2" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 16:48:38 -0000 On Sun, 2015-10-25 at 13:14 +0000, Kristof Provost wrote: > Author: kp > Date: Sun Oct 25 13:14:53 2015 > New Revision: 289932 > URL: https://svnweb.freebsd.org/changeset/base/289932 > > Log: > PF_ANEQ() macro will in most situations returns TRUE comparing two > identical > IPv4 packets (when it should return FALSE). It happens because > PF_ANEQ() doesn't > stop if first 32 bits of IPv4 packets are equal and starts to check > next 3*32 > bits (like for IPv6 packet). Those bits containt some garbage and > in result > PF_ANEQ() wrongly returns TRUE. > > Fix: Check if packet is of AF_INET type and if it is then compare > only first 32 > bits of data. > > PR: 204005 > Submitted by: Miłosz Kaniewski > > Modified: > head/sys/net/pfvar.h > > Modified: head/sys/net/pfvar.h > ===================================================================== > ========= > --- head/sys/net/pfvar.h Sun Oct 25 12:09:28 2015 (r289 > 931) > +++ head/sys/net/pfvar.h Sun Oct 25 13:14:53 2015 (r289 > 932) > @@ -198,10 +198,11 @@ extern struct rwlock pf_rules_lock; > (a)->addr32[0] == (b)->addr32[0])) \ > > #define PF_ANEQ(a, b, c) \ > - ((a)->addr32[0] != (b)->addr32[0] || \ > + ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \ > + (c == AF_INET6 && (a)->addr32[3] != (b)->addr32[3] && \ > (a)->addr32[1] != (b)->addr32[1] || \ > (a)->addr32[2] != (b)->addr32[2] || \ > - (a)->addr32[3] != (b)->addr32[3]) \ > + (a)->addr32[3] != (b)->addr32[3])) \ > > #define PF_AZERO(a, c) \ > ((c == AF_INET && !(a)->addr32[0]) || \ > It looks like this change is causing warnings when compiled with gcc: cc1: warnings being treated as errors /local/build/staging/freebsd/dpcur/src/sys/netpfil/pf/if_pfsync.c: In function 'pfsync_state_import': /local/build/staging/freebsd/dpcur/src/sys/netpfil/pf/if_pfsync.c:467: warning: suggest parentheses around && within || [-Wparentheses] /local/build/staging/freebsd/dpcur/src/sys/netpfil/pf/if_pfsync.c:468: warning: suggest parentheses around && within || [-Wparentheses] --- if_pfsync.o --- *** [if_pfsync.o] Error code 1 (and many more just the same building other pf files). -- Ian From owner-svn-src-head@freebsd.org Sun Oct 25 16:55:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76FB88108; Sun, 25 Oct 2015 16:55:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D89412BC; Sun, 25 Oct 2015 16:55:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:f98e:1278:f825:1dc6] (unknown [IPv6:2a02:1811:2419:4e02:f98e:1278:f825:1dc6]) by venus.codepro.be (Postfix) with ESMTPSA id 95DE2225D8; Sun, 25 Oct 2015 17:55:41 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Subject: Re: svn commit: r289932 - head/sys/net From: Kristof Provost In-Reply-To: <1445791710.91534.51.camel@freebsd.org> Date: Sun, 25 Oct 2015 17:55:38 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201510251314.t9PDEsV6053440@repo.freebsd.org> <1445791710.91534.51.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3096.5) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 16:55:45 -0000 > On 25 Oct 2015, at 17:48, Ian Lepore wrote: >=20 > On Sun, 2015-10-25 at 13:14 +0000, Kristof Provost wrote: >> Author: kp >> Date: Sun Oct 25 13:14:53 2015 >> New Revision: 289932 >> URL: https://svnweb.freebsd.org/changeset/base/289932 >>=20 >> Log: >> PF_ANEQ() macro will in most situations returns TRUE comparing two >> identical >=20 > It looks like this change is causing warnings when compiled with gcc: >=20 > cc1: warnings being treated as errors > /local/build/staging/freebsd/dpcur/src/sys/netpfil/pf/if_pfsync.c: In = function 'pfsync_state_import': > /local/build/staging/freebsd/dpcur/src/sys/netpfil/pf/if_pfsync.c:467: = warning: suggest parentheses around && within || [-Wparentheses] > /local/build/staging/freebsd/dpcur/src/sys/netpfil/pf/if_pfsync.c:468: = warning: suggest parentheses around && within || [-Wparentheses] > --- if_pfsync.o --- > *** [if_pfsync.o] Error code 1 >=20 > (and many more just the same building other pf files). Ouch, yes, it looks like I messed that up. The fix is on its way. Regards, Kristof= From owner-svn-src-head@freebsd.org Sun Oct 25 17:24:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C8CB8608; Sun, 25 Oct 2015 17:24:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id DA9B410CB; Sun, 25 Oct 2015 17:24:38 +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 t9PHObSC024602; Sun, 25 Oct 2015 17:24:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PHObZ8024601; Sun, 25 Oct 2015 17:24:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510251724.t9PHObZ8024601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Oct 2015 17:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289939 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 17:24:39 -0000 Author: mav Date: Sun Oct 25 17:24:37 2015 New Revision: 289939 URL: https://svnweb.freebsd.org/changeset/base/289939 Log: Rework r289933 using already existing macro. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Oct 25 17:17:50 2015 (r289938) +++ head/sys/dev/isp/isp.c Sun Oct 25 17:24:37 2015 (r289939) @@ -6073,11 +6073,10 @@ isp_parse_async_fc(ispsoftc_t *isp, uint if (IS_24XX(isp)) { nphdl = ISP_READ(isp, OUTMAILBOX1); nlstate = ISP_READ(isp, OUTMAILBOX2); - reason = ISP_READ(isp, OUTMAILBOX3); - chan = reason & 0xff; + reason = ISP_READ(isp, OUTMAILBOX3) >> 8; + GET_24XX_BUS(isp, chan, "ASYNC_CHANGE_NOTIFY"); echan = (nphdl == NIL_HANDLE) ? isp->isp_nchan - 1 : chan; - reason = reason >> 8; } else { nphdl = NIL_HANDLE; nlstate = reason = 0; From owner-svn-src-head@freebsd.org Sun Oct 25 18:09:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48EE38EF9; Sun, 25 Oct 2015 18:09:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B73A113A; Sun, 25 Oct 2015 18:09:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PI94Pg036249; Sun, 25 Oct 2015 18:09:04 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PI94u5036248; Sun, 25 Oct 2015 18:09:04 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201510251809.t9PI94u5036248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 25 Oct 2015 18:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289940 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 18:09:05 -0000 Author: kp Date: Sun Oct 25 18:09:03 2015 New Revision: 289940 URL: https://svnweb.freebsd.org/changeset/base/289940 Log: pf: Fix compliation warning with gcc While fixing the PF_ANEQ() macro I messed up the parentheses, leading to compliation warnings with gcc. Spotted by: ian Pointy Hat: kp Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Oct 25 17:24:37 2015 (r289939) +++ head/sys/net/pfvar.h Sun Oct 25 18:09:03 2015 (r289940) @@ -199,10 +199,10 @@ extern struct rwlock pf_rules_lock; #define PF_ANEQ(a, b, c) \ ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \ - (c == AF_INET6 && (a)->addr32[3] != (b)->addr32[3] && \ + (c == AF_INET6 && ((a)->addr32[0] != (b)->addr32[0] || \ (a)->addr32[1] != (b)->addr32[1] || \ (a)->addr32[2] != (b)->addr32[2] || \ - (a)->addr32[3] != (b)->addr32[3])) \ + (a)->addr32[3] != (b)->addr32[3]))) \ #define PF_AZERO(a, c) \ ((c == AF_INET && !(a)->addr32[0]) || \ From owner-svn-src-head@freebsd.org Sun Oct 25 18:37:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820E88415; Sun, 25 Oct 2015 18:37:58 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.net) Received: from heemeyer.club (heemeyer.club [IPv6:2001:19f0:6400:80a1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B58111CE2; Sun, 25 Oct 2015 18:37:57 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.net) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id t9PIbrDw090974 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Oct 2015 18:37:55 GMT (envelope-from dchagin@dchagin.static.corbina.net) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be dchagin.static.corbina.net Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.15.2/8.15.1) with ESMTPS id t9P4VwnH021944 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 25 Oct 2015 07:31:58 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.15.2/8.15.1/Submit) id t9P4Vwsp021943; Sun, 25 Oct 2015 07:31:58 +0300 (MSK) (envelope-from dchagin) Date: Sun, 25 Oct 2015 07:31:58 +0300 From: Chagin Dmitry To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r287395 - head/sys/compat/linux Message-ID: <20151025043158.GA17331@dchagin.static.corbina.net> References: <201509021404.t82E4E46037569@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201509021404.t82E4E46037569@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 18:37:58 -0000 On Wed, Sep 02, 2015 at 02:04:14PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Wed Sep 2 14:04:13 2015 > New Revision: 287395 > URL: https://svnweb.freebsd.org/changeset/base/287395 > > Log: > Fixes a panic triggered by threaded Linux applications when running > with RACCT/RCTL enabled. Thank you, Edward! -- Have fun! chd From owner-svn-src-head@freebsd.org Sun Oct 25 18:48:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 936FB8627; Sun, 25 Oct 2015 18:48:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA2410B6; Sun, 25 Oct 2015 18:48:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PIm996047670; Sun, 25 Oct 2015 18:48:09 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PIm9kg047669; Sun, 25 Oct 2015 18:48:09 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201510251848.t9PIm9kg047669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Sun, 25 Oct 2015 18:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289941 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 18:48:10 -0000 Author: pjd Date: Sun Oct 25 18:48:09 2015 New Revision: 289941 URL: https://svnweb.freebsd.org/changeset/base/289941 Log: The aio_waitcomplete(2) syscall should not sleep when the given timeout is 0. Without this change it was sleeping for one tick. Maybe not a big deal, but it makes share/dtrace/blocking script to report that. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D3814 Sponsored by: Wheel Systems, http://wheelsystems.com Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Oct 25 18:09:03 2015 (r289940) +++ head/sys/kern/vfs_aio.c Sun Oct 25 18:48:09 2015 (r289941) @@ -2494,8 +2494,11 @@ kern_aio_waitcomplete(struct thread *td, ops->store_aiocb(aiocbp, NULL); - timo = 0; - if (ts) { + if (ts == NULL) { + timo = 0; + } else if (ts->tv_sec == 0 && ts->tv_nsec == 0) { + timo = -1; + } else { if ((ts->tv_nsec < 0) || (ts->tv_nsec >= 1000000000)) return (EINVAL); @@ -2513,6 +2516,10 @@ kern_aio_waitcomplete(struct thread *td, cb = NULL; AIO_LOCK(ki); while ((cb = TAILQ_FIRST(&ki->kaio_done)) == NULL) { + if (timo == -1) { + error = EWOULDBLOCK; + break; + } ki->kaio_flags |= KAIO_WAKEUP; error = msleep(&p->p_aioinfo, AIO_MTX(ki), PRIBIO | PCATCH, "aiowc", timo); From owner-svn-src-head@freebsd.org Sun Oct 25 19:55:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD038846; Sun, 25 Oct 2015 19:55:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 333171D33; Sun, 25 Oct 2015 19:55:49 +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 t9PJtmBj070146; Sun, 25 Oct 2015 19:55:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PJtmpI070145; Sun, 25 Oct 2015 19:55:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510251955.t9PJtmpI070145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 25 Oct 2015 19:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289942 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 19:55:49 -0000 Author: mav Date: Sun Oct 25 19:55:48 2015 New Revision: 289942 URL: https://svnweb.freebsd.org/changeset/base/289942 Log: Deliver INOTs only to enabled virtual ports. Modified: head/sys/dev/isp/isp_target.c Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Sun Oct 25 18:48:09 2015 (r289941) +++ head/sys/dev/isp/isp_target.c Sun Oct 25 19:55:48 2015 (r289942) @@ -1889,6 +1889,8 @@ isp_handle_24xx_inotify(ispsoftc_t *isp, } isp_prt(isp, ISP_LOGTDEBUG1, "%s: Immediate Notify Channels %d..%d status=0x%x seqid=0x%x", __func__, lochan, hichan-1, inot_24xx->in_status, inot_24xx->in_rxid); for (chan = lochan; chan < hichan; chan++) { + if (FCPARAM(isp, chan)->role == ISP_ROLE_NONE) + continue; switch (inot_24xx->in_status) { case IN24XX_LIP_RESET: case IN24XX_LINK_RESET: From owner-svn-src-head@freebsd.org Sun Oct 25 22:00:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38802865A; Sun, 25 Oct 2015 22:00:59 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 022041777; Sun, 25 Oct 2015 22:00:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PM0wKf005340; Sun, 25 Oct 2015 22:00:58 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PM0v0D005329; Sun, 25 Oct 2015 22:00:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510252200.t9PM0v0D005329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 25 Oct 2015 22:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289945 - in head/sys: arm/conf conf dev/mge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 22:00:59 -0000 Author: zbb Date: Sun Oct 25 22:00:56 2015 New Revision: 289945 URL: https://svnweb.freebsd.org/changeset/base/289945 Log: Add etherswitch support to mge This commit introduces support for etherswitch devices that utilize SMI as a way of accessing its registers. SMI register is located in address space of mge -- access to it was exported through MDIO interface. Attachment functions were enhanced so as to ensure proper initialisation in both cases: 1) PHYs attached directly to mge, 2) PHYs attached to switch device and switch attached to mge. Attachment of etherswitch device depends on dts entry with compatible="mrvl,sw" property. If none is found, typical PHY attachment procedure follows. In case of switch attached, PHYs' status and configuration is accessible via etherswitchcfg, and ifconfig shows always-up, non-configurable mge interfaces. Due to the fact that there may be simultaneous accessess to SMI registers (e.g. from PHY attached to one of mge instances and switch to the other), SMI access interlock was added. It is SX lock, because sleep ability is necessary -- busy-waiting would result in poor performance due to long delays required by hardware. Underlying switch driver is obliged to use sleepable locks as well. Reviewed by: adrian Obtained from: Semihalf Submitted by: Bartosz Szczepanek Differential revision: https://reviews.freebsd.org/D3900 Modified: head/sys/arm/conf/ARMADAXP head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/TS7800 head/sys/conf/files head/sys/dev/mge/if_mge.c head/sys/dev/mge/if_mgevar.h Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/ARMADAXP Sun Oct 25 22:00:56 2015 (r289945) @@ -95,6 +95,7 @@ device iicbus device ether device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy device bpf options DEVICE_POLLING Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/DB-78XXX Sun Oct 25 22:00:56 2015 (r289945) @@ -66,6 +66,7 @@ device uart device ether device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy device bpf Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/DB-88F5XXX Sun Oct 25 22:00:56 2015 (r289945) @@ -65,6 +65,7 @@ device uart device ether device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy device bpf options DEVICE_POLLING Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/DB-88F6XXX Sun Oct 25 22:00:56 2015 (r289945) @@ -67,6 +67,7 @@ device uart device ether device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy device bpf Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/DOCKSTAR Sun Oct 25 22:00:56 2015 (r289945) @@ -96,6 +96,7 @@ device uart # Networking device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy # USB Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/DREAMPLUG-1001 Sun Oct 25 22:00:56 2015 (r289945) @@ -100,6 +100,7 @@ device uart # Networking device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy # USB Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/SHEEVAPLUG Sun Oct 25 22:00:56 2015 (r289945) @@ -60,6 +60,7 @@ device uart device ether device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy device bpf options DEVICE_POLLING Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/arm/conf/TS7800 Sun Oct 25 22:00:56 2015 (r289945) @@ -60,6 +60,7 @@ device uart device ether device mge # Marvell Gigabit Ethernet controller device mii +device mdio device e1000phy device bpf options HZ=1000 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/conf/files Sun Oct 25 22:00:56 2015 (r289945) @@ -1398,8 +1398,8 @@ dev/etherswitch/ip17x/ip175c.c optional dev/etherswitch/ip17x/ip175d.c optional ip17x dev/etherswitch/ip17x/ip17x_phy.c optional ip17x dev/etherswitch/ip17x/ip17x_vlans.c optional ip17x -dev/etherswitch/mdio_if.m optional miiproxy -dev/etherswitch/mdio.c optional miiproxy +dev/etherswitch/mdio_if.m optional miiproxy | mdio +dev/etherswitch/mdio.c optional miiproxy | mdio dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb dev/etherswitch/ukswitch/ukswitch.c optional ukswitch Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/dev/mge/if_mge.c Sun Oct 25 22:00:56 2015 (r289945) @@ -1,5 +1,7 @@ /*- * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (C) 2009-2015 Semihalf + * Copyright (C) 2015 Stormshield * All rights reserved. * * Developed by Semihalf. @@ -50,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -73,12 +74,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include "miibus_if.h" +#include "mdio_if.h" + +#define MGE_DELAY(x) pause("SMI access sleep", (x) / tick_sbt) static int mge_probe(device_t dev); static int mge_attach(device_t dev); @@ -90,6 +95,9 @@ static int mge_resume(device_t dev); static int mge_miibus_readreg(device_t dev, int phy, int reg); static int mge_miibus_writereg(device_t dev, int phy, int reg, int value); +static int mge_mdio_readreg(device_t dev, int phy, int reg); +static int mge_mdio_writereg(device_t dev, int phy, int reg, int value); + static int mge_ifmedia_upd(struct ifnet *ifp); static void mge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); @@ -154,21 +162,23 @@ static device_method_t mge_methods[] = { /* MII interface */ DEVMETHOD(miibus_readreg, mge_miibus_readreg), DEVMETHOD(miibus_writereg, mge_miibus_writereg), + /* MDIO interface */ + DEVMETHOD(mdio_readreg, mge_mdio_readreg), + DEVMETHOD(mdio_writereg, mge_mdio_writereg), { 0, 0 } }; -static driver_t mge_driver = { - "mge", - mge_methods, - sizeof(struct mge_softc), -}; +DEFINE_CLASS_0(mge, mge_driver, mge_methods, sizeof(struct mge_softc)); static devclass_t mge_devclass; +static int switch_attached = 0; DRIVER_MODULE(mge, simplebus, mge_driver, mge_devclass, 0, 0); DRIVER_MODULE(miibus, mge, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mdio, mge, mdio_driver, mdio_devclass, 0, 0); MODULE_DEPEND(mge, ether, 1, 1, 1); MODULE_DEPEND(mge, miibus, 1, 1, 1); +MODULE_DEPEND(mge, mdio, 1, 1, 1); static struct resource_spec res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -190,6 +200,133 @@ static struct { { mge_intr_err, "GbE error interrupt" }, }; +/* SMI access interlock */ +static struct sx sx_smi; + +static uint32_t +mv_read_ge_smi(device_t dev, int phy, int reg) +{ + uint32_t timeout; + uint32_t ret; + struct mge_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc != NULL, ("NULL softc ptr!")); + timeout = MGE_SMI_WRITE_RETRIES; + + MGE_SMI_LOCK(); + while (--timeout && + (MGE_READ(sc, MGE_REG_SMI) & MGE_SMI_BUSY)) + MGE_DELAY(MGE_SMI_WRITE_DELAY); + + if (timeout == 0) { + device_printf(dev, "SMI write timeout.\n"); + ret = ~0U; + goto out; + } + + MGE_WRITE(sc, MGE_REG_SMI, MGE_SMI_MASK & + (MGE_SMI_READ | (reg << 21) | (phy << 16))); + + /* Wait till finished. */ + timeout = MGE_SMI_WRITE_RETRIES; + while (--timeout && + !((MGE_READ(sc, MGE_REG_SMI) & MGE_SMI_READVALID))) + MGE_DELAY(MGE_SMI_WRITE_DELAY); + + if (timeout == 0) { + device_printf(dev, "SMI write validation timeout.\n"); + ret = ~0U; + goto out; + } + + /* Wait for the data to update in the SMI register */ + MGE_DELAY(MGE_SMI_DELAY); + ret = MGE_READ(sc, MGE_REG_SMI) & MGE_SMI_DATA_MASK; + +out: + MGE_SMI_UNLOCK(); + return (ret); + +} + +static void +mv_write_ge_smi(device_t dev, int phy, int reg, uint32_t value) +{ + uint32_t timeout; + struct mge_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc != NULL, ("NULL softc ptr!")); + + MGE_SMI_LOCK(); + timeout = MGE_SMI_READ_RETRIES; + while (--timeout && + (MGE_READ(sc, MGE_REG_SMI) & MGE_SMI_BUSY)) + MGE_DELAY(MGE_SMI_READ_DELAY); + + if (timeout == 0) { + device_printf(dev, "SMI read timeout.\n"); + goto out; + } + + MGE_WRITE(sc, MGE_REG_SMI, MGE_SMI_MASK & + (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | + (value & MGE_SMI_DATA_MASK))); + +out: + MGE_SMI_UNLOCK(); +} + +static int +mv_read_ext_phy(device_t dev, int phy, int reg) +{ + uint32_t retries; + struct mge_softc *sc; + uint32_t ret; + + sc = device_get_softc(dev); + + MGE_SMI_LOCK(); + MGE_WRITE(sc->phy_sc, MGE_REG_SMI, MGE_SMI_MASK & + (MGE_SMI_READ | (reg << 21) | (phy << 16))); + + retries = MGE_SMI_READ_RETRIES; + while (--retries && + !(MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_READVALID)) + DELAY(MGE_SMI_READ_DELAY); + + if (retries == 0) + device_printf(dev, "Timeout while reading from PHY\n"); + + ret = MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_DATA_MASK; + MGE_SMI_UNLOCK(); + + return (ret); +} + +static void +mv_write_ext_phy(device_t dev, int phy, int reg, int value) +{ + uint32_t retries; + struct mge_softc *sc; + + sc = device_get_softc(dev); + + MGE_SMI_LOCK(); + MGE_WRITE(sc->phy_sc, MGE_REG_SMI, MGE_SMI_MASK & + (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | + (value & MGE_SMI_DATA_MASK))); + + retries = MGE_SMI_WRITE_RETRIES; + while (--retries && MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_BUSY) + DELAY(MGE_SMI_WRITE_DELAY); + + if (retries == 0) + device_printf(dev, "Timeout while writing to PHY\n"); + MGE_SMI_UNLOCK(); +} + static void mge_get_mac_address(struct mge_softc *sc, uint8_t *addr) { @@ -605,10 +742,10 @@ mge_poll(struct ifnet *ifp, enum poll_cm uint32_t int_cause, int_cause_ext; int rx_npkts = 0; - MGE_GLOBAL_LOCK(sc); + MGE_RECEIVE_LOCK(sc); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - MGE_GLOBAL_UNLOCK(sc); + MGE_RECEIVE_UNLOCK(sc); return (rx_npkts); } @@ -626,10 +763,13 @@ mge_poll(struct ifnet *ifp, enum poll_cm } } - mge_intr_tx_locked(sc); + rx_npkts = mge_intr_rx_locked(sc, count); - MGE_GLOBAL_UNLOCK(sc); + MGE_RECEIVE_UNLOCK(sc); + MGE_TRANSMIT_LOCK(sc); + mge_intr_tx_locked(sc); + MGE_TRANSMIT_UNLOCK(sc); return (rx_npkts); } #endif /* DEVICE_POLLING */ @@ -646,14 +786,34 @@ mge_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; sc->node = ofw_bus_get_node(dev); + phy = 0; + + if (fdt_get_phyaddr(sc->node, sc->dev, &phy, (void **)&sc->phy_sc) == 0) { + device_printf(dev, "PHY%i attached, phy_sc points to %s\n", phy, + device_get_nameunit(sc->phy_sc->dev)); + sc->phy_attached = 1; + } else { + device_printf(dev, "PHY not attached.\n"); + sc->phy_attached = 0; + sc->phy_sc = sc; + } + + if (fdt_find_compatible(sc->node, "mrvl,sw", 1) != 0) { + device_printf(dev, "Switch attached.\n"); + sc->switch_attached = 1; + /* additional variable available across instances */ + switch_attached = 1; + } else { + sc->switch_attached = 0; + } + + if (device_get_unit(dev) == 0) { + sx_init(&sx_smi, "mge_tick() SMI access threads interlock"); + } /* Set chip version-dependent parameters */ mge_ver_params(sc); - /* Get phy address and used softc from fdt */ - if (fdt_get_phyaddr(sc->node, sc->dev, &phy, (void **)&sc->phy_sc) != 0) - return (ENXIO); - /* Initialize mutexes */ mtx_init(&sc->transmit_lock, device_get_nameunit(dev), "mge TX lock", MTX_DEF); mtx_init(&sc->receive_lock, device_get_nameunit(dev), "mge RX lock", MTX_DEF); @@ -719,18 +879,32 @@ mge_attach(device_t dev) callout_init(&sc->wd_callout, 0); /* Attach PHY(s) */ - error = mii_attach(dev, &sc->miibus, ifp, mge_ifmedia_upd, - mge_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); - if (error) { - device_printf(dev, "attaching PHYs failed\n"); - mge_detach(dev); - return (error); - } - sc->mii = device_get_softc(sc->miibus); + if (sc->phy_attached) { + error = mii_attach(dev, &sc->miibus, ifp, mge_ifmedia_upd, + mge_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + if (error) { + device_printf(dev, "MII failed to find PHY\n"); + if_free(ifp); + sc->ifp = NULL; + mge_detach(dev); + return (error); + } + sc->mii = device_get_softc(sc->miibus); - /* Tell the MAC where to find the PHY so autoneg works */ - miisc = LIST_FIRST(&sc->mii->mii_phys); - MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); + /* Tell the MAC where to find the PHY so autoneg works */ + miisc = LIST_FIRST(&sc->mii->mii_phys); + MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); + } else { + /* no PHY, so use hard-coded values */ + ifmedia_init(&sc->mge_ifmedia, 0, + mge_ifmedia_upd, + mge_ifmedia_sts); + ifmedia_add(&sc->mge_ifmedia, + IFM_ETHER | IFM_1000_T | IFM_FDX, + 0, NULL); + ifmedia_set(&sc->mge_ifmedia, + IFM_ETHER | IFM_1000_T | IFM_FDX); + } /* Attach interrupt handlers */ /* TODO: review flags, in part. mark RX as INTR_ENTROPY ? */ @@ -747,6 +921,13 @@ mge_attach(device_t dev) } } + if (sc->switch_attached) { + device_t child; + MGE_WRITE(sc, MGE_REG_PHYDEV, MGE_SWITCH_PHYDEV); + child = device_add_child(dev, "mdio", -1); + bus_generic_attach(dev); + } + return (0); } @@ -792,6 +973,9 @@ mge_detach(device_t dev) mtx_destroy(&sc->receive_lock); mtx_destroy(&sc->transmit_lock); + if (device_get_unit(dev) == 0) + sx_destroy(&sx_smi); + return (0); } @@ -801,7 +985,13 @@ mge_ifmedia_sts(struct ifnet *ifp, struc struct mge_softc *sc = ifp->if_softc; struct mii_data *mii; - MGE_TRANSMIT_LOCK(sc); + MGE_GLOBAL_LOCK(sc); + + if (!sc->phy_attached) { + ifmr->ifm_active = IFM_1000_T | IFM_FDX | IFM_ETHER; + ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE; + goto out_unlock; + } mii = sc->mii; mii_pollstat(mii); @@ -809,7 +999,8 @@ mge_ifmedia_sts(struct ifnet *ifp, struc ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; - MGE_TRANSMIT_UNLOCK(sc); +out_unlock: + MGE_GLOBAL_UNLOCK(sc); } static uint32_t @@ -826,13 +1017,13 @@ mge_set_port_serial_control(uint32_t med break; case IFM_1000_T: port_config |= (PORT_SERIAL_GMII_SPEED_1000 | - PORT_SERIAL_AUTONEG | PORT_SERIAL_AUTONEG_FC | - PORT_SERIAL_SPEED_AUTONEG); + PORT_SERIAL_AUTONEG | PORT_SERIAL_AUTONEG_FC + | PORT_SERIAL_SPEED_AUTONEG); break; case IFM_100_TX: port_config |= (PORT_SERIAL_MII_SPEED_100 | - PORT_SERIAL_AUTONEG | PORT_SERIAL_AUTONEG_FC | - PORT_SERIAL_SPEED_AUTONEG); + PORT_SERIAL_AUTONEG | PORT_SERIAL_AUTONEG_FC + | PORT_SERIAL_SPEED_AUTONEG); break; case IFM_10_T: port_config |= (PORT_SERIAL_AUTONEG | @@ -851,13 +1042,21 @@ mge_ifmedia_upd(struct ifnet *ifp) { struct mge_softc *sc = ifp->if_softc; - if (ifp->if_flags & IFF_UP) { + /* + * Do not do anything for switch here, as updating media between + * MGE MAC and switch MAC is hardcoded in PCB. Changing it here would + * break the link. + */ + if (sc->phy_attached) { MGE_GLOBAL_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + sc->mge_media_status = sc->mii->mii_media.ifm_media; + mii_mediachg(sc->mii); - sc->mge_media_status = sc->mii->mii_media.ifm_media; - mii_mediachg(sc->mii); - mge_init_locked(sc); + /* MGE MAC needs to be reinitialized. */ + mge_init_locked(sc); + } MGE_GLOBAL_UNLOCK(sc); } @@ -883,6 +1082,7 @@ mge_init_locked(void *arg) struct mge_desc_wrapper *dw; volatile uint32_t reg_val; int i, count; + uint32_t media_status; MGE_GLOBAL_LOCK_ASSERT(sc); @@ -925,8 +1125,17 @@ mge_init_locked(void *arg) PORT_CONFIG_ARO_RXQ(0)); MGE_WRITE(sc, MGE_PORT_EXT_CONFIG , 0x0); + /* Configure promisc mode */ + mge_set_prom_mode(sc, MGE_RX_DEFAULT_QUEUE); + + media_status = sc->mge_media_status; + if (sc->switch_attached) { + media_status &= ~IFM_TMASK; + media_status |= IFM_1000_T; + } + /* Setup port configuration */ - reg_val = mge_set_port_serial_control(sc->mge_media_status); + reg_val = mge_set_port_serial_control(media_status); MGE_WRITE(sc, MGE_PORT_SERIAL_CTRL, reg_val); /* Setup SDMA configuration */ @@ -997,7 +1206,8 @@ mge_init_locked(void *arg) sc->wd_timer = 0; /* Schedule watchdog timeout */ - callout_reset(&sc->wd_callout, hz, mge_tick, sc); + if (sc->phy_attached) + callout_reset(&sc->wd_callout, hz, mge_tick, sc); } static void @@ -1331,6 +1541,18 @@ mge_ioctl(struct ifnet *ifp, u_long comm break; case SIOCGIFMEDIA: /* fall through */ case SIOCSIFMEDIA: + /* + * Setting up media type via ioctls is *not* supported for MAC + * which is connected to switch. Use etherswitchcfg. + */ + if (!sc->phy_attached && (command == SIOCSIFMEDIA)) + return (0); + else if (!sc->phy_attached) { + error = ifmedia_ioctl(ifp, ifr, &sc->mge_ifmedia, + command); + break; + } + if (IFM_SUBTYPE(ifr->ifr_media) == IFM_1000_T && !(ifr->ifr_media & IFM_FDX)) { device_printf(sc->dev, @@ -1349,41 +1571,23 @@ static int mge_miibus_readreg(device_t dev, int phy, int reg) { struct mge_softc *sc; - uint32_t retries; - sc = device_get_softc(dev); - MGE_WRITE(sc->phy_sc, MGE_REG_SMI, 0x1fffffff & - (MGE_SMI_READ | (reg << 21) | (phy << 16))); - - retries = MGE_SMI_READ_RETRIES; - while (--retries && - !(MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_READVALID)) - DELAY(MGE_SMI_READ_DELAY); + KASSERT(!switch_attached, ("miibus used with switch attached")); - if (retries == 0) - device_printf(dev, "Timeout while reading from PHY\n"); - - return (MGE_READ(sc->phy_sc, MGE_REG_SMI) & 0xffff); + return (mv_read_ext_phy(dev, phy, reg)); } static int mge_miibus_writereg(device_t dev, int phy, int reg, int value) { struct mge_softc *sc; - uint32_t retries; - sc = device_get_softc(dev); - MGE_WRITE(sc->phy_sc, MGE_REG_SMI, 0x1fffffff & - (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | (value & 0xffff))); + KASSERT(!switch_attached, ("miibus used with switch attached")); - retries = MGE_SMI_WRITE_RETRIES; - while (--retries && MGE_READ(sc->phy_sc, MGE_REG_SMI) & MGE_SMI_BUSY) - DELAY(MGE_SMI_WRITE_DELAY); + mv_write_ext_phy(dev, phy, reg, value); - if (retries == 0) - device_printf(dev, "Timeout while writing to PHY\n"); return (0); } @@ -1489,6 +1693,10 @@ mge_tick(void *msc) { struct mge_softc *sc = msc; + KASSERT(sc->phy_attached == 1, ("mge_tick while PHY not attached")); + + MGE_GLOBAL_LOCK(sc); + /* Check for TX timeout */ mge_watchdog(sc); @@ -1498,8 +1706,12 @@ mge_tick(void *msc) if(sc->mge_media_status != sc->mii->mii_media.ifm_media) mge_ifmedia_upd(sc->ifp); + MGE_GLOBAL_UNLOCK(sc); + /* Schedule another timeout one second from now */ callout_reset(&sc->wd_callout, hz, mge_tick, sc); + + return; } static void @@ -1509,10 +1721,7 @@ mge_watchdog(struct mge_softc *sc) ifp = sc->ifp; - MGE_GLOBAL_LOCK(sc); - if (sc->wd_timer == 0 || --sc->wd_timer) { - MGE_GLOBAL_UNLOCK(sc); return; } @@ -1521,8 +1730,6 @@ mge_watchdog(struct mge_softc *sc) mge_stop(sc); mge_init_locked(sc); - - MGE_GLOBAL_UNLOCK(sc); } static void @@ -1927,3 +2134,23 @@ mge_add_sysctls(struct mge_softc *sc) CTLTYPE_UINT | CTLFLAG_RW, sc, MGE_IC_TX, mge_sysctl_ic, "I", "IC TX time threshold"); } + +static int +mge_mdio_writereg(device_t dev, int phy, int reg, int value) +{ + + mv_write_ge_smi(dev, phy, reg, value); + + return (0); +} + + +static int +mge_mdio_readreg(device_t dev, int phy, int reg) +{ + int ret; + + ret = mv_read_ge_smi(dev, phy, reg); + + return (ret); +} Modified: head/sys/dev/mge/if_mgevar.h ============================================================================== --- head/sys/dev/mge/if_mgevar.h Sun Oct 25 21:48:45 2015 (r289944) +++ head/sys/dev/mge/if_mgevar.h Sun Oct 25 22:00:56 2015 (r289945) @@ -34,6 +34,8 @@ #ifndef __IF_MGE_H__ #define __IF_MGE_H__ +#include + #define MGE_INTR_COUNT 5 /* ETH controller occupies 5 IRQ lines */ #define MGE_TX_DESC_NUM 256 #define MGE_RX_DESC_NUM 256 @@ -71,6 +73,7 @@ struct mge_softc { device_t miibus; struct mii_data *mii; + struct ifmedia mge_ifmedia; struct resource *res[1 + MGE_INTR_COUNT]; /* resources */ void *ih_cookie[MGE_INTR_COUNT]; /* interrupt handlers cookies */ struct mtx transmit_lock; /* transmitter lock */ @@ -106,6 +109,8 @@ struct mge_softc { int mge_intr_cnt; uint8_t mge_hw_csum; + int phy_attached; + int switch_attached; struct mge_softc *phy_sc; }; @@ -150,6 +155,14 @@ struct mge_softc { MGE_RECEIVE_LOCK_ASSERT(sc); \ } while (0) +#define MGE_SMI_LOCK() do { \ + sx_assert(&sx_smi, SA_UNLOCKED); \ + sx_xlock(&sx_smi); \ +} while (0) + +#define MGE_SMI_UNLOCK() sx_unlock(&sx_smi) +#define MGE_SMI_LOCK_ASSERT() sx_assert(&sx_smi, SA_XLOCKED) + /* SMI-related macros */ #define MGE_REG_PHYDEV 0x000 #define MGE_REG_SMI 0x004 @@ -158,6 +171,17 @@ struct mge_softc { #define MGE_SMI_READVALID (1 << 27) #define MGE_SMI_BUSY (1 << 28) +#define MGE_SMI_MASK 0x1fffffff +#define MGE_SMI_DATA_MASK 0xffff +#define MGE_SMI_DELAY 1000 + +#define MGE_SWITCH_PHYDEV 6 + +/* Internal Switch SMI Command */ + +#define SW_SMI_READ_CMD(phy, reg) ((1 << 15) | (1 << 12) | (1 << 11) | (phy << 5) | reg) +#define SW_SMI_WRITE_CMD(phy, reg) ((1 << 15) | (1 << 12) | (1 << 10) | (phy << 5) | reg) + /* TODO verify the timings and retries count w/specs */ #define MGE_SMI_READ_RETRIES 1000 #define MGE_SMI_READ_DELAY 100 From owner-svn-src-head@freebsd.org Sun Oct 25 22:14:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF958C4B; Sun, 25 Oct 2015 22:14:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2B05313E4; Sun, 25 Oct 2015 22:14:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PME4ew011041; Sun, 25 Oct 2015 22:14:04 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PME4X2011039; Sun, 25 Oct 2015 22:14:04 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510252214.t9PME4X2011039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 25 Oct 2015 22:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289947 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 22:14:05 -0000 Author: zbb Date: Sun Oct 25 22:14:04 2015 New Revision: 289947 URL: https://svnweb.freebsd.org/changeset/base/289947 Log: Introduce e6000sw etherswitch support Add e6000sw driver supporting Marvell 88E6352, 88E6172, 88E6176 switches. It needs to be attached to mdio interface, exporting SMI access functionality. e6000sw supports port-based VLAN configuration, per-port media changing, accessing PHY and switch registers. e6000sw attaches miibuses and PHY drivers as children. Instead of typical tick as callout, kthread-based tick is used. This combined with SX locks allows MDIO read/write calls to sleep. It is expected, because this hardware requires long delays in SMI read/write procedures, which can not be handled by busy-waiting. Reviewed by: adrian Obtained from: Semihalf Submitted by: Bartosz Szczepanek Differential revision: https://reviews.freebsd.org/D3902 Added: head/sys/dev/etherswitch/e6000sw/ head/sys/dev/etherswitch/e6000sw/e6000sw.c (contents, props changed) head/sys/dev/etherswitch/e6000sw/e6000swreg.h (contents, props changed) Added: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Sun Oct 25 22:14:04 2015 (r289947) @@ -0,0 +1,976 @@ +/*- + * Copyright (c) 2015 Semihalf + * Copyright (c) 2015 Stormshield + * 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 +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "e6000swreg.h" +#include "etherswitch_if.h" +#include "miibus_if.h" +#include "mdio_if.h" + +MALLOC_DECLARE(M_E6000SW); +MALLOC_DEFINE(M_E6000SW, "e6000sw", "e6000sw switch"); + +#define E6000SW_LOCK(_sc) \ + sx_xlock(&(_sc)->sx) +#define E6000SW_UNLOCK(_sc) \ + sx_unlock(&(_sc)->sx) +#define E6000SW_LOCK_ASSERT(_sc, _what) \ + sx_assert(&(_sc)->sx, (_what)) +#define E6000SW_TRYLOCK(_sc) \ + sx_tryxlock(&(_sc)->sx) + +typedef struct e6000sw_softc { + device_t dev; + + struct sx sx; + struct ifnet *ifp[E6000SW_NUM_PHYS]; + char *ifname[E6000SW_NUM_PHYS]; + device_t miibus[E6000SW_NUM_PHYS]; + struct mii_data *mii[E6000SW_NUM_PHYS]; + struct callout tick_callout; + + uint32_t cpuports_mask; + + int vid[E6000SW_NUM_VGROUPS]; + int members[E6000SW_NUM_VGROUPS]; + int vgroup[E6000SW_NUM_PORTS]; +} e6000sw_softc_t; + +static etherswitch_info_t etherswitch_info = { + .es_nports = E6000SW_NUM_PORTS, + .es_nvlangroups = E6000SW_NUM_VGROUPS, + .es_name = "Marvell 6000 series switch" +}; + +static void e6000sw_identify(driver_t *driver, device_t parent); +static int e6000sw_probe(device_t dev); +static int e6000sw_attach(device_t dev); +static int e6000sw_detach(device_t dev); +static int e6000sw_readphy(device_t dev, int phy, int reg); +static int e6000sw_writephy(device_t dev, int phy, int reg, int data); +static etherswitch_info_t* e6000sw_getinfo(device_t dev); +static void e6000sw_lock(device_t dev); +static void e6000sw_unlock(device_t dev); +static int e6000sw_getport(device_t dev, etherswitch_port_t *p); +static int e6000sw_setport(device_t dev, etherswitch_port_t *p); +static int e6000sw_readreg_wrapper(device_t dev, int addr_reg); +static int e6000sw_writereg_wrapper(device_t dev, int addr_reg, int val); +static int e6000sw_readphy_wrapper(device_t dev, int phy, int reg); +static int e6000sw_writephy_wrapper(device_t dev, int phy, int reg, int data); +static int e6000sw_getvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg); +static int e6000sw_setvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg); +static int e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg); +static int e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg); +static void e6000sw_setup(device_t dev, e6000sw_softc_t *sc); +static void e6000sw_port_vlan_conf(e6000sw_softc_t *sc); +static void e6000sw_tick(void *arg); +static void e6000sw_set_atustat(device_t dev, e6000sw_softc_t *sc, int bin, + int flag); +static int e6000sw_atu_flush(device_t dev, e6000sw_softc_t *sc, int flag); +static __inline void e6000sw_writereg(e6000sw_softc_t *sc, int addr, int reg, + int val); +static __inline uint32_t e6000sw_readreg(e6000sw_softc_t *sc, int addr, + int reg); +static int e6000sw_ifmedia_upd(struct ifnet *ifp); +static void e6000sw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); +static int e6000sw_atu_mac_table(device_t dev, e6000sw_softc_t *sc, struct + atu_opt *atu, int flag); +static int e6000sw_get_pvid(e6000sw_softc_t *sc, int port, int *pvid); +static int e6000sw_set_pvid(e6000sw_softc_t *sc, int port, int pvid); +static __inline int e6000sw_cpuport(e6000sw_softc_t *sc, int port); +static __inline struct mii_data *e6000sw_miiforphy(e6000sw_softc_t *sc, + unsigned int phy); + +static struct proc *e6000sw_kproc; + +static device_method_t e6000sw_methods[] = { + /* device interface */ + DEVMETHOD(device_identify, e6000sw_identify), + DEVMETHOD(device_probe, e6000sw_probe), + DEVMETHOD(device_attach, e6000sw_attach), + DEVMETHOD(device_detach, e6000sw_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, device_add_child_ordered), + + /* mii interface */ + DEVMETHOD(miibus_readreg, e6000sw_readphy), + DEVMETHOD(miibus_writereg, e6000sw_writephy), + + /* etherswitch interface */ + DEVMETHOD(etherswitch_getinfo, e6000sw_getinfo), + DEVMETHOD(etherswitch_lock, e6000sw_lock), + DEVMETHOD(etherswitch_unlock, e6000sw_unlock), + DEVMETHOD(etherswitch_getport, e6000sw_getport), + DEVMETHOD(etherswitch_setport, e6000sw_setport), + DEVMETHOD(etherswitch_readreg, e6000sw_readreg_wrapper), + DEVMETHOD(etherswitch_writereg, e6000sw_writereg_wrapper), + DEVMETHOD(etherswitch_readphyreg, e6000sw_readphy_wrapper), + DEVMETHOD(etherswitch_writephyreg, e6000sw_writephy_wrapper), + DEVMETHOD(etherswitch_setvgroup, e6000sw_setvgroup_wrapper), + DEVMETHOD(etherswitch_getvgroup, e6000sw_getvgroup_wrapper), + + DEVMETHOD_END +}; + +static devclass_t e6000sw_devclass; + +DEFINE_CLASS_0(e6000sw, e6000sw_driver, e6000sw_methods, + sizeof(e6000sw_softc_t)); + +DRIVER_MODULE(e6000sw, mdio, e6000sw_driver, e6000sw_devclass, 0, 0); +DRIVER_MODULE(etherswitch, e6000sw, etherswitch_driver, etherswitch_devclass, 0, + 0); +DRIVER_MODULE(miibus, e6000sw, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(e6000sw, mdio, 1, 1, 1); + +static void +e6000sw_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "e6000sw", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "e6000sw", -1); +} + +static int +e6000sw_probe(device_t dev) +{ + e6000sw_softc_t *sc; + const char *description; + unsigned int id; + + sc = device_get_softc(dev); + bzero(sc, sizeof(e6000sw_softc_t)); + sc->dev = dev; + /* Lock is necessary due to assertions. */ + sx_init(&sc->sx, "e6000sw"); + E6000SW_LOCK(sc); + + id = e6000sw_readreg(sc, REG_PORT(0), SWITCH_ID); + + switch (id & 0xfff0) { + case 0x3520: + description = "Marvell 88E6352"; + break; + case 0x1720: + description = "Marvell 88E6172"; + break; + case 0x1760: + description = "Marvell 88E6176"; + break; + default: + E6000SW_UNLOCK(sc); + sx_destroy(&sc->sx); + device_printf(dev, "Unrecognized device.\n"); + return (ENXIO); + } + + device_set_desc(dev, description); + + E6000SW_UNLOCK(sc); + + return (BUS_PROBE_DEFAULT); +} + +static int +e6000sw_attach(device_t dev) +{ + e6000sw_softc_t *sc; + int phy, err, port; + char name[IFNAMSIZ]; + + err = 0; + sc = device_get_softc(dev); + E6000SW_LOCK(sc); + sc->cpuports_mask = E6000SW_CPUPORTS_MASK; + for (port = 0; port < E6000SW_NUM_PORTS; port++) + sc->vgroup[port] = E6000SW_PORT_NO_VGROUP; + e6000sw_setup(dev, sc); + + snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->dev)); + for (phy = 0; phy < E6000SW_NUM_PHYS; phy++) { + sc->ifp[phy] = if_alloc(IFT_ETHER); + if (sc->ifp[phy] == NULL) + goto out_fail; + sc->ifp[phy]->if_softc = sc; + sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX; + sc->ifname[phy] = malloc(strlen(name) + 1, M_E6000SW, M_WAITOK); + if (sc->ifname[phy] == NULL) + goto out_fail; + bcopy(name, sc->ifname[phy], strlen(name) + 1); + if_initname(sc->ifp[phy], sc->ifname[phy], phy); + err = mii_attach(sc->dev, &sc->miibus[phy], sc->ifp[phy], + e6000sw_ifmedia_upd, e6000sw_ifmedia_sts, BMSR_DEFCAPMASK, + phy, MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(sc->dev, + "attaching PHY %d failed\n", + phy); + goto out_fail; + } + sc->mii[phy] = device_get_softc(sc->miibus[phy]); + } + E6000SW_UNLOCK(sc); + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + bus_generic_attach(dev); + + kproc_create(e6000sw_tick, sc, &e6000sw_kproc, 0, 0, + "e6000sw tick kproc"); + + return (0); + +out_fail: + e6000sw_detach(dev); + + return (ENXIO); +} + +static __inline void +e6000sw_poll_done(e6000sw_softc_t *sc) +{ + + while (e6000sw_readreg(sc, REG_GLOBAL2, PHY_CMD) & + (1 << PHY_CMD_SMI_BUSY)) + continue; +} + + +/* + * PHY registers are paged. Put page index in reg 22 (accessible from every + * page), then access specific register. + */ +static int +e6000sw_readphy(device_t dev, int phy, int reg) +{ + e6000sw_softc_t *sc; + uint32_t val; + + sc = device_get_softc(dev); + val = 0; + + if (phy >= E6000SW_NUM_PHYS || reg >= E6000SW_NUM_PHY_REGS) { + device_printf(dev, "Wrong register address.\n"); + return (EINVAL); + } + + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + + e6000sw_poll_done(sc); + val |= 1 << PHY_CMD_SMI_BUSY; + val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE; + val |= PHY_CMD_OPCODE_READ << PHY_CMD_OPCODE; + val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK; + val |= (phy << PHY_CMD_DEV_ADDR) & PHY_CMD_DEV_ADDR_MASK; + e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val); + e6000sw_poll_done(sc); + val = e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG) + & PHY_DATA_MASK; + + return (val); +} + +static int +e6000sw_writephy(device_t dev, int phy, int reg, int data) +{ + e6000sw_softc_t *sc; + uint32_t val; + + sc = device_get_softc(dev); + val = 0; + + if (phy >= E6000SW_NUM_PHYS || reg >= E6000SW_NUM_PHY_REGS) { + device_printf(dev, "Wrong register address.\n"); + return (EINVAL); + } + + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + + e6000sw_poll_done(sc); + val |= PHY_CMD_MODE_MDIO << PHY_CMD_MODE; + val |= 1 << PHY_CMD_SMI_BUSY; + val |= PHY_CMD_OPCODE_WRITE << PHY_CMD_OPCODE; + val |= (reg << PHY_CMD_REG_ADDR) & PHY_CMD_REG_ADDR_MASK; + val |= (phy << PHY_CMD_DEV_ADDR) & PHY_CMD_DEV_ADDR_MASK; + e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG, + data & PHY_DATA_MASK); + e6000sw_writereg(sc, REG_GLOBAL2, SMI_PHY_CMD_REG, val); + e6000sw_poll_done(sc); + + return (0); +} + +static int +e6000sw_detach(device_t dev) +{ + int phy; + e6000sw_softc_t *sc; + + sc = device_get_softc(dev); + bus_generic_detach(dev); + sx_destroy(&sc->sx); + for (phy = 0; phy < E6000SW_NUM_PHYS; phy++) { + if (sc->miibus[phy] != NULL) + device_delete_child(dev, sc->miibus[phy]); + if (sc->ifp[phy] != NULL) + if_free(sc->ifp[phy]); + if (sc->ifname[phy] != NULL) + free(sc->ifname[phy], M_E6000SW); + } + + return (0); +} + +static etherswitch_info_t* +e6000sw_getinfo(device_t dev) +{ + + return (ðerswitch_info); +} + +static void +e6000sw_lock(device_t dev) +{ + struct e6000sw_softc *sc; + + sc = device_get_softc(dev); + + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + E6000SW_LOCK(sc); +} + +static void +e6000sw_unlock(device_t dev) +{ + struct e6000sw_softc *sc; + + sc = device_get_softc(dev); + + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + E6000SW_UNLOCK(sc); +} + +static int +e6000sw_getport(device_t dev, etherswitch_port_t *p) +{ + struct mii_data *mii; + int err; + struct ifmediareq *ifmr; + + err = 0; + e6000sw_softc_t *sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + + E6000SW_LOCK(sc); + + if (p->es_port >= E6000SW_NUM_PORTS || + p->es_port < 0) { + err = EINVAL; + goto out; + } + + e6000sw_get_pvid(sc, p->es_port, &p->es_pvid); + + if (e6000sw_cpuport(sc, p->es_port)) { + p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr = &p->es_ifmr; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + ifmr->ifm_count = 0; + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_1000_T | IFM_FDX; + ifmr->ifm_mask = 0; + } else { + mii = e6000sw_miiforphy(sc, p->es_port); + err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, + &mii->mii_media, SIOCGIFMEDIA); + } + +out: + E6000SW_UNLOCK(sc); + return (err); +} + +static int +e6000sw_setport(device_t dev, etherswitch_port_t *p) +{ + e6000sw_softc_t *sc; + int err; + struct mii_data *mii; + + err = 0; + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + + E6000SW_LOCK(sc); + + if (p->es_port >= E6000SW_NUM_PORTS || + p->es_port < 0) { + err = EINVAL; + goto out; + } + + if (p->es_pvid != 0) + e6000sw_set_pvid(sc, p->es_port, p->es_pvid); + if (!e6000sw_cpuport(sc, p->es_port)) { + mii = e6000sw_miiforphy(sc, p->es_port); + err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, &mii->mii_media, + SIOCSIFMEDIA); + } + +out: + E6000SW_UNLOCK(sc); + return (err); +} + +/* + * Registers in this switch are divided into sections, specified in + * documentation. So as to access any of them, section index and reg index + * is necessary. etherswitchcfg uses only one variable, so indexes were + * compressed into addr_reg: 32 * section_index + reg_index. + */ +static int +e6000sw_readreg_wrapper(device_t dev, int addr_reg) +{ + + if ((addr_reg > (REG_GLOBAL2 * 32 + REG_NUM_MAX)) || + (addr_reg < (REG_PORT(0) * 32))) { + device_printf(dev, "Wrong register address.\n"); + return (EINVAL); + } + + return (e6000sw_readreg(device_get_softc(dev), addr_reg / 32, + addr_reg % 32)); +} + +static int +e6000sw_writereg_wrapper(device_t dev, int addr_reg, int val) +{ + + if ((addr_reg > (REG_GLOBAL2 * 32 + REG_NUM_MAX)) || + (addr_reg < (REG_PORT(0) * 32))) { + device_printf(dev, "Wrong register address.\n"); + return (EINVAL); + } + e6000sw_writereg(device_get_softc(dev), addr_reg / 5, + addr_reg % 32, val); + + return (0); +} + +/* + * These wrappers are necessary because PHY accesses from etherswitchcfg + * need to be synchronized with locks, while miibus PHY accesses do not. + */ +static int +e6000sw_readphy_wrapper(device_t dev, int phy, int reg) +{ + e6000sw_softc_t *sc; + int ret; + + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + + E6000SW_LOCK(sc); + ret = e6000sw_readphy(dev, phy, reg); + E6000SW_UNLOCK(sc); + + return (ret); +} + +static int +e6000sw_writephy_wrapper(device_t dev, int phy, int reg, int data) +{ + e6000sw_softc_t *sc; + int ret; + + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + + E6000SW_LOCK(sc); + ret = e6000sw_writephy(dev, phy, reg, data); + E6000SW_UNLOCK(sc); + + return (ret); +} + +/* + * setvgroup/getvgroup called from etherswitchfcg need to be locked, + * while internal calls do not. + */ +static int +e6000sw_setvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg) +{ + e6000sw_softc_t *sc; + int ret; + + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + + E6000SW_LOCK(sc); + ret = e6000sw_setvgroup(dev, vg); + E6000SW_UNLOCK(sc); + + return (ret); +} + +static int +e6000sw_getvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg) +{ + e6000sw_softc_t *sc; + int ret; + + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + + E6000SW_LOCK(sc); + ret = e6000sw_getvgroup(dev, vg); + E6000SW_UNLOCK(sc); + + return (ret); +} + +static __inline void +e6000sw_flush_port(e6000sw_softc_t *sc, int port) +{ + uint32_t reg; + + reg = e6000sw_readreg(sc, REG_PORT(port), + PORT_VLAN_MAP); + reg &= ~PORT_VLAN_MAP_TABLE_MASK; + reg &= ~PORT_VLAN_MAP_FID_MASK; + e6000sw_writereg(sc, REG_PORT(port), + PORT_VLAN_MAP, reg); + if (sc->vgroup[port] != E6000SW_PORT_NO_VGROUP) { + /* + * If port belonged somewhere, owner-group + * should have its entry removed. + */ + sc->members[sc->vgroup[port]] &= ~(1 << port); + sc->vgroup[port] = E6000SW_PORT_NO_VGROUP; + } +} + +static __inline void +e6000sw_port_assign_vgroup(e6000sw_softc_t *sc, int port, int fid, int vgroup, + int members) +{ + uint32_t reg; + + reg = e6000sw_readreg(sc, REG_PORT(port), + PORT_VLAN_MAP); + reg &= ~PORT_VLAN_MAP_TABLE_MASK; + reg &= ~PORT_VLAN_MAP_FID_MASK; + reg |= members & ~(1 << port); + reg |= (fid << PORT_VLAN_MAP_FID) & PORT_VLAN_MAP_FID_MASK; + e6000sw_writereg(sc, REG_PORT(port), PORT_VLAN_MAP, + reg); + sc->vgroup[port] = vgroup; +} + +static int +e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + e6000sw_softc_t *sc; + int port, fid; + + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + + if (vg->es_vlangroup >= E6000SW_NUM_VGROUPS) + return (EINVAL); + if (vg->es_member_ports != vg->es_untagged_ports) { + device_printf(dev, "Tagged ports not supported.\n"); + return (EINVAL); + } + + vg->es_untagged_ports &= PORT_VLAN_MAP_TABLE_MASK; + fid = vg->es_vlangroup + 1; + for (port = 0; port < E6000SW_NUM_PORTS; port++) { + if ((sc->members[vg->es_vlangroup] & (1 << port)) || + (vg->es_untagged_ports & (1 << port))) + e6000sw_flush_port(sc, port); + if (vg->es_untagged_ports & (1 << port)) + e6000sw_port_assign_vgroup(sc, port, fid, + vg->es_vlangroup, vg->es_untagged_ports); + } + sc->vid[vg->es_vlangroup] = vg->es_vid; + sc->members[vg->es_vlangroup] = vg->es_untagged_ports; + + return (0); +} + +static int +e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + e6000sw_softc_t *sc; + + sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + + if (vg->es_vlangroup >= E6000SW_NUM_VGROUPS) + return (EINVAL); + vg->es_untagged_ports = vg->es_member_ports = + sc->members[vg->es_vlangroup]; + vg->es_vid = ETHERSWITCH_VID_VALID; + + return (0); +} + +static __inline struct mii_data* +e6000sw_miiforphy(e6000sw_softc_t *sc, unsigned int phy) +{ + + if (phy >= E6000SW_NUM_PHYS) + return (NULL); + + return (device_get_softc(sc->miibus[phy])); +} + +static int +e6000sw_ifmedia_upd(struct ifnet *ifp) +{ + e6000sw_softc_t *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = e6000sw_miiforphy(sc, ifp->if_dunit); + if (mii == NULL) + return (ENXIO); + mii_mediachg(mii); + + return (0); +} + +static void +e6000sw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + e6000sw_softc_t *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = e6000sw_miiforphy(sc, ifp->if_dunit); + + if (mii == NULL) + return; + + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; +} + +static __inline uint32_t +e6000sw_readreg(e6000sw_softc_t *sc, int addr, int reg) +{ + + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + + return (MDIO_READREG(device_get_parent(sc->dev), addr, reg)); +} + +static __inline void +e6000sw_writereg(e6000sw_softc_t *sc, int addr, int reg, int val) +{ + + E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + + MDIO_WRITEREG(device_get_parent(sc->dev), addr, reg, val); +} + +static __inline int +e6000sw_cpuport(e6000sw_softc_t *sc, int port) +{ + + return (sc->cpuports_mask & (1 << port)); +} + +static __inline int +e6000sw_set_pvid(e6000sw_softc_t *sc, int port, int pvid) +{ + + e6000sw_writereg(sc, REG_PORT(port), PORT_VID, pvid & + PORT_VID_DEF_VID_MASK); + + return (0); +} + +static __inline int +e6000sw_get_pvid(e6000sw_softc_t *sc, int port, int *pvid) +{ + + if (pvid == NULL) + return (ENXIO); + + *pvid = e6000sw_readreg(sc, REG_PORT(port), PORT_VID) & + PORT_VID_DEF_VID_MASK; + + return (0); +} + +static void +e6000sw_tick (void *arg) +{ + e6000sw_softc_t *sc; + struct mii_softc *miisc; + int i; + + sc = arg; + + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + for (;;) { + E6000SW_LOCK(sc); + for (i = 0; i < E6000SW_NUM_PHYS; i++) { + mii_tick(sc->mii[i]); + LIST_FOREACH(miisc, &sc->mii[i]->mii_phys, mii_list) { + if (IFM_INST(sc->mii[i]->mii_media.ifm_cur->ifm_media) + != miisc->mii_inst) + continue; + mii_phy_update(miisc, MII_POLLSTAT); + } + } + E6000SW_UNLOCK(sc); + pause("e6000sw tick", 1000); + } +} + +static void +e6000sw_setup(device_t dev, e6000sw_softc_t *sc) +{ + uint16_t atu_ctrl, atu_age; + + /* Set aging time */ + e6000sw_writereg(sc, REG_GLOBAL, ATU_CONTROL, + (E6000SW_DEFAULT_AGETIME << ATU_CONTROL_AGETIME) | + (1 << ATU_CONTROL_LEARN2ALL)); + + /* Send all with specific mac address to cpu port */ + e6000sw_writereg(sc, REG_GLOBAL2, MGMT_EN_2x, MGMT_EN_ALL); + e6000sw_writereg(sc, REG_GLOBAL2, MGMT_EN_0x, MGMT_EN_ALL); + + /* Disable Remote Managment */ + e6000sw_writereg(sc, REG_GLOBAL, SWITCH_GLOBAL_CONTROL2, 0); + + /* Disable loopback filter and flow control messages */ + e6000sw_writereg(sc, REG_GLOBAL2, SWITCH_MGMT, + SWITCH_MGMT_PRI_MASK | + (1 << SWITCH_MGMT_RSVD2CPU) | + SWITCH_MGMT_FC_PRI_MASK | + (1 << SWITCH_MGMT_FORCEFLOW)); + + /* Set VLAN configuration */ + e6000sw_port_vlan_conf(sc); + + e6000sw_atu_flush(dev, sc, NO_OPERATION); + e6000sw_atu_mac_table(dev, sc, NULL, NO_OPERATION); + e6000sw_set_atustat(dev, sc, 0, COUNT_ALL); + + /* Set ATU AgeTime to 15 seconds */ + atu_age = 1; + + atu_ctrl = e6000sw_readreg(sc, REG_GLOBAL, ATU_CONTROL); + + /* Set new AgeTime field */ + atu_ctrl &= ~ATU_CONTROL_AGETIME_MASK; + e6000sw_writereg(sc, REG_GLOBAL, ATU_CONTROL, atu_ctrl | + (atu_age << ATU_CONTROL_AGETIME)); +} + +static void +e6000sw_port_vlan_conf(e6000sw_softc_t *sc) +{ + int port, ret; + etherswitch_vlangroup_t vg; + device_t dev; + + dev = sc->dev; + /* Disable all ports */ + for (port = 0; port < E6000SW_NUM_PORTS; port++) { + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, + (ret & ~PORT_CONTROL_ENABLE)); + } + + /* Set port priority */ + for (port = 0; port < E6000SW_NUM_PORTS; port++) { + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); + ret &= ~PORT_VID_PRIORITY_MASK; + e6000sw_writereg(sc, REG_PORT(port), PORT_VID, ret); + } + + vg.es_vlangroup = 0; + vg.es_vid = 0; + vg.es_member_ports = vg.es_untagged_ports = E6000SW_DEF_VLANGROUP0; + e6000sw_setvgroup(dev, &vg); + vg.es_vlangroup = 1; + vg.es_vid = 1; + vg.es_member_ports = vg.es_untagged_ports = E6000SW_DEF_VLANGROUP1; + e6000sw_setvgroup(dev, &vg); + + device_printf(dev, "Default vlangroups set.\n"); + /* Set VID map */ + for (port = 0; port < E6000SW_NUM_PORTS; port++) { + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_VID); + ret &= ~PORT_VID_DEF_VID_MASK; + ret |= (port + 1); + e6000sw_writereg(sc, REG_PORT(port), PORT_VID, ret); + } + + /* Enable all ports */ + for (port = 0; port < E6000SW_NUM_PORTS; port++) { + ret = e6000sw_readreg(sc, REG_PORT(port), PORT_CONTROL); + e6000sw_writereg(sc, REG_PORT(port), PORT_CONTROL, (ret | + PORT_CONTROL_ENABLE)); + } +} + +static void +e6000sw_set_atustat(device_t dev, e6000sw_softc_t *sc, int bin, int flag) +{ + uint16_t ret; + + ret = e6000sw_readreg(sc, REG_GLOBAL2, ATU_STATS); + e6000sw_writereg(sc, REG_GLOBAL2, ATU_STATS, (bin << ATU_STATS_BIN ) | + (flag << ATU_STATS_FLAG)); +} + +static int +e6000sw_atu_mac_table(device_t dev, e6000sw_softc_t *sc, struct atu_opt *atu, + int flag) +{ + uint16_t ret_opt; + uint16_t ret_data; + int retries; + + if (flag == NO_OPERATION) + return (0); + else if ((flag & (LOAD_FROM_FIB | PURGE_FROM_FIB | GET_NEXT_IN_FIB | + GET_VIOLATION_DATA | CLEAR_VIOLATION_DATA)) == 0) { + device_printf(dev, "Wrong Opcode for ATU operation\n"); + return (EINVAL); + } + + ret_opt = e6000sw_readreg(sc, REG_GLOBAL, ATU_OPERATION); + + if (ret_opt & ATU_UNIT_BUSY) { + device_printf(dev, "ATU unit is busy, cannot access" + "register\n"); + return (EBUSY); + } else { + if(flag & LOAD_FROM_FIB) { + ret_data = e6000sw_readreg(sc, REG_GLOBAL, ATU_DATA); + e6000sw_writereg(sc, REG_GLOBAL2, ATU_DATA, (ret_data & + ~ENTRY_STATE)); + } + e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR01, atu->mac_01); + e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR23, atu->mac_23); + e6000sw_writereg(sc, REG_GLOBAL, ATU_MAC_ADDR45, atu->mac_45); + e6000sw_writereg(sc, REG_GLOBAL, ATU_FID, atu->fid); + + e6000sw_writereg(sc, REG_GLOBAL, ATU_OPERATION, (ret_opt | + ATU_UNIT_BUSY | flag)); + + retries = E6000SW_RETRIES; + while (--retries & (e6000sw_readreg(sc, REG_GLOBAL, + ATU_OPERATION) & ATU_UNIT_BUSY)) + DELAY(1); + + if (retries == 0) + device_printf(dev, "Timeout while flushing\n"); + else if (flag & GET_NEXT_IN_FIB) { + atu->mac_01 = e6000sw_readreg(sc, REG_GLOBAL, + ATU_MAC_ADDR01); + atu->mac_23 = e6000sw_readreg(sc, REG_GLOBAL, + ATU_MAC_ADDR23); + atu->mac_45 = e6000sw_readreg(sc, REG_GLOBAL, + ATU_MAC_ADDR45); + } + } + + return (0); +} + +static int +e6000sw_atu_flush(device_t dev, e6000sw_softc_t *sc, int flag) +{ + uint16_t ret; + int retries; + + if (flag == NO_OPERATION) + return (0); + + ret = e6000sw_readreg(sc, REG_GLOBAL, ATU_OPERATION); + if (ret & ATU_UNIT_BUSY) { + device_printf(dev, "Atu unit is busy, cannot flush\n"); + return (EBUSY); + } else { + e6000sw_writereg(sc, REG_GLOBAL, ATU_OPERATION, (ret | + ATU_UNIT_BUSY | flag)); + retries = E6000SW_RETRIES; + while (--retries & (e6000sw_readreg(sc, REG_GLOBAL, + ATU_OPERATION) & ATU_UNIT_BUSY)) + DELAY(1); + + if (retries == 0) + device_printf(dev, "Timeout while flushing\n"); + } + + return (0); +} Added: head/sys/dev/etherswitch/e6000sw/e6000swreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/e6000sw/e6000swreg.h Sun Oct 25 22:14:04 2015 (r289947) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2015 Semihalf + * Copyright (c) 2015 Stormshield + * 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 25 22:17:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23ABE8D78; Sun, 25 Oct 2015 22:17:12 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E2A831601; Sun, 25 Oct 2015 22:17:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PMHADu011224; Sun, 25 Oct 2015 22:17:10 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PMHAeJ011223; Sun, 25 Oct 2015 22:17:10 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510252217.t9PMHAeJ011223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 25 Oct 2015 22:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289948 - head/sys/dev/mge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 22:17:12 -0000 Author: zbb Date: Sun Oct 25 22:17:10 2015 New Revision: 289948 URL: https://svnweb.freebsd.org/changeset/base/289948 Log: Change improper locking assertion in mge Assertion used here was invalid. If current thread helds any of locks, we never want to recurse on them. Obtained from: Semihalf Submitted by: Bartosz Szczepanek Differential revision: https://reviews.freebsd.org/D3903 Modified: head/sys/dev/mge/if_mgevar.h Modified: head/sys/dev/mge/if_mgevar.h ============================================================================== --- head/sys/dev/mge/if_mgevar.h Sun Oct 25 22:14:04 2015 (r289947) +++ head/sys/dev/mge/if_mgevar.h Sun Oct 25 22:17:10 2015 (r289948) @@ -137,10 +137,8 @@ struct mge_softc { #define MGE_RECEIVE_LOCK_ASSERT(sc) mtx_assert(&(sc)->receive_lock, MA_OWNED) #define MGE_GLOBAL_LOCK(sc) do { \ - if ((mtx_owned(&(sc)->transmit_lock) ? 1 : 0) != \ - (mtx_owned(&(sc)->receive_lock) ? 1 : 0)) { \ - panic("mge deadlock possibility detection!"); \ - } \ + mtx_assert(&(sc)->transmit_lock, MA_NOTOWNED); \ + mtx_assert(&(sc)->receive_lock, MA_NOTOWNED); \ mtx_lock(&(sc)->transmit_lock); \ mtx_lock(&(sc)->receive_lock); \ } while (0) From owner-svn-src-head@freebsd.org Sun Oct 25 22:20:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C938F41; Sun, 25 Oct 2015 22:20:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2693D1B65; Sun, 25 Oct 2015 22:20:14 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PMKDij011513; Sun, 25 Oct 2015 22:20:13 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PMKDjV011512; Sun, 25 Oct 2015 22:20:13 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510252220.t9PMKDjV011512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 25 Oct 2015 22:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289951 - head/sys/dev/mge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 22:20:14 -0000 Author: zbb Date: Sun Oct 25 22:20:13 2015 New Revision: 289951 URL: https://svnweb.freebsd.org/changeset/base/289951 Log: Improve style in mge driver Minor improvements introduced to ensure code follows FreeBSD style guidelines. Reviewed by: adrian Obtained from: Semihalf Submitted by: Bartosz Szczepanek Differential revision: https://reviews.freebsd.org/D3904 Modified: head/sys/dev/mge/if_mge.c Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Sun Oct 25 22:19:11 2015 (r289950) +++ head/sys/dev/mge/if_mge.c Sun Oct 25 22:20:13 2015 (r289951) @@ -133,13 +133,15 @@ static void mge_set_ucast_address(struct static void mge_set_prom_mode(struct mge_softc *sc, uint8_t queue); static int mge_allocate_dma(struct mge_softc *sc); static int mge_alloc_desc_dma(struct mge_softc *sc, - struct mge_desc_wrapper* desc_tab, uint32_t size, bus_dma_tag_t *buffer_tag); + struct mge_desc_wrapper* desc_tab, uint32_t size, + bus_dma_tag_t *buffer_tag); static int mge_new_rxbuf(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf **mbufp, bus_addr_t *paddr); -static void mge_get_dma_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error); +static void mge_get_dma_addr(void *arg, bus_dma_segment_t *segs, int nseg, + int error); static void mge_free_dma(struct mge_softc *sc); -static void mge_free_desc(struct mge_softc *sc, struct mge_desc_wrapper* tab, uint32_t size, - bus_dma_tag_t buffer_tag, uint8_t free_mbufs); +static void mge_free_desc(struct mge_softc *sc, struct mge_desc_wrapper* tab, + uint32_t size, bus_dma_tag_t buffer_tag, uint8_t free_mbufs); static void mge_offload_process_frame(struct ifnet *ifp, struct mbuf *frame, uint32_t status, uint16_t bufsize); static void mge_offload_setup_descriptor(struct mge_softc *sc, @@ -692,6 +694,7 @@ mge_free_desc(struct mge_softc *sc, stru static void mge_free_dma(struct mge_softc *sc) { + /* Free desciptors and mbufs */ mge_free_desc(sc, sc->mge_rx_desc, MGE_RX_DESC_NUM, sc->mge_rx_dtag, 1); mge_free_desc(sc, sc->mge_tx_desc, MGE_TX_DESC_NUM, sc->mge_tx_dtag, 0); @@ -815,8 +818,10 @@ mge_attach(device_t dev) mge_ver_params(sc); /* Initialize mutexes */ - mtx_init(&sc->transmit_lock, device_get_nameunit(dev), "mge TX lock", MTX_DEF); - mtx_init(&sc->receive_lock, device_get_nameunit(dev), "mge RX lock", MTX_DEF); + mtx_init(&sc->transmit_lock, device_get_nameunit(dev), "mge TX lock", + MTX_DEF); + mtx_init(&sc->receive_lock, device_get_nameunit(dev), "mge RX lock", + MTX_DEF); /* Allocate IO and IRQ resources */ error = bus_alloc_resources(dev, res_spec, sc->res); @@ -951,7 +956,8 @@ mge_detach(device_t dev) if (!sc->ih_cookie[i]) continue; - error = bus_teardown_intr(dev, sc->res[1 + i], sc->ih_cookie[i]); + error = bus_teardown_intr(dev, sc->res[1 + i], + sc->ih_cookie[i]); if (error) device_printf(dev, "could not release %s\n", mge_intrs[(sc->mge_intr_cnt == 1 ? 0 : i + 1)].description); @@ -982,9 +988,10 @@ mge_detach(device_t dev) static void mge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct mge_softc *sc = ifp->if_softc; + struct mge_softc *sc; struct mii_data *mii; + sc = ifp->if_softc; MGE_GLOBAL_LOCK(sc); if (!sc->phy_attached) { @@ -1066,8 +1073,9 @@ mge_ifmedia_upd(struct ifnet *ifp) static void mge_init(void *arg) { - struct mge_softc *sc = arg; + struct mge_softc *sc; + sc = arg; MGE_GLOBAL_LOCK(sc); mge_init_locked(arg); @@ -1213,9 +1221,10 @@ mge_init_locked(void *arg) static void mge_intr_rxtx(void *arg) { - struct mge_softc *sc = arg; + struct mge_softc *sc; uint32_t int_cause, int_cause_ext; + sc = arg; MGE_GLOBAL_LOCK(sc); #ifdef DEVICE_POLLING @@ -1248,9 +1257,10 @@ mge_intr_rxtx(void *arg) static void mge_intr_err(void *arg) { - struct mge_softc *sc = arg; + struct mge_softc *sc; struct ifnet *ifp; + sc = arg; ifp = sc->ifp; if_printf(ifp, "%s\n", __FUNCTION__); } @@ -1258,18 +1268,20 @@ mge_intr_err(void *arg) static void mge_intr_misc(void *arg) { - struct mge_softc *sc = arg; + struct mge_softc *sc; struct ifnet *ifp; + sc = arg; ifp = sc->ifp; if_printf(ifp, "%s\n", __FUNCTION__); } static void mge_intr_rx(void *arg) { - struct mge_softc *sc = arg; + struct mge_softc *sc; uint32_t int_cause, int_cause_ext; + sc = arg; MGE_RECEIVE_LOCK(sc); #ifdef DEVICE_POLLING @@ -1411,7 +1423,6 @@ mge_intr_tx(void *arg) MGE_TRANSMIT_UNLOCK(sc); } - static void mge_intr_tx_locked(struct mge_softc *sc) { @@ -1467,7 +1478,6 @@ mge_intr_tx_locked(struct mge_softc *sc) mge_start_locked(ifp); } } - static int mge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { @@ -1778,7 +1788,7 @@ mge_start_locked(struct ifnet *ifp) /* The driver support only one DMA fragment. */ if (m0->m_next != NULL) { mtmp = m_defrag(m0, M_NOWAIT); - if (mtmp) + if (mtmp != NULL) m0 = mtmp; } @@ -1870,8 +1880,9 @@ mge_stop(struct mge_softc *sc) DELAY(100); } - if(!count) - if_printf(ifp, "%s: timeout while waiting for end of transmission\n", + if (count == 0) + if_printf(ifp, + "%s: timeout while waiting for end of transmission\n", __FUNCTION__); reg_val = MGE_READ(sc, MGE_PORT_SERIAL_CTRL); @@ -1918,7 +1929,7 @@ mge_offload_setup_descriptor(struct mge_ struct ip *ip; int ehlen, etype; - if (csum_flags) { + if (csum_flags != 0) { if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { etype = ntohs(eh->evl_proto); ehlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; From owner-svn-src-head@freebsd.org Sun Oct 25 23:22:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3BEFA180BF; Sun, 25 Oct 2015 23:22:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8C65318B2; Sun, 25 Oct 2015 23:22:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PNMeGH032354; Sun, 25 Oct 2015 23:22:40 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PNMeJh032353; Sun, 25 Oct 2015 23:22:40 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510252322.t9PNMeJh032353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 25 Oct 2015 23:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289966 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 23:22:42 -0000 Author: zbb Date: Sun Oct 25 23:22:40 2015 New Revision: 289966 URL: https://svnweb.freebsd.org/changeset/base/289966 Log: Add support for unspecified ranges on ThunderX system When one tries to allocate a resource with unspecified range, read already configured BAR values (by UEFI or whatever). This is necessary to make VNIC VFs working and to allow them to be properly allocated. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D3752 Modified: head/sys/arm64/cavium/thunder_pcie.c Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Sun Oct 25 23:03:04 2015 (r289965) +++ head/sys/arm64/cavium/thunder_pcie.c Sun Oct 25 23:22:40 2015 (r289966) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -96,6 +99,15 @@ struct thunder_pcie_softc { device_t dev; }; +/* + * ThunderX supports up to 4 ethernet interfaces, so it's good + * value to use as default for numbers of VFs, since each eth + * interface represents separate virtual function. + */ +static int thunder_pcie_max_vfs = 4; +SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_max_vfs, CTLFLAG_RWTUN, + &thunder_pcie_max_vfs, 0, "Max VFs supported by ThunderX internal PCIe"); + /* Forward prototypes */ static struct resource *thunder_pcie_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); @@ -424,6 +436,7 @@ thunder_pcie_alloc_resource(device_t dev struct thunder_pcie_softc *sc = device_get_softc(dev); struct rman *rm = NULL; struct resource *res; + pci_addr_t map, testval; switch (type) { case SYS_RES_IOPORT: @@ -438,9 +451,32 @@ thunder_pcie_alloc_resource(device_t dev }; if ((start == 0UL) && (end == ~0UL)) { - device_printf(dev, - "Cannot allocate resource with unspecified range\n"); - goto fail; + + /* Read BAR manually to get resource address and size */ + pci_read_bar(child, *rid, &map, &testval, NULL); + + /* Mask the information bits */ + if (PCI_BAR_MEM(map)) + map &= PCIM_BAR_MEM_BASE; + else + map &= PCIM_BAR_IO_BASE; + + if (PCI_BAR_MEM(testval)) + testval &= PCIM_BAR_MEM_BASE; + else + testval &= PCIM_BAR_IO_BASE; + + start = map; + count = (~testval) + 1; + /* + * Internal ThunderX devices supports up to 3 64-bit BARs. + * If we're allocating anything above, that means upper layer + * wants us to allocate VF-BAR. In that case reserve bigger + * slice to make a room for other VFs adjacent to this one. + */ + if (*rid > PCIR_BAR(5)) + count = count * thunder_pcie_max_vfs; + end = start + count - 1; } /* Convert input BUS address to required PHYS */ From owner-svn-src-head@freebsd.org Sun Oct 25 23:27:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A74FAA18148; Sun, 25 Oct 2015 23:27:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7232E1A74; Sun, 25 Oct 2015 23:27:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PNR87E032563; Sun, 25 Oct 2015 23:27:08 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PNR8oC032562; Sun, 25 Oct 2015 23:27:08 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510252327.t9PNR8oC032562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Sun, 25 Oct 2015 23:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289967 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 25 Oct 2015 23:27:09 -0000 Author: zbb Date: Sun Oct 25 23:27:08 2015 New Revision: 289967 URL: https://svnweb.freebsd.org/changeset/base/289967 Log: Fix bus numbering in ThunderX ITS quirk Internal busses (thus ECAM access) should be mapped to all values from 0 to 143. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D3753 Modified: head/sys/arm64/arm64/gic_v3_its.c Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Sun Oct 25 23:22:40 2015 (r289966) +++ head/sys/arm64/arm64/gic_v3_its.c Sun Oct 25 23:27:08 2015 (r289967) @@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_reg.h" #include "gic_v3_var.h" +#define GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET 144 + #include "pic_if.h" /* Device and PIC methods */ @@ -1475,8 +1477,8 @@ its_get_devid_thunder(device_t pci_dev) bsf = PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev), pci_get_function(pci_dev)); - /* ECAM is on bus=0 */ - if (bus == 0) { + /* Check if accessing internal PCIe (low bus numbers) */ + if (bus < GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET) { return ((pci_get_domain(pci_dev) << PCI_RID_DOMAIN_SHIFT) | bsf); /* PEM otherwise */ From owner-svn-src-head@freebsd.org Mon Oct 26 02:21:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 977CC848C; Mon, 26 Oct 2015 02:21:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7388B1311; Mon, 26 Oct 2015 02:21:21 +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 t9Q2LKMv082740; Mon, 26 Oct 2015 02:21:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9Q2LK72082735; Mon, 26 Oct 2015 02:21:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510260221.t9Q2LK72082735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 26 Oct 2015 02:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289979 - in head/sys: dev/ioat sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 02:21:21 -0000 Author: cem Date: Mon Oct 26 02:21:19 2015 New Revision: 289979 URL: https://svnweb.freebsd.org/changeset/base/289979 Log: ioat: Introduce KTR probes Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h head/sys/sys/ktr_class.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Oct 26 00:28:05 2015 (r289978) +++ head/sys/dev/ioat/ioat.c Mon Oct 26 02:21:19 2015 (r289979) @@ -567,7 +567,7 @@ ioat_process_events(struct ioat_softc *i comp_update = *ioat->comp_update; status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; - ioat_log_message(3, "%s\n", __func__); + CTR0(KTR_IOAT, __func__); if (status == ioat->last_seen) goto out; @@ -575,7 +575,7 @@ ioat_process_events(struct ioat_softc *i while (1) { desc = ioat_get_ring_entry(ioat, ioat->tail); dmadesc = &desc->bus_dmadesc; - ioat_log_message(3, "completing desc %d\n", ioat->tail); + CTR1(KTR_IOAT, "completing desc %d", ioat->tail); if (dmadesc->callback_fn) (*dmadesc->callback_fn)(dmadesc->callback_arg); @@ -629,7 +629,7 @@ ioat_acquire(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); mtx_lock(&ioat->submit_lock); - ioat_log_message(3, "%s\n", __func__); + CTR0(KTR_IOAT, __func__); } void @@ -638,7 +638,7 @@ ioat_release(bus_dmaengine_t dmaengine) struct ioat_softc *ioat; ioat = to_ioat_softc(dmaengine); - ioat_log_message(3, "%s\n", __func__); + CTR0(KTR_IOAT, __func__); ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->head); mtx_unlock(&ioat->submit_lock); } @@ -660,7 +660,7 @@ ioat_null(bus_dmaengine_t dmaengine, bus if (ioat_reserve_space_and_lock(ioat, 1) != 0) return (NULL); - ioat_log_message(3, "%s\n", __func__); + CTR0(KTR_IOAT, __func__); desc = ioat_get_ring_entry(ioat, ioat->head); hw_desc = desc->u.dma; @@ -707,7 +707,7 @@ ioat_copy(bus_dmaengine_t dmaengine, bus if (ioat_reserve_space_and_lock(ioat, 1) != 0) return (NULL); - ioat_log_message(3, "%s\n", __func__); + CTR0(KTR_IOAT, __func__); desc = ioat_get_ring_entry(ioat, ioat->head); hw_desc = desc->u.dma; Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Mon Oct 26 00:28:05 2015 (r289978) +++ head/sys/dev/ioat/ioat_internal.h Mon Oct 26 02:21:19 2015 (r289979) @@ -29,7 +29,8 @@ __FBSDID("$FreeBSD$"); #ifndef __IOAT_INTERNAL_H__ #define __IOAT_INTERNAL_H__ -#define DEVICE2SOFTC(dev) ((struct ioat_softc *) device_get_softc(dev)) +#define DEVICE2SOFTC(dev) ((struct ioat_softc *) device_get_softc(dev)) +#define KTR_IOAT KTR_SPARE3 #define ioat_read_chancnt(ioat) \ ioat_read_1((ioat), IOAT_CHANCNT_OFFSET) Modified: head/sys/sys/ktr_class.h ============================================================================== --- head/sys/sys/ktr_class.h Mon Oct 26 00:28:05 2015 (r289978) +++ head/sys/sys/ktr_class.h Mon Oct 26 02:21:19 2015 (r289979) @@ -55,7 +55,7 @@ #define KTR_PROC 0x00001000 /* Process scheduling */ #define KTR_SYSC 0x00002000 /* System call */ #define KTR_INIT 0x00004000 /* System initialization */ -#define KTR_SPARE3 0x00008000 /* cxgb, drm2, ntb */ +#define KTR_SPARE3 0x00008000 /* cxgb, drm2, ioat, ntb */ #define KTR_SPARE4 0x00010000 /* geom_sched */ #define KTR_EVH 0x00020000 /* Eventhandler */ #define KTR_VFS 0x00040000 /* VFS events */ From owner-svn-src-head@freebsd.org Mon Oct 26 02:21:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E9B784B1; Mon, 26 Oct 2015 02:21:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CEE814C4; Mon, 26 Oct 2015 02:21:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9Q2LWo4082792; Mon, 26 Oct 2015 02:21:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9Q2LWq1082791; Mon, 26 Oct 2015 02:21:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510260221.t9Q2LWq1082791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 26 Oct 2015 02:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289980 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 02:21:33 -0000 Author: cem Date: Mon Oct 26 02:21:32 2015 New Revision: 289980 URL: https://svnweb.freebsd.org/changeset/base/289980 Log: ioat: Expose more softc members in sysctls Kill some unused softc variables while we're here. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Oct 26 02:21:19 2015 (r289979) +++ head/sys/dev/ioat/ioat.c Mon Oct 26 02:21:32 2015 (r289980) @@ -381,7 +381,6 @@ ioat3_attach(device_t device) ioat->is_completion_pending = FALSE; ioat->is_reset_pending = FALSE; ioat->is_channel_running = FALSE; - ioat->is_waiting_for_ack = FALSE; bus_dma_tag_create(bus_get_dma_tag(ioat->device), sizeof(uint64_t), 0x0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, @@ -1129,6 +1128,11 @@ ioat_setup_sysctl(device_t device) tree = device_get_sysctl_tree(device); par = SYSCTL_CHILDREN(tree); + SYSCTL_ADD_INT(ctx, par, OID_AUTO, "version", CTLFLAG_RD, + &ioat->version, 0, "HW version (0xMM form)"); + SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "max_xfer_size", CTLFLAG_RD, + &ioat->max_xfer_size, 0, "HW maximum transfer size"); + SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "ring_size_order", CTLFLAG_RD, &ioat->ring_size_order, 0, "HW descriptor ring size order"); SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "head", CTLFLAG_RD, &ioat->head, 0, @@ -1136,6 +1140,18 @@ ioat_setup_sysctl(device_t device) SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "tail", CTLFLAG_RD, &ioat->tail, 0, "HW descriptor tail pointer index"); + SYSCTL_ADD_UQUAD(ctx, par, OID_AUTO, "last_completion", CTLFLAG_RD, + ioat->comp_update, "HW addr of last completion"); + + SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_resize_pending", CTLFLAG_RD, + &ioat->is_resize_pending, 0, "resize pending"); + SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_completion_pending", CTLFLAG_RD, + &ioat->is_completion_pending, 0, "completion pending"); + SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_reset_pending", CTLFLAG_RD, + &ioat->is_reset_pending, 0, "reset pending"); + SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_channel_running", CTLFLAG_RD, + &ioat->is_channel_running, 0, "channel running"); + SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "force_hw_reset", CTLTYPE_INT | CTLFLAG_RW, ioat, 0, sysctl_handle_reset, "I", "Set to non-zero to reset the hardware"); Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Mon Oct 26 02:21:19 2015 (r289979) +++ head/sys/dev/ioat/ioat_internal.h Mon Oct 26 02:21:32 2015 (r289980) @@ -333,7 +333,6 @@ struct ioat_softc { int version; struct mtx submit_lock; - int num_interrupts; device_t device; bus_space_tag_t pci_bus_tag; bus_space_handle_t pci_bus_handle; @@ -359,12 +358,9 @@ struct ioat_softc { boolean_t is_completion_pending; boolean_t is_reset_pending; boolean_t is_channel_running; - boolean_t is_waiting_for_ack; - uint32_t xfercap_log; uint32_t head; uint32_t tail; - uint16_t reserved; uint32_t ring_size_order; bus_addr_t last_seen; From owner-svn-src-head@freebsd.org Mon Oct 26 03:30:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1175873D; Mon, 26 Oct 2015 03:30:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id AA8DB1F30; Mon, 26 Oct 2015 03:30:39 +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 t9Q3UcDE003020; Mon, 26 Oct 2015 03:30:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9Q3UcJ7003017; Mon, 26 Oct 2015 03:30:38 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510260330.t9Q3UcJ7003017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 26 Oct 2015 03:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289982 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 03:30:40 -0000 Author: cem Date: Mon Oct 26 03:30:38 2015 New Revision: 289982 URL: https://svnweb.freebsd.org/changeset/base/289982 Log: ioat: Allocate memory for ring resize sanely Add a new flag for DMA operations, DMA_NO_WAIT. It behaves much like other NOWAIT flags -- if queueing an operation would sleep, abort and return NULL instead. When growing the internal descriptor ring, the memory allocation is performed outside of all locks. A lock-protected flag is used to avoid duplicated work. Threads that cannot sleep and attempt to queue operations when the descriptor ring is full allocate a larger ring with M_NOWAIT, or bail if that fails. ioat_reserve_space() could become an external API if is important to callers that they have room for a sequence of operations, or that those operations succeed each other directly in the hardware ring. This patch splits the internal head index (->head) from the hardware's head-of-chain (DMACOUNT) register (->hw_head). In the future, for simplicity's sake, we could drop the 'ring' array entirely and just use a linked list (with head and tail pointers rather than indices). Suggested by: Witness Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Oct 26 03:15:06 2015 (r289981) +++ head/sys/dev/ioat/ioat.c Mon Oct 26 03:30:38 2015 (r289982) @@ -68,13 +68,21 @@ static boolean_t ioat_model_resets_msix( static void ioat_process_events(struct ioat_softc *ioat); static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); +static void ioat_free_ring(struct ioat_softc *, uint32_t size, + struct ioat_descriptor **); static void ioat_free_ring_entry(struct ioat_softc *ioat, struct ioat_descriptor *desc); -static struct ioat_descriptor *ioat_alloc_ring_entry(struct ioat_softc *ioat); -static int ioat_reserve_space_and_lock(struct ioat_softc *ioat, int num_descs); +static struct ioat_descriptor *ioat_alloc_ring_entry(struct ioat_softc *, + int mflags); +static int ioat_reserve_space(struct ioat_softc *, uint32_t, int mflags); static struct ioat_descriptor *ioat_get_ring_entry(struct ioat_softc *ioat, uint32_t index); -static boolean_t resize_ring(struct ioat_softc *ioat, int order); +static struct ioat_descriptor **ioat_prealloc_ring(struct ioat_softc *, + uint32_t size, boolean_t need_dscr, int mflags); +static int ring_grow(struct ioat_softc *, uint32_t oldorder, + struct ioat_descriptor **); +static int ring_shrink(struct ioat_softc *, uint32_t oldorder, + struct ioat_descriptor **); static void ioat_timer_callback(void *arg); static void dump_descriptor(void *hw_desc); static void ioat_submit_single(struct ioat_softc *ioat); @@ -276,7 +284,6 @@ static int ioat_detach(device_t device) { struct ioat_softc *ioat; - uint32_t i; ioat = DEVICE2SOFTC(device); @@ -292,11 +299,8 @@ ioat_detach(device_t device) bus_release_resource(device, SYS_RES_MEMORY, ioat->pci_resource_id, ioat->pci_resource); - if (ioat->ring != NULL) { - for (i = 0; i < (1 << ioat->ring_size_order); i++) - ioat_free_ring_entry(ioat, ioat->ring[i]); - free(ioat->ring, M_IOAT); - } + if (ioat->ring != NULL) + ioat_free_ring(ioat, 1 << ioat->ring_size_order, ioat->ring); if (ioat->comp_update != NULL) { bus_dmamap_unload(ioat->comp_update_tag, ioat->comp_update_map); @@ -409,13 +413,13 @@ ioat3_attach(device_t device) &ioat->hw_desc_tag); ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT, - M_ZERO | M_NOWAIT); + M_ZERO | M_WAITOK); if (ioat->ring == NULL) return (ENOMEM); ring = ioat->ring; for (i = 0; i < num_descriptors; i++) { - ring[i] = ioat_alloc_ring_entry(ioat); + ring[i] = ioat_alloc_ring_entry(ioat, M_WAITOK); if (ring[i] == NULL) return (ENOMEM); @@ -431,7 +435,7 @@ ioat3_attach(device_t device) ring[i]->u.dma->next = ring[0]->hw_desc_bus_addr; - ioat->head = 0; + ioat->head = ioat->hw_head = 0; ioat->tail = 0; ioat->last_seen = 0; return (0); @@ -598,6 +602,7 @@ out: mtx_unlock(&ioat->cleanup_lock); ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); + wakeup(&ioat->tail); } /* @@ -638,7 +643,7 @@ ioat_release(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); CTR0(KTR_IOAT, __func__); - ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->head); + ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); mtx_unlock(&ioat->submit_lock); } @@ -649,14 +654,19 @@ ioat_null(bus_dmaengine_t dmaengine, bus struct ioat_softc *ioat; struct ioat_descriptor *desc; struct ioat_dma_hw_descriptor *hw_desc; + int mflags; KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", flags & ~DMA_ALL_FLAGS)); + if ((flags & DMA_NO_WAIT) != 0) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; ioat = to_ioat_softc(dmaengine); mtx_assert(&ioat->submit_lock, MA_OWNED); - if (ioat_reserve_space_and_lock(ioat, 1) != 0) + if (ioat_reserve_space(ioat, 1, mflags) != 0) return (NULL); CTR0(KTR_IOAT, __func__); @@ -690,9 +700,14 @@ ioat_copy(bus_dmaengine_t dmaengine, bus struct ioat_descriptor *desc; struct ioat_dma_hw_descriptor *hw_desc; struct ioat_softc *ioat; + int mflags; KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", flags & ~DMA_ALL_FLAGS)); + if ((flags & DMA_NO_WAIT) != 0) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; ioat = to_ioat_softc(dmaengine); mtx_assert(&ioat->submit_lock, MA_OWNED); @@ -703,7 +718,7 @@ ioat_copy(bus_dmaengine_t dmaengine, bus return (NULL); } - if (ioat_reserve_space_and_lock(ioat, 1) != 0) + if (ioat_reserve_space(ioat, 1, mflags) != 0) return (NULL); CTR0(KTR_IOAT, __func__); @@ -749,21 +764,26 @@ ioat_get_ring_space(struct ioat_softc *i } static struct ioat_descriptor * -ioat_alloc_ring_entry(struct ioat_softc *ioat) +ioat_alloc_ring_entry(struct ioat_softc *ioat, int mflags) { struct ioat_dma_hw_descriptor *hw_desc; struct ioat_descriptor *desc; - int error; + int error, busdmaflag; error = ENOMEM; hw_desc = NULL; - desc = malloc(sizeof(*desc), M_IOAT, M_NOWAIT); + if ((mflags & M_WAITOK) != 0) + busdmaflag = BUS_DMA_WAITOK; + else + busdmaflag = BUS_DMA_NOWAIT; + + desc = malloc(sizeof(*desc), M_IOAT, mflags); if (desc == NULL) goto out; bus_dmamem_alloc(ioat->hw_desc_tag, (void **)&hw_desc, - BUS_DMA_ZERO | BUS_DMA_NOWAIT, &ioat->hw_desc_map); + BUS_DMA_ZERO | busdmaflag, &ioat->hw_desc_map); if (hw_desc == NULL) goto out; @@ -771,7 +791,7 @@ ioat_alloc_ring_entry(struct ioat_softc error = bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, sizeof(*hw_desc), ioat_dmamap_cb, &desc->hw_desc_bus_addr, - BUS_DMA_NOWAIT); + busdmaflag); if (error) goto out; @@ -796,22 +816,130 @@ ioat_free_ring_entry(struct ioat_softc * free(desc, M_IOAT); } +/* + * Reserves space in this IOAT descriptor ring by ensuring enough slots remain + * for 'num_descs'. + * + * If mflags contains M_WAITOK, blocks until enough space is available. + * + * Returns zero on success, or an errno on error. If num_descs is beyond the + * maximum ring size, returns EINVAl; if allocation would block and mflags + * contains M_NOWAIT, returns EAGAIN. + * + * Must be called with the submit_lock held; returns with the lock held. The + * lock may be dropped to allocate the ring. + * + * (The submit_lock is needed to add any entries to the ring, so callers are + * assured enough room is available.) + */ static int -ioat_reserve_space_and_lock(struct ioat_softc *ioat, int num_descs) +ioat_reserve_space(struct ioat_softc *ioat, uint32_t num_descs, int mflags) { - boolean_t retry; + struct ioat_descriptor **new_ring; + uint32_t order; + int error; - while (1) { + mtx_assert(&ioat->submit_lock, MA_OWNED); + error = 0; + + if (num_descs < 1 || num_descs > (1 << IOAT_MAX_ORDER)) { + error = EINVAL; + goto out; + } + + for (;;) { if (ioat_get_ring_space(ioat) >= num_descs) - return (0); + goto out; - mtx_lock(&ioat->cleanup_lock); - retry = resize_ring(ioat, ioat->ring_size_order + 1); - mtx_unlock(&ioat->cleanup_lock); + order = ioat->ring_size_order; + if (ioat->is_resize_pending || order == IOAT_MAX_ORDER) { + if ((mflags & M_WAITOK) != 0) { + msleep(&ioat->tail, &ioat->submit_lock, 0, + "ioat_rsz", 0); + continue; + } - if (!retry) - return (ENOMEM); + error = EAGAIN; + break; + } + + ioat->is_resize_pending = TRUE; + for (;;) { + mtx_unlock(&ioat->submit_lock); + + new_ring = ioat_prealloc_ring(ioat, 1 << (order + 1), + TRUE, mflags); + + mtx_lock(&ioat->submit_lock); + KASSERT(ioat->ring_size_order == order, + ("is_resize_pending should protect order")); + + if (new_ring == NULL) { + KASSERT((mflags & M_WAITOK) == 0, + ("allocation failed")); + error = EAGAIN; + break; + } + + error = ring_grow(ioat, order, new_ring); + if (error == 0) + break; + } + ioat->is_resize_pending = FALSE; + wakeup(&ioat->tail); + if (error) + break; + } + +out: + mtx_assert(&ioat->submit_lock, MA_OWNED); + return (error); +} + +static struct ioat_descriptor ** +ioat_prealloc_ring(struct ioat_softc *ioat, uint32_t size, boolean_t need_dscr, + int mflags) +{ + struct ioat_descriptor **ring; + uint32_t i; + int error; + + KASSERT(size > 0 && powerof2(size), ("bogus size")); + + ring = malloc(size * sizeof(*ring), M_IOAT, M_ZERO | mflags); + if (ring == NULL) + return (NULL); + + if (need_dscr) { + error = ENOMEM; + for (i = size / 2; i < size; i++) { + ring[i] = ioat_alloc_ring_entry(ioat, mflags); + if (ring[i] == NULL) + goto out; + ring[i]->id = i; + } } + error = 0; + +out: + if (error != 0 && ring != NULL) { + ioat_free_ring(ioat, size, ring); + ring = NULL; + } + return (ring); +} + +static void +ioat_free_ring(struct ioat_softc *ioat, uint32_t size, + struct ioat_descriptor **ring) +{ + uint32_t i; + + for (i = 0; i < size; i++) { + if (ring[i] != NULL) + ioat_free_ring_entry(ioat, ring[i]); + } + free(ring, M_IOAT); } static struct ioat_descriptor * @@ -821,105 +949,155 @@ ioat_get_ring_entry(struct ioat_softc *i return (ioat->ring[index % (1 << ioat->ring_size_order)]); } -static boolean_t -resize_ring(struct ioat_softc *ioat, int order) +static int +ring_grow(struct ioat_softc *ioat, uint32_t oldorder, + struct ioat_descriptor **newring) { - struct ioat_descriptor **ring; - struct ioat_descriptor *next; + struct ioat_descriptor *tmp, *next; struct ioat_dma_hw_descriptor *hw; - struct ioat_descriptor *ent; - uint32_t current_size, active, new_size, i, new_idx, current_idx; - uint32_t new_idx2; - - current_size = 1 << ioat->ring_size_order; - active = (ioat->head - ioat->tail) & (current_size - 1); - new_size = 1 << order; + uint32_t oldsize, newsize, head, tail, i, end; + int error; - if (order > IOAT_MAX_ORDER) - return (FALSE); + CTR0(KTR_IOAT, __func__); - /* - * when shrinking, verify that we can hold the current active - * set in the new ring - */ - if (active >= new_size) - return (FALSE); + mtx_assert(&ioat->submit_lock, MA_OWNED); - /* allocate the array to hold the software ring */ - ring = malloc(new_size * sizeof(*ring), M_IOAT, M_ZERO | M_NOWAIT); - if (ring == NULL) - return (FALSE); + if (oldorder != ioat->ring_size_order || oldorder >= IOAT_MAX_ORDER) { + error = EINVAL; + goto out; + } - ioat_log_message(2, "ring resize: new: %d old: %d\n", - new_size, current_size); + oldsize = (1 << oldorder); + newsize = (1 << (oldorder + 1)); - /* allocate/trim descriptors as needed */ - if (new_size > current_size) { - /* copy current descriptors to the new ring */ - for (i = 0; i < current_size; i++) { - current_idx = (ioat->tail + i) & (current_size - 1); - new_idx = (ioat->tail + i) & (new_size - 1); + mtx_lock(&ioat->cleanup_lock); - ring[new_idx] = ioat->ring[current_idx]; - ring[new_idx]->id = new_idx; - } + head = ioat->head & (oldsize - 1); + tail = ioat->tail & (oldsize - 1); - /* add new descriptors to the ring */ - for (i = current_size; i < new_size; i++) { - new_idx = (ioat->tail + i) & (new_size - 1); - - ring[new_idx] = ioat_alloc_ring_entry(ioat); - if (ring[new_idx] == NULL) { - while (i--) { - new_idx2 = (ioat->tail + i) & - (new_size - 1); - - ioat_free_ring_entry(ioat, - ring[new_idx2]); - } - free(ring, M_IOAT); - return (FALSE); - } - ring[new_idx]->id = new_idx; - } + /* Copy old descriptors to new ring */ + for (i = 0; i < oldsize; i++) + newring[i] = ioat->ring[i]; - for (i = current_size - 1; i < new_size; i++) { - new_idx = (ioat->tail + i) & (new_size - 1); - next = ring[(new_idx + 1) & (new_size - 1)]; - hw = ring[new_idx]->u.dma; + /* + * If head has wrapped but tail hasn't, we must swap some descriptors + * around so that tail can increment directly to head. + */ + if (head < tail) { + for (i = 0; i <= head; i++) { + tmp = newring[oldsize + i]; - hw->next = next->hw_desc_bus_addr; - } - } else { - /* - * copy current descriptors to the new ring, dropping the - * removed descriptors - */ - for (i = 0; i < new_size; i++) { - current_idx = (ioat->tail + i) & (current_size - 1); - new_idx = (ioat->tail + i) & (new_size - 1); + newring[oldsize + i] = newring[i]; + newring[oldsize + i]->id = oldsize + i; - ring[new_idx] = ioat->ring[current_idx]; - ring[new_idx]->id = new_idx; + newring[i] = tmp; + newring[i]->id = i; } + head += oldsize; + } - /* free deleted descriptors */ - for (i = new_size; i < current_size; i++) { - ent = ioat_get_ring_entry(ioat, ioat->tail + i); - ioat_free_ring_entry(ioat, ent); - } + KASSERT(head >= tail, ("invariants")); + + /* Head didn't wrap; we only need to link in oldsize..newsize */ + if (head < oldsize) { + i = oldsize - 1; + end = newsize; + } else { + /* Head did wrap; link newhead..newsize and 0..oldhead */ + i = head; + end = newsize + (head - oldsize) + 1; + } + + /* + * Fix up hardware ring, being careful not to trample the active + * section (tail -> head). + */ + for (; i < end; i++) { + KASSERT((i & (newsize - 1)) < tail || + (i & (newsize - 1)) >= head, ("trampling snake")); - /* fix up hardware ring */ - hw = ring[(ioat->tail + new_size - 1) & (new_size - 1)]->u.dma; - next = ring[(ioat->tail + new_size) & (new_size - 1)]; + next = newring[(i + 1) & (newsize - 1)]; + hw = newring[i & (newsize - 1)]->u.dma; hw->next = next->hw_desc_bus_addr; } free(ioat->ring, M_IOAT); - ioat->ring = ring; - ioat->ring_size_order = order; + ioat->ring = newring; + ioat->ring_size_order = oldorder + 1; + ioat->tail = tail; + ioat->head = head; + error = 0; - return (TRUE); + mtx_unlock(&ioat->cleanup_lock); +out: + if (error) + ioat_free_ring(ioat, (1 << (oldorder + 1)), newring); + return (error); +} + +static int +ring_shrink(struct ioat_softc *ioat, uint32_t oldorder, + struct ioat_descriptor **newring) +{ + struct ioat_dma_hw_descriptor *hw; + struct ioat_descriptor *ent, *next; + uint32_t oldsize, newsize, current_idx, new_idx, i; + int error; + + CTR0(KTR_IOAT, __func__); + + mtx_assert(&ioat->submit_lock, MA_OWNED); + + if (oldorder != ioat->ring_size_order || oldorder <= IOAT_MIN_ORDER) { + error = EINVAL; + goto out_unlocked; + } + + oldsize = (1 << oldorder); + newsize = (1 << (oldorder - 1)); + + mtx_lock(&ioat->cleanup_lock); + + /* Can't shrink below current active set! */ + if (ioat_get_active(ioat) >= newsize) { + error = ENOMEM; + goto out; + } + + /* + * Copy current descriptors to the new ring, dropping the removed + * descriptors. + */ + for (i = 0; i < newsize; i++) { + current_idx = (ioat->tail + i) & (oldsize - 1); + new_idx = (ioat->tail + i) & (newsize - 1); + + newring[new_idx] = ioat->ring[current_idx]; + newring[new_idx]->id = new_idx; + } + + /* Free deleted descriptors */ + for (i = newsize; i < oldsize; i++) { + ent = ioat_get_ring_entry(ioat, ioat->tail + i); + ioat_free_ring_entry(ioat, ent); + } + + /* Fix up hardware ring. */ + hw = newring[(ioat->tail + newsize - 1) & (newsize - 1)]->u.dma; + next = newring[(ioat->tail + newsize) & (newsize - 1)]; + hw->next = next->hw_desc_bus_addr; + + free(ioat->ring, M_IOAT); + ioat->ring = newring; + ioat->ring_size_order = oldorder - 1; + error = 0; + +out: + mtx_unlock(&ioat->cleanup_lock); +out_unlocked: + if (error) + ioat_free_ring(ioat, (1 << (oldorder - 1)), newring); + return (error); } static void @@ -931,19 +1109,22 @@ ioat_halted_debug(struct ioat_softc *ioa if (chanerr == 0) return; + mtx_lock(&ioat->submit_lock); desc = ioat_get_ring_entry(ioat, ioat->tail + 0); dump_descriptor(desc->u.raw); desc = ioat_get_ring_entry(ioat, ioat->tail + 1); dump_descriptor(desc->u.raw); + mtx_unlock(&ioat->submit_lock); } static void ioat_timer_callback(void *arg) { + struct ioat_descriptor **newring; struct ioat_softc *ioat; uint64_t status; - uint32_t chanerr; + uint32_t chanerr, order; ioat = arg; ioat_log_message(1, "%s\n", __func__); @@ -962,17 +1143,31 @@ ioat_timer_callback(void *arg) ioat_process_events(ioat); } else { mtx_lock(&ioat->submit_lock); - mtx_lock(&ioat->cleanup_lock); + order = ioat->ring_size_order; + if (ioat->is_resize_pending || order == IOAT_MIN_ORDER) { + mtx_unlock(&ioat->submit_lock); + goto out; + } + ioat->is_resize_pending = TRUE; + mtx_unlock(&ioat->submit_lock); + + newring = ioat_prealloc_ring(ioat, 1 << (order - 1), FALSE, + M_NOWAIT); + + mtx_lock(&ioat->submit_lock); + KASSERT(ioat->ring_size_order == order, + ("resize_pending protects order")); - if (ioat_get_active(ioat) == 0 && - ioat->ring_size_order > IOAT_MIN_ORDER) - resize_ring(ioat, ioat->ring_size_order - 1); + if (newring != NULL) + ring_shrink(ioat, order, newring); - mtx_unlock(&ioat->cleanup_lock); + ioat->is_resize_pending = FALSE; mtx_unlock(&ioat->submit_lock); +out: + /* Slowly scale the ring down if idle. */ if (ioat->ring_size_order > IOAT_MIN_ORDER) - callout_reset(&ioat->timer, IOAT_INTR_TIMO, + callout_reset(&ioat->timer, 10 * hz, ioat_timer_callback, ioat); } } @@ -986,6 +1181,7 @@ ioat_submit_single(struct ioat_softc *io ioat_get(ioat, IOAT_ACTIVE_DESCR_REF); atomic_add_rel_int(&ioat->head, 1); + atomic_add_rel_int(&ioat->hw_head, 1); if (!ioat->is_completion_pending) { ioat->is_completion_pending = TRUE; @@ -1071,7 +1267,7 @@ ioat_reset_hw(struct ioat_softc *ioat) * The internal ring counter resets to zero, so we have to start over * at zero as well. */ - ioat->tail = ioat->head = 0; + ioat->tail = ioat->head = ioat->hw_head = 0; ioat->last_seen = 0; ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); @@ -1134,11 +1330,13 @@ ioat_setup_sysctl(device_t device) &ioat->max_xfer_size, 0, "HW maximum transfer size"); SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "ring_size_order", CTLFLAG_RD, - &ioat->ring_size_order, 0, "HW descriptor ring size order"); + &ioat->ring_size_order, 0, "SW descriptor ring size order"); SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "head", CTLFLAG_RD, &ioat->head, 0, - "HW descriptor head pointer index"); + "SW descriptor head pointer index"); SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "tail", CTLFLAG_RD, &ioat->tail, 0, - "HW descriptor tail pointer index"); + "SW descriptor tail pointer index"); + SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "hw_head", CTLFLAG_RD, + &ioat->hw_head, 0, "HW DMACOUNT"); SYSCTL_ADD_UQUAD(ctx, par, OID_AUTO, "last_completion", CTLFLAG_RD, ioat->comp_update, "HW addr of last completion"); Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Mon Oct 26 03:15:06 2015 (r289981) +++ head/sys/dev/ioat/ioat.h Mon Oct 26 03:30:38 2015 (r289982) @@ -41,7 +41,12 @@ __FBSDID("$FreeBSD$"); * this on the last operation in a group */ #define DMA_INT_EN 0x1 -#define DMA_ALL_FLAGS (DMA_INT_EN) +/* + * Like M_NOWAIT. Operations will return NULL if they cannot allocate a + * descriptor without blocking. + */ +#define DMA_NO_WAIT 0x2 +#define DMA_ALL_FLAGS (DMA_INT_EN | DMA_NO_WAIT) typedef void *bus_dmaengine_t; struct bus_dmadesc; Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Mon Oct 26 03:15:06 2015 (r289981) +++ head/sys/dev/ioat/ioat_internal.h Mon Oct 26 03:30:38 2015 (r289982) @@ -361,6 +361,7 @@ struct ioat_softc { uint32_t head; uint32_t tail; + uint32_t hw_head; uint32_t ring_size_order; bus_addr_t last_seen; From owner-svn-src-head@freebsd.org Mon Oct 26 03:30:51 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D474F8760; Mon, 26 Oct 2015 03:30:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8212C1097; Mon, 26 Oct 2015 03:30:51 +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 t9Q3Uogm003069; Mon, 26 Oct 2015 03:30:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9Q3Uo6h003067; Mon, 26 Oct 2015 03:30:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510260330.t9Q3Uo6h003067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 26 Oct 2015 03:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289983 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 03:30:51 -0000 Author: cem Date: Mon Oct 26 03:30:50 2015 New Revision: 289983 URL: https://svnweb.freebsd.org/changeset/base/289983 Log: ioat: Add %b format string for CHANERR codes Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_hw.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Oct 26 03:30:38 2015 (r289982) +++ head/sys/dev/ioat/ioat.c Mon Oct 26 03:30:50 2015 (r289983) @@ -349,7 +349,8 @@ ioat_start_channel(struct ioat_softc *io chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); ioat_log_message(0, "could not start channel: " - "status = %#jx error = %x\n", (uintmax_t)status, chanerr); + "status = %#jx error = %b\n", (uintmax_t)status, (int)chanerr, + IOAT_CHANERR_STR); return (ENXIO); } @@ -1105,7 +1106,8 @@ ioat_halted_debug(struct ioat_softc *ioa { struct ioat_descriptor *desc; - ioat_log_message(0, "Channel halted (%x)\n", chanerr); + ioat_log_message(0, "Channel halted (%b)\n", (int)chanerr, + IOAT_CHANERR_STR); if (chanerr == 0) return; Modified: head/sys/dev/ioat/ioat_hw.h ============================================================================== --- head/sys/dev/ioat/ioat_hw.h Mon Oct 26 03:30:38 2015 (r289982) +++ head/sys/dev/ioat/ioat_hw.h Mon Oct 26 03:30:50 2015 (r289983) @@ -126,6 +126,13 @@ __FBSDID("$FreeBSD$"); #define IOAT_CHANERR_RATVERR (1 << 26) #define IOAT_CHANERR_RRTVERR (1 << 27) +#define IOAT_CHANERR_STR \ + "\20\34RRTVERR\33RATVERR\32RGTVERR\31RDIFFERR\30BBERR\27RTVERR\26ATVERR" \ + "\25GTVERR\24DIFFERR\23DCNTERR\21CXPERR\20UNAFFERR\17SEDERR\16INTCFGERR" \ + "\15CMPADDERR\14DXSERR\13DCERR\12WDERR\11RDERR\10DUNCORERR\07CUNCORERR" \ + "\06CCMDERR\05CHADDERR\04DERR\03NDADDERR\02XDADDERR\01XSADDERR" + + #define IOAT_CFG_CHANERR_INT_OFFSET 0x180 #define IOAT_CFG_CHANERRMASK_INT_OFFSET 0x184 From owner-svn-src-head@freebsd.org Mon Oct 26 09:34:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E12DAA1C72C; Mon, 26 Oct 2015 09:34:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A82351DF6; Mon, 26 Oct 2015 09:34:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9Q9Yhma010537; Mon, 26 Oct 2015 09:34:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9Q9YhFW010536; Mon, 26 Oct 2015 09:34:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510260934.t9Q9YhFW010536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Oct 2015 09:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289993 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 09:34:45 -0000 Author: hselasky Date: Mon Oct 26 09:34:43 2015 New Revision: 289993 URL: https://svnweb.freebsd.org/changeset/base/289993 Log: Build fix for MIPS. Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/sched.h Modified: head/sys/ofed/include/linux/sched.h ============================================================================== --- head/sys/ofed/include/linux/sched.h Mon Oct 26 07:19:03 2015 (r289992) +++ head/sys/ofed/include/linux/sched.h Mon Oct 26 09:34:43 2015 (r289993) @@ -64,9 +64,12 @@ struct task_struct { int should_stop; }; -#define current ((struct task_struct *)curthread->td_retval[1]) -#define task_struct_get(x) (struct task_struct *)(x)->td_retval[1] -#define task_struct_set(x, y) (x)->td_retval[1] = (register_t)(y) +#define current task_struct_get(curthread) +#define task_struct_get(x) ((struct task_struct *)(uintptr_t)(x)->td_retval[1]) +#define task_struct_set(x, y) (x)->td_retval[1] = (uintptr_t)(y) + +/* ensure the task_struct pointer fits into the td_retval[1] field */ +CTASSERT(sizeof(((struct thread *)0)->td_retval[1]) >= sizeof(uintptr_t)); #define set_current_state(x) \ atomic_store_rel_int((volatile int *)¤t->state, (x)) From owner-svn-src-head@freebsd.org Mon Oct 26 10:09:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3443BA1D09E; Mon, 26 Oct 2015 10:09:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F29161D8C; Mon, 26 Oct 2015 10:09:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QA99fO019133; Mon, 26 Oct 2015 10:09:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QA99if019132; Mon, 26 Oct 2015 10:09:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510261009.t9QA99if019132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Oct 2015 10:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289994 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 10:09:10 -0000 Author: hselasky Date: Mon Oct 26 10:09:08 2015 New Revision: 289994 URL: https://svnweb.freebsd.org/changeset/base/289994 Log: Build the LinuxKPI module by default. Sponsored by: Mellanox Technologies Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 26 09:34:43 2015 (r289993) +++ head/sys/modules/Makefile Mon Oct 26 10:09:08 2015 (r289994) @@ -202,7 +202,7 @@ SUBDIR= \ ${_linux} \ ${_linux_common} \ ${_linux64} \ - ${_linuxkpi} \ + linuxkpi \ lmc \ lpt \ mac_biba \ @@ -539,9 +539,6 @@ _ixv= ixv _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux -.if ${MK_OFED} != "no" -_linuxkpi= linuxkpi -.endif _ndis= ndis _pccard= pccard .if ${MK_OFED} != "no" || defined(ALL_MODULES) From owner-svn-src-head@freebsd.org Mon Oct 26 10:37:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DBCF81CD; Mon, 26 Oct 2015 10:37:19 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 CD7E01B2D; Mon, 26 Oct 2015 10:37:18 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QAbHjV027611; Mon, 26 Oct 2015 10:37:17 GMT (envelope-from theraven@FreeBSD.org) Received: (from theraven@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QAbHc9027610; Mon, 26 Oct 2015 10:37:17 GMT (envelope-from theraven@FreeBSD.org) Message-Id: <201510261037.t9QAbHc9027610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: theraven set sender to theraven@FreeBSD.org using -f From: David Chisnall Date: Mon, 26 Oct 2015 10:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289995 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 10:37:19 -0000 Author: theraven Date: Mon Oct 26 10:37:17 2015 New Revision: 289995 URL: https://svnweb.freebsd.org/changeset/base/289995 Log: Ensure that dtc is built in C++11 mode. Reported by: George Abdelmalik Modified: head/usr.bin/dtc/Makefile Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Mon Oct 26 10:09:08 2015 (r289994) +++ head/usr.bin/dtc/Makefile Mon Oct 26 10:37:17 2015 (r289995) @@ -6,6 +6,8 @@ MAN= dtc.1 WARNS?= 3 +CXXFLAGS+= -std=c++11 + NO_SHARED?=NO .include From owner-svn-src-head@freebsd.org Mon Oct 26 10:48:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 628D88332; Mon, 26 Oct 2015 10:48:59 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (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 F3A8A1130; Mon, 26 Oct 2015 10:48:58 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wicfx6 with SMTP id fx6so107668065wic.1; Mon, 26 Oct 2015 03:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=07J6GxlVOw1IJcGTRkYGNDn4Mh80pMU4w6sDQQRnj8o=; b=vfKVYg3ctv0NyIonXzOyKeLdKmX5ytEDNJ99JXKSqNFIv54SJWu1vI/qDxVMno+if7 NbzdoNvE980GlLaEOFN5WlNjntlzVEwWKKpLrLugQXlb9Ae8ESo7VMjRdWuTI2wadnwR OA2KiH8o2Eg+3qwEMU5r5mrE1A4PVmy+yxAkfflGkXj1A1ue8bbZFBSnT2vSvPIcjApt hqNZ/bzeDCXfo/Bej1Ix92+59cBTlTPgpEf9PiB+PmcZ/ZzLaohKhJt5yU9+d9bD1RCU 4U49m0vgxn4XwGtXdtkjbDCDKKCNTSVUrNeViWeQ5RJXY1oOz56bx0WzwvXLSbXEor+J gkTQ== X-Received: by 10.194.87.40 with SMTP id u8mr22327911wjz.121.1445856537392; Mon, 26 Oct 2015 03:48:57 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id l78sm2024315wmb.5.2015.10.26.03.48.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2015 03:48:56 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 26 Oct 2015 11:48:55 +0100 From: Baptiste Daroussin To: David Chisnall Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289995 - head/usr.bin/dtc Message-ID: <20151026104855.GE17025@ivaldir.etoilebsd.net> References: <201510261037.t9QAbHc9027610@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u5E4XgoOPWr4PD9E" Content-Disposition: inline In-Reply-To: <201510261037.t9QAbHc9027610@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 10:48:59 -0000 --u5E4XgoOPWr4PD9E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 26, 2015 at 10:37:17AM +0000, David Chisnall wrote: > Author: theraven > Date: Mon Oct 26 10:37:17 2015 > New Revision: 289995 > URL: https://svnweb.freebsd.org/changeset/base/289995 >=20 > Log: > Ensure that dtc is built in C++11 mode. > =20 > Reported by: George Abdelmalik >=20 > Modified: > head/usr.bin/dtc/Makefile >=20 > Modified: head/usr.bin/dtc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/dtc/Makefile Mon Oct 26 10:09:08 2015 (r289994) > +++ head/usr.bin/dtc/Makefile Mon Oct 26 10:37:17 2015 (r289995) > @@ -6,6 +6,8 @@ MAN=3D dtc.1 > =20 > WARNS?=3D 3 > =20 > +CXXFLAGS+=3D -std=3Dc++11 > + > NO_SHARED?=3DNO > =20 > .include >=20 Just jumping on that one, you should probably revisit de HACKING files :) Bapt --u5E4XgoOPWr4PD9E Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlYuBRcACgkQ8kTtMUmk6Ex2sgCgjAKOkbb49S4q+km3C+vxAnQI FHgAoIaJb/4JeRBG5iyFZ/ZECGBFG1Gw =Fknp -----END PGP SIGNATURE----- --u5E4XgoOPWr4PD9E-- From owner-svn-src-head@freebsd.org Mon Oct 26 10:53:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1B286C4; Mon, 26 Oct 2015 10:53:42 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DFC6F154E; Mon, 26 Oct 2015 10:53:41 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id t9QArcwE042252 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Oct 2015 10:53:39 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r289995 - head/usr.bin/dtc From: David Chisnall In-Reply-To: <20151026104855.GE17025@ivaldir.etoilebsd.net> Date: Mon, 26 Oct 2015 10:53:32 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201510261037.t9QAbHc9027610@repo.freebsd.org> <20151026104855.GE17025@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 10:53:42 -0000 On 26 Oct 2015, at 10:48, Baptiste Daroussin wrote: >=20 > Just jumping on that one, you should probably revisit de HACKING files = :) Ah, good point. I=E2=80=99ll update them. David From owner-svn-src-head@freebsd.org Mon Oct 26 11:02:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7250E8A86; Mon, 26 Oct 2015 11:02:58 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2585D1BF4; Mon, 26 Oct 2015 11:02:58 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QB2vFc036026; Mon, 26 Oct 2015 11:02:57 GMT (envelope-from theraven@FreeBSD.org) Received: (from theraven@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QB2vkA036025; Mon, 26 Oct 2015 11:02:57 GMT (envelope-from theraven@FreeBSD.org) Message-Id: <201510261102.t9QB2vkA036025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: theraven set sender to theraven@FreeBSD.org using -f From: David Chisnall Date: Mon, 26 Oct 2015 11:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289996 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 11:02:58 -0000 Author: theraven Date: Mon Oct 26 11:02:57 2015 New Revision: 289996 URL: https://svnweb.freebsd.org/changeset/base/289996 Log: Update some obsolete information in the HACKING document. Reported by: bapt Modified: head/usr.bin/dtc/HACKING Modified: head/usr.bin/dtc/HACKING ============================================================================== --- head/usr.bin/dtc/HACKING Mon Oct 26 10:37:17 2015 (r289995) +++ head/usr.bin/dtc/HACKING Mon Oct 26 11:02:57 2015 (r289996) @@ -21,19 +21,17 @@ welcome. C++11 ----- -This project currently aims to compile with g++ 4.2.1 and so doesn't make any -use of C++11 features. It would be a good idea to relax this restriction once -clang is the default compiler for ARM, MIPS and PowerPC. - -This code makes use of a lot of iterator loops, which would be cleaner using -the new syntax in C++11. It also explicitly deletes a lot of objects held in -collections in destructors that have these collections as their members. This -could be simplified by using `shared_ptr`. - -The code does make use of `static_assert()`, but uses a macro in utility.hh to -remove these if they are not supported. The FreeBSD standard headers also -define a compatibility macro the implements static asserts in terms of an array -with 1 element on success and -1 elements on failure. +This project uses C++11, as the goal for FreeBSD 11 is to require C/C++11 as a +minimum, either from clang or an external toolchain. In particular, it uses +`std::unique_ptr` extensively for memory management within the tree. Unique +pointers are also used in several other places to track ownership. + +Most iterator loops use the new loop syntax and the `auto` type for type +deduction. Range-based `for` loops generally improve the readability of the +code, though `auto` should only be used in places where the type can be deduced +as easily by the reader as by the compiler. + +The code also makes use of `static_assert()` to track compile-time invariants. Adding New Checks ----------------- From owner-svn-src-head@freebsd.org Mon Oct 26 12:24:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 391AEA1AF66; Mon, 26 Oct 2015 12:24:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (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 04C9511D4; Mon, 26 Oct 2015 12:24:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igdg1 with SMTP id g1so57091770igd.1; Mon, 26 Oct 2015 05:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7ogB/iGtwWjR7JhNXmLfH3JnNtb3m8MF8RSV/lGhaSk=; b=cBsb3OOJqQc37QHca9i22G1x3ZIU11zOTyxd5Wg75Ot2x3X1JcMeMMCYs0D2BHs7/9 UVZP2geZe0A/myhmrK4/Fzyi9uVBTr7XeGwpmLlWSgOO8lSh0axigqdbDt58O7i30xnH N7yORnNa5e0M7nGMoa3+NVsBUZuCGA54Q7tpdMVfqpnickczr477fS67M305O5H0g9gZ W+/l1KN4i8cm1AbP9p1dzuEQWAofWh+jOiw7VpnsVmwFUjl6mLO0VfM+4heKA9uMipC4 ut11pkkPGG4HEzKNlZgWcMS6IQGPKHP2960y6Iwr46Fd51LIgERybYpBjKj+/PaBgjDm Pf6w== MIME-Version: 1.0 X-Received: by 10.50.164.196 with SMTP id ys4mr535950igb.37.1445862284349; Mon, 26 Oct 2015 05:24:44 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Mon, 26 Oct 2015 05:24:44 -0700 (PDT) In-Reply-To: <562A564D.9080703@citrix.com> References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> Date: Mon, 26 Oct 2015 05:24:44 -0700 Message-ID: Subject: Re: svn commit: r289834 - head/sys/x86/x86 From: Adrian Chadd To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 12:24:45 -0000 Hi, I've started seeing panics on -head with ATA code doing a dmamap load -> panic. I'll test by reverting this patch and see what happens, but when it /does/ happen I can't get a crashdump, so debugging will be less easy. Has anyone else seen this? -a On 23 October 2015 at 08:46, Roger Pau Monn=C3=A9 wr= ote: > El 23/10/15 a les 17.39, Roger Pau Monn=C3=A9 ha escrit: >> Author: royger >> Date: Fri Oct 23 15:39:59 2015 >> New Revision: 289834 >> URL: https://svnweb.freebsd.org/changeset/base/289834 >> >> Log: >> x86/dma_bounce: rework _bus_dmamap_load_ma implementation >> >> The implementation of bus_dmamap_load_ma_triv currently calls >> _bus_dmamap_load_phys on each page that is part of the passed in buffe= r. >> Since each page is treated as an individual buffer, the resulting beha= viour >> is different from the behaviour of _bus_dmamap_load_buffer. This break= s >> certain drivers, like Xen blkfront. >> >> If an unmapped buffer of size 4096 that starts at offset 13 into the f= irst >> page is passed to the current _bus_dmamap_load_ma implementation (so t= he ma >> array contains two pages), the result is that two segments are created= , one >> with a size of 4083 and the other with size 13 (because two independan= t >> calls to _bus_dmamap_load_phys are performed, one for each physical pa= ge). >> If the same is done with a mapped buffer and calling _bus_dmamap_load_= buffer >> the result is that only one segment is created, with a size of 4096. >> >> This patch relegates the usage of bus_dmamap_load_ma_triv in x86 bounc= e >> buffer code to drivers requesting BUS_DMA_KEEP_PG_OFFSET and implement= s >> _bus_dmamap_load_ma so that it's behaviour is the same as the mapped v= ersion >> (_bus_dmamap_load_buffer). This patch only modifies the x86 bounce buf= fer >> code, other arches are left untouched. >> >> Reviewed by: kib, jah >> Differential Revision: https://reviews.freebsd.org/D888 >> Sponsored by: Citrix Systems R&D > > Forgot to add: > > MFC after: 2 weeks > > Roger. > From owner-svn-src-head@freebsd.org Mon Oct 26 12:41:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCAEF8A04; Mon, 26 Oct 2015 12:41:45 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c: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 4C388122F; Mon, 26 Oct 2015 12:41:45 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wicfx6 with SMTP id fx6so112097935wic.1; Mon, 26 Oct 2015 05:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=cDoh7xz9JJuWpvs4S7lJxsCRs7a63P32mxaEkH7pZfw=; b=VauydF5EqimX0GfEPX7HSDMN8HGUo/LKyfVJMDuLBw35YR7qZdomu45uC4jNfEzfAC NMe8c8C+hbtyXf5HK6h4Ll3q7gKj99uBS50rqoCscz0yLo+0e6azA/glAEHj1jEizbcj /b4Vn4geSpUUQ/CsGdkUh52KTFPwhbLJUNaO2KtM0bCwRv6ZSvQcpBS59LkMGAJXqzhG 5k6sgdtR1pVhLj0Hs22MTr9jV56+2w1wfGKa82OTorqNrXMStbHVSh2tyH4l1p3YpKXi fN6pBKQP9RmgvzgmnwPxfQ+Hz52q9RMUJqsDKnCZtflZSnk8dYaqGAESRGW7d1v3leu5 YbKA== X-Received: by 10.194.79.9 with SMTP id f9mr16675794wjx.130.1445863303462; Mon, 26 Oct 2015 05:41:43 -0700 (PDT) Received: from [192.168.1.130] (43.Red-88-12-33.staticIP.rima-tde.net. [88.12.33.43]) by smtp.gmail.com with ESMTPSA id xt1sm38816959wjb.32.2015.10.26.05.41.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2015 05:41:42 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r289834 - head/sys/x86/x86 To: Adrian Chadd References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> Cc: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Message-ID: <562E1F8F.3010304@FreeBSD.org> Date: Mon, 26 Oct 2015 13:41:51 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 12:41:45 -0000 El 26/10/15 a les 13.24, Adrian Chadd ha escrit: > Hi, > > I've started seeing panics on -head with ATA code doing a dmamap load > -> panic. I'll test by reverting this patch and see what happens, but > when it /does/ happen I can't get a crashdump, so debugging will be > less easy. > > Has anyone else seen this? I've got another report regarding ATA page-faults from Oliver Pinter. The crash he was seeing was caused by bus_dmamap_load_ccb, but the calls to the specific dma functions where optimized away. Can you figure out which bounce_* function causes this specifically? Thanks, Roger. From owner-svn-src-head@freebsd.org Mon Oct 26 12:54:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26808E5B for ; Mon, 26 Oct 2015 12:53:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (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 812371B8F for ; Mon, 26 Oct 2015 12:53:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wicfv8 with SMTP id fv8so114518886wic.0 for ; Mon, 26 Oct 2015 05:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=HgxhkyguNL64guQj04wlPB/azZhScr8JqHiKotGeHKk=; b=iM1ZAbZy+/CRlGt5RuzdwH64r2036uuQXKzRyzLsIWRIWuv6x1ymZmz7N1EEZA+AP+ G/NMyvXMsr+CGFlVv7jwXVAl+HfBLQHfokFY44GwM2Wmz7s27PNf82+UWhf48mK2KMGU wK8RPcgyD2vQsHAiHz9H2ZVtxfUR64HBFMzo6Kh/FKYP1MSOlV+DVsMb5il169q8VnQk z0v8YAf4v32PVj86vNwvLYzN8wBJxEsGwiDRaNNdvAqWK+L/S4x0tb4g8GaL7hLnEd0U BcT7Gtg8GErHEV0nFb9qyAllfww1rn5yu3LGOyozHhMxflr20lyljsPqspCreOKuYpPz rPwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HgxhkyguNL64guQj04wlPB/azZhScr8JqHiKotGeHKk=; b=SWLFLxv/KKLZ1pi7yTzFuSULf39cUKbtyfz3tN+AvOpbSgCZOC6dpSt0xBENdMhQYV 0lwwm2laA5kKnSkEDSSbaXpHO2AKKCXxfGZOXxx3HIL1Hot8WpsDxUqF0ojJ6gYzp76V WqH5mhOmK5ABQjL5LnDlUnLKNzJufYDe5pxHZt5f9GzR8VZCleTKKqZu+TA7wePlW0tb UnuRroK3p3YHasn853eIFWZtJCVmVFU6CzN5v9q2+TGeiOK7RPP23+mWDURf4e1KOnky rm0sIZbs00o+O4BPTREyMUUaxvumESrP/X4e5ZvBVTjUHGDbVAd0oa7sPbS8uvO/ocdG Cj3Q== X-Gm-Message-State: ALoCoQkvAyVUUxBqJM4zaUAg640vh8GKaA8SffxzKCm3rUEvoiTinX1uay6UBvMbglok3NItPY/M MIME-Version: 1.0 X-Received: by 10.194.78.135 with SMTP id b7mr19740281wjx.67.1445864037851; Mon, 26 Oct 2015 05:53:57 -0700 (PDT) Received: by 10.194.240.226 with HTTP; Mon, 26 Oct 2015 05:53:57 -0700 (PDT) In-Reply-To: <562E1F8F.3010304@FreeBSD.org> References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> <562E1F8F.3010304@FreeBSD.org> Date: Mon, 26 Oct 2015 13:53:57 +0100 Message-ID: Subject: Re: svn commit: r289834 - head/sys/x86/x86 From: Oliver Pinter To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 12:54:00 -0000 Hi Roger! On 10/26/15, Roger Pau Monn=C3=A9 wrote: > El 26/10/15 a les 13.24, Adrian Chadd ha escrit: >> Hi, >> >> I've started seeing panics on -head with ATA code doing a dmamap load >> -> panic. I'll test by reverting this patch and see what happens, but >> when it /does/ happen I can't get a crashdump, so debugging will be >> less easy. >> >> Has anyone else seen this? > > I've got another report regarding ATA page-faults from Oliver Pinter. > The crash he was seeing was caused by bus_dmamap_load_ccb, but the calls > to the specific dma functions where optimized away. Can you figure out > which bounce_* function causes this specifically? I have already deleted the broken kernel, and I'm now running on kernel without this patch. > > Thanks, Roger. > > _______________________________________________ > 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 Oct 26 13:28:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE14F863A; Mon, 26 Oct 2015 13:28:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAB8A195F; Mon, 26 Oct 2015 13:28:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QDSYdD076893; Mon, 26 Oct 2015 13:28:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QDSYRT076892; Mon, 26 Oct 2015 13:28:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510261328.t9QDSYRT076892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Oct 2015 13:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290003 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 13:28:36 -0000 Author: hselasky Date: Mon Oct 26 13:28:34 2015 New Revision: 290003 URL: https://svnweb.freebsd.org/changeset/base/290003 Log: Add support for binding IRQs to CPUs in the LinuxKPI. The new function added is for BSD only and does not exist in Linux. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/interrupt.h Modified: head/sys/ofed/include/linux/interrupt.h ============================================================================== --- head/sys/ofed/include/linux/interrupt.h Mon Oct 26 12:16:50 2015 (r290002) +++ head/sys/ofed/include/linux/interrupt.h Mon Oct 26 13:28:34 2015 (r290003) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -118,6 +118,23 @@ request_irq(unsigned int irq, irq_handle return 0; } +static inline int +bind_irq_to_cpu(unsigned int irq, int cpu_id) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return (-ENOENT); + + irqe = _irq_ent(dev, irq); + if (irqe == NULL) + return (-ENOENT); + + return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); +} + static inline void free_irq(unsigned int irq, void *device) { From owner-svn-src-head@freebsd.org Mon Oct 26 13:58:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E94E8D3D; Mon, 26 Oct 2015 13:58:01 +0000 (UTC) (envelope-from adrian.chadd@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 5F8631797; Mon, 26 Oct 2015 13:58:01 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iody8 with SMTP id y8so31175836iod.1; Mon, 26 Oct 2015 06:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=0tfpB3iOmRwnxOhdxmmsjxPfEON70Ml88N7dFw+nrv4=; b=LNBeWCJ8Y6uhUn/3x6Kn5i4QNQtiV4oZS5VYP21I1hzdoZNl2x0Jp3kIgRleadaJpb Q2LGPrCrAier6qGEiGfR2ssPvioa6Y0ER7Qid45/aXwunnlUj34wSYLqZ9RhDK1oh0Rs GdthUsdgA1dojE6CyCVwpgM8P5KDAaLlGC5mMwi9ZBrRSIeiwdkFKUeEbmmpovkt99cU +joNfcl/mvHJZCPnfZ0npiJd60C9NpBo9E8T9uwU0b/2bhLg+IF8OXCd5wSWqCqSWa+t XgBO4Ne4srvn80/XpBKYsBjGxliDlRx4M2JKFxaet+Totf7b8WcjIlgTGbvddtQJn0b2 Rk5A== MIME-Version: 1.0 X-Received: by 10.107.3.72 with SMTP id 69mr34411507iod.75.1445867880706; Mon, 26 Oct 2015 06:58:00 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Mon, 26 Oct 2015 06:58:00 -0700 (PDT) In-Reply-To: References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> <562E1F8F.3010304@FreeBSD.org> Date: Mon, 26 Oct 2015 06:58:00 -0700 Message-ID: Subject: Re: svn commit: r289834 - head/sys/x86/x86 From: Adrian Chadd To: Oliver Pinter Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 13:58:01 -0000 Hi, I'll take a photo of it when it breaks next. Would you mind reverting it for now until we can figure it out? -adrian On 26 October 2015 at 05:53, Oliver Pinter wrote: > Hi Roger! > > On 10/26/15, Roger Pau Monn=C3=A9 wrote: >> El 26/10/15 a les 13.24, Adrian Chadd ha escrit: >>> Hi, >>> >>> I've started seeing panics on -head with ATA code doing a dmamap load >>> -> panic. I'll test by reverting this patch and see what happens, but >>> when it /does/ happen I can't get a crashdump, so debugging will be >>> less easy. >>> >>> Has anyone else seen this? >> >> I've got another report regarding ATA page-faults from Oliver Pinter. >> The crash he was seeing was caused by bus_dmamap_load_ccb, but the calls >> to the specific dma functions where optimized away. Can you figure out >> which bounce_* function causes this specifically? > > I have already deleted the broken kernel, and I'm now running on > kernel without this patch. > >> >> Thanks, Roger. >> >> _______________________________________________ >> 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 Oct 26 14:14:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CADA1C1F7; Mon, 26 Oct 2015 14:14:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id ACB6A10E4; Mon, 26 Oct 2015 14:14:57 +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 t9QEEu9a091085; Mon, 26 Oct 2015 14:14:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QEEuuF091084; Mon, 26 Oct 2015 14:14:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510261414.t9QEEuuF091084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 26 Oct 2015 14:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290004 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 14:14:58 -0000 Author: mav Date: Mon Oct 26 14:14:56 2015 New Revision: 290004 URL: https://svnweb.freebsd.org/changeset/base/290004 Log: Don't try to replicate mode pages not present on this device. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Oct 26 13:28:34 2015 (r290003) +++ head/sys/cam/ctl/ctl.c Mon Oct 26 14:14:56 2015 (r290004) @@ -927,6 +927,11 @@ ctl_isc_announce_mode(struct ctl_lun *lu } if (i == CTL_NUM_MODE_PAGES) return; + + /* Don't try to replicate pages not present on this device. */ + if (lun->mode_pages.index[i].page_data == NULL) + return; + bzero(&msg.mode, sizeof(msg.mode)); msg.hdr.msg_type = CTL_MSG_MODE_SYNC; msg.hdr.nexus.targ_port = initidx / CTL_MAX_INIT_PER_PORT; From owner-svn-src-head@freebsd.org Mon Oct 26 14:24:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48550A1C3EE for ; Mon, 26 Oct 2015 14:24:21 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (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 CA3B11722 for ; Mon, 26 Oct 2015 14:24:20 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wikq8 with SMTP id q8so167319729wik.1 for ; Mon, 26 Oct 2015 07:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=KJ6MVV+/sueZg1LRqrlTW3y2FXds2HhW7znnEH+YiQk=; b=L6Sgciy2gbBErX2RnLx9X3Er3GIo2b5WxhctgLgSU2PzIRkIV9uidv0klzaN1ndtg7 o+NZtqVWpw/v7RAcqTeaszznh4jq35msqTy61D4yBoPuxsXr7nlffHkaSY8tSmkhW3R7 au/8Qr+4smkVSEGx4ni49E/4mVNyaFpbLxUX23BlwE8nf4mM0avSRHfGGj+JypZFZost 08l7uHefcYLY/nCbJn/VVvHlnfJBSl4YZ+JO6LeqlqKLd95rgcLJrjrhMUIE7FCXomXA PYVsUGv5oZsR6Wc9OnGae22dyPPFlBy/JC9s/YjfE0q8c1ypbcNQKCyPZnfxT6dkdHvu PAmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=KJ6MVV+/sueZg1LRqrlTW3y2FXds2HhW7znnEH+YiQk=; b=EV0Gm0Mava6GbNKBokn4VmJRFEk3JzJPj1DVSnkvGq60qyD4p5+1xIgOqqIWrReTO/ D0EIsyvveLnPGKnvwZPyO3TMGx6aKAQ/1nOiEdi1Kbe7zNhyyk7GoR2q8daEfiMl3+Fg SrvliCnJFC9se+7aFTW9a/03nXWkJuKC8BchGy1fNaCkjFbH4J6eicamovQP5NE/6szA rnl4jNaDPEO0MUhcOSwudPLhf3rbMgC4DXzuRMRIBLgsOWE1/rx9iM3AyoJu3AhLSMe6 m4pbcJuTr0KVmVBktqaTP25BTEa5A83XC3uN3oVMvzlUG6zJ/7O0HUVtA9AbSy9EKVCb Qm0g== X-Gm-Message-State: ALoCoQlROPlbOG14NZw1WkBImjCPhY4KhgGvA8VRh6s5bmB2MB2vIQhzWJWiBzra0ZKAvzgKLMTZ MIME-Version: 1.0 X-Received: by 10.180.102.233 with SMTP id fr9mr15359484wib.59.1445869459114; Mon, 26 Oct 2015 07:24:19 -0700 (PDT) Received: by 10.194.240.226 with HTTP; Mon, 26 Oct 2015 07:24:19 -0700 (PDT) In-Reply-To: References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> <562E1F8F.3010304@FreeBSD.org> Date: Mon, 26 Oct 2015 15:24:19 +0100 Message-ID: Subject: Re: svn commit: r289834 - head/sys/x86/x86 From: Oliver Pinter To: Adrian Chadd Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 14:24:21 -0000 On 10/26/15, Adrian Chadd wrote: > Hi, > > I'll take a photo of it when it breaks next. > > Would you mind reverting it for now until we can figure it out? btw, this was the two kernel panic what I got: Fatal trap 12: page fault while in kernel mode cpuid =3D 11; apic id =3D 03 fault virtual address =3D 0x30 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff808a2d22 stack pointer =3D 0x28:0xfffffe07cc75a6f0 frame pointer =3D 0x28:0xfffffe07cc75a770 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 5 (doneq0) trap number =3D 12 panic: page fault cpuid =3D 11 KDB: stack backtrace: #0 0xffffffff80641647 at kdb_backtrace+0x67 #1 0xffffffff80606762 at vpanic+0x182 #2 0xffffffff806067e3 at panic+0x43 #3 0xffffffff8084eef1 at trap_fatal+0x351 #4 0xffffffff8084f0e4 at trap_pfault+0x1e4 #5 0xffffffff8084e82f at trap+0x4bf #6 0xffffffff80830d57 at calltrap+0x8 #7 0xffffffff8063beab at _bus_dmamap_load_ccb+0x1fb #8 0xffffffff8063bc51 at bus_dmamap_load_ccb+0x91 #9 0xffffffff8042dcad at ata_dmaload+0x11d #10 0xffffffff8042df7e at ata_begin_transaction+0x7e #11 0xffffffff8042c18e at ataaction+0x9ce #12 0xffffffff802a220f at xpt_run_devq+0x5bf #13 0xffffffff802a17ad at xpt_action_default+0x94d #14 0xffffffff802c0024 at adastart+0x8b4 #15 0xffffffff802a2e93 at xpt_run_allocq+0x193 #16 0xffffffff802c0ea0 at adadone+0x280 #17 0xffffffff802a5310 at xpt_done_process+0x3a0 Uptime: 1m40s Fatal trap 12: page fault while in kernel mode cpuid =3D 11; apic id =3D 03 fault virtual address =3D 0x30 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff808a2d22 stack pointer =3D 0x28:0xfffffe07cc737710 frame pointer =3D 0x28:0xfffffe07cc737790 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 13 (g_down) trap number =3D 12 panic: page fault cpuid =3D 11 KDB: stack backtrace: #0 0xffffffff80641647 at kdb_backtrace+0x67 #1 0xffffffff80606762 at vpanic+0x182 #2 0xffffffff806067e3 at panic+0x43 #3 0xffffffff8084eef1 at trap_fatal+0x351 #4 0xffffffff8084f0e4 at trap_pfault+0x1e4 #5 0xffffffff8084e82f at trap+0x4bf #6 0xffffffff80830d57 at calltrap+0x8 #7 0xffffffff8063beab at _bus_dmamap_load_ccb+0x1fb #8 0xffffffff8063bc51 at bus_dmamap_load_ccb+0x91 #9 0xffffffff8042dcad at ata_dmaload+0x11d #10 0xffffffff8042df7e at ata_begin_transaction+0x7e #11 0xffffffff8042c18e at ataaction+0x9ce #12 0xffffffff802a220f at xpt_run_devq+0x5bf #13 0xffffffff802a17ad at xpt_action_default+0x94d #14 0xffffffff802c0024 at adastart+0x8b4 #15 0xffffffff802a2e93 at xpt_run_allocq+0x193 #16 0xffffffff802c0735 at adastrategy+0xf5 #17 0xffffffff80554206 at g_disk_start+0x426 Uptime: 2m29s Extra info, it's a Dell R410, with 2x1TB disc in mirrored raidz + plus a gmirrored partition. > > > > -adrian > > > On 26 October 2015 at 05:53, Oliver Pinter > wrote: >> Hi Roger! >> >> On 10/26/15, Roger Pau Monn=C3=A9 wrote: >>> El 26/10/15 a les 13.24, Adrian Chadd ha escrit: >>>> Hi, >>>> >>>> I've started seeing panics on -head with ATA code doing a dmamap load >>>> -> panic. I'll test by reverting this patch and see what happens, but >>>> when it /does/ happen I can't get a crashdump, so debugging will be >>>> less easy. >>>> >>>> Has anyone else seen this? >>> >>> I've got another report regarding ATA page-faults from Oliver Pinter. >>> The crash he was seeing was caused by bus_dmamap_load_ccb, but the call= s >>> to the specific dma functions where optimized away. Can you figure out >>> which bounce_* function causes this specifically? >> >> I have already deleted the broken kernel, and I'm now running on >> kernel without this patch. >> >>> >>> Thanks, Roger. >>> >>> _______________________________________________ >>> 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 Oct 26 14:50:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6CC9A1C99D; Mon, 26 Oct 2015 14:50:37 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 7EB1A1386; Mon, 26 Oct 2015 14:50:37 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QEoa64099841; Mon, 26 Oct 2015 14:50:36 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QEoaxo099839; Mon, 26 Oct 2015 14:50:36 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201510261450.t9QEoaxo099839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 26 Oct 2015 14:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290005 - head/sys/dev/xen/blkfront head/sys/x86/x86 svnadmin/tools/checkacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 14:50:37 -0000 Author: royger Date: Mon Oct 26 14:50:35 2015 New Revision: 290005 URL: https://svnweb.freebsd.org/changeset/base/290005 Log: x86/dma_bounce: revert r289834 and r289836 The new load_ma implementation can cause dereferences when used with certain drivers, back it out until the reason is found: Fatal trap 12: page fault while in kernel mode cpuid = 11; apic id = 03 fault virtual address = 0x30 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff808a2d22 stack pointer = 0x28:0xfffffe07cc737710 frame pointer = 0x28:0xfffffe07cc737790 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 13 (g_down) trap number = 12 panic: page fault cpuid = 11 KDB: stack backtrace: #0 0xffffffff80641647 at kdb_backtrace+0x67 #1 0xffffffff80606762 at vpanic+0x182 #2 0xffffffff806067e3 at panic+0x43 #3 0xffffffff8084eef1 at trap_fatal+0x351 #4 0xffffffff8084f0e4 at trap_pfault+0x1e4 #5 0xffffffff8084e82f at trap+0x4bf #6 0xffffffff80830d57 at calltrap+0x8 #7 0xffffffff8063beab at _bus_dmamap_load_ccb+0x1fb #8 0xffffffff8063bc51 at bus_dmamap_load_ccb+0x91 #9 0xffffffff8042dcad at ata_dmaload+0x11d #10 0xffffffff8042df7e at ata_begin_transaction+0x7e #11 0xffffffff8042c18e at ataaction+0x9ce #12 0xffffffff802a220f at xpt_run_devq+0x5bf #13 0xffffffff802a17ad at xpt_action_default+0x94d #14 0xffffffff802c0024 at adastart+0x8b4 #15 0xffffffff802a2e93 at xpt_run_allocq+0x193 #16 0xffffffff802c0735 at adastrategy+0xf5 #17 0xffffffff80554206 at g_disk_start+0x426 Uptime: 2m29s Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/x86/x86/busdma_bounce.c Changes in other areas also in this revision: Modified: Directory Properties: svnadmin/tools/checkacl/Makefile (props changed) svnadmin/tools/checkacl/checkacl.c (props changed) vendor/ (props changed) Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Oct 26 14:14:56 2015 (r290004) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Oct 26 14:50:35 2015 (r290005) @@ -293,12 +293,8 @@ xbd_queue_request(struct xbd_softc *sc, { int error; - if (cm->cm_bp != NULL) - error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, - cm->cm_bp, xbd_queue_cb, cm, 0); - else - error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, - cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, + cm->cm_datalen, xbd_queue_cb, cm, 0); if (error == EINPROGRESS) { /* * Maintain queuing order by freezing the queue. The next @@ -358,6 +354,8 @@ xbd_bio_command(struct xbd_softc *sc) } cm->cm_bp = bp; + cm->cm_data = bp->bio_data; + cm->cm_datalen = bp->bio_bcount; cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; switch (bp->bio_cmd) { @@ -1011,7 +1009,7 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; + sc->xbd_disk->d_flags = 0; if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; device_printf(sc->xbd_dev, Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Mon Oct 26 14:14:56 2015 (r290004) +++ head/sys/x86/x86/busdma_bounce.c Mon Oct 26 14:50:35 2015 (r290005) @@ -79,8 +79,8 @@ struct bounce_page { vm_offset_t vaddr; /* kva of bounce buffer */ bus_addr_t busaddr; /* Physical address */ vm_offset_t datavaddr; /* kva of client data */ + vm_page_t datapage; /* physical page of client data */ vm_offset_t dataoffs; /* page offset of client data */ - vm_page_t datapage[2]; /* physical page(s) of client data */ bus_size_t datacount; /* client data count */ STAILQ_ENTRY(bounce_page) links; }; @@ -135,8 +135,8 @@ static int alloc_bounce_pages(bus_dma_ta static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_addr_t addr1, - bus_addr_t addr2, bus_size_t size); + vm_offset_t vaddr, bus_addr_t addr, + bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, @@ -527,51 +527,6 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm } } -static void -_bus_dmamap_count_ma(bus_dma_tag_t dmat, bus_dmamap_t map, struct vm_page **ma, - int ma_offs, bus_size_t buflen, int flags) -{ - bus_size_t sg_len, max_sgsize; - int page_index; - vm_paddr_t paddr; - - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { - CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " - "alignment= %d", dmat->common.lowaddr, - ptoa((vm_paddr_t)Maxmem), - dmat->common.boundary, dmat->common.alignment); - CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", - map, &nobounce_dmamap, map->pagesneeded); - - /* - * Count the number of bounce pages - * needed in order to complete this transfer - */ - page_index = 0; - while (buflen > 0) { - paddr = ma[page_index]->phys_addr + ma_offs; - sg_len = PAGE_SIZE - ma_offs; - max_sgsize = MIN(buflen, dmat->common.maxsegsz); - sg_len = MIN(sg_len, max_sgsize); - if (bus_dma_run_filter(&dmat->common, paddr) != 0) { - sg_len = roundup2(sg_len, - dmat->common.alignment); - sg_len = MIN(sg_len, max_sgsize); - KASSERT((sg_len & (dmat->common.alignment - 1)) - == 0, ("Segment size is not aligned")); - map->pagesneeded++; - } - if (((ma_offs + sg_len) & ~PAGE_MASK) != 0) - page_index++; - ma_offs = (ma_offs + sg_len) & PAGE_MASK; - KASSERT(buflen >= sg_len, - ("Segment length overruns original buffer")); - buflen -= sg_len; - } - CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); - } -} - static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) { @@ -677,7 +632,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); - curaddr = add_bounce_page(dmat, map, 0, curaddr, 0, + curaddr = add_bounce_page(dmat, map, 0, curaddr, sgsize); } sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, @@ -746,7 +701,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); sgsize = MIN(sgsize, max_sgsize); - curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, 0, + curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, sgsize); } else { sgsize = MIN(sgsize, max_sgsize); @@ -765,90 +720,6 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } -static int -bounce_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, - struct vm_page **ma, bus_size_t buflen, int ma_offs, int flags, - bus_dma_segment_t *segs, int *segp) -{ - vm_paddr_t paddr, next_paddr; - int error, page_index; - struct vm_page *page; - bus_size_t sgsize, max_sgsize; - - if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { - /* - * If we have to keep the offset of each page this function - * is not suitable, switch back to bus_dmamap_load_ma_triv - * which is going to do the right thing in this case. - */ - error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs, - flags, segs, segp); - return (error); - } - - if (map == NULL) - map = &nobounce_dmamap; - - if (segs == NULL) - segs = dmat->segments; - - if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { - _bus_dmamap_count_ma(dmat, map, ma, ma_offs, buflen, flags); - if (map->pagesneeded != 0) { - error = _bus_dmamap_reserve_pages(dmat, map, flags); - if (error) - return (error); - } - } - - page_index = 0; - page = ma[0]; - while (buflen > 0) { - /* - * Compute the segment size, and adjust counts. - */ - page = ma[page_index]; - paddr = page->phys_addr + ma_offs; - max_sgsize = MIN(buflen, dmat->common.maxsegsz); - sgsize = PAGE_SIZE - ma_offs; - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && - map->pagesneeded != 0 && - bus_dma_run_filter(&dmat->common, paddr)) { - sgsize = roundup2(sgsize, dmat->common.alignment); - sgsize = MIN(sgsize, max_sgsize); - KASSERT((sgsize & (dmat->common.alignment - 1)) == 0, - ("Segment size is not aligned")); - /* - * Check if two pages of the user provided buffer - * are used. - */ - if (((ma_offs + sgsize) & ~PAGE_MASK) != 0) - next_paddr = ma[page_index + 1]->phys_addr; - else - next_paddr = 0; - paddr = add_bounce_page(dmat, map, 0, paddr, - next_paddr, sgsize); - } else { - sgsize = MIN(sgsize, max_sgsize); - } - sgsize = _bus_dmamap_addseg(dmat, map, paddr, sgsize, segs, - segp); - if (sgsize == 0) - break; - KASSERT(buflen >= sgsize, - ("Segment length overruns original buffer")); - buflen -= sgsize; - if (((ma_offs + sgsize) & ~PAGE_MASK) != 0) - page_index++; - ma_offs = (ma_offs + sgsize) & PAGE_MASK; - } - - /* - * Did we fit? - */ - return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ -} - static void bounce_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) @@ -892,7 +763,6 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma { struct bounce_page *bpage; vm_offset_t datavaddr, tempvaddr; - bus_size_t datacount1, datacount2; if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL) return; @@ -908,35 +778,17 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma while (bpage != NULL) { tempvaddr = 0; datavaddr = bpage->datavaddr; - datacount1 = bpage->datacount; if (datavaddr == 0) { tempvaddr = - pmap_quick_enter_page(bpage->datapage[0]); + pmap_quick_enter_page(bpage->datapage); datavaddr = tempvaddr | bpage->dataoffs; - datacount1 = min(PAGE_SIZE - bpage->dataoffs, - datacount1); } bcopy((void *)datavaddr, - (void *)bpage->vaddr, datacount1); + (void *)bpage->vaddr, bpage->datacount); if (tempvaddr != 0) pmap_quick_remove_page(tempvaddr); - - if (bpage->datapage[1] == 0) - goto next_w; - - /* - * We are dealing with an unmapped buffer that expands - * over two pages. - */ - datavaddr = pmap_quick_enter_page(bpage->datapage[1]); - datacount2 = bpage->datacount - datacount1; - bcopy((void *)datavaddr, - (void *)(bpage->vaddr + datacount1), datacount2); - pmap_quick_remove_page(datavaddr); - -next_w: bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -946,35 +798,17 @@ next_w: while (bpage != NULL) { tempvaddr = 0; datavaddr = bpage->datavaddr; - datacount1 = bpage->datacount; if (datavaddr == 0) { tempvaddr = - pmap_quick_enter_page(bpage->datapage[0]); + pmap_quick_enter_page(bpage->datapage); datavaddr = tempvaddr | bpage->dataoffs; - datacount1 = min(PAGE_SIZE - bpage->dataoffs, - datacount1); } - bcopy((void *)bpage->vaddr, (void *)datavaddr, - datacount1); + bcopy((void *)bpage->vaddr, + (void *)datavaddr, bpage->datacount); if (tempvaddr != 0) pmap_quick_remove_page(tempvaddr); - - if (bpage->datapage[1] == 0) - goto next_r; - - /* - * We are dealing with an unmapped buffer that expands - * over two pages. - */ - datavaddr = pmap_quick_enter_page(bpage->datapage[1]); - datacount2 = bpage->datacount - datacount1; - bcopy((void *)(bpage->vaddr + datacount1), - (void *)datavaddr, datacount2); - pmap_quick_remove_page(datavaddr); - -next_r: bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -1138,7 +972,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_addr_t addr1, bus_addr_t addr2, bus_size_t size) + bus_addr_t addr, bus_size_t size) { struct bounce_zone *bz; struct bounce_page *bpage; @@ -1168,16 +1002,12 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= addr1 & PAGE_MASK; - bpage->busaddr |= addr1 & PAGE_MASK; - KASSERT(addr2 == 0, - ("Trying to bounce multiple pages with BUS_DMA_KEEP_PG_OFFSET")); + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; - bpage->datapage[0] = PHYS_TO_VM_PAGE(addr1); - KASSERT((addr2 & PAGE_MASK) == 0, ("Second page is not aligned")); - bpage->datapage[1] = PHYS_TO_VM_PAGE(addr2); - bpage->dataoffs = addr1 & PAGE_MASK; + bpage->datapage = PHYS_TO_VM_PAGE(addr); + bpage->dataoffs = addr & PAGE_MASK; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); return (bpage->busaddr); @@ -1249,7 +1079,7 @@ struct bus_dma_impl bus_dma_bounce_impl .mem_free = bounce_bus_dmamem_free, .load_phys = bounce_bus_dmamap_load_phys, .load_buffer = bounce_bus_dmamap_load_buffer, - .load_ma = bounce_bus_dmamap_load_ma, + .load_ma = bus_dmamap_load_ma_triv, .map_waitok = bounce_bus_dmamap_waitok, .map_complete = bounce_bus_dmamap_complete, .map_unload = bounce_bus_dmamap_unload, From owner-svn-src-head@freebsd.org Mon Oct 26 15:03:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA86A1CD92; Mon, 26 Oct 2015 15:03:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C9D4B1E41; Mon, 26 Oct 2015 15:03:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA03597; Mon, 26 Oct 2015 17:03:06 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ZqjIf-000FhQ-QZ; Mon, 26 Oct 2015 17:03:05 +0200 Subject: Re: svn commit: r290005 - head/sys/dev/xen/blkfront head/sys/x86/x86 svnadmin/tools/checkacl To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201510261450.t9QEoaxo099839@repo.freebsd.org> From: Andriy Gapon Message-ID: <562E4085.4080007@FreeBSD.org> Date: Mon, 26 Oct 2015 17:02:29 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510261450.t9QEoaxo099839@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:03:11 -0000 On 26/10/2015 16:50, Roger Pau MonnĂ© wrote: > Changes in other areas also in this revision: > Modified: > Directory Properties: > svnadmin/tools/checkacl/Makefile (props changed) > svnadmin/tools/checkacl/checkacl.c (props changed) > vendor/ (props changed) Seems like those shouldn't have been committed... -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Oct 26 15:09:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88966A1CFF5; Mon, 26 Oct 2015 15:09:20 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (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 2D1E91317; Mon, 26 Oct 2015 15:09:20 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wicfx6 with SMTP id fx6so118641875wic.1; Mon, 26 Oct 2015 08:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=DZrTk0slCen0vReJ3h/BOlC1Qj7hjDJpv9ti8swepvA=; b=ho10k2XR/HO7wB9XiThL7m/SXKpf1zQg2OO1jX6Zg0vlmkDSkpk1ozu10VX7FzgGwZ qR/D8g8gW7iY2UFM3YqqB8G9L5bS7dOEiASCSsrXA+G40hA3t8P8/MrzA7CrQUqRnOdt hZLqWAFxUWo3okeXKJ7aPhhQx/qDkHpSXyprtop2tRQZ8JDJEpAcMj/87CmvFjTvUYt5 Vrv9HTEtuLkhabecactdbUrBjKdo4SzbeuMXkfV93xzQW56IvvH6FxMQ8pcJs7JyvJ0c XpcXd9V2aRIU+aSzbvdnMgrFFfkZWjoEadpUdNgtRmEDRbDlPB127Fqz7KF9T+2aS1gv Mi2A== X-Received: by 10.180.206.174 with SMTP id lp14mr22758226wic.55.1445872158642; Mon, 26 Oct 2015 08:09:18 -0700 (PDT) Received: from [192.168.1.130] (43.Red-88-12-33.staticIP.rima-tde.net. [88.12.33.43]) by smtp.gmail.com with ESMTPSA id m135sm2635206wmb.0.2015.10.26.08.09.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2015 08:09:18 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r290005 - head/sys/dev/xen/blkfront head/sys/x86/x86 svnadmin/tools/checkacl To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201510261450.t9QEoaxo099839@repo.freebsd.org> <562E4085.4080007@FreeBSD.org> From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Message-ID: <562E4225.4040807@FreeBSD.org> Date: Mon, 26 Oct 2015 16:09:25 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562E4085.4080007@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:09:20 -0000 El 26/10/15 a les 16.02, Andriy Gapon ha escrit: > On 26/10/2015 16:50, Roger Pau MonnĂ© wrote: >> Changes in other areas also in this revision: >> Modified: >> Directory Properties: >> svnadmin/tools/checkacl/Makefile (props changed) >> svnadmin/tools/checkacl/checkacl.c (props changed) >> vendor/ (props changed) > > Seems like those shouldn't have been committed... Yes, something went wrong while doing the revert. For the record, I did the following inside of the head/ folder: $ svn merge -c -289834,-289836 . $ svn diff $ svn ci I did a pre-commit diff, but props changes are not shown there. Roger. From owner-svn-src-head@freebsd.org Mon Oct 26 15:14:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4171DA1D18A; Mon, 26 Oct 2015 15:14:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AE9A186F; Mon, 26 Oct 2015 15:14:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QFEHeV008345; Mon, 26 Oct 2015 15:14:17 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QFEHu9008344; Mon, 26 Oct 2015 15:14:17 GMT (envelope-from des@FreeBSD.org) Message-Id: <201510261514.t9QFEHu9008344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 26 Oct 2015 15:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290006 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:14:18 -0000 Author: des Date: Mon Oct 26 15:14:16 2015 New Revision: 290006 URL: https://svnweb.freebsd.org/changeset/base/290006 Log: Loading rc.subr and rc.conf has no effect since all we do is run other scripts which load them again. MFC after: 3 weeks Modified: head/etc/netstart Modified: head/etc/netstart ============================================================================== --- head/etc/netstart Mon Oct 26 14:50:35 2015 (r290005) +++ head/etc/netstart Mon Oct 26 15:14:16 2015 (r290006) @@ -34,9 +34,6 @@ # the network by hand, this script will do it for you). # -. /etc/rc.subr - -load_rc_config 'XXX' _start=quietstart /etc/rc.d/devd ${_start} From owner-svn-src-head@freebsd.org Mon Oct 26 15:14:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C8B8A1D1D2; Mon, 26 Oct 2015 15:14:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1685819CB; Mon, 26 Oct 2015 15:14:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QFEujS008415; Mon, 26 Oct 2015 15:14:56 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QFEuWu008414; Mon, 26 Oct 2015 15:14:56 GMT (envelope-from des@FreeBSD.org) Message-Id: <201510261514.t9QFEuWu008414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 26 Oct 2015 15:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290007 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:14:57 -0000 Author: des Date: Mon Oct 26 15:14:55 2015 New Revision: 290007 URL: https://svnweb.freebsd.org/changeset/base/290007 Log: Correctly document the change made in r275359. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Mon Oct 26 15:14:16 2015 (r290006) +++ head/etc/rc.subr Mon Oct 26 15:14:55 2015 (r290007) @@ -1316,8 +1316,10 @@ run_rc_script() } # -# load_rc_config name -# Source in the configuration file for a given name. +# load_rc_config [service] +# Source in the configuration file(s) for a given service. +# If no service is specified, only the global configuration +# file(s) will be loaded. # load_rc_config() { From owner-svn-src-head@freebsd.org Mon Oct 26 15:16:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1478A1D233; Mon, 26 Oct 2015 15:16:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9281B33; Mon, 26 Oct 2015 15:16:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QFGREL008511; Mon, 26 Oct 2015 15:16:27 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QFGRFm008509; Mon, 26 Oct 2015 15:16:27 GMT (envelope-from des@FreeBSD.org) Message-Id: <201510261516.t9QFGRFm008509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 26 Oct 2015 15:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290008 - in head/etc: . rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:16:28 -0000 Author: des Date: Mon Oct 26 15:16:27 2015 New Revision: 290008 URL: https://svnweb.freebsd.org/changeset/base/290008 Log: Since r275359, there is no need to provide a bogus service name. MFC after: 3 weeks Modified: head/etc/rc.d/othermta head/etc/rc.shutdown Modified: head/etc/rc.d/othermta ============================================================================== --- head/etc/rc.d/othermta Mon Oct 26 15:14:55 2015 (r290007) +++ head/etc/rc.d/othermta Mon Oct 26 15:16:27 2015 (r290008) @@ -10,7 +10,7 @@ # . /etc/rc.subr -load_rc_config 'XXX' +load_rc_config if [ -n "${mta_start_script}" ]; then [ "${mta_start_script}" != "/etc/rc.sendmail" ] && \ Modified: head/etc/rc.shutdown ============================================================================== --- head/etc/rc.shutdown Mon Oct 26 15:14:55 2015 (r290007) +++ head/etc/rc.shutdown Mon Oct 26 15:16:27 2015 (r290008) @@ -45,7 +45,7 @@ export HOME PATH . /etc/rc.subr -load_rc_config 'XXX' +load_rc_config # reverse_list list # print the list in reverse order From owner-svn-src-head@freebsd.org Mon Oct 26 15:43:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744C5814B; Mon, 26 Oct 2015 15:43:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA791084; Mon, 26 Oct 2015 15:43:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QFh8xY017313; Mon, 26 Oct 2015 15:43:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QFh8QB017312; Mon, 26 Oct 2015 15:43:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201510261543.t9QFh8QB017312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 26 Oct 2015 15:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290012 - in head/contrib/ntp: html/drivers include libjsmn/example libntp ntpd scripts/update-leap sntp sntp/ag-tpl sntp/libpkgver sntp/tests sntp/unity sntp/unity/auto tests/bug-2803 ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:43:09 -0000 Author: glebius Date: Mon Oct 26 15:43:08 2015 New Revision: 290012 URL: https://svnweb.freebsd.org/changeset/base/290012 Log: Remove svn:keywords that leaked in. Modified: Directory Properties: head/contrib/ntp/html/drivers/driver40-ja.html (props changed) head/contrib/ntp/include/refidsmear.h (props changed) head/contrib/ntp/libjsmn/example/jsondump.c (props changed) head/contrib/ntp/libjsmn/example/simple.c (props changed) head/contrib/ntp/libntp/refidsmear.c (props changed) head/contrib/ntp/ntpd/rc_cmdlength.c (props changed) head/contrib/ntp/scripts/update-leap/Makefile.am (props changed) head/contrib/ntp/scripts/update-leap/Makefile.in (props changed) head/contrib/ntp/scripts/update-leap/update-leap.html (props changed) head/contrib/ntp/scripts/update-leap/update-leap.in (props changed) head/contrib/ntp/scripts/update-leap/update-leap.man.in (props changed) head/contrib/ntp/scripts/update-leap/update-leap.mdoc.in (props changed) head/contrib/ntp/scripts/update-leap/update-leap.sh (props changed) head/contrib/ntp/sntp/ag-tpl/Mdoc.pm (props changed) head/contrib/ntp/sntp/libpkgver/colcomp.c (props changed) head/contrib/ntp/sntp/libpkgver/pkgver.h (props changed) head/contrib/ntp/sntp/tests/crypto.c (props changed) head/contrib/ntp/sntp/tests/fileHandlingTest.h.in (props changed) head/contrib/ntp/sntp/tests/keyFile.c (props changed) head/contrib/ntp/sntp/tests/kodDatabase.c (props changed) head/contrib/ntp/sntp/tests/kodFile.c (props changed) head/contrib/ntp/sntp/tests/networking.c (props changed) head/contrib/ntp/sntp/tests/packetHandling.c (props changed) head/contrib/ntp/sntp/tests/packetProcessing.c (props changed) head/contrib/ntp/sntp/tests/run-crypto.c (props changed) head/contrib/ntp/sntp/tests/run-keyFile.c (props changed) head/contrib/ntp/sntp/tests/run-kodDatabase.c (props changed) head/contrib/ntp/sntp/tests/run-kodFile.c (props changed) head/contrib/ntp/sntp/tests/run-networking.c (props changed) head/contrib/ntp/sntp/tests/run-packetHandling.c (props changed) head/contrib/ntp/sntp/tests/run-packetProcessing.c (props changed) head/contrib/ntp/sntp/tests/run-utilities.c (props changed) head/contrib/ntp/sntp/tests/utilities.c (props changed) head/contrib/ntp/sntp/unity/Makefile.am (props changed) head/contrib/ntp/sntp/unity/Makefile.in (props changed) head/contrib/ntp/sntp/unity/auto/colour_prompt.rb (props changed) head/contrib/ntp/sntp/unity/auto/colour_reporter.rb (props changed) head/contrib/ntp/sntp/unity/auto/generate_module.rb (props changed) head/contrib/ntp/sntp/unity/auto/generate_test_runner.rb (props changed) head/contrib/ntp/sntp/unity/auto/runner_maybe.c (props changed) head/contrib/ntp/sntp/unity/auto/test_file_filter.rb (props changed) head/contrib/ntp/sntp/unity/auto/unity_test_summary.rb (props changed) head/contrib/ntp/sntp/unity/unity.c (props changed) head/contrib/ntp/sntp/unity/unity.h (props changed) head/contrib/ntp/sntp/unity/unity_fixture.c (props changed) head/contrib/ntp/sntp/unity/unity_fixture.h (props changed) head/contrib/ntp/sntp/unity/unity_fixture_internals.h (props changed) head/contrib/ntp/sntp/unity/unity_fixture_malloc_overrides.h (props changed) head/contrib/ntp/sntp/unity/unity_internals.h (props changed) head/contrib/ntp/sntp/version.c (props changed) head/contrib/ntp/tests/bug-2803/Makefile.am (props changed) head/contrib/ntp/tests/bug-2803/Makefile.in (props changed) head/contrib/ntp/tests/bug-2803/bug-2803.c (props changed) head/contrib/ntp/tests/bug-2803/run-bug-2803.c (props changed) head/contrib/ntp/tests/libntp/a_md5encrypt.c (props changed) head/contrib/ntp/tests/libntp/atoint.c (props changed) head/contrib/ntp/tests/libntp/atouint.c (props changed) head/contrib/ntp/tests/libntp/authkeys.c (props changed) head/contrib/ntp/tests/libntp/buftvtots.c (props changed) head/contrib/ntp/tests/libntp/calendar.c (props changed) head/contrib/ntp/tests/libntp/caljulian.c (props changed) head/contrib/ntp/tests/libntp/caltontp.c (props changed) head/contrib/ntp/tests/libntp/calyearstart.c (props changed) head/contrib/ntp/tests/libntp/clocktime.c (props changed) head/contrib/ntp/tests/libntp/decodenetnum.c (props changed) head/contrib/ntp/tests/libntp/hextoint.c (props changed) head/contrib/ntp/tests/libntp/hextolfp.c (props changed) head/contrib/ntp/tests/libntp/humandate.c (props changed) head/contrib/ntp/tests/libntp/lfpfunc.c (props changed) head/contrib/ntp/tests/libntp/lfptostr.c (props changed) head/contrib/ntp/tests/libntp/modetoa.c (props changed) head/contrib/ntp/tests/libntp/msyslog.c (props changed) head/contrib/ntp/tests/libntp/netof.c (props changed) head/contrib/ntp/tests/libntp/numtoa.c (props changed) head/contrib/ntp/tests/libntp/numtohost.c (props changed) head/contrib/ntp/tests/libntp/octtoint.c (props changed) head/contrib/ntp/tests/libntp/prettydate.c (props changed) head/contrib/ntp/tests/libntp/recvbuff.c (props changed) head/contrib/ntp/tests/libntp/refidsmear.c (props changed) head/contrib/ntp/tests/libntp/refnumtoa.c (props changed) head/contrib/ntp/tests/libntp/run-a_md5encrypt.c (props changed) head/contrib/ntp/tests/libntp/run-atoint.c (props changed) head/contrib/ntp/tests/libntp/run-atouint.c (props changed) head/contrib/ntp/tests/libntp/run-authkeys.c (props changed) head/contrib/ntp/tests/libntp/run-buftvtots.c (props changed) head/contrib/ntp/tests/libntp/run-calendar.c (props changed) head/contrib/ntp/tests/libntp/run-caljulian.c (props changed) head/contrib/ntp/tests/libntp/run-caltontp.c (props changed) head/contrib/ntp/tests/libntp/run-calyearstart.c (props changed) head/contrib/ntp/tests/libntp/run-clocktime.c (props changed) head/contrib/ntp/tests/libntp/run-decodenetnum.c (props changed) head/contrib/ntp/tests/libntp/run-hextoint.c (props changed) head/contrib/ntp/tests/libntp/run-hextolfp.c (props changed) head/contrib/ntp/tests/libntp/run-humandate.c (props changed) head/contrib/ntp/tests/libntp/run-lfpfunc.c (props changed) head/contrib/ntp/tests/libntp/run-lfptostr.c (props changed) head/contrib/ntp/tests/libntp/run-modetoa.c (props changed) head/contrib/ntp/tests/libntp/run-msyslog.c (props changed) head/contrib/ntp/tests/libntp/run-netof.c (props changed) head/contrib/ntp/tests/libntp/run-numtoa.c (props changed) head/contrib/ntp/tests/libntp/run-numtohost.c (props changed) head/contrib/ntp/tests/libntp/run-octtoint.c (props changed) head/contrib/ntp/tests/libntp/run-prettydate.c (props changed) head/contrib/ntp/tests/libntp/run-recvbuff.c (props changed) head/contrib/ntp/tests/libntp/run-refidsmear.c (props changed) head/contrib/ntp/tests/libntp/run-refnumtoa.c (props changed) head/contrib/ntp/tests/libntp/run-sfptostr.c (props changed) head/contrib/ntp/tests/libntp/run-socktoa.c (props changed) head/contrib/ntp/tests/libntp/run-ssl_init.c (props changed) head/contrib/ntp/tests/libntp/run-statestr.c (props changed) head/contrib/ntp/tests/libntp/run-strtolfp.c (props changed) head/contrib/ntp/tests/libntp/run-timespecops.c (props changed) head/contrib/ntp/tests/libntp/run-timevalops.c (props changed) head/contrib/ntp/tests/libntp/run-tstotv.c (props changed) head/contrib/ntp/tests/libntp/run-tvtots.c (props changed) head/contrib/ntp/tests/libntp/run-uglydate.c (props changed) head/contrib/ntp/tests/libntp/run-vi64ops.c (props changed) head/contrib/ntp/tests/libntp/run-ymd2yd.c (props changed) head/contrib/ntp/tests/libntp/sfptostr.c (props changed) head/contrib/ntp/tests/libntp/socktoa.c (props changed) head/contrib/ntp/tests/libntp/ssl_init.c (props changed) head/contrib/ntp/tests/libntp/statestr.c (props changed) head/contrib/ntp/tests/libntp/strtolfp.c (props changed) head/contrib/ntp/tests/libntp/test-libntp.c (props changed) head/contrib/ntp/tests/libntp/test-libntp.h (props changed) head/contrib/ntp/tests/libntp/timespecops.c (props changed) head/contrib/ntp/tests/libntp/timevalops.c (props changed) head/contrib/ntp/tests/libntp/tstotv.c (props changed) head/contrib/ntp/tests/libntp/tvtots.c (props changed) head/contrib/ntp/tests/libntp/uglydate.c (props changed) head/contrib/ntp/tests/libntp/vi64ops.c (props changed) head/contrib/ntp/tests/libntp/ymd2yd.c (props changed) head/contrib/ntp/tests/sandbox/Makefile.am (props changed) head/contrib/ntp/tests/sandbox/Makefile.in (props changed) head/contrib/ntp/tests/sandbox/bug-2803.c (props changed) head/contrib/ntp/tests/sandbox/modetoa.c (props changed) head/contrib/ntp/tests/sandbox/run-modetoa.c (props changed) head/contrib/ntp/tests/sandbox/run-uglydate.c (props changed) head/contrib/ntp/tests/sandbox/run-ut-2803.c (props changed) head/contrib/ntp/tests/sandbox/smeartest.c (props changed) head/contrib/ntp/tests/sandbox/uglydate.c (props changed) head/contrib/ntp/tests/sandbox/ut-2803.c (props changed) head/contrib/ntp/tests/sec-2853/Makefile.am (props changed) head/contrib/ntp/tests/sec-2853/Makefile.in (props changed) head/contrib/ntp/tests/sec-2853/run-sec-2853.c (props changed) head/contrib/ntp/tests/sec-2853/sec-2853.c (props changed) From owner-svn-src-head@freebsd.org Mon Oct 26 15:55:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9890C85CE; Mon, 26 Oct 2015 15:55:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 231DD1A83; Mon, 26 Oct 2015 15:55:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t9QFtP0S033886 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 26 Oct 2015 18:55:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t9QFtPVF033885; Mon, 26 Oct 2015 18:55:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 26 Oct 2015 18:55:25 +0300 From: Gleb Smirnoff To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r290005 - head/sys/dev/xen/blkfront head/sys/x86/x86 svnadmin/tools/checkacl Message-ID: <20151026155525.GJ97830@FreeBSD.org> References: <201510261450.t9QEoaxo099839@repo.freebsd.org> <562E4085.4080007@FreeBSD.org> <562E4225.4040807@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <562E4225.4040807@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:55:29 -0000 On Mon, Oct 26, 2015 at 04:09:25PM +0100, Roger Pau Monné wrote: R> El 26/10/15 a les 16.02, Andriy Gapon ha escrit: R> > On 26/10/2015 16:50, Roger Pau Monné wrote: R> >> Changes in other areas also in this revision: R> >> Modified: R> >> Directory Properties: R> >> svnadmin/tools/checkacl/Makefile (props changed) R> >> svnadmin/tools/checkacl/checkacl.c (props changed) R> >> vendor/ (props changed) R> > R> > Seems like those shouldn't have been committed... R> R> Yes, something went wrong while doing the revert. For the record, I did R> the following inside of the head/ folder: R> R> $ svn merge -c -289834,-289836 . R> $ svn diff R> $ svn ci R> R> I did a pre-commit diff, but props changes are not shown there. Merging is quite a weird way of reverting. IMO should be: svn diff -c 289836 | svn patch --reverse-diff svn diff -c 289834 | svn patch --reverse-diff -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Oct 26 15:57:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B63486CA; Mon, 26 Oct 2015 15:57:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B85E11D07; Mon, 26 Oct 2015 15:57:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t9QFvHOc033904 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 26 Oct 2015 18:57:17 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t9QFvHFf033903; Mon, 26 Oct 2015 18:57:17 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 26 Oct 2015 18:57:17 +0300 From: Gleb Smirnoff To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282145 - head/etc/rc.d Message-ID: <20151026155717.GK97830@FreeBSD.org> References: <201504281313.t3SDDOr1074557@svn.freebsd.org> <5B403542-1277-4D18-9B4B-92A1EA1A6F96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5B403542-1277-4D18-9B4B-92A1EA1A6F96@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:57:21 -0000 Garrett, On Sat, Oct 24, 2015 at 09:51:01PM -0700, NGie Cooper wrote: N> > Author: glebius N> > Date: Tue Apr 28 13:13:23 2015 N> > New Revision: 282145 N> > URL: https://svnweb.freebsd.org/changeset/base/282145 N> > N> > Log: N> > Require "ldconfig" for "devd". It is possible that user puts into N> > devd.conf execution of third-party software, that needs libraries N> > from /usr/local. Since devd is launched before ldconfig script, if N> > the hardware that has associated software is attached on boot, then N> > execution would fail. N> > N> > Differential Revision: https://reviews.freebsd.org/D2332 N> > Reviewed by: imp N> N> This broke rcorder. With my custom knobs it breaks with: N> N> rcorder: Circular dependency on provision `ldconfig' in file `devd’. N> N> With the defaults knobs, it breaks like this: N> N> rcorder: Circular dependency on provision `mountcritremote' in file `ldconfig'. N> N> Repro: N> N> (cd /usr/src/etc/rc.d; rcorder `SRCCONF=/dev/null make -VFILES` 2>&1) I've seen the bug in the bugzilla. Thanks for taking it, Garrett. It is definitely not an easy one. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Oct 26 15:58:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B37F8758 for ; Mon, 26 Oct 2015 15:58:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (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 D171D1E7E for ; Mon, 26 Oct 2015 15:58:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by wikq8 with SMTP id q8so171351486wik.1 for ; Mon, 26 Oct 2015 08:58:15 -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:content-type:content-transfer-encoding; bh=So+de1am7SnQNMxUSJShmAhjhIngDDgQjYgV6UEEJRo=; b=eOlpZA5pxkfM4ofoDZIppgObStVQUZoS1yFXtt/HUSfsgmYkCvApfE9H4pjopL3m9Z yB+YUTAWZxVZ1BukRhf7r5icFMNF5TTvNy+7NMSnUMm0L6IPDCPZ6z7tHEtZvuFTCJRC 3dep4ET5hcMuuXLOFoWRCu4t8VQrY0RI04rPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=So+de1am7SnQNMxUSJShmAhjhIngDDgQjYgV6UEEJRo=; b=OaC+agFWenoRgMoEysGFq9M83bUtlvZWl2TntOs5RBfN/CcOs6/S8/7ss+dK4GpmoG tmmUPCoIKPsgG4wdKnFNzIDDCQ4FBCPseJyuHxzi4/XRNpBWmkdXr+5i/R49RJ8gOocN Xi3g9RV2nhYS/S50e62xZ89mxJ8HxtCyPyWeMkwdJbxjB6ldaif0XZstIbSkNXujCQwz ZxnRz5RcILYM7OHvaeu9w6TgC4wOq1VfB30iVq9nn0nOzEu+4w72ppdGPGz04WZwYgfs XdresW9UVA2ZlOLiqII5rhh+zxWnWheR+l6YLZ6iHH/AKcfGjRMU6tOSFW8dI1/ARNpO V/Kg== X-Gm-Message-State: ALoCoQmgsvs+ouOis11NReVCLHloCCd7UJGxbB5t7k3S13Dsm1BnxMZPwaQwOePfdjdy9KJVdCB9 X-Received: by 10.180.206.212 with SMTP id lq20mr19966301wic.90.1445875094808; Mon, 26 Oct 2015 08:58:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.136.143 with HTTP; Mon, 26 Oct 2015 08:57:45 -0700 (PDT) In-Reply-To: <20151026155525.GJ97830@FreeBSD.org> References: <201510261450.t9QEoaxo099839@repo.freebsd.org> <562E4085.4080007@FreeBSD.org> <562E4225.4040807@FreeBSD.org> <20151026155525.GJ97830@FreeBSD.org> From: Eitan Adler Date: Mon, 26 Oct 2015 08:57:45 -0700 Message-ID: Subject: Re: svn commit: r290005 - head/sys/dev/xen/blkfront head/sys/x86/x86 svnadmin/tools/checkacl To: Gleb Smirnoff Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 15:58:17 -0000 On 26 October 2015 at 08:55, Gleb Smirnoff wrote: > On Mon, Oct 26, 2015 at 04:09:25PM +0100, Roger Pau Monn=C3=A9 wrote: > R> El 26/10/15 a les 16.02, Andriy Gapon ha escrit: > R> > On 26/10/2015 16:50, Roger Pau Monn=C3=A9 wrote: > R> >> Changes in other areas also in this revision: > R> >> Modified: > R> >> Directory Properties: > R> >> svnadmin/tools/checkacl/Makefile (props changed) > R> >> svnadmin/tools/checkacl/checkacl.c (props changed) > R> >> vendor/ (props changed) > R> > > R> > Seems like those shouldn't have been committed... > R> > R> Yes, something went wrong while doing the revert. For the record, I di= d > R> the following inside of the head/ folder: > R> > R> $ svn merge -c -289834,-289836 . > R> $ svn diff > R> $ svn ci > R> > R> I did a pre-commit diff, but props changes are not shown there. > > Merging is quite a weird way of reverting. IMO should be: Merging with a negative diff is the correct way of reverting. Using 'svn patch' loses information. --=20 Eitan Adler From owner-svn-src-head@freebsd.org Mon Oct 26 17:07:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED29CA1E928; Mon, 26 Oct 2015 17:07:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id C61AA1500; Mon, 26 Oct 2015 17:07:23 +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 t9QH7MVo040813; Mon, 26 Oct 2015 17:07:22 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QH7MsT040811; Mon, 26 Oct 2015 17:07:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201510261707.t9QH7MsT040811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 26 Oct 2015 17:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290015 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 17:07:24 -0000 Author: allanjude Date: Mon Oct 26 17:07:22 2015 New Revision: 290015 URL: https://svnweb.freebsd.org/changeset/base/290015 Log: Allow 'zfs holds -r' to recurse over a file system or volume to find holds Previously, the parameters of 'zfs holds' could only be snapshots Add -d flag to limit depth of recursion Add -p flag to print literal values, rather than interpreted values Add -H flag to suppress header output and use tabs rather than whitespace Reviewed by: mahrens, smh, dteske Approved by: bapt (mentor) MFC after: 3 weeks Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3994 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Oct 26 16:21:56 2015 (r290014) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Oct 26 17:07:22 2015 (r290015) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2015 +.Dd October 24, 2015 .Dt ZFS 8 .Os .Sh NAME @@ -272,8 +272,10 @@ .Ar tag snapshot Ns ... .Nm .Cm holds -.Op Fl r -.Ar snapshot Ns ... +.Op Fl Hp +.Op Fl r Ns | Ns Fl d Ar depth +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns +.Ns ... .Nm .Cm release .Op Fl r @@ -3159,15 +3161,26 @@ snapshots of all descendent file systems .It Xo .Nm .Cm holds -.Op Fl r -.Ar snapshot Ns ... +.Op Fl Hp +.Op Fl r Ns | Ns Fl d Ar depth +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns +.Ns ... .Xc .Pp -Lists all existing user references for the given snapshot or snapshots. +Lists all existing user references for the given dataset or datasets. .Bl -tag -width indent +.It Fl H +Used for scripting mode. Do not print headers and separate fields by a single +tab instead of arbitrary white space. +.It Fl p +Display numbers in parsable (exact) values. .It Fl r -Lists the holds that are set on the named descendent snapshots, in addition to -listing the holds on the named snapshot. +Lists the holds that are set on the descendent snapshots of the named datasets +or snapshots, in addition to listing the holds on the named snapshots, if any. +.It Fl d Ar depth +Recursively display any holds on the named snapshots, or descendent snapshots of +the named datasets or snapshots, limiting the recursion to +.Ar depth . .El .It Xo .Nm Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Oct 26 16:21:56 2015 (r290014) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Oct 26 17:07:22 2015 (r290015) @@ -329,7 +329,8 @@ get_usage(zfs_help_t idx) case HELP_HOLD: return (gettext("\thold [-r] ...\n")); case HELP_HOLDS: - return (gettext("\tholds [-r] ...\n")); + return (gettext("\tholds [-Hp] [-r|-d depth] " + " ...\n")); case HELP_RELEASE: return (gettext("\trelease [-r] ...\n")); case HELP_DIFF: @@ -5543,7 +5544,8 @@ typedef struct holds_cbdata { * */ static void -print_holds(boolean_t scripted, size_t nwidth, size_t tagwidth, nvlist_t *nvl) +print_holds(boolean_t scripted, boolean_t literal, size_t nwidth, + size_t tagwidth, nvlist_t *nvl) { int i; nvpair_t *nvp = NULL; @@ -5576,10 +5578,14 @@ print_holds(boolean_t scripted, size_t n size_t sepnum = scripted ? 1 : 2; (void) nvpair_value_uint64(nvp2, &val); - time = (time_t)val; - (void) localtime_r(&time, &t); - (void) strftime(tsbuf, DATETIME_BUF_LEN, - gettext(STRFTIME_FMT_STR), &t); + if (literal) + snprintf(tsbuf, DATETIME_BUF_LEN, "%llu", val); + else { + time = (time_t)val; + (void) localtime_r(&time, &t); + (void) strftime(tsbuf, DATETIME_BUF_LEN, + gettext(STRFTIME_FMT_STR), &t); + } (void) printf("%-*s%*c%-*s%*c%s\n", nwidth, zname, sepnum, sep, tagwidth, tagname, sepnum, sep, tsbuf); @@ -5600,7 +5606,7 @@ holds_callback(zfs_handle_t *zhp, void * const char *zname = zfs_get_name(zhp); size_t znamelen = strnlen(zname, ZFS_MAXNAMELEN); - if (cbp->cb_recursive) { + if (cbp->cb_recursive && cbp->cb_snapname != NULL) { const char *snapname; char *delim = strchr(zname, '@'); if (delim == NULL) @@ -5628,9 +5634,12 @@ holds_callback(zfs_handle_t *zhp, void * } /* - * zfs holds [-r] ... + * zfs holds [-Hp] [-r | -d max] ... * - * -r Recursively hold + * -H Suppress header output + * -p Output literal values + * -r Recursively search for holds + * -d max Limit depth of recursive search */ static int zfs_do_holds(int argc, char **argv) @@ -5639,8 +5648,9 @@ zfs_do_holds(int argc, char **argv) int c; int i; boolean_t scripted = B_FALSE; + boolean_t literal = B_FALSE; boolean_t recursive = B_FALSE; - const char *opts = "rH"; + const char *opts = "d:rHp"; nvlist_t *nvl; int types = ZFS_TYPE_SNAPSHOT; @@ -5653,12 +5663,19 @@ zfs_do_holds(int argc, char **argv) /* check options */ while ((c = getopt(argc, argv, opts)) != -1) { switch (c) { + case 'd': + limit = parse_depth(optarg, &flags); + recursive = B_TRUE; + break; case 'r': recursive = B_TRUE; break; case 'H': scripted = B_TRUE; break; + case 'p': + literal = B_TRUE; + break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -5684,18 +5701,14 @@ zfs_do_holds(int argc, char **argv) for (i = 0; i < argc; ++i) { char *snapshot = argv[i]; const char *delim; - const char *snapname; + const char *snapname = NULL; delim = strchr(snapshot, '@'); - if (delim == NULL) { - (void) fprintf(stderr, - gettext("'%s' is not a snapshot\n"), snapshot); - ++errors; - continue; + if (delim != NULL) { + snapname = delim + 1; + if (recursive) + snapshot[delim - snapshot] = '\0'; } - snapname = delim + 1; - if (recursive) - snapshot[delim - snapshot] = '\0'; cb.cb_recursive = recursive; cb.cb_snapname = snapname; @@ -5713,7 +5726,8 @@ zfs_do_holds(int argc, char **argv) /* * 2. print holds data */ - print_holds(scripted, cb.cb_max_namelen, cb.cb_max_taglen, nvl); + print_holds(scripted, literal, cb.cb_max_namelen, cb.cb_max_taglen, + nvl); if (nvlist_empty(nvl)) (void) printf(gettext("no datasets available\n")); From owner-svn-src-head@freebsd.org Mon Oct 26 17:34:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0E05A1ED9F; Mon, 26 Oct 2015 17:34:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 BD4BF10BF; Mon, 26 Oct 2015 17:34:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E7DEAB976; Mon, 26 Oct 2015 13:34:31 -0400 (EDT) From: John Baldwin To: "Andrey A. Chernov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289863 - head/lib/libc/stdio Date: Mon, 26 Oct 2015 10:27:31 -0700 Message-ID: <2119048.oF1gNjmV7i@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201510240223.t9O2NFiY011536@repo.freebsd.org> References: <201510240223.t9O2NFiY011536@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.2.7 (bigwig.baldwin.cx); Mon, 26 Oct 2015 13:34:32 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 17:34:34 -0000 On Saturday, October 24, 2015 02:23:15 AM Andrey A. Chernov wrote: > Author: ache > Date: Sat Oct 24 02:23:15 2015 > New Revision: 289863 > URL: https://svnweb.freebsd.org/changeset/base/289863 > > Log: > Since no room left in the _flags, reuse __SALC for O_APPEND. > It helps to remove _fcntl() call from _ftello() and optimize seek position > calculation in _swrite(). You could just add a _flags2 to FILE if that would be cleaner. It should even be MFC'able without being an ABI change since stdio always allocates FILE objects internally and we only export pointers to them. Programs do not allocate them statically. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 26 18:14:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1317A8868; Mon, 26 Oct 2015 18:14:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB161E50; Mon, 26 Oct 2015 18:14:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QIEFZA061226; Mon, 26 Oct 2015 18:14:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QIEF1h061223; Mon, 26 Oct 2015 18:14:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510261814.t9QIEF1h061223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 26 Oct 2015 18:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290018 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 18:14:17 -0000 Author: mav Date: Mon Oct 26 18:14:15 2015 New Revision: 290018 URL: https://svnweb.freebsd.org/changeset/base/290018 Log: Reimplement enable and implement disable of virtual ports. Now on 24xx and above chips it is really possible to simulate several virtual FC ports with single physical one. For example, it allows to configure several targets in ctl.conf, assign each of them to separate virtual port, and let user to control access to them with switch zoning. I still doubt that all problems are solved there, but at now it passes at least basic tests. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Oct 26 17:49:13 2015 (r290017) +++ head/sys/dev/isp/isp.c Mon Oct 26 18:14:15 2015 (r290018) @@ -1275,7 +1275,12 @@ isp_reset(ispsoftc_t *isp, int do_load_d */ if (IS_FC(isp) && isp->isp_nchan > 1) { if (!ISP_CAP_MULTI_ID(isp)) { - isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, only can enable 1 of %d channels", isp->isp_nchan); + isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, " + "only can enable 1 of %d channels", isp->isp_nchan); + isp->isp_nchan = 1; + } else if (!ISP_CAP_VP0(isp)) { + isp_prt(isp, ISP_LOGWARN, "We can not use MULTIID " + "feature properly without VP0_Decoupling"); isp->isp_nchan = 1; } } @@ -2017,7 +2022,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions1 = fcp->isp_fwoptions; icbp->icb_fwoptions2 = fcp->isp_xfwoptions; icbp->icb_fwoptions3 = fcp->isp_zfwoptions; - if (isp->isp_nchan > 1 && (isp->isp_fwattr & ISP2400_FW_ATTR_VP0)) { + if (isp->isp_nchan > 1 && ISP_CAP_VP0(isp)) { icbp->icb_fwoptions1 &= ~ICB2400_OPT1_INI_DISABLE; icbp->icb_fwoptions1 |= ICB2400_OPT1_TGT_ENABLE; } else { @@ -2200,7 +2205,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) uint8_t *off; vpinfo.vp_global_options = 0; - if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) { + if (ISP_CAP_VP0(isp)) { vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE; vpinfo.vp_count = isp->isp_nchan; chan = 0; @@ -2235,7 +2240,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; - if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) + if (ISP_CAP_VP0(isp)) off += ICB2400_VPINFO_PORT_OFF(chan); else off += ICB2400_VPINFO_PORT_OFF(chan - 1); Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Mon Oct 26 17:49:13 2015 (r290017) +++ head/sys/dev/isp/isp_library.c Mon Oct 26 18:14:15 2015 (r290018) @@ -581,6 +581,136 @@ isp_fc_toponame(fcparam *fcp) } } +static int +isp_fc_enable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_modify_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* + * Build a VP MODIFY command in memory + */ + vp = (vp_modify_t *) qe; + vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; + vp->vp_mod_hdr.rqs_entry_count = 1; + vp->vp_mod_cnt = 1; + vp->vp_mod_idx0 = chan; + vp->vp_mod_cmd = VP_MODIFY_ENA; + vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED; + if (fcp->role & ISP_ROLE_INITIATOR) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; + } + if ((fcp->role & ISP_ROLE_TARGET) == 0) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; + } + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + vp->vp_mod_ports[0].loopid = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_HARD_ADDRESS; + else + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_PREV_ADDRESS; + } + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); + isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); + + /* + * Build a EXEC IOCB A64 command that points to the VP MODIFY command + */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_mod_status != VP_STS_OK) { + isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); + return (EIO); + } + return (0); +} + +static int +isp_fc_disable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_ctrl_info_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* + * Build a VP CTRL command in memory + */ + vp = (vp_ctrl_info_t *) qe; + vp->vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; + vp->vp_ctrl_hdr.rqs_entry_count = 1; + if (ISP_CAP_VP0(isp)) { + vp->vp_ctrl_status = 1; + } else { + vp->vp_ctrl_status = 0; + chan--; /* VP0 can not be controlled in this case. */ + } + vp->vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; + vp->vp_ctrl_vp_count = 1; + vp->vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); + isp_put_vp_ctrl_info(isp, vp, (vp_ctrl_info_t *) scp); + + /* + * Build a EXEC IOCB A64 command that points to the VP CTRL command + */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_ctrl_status != 0) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_CTRL of Chan %d failed with status %d %d", + __func__, chan, vp->vp_ctrl_status, vp->vp_ctrl_index_fail); + return (EIO); + } + return (0); +} + /* * Change Roles */ @@ -588,74 +718,28 @@ int isp_fc_change_role(ispsoftc_t *isp, int chan, int new_role) { fcparam *fcp = FCPARAM(isp, chan); + int i, was, res = 0; if (chan >= isp->isp_nchan) { isp_prt(isp, ISP_LOGWARN, "%s: bad channel %d", __func__, chan); return (ENXIO); } - if (chan == 0) { + if (fcp->role == new_role) + return (0); + for (was = 0, i = 0; i < isp->isp_nchan; i++) { + if (FCPARAM(isp, i)->role != ISP_ROLE_NONE) + was++; + } + if (was == 0 || (was == 1 && fcp->role != ISP_ROLE_NONE)) { fcp->role = new_role; return (isp_reinit(isp, 0)); - } else if (ISP_CAP_MULTI_ID(isp)) { - mbreg_t mbs; - vp_modify_t *vp; - uint8_t qe[QENTRY_LEN], *scp; - - ISP_MEMZERO(qe, QENTRY_LEN); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - return (EBUSY); - } - scp = fcp->isp_scratch; - - /* - * Build a VP MODIFY command in memory - */ - vp = (vp_modify_t *) qe; - vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; - vp->vp_mod_hdr.rqs_entry_count = 1; - vp->vp_mod_cnt = 1; - vp->vp_mod_idx0 = chan; - vp->vp_mod_cmd = VP_MODIFY_ENA; - vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED; - if (new_role & ISP_ROLE_INITIATOR) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((new_role & ISP_ROLE_TARGET) == 0) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; - } - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); - isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); - - /* - * Build a EXEC IOCB A64 command that points to the VP MODIFY command - */ - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); - isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); - return (EIO); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); - - FC_SCRATCH_RELEASE(isp, chan); - - if (vp->vp_mod_status != VP_STS_OK) { - isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); - return (EIO); - } - fcp->role = new_role; - return (0); - } else { - return (EINVAL); } + if (fcp->role != ISP_ROLE_NONE) + res = isp_fc_disable_vp(isp, chan); + fcp->role = new_role; + if (fcp->role != ISP_ROLE_NONE) + res = isp_fc_enable_vp(isp, chan); + return (res); } void @@ -1400,8 +1484,9 @@ isp_put_vp_ctrl_info(ispsoftc_t *isp, vp ISP_IOXPUT_16(isp, src->vp_ctrl_idmap[i], &dst->vp_ctrl_idmap[i]); } for (i = 0; i < ASIZE(src->vp_ctrl_reserved); i++) { - ISP_IOXPUT_8(isp, src->vp_ctrl_reserved[i], &dst->vp_ctrl_reserved[i]); + ISP_IOXPUT_16(isp, src->vp_ctrl_reserved[i], &dst->vp_ctrl_reserved[i]); } + ISP_IOXPUT_16(isp, src->vp_ctrl_fcf_index, &dst->vp_ctrl_fcf_index); } void @@ -1418,8 +1503,9 @@ isp_get_vp_ctrl_info(ispsoftc_t *isp, vp ISP_IOXGET_16(isp, &src->vp_ctrl_idmap[i], dst->vp_ctrl_idmap[i]); } for (i = 0; i < ASIZE(src->vp_ctrl_reserved); i++) { - ISP_IOXGET_8(isp, &src->vp_ctrl_reserved[i], dst->vp_ctrl_reserved[i]); + ISP_IOXGET_16(isp, &src->vp_ctrl_reserved[i], dst->vp_ctrl_reserved[i]); } + ISP_IOXGET_16(isp, &src->vp_ctrl_fcf_index, dst->vp_ctrl_fcf_index); } void Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Mon Oct 26 17:49:13 2015 (r290017) +++ head/sys/dev/isp/ispmbox.h Mon Oct 26 18:14:15 2015 (r290018) @@ -855,6 +855,8 @@ typedef struct { (IS_24XX(isp)? (isp->isp_fwattr & ISP2400_FW_ATTR_MULTIID) : 0) #define ISP_GET_VPIDX(isp, tag) \ (ISP_CAP_MULTI_ID(isp) ? tag : 0) +#define ISP_CAP_VP0(isp) \ + (IS_24XX(isp)? (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) : 0) /* * This is true manifestly or is dependent on a f/w attribute @@ -1177,14 +1179,16 @@ typedef struct { uint16_t vp_ctrl_status; uint16_t vp_ctrl_command; uint16_t vp_ctrl_vp_count; - uint16_t vp_ctrl_idmap[8]; - uint8_t vp_ctrl_reserved[32]; + uint16_t vp_ctrl_idmap[16]; + uint16_t vp_ctrl_reserved[7]; + uint16_t vp_ctrl_fcf_index; } vp_ctrl_info_t; -#define VP_CTRL_CMD_ENABLE_VP 0 -#define VP_CTRL_CMD_DISABLE_VP 8 -#define VP_CTRL_CMD_DISABLE_VP_REINIT_LINK 9 -#define VP_CTRL_CMD_DISABLE_VP_LOGO 0xA +#define VP_CTRL_CMD_ENABLE_VP 0x00 +#define VP_CTRL_CMD_DISABLE_VP 0x08 +#define VP_CTRL_CMD_DISABLE_VP_REINIT_LINK 0x09 +#define VP_CTRL_CMD_DISABLE_VP_LOGO 0x0A +#define VP_CTRL_CMD_DISABLE_VP_LOGO_ALL 0x0B /* * We can use this structure for modifying either one or two VP ports after initialization From owner-svn-src-head@freebsd.org Mon Oct 26 19:28:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2692DA1ECA3; Mon, 26 Oct 2015 19:28:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA3351303; Mon, 26 Oct 2015 19:28:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QJSKC0081951; Mon, 26 Oct 2015 19:28:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QJSKxn081950; Mon, 26 Oct 2015 19:28:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510261928.t9QJSKxn081950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 26 Oct 2015 19:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290019 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 19:28:22 -0000 Author: bdrewery Date: Mon Oct 26 19:28:20 2015 New Revision: 290019 URL: https://svnweb.freebsd.org/changeset/base/290019 Log: Add a note about DEPFLAGS which is currently a hack around not properly passing CXXFLAGS to sub-makes. The bad passing also causes bsd.dep.mk's logic to selectively pull only some flags from C[XX]FLAGS to not apply which can be seen with '-L' being passed to mkdep when using an external compiler. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Oct 26 18:14:15 2015 (r290018) +++ head/Makefile.inc1 Mon Oct 26 19:28:20 2015 (r290019) @@ -398,6 +398,9 @@ TARGET_ABI= gnueabi .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ +# XXX: DEPFLAGS is a workaround for not properly passing CXXFLAGS to sub-makes +# due to CXX="${XCXX} ${XCXXFLAGS}". bsd.dep.mk does use CXXFLAGS when +# building C++ files so this can come out if passing CXXFLAGS down is fixed. DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 .else TARGET_ABI?= unknown From owner-svn-src-head@freebsd.org Mon Oct 26 19:34:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1622DA1EDCC; Mon, 26 Oct 2015 19:34:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDE71182F; Mon, 26 Oct 2015 19:34:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QJY0NA084704; Mon, 26 Oct 2015 19:34:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QJY0G1084702; Mon, 26 Oct 2015 19:34:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510261934.t9QJY0G1084702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 26 Oct 2015 19:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290020 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 19:34:02 -0000 Author: cem Date: Mon Oct 26 19:34:00 2015 New Revision: 290020 URL: https://svnweb.freebsd.org/changeset/base/290020 Log: ioat: Dedupe operation enqueue logic Add generic hw descriptor struct and generic control flags struct, in preparation for other kinds of IOAT operation. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Oct 26 19:28:20 2015 (r290019) +++ head/sys/dev/ioat/ioat.c Mon Oct 26 19:34:00 2015 (r290020) @@ -648,15 +648,18 @@ ioat_release(bus_dmaengine_t dmaengine) mtx_unlock(&ioat->submit_lock); } -struct bus_dmadesc * -ioat_null(bus_dmaengine_t dmaengine, bus_dmaengine_callback_t callback_fn, - void *callback_arg, uint32_t flags) +static struct ioat_descriptor * +ioat_op_generic(struct ioat_softc *ioat, uint8_t op, + uint32_t size, uint64_t src, uint64_t dst, + bus_dmaengine_callback_t callback_fn, void *callback_arg, + uint32_t flags) { - struct ioat_softc *ioat; + struct ioat_generic_hw_descriptor *hw_desc; struct ioat_descriptor *desc; - struct ioat_dma_hw_descriptor *hw_desc; int mflags; + mtx_assert(&ioat->submit_lock, MA_OWNED); + KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", flags & ~DMA_ALL_FLAGS)); if ((flags & DMA_NO_WAIT) != 0) @@ -664,31 +667,52 @@ ioat_null(bus_dmaengine_t dmaengine, bus else mflags = M_WAITOK; - ioat = to_ioat_softc(dmaengine); - mtx_assert(&ioat->submit_lock, MA_OWNED); + if (size > ioat->max_xfer_size) { + ioat_log_message(0, "%s: max_xfer_size = %d, requested = %u\n", + __func__, ioat->max_xfer_size, (unsigned)size); + return (NULL); + } if (ioat_reserve_space(ioat, 1, mflags) != 0) return (NULL); - CTR0(KTR_IOAT, __func__); - desc = ioat_get_ring_entry(ioat, ioat->head); - hw_desc = desc->u.dma; + hw_desc = desc->u.generic; hw_desc->u.control_raw = 0; - hw_desc->u.control.null = 1; - hw_desc->u.control.completion_update = 1; + hw_desc->u.control_generic.op = op; + hw_desc->u.control_generic.completion_update = 1; if ((flags & DMA_INT_EN) != 0) - hw_desc->u.control.int_enable = 1; + hw_desc->u.control_generic.int_enable = 1; - hw_desc->size = 8; - hw_desc->src_addr = 0; - hw_desc->dest_addr = 0; + hw_desc->size = size; + hw_desc->src_addr = src; + hw_desc->dest_addr = dst; desc->bus_dmadesc.callback_fn = callback_fn; desc->bus_dmadesc.callback_arg = callback_arg; + return (desc); +} + +struct bus_dmadesc * +ioat_null(bus_dmaengine_t dmaengine, bus_dmaengine_callback_t callback_fn, + void *callback_arg, uint32_t flags) +{ + struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + + CTR0(KTR_IOAT, __func__); + ioat = to_ioat_softc(dmaengine); + desc = ioat_op_generic(ioat, IOAT_OP_COPY, 8, 0, 0, callback_fn, + callback_arg, flags); + if (desc == NULL) + return (NULL); + + hw_desc = desc->u.dma; + hw_desc->u.control.null = 1; ioat_submit_single(ioat); return (&desc->bus_dmadesc); } @@ -698,51 +722,28 @@ ioat_copy(bus_dmaengine_t dmaengine, bus bus_addr_t src, bus_size_t len, bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) { - struct ioat_descriptor *desc; struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; struct ioat_softc *ioat; - int mflags; - - KASSERT((flags & ~DMA_ALL_FLAGS) == 0, ("Unrecognized flag(s): %#x", - flags & ~DMA_ALL_FLAGS)); - if ((flags & DMA_NO_WAIT) != 0) - mflags = M_NOWAIT; - else - mflags = M_WAITOK; + CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); - mtx_assert(&ioat->submit_lock, MA_OWNED); - if (len > ioat->max_xfer_size) { - ioat_log_message(0, "%s: max_xfer_size = %d, requested = %d\n", - __func__, ioat->max_xfer_size, (int)len); + if (((src | dst) & (0xffffull << 48)) != 0) { + ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", + __func__); return (NULL); } - if (ioat_reserve_space(ioat, 1, mflags) != 0) + desc = ioat_op_generic(ioat, IOAT_OP_COPY, len, src, dst, callback_fn, + callback_arg, flags); + if (desc == NULL) return (NULL); - CTR0(KTR_IOAT, __func__); - - desc = ioat_get_ring_entry(ioat, ioat->head); hw_desc = desc->u.dma; - - hw_desc->u.control_raw = 0; - hw_desc->u.control.completion_update = 1; - - if ((flags & DMA_INT_EN) != 0) - hw_desc->u.control.int_enable = 1; - - hw_desc->size = len; - hw_desc->src_addr = src; - hw_desc->dest_addr = dst; - if (g_ioat_debug_level >= 3) dump_descriptor(hw_desc); - desc->bus_dmadesc.callback_fn = callback_fn; - desc->bus_dmadesc.callback_arg = callback_arg; - ioat_submit_single(ioat); return (&desc->bus_dmadesc); } @@ -767,7 +768,7 @@ ioat_get_ring_space(struct ioat_softc *i static struct ioat_descriptor * ioat_alloc_ring_entry(struct ioat_softc *ioat, int mflags) { - struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_generic_hw_descriptor *hw_desc; struct ioat_descriptor *desc; int error, busdmaflag; @@ -788,7 +789,7 @@ ioat_alloc_ring_entry(struct ioat_softc if (hw_desc == NULL) goto out; - desc->u.dma = hw_desc; + desc->u.generic = hw_desc; error = bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, sizeof(*hw_desc), ioat_dmamap_cb, &desc->hw_desc_bus_addr, @@ -811,8 +812,8 @@ ioat_free_ring_entry(struct ioat_softc * if (desc == NULL) return; - if (desc->u.dma) - bus_dmamem_free(ioat->hw_desc_tag, desc->u.dma, + if (desc->u.generic) + bus_dmamem_free(ioat->hw_desc_tag, desc->u.generic, ioat->hw_desc_map); free(desc, M_IOAT); } Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Mon Oct 26 19:28:20 2015 (r290019) +++ head/sys/dev/ioat/ioat_internal.h Mon Oct 26 19:34:00 2015 (r290020) @@ -122,10 +122,39 @@ SYSCTL_DECL(_hw_ioat); extern int g_ioat_debug_level; +struct generic_dma_control { + uint32_t int_enable:1; + uint32_t src_snoop_disable:1; + uint32_t dest_snoop_disable:1; + uint32_t completion_update:1; + uint32_t fence:1; + uint32_t reserved1:1; + uint32_t src_page_break:1; + uint32_t dest_page_break:1; + uint32_t bundle:1; + uint32_t dest_dca:1; + uint32_t hint:1; + uint32_t reserved2:13; + uint32_t op:8; +}; + +struct ioat_generic_hw_descriptor { + uint32_t size; + union { + uint32_t control_raw; + struct generic_dma_control control_generic; + } u; + uint64_t src_addr; + uint64_t dest_addr; + uint64_t next; + uint64_t reserved[4]; +}; + struct ioat_dma_hw_descriptor { uint32_t size; union { uint32_t control_raw; + struct generic_dma_control control_generic; struct { uint32_t int_enable:1; uint32_t src_snoop_disable:1; @@ -156,6 +185,7 @@ struct ioat_fill_hw_descriptor { uint32_t size; union { uint32_t control_raw; + struct generic_dma_control control_generic; struct { uint32_t int_enable:1; uint32_t reserved:1; @@ -183,6 +213,7 @@ struct ioat_xor_hw_descriptor { uint32_t size; union { uint32_t control_raw; + struct generic_dma_control control_generic; struct { uint32_t int_enable:1; uint32_t src_snoop_disable:1; @@ -220,6 +251,7 @@ struct ioat_pq_hw_descriptor { uint32_t size; union { uint32_t control_raw; + struct generic_dma_control control_generic; struct { uint32_t int_enable:1; uint32_t src_snoop_disable:1; @@ -261,6 +293,7 @@ struct ioat_pq_update_hw_descriptor { uint32_t size; union { uint32_t control_raw; + struct generic_dma_control control_generic; struct { uint32_t int_enable:1; uint32_t src_snoop_disable:1; @@ -300,6 +333,7 @@ struct bus_dmadesc { struct ioat_descriptor { struct bus_dmadesc bus_dmadesc; union { + struct ioat_generic_hw_descriptor *generic; struct ioat_dma_hw_descriptor *dma; struct ioat_fill_hw_descriptor *fill; struct ioat_xor_hw_descriptor *xor; From owner-svn-src-head@freebsd.org Mon Oct 26 19:34:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A0AA1EDF8; Mon, 26 Oct 2015 19:34:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id F2B5F1983; Mon, 26 Oct 2015 19:34:13 +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 t9QJYDvn084760; Mon, 26 Oct 2015 19:34:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QJYC63084754; Mon, 26 Oct 2015 19:34:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510261934.t9QJYC63084754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 26 Oct 2015 19:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290021 - in head: sys/dev/ioat tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 19:34:14 -0000 Author: cem Date: Mon Oct 26 19:34:12 2015 New Revision: 290021 URL: https://svnweb.freebsd.org/changeset/base/290021 Log: ioat: Add support for Block Fill operations The IOAT hardware supports writing a 64-bit pattern to some destination buffer. The same limitations on buffer length apply as for copy operations. Throughput is a bit higher (probably because fill does not have to spend bandwidth reading from a source in memory). Support for testing Block Fill has been added to ioatcontrol(8) and the ioat_test device. ioatcontrol(8) accepts the '-f' flag, which tests Block Fill. (If the flag is omitted, the tool tests copy by default.) The '-V' flag, in conjunction with '-f', verifies that buffers are filled in the expected pattern. Tested on: Broadwell DE (Xeon D-1500) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_test.c head/sys/dev/ioat/ioat_test.h head/tools/tools/ioat/ioatcontrol.8 head/tools/tools/ioat/ioatcontrol.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Oct 26 19:34:00 2015 (r290020) +++ head/sys/dev/ioat/ioat.c Mon Oct 26 19:34:12 2015 (r290021) @@ -748,6 +748,37 @@ ioat_copy(bus_dmaengine_t dmaengine, bus return (&desc->bus_dmadesc); } +struct bus_dmadesc * +ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, uint64_t fillpattern, + bus_size_t len, bus_dmaengine_callback_t callback_fn, void *callback_arg, + uint32_t flags) +{ + struct ioat_fill_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + + CTR0(KTR_IOAT, __func__); + ioat = to_ioat_softc(dmaengine); + + if ((dst & (0xffffull << 48)) != 0) { + ioat_log_message(0, "%s: High 16 bits of dst invalid\n", + __func__); + return (NULL); + } + + desc = ioat_op_generic(ioat, IOAT_OP_FILL, len, fillpattern, dst, + callback_fn, callback_arg, flags); + if (desc == NULL) + return (NULL); + + hw_desc = desc->u.fill; + if (g_ioat_debug_level >= 3) + dump_descriptor(hw_desc); + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + /* * Ring Management */ Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Mon Oct 26 19:34:00 2015 (r290020) +++ head/sys/dev/ioat/ioat.h Mon Oct 26 19:34:12 2015 (r290021) @@ -68,6 +68,14 @@ void ioat_put_dmaengine(bus_dmaengine_t void ioat_acquire(bus_dmaengine_t dmaengine); void ioat_release(bus_dmaengine_t dmaengine); +/* + * Issue a blockfill operation. The 64-bit pattern 'fillpattern' is written to + * 'len' physically contiguous bytes at 'dst'. + */ +struct bus_dmadesc *ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, + uint64_t fillpattern, bus_size_t len, bus_dmaengine_callback_t callback_fn, + void *callback_arg, uint32_t flags); + /* Issues the copy data operation */ struct bus_dmadesc *ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, bus_addr_t src, bus_size_t len, bus_dmaengine_callback_t callback_fn, Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Mon Oct 26 19:34:00 2015 (r290020) +++ head/sys/dev/ioat/ioat_test.c Mon Oct 26 19:34:12 2015 (r290021) @@ -123,11 +123,26 @@ test_transaction *ioat_test_transaction_ static bool ioat_compare_ok(struct test_transaction *tx) { - uint32_t i; + struct ioat_test *test; + char *dst, *src; + uint32_t i, j; + + test = tx->test; for (i = 0; i < tx->depth; i++) { - if (memcmp(tx->buf[2*i], tx->buf[2*i+1], tx->length) != 0) - return (false); + dst = tx->buf[2 * i + 1]; + src = tx->buf[2 * i]; + + if (test->testkind == IOAT_TEST_FILL) { + for (j = 0; j < tx->length; j += sizeof(uint64_t)) { + if (memcmp(src, &dst[j], + MIN(sizeof(uint64_t), tx->length - j)) + != 0) + return (false); + } + } else if (test->testkind == IOAT_TEST_DMA) + if (memcmp(src, dst, tx->length) != 0) + return (false); } return (true); } @@ -208,8 +223,11 @@ ioat_test_submit_1_tx(struct ioat_test * struct bus_dmadesc *desc; bus_dmaengine_callback_t cb; bus_addr_t src, dest; + uint64_t fillpattern; uint32_t i, flags; + desc = NULL; + IT_LOCK(); while (TAILQ_EMPTY(&test->free_q)) msleep(&test->free_q, &ioat_test_lk, 0, "test_submit", 0); @@ -232,7 +250,15 @@ ioat_test_submit_1_tx(struct ioat_test * flags = 0; } - desc = ioat_copy(dma, src, dest, tx->length, cb, tx, flags); + if (test->testkind == IOAT_TEST_DMA) + desc = ioat_copy(dma, dest, src, tx->length, cb, tx, + flags); + else if (test->testkind == IOAT_TEST_FILL) { + fillpattern = *(uint64_t *)tx->buf[2*i]; + desc = ioat_blockfill(dma, dest, fillpattern, + tx->length, cb, tx, flags); + } + if (desc == NULL) panic("Failed to allocate a ring slot " "-- this shouldn't happen!"); @@ -279,6 +305,13 @@ ioat_dma_test(void *arg) return; } + if (test->testkind >= IOAT_NUM_TESTKINDS) { + ioat_test_log(0, "Invalid kind %u\n", + (unsigned)test->testkind); + test->status[IOAT_TEST_INVALID_INPUT]++; + return; + } + dmaengine = ioat_get_dmaengine(test->channel_index); if (dmaengine == NULL) { ioat_test_log(0, "Couldn't acquire dmaengine\n"); Modified: head/sys/dev/ioat/ioat_test.h ============================================================================== --- head/sys/dev/ioat/ioat_test.h Mon Oct 26 19:34:00 2015 (r290020) +++ head/sys/dev/ioat/ioat_test.h Mon Oct 26 19:34:12 2015 (r290021) @@ -34,15 +34,24 @@ enum ioat_res { IOAT_TEST_NO_DMA_ENGINE, IOAT_TEST_NO_MEMORY, IOAT_TEST_MISCOMPARE, + IOAT_TEST_INVALID_INPUT, IOAT_NUM_RES }; +enum ioat_test_kind { + IOAT_TEST_FILL = 0, + IOAT_TEST_DMA, + IOAT_NUM_TESTKINDS +}; + struct test_transaction; struct ioat_test { volatile uint32_t status[IOAT_NUM_RES]; uint32_t channel_index; + enum ioat_test_kind testkind; + /* HW max of 1MB */ uint32_t buffer_size; uint32_t chain_depth; Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Mon Oct 26 19:34:00 2015 (r290020) +++ head/tools/tools/ioat/ioatcontrol.8 Mon Oct 26 19:34:12 2015 (r290021) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2015 +.Dd October 26, 2015 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -33,6 +33,7 @@ .Xr ioat 4 .Sh SYNOPSIS .Nm +.Op Fl f .Op Fl V .Ar channel_number .Ar num_txns @@ -46,8 +47,12 @@ allows one to issue some number of test driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds +.It Fl f +Test block fill (by default, +.Nm +tests copy) .It Fl V -Verify copies for accuracy +Verify copies/fills for accuracy .El .Pp .Nm @@ -98,13 +103,14 @@ The interface between .Nm and .Xr ioat 4 . -.Nm +.Xr ioat 4 exposes it with .Cd hw.ioat.enable_ioat_test=1 . .Sh DIAGNOSTICS The wait channel .Va test_submit -indicates that the test code is keeping the DMA engine full of work. +indicates that the test code has enqueued all requested transactions and is +waiting on the IOAT hardware to complete one before issuing another operation. .Sh SEE ALSO .Xr ioat 4 .Sh HISTORY @@ -119,7 +125,8 @@ driver and .Nm tool were developed by .An \&Jim Harris Aq Mt jimharris@FreeBSD.org , +.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com , and -.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com . +.An \&Conrad Meyer Aq Mt cem@FreeBSD.org . This manual page was written by .An \&Conrad Meyer Aq Mt cem@FreeBSD.org . Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Mon Oct 26 19:34:00 2015 (r290020) +++ head/tools/tools/ioat/ioatcontrol.c Mon Oct 26 19:34:12 2015 (r290021) @@ -48,7 +48,7 @@ static void usage(void) { - printf("Usage: %s [-V] [ " + printf("Usage: %s [-fV] [ " "[ [duration]]]\n", getprogname()); exit(EX_USAGE); } @@ -58,9 +58,13 @@ main(int argc, char **argv) { struct ioat_test t; int fd, ch; + bool fflag; - while ((ch = getopt(argc, argv, "V")) != -1) { + while ((ch = getopt(argc, argv, "fV")) != -1) { switch (ch) { + case 'f': + fflag = true; + break; case 'V': t.verify = true; break; @@ -78,6 +82,10 @@ main(int argc, char **argv) t.buffer_size = 256 * 1024; t.chain_depth = 2; t.duration = 0; + t.testkind = IOAT_TEST_DMA; + + if (fflag) + t.testkind = IOAT_TEST_FILL; t.channel_index = atoi(argv[0]); if (t.channel_index > 8) { From owner-svn-src-head@freebsd.org Mon Oct 26 21:03:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55575A1E12E; Mon, 26 Oct 2015 21:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 21E481FEB; Mon, 26 Oct 2015 21:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QL3K7X011661; Mon, 26 Oct 2015 21:03:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QL3KOa011660; Mon, 26 Oct 2015 21:03:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201510262103.t9QL3KOa011660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 26 Oct 2015 21:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290022 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 21:03:21 -0000 Author: avos Date: Mon Oct 26 21:03:20 2015 New Revision: 290022 URL: https://svnweb.freebsd.org/changeset/base/290022 Log: urtwn(4): do not filter out control frames in the RX path Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3811 Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Oct 26 19:34:12 2015 (r290021) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Oct 26 21:03:20 2015 (r290022) @@ -626,7 +626,8 @@ urtwn_rx_frame(struct urtwn_softc *sc, u counter_u64_add(ic->ic_ierrors, 1); return (NULL); } - if (pktlen < sizeof(*wh) || pktlen > MCLBYTES) { + if (pktlen < sizeof(struct ieee80211_frame_ack) || + pktlen > MCLBYTES) { counter_u64_add(ic->ic_ierrors, 1); return (NULL); } @@ -744,7 +745,7 @@ urtwn_bulk_rx_callback(struct usb_xfer * { struct urtwn_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; + struct ieee80211_frame_min *wh; struct ieee80211_node *ni; struct mbuf *m = NULL, *next; struct urtwn_data *data; @@ -784,9 +785,11 @@ tr_setup: while (m != NULL) { next = m->m_next; m->m_next = NULL; - wh = mtod(m, struct ieee80211_frame *); - ni = ieee80211_find_rxnode(ic, - (struct ieee80211_frame_min *)wh); + wh = mtod(m, struct ieee80211_frame_min *); + if (m->m_len >= sizeof(*wh)) + ni = ieee80211_find_rxnode(ic, wh); + else + ni = NULL; nf = URTWN_NOISE_FLOOR; if (ni != NULL) { (void)ieee80211_input(ni, m, rssi - nf, nf); From owner-svn-src-head@freebsd.org Mon Oct 26 21:19:50 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB170A1E5F1; Mon, 26 Oct 2015 21:19:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A84B519E7; Mon, 26 Oct 2015 21:19:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QLJnLp015928; Mon, 26 Oct 2015 21:19:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QLJnLn015927; Mon, 26 Oct 2015 21:19:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201510262119.t9QLJnLn015927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 26 Oct 2015 21:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290023 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 21:19:51 -0000 Author: tuexen Date: Mon Oct 26 21:19:49 2015 New Revision: 290023 URL: https://svnweb.freebsd.org/changeset/base/290023 Log: When processing a cookie, any mismatch in port numbers or the vtag results in failing the check. This fixes https://github.com/nplab/ETSI-SCTP-Conformance-Testsuite/blob/master/sctp-imh-tests/sctp-imh-i-3-3.pkt MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Oct 26 21:03:20 2015 (r290022) +++ head/sys/netinet/sctp_input.c Mon Oct 26 21:19:49 2015 (r290023) @@ -2435,8 +2435,8 @@ sctp_handle_cookie_echo(struct mbuf *m, cookie_offset = offset + sizeof(struct sctp_chunkhdr); cookie_len = ntohs(cp->ch.chunk_length); - if ((cookie->peerport != sh->src_port) && - (cookie->myport != sh->dest_port) && + if ((cookie->peerport != sh->src_port) || + (cookie->myport != sh->dest_port) || (cookie->my_vtag != sh->v_tag)) { /* * invalid ports or bad tag. Note that we always leave the From owner-svn-src-head@freebsd.org Mon Oct 26 22:30:00 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7979D86C8; Mon, 26 Oct 2015 22:30:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ECC41C30; Mon, 26 Oct 2015 22:30:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QMTx0r038925; Mon, 26 Oct 2015 22:29:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QMTw1i038923; Mon, 26 Oct 2015 22:29:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201510262229.t9QMTw1i038923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 26 Oct 2015 22:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290024 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 22:30:00 -0000 Author: delphij Date: Mon Oct 26 22:29:58 2015 New Revision: 290024 URL: https://svnweb.freebsd.org/changeset/base/290024 Log: In gunzip(1), treat trailing garbage as a warning and not an error. This allows scripts to distinguish it between real fatal errors, for instance a CRC mismatch. Update manual page for the behavior change. PR: bin/203873 Submitted by: Eugene Grosbein MFC after: 2 weeks Modified: head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.1 ============================================================================== --- head/usr.bin/gzip/gzip.1 Mon Oct 26 21:19:49 2015 (r290023) +++ head/usr.bin/gzip/gzip.1 Mon Oct 26 22:29:58 2015 (r290024) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 6, 2015 +.Dd October 26, 2015 .Dt GZIP 1 .Os .Sh NAME @@ -136,7 +136,7 @@ option, allowing non-compressed data to .It Fl h , -help This option prints a usage summary and exits. .It Fl k , -keep -Keep (don't delete) input files during compression +Keep (do not delete) input files during compression or decompression. .It Fl L , -license This option prints @@ -183,6 +183,12 @@ is set, it is parsed as a white-space se handled before any options on the command line. Options on the command line will override anything in .Ev GZIP . +.Sh EXIT STATUS +The +.Nm +utility exits 0 on success, +1 on errors, +and 2 if a warning occurs. .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , @@ -220,7 +226,7 @@ with unpack support written by .An Xin LI Aq Mt delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit -integer, therefore, it can not represent files larger than 4GB. +integer, therefore, it cannot represent files larger than 4GB. This limitation also applies to .Fl l option of Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Mon Oct 26 21:19:49 2015 (r290023) +++ head/usr.bin/gzip/gzip.c Mon Oct 26 22:29:58 2015 (r290024) @@ -810,6 +810,7 @@ gz_uncompress(int in, int out, char *pre if (in_tot > 0) { maybe_warnx("%s: trailing garbage " "ignored", filename); + exit_value = 2; goto stop; } maybe_warnx("input not gziped (MAGIC0)"); From owner-svn-src-head@freebsd.org Mon Oct 26 22:31:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 240598896; Mon, 26 Oct 2015 22:31:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E23121FAF; Mon, 26 Oct 2015 22:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QMVvJE039669; Mon, 26 Oct 2015 22:31:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QMVva3039666; Mon, 26 Oct 2015 22:31:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510262231.t9QMVva3039666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 26 Oct 2015 22:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290025 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 22:31:59 -0000 Author: bdrewery Date: Mon Oct 26 22:31:57 2015 New Revision: 290025 URL: https://svnweb.freebsd.org/changeset/base/290025 Log: META MODE: bsd.files.mk and bsd.confs.mk don't handle symlinks so there is no need to set STAGE_SYMLINKS_DIR.${STAGE_SET}. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Mon Oct 26 22:29:58 2015 (r290024) +++ head/share/mk/bsd.confs.mk Mon Oct 26 22:31:57 2015 (r290025) @@ -24,7 +24,6 @@ ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFIGDIR}/ STAGE_SETS+= ${group} STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} _${group}CONFS= .for cnf in ${${group}} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Mon Oct 26 22:29:58 2015 (r290024) +++ head/share/mk/bsd.files.mk Mon Oct 26 22:31:57 2015 (r290025) @@ -30,7 +30,6 @@ ${group}DIR?= ${BINDIR} STAGE_SETS+= ${group} .endif STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} _${group}FILES= .for file in ${${group}} From owner-svn-src-head@freebsd.org Mon Oct 26 23:28:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E5EA1E4C7; Mon, 26 Oct 2015 23:28:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0813D18DA; Mon, 26 Oct 2015 23:28:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QNSaTY058732; Mon, 26 Oct 2015 23:28:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QNSaJ0058731; Mon, 26 Oct 2015 23:28:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510262328.t9QNSaJ0058731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 26 Oct 2015 23:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290026 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 26 Oct 2015 23:28:37 -0000 Author: bdrewery Date: Mon Oct 26 23:28:35 2015 New Revision: 290026 URL: https://svnweb.freebsd.org/changeset/base/290026 Log: META MODE: Fix FILESNAME not being respected sans other FILES_group overrides. This was fixed in bsd.incs.mk in r242801 already. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Mon Oct 26 22:31:57 2015 (r290025) +++ head/share/mk/bsd.files.mk Mon Oct 26 23:28:35 2015 (r290026) @@ -35,7 +35,7 @@ _${group}FILES= .for file in ${${group}} .if defined(${group}OWN_${file:T}) || defined(${group}GRP_${file:T}) || \ defined(${group}MODE_${file:T}) || defined(${group}DIR_${file:T}) || \ - defined(${group}NAME_${file:T}) + defined(${group}NAME_${file:T}) || defined(${group}NAME) ${group}OWN_${file:T}?= ${${group}OWN} ${group}GRP_${file:T}?= ${${group}GRP} ${group}MODE_${file:T}?= ${${group}MODE} From owner-svn-src-head@freebsd.org Tue Oct 27 00:01:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C17E5A1EBEF for ; Tue, 27 Oct 2015 00:01:34 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f181.google.com (mail-lb0-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)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8F31760 for ; Tue, 27 Oct 2015 00:01:34 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lbbwb3 with SMTP id wb3so51971272lbb.1 for ; Mon, 26 Oct 2015 17:01:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=5+74Bk5okEAEMg0Hy7KlhiVda0jXBDZ/7WDOKe5sFkM=; b=hOSQE/ERFjloPKWjRDvC1mUUyVWYopcPBXSpM5K6qNPh0OM4+3dn5pGnL5Bzbyipsn /TsGODqRpJq5ezMur9AG17V4TWRQGLENYeP9QnDQzFwsFY0Q6WGksghTCDSHr+ac0HQ8 UzPX/npNavtewmQi54BI7q5ohrbOcKghVQ1LzwMJBPUaFtpFS7+TbSOXbVAlw2lSP2IE yG2aGflHojgL6Ag0y19v6xMXee4vnWmEvYa9La80gD4Sq2Ze/OCv8SSoiI9+IXlKe0Mq TaAw0BNbiFhhT7J5aB7VTK8TaUZjT/H/w3KIlIDZih9kOYU2rDdx6l/hRHm+B1Ye5M6i 3B+Q== X-Gm-Message-State: ALoCoQlBY35Sp3qLRSVoSruujmq/wVrXcIs+VA9OT/0O9m+8/0FcI4ZEmWap4dJfnQ06tG4tE4Jy X-Received: by 10.112.167.3 with SMTP id zk3mr3001970lbb.103.1445903748278; Mon, 26 Oct 2015 16:55:48 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id zk5sm6343964lbb.18.2015.10.26.16.55.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2015 16:55:47 -0700 (PDT) Subject: Re: svn commit: r289863 - head/lib/libc/stdio To: John Baldwin References: <201510240223.t9O2NFiY011536@repo.freebsd.org> <2119048.oF1gNjmV7i@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <562EBD7F.6090009@freebsd.org> Date: Tue, 27 Oct 2015 02:55:43 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <2119048.oF1gNjmV7i@ralph.baldwin.cx> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 00:01:34 -0000 On 26.10.2015 20:27, John Baldwin wrote: > On Saturday, October 24, 2015 02:23:15 AM Andrey A. Chernov wrote: >> Author: ache >> Date: Sat Oct 24 02:23:15 2015 >> New Revision: 289863 >> URL: https://svnweb.freebsd.org/changeset/base/289863 >> >> Log: >> Since no room left in the _flags, reuse __SALC for O_APPEND. >> It helps to remove _fcntl() call from _ftello() and optimize seek position >> calculation in _swrite(). > > You could just add a _flags2 to FILE if that would be cleaner. It should even > be MFC'able without being an ABI change since stdio always allocates FILE > objects internally and we only export pointers to them. Programs do not > allocate them statically. > Thanx, I understand it from your bugzilla answer, but I have a doubt. What if some 3rd party port will use static FILE f; and then &f? Some of ports may deal with FILE internals and I don't know which ones. I prefer rather to not break something there and currently I need only one flag and __SALC is not conflicting since used only with _file = -1 and __SSTR. If you or somebody else will need another flag and be brave enough to add _flags2, this patch can be easily converted. -- http://ache.vniz.net/ From owner-svn-src-head@freebsd.org Tue Oct 27 00:42:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 391A3845F; Tue, 27 Oct 2015 00:42:17 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D65EA186B; Tue, 27 Oct 2015 00:42:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R0gF9g081195; Tue, 27 Oct 2015 00:42:15 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R0gFID081191; Tue, 27 Oct 2015 00:42:15 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201510270042.t9R0gFID081191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 27 Oct 2015 00:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290028 - in head/sys: netinet netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 00:42:17 -0000 Author: gnn Date: Tue Oct 27 00:42:15 2015 New Revision: 290028 URL: https://svnweb.freebsd.org/changeset/base/290028 Log: Turning on IPSEC used to introduce a slight amount of performance degradation (7%) for host host TCP connections over 10Gbps links, even when there were no secuirty policies in place. There is no change in performance on 1Gbps network links. Testing GENERIC vs. GENERIC-NOIPSEC vs. GENERIC with this change shows that the new code removes any overhead introduced by having IPSEC always in the kernel. Differential Revision: D3993 MFC after: 1 month Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/netinet/ip_ipsec.c head/sys/netinet/tcp_subr.c head/sys/netipsec/ipsec.c Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Tue Oct 27 00:37:19 2015 (r290027) +++ head/sys/netinet/ip_ipsec.c Tue Oct 27 00:42:15 2015 (r290028) @@ -158,6 +158,10 @@ int ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *error) { struct secpolicy *sp; + + if (!key_havesp(IPSEC_DIR_INBOUND)) + return 0; + /* * Check the security policy (SP) for the packet and, if * required, do IPsec-related processing. There are two Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Oct 27 00:37:19 2015 (r290027) +++ head/sys/netinet/tcp_subr.c Tue Oct 27 00:42:15 2015 (r290028) @@ -1972,7 +1972,8 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) #endif struct tcphdr *th; - if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL)) + if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL) || + (!key_havesp(IPSEC_DIR_OUTBOUND))) return (0); m = m_gethdr(M_NOWAIT, MT_DATA); if (!m) Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Tue Oct 27 00:37:19 2015 (r290027) +++ head/sys/netipsec/ipsec.c Tue Oct 27 00:42:15 2015 (r290028) @@ -1276,6 +1276,9 @@ ipsec46_in_reject(struct mbuf *m, struct int error; int result; + if (!key_havesp(IPSEC_DIR_INBOUND)) + return 0; + IPSEC_ASSERT(m != NULL, ("null mbuf")); /* Get SP for this packet. */ @@ -1403,6 +1406,9 @@ ipsec_hdrsiz(struct mbuf *m, u_int dir, int error; size_t size; + if (!key_havesp(dir)) + return 0; + IPSEC_ASSERT(m != NULL, ("null mbuf")); /* Get SP for this packet. */ From owner-svn-src-head@freebsd.org Tue Oct 27 00:44:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84D5384CF; Tue, 27 Oct 2015 00:44:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 6D33E1A10; Tue, 27 Oct 2015 00:44:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 668111BE7; Tue, 27 Oct 2015 00:44:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1C18C1602A; Tue, 27 Oct 2015 00:44:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 0aUM0HZv6Tcp; Tue, 27 Oct 2015 00:44:10 +0000 (UTC) Subject: Re: svn commit: r289269 - head/usr.sbin/tzsetup DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 06FB716024 To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510132255.t9DMtHpe000697@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <562EC8D6.6050609@FreeBSD.org> Date: Mon, 26 Oct 2015 17:44:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510132255.t9DMtHpe000697@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BVVRFqB6ueBHfBQxpkoU7GcQ5aCFx2u66" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 00:44:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BVVRFqB6ueBHfBQxpkoU7GcQ5aCFx2u66 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/13/2015 3:55 PM, Xin LI wrote: > Author: delphij > Date: Tue Oct 13 22:55:17 2015 > New Revision: 289269 > URL: https://svnweb.freebsd.org/changeset/base/289269 >=20 > Log: > Use chroot(2) instead of using prefixes for files. > =20 > Previously, the code prefixes the chroot path to actual file paths to= > simulate the effect. This, however, will not work for tzset(3) which= > expects the current system have a working set of timezone data files,= > and that is not always the case. > =20 > This changeset simplifies the handling of paths and use an actual > chroot(2) call to implement the effect. > =20 > PR: bin/197313 > MFC after: 2 weeks >=20 > Modified: > head/usr.sbin/tzsetup/tzsetup.c >=20 > Modified: head/usr.sbin/tzsetup/tzsetup.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 21:34:54 2015 (r289268) > +++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 22:55:17 2015 (r289269) > @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > =20 > @@ -944,23 +945,18 @@ main(int argc, char **argv) > if (argc - optind > 1) > usage(); > =20 > - if (chrootenv =3D=3D NULL) { I would think there would be a reason for not really using chroot(2) here, such as preparing images as non-root. --=20 Regards, Bryan Drewery --BVVRFqB6ueBHfBQxpkoU7GcQ5aCFx2u66 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWLsjWAAoJEDXXcbtuRpfP3vQH/1VDHyBu7YdV38ANcjTUxFCe t7yn8PvvWIAoobcrBteZfoPY2r1pXcx1S2tmn0aP1+F1/MEsL1lSbYAerkXHk+ts OF/KLTKyKLr39LfveuN2t9hKJ1ek1bXT5XeJInIhcan4RaqqhMFLhmR1IJ0xnRyr 0zyqifmgISBsvVUFQNLHt+HhpyxDr4eB5LmxJgVPtf8hqbgyMC07KxbLvXQaig3N vadOTKBhUFndNjJv0docfdnU1JuVLfKVdl0Wxqd62QqU345tFP3E+GHVHMtvFr6w 7dIwOwEmSy+Xxqzf8WL9uOzefWjcUc4MP+cd7OiPqN0zh0sLzaQfZUFKa8R1wFY= =SDfV -----END PGP SIGNATURE----- --BVVRFqB6ueBHfBQxpkoU7GcQ5aCFx2u66-- From owner-svn-src-head@freebsd.org Tue Oct 27 00:57:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3043F878F; Tue, 27 Oct 2015 00:57:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2DBC1FE0; Tue, 27 Oct 2015 00:57:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R0v66L084253; Tue, 27 Oct 2015 00:57:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R0v6Xr084252; Tue, 27 Oct 2015 00:57:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510270057.t9R0v6Xr084252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 27 Oct 2015 00:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290029 - head/sys/dev/otus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 00:57:08 -0000 Author: adrian Date: Tue Oct 27 00:57:06 2015 New Revision: 290029 URL: https://svnweb.freebsd.org/changeset/base/290029 Log: otus(4) - monitor mode fixes, large-mbuf crash fix * refactor out the rx filter and operating mode code into a separate method. * add some comments about what's left with setting the operating mode based on what carl9170 does. * comment out some init from otus_init_mac() - it's no longer needed as it's always init'ed now. * add debugging and a missing return around a failure to call m_get2() - during monitor mode operation I found RXing of frames > 2k, which fails allocation. I'm sure they're valid (it's configuring 11n RX and receiving 11n frames even though the driver doesn't "do" 11n) and may be A-MSDU; but allocations fail and we should handle that gracefully. Tested: * UB82 reference NIC (AR9170 + AR9104 2x2 dual band NIC); STA and monitor mode operation. Modified: head/sys/dev/otus/if_otus.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Tue Oct 27 00:42:15 2015 (r290028) +++ head/sys/dev/otus/if_otus.c Tue Oct 27 00:57:06 2015 (r290029) @@ -1645,8 +1645,8 @@ otus_sub_rxeof(struct otus_softc *sc, ui } tail = (struct ar_rx_tail *)(plcp + len - sizeof (*tail)); - /* Discard error frames. */ - if (__predict_false(tail->error != 0)) { + /* Discard error frames; don't discard BAD_RA (eg monitor mode); let net80211 do that */ + if (__predict_false((tail->error & ~AR_RX_ERROR_BAD_RA) != 0)) { OTUS_DPRINTF(sc, OTUS_DEBUG_RXDONE, "error frame 0x%02x\n", tail->error); if (tail->error & AR_RX_ERROR_FCS) { OTUS_DPRINTF(sc, OTUS_DEBUG_RXDONE, "bad FCS\n"); @@ -1671,10 +1671,14 @@ otus_sub_rxeof(struct otus_softc *sc, ui wh = (struct ieee80211_frame *)(plcp + AR_PLCP_HDR_LEN); + /* + * TODO: I see > 2KiB buffers in this path; is it A-MSDU or something? + */ m = m_get2(mlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { - device_printf(sc->sc_dev, "%s: failed m_get2()\n", __func__); + device_printf(sc->sc_dev, "%s: failed m_get2() (mlen=%d)\n", __func__, mlen); counter_u64_add(ic->ic_ierrors, 1); + return; } /* Finalize mbuf. */ @@ -2469,8 +2473,8 @@ otus_init_mac(struct otus_softc *sc) otus_write(sc, AR_MAC_REG_BACKOFF_PROTECT, 0x105); otus_write(sc, AR_MAC_REG_AMPDU_FACTOR, 0x10000a); /* Filter any control frames, BAR is bit 24. */ - otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0x0500ffff); - otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); +// otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0x0500ffff); +// otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); otus_write(sc, AR_MAC_REG_BASIC_RATE, 0x150f); otus_write(sc, AR_MAC_REG_MANDATORY_RATE, 0x150f); otus_write(sc, AR_MAC_REG_RTS_CTS_RATE, 0x10b01bb); @@ -3070,6 +3074,57 @@ otus_led_newstate_type3(struct otus_soft #endif } +/* + * TODO: + * + * + If in monitor mode, set BSSID to all zeros, else the node BSSID. + * + Handle STA + monitor (eg tcpdump/promisc/radiotap) as well as + * pure monitor mode. + */ +static int +otus_set_operating_mode(struct otus_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t rx_ctrl; + uint32_t frm_filt; + uint32_t cam_mode; + uint32_t rx_sniffer; + + OTUS_LOCK_ASSERT(sc); + + /* XXX TODO: too many magic constants */ + rx_ctrl = 0x1; + /* Filter any control frames, BAR is bit 24. */ + frm_filt = 0x0500ffff; + cam_mode = 0x0f000002; /* XXX STA */ + rx_sniffer = 0x20000000; + + switch (ic->ic_opmode) { + case IEEE80211_M_STA: + cam_mode = 0x0f000002; /* XXX STA */ + rx_ctrl = 0x1; + frm_filt = 0x0500ffff; + rx_sniffer = 0x20000000; + break; + case IEEE80211_M_MONITOR: + cam_mode = 0x0f000002; /* XXX STA */ + rx_ctrl = 0x1; + frm_filt = 0xffffffff; + rx_sniffer = 0x20000001; + break; + default: + break; + } + + otus_write(sc, AR_MAC_REG_SNIFFER, rx_sniffer); + otus_write(sc, AR_MAC_REG_CAM_MODE, cam_mode); + otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, frm_filt); + otus_write(sc, AR_MAC_REG_RX_CONTROL, cam_mode); + + (void) otus_write_barrier(sc); + return (0); +} + int otus_init(struct otus_softc *sc) { @@ -3092,48 +3147,7 @@ otus_init(struct otus_softc *sc) } (void) otus_set_macaddr(sc, ic->ic_macaddr); - -#if 0 - switch (ic->ic_opmode) { -#ifdef notyet -#ifndef IEEE80211_STA_ONLY - case IEEE80211_M_HOSTAP: - otus_write(sc, AR_MAC_REG_CAM_MODE, 0x0f0000a1); - otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); - break; - case IEEE80211_M_IBSS: - otus_write(sc, AR_MAC_REG_CAM_MODE, 0x0f000000); - otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); - break; -#endif -#endif - case IEEE80211_M_STA: - otus_write(sc, AR_MAC_REG_CAM_MODE, 0x0f000002); - otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); - break; - default: - break; - } -#endif - - switch (ic->ic_opmode) { - case IEEE80211_M_STA: - otus_write(sc, AR_MAC_REG_CAM_MODE, 0x0f000002); - otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1); - /* XXX set frametype filter? */ - break; - case IEEE80211_M_MONITOR: - otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0xffffffff); - break; - default: - break; - } - - /* XXX ic_opmode? */ - otus_write(sc, AR_MAC_REG_SNIFFER, - (ic->ic_opmode == IEEE80211_M_MONITOR) ? 0x2000001 : 0x2000000); - - (void)otus_write_barrier(sc); + (void) otus_set_operating_mode(sc); sc->bb_reset = 1; /* Force cold reset. */ From owner-svn-src-head@freebsd.org Tue Oct 27 01:07:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56087897E; Tue, 27 Oct 2015 01:07:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (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 223061452; Tue, 27 Oct 2015 01:07:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbkq10 with SMTP id kq10so71882244igb.0; Mon, 26 Oct 2015 18:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XZgQZ3Xl9MfQ+P3W5W8NxOjYSkZZn+YZk6w1N8Zm0NI=; b=h+FPDkipJ3qgp5SQfveNNE6Dz13hTqatpax/sAHwXaZI8UKVKkKfvokV/glVf0jQQh cFfQIyjd2E4g+KBlrhh8JT8ecSbQGE/+ZVsLkjjrxggjoBVkxNDkCxhtDq6tD+V6gzIg 6TlQMV++feV5ihJaYhyK9rKas8/slLqAMJ7vI7jImoXXtk9/u1F8zX3eO7fmGyJucAVu q+l1j7c3sOXrE7cUK6nej4sn0ldY2Si9Df41rtKsARpmLiJKwDduyMAIme75QEyjZ9Ff w8eZ/BgxGWrDqAHHRpvblzjagNK0XbacnSwuP6Yw+er4Xx3V5hvNEKxULP6556DV8mRF uNbQ== MIME-Version: 1.0 X-Received: by 10.50.85.17 with SMTP id d17mr22510923igz.37.1445908041618; Mon, 26 Oct 2015 18:07:21 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Mon, 26 Oct 2015 18:07:21 -0700 (PDT) In-Reply-To: <562EC8D6.6050609@FreeBSD.org> References: <201510132255.t9DMtHpe000697@repo.freebsd.org> <562EC8D6.6050609@FreeBSD.org> Date: Mon, 26 Oct 2015 20:07:21 -0500 Message-ID: Subject: Re: svn commit: r289269 - head/usr.sbin/tzsetup From: Adrian Chadd To: Bryan Drewery Cc: Xin LI , "src-committers@freebsd.org" , "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.20 Precedence: list List-Id: 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, 27 Oct 2015 01:07:22 -0000 Hi, Please don't break non-root builds. I may get stabby. :) -adrian On 26 October 2015 at 19:44, Bryan Drewery wrote: > On 10/13/2015 3:55 PM, Xin LI wrote: >> Author: delphij >> Date: Tue Oct 13 22:55:17 2015 >> New Revision: 289269 >> URL: https://svnweb.freebsd.org/changeset/base/289269 >> >> Log: >> Use chroot(2) instead of using prefixes for files. >> >> Previously, the code prefixes the chroot path to actual file paths to >> simulate the effect. This, however, will not work for tzset(3) which >> expects the current system have a working set of timezone data files, >> and that is not always the case. >> >> This changeset simplifies the handling of paths and use an actual >> chroot(2) call to implement the effect. >> >> PR: bin/197313 >> MFC after: 2 weeks >> >> Modified: >> head/usr.sbin/tzsetup/tzsetup.c >> >> Modified: head/usr.sbin/tzsetup/tzsetup.c >> ============================================================================== >> --- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 21:34:54 2015 (r289268) >> +++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 22:55:17 2015 (r289269) >> @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> >> @@ -944,23 +945,18 @@ main(int argc, char **argv) >> if (argc - optind > 1) >> usage(); >> >> - if (chrootenv == NULL) { > > I would think there would be a reason for not really using chroot(2) > here, such as preparing images as non-root. > > -- > Regards, > Bryan Drewery > From owner-svn-src-head@freebsd.org Tue Oct 27 01:24:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1C08E6B; Tue, 27 Oct 2015 01:24:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B9511E52; Tue, 27 Oct 2015 01:24:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R1Ovt6092917; Tue, 27 Oct 2015 01:24:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R1OvXf092915; Tue, 27 Oct 2015 01:24:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510270124.t9R1OvXf092915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 01:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290030 - in head/libexec/dma: dma-mbox-create dmagent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 01:24:59 -0000 Author: bdrewery Date: Tue Oct 27 01:24:57 2015 New Revision: 290030 URL: https://svnweb.freebsd.org/changeset/base/290030 Log: Add Makefile.depend Added: head/libexec/dma/dma-mbox-create/Makefile.depend (contents, props changed) head/libexec/dma/dmagent/Makefile.depend (contents, props changed) Added: head/libexec/dma/dma-mbox-create/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/dma/dma-mbox-create/Makefile.depend Tue Oct 27 01:24:57 2015 (r290030) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + secure/lib/libcrypto \ + secure/lib/libssl \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/libexec/dma/dmagent/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/dma/dmagent/Makefile.depend Tue Oct 27 01:24:57 2015 (r290030) @@ -0,0 +1,29 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + secure/lib/libcrypto \ + secure/lib/libssl \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +aliases_parse.o: aliases_parse.c +aliases_parse.o: aliases_parse.h +aliases_parse.po: aliases_parse.c +aliases_parse.po: aliases_parse.h +aliases_scan.o: aliases_parse.h +aliases_scan.o: aliases_scan.c +aliases_scan.po: aliases_parse.h +aliases_scan.po: aliases_scan.c +.endif From owner-svn-src-head@freebsd.org Tue Oct 27 01:25:24 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B768EC2; Tue, 27 Oct 2015 01:25:24 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 824231FAC; Tue, 27 Oct 2015 01:25:22 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 6AFEA2A16A; Mon, 26 Oct 2015 18:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1445909121; x=1445923521; bh=DlOFPV7hYDLDnDd8iB6Fgq6chXaeHU9USdKHkxFfwBY=; h=Reply-To:Subject:References:To:Cc:From:Date:In-Reply-To; b=Q7Kztpn4YoMnNvC4RAsghCDq1Evc8uyMXIuYw+NeW736Mejh3BCBbT5AJGWmMGVEw cXHBWm+moP/HH2ydd3NEIcMCB9cTzYezOUxb1NpRaLFm9xGEVtFQoRS5lJzJAminmM Lv15qnVyLsv1lrj2hQJqcC1zMID1R+sNvCH2uZGo= Reply-To: d@delphij.net Subject: Re: svn commit: r289269 - head/usr.sbin/tzsetup References: <201510132255.t9DMtHpe000697@repo.freebsd.org> <562EC8D6.6050609@FreeBSD.org> To: Adrian Chadd , Bryan Drewery Cc: Xin LI , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Xin Li Organization: The FreeBSD Project Message-ID: <562ED280.2030307@delphij.net> Date: Mon, 26 Oct 2015 18:25:20 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4fHAqkBBRaXfFUoEPB2lxEwUlX5kUpdr6" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 01:25:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4fHAqkBBRaXfFUoEPB2lxEwUlX5kUpdr6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/26/15 18:07, Adrian Chadd wrote: > Hi, >=20 > Please don't break non-root builds. I may get stabby. >=20 > :) Will revert now. > -adrian >=20 >=20 > On 26 October 2015 at 19:44, Bryan Drewery wrote= : >> On 10/13/2015 3:55 PM, Xin LI wrote: >>> Author: delphij >>> Date: Tue Oct 13 22:55:17 2015 >>> New Revision: 289269 >>> URL: https://svnweb.freebsd.org/changeset/base/289269 >>> >>> Log: >>> Use chroot(2) instead of using prefixes for files. >>> >>> Previously, the code prefixes the chroot path to actual file paths = to >>> simulate the effect. This, however, will not work for tzset(3) whi= ch >>> expects the current system have a working set of timezone data file= s, >>> and that is not always the case. >>> >>> This changeset simplifies the handling of paths and use an actual >>> chroot(2) call to implement the effect. >>> >>> PR: bin/197313 >>> MFC after: 2 weeks >>> >>> Modified: >>> head/usr.sbin/tzsetup/tzsetup.c >>> >>> Modified: head/usr.sbin/tzsetup/tzsetup.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 21:34:54 2015 = (r289268) >>> +++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 22:55:17 2015 = (r289269) >>> @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> >>> @@ -944,23 +945,18 @@ main(int argc, char **argv) >>> if (argc - optind > 1) >>> usage(); >>> >>> - if (chrootenv =3D=3D NULL) { >> >> I would think there would be a reason for not really using chroot(2) >> here, such as preparing images as non-root. >> >> -- >> Regards, >> Bryan Drewery >> >=20 --=20 Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die --4fHAqkBBRaXfFUoEPB2lxEwUlX5kUpdr6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.8 (FreeBSD) iQIcBAEBCgAGBQJWLtKAAAoJEJW2GBstM+ns3VAP/RcaHOdnMYdpXtjzyifin0E7 PuCRJBZ/QLRG9jI+g6KkGQlXtj5DX8K33FBOoenolJAS1peZ3kNuO2Q8lOCLUr/L Feldx49gA50TQyPgvCWINWdSUVK+6Nc7rF7ETFM3RL9hCqZGJ8P1k2s7HmzgzxoJ UExXBzSgGprUVJFTh63oytcRYwhElvWa9XZOG8mMmL5GaAUziLeROqxi0vSExD33 cNdBsZKgTih087aFAvPENhNziULYWGrMaLKWnxlWA/xfNTXII53tlsAaJcVrVJdE hi/IhtmPDZr5fGS3+m9QLDoUcI4smVn+BnfAS/cQk7At8RB0kuYZ9En+jMB8pn/C MNn4OiP24DGKA/kk3okPJvcugLBLSEp1QfAAg2VUaK49AW3R2hkzcdmXYoXq4EXK 62Xvahz58UcjTl0GWiJu9bi0eMPdlKyE+LvWszd3RVjV5r+31FsCe8sp0hCVevsk JCjWBgeJgpXzsg2L+yv/1ORWhbIMvFFFQwOPCojMv0MpuCQz5SYRB3UAX0FEr489 myEQOLiircnhNesKO1FuBt5lJTvMBbBMSR9z/v8t/onmiyXjrAm1olH5CnButK+A v/TcZEHcUoYvh1LcH4Tu7rfY9vtUZgz162aen+deVO8pwrIXvOnCSJbSRP/KYD6q Thi8fzr03QBjDmRLRb1L =jT3W -----END PGP SIGNATURE----- --4fHAqkBBRaXfFUoEPB2lxEwUlX5kUpdr6-- From owner-svn-src-head@freebsd.org Tue Oct 27 01:26:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 517378F3B; Tue, 27 Oct 2015 01:26:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04A281111; Tue, 27 Oct 2015 01:26:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R1QpfK093027; Tue, 27 Oct 2015 01:26:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R1QpQv093026; Tue, 27 Oct 2015 01:26:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201510270126.t9R1QpQv093026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 27 Oct 2015 01:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290031 - head/usr.sbin/tzsetup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 01:26:52 -0000 Author: delphij Date: Tue Oct 27 01:26:50 2015 New Revision: 290031 URL: https://svnweb.freebsd.org/changeset/base/290031 Log: Revert r289269 for now. After looking at share/zoneinfo/Makefile this could potentially break non-root installs and we need a better solution, probably by doing it differently when no UI is involved. Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 27 01:24:57 2015 (r290030) +++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 27 01:26:50 2015 (r290031) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -945,18 +944,23 @@ main(int argc, char **argv) if (argc - optind > 1) usage(); - if (chrootenv != NULL) { - rv = chroot(chrootenv); - if (rv != 0) - err(EX_OSERR, "chroot to %s", chrootenv); + if (chrootenv == NULL) { + strcpy(path_zonetab, _PATH_ZONETAB); + strcpy(path_iso3166, _PATH_ISO3166); + strcpy(path_zoneinfo, _PATH_ZONEINFO); + strcpy(path_localtime, _PATH_LOCALTIME); + strcpy(path_db, _PATH_DB); + strcpy(path_wall_cmos_clock, _PATH_WALL_CMOS_CLOCK); + } else { + sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB); + sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166); + sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO); + sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME); + sprintf(path_db, "%s/%s", chrootenv, _PATH_DB); + sprintf(path_wall_cmos_clock, "%s/%s", chrootenv, + _PATH_WALL_CMOS_CLOCK); } - strcpy(path_zonetab, _PATH_ZONETAB); - strcpy(path_iso3166, _PATH_ISO3166); - strcpy(path_zoneinfo, _PATH_ZONEINFO); - strcpy(path_localtime, _PATH_LOCALTIME); - strcpy(path_db, _PATH_DB); - strcpy(path_wall_cmos_clock, _PATH_WALL_CMOS_CLOCK); /* Override the user-supplied umask. */ (void)umask(S_IWGRP | S_IWOTH); From owner-svn-src-head@freebsd.org Tue Oct 27 01:29:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD96A1C0C0; Tue, 27 Oct 2015 01:29:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ABE317A0; Tue, 27 Oct 2015 01:29:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R1TcS5093262; Tue, 27 Oct 2015 01:29:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R1TcAN093261; Tue, 27 Oct 2015 01:29:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510270129.t9R1TcAN093261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 01:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290034 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 01:29:39 -0000 Author: bdrewery Date: Tue Oct 27 01:29:38 2015 New Revision: 290034 URL: https://svnweb.freebsd.org/changeset/base/290034 Log: META MODE: Fix after addition of bsd.confs.mk: Stage in "files" set. The "files" staging name is not the same as "bsd.files.mk" but seems to just be a group of extra files that are not the essential includes or libraries, which include . Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.confs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Tue Oct 27 01:28:11 2015 (r290033) +++ head/share/mk/bsd.confs.mk Tue Oct 27 01:29:38 2015 (r290034) @@ -44,7 +44,6 @@ STAGE_AS_${cnf:T}= ${${group}NAME_${cnf: # XXX {group}OWN,GRP,MODE STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} stage_as.${cnf:T}: ${cnf} -stage_config: stage_as.${cnf:T} installconfig: _${group}INS_${cnf:T} _${group}INS_${cnf:T}: ${cnf} @@ -58,7 +57,6 @@ _${group}CONFS+= ${cnf} .endfor .if !empty(_${group}CONFS) stage_files.${group}: ${_${group}CONFS} -stage_config: stage_files.${group} installconfig: _${group}INS _${group}INS: ${_${group}CONFS} @@ -76,8 +74,12 @@ _${group}INS: ${_${group}CONFS} .endif # !target(installconfig) -.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) -.if !defined(NO_STAGE_CONFIG) -STAGE_TARGETS+= stage_config +.if ${MK_STAGING} != "no" +.if !empty(STAGE_SETS) +buildconfig: stage_files +.if !empty(STAGE_AS_SETS) +buildconfig: stage_as .endif .endif +.endif + From owner-svn-src-head@freebsd.org Tue Oct 27 02:04:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA2E0A1C848; Tue, 27 Oct 2015 02:04:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A435314F3; Tue, 27 Oct 2015 02:04:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R24Lai004634; Tue, 27 Oct 2015 02:04:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R24Luo004633; Tue, 27 Oct 2015 02:04:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510270204.t9R24Luo004633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 02:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290035 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 02:04:23 -0000 Author: bdrewery Date: Tue Oct 27 02:04:21 2015 New Revision: 290035 URL: https://svnweb.freebsd.org/changeset/base/290035 Log: Spell CONFGROUPS properly. Modified: head/share/mk/bsd.confs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Tue Oct 27 01:29:38 2015 (r290034) +++ head/share/mk/bsd.confs.mk Tue Oct 27 02:04:21 2015 (r290035) @@ -7,7 +7,7 @@ CONFGROUPS?= CONFS .if !target(buildconfig) -.for group in ${CONFSGROUPS} +.for group in ${CONFGROUPS} buildconfig: ${${group}} .endfor .endif From owner-svn-src-head@freebsd.org Tue Oct 27 02:41:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE75A1D2AA; Tue, 27 Oct 2015 02:41:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (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 38548188C; Tue, 27 Oct 2015 02:41:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igpw7 with SMTP id w7so295328igp.1; Mon, 26 Oct 2015 19:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WnCUaqbPHpNsTBRhr0BO8BOHwpBPsWOHbKKaGl1WZL8=; b=Llzm4+T/GVsr3Y3DN1++2AUc+K3VOQI9S758Nz1yiwVcRXaW4bOI8Ynla6i5Kb550E y8U2hvwYYN7+6VWWTFPuNumJij/eNATXcgHO0sFim4NeMOcNoTg00qEwAplaZdY8IR5G IAMwrH3NFQQ3smMJexYizhSkTNMqgbX6d83mNppdIGi9HzHz7YlOt/4Zbz1CF/VYsmZY kI0ErdmiYvatoAx7y8zvEzKqAc4zfnFn9zFPxb/sNaGuteYQuZwXS8fY97yyanYuFkFC fCtmE/ny8GDOblze6a1o0wsIRXIq6PlckhaQVtoJrUZOOXIYfod04rSkUTss2LHTJmgU GM2g== MIME-Version: 1.0 X-Received: by 10.50.178.141 with SMTP id cy13mr21293572igc.61.1445913682546; Mon, 26 Oct 2015 19:41:22 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Mon, 26 Oct 2015 19:41:22 -0700 (PDT) In-Reply-To: <562ED280.2030307@delphij.net> References: <201510132255.t9DMtHpe000697@repo.freebsd.org> <562EC8D6.6050609@FreeBSD.org> <562ED280.2030307@delphij.net> Date: Mon, 26 Oct 2015 21:41:22 -0500 Message-ID: Subject: Re: svn commit: r289269 - head/usr.sbin/tzsetup From: Adrian Chadd To: Xin LI Cc: Bryan Drewery , Xin LI , "src-committers@freebsd.org" , "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.20 Precedence: list List-Id: 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, 27 Oct 2015 02:41:23 -0000 aw thanks I would really love to see a non-terrible way to do this stuff. :( -a On 26 October 2015 at 20:25, Xin Li wrote: > On 10/26/15 18:07, Adrian Chadd wrote: >> Hi, >> >> Please don't break non-root builds. I may get stabby. >> >> :) > > Will revert now. > >> -adrian >> >> >> On 26 October 2015 at 19:44, Bryan Drewery wrote: >>> On 10/13/2015 3:55 PM, Xin LI wrote: >>>> Author: delphij >>>> Date: Tue Oct 13 22:55:17 2015 >>>> New Revision: 289269 >>>> URL: https://svnweb.freebsd.org/changeset/base/289269 >>>> >>>> Log: >>>> Use chroot(2) instead of using prefixes for files. >>>> >>>> Previously, the code prefixes the chroot path to actual file paths to >>>> simulate the effect. This, however, will not work for tzset(3) which >>>> expects the current system have a working set of timezone data files, >>>> and that is not always the case. >>>> >>>> This changeset simplifies the handling of paths and use an actual >>>> chroot(2) call to implement the effect. >>>> >>>> PR: bin/197313 >>>> MFC after: 2 weeks >>>> >>>> Modified: >>>> head/usr.sbin/tzsetup/tzsetup.c >>>> >>>> Modified: head/usr.sbin/tzsetup/tzsetup.c >>>> ============================================================================== >>>> --- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 21:34:54 2015 (r289268) >>>> +++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 13 22:55:17 2015 (r289269) >>>> @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); >>>> #include >>>> #include >>>> #include >>>> +#include >>>> #include >>>> #include >>>> >>>> @@ -944,23 +945,18 @@ main(int argc, char **argv) >>>> if (argc - optind > 1) >>>> usage(); >>>> >>>> - if (chrootenv == NULL) { >>> >>> I would think there would be a reason for not really using chroot(2) >>> here, such as preparing images as non-root. >>> >>> -- >>> Regards, >>> Bryan Drewery >>> >> > > > -- > Xin LI https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die > From owner-svn-src-head@freebsd.org Tue Oct 27 03:42:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 842F4A1EC5C; Tue, 27 Oct 2015 03:42:29 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 236801D37; Tue, 27 Oct 2015 03:42:29 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R3gSkL033808; Tue, 27 Oct 2015 03:42:28 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R3gQ3O033792; Tue, 27 Oct 2015 03:42:26 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201510270342.t9R3gQ3O033792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 27 Oct 2015 03:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290038 - in head/sys/netgraph/bluetooth: hci include l2cap socket X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 03:42:29 -0000 Author: takawata Date: Tue Oct 27 03:42:26 2015 New Revision: 290038 URL: https://svnweb.freebsd.org/changeset/base/290038 Log: Bluetooth LE Security Management channel support. Add a socket option to block until underlying HCI connection encrypted. Differential Revision: https://reviews.freebsd.org/D3981 Modified: head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.h head/sys/netgraph/bluetooth/include/ng_btsocket.h head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h head/sys/netgraph/bluetooth/include/ng_hci.h head/sys/netgraph/bluetooth/include/ng_l2cap.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Modified: head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c ============================================================================== --- head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/hci/ng_hci_evnt.c Tue Oct 27 03:42:26 2015 (r290038) @@ -929,7 +929,7 @@ encryption_change(ng_hci_unit_p unit, st "%s: %s - invalid connection handle=%d\n", __func__, NG_NODE_NAME(unit->node), h); error = ENOENT; - } else if (con->link_type != NG_HCI_LINK_ACL) { + } else if (con->link_type == NG_HCI_LINK_SCO) { NG_HCI_ALERT( "%s: %s - invalid link type=%d\n", __func__, NG_NODE_NAME(unit->node), @@ -940,6 +940,7 @@ encryption_change(ng_hci_unit_p unit, st con->encryption_mode = NG_HCI_ENCRYPTION_MODE_P2P; else con->encryption_mode = NG_HCI_ENCRYPTION_MODE_NONE; + ng_hci_lp_enc_change(con, ep->encryption_enable); } else NG_HCI_ERR( "%s: %s - failed to change encryption mode, status=%d\n", Modified: head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c ============================================================================== --- head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c Tue Oct 27 03:42:26 2015 (r290038) @@ -814,6 +814,37 @@ ng_hci_lp_con_cfm(ng_hci_unit_con_p con, return (0); } /* ng_hci_lp_con_cfm */ +int +ng_hci_lp_enc_change(ng_hci_unit_con_p con, int status) +{ + ng_hci_unit_p unit = con->unit; + struct ng_mesg *msg = NULL; + ng_hci_lp_enc_change_ep *ep = NULL; + int error; + + + if (con->link_type != NG_HCI_LINK_SCO) { + if (unit->acl != NULL && NG_HOOK_IS_VALID(unit->acl)) { + NG_MKMESSAGE(msg, NGM_HCI_COOKIE, NGM_HCI_LP_ENC_CHG, + sizeof(*ep), M_NOWAIT); + if (msg != NULL) { + ep = (ng_hci_lp_enc_change_ep *) msg->data; + ep->status = status; + ep->link_type = con->link_type; + ep->con_handle = con->con_handle; + + NG_SEND_MSG_HOOK(error, unit->node, msg, + unit->acl, 0); + } + } else + NG_HCI_INFO( +"%s: %s - ACL hook not valid, hook=%p\n", + __func__, NG_NODE_NAME(unit->node), unit->acl); + + } + return (0); +} /* ng_hci_lp_con_cfm */ + /* * Send LP_ConnectInd event to the upper layer protocol */ Modified: head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.h ============================================================================== --- head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/hci/ng_hci_ulpi.h Tue Oct 27 03:42:26 2015 (r290038) @@ -47,6 +47,7 @@ int ng_hci_lp_discon_ind int ng_hci_lp_qos_req (ng_hci_unit_p, item_p, hook_p); int ng_hci_lp_qos_cfm (ng_hci_unit_con_p, int); int ng_hci_lp_qos_ind (ng_hci_unit_con_p); +int ng_hci_lp_enc_change (ng_hci_unit_con_p, int); void ng_hci_process_con_timeout (node_p, hook_p, void *, int); Modified: head/sys/netgraph/bluetooth/include/ng_btsocket.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_btsocket.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/include/ng_btsocket.h Tue Oct 27 03:42:26 2015 (r290038) @@ -255,7 +255,7 @@ struct sockaddr_l2cap { #define SO_L2CAP_IFLOW 3 /* get incoming flow spec. */ #define SO_L2CAP_OFLOW 4 /* get/set outgoing flow spec. */ #define SO_L2CAP_FLUSH 5 /* get/set flush timeout */ - +#define SO_L2CAP_ENCRYPTED 6 /* get/set whether wait for encryptin on connect */ /* * Raw L2CAP sockets ioctl's */ Modified: head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h Tue Oct 27 03:42:26 2015 (r290038) @@ -136,7 +136,7 @@ struct ng_btsocket_l2cap_pcb { u_int16_t psm; /* PSM */ u_int16_t cid; /* Local channel ID */ - + uint8_t idtype; u_int16_t flags; /* socket flags */ #define NG_BTSOCKET_L2CAP_CLIENT (1 << 0) /* socket is client */ #define NG_BTSOCKET_L2CAP_TIMO (1 << 1) /* timeout pending */ @@ -147,6 +147,7 @@ struct ng_btsocket_l2cap_pcb { #define NG_BTSOCKET_L2CAP_CONFIGURING 2 /* wait for config */ #define NG_BTSOCKET_L2CAP_OPEN 3 /* socket open */ #define NG_BTSOCKET_L2CAP_DISCONNECTING 4 /* wait for disconnect */ +#define NG_BTSOCKET_L2CAP_W4_ENC_CHANGE 5 u_int8_t cfg_state; /* config state */ #define NG_BTSOCKET_L2CAP_CFG_IN (1 << 0) /* incoming path done */ @@ -156,7 +157,7 @@ struct ng_btsocket_l2cap_pcb { #define NG_BTSOCKET_L2CAP_CFG_IN_SENT (1 << 2) /* L2CAP ConfigReq sent */ #define NG_BTSOCKET_L2CAP_CFG_OUT_SENT (1 << 3) /* ---/--- */ - + uint8_t encryption; u_int16_t imtu; /* Incoming MTU */ ng_l2cap_flow_t iflow; /* Input flow spec */ @@ -172,7 +173,8 @@ struct ng_btsocket_l2cap_pcb { ng_btsocket_l2cap_rtentry_p rt; /* routing info */ struct mtx pcb_mtx; /* pcb mutex */ - + uint16_t need_encrypt; /*encryption needed*/ + LIST_ENTRY(ng_btsocket_l2cap_pcb) next; /* link to next PCB */ }; typedef struct ng_btsocket_l2cap_pcb ng_btsocket_l2cap_pcb_t; Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Tue Oct 27 03:42:26 2015 (r290038) @@ -469,7 +469,13 @@ typedef struct { typedef struct { u_int16_t con_handle; /* connection handle */ } ng_hci_lp_qos_ind_ep; - +/*Encryption Change event*/ +#define NGM_HCI_LP_ENC_CHG 10 /* HCI->Upper*/ +typedef struct { + uint16_t con_handle; + uint8_t status; + uint8_t link_type; +}ng_hci_lp_enc_change_ep; /************************************************************************** ************************************************************************** ** HCI node command/event parameters Modified: head/sys/netgraph/bluetooth/include/ng_l2cap.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_l2cap.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/include/ng_l2cap.h Tue Oct 27 03:42:26 2015 (r290038) @@ -256,6 +256,7 @@ typedef union { u_int16_t mtu; /* NG_L2CAP_OPT_MTU */ u_int16_t flush_timo; /* NG_L2CAP_OPT_FLUSH_TIMO */ ng_l2cap_flow_t flow; /* NG_L2CAP_OPT_QOS */ + uint16_t encryption; } ng_l2cap_cfg_opt_val_t; typedef ng_l2cap_cfg_opt_val_t * ng_l2cap_cfg_opt_val_p; @@ -357,6 +358,7 @@ typedef struct { #define NG_L2CAP_L2CA_IDTYPE_BREDR 0 #define NG_L2CAP_L2CA_IDTYPE_ATT 1 #define NG_L2CAP_L2CA_IDTYPE_LE 2 +#define NG_L2CAP_L2CA_IDTYPE_SMP 3 /* L2CA_Connect */ #define NGM_L2CAP_L2CA_CON 0x80 /* Upper -> L2CAP */ @@ -373,6 +375,7 @@ typedef struct { uint16_t idtype; /*ID type*/ u_int16_t result; /* 0x00 - success */ u_int16_t status; /* if result != 0x00 */ + uint8_t encryption; } ng_l2cap_l2ca_con_op; /* L2CA_ConnectInd */ @@ -598,6 +601,12 @@ typedef struct { * u_int16_t result; /* 0x00 - success */ * } ng_l2cap_l2ca_enable_clt_op; #endif +#define NGM_L2CAP_L2CA_ENC_CHANGE 0x92 +typedef struct { + uint16_t lcid; + uint16_t result; + uint8_t idtype; +} ng_l2cap_l2ca_enc_chg_op; /************************************************************************** ************************************************************************** Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c Tue Oct 27 03:42:26 2015 (r290038) @@ -475,6 +475,8 @@ ng_l2cap_process_con_req(ng_l2cap_con_p con->rx_pkt = NULL; if(dcid == NG_L2CAP_ATT_CID) idtype = NG_L2CAP_L2CA_IDTYPE_ATT; + else if(dcid == NG_L2CAP_SMP_CID) + idtype = NG_L2CAP_L2CA_IDTYPE_SMP; else if( con->linktype != NG_HCI_LINK_ACL) idtype = NG_L2CAP_L2CA_IDTYPE_LE; else @@ -602,7 +604,9 @@ ng_l2cap_process_con_rsp(ng_l2cap_con_p */ cmd->ch->dcid = dcid; - cmd->ch->state = (cmd->ch->scid == NG_L2CAP_ATT_CID)? + cmd->ch->state = ((cmd->ch->scid == NG_L2CAP_ATT_CID)|| + (cmd->ch->scid == NG_L2CAP_SMP_CID)) + ? NG_L2CAP_OPEN : NG_L2CAP_CONFIG; } else /* There was an error, so close the channel */ Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c Tue Oct 27 03:42:26 2015 (r290038) @@ -481,6 +481,58 @@ out: return (error); } /* ng_l2cap_qos_ind */ +int +ng_l2cap_lp_enc_change(ng_l2cap_p l2cap, struct ng_mesg *msg) +{ + ng_hci_lp_enc_change_ep *ep = NULL; + ng_l2cap_con_p con = NULL; + int error = 0; + ng_l2cap_chan_p ch = NULL; + /* Check message */ + if (msg->header.arglen != sizeof(*ep)) { + NG_L2CAP_ALERT( +"%s: %s - invalid LP_ENCChange message size\n", + __func__, NG_NODE_NAME(l2cap->node)); + error = EMSGSIZE; + goto out; + } + + ep = (ng_hci_lp_enc_change_ep *) (msg->data); + + /* Check if we have this connection */ + con = ng_l2cap_con_by_handle(l2cap, ep->con_handle); + if (con == NULL) { + NG_L2CAP_ERR( +"%s: %s - unexpected LP_Enc Change Event. " \ +"Connection does not exist, con_handle=%d\n", + __func__, NG_NODE_NAME(l2cap->node), ep->con_handle); + error = ENOENT; + goto out; + } + + /* Verify connection state */ + if (con->state != NG_L2CAP_CON_OPEN) { + NG_L2CAP_ERR( +"%s: %s - unexpected ENC_CHANGE event. " \ +"Invalid connection state, state=%d, con_handle=%d\n", + __func__, NG_NODE_NAME(l2cap->node), con->state, + con->con_handle); + error = EINVAL; + goto out; + } + + con->encryption = ep->status; + + LIST_FOREACH(ch, &l2cap->chan_list, next){ + if((ch->con->con_handle == ep->con_handle) && + (ch->con->linktype == ep->link_type)) + ng_l2cap_l2ca_encryption_change(ch, ep->status); + } + +out: + return (error); +} /* ng_l2cap_enc_change */ + /* * Prepare L2CAP packet. Prepend packet with L2CAP packet header and then * segment it according to HCI MTU. Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.h Tue Oct 27 03:42:26 2015 (r290038) @@ -41,6 +41,7 @@ int ng_l2cap_lp_discon_ind (ng int ng_l2cap_lp_qos_req (ng_l2cap_p, u_int16_t, ng_l2cap_flow_p); int ng_l2cap_lp_qos_cfm (ng_l2cap_p, struct ng_mesg *); int ng_l2cap_lp_qos_ind (ng_l2cap_p, struct ng_mesg *); +int ng_l2cap_lp_enc_change (ng_l2cap_p, struct ng_mesg *); int ng_l2cap_lp_send (ng_l2cap_con_p, u_int16_t,struct mbuf *); int ng_l2cap_lp_receive (ng_l2cap_p, struct mbuf *); void ng_l2cap_lp_deliver (ng_l2cap_con_p); Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c Tue Oct 27 03:42:26 2015 (r290038) @@ -350,7 +350,9 @@ ng_l2cap_lower_rcvmsg(node_p node, item_ case NGM_HCI_LP_QOS_IND: error = ng_l2cap_lp_qos_ind(l2cap, msg); break; - + case NGM_HCI_LP_ENC_CHG: + error = ng_l2cap_lp_enc_change(l2cap, msg); + break; default: error = EINVAL; break; Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c Tue Oct 27 03:42:26 2015 (r290038) @@ -114,7 +114,7 @@ ng_l2cap_new_con(ng_l2cap_p l2cap, bdadd con->l2cap = l2cap; con->state = NG_L2CAP_CON_CLOSED; - + con->encryption = 0; /* * XXX * @@ -340,6 +340,8 @@ ng_l2cap_new_chan(ng_l2cap_p l2cap, ng_l return (NULL); if(idtype == NG_L2CAP_L2CA_IDTYPE_ATT){ ch->scid = ch->dcid = NG_L2CAP_ATT_CID; + }else if(idtype == NG_L2CAP_L2CA_IDTYPE_SMP){ + ch->scid = ch->dcid = NG_L2CAP_SMP_CID; }else{ ch->scid = ng_l2cap_get_cid(l2cap, (con->linktype!= NG_HCI_LINK_ACL)); @@ -379,7 +381,8 @@ ng_l2cap_chan_by_scid(ng_l2cap_p l2cap, { ng_l2cap_chan_p ch = NULL; - if(idtype == NG_L2CAP_L2CA_IDTYPE_ATT){ + if((idtype == NG_L2CAP_L2CA_IDTYPE_ATT)|| + (idtype == NG_L2CAP_L2CA_IDTYPE_SMP)){ return NULL; } @@ -390,7 +393,6 @@ ng_l2cap_chan_by_scid(ng_l2cap_p l2cap, if((idtype != NG_L2CAP_L2CA_IDTYPE_LE)&& (ch->con->linktype != NG_HCI_LINK_ACL )) continue; - if (ch->scid == scid) break; } Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c Tue Oct 27 03:42:26 2015 (r290038) @@ -130,6 +130,10 @@ ng_l2cap_l2ca_con_req(ng_l2cap_p l2cap, _ng_l2cap_con_rsp(cmd->aux, cmd->ident, NG_L2CAP_ATT_CID, NG_L2CAP_ATT_CID, 0, 0); cmd->aux->m_flags |= M_PROTO2; + }else if(ip->idtype == NG_L2CAP_L2CA_IDTYPE_SMP){ + _ng_l2cap_con_rsp(cmd->aux, cmd->ident, NG_L2CAP_SMP_CID, + NG_L2CAP_SMP_CID, 0, 0); + cmd->aux->m_flags |= M_PROTO2; }else{ _ng_l2cap_con_req(cmd->aux, cmd->ident, ch->psm, ch->scid); } @@ -191,13 +195,16 @@ ng_l2cap_l2ca_con_rsp(ng_l2cap_chan_p ch if(ch->scid == NG_L2CAP_ATT_CID){ op->idtype = NG_L2CAP_L2CA_IDTYPE_ATT; op->lcid = ch->con->con_handle; + }else if(ch->scid == NG_L2CAP_SMP_CID){ + op->idtype = NG_L2CAP_L2CA_IDTYPE_SMP; + op->lcid = ch->con->con_handle; }else{ op->idtype = (ch->con->linktype == NG_HCI_LINK_ACL)? NG_L2CAP_L2CA_IDTYPE_BREDR : NG_L2CAP_L2CA_IDTYPE_LE; op->lcid = ch->scid; } - + op->encryption = ch->con->encryption; op->result = result; op->status = status; @@ -234,7 +241,8 @@ ng_l2cap_l2ca_con_rsp_req(ng_l2cap_p l2c ip = (ng_l2cap_l2ca_con_rsp_ip *)(msg->data); /* Check if we have this channel */ - if(ip->lcid != NG_L2CAP_ATT_CID){ + if((ip->lcid != NG_L2CAP_ATT_CID)&& + (ip->lcid != NG_L2CAP_SMP_CID)){ ch = ng_l2cap_chan_by_scid(l2cap, ip->lcid ,(ip->linktype == NG_HCI_LINK_ACL)? NG_L2CAP_L2CA_IDTYPE_BREDR: @@ -281,7 +289,8 @@ ng_l2cap_l2ca_con_rsp_req(ng_l2cap_p l2c /* Check result */ switch (ip->result) { case NG_L2CAP_SUCCESS: - ch->state = (ch->scid == NG_L2CAP_ATT_CID)? + ch->state = ((ch->scid == NG_L2CAP_ATT_CID)|| + (ch->scid == NG_L2CAP_SMP_CID))? NG_L2CAP_OPEN : NG_L2CAP_CONFIG; ch->cfg_state = 0; break; @@ -324,6 +333,53 @@ out: return (error); } /* ng_l2cap_l2ca_con_rsp_req */ +int ng_l2cap_l2ca_encryption_change(ng_l2cap_chan_p ch, uint16_t result) +{ + ng_l2cap_p l2cap = ch->con->l2cap; + struct ng_mesg *msg = NULL; + ng_l2cap_l2ca_enc_chg_op *op = NULL; + int error = 0; + + /* Check if upstream hook is connected and valid */ + if (l2cap->l2c == NULL || NG_HOOK_NOT_VALID(l2cap->l2c)) { + NG_L2CAP_ERR( +"%s: %s - unable to send L2CA_ConnectRsp response message. " \ +"Hook is not connected or valid, psm=%d\n", + __func__, NG_NODE_NAME(l2cap->node), ch->psm); + + return (ENOTCONN); + } + + /* Create and send L2CA_ConnectRsp response message */ + NG_MKMESSAGE(msg, NGM_L2CAP_COOKIE, NGM_L2CAP_L2CA_ENC_CHANGE, + sizeof(*op), M_NOWAIT); + if (msg == NULL) + error = ENOMEM; + else { + msg->header.token = 0; + msg->header.flags |= NGF_RESP; + + op = (ng_l2cap_l2ca_enc_chg_op *)(msg->data); + op->result = result; + if(ch->scid ==NG_L2CAP_ATT_CID|| + ch->scid ==NG_L2CAP_SMP_CID){ + op->lcid = ch->con->con_handle; + op->idtype = (ch->scid==NG_L2CAP_ATT_CID)? + NG_L2CAP_L2CA_IDTYPE_ATT: + NG_L2CAP_L2CA_IDTYPE_SMP; + }else{ + op->idtype =(ch->con->linktype ==NG_HCI_LINK_ACL)? + NG_L2CAP_L2CA_IDTYPE_BREDR: + NG_L2CAP_L2CA_IDTYPE_LE; + } + + + NG_SEND_MSG_HOOK(error, l2cap->node, msg, l2cap->l2c, 0); + } + + return (error); + +} /* * Send L2CAP_ConnectRsp response to the upper layer */ @@ -399,6 +455,7 @@ ng_l2cap_l2ca_con_ind(ng_l2cap_chan_p ch ip->psm = ch->psm; ip->ident = ch->ident; ip->linktype = ch->con->linktype; + NG_SEND_MSG_HOOK(error, l2cap->node, msg, l2cap->l2c, 0); } @@ -501,7 +558,8 @@ ng_l2cap_l2ca_cfg_req(ng_l2cap_p l2cap, /* Adjust channel state for re-configuration */ if (ch->state == NG_L2CAP_OPEN) { - ch->state = (ch->scid == NG_L2CAP_ATT_CID)? + ch->state = ((ch->scid == NG_L2CAP_ATT_CID)|| + (ch->scid == NG_L2CAP_SMP_CID))? NG_L2CAP_OPEN : NG_L2CAP_CONFIG; ch->cfg_state = 0; } @@ -812,7 +870,10 @@ ng_l2cap_l2ca_write_req(ng_l2cap_p l2cap if (l2ca_hdr->idtype == NG_L2CAP_L2CA_IDTYPE_ATT){ ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_ATT_CID, l2ca_hdr->lcid); - } else{ + } else if (l2ca_hdr->idtype == NG_L2CAP_L2CA_IDTYPE_SMP){ + ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_SMP_CID, + l2ca_hdr->lcid); + }else{ if (l2ca_hdr->lcid < NG_L2CAP_FIRST_CID) { NG_L2CAP_ERR( "%s: %s - invalid L2CA Data packet. Inavlid channel ID, cid=%d\n", @@ -901,6 +962,9 @@ ng_l2cap_l2ca_write_rsp(ng_l2cap_chan_p if(ch->scid == NG_L2CAP_ATT_CID){ op->idtype = NG_L2CAP_L2CA_IDTYPE_ATT; op->lcid = ch->con->con_handle; + }else if(ch->scid == NG_L2CAP_SMP_CID){ + op->idtype = NG_L2CAP_L2CA_IDTYPE_SMP; + op->lcid = ch->con->con_handle; }else{ op->idtype = (ch->con->linktype == NG_HCI_LINK_ACL)? NG_L2CAP_L2CA_IDTYPE_BREDR : @@ -928,7 +992,8 @@ ng_l2cap_l2ca_receive(ng_l2cap_con_p con int error = 0; int idtype; uint16_t *idp; - + int silent = 0; + NG_L2CAP_M_PULLUP(con->rx_pkt, sizeof(*hdr)); if (con->rx_pkt == NULL) return (ENOBUFS); @@ -945,6 +1010,17 @@ ng_l2cap_l2ca_receive(ng_l2cap_con_p con * Here,ATT channel is distinguished by * connection handle */ + hdr->dcid = con->con_handle; + silent = 1; + }else if(hdr->dcid == NG_L2CAP_SMP_CID){ + idtype = NG_L2CAP_L2CA_IDTYPE_SMP; + ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_SMP_CID, + con->con_handle); + /* + * Here,SMP channel is distinguished by + * connection handle + */ + silent = 1; hdr->dcid = con->con_handle; }else{ idtype = (con->linktype==NG_HCI_LINK_ACL)? @@ -953,7 +1029,8 @@ ng_l2cap_l2ca_receive(ng_l2cap_con_p con ch = ng_l2cap_chan_by_scid(l2cap, hdr->dcid, idtype); } if (ch == NULL) { - NG_L2CAP_ERR( + if(!silent) + NG_L2CAP_ERR( "%s: %s - unexpected L2CAP data packet. Channel does not exist, cid=%d, idtype=%d\n", __func__, NG_NODE_NAME(l2cap->node), hdr->dcid, idtype); error = ENOENT; @@ -1170,6 +1247,21 @@ ng_l2cap_l2ca_discon_req(ng_l2cap_p l2ca error = EINVAL; } goto out; + }else if(ip->idtype == NG_L2CAP_L2CA_IDTYPE_SMP){ + /* Don't send Disconnect request on L2CAP Layer*/ + ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_SMP_CID, + ip->lcid); + + if(ch != NULL){ + ng_l2cap_free_chan(ch); + }else{ + NG_L2CAP_ERR( +"%s: %s - unexpected L2CA_Disconnect request message. " \ +"Channel does not exist, conhandle=%d\n", + __func__, NG_NODE_NAME(l2cap->node), ip->lcid); + error = EINVAL; + } + goto out; }else{ /* Check if we have this channel */ ch = ng_l2cap_chan_by_scid(l2cap, ip->lcid, ip->idtype); Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.h ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.h Tue Oct 27 03:42:26 2015 (r290038) @@ -74,6 +74,6 @@ int ng_l2cap_l2ca_get_info_rsp (ng_l2cap struct mbuf *); int ng_l2cap_l2ca_enable_clt (ng_l2cap_p, struct ng_mesg *); - +int ng_l2cap_l2ca_encryption_change(ng_l2cap_chan_p , uint16_t ); #endif /* ndef _NETGRAPH_L2CAP_ULPI_H_ */ Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h Tue Oct 27 03:42:26 2015 (r290038) @@ -119,7 +119,8 @@ typedef struct ng_l2cap_con { u_int8_t ident; /* last allocated ident */ uint8_t linktype; - + uint8_t encryption; + TAILQ_HEAD(, ng_l2cap_cmd) cmd_list; /* pending L2CAP cmds */ struct mbuf *tx_pkt; /* xmitted L2CAP packet */ Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Oct 27 03:02:48 2015 (r290037) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Oct 27 03:42:26 2015 (r290038) @@ -213,7 +213,7 @@ static ng_btsocket_l2cap_pcb_p ng_bt static int ng_btsocket_l2cap_result2errno(int); static int ng_btsock_l2cap_addrtype_to_linktype(int addrtype); -static int ng_btsock_l2cap_pcb_to_idtype(struct ng_btsocket_l2cap_pcb *); + #define ng_btsocket_l2cap_wakeup_input_task() \ taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_queue_task) @@ -221,16 +221,6 @@ static int ng_btsock_l2cap_pcb_to_idtype taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_rt_task) -int ng_btsock_l2cap_pcb_to_idtype(struct ng_btsocket_l2cap_pcb *pcb) -{ - if(pcb->dsttype == BDADDR_BREDR){ - return NG_L2CAP_L2CA_IDTYPE_BREDR; - }else if(pcb->psm == 0){ - return NG_L2CAP_L2CA_IDTYPE_ATT; - }else{ - return NG_L2CAP_L2CA_IDTYPE_LE; - } -} int ng_btsock_l2cap_addrtype_to_linktype(int addrtype) { @@ -473,11 +463,15 @@ ng_btsocket_l2cap_process_l2ca_con_req_r } if (op->result == NG_L2CAP_SUCCESS){ - if(ng_btsock_l2cap_pcb_to_idtype(pcb) == - NG_L2CAP_L2CA_IDTYPE_ATT){ - pcb->state = NG_BTSOCKET_L2CAP_OPEN; - soisconnected(pcb->so); - pcb->cid = op->lcid; + if((pcb->idtype == NG_L2CAP_L2CA_IDTYPE_ATT)|| + (pcb->idtype == NG_L2CAP_L2CA_IDTYPE_SMP)){ + pcb->encryption = op->encryption; pcb->cid = op->lcid; + if(pcb->need_encrypt && !(pcb->encryption)){ + pcb->state = NG_BTSOCKET_L2CAP_W4_ENC_CHANGE; + }else{ + pcb->state = NG_BTSOCKET_L2CAP_OPEN; + soisconnected(pcb->so); + } }else{ /* * Channel is now open, so update local channel ID and @@ -486,7 +480,7 @@ ng_btsocket_l2cap_process_l2ca_con_req_r */ pcb->cid = op->lcid; - + pcb->encryption = op->encryption; error = ng_btsocket_l2cap_send_l2ca_cfg_req(pcb); if (error != 0) { /* Send disconnect request with "zero" token */ @@ -513,7 +507,6 @@ ng_btsocket_l2cap_process_l2ca_con_req_r pcb->state = NG_BTSOCKET_L2CAP_CLOSED; soisdisconnected(pcb->so); } - mtx_unlock(&pcb->pcb_mtx); mtx_unlock(&ng_btsocket_l2cap_sockets_mtx); @@ -702,7 +695,40 @@ respond: return (error); } /* ng_btsocket_l2cap_process_l2ca_con_ind */ +/*Encryption Change*/ +static int ng_btsocket_l2cap_process_l2ca_enc_change(struct ng_mesg *msg, ng_btsocket_l2cap_rtentry_p rt) +{ + ng_l2cap_l2ca_enc_chg_op *op = NULL; + ng_btsocket_l2cap_pcb_t *pcb = NULL; + + + if (msg->header.arglen != sizeof(*op)) + return (EMSGSIZE); + + op = (ng_l2cap_l2ca_enc_chg_op *)(msg->data); + + pcb = ng_btsocket_l2cap_pcb_by_cid(&rt->src, op->lcid, + op->idtype); + mtx_lock(&pcb->pcb_mtx); + pcb->encryption = op->result; + + if(pcb->need_encrypt){ + if(pcb->state != NG_BTSOCKET_L2CAP_W4_ENC_CHANGE){ + NG_BTSOCKET_L2CAP_WARN("%s: Invalid pcb status %d", + __func__, pcb->state); + }else if(pcb->encryption){ + pcb->state = NG_BTSOCKET_L2CAP_OPEN; + soisconnected(pcb->so); + }else{ + pcb->so->so_error = EPERM; + pcb->state = NG_BTSOCKET_L2CAP_CLOSED; + soisdisconnected(pcb->so); + } + } + mtx_unlock(&pcb->pcb_mtx); + return 0; +} /* * Process L2CA_Config response */ @@ -1215,7 +1241,7 @@ ng_btsocket_l2cap_send_l2ca_con_req(ng_b bcopy(&pcb->dst, &ip->bdaddr, sizeof(ip->bdaddr)); ip->psm = pcb->psm; ip->linktype = ng_btsock_l2cap_addrtype_to_linktype(pcb->dsttype); - ip->idtype = ng_btsock_l2cap_pcb_to_idtype(pcb); + ip->idtype = pcb->idtype; NG_SEND_MSG_HOOK(error, ng_btsocket_l2cap_node, msg,pcb->rt->hook, 0); return (error); @@ -1354,7 +1380,7 @@ ng_btsocket_l2cap_send_l2ca_discon_req(u ip = (ng_l2cap_l2ca_discon_ip *)(msg->data); ip->lcid = pcb->cid; - ip->idtype = ng_btsock_l2cap_pcb_to_idtype(pcb); + ip->idtype = pcb->idtype; NG_SEND_MSG_HOOK(error, ng_btsocket_l2cap_node, msg,pcb->rt->hook, 0); @@ -1441,7 +1467,9 @@ ng_btsocket_l2cap_data_input(struct mbuf hdr->dcid, hdr->length); if ((hdr->dcid >= NG_L2CAP_FIRST_CID) || - (idtype == NG_L2CAP_L2CA_IDTYPE_ATT)){ + (idtype == NG_L2CAP_L2CA_IDTYPE_ATT)|| + (idtype == NG_L2CAP_L2CA_IDTYPE_SMP) + ){ mtx_lock(&ng_btsocket_l2cap_sockets_mtx); @@ -1707,7 +1735,10 @@ ng_btsocket_l2cap_l2ca_msg_input(struct case NGM_L2CAP_L2CA_WRITE: /* L2CA_Write response */ ng_btsocket_l2cap_process_l2ca_write_rsp(msg, rt); break; + case NGM_L2CAP_L2CA_ENC_CHANGE: + ng_btsocket_l2cap_process_l2ca_enc_change(msg, rt); + break; /* XXX FIXME add other L2CA messages */ default: @@ -1764,6 +1795,7 @@ ng_btsocket_l2cap_input(void *context, i case NGM_L2CAP_L2CA_DISCON: case NGM_L2CAP_L2CA_DISCON_IND: case NGM_L2CAP_L2CA_WRITE: + case NGM_L2CAP_L2CA_ENC_CHANGE: /* XXX FIXME add other L2CA messages */ ng_btsocket_l2cap_l2ca_msg_input(msg, hook); break; @@ -2135,7 +2167,7 @@ ng_btsocket_l2cap_connect(struct socket struct sockaddr_l2cap ba; ng_btsocket_l2cap_rtentry_t *rt = NULL; int have_src, error = 0; - + int idtype = NG_L2CAP_L2CA_IDTYPE_BREDR; /* Check socket */ if (pcb == NULL) return (EINVAL); @@ -2164,9 +2196,16 @@ ng_btsocket_l2cap_connect(struct socket if((sa->l2cap_bdaddr_type == BDADDR_BREDR)&& (sa->l2cap_psm == 0)) return EDESTADDRREQ; - if((sa->l2cap_bdaddr_type != BDADDR_BREDR)&& - (sa->l2cap_cid != NG_L2CAP_ATT_CID)){ - return EINVAL; + if(sa->l2cap_bdaddr_type != BDADDR_BREDR){ + if(sa->l2cap_cid == NG_L2CAP_ATT_CID){ + idtype = NG_L2CAP_L2CA_IDTYPE_ATT; + }else if (sa->l2cap_cid == NG_L2CAP_SMP_CID){ + idtype =NG_L2CAP_L2CA_IDTYPE_SMP; + }else{ + //if cid == 0 idtype = NG_L2CAP_L2CA_IDTYPE_LE; + // Not supported yet + return EINVAL; + } } if (pcb->psm != 0 && pcb->psm != le16toh(sa->l2cap_psm)) return (EINVAL); @@ -2185,8 +2224,8 @@ ng_btsocket_l2cap_connect(struct socket bcopy(&sa->l2cap_bdaddr, &pcb->dst, sizeof(pcb->dst)); pcb->psm = le16toh(sa->l2cap_psm); pcb->dsttype = sa->l2cap_bdaddr_type; - pcb->cid = sa->l2cap_cid; - + pcb->cid = 0; + pcb->idtype = idtype; pcb->rt = NULL; have_src = bcmp(&pcb->src, NG_HCI_BDADDR_ANY, sizeof(pcb->src)); @@ -2211,7 +2250,7 @@ ng_btsocket_l2cap_connect(struct socket bcopy(&rt->src, &pcb->src, sizeof(pcb->src)); pcb->srctype = (sa->l2cap_bdaddr_type == BDADDR_BREDR)? - BDADDR_BREDR : BDADDR_LE_RANDOM; + BDADDR_BREDR : BDADDR_LE_PUBLIC; } } else error = EHOSTUNREACH; @@ -2297,6 +2336,11 @@ ng_btsocket_l2cap_ctloutput(struct socke error = sooptcopyout(sopt, &pcb->flush_timo, sizeof(pcb->flush_timo)); break; + case SO_L2CAP_ENCRYPTED: /* get encrypt required */ + error = sooptcopyout(sopt, &pcb->need_encrypt, + sizeof(pcb->need_encrypt)); + break; + default: error = ENOPROTOOPT; @@ -2337,7 +2381,17 @@ ng_btsocket_l2cap_ctloutput(struct socke if (error == 0) pcb->flush_timo = v.flush_timo; break; - + case SO_L2CAP_ENCRYPTED: /*set connect encryption opt*/ + if((pcb->state != NG_BTSOCKET_L2CAP_OPEN) && + (pcb->state != NG_BTSOCKET_L2CAP_W4_ENC_CHANGE)){ + error = sooptcopyin(sopt, &v, sizeof(v), + sizeof(v.encryption)); + if(error == 0) + pcb->need_encrypt = (v.encryption)?1:0; + }else{ + error = EINVAL; + } + break; default: error = ENOPROTOOPT; break; @@ -2489,7 +2543,17 @@ ng_btsocket_l2cap_peeraddr(struct socket sa.l2cap_psm = htole16(pcb->psm); sa.l2cap_len = sizeof(sa); sa.l2cap_family = AF_BLUETOOTH; - sa.l2cap_cid = 0; + switch(pcb->idtype){ + case NG_L2CAP_L2CA_IDTYPE_ATT: + sa.l2cap_cid = NG_L2CAP_ATT_CID; + break; + case NG_L2CAP_L2CA_IDTYPE_SMP: + sa.l2cap_cid = NG_L2CAP_SMP_CID; + break; + default: + sa.l2cap_cid = 0; + break; + } sa.l2cap_bdaddr_type = pcb->dsttype; *nam = sodupsockaddr((struct sockaddr *) &sa, M_NOWAIT); @@ -2608,7 +2672,7 @@ ng_btsocket_l2cap_send2(ng_btsocket_l2ca hdr->token = pcb->token; hdr->length = m->m_pkthdr.len - sizeof(*hdr); hdr->lcid = pcb->cid; - hdr->idtype = ng_btsock_l2cap_pcb_to_idtype(pcb); + hdr->idtype = pcb->idtype; NG_BTSOCKET_L2CAP_INFO( "%s: Sending packet: len=%d, length=%d, lcid=%d, token=%d, state=%d\n", __func__, m->m_pkthdr.len, hdr->length, hdr->lcid, @@ -2721,7 +2785,7 @@ ng_btsocket_l2cap_pcb_by_cid(bdaddr_p sr LIST_FOREACH(p, &ng_btsocket_l2cap_sockets, next){ if (p->cid == cid && bcmp(src, &p->src, sizeof(p->src)) == 0&& - ng_btsock_l2cap_pcb_to_idtype(p) == idtype) + p->idtype == idtype) break; } From owner-svn-src-head@freebsd.org Tue Oct 27 03:48:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09BF7A1EF13; Tue, 27 Oct 2015 03:48:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id CD4A51FDA; Tue, 27 Oct 2015 03:48:43 +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 t9R3mg48034052; Tue, 27 Oct 2015 03:48:42 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R3mgcS034051; Tue, 27 Oct 2015 03:48:42 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201510270348.t9R3mgcS034051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 27 Oct 2015 03:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290039 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 03:48:44 -0000 Author: lidl Date: Tue Oct 27 03:48:42 2015 New Revision: 290039 URL: https://svnweb.freebsd.org/changeset/base/290039 Log: Add myself and my mentors to the committers-src.dot file. Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D4006 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Oct 27 03:42:26 2015 (r290038) +++ head/share/misc/committers-src.dot Tue Oct 27 03:48:42 2015 (r290039) @@ -217,6 +217,7 @@ kib [label="Konstantin Belousov\nkib@Fre kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] kp [label="Kristof Provost\nkp@FreeBSD.org\n2015/03/22"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] +lidl [label="Kurt Lidl\nlidl@FreeBSD.org\n2015/10/21"] loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] @@ -334,6 +335,7 @@ day1 -> alm day1 -> dg adrian -> avos +adrian -> lidl adrian -> loos adrian -> monthadar adrian -> ray @@ -660,6 +662,7 @@ rpaulo -> avg rpaulo -> bschmidt rpaulo -> dim rpaulo -> jmmv +rpaulo -> lidl rpaulo -> ngie rrs -> brucec From owner-svn-src-head@freebsd.org Tue Oct 27 04:19:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3D8A0654A; Tue, 27 Oct 2015 04:19:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 8446F1AA6; Tue, 27 Oct 2015 04:19:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8ECD6B918; Tue, 27 Oct 2015 00:19:43 -0400 (EDT) From: John Baldwin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289863 - head/lib/libc/stdio Date: Mon, 26 Oct 2015 21:19:26 -0700 Message-ID: <2076950.skSTJcjGfc@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <562EBD7F.6090009@freebsd.org> References: <201510240223.t9O2NFiY011536@repo.freebsd.org> <2119048.oF1gNjmV7i@ralph.baldwin.cx> <562EBD7F.6090009@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.2.7 (bigwig.baldwin.cx); Tue, 27 Oct 2015 00:19:43 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 04:19:45 -0000 On Tuesday, October 27, 2015 02:55:43 AM Andrey Chernov wrote: > On 26.10.2015 20:27, John Baldwin wrote: > > On Saturday, October 24, 2015 02:23:15 AM Andrey A. Chernov wrote: > >> Author: ache > >> Date: Sat Oct 24 02:23:15 2015 > >> New Revision: 289863 > >> URL: https://svnweb.freebsd.org/changeset/base/289863 > >> > >> Log: > >> Since no room left in the _flags, reuse __SALC for O_APPEND. > >> It helps to remove _fcntl() call from _ftello() and optimize seek position > >> calculation in _swrite(). > > > > You could just add a _flags2 to FILE if that would be cleaner. It should even > > be MFC'able without being an ABI change since stdio always allocates FILE > > objects internally and we only export pointers to them. Programs do not > > allocate them statically. > > > > Thanx, I understand it from your bugzilla answer, but I have a doubt. > What if some 3rd party port will use static FILE f; and then &f? Some of > ports may deal with FILE internals and I don't know which ones. I prefer > rather to not break something there and currently I need only one flag > and __SALC is not conflicting since used only with _file = -1 and > __SSTR. If you or somebody else will need another flag and be brave > enough to add _flags2, this patch can be easily converted. A static FILE f has never worked. Even in libc we have a special macro to initialize internal static FILE objects. Not too long ago (6.x?) we used to have a separate xFILE structure in a parallel array of extended fields. The only reason was that stdout/err/in resolved to offsets in a global array. Peter fixed those to indirect individual pointers, so we merged xFILE back into FILE. We've basically broken any software using static FILE f multiple times. It is true that some ports may abuse FILE internals, but they mostly do it via the macros in stdio.h, not directly. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Oct 27 05:06:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 143D18086 for ; Tue, 27 Oct 2015 05:06:25 +0000 (UTC) (envelope-from sales@ouyunceramics.com) Received: from smtpbg331.qq.com (smtpbg331.qq.com [14.17.43.223]) (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 694ED1E7D for ; Tue, 27 Oct 2015 05:06:22 +0000 (UTC) (envelope-from sales@ouyunceramics.com) X-QQ-mid: bizesmtp2t1445922236t941t156 Received: from ztcojcyi (unknown [100.43.131.85]) by esmtp4.qq.com (ESMTP) with SMTP id 0 for ; Tue, 27 Oct 2015 13:03:48 +0800 (CST) X-QQ-SSF: 01100000004000F0FK12E00A0000000 X-QQ-FEAT: 8oHFcAoL8WOMNTSl3+3mD1Hjsue4w9tOaNN2JCHN4zhcMSH8Rfqi63U5drxgf ukhJVSR0wtcHYvVMUW/iMok6XhRWJ0b3hgx8j/tb3nGUfOzNLwMGTZq+Wt6QXB/6vYuKEyE HROWy5/O4UyM9EHmLaqnPcRKgxP2TD39PyKI5jXZD6xgFv+KDn6SraZstqlbbPAZiTmKwcT JykqLNXOS1NcvBJcKz3x/ZS8ybj6S5Sss557K5z7CWM0gfaP2J3q88cXXeemyaZMonier33 BkpxMtpNL9OCZEUUCqLTDwhGs= X-QQ-GoodBg: 0 Message-ID: From: "Alice" To: Subject: Ceramic Roof Tile FOB USD0.30/pcs Double color Date: Tue, 27 Oct 2015 13:02:33 +0800 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 05:06:25 -0000 VG86c3ZuLXNyYy1oZWFkQGZyZWVic2Qub3JnDQpEZWFyIENsaWVudHMNCkhvdyBhcmUgeW91Pw0K SGVyZSByZWNvbW1lbmQgb3VyIGdvb2Qgc2VsbGluZyBjZXJhbWljIHJvb2YgdGlsZSBiYXNlIGRv dWJsZSBnbG9zc3kgY29sb3IuDQphbmQgcHJpY2UgYXQgRk9CIFVTRDAuMzAvcGNzLiBpdCdzIHdp dGggdmVyeSBjb21wZXRpdGl2ZSBwcmljZSBhbmQgcmVsaWFibGUgcXVhbGl0eS4NCmlmIHlvdSBu ZWVkIG91ciBjYXJhbG9ndWUscGxlYXNlIGp1c3QgdGVsbCBtZSBhbmQgSSBhbSBwbGVhc3VyZWQg dG8gc2VuZCB0byB5b3UuDQoNCkhvcGUgd2Ugd2lsbCBlc3RhYmxpc2ggbG9uZy10ZXJtIGJ1c2lu ZXNzIHJlbGF0aW9uc2hpcCBvbiBuZWFyIGZ1dHVyZS4NCmlmIGFueSBpbnF1aXJ5IGFuZCBxdWVz dGlvbnMgcGxlYXNlIGp1c3QgZnJlZSB0byBjb250YWN0IG1lLg0KSGlnaGx5IGFwcHJlY2lhdGVk IGZvciB5b3VyIHJlcGx5Lg0KV2l0aCBCZXN0IFJlZ2FyZHMNCkFsaWNlDQoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioN CkppYW5neGkgT3V5dW4gQ2VyYW1pY3MgQ28sLkx0ZC4NCkFkZDp4aW5qaWUgdG93ZW4gY2VyYW1p Y3MgaW5kdXN0cmlhbCBwYXJrLEdhb2FuIGNpdHkgSmlhbmd4aSxDaGluYQ0KVGVsOjA3OTUtNzIx OTE4OQ0KTW9iaWxlOjE4OTc5NTI1MzIxDQpFbWFpbDogc2FsZXNAb3V5dW5jZXJhbWljcy5jb20N ClNreXBlOm91eW5jZXJhbWljQGhvdG1haWwuY29tDQpXZWI6d3d3Lm91eXVuY2VyYW1pY3MuY29t DQoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioq From owner-svn-src-head@freebsd.org Tue Oct 27 09:33:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05D0887FB; Tue, 27 Oct 2015 09:33:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id C3B5E1627; Tue, 27 Oct 2015 09:33:48 +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 t9R9Xl4k034145; Tue, 27 Oct 2015 09:33:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R9XlBL034144; Tue, 27 Oct 2015 09:33:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510270933.t9R9XlBL034144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Oct 2015 09:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290042 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 09:33:49 -0000 Author: mav Date: Tue Oct 27 09:33:47 2015 New Revision: 290042 URL: https://svnweb.freebsd.org/changeset/base/290042 Log: Fix error code that looks like wrong. Modified: head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Tue Oct 27 07:23:40 2015 (r290041) +++ head/sys/dev/isp/ispmbox.h Tue Oct 27 09:33:47 2015 (r290042) @@ -1411,7 +1411,7 @@ typedef struct { #define PLOGX_IOCBERR_FAILED 0x04 /* further info in IOPARM 1 */ #define PLOGX_IOCBERR_NOFABRIC 0x05 #define PLOGX_IOCBERR_NOTREADY 0x07 -#define PLOGX_IOCBERR_NOLOGIN 0x08 /* further info in IOPARM 1 */ +#define PLOGX_IOCBERR_NOLOGIN 0x09 /* further info in IOPARM 1 */ #define PLOGX_IOCBERR_NOPCB 0x0a #define PLOGX_IOCBERR_REJECT 0x18 /* further info in IOPARM 1 */ #define PLOGX_IOCBERR_EINVAL 0x19 /* further info in IOPARM 1 */ From owner-svn-src-head@freebsd.org Tue Oct 27 09:43:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FCB489EE; Tue, 27 Oct 2015 09:43:07 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 CF7DD1C8E; Tue, 27 Oct 2015 09:43:06 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R9h5ut037123; Tue, 27 Oct 2015 09:43:05 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R9h5Wf037120; Tue, 27 Oct 2015 09:43:05 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201510270943.t9R9h5Wf037120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Tue, 27 Oct 2015 09:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290043 - in head: share/man/man4 sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 09:43:07 -0000 Author: hiren Date: Tue Oct 27 09:43:05 2015 New Revision: 290043 URL: https://svnweb.freebsd.org/changeset/base/290043 Log: Add sysctl tunable net.inet.tcp.initcwnd_segments to specify initial congestion window in number of segments on fly. It is set to 10 segments by default. Remove net.inet.tcp.experimental.initcwnd10 which is now redundant. Also remove the parent node net.inet.tcp.experimental as it's not needed anymore and also because it was not well thought out. Differential Revision: https://reviews.freebsd.org/D3858 In collaboration with: lstewart Reviewed by: gnn (prev version), rwatson, allanjude, wblock (man page) MFC after: 2 weeks Relnotes: yes Sponsored by: Limelight Networks Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp_input.c head/sys/netinet/tcp_var.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Tue Oct 27 09:33:47 2015 (r290042) +++ head/share/man/man4/tcp.4 Tue Oct 27 09:43:05 2015 (r290043) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 13, 2014 +.Dd October 27, 2015 .Dt TCP 4 .Os .Sh NAME @@ -454,6 +454,17 @@ code. For this reason, we use 200ms of slop and a near-0 minimum, which gives us an effective minimum of 200ms (similar to .Tn Linux ) . +.It Va initcwnd_segments +Enable the ability to specify initial congestion window in number of segments. +The default value is 10 as suggested by RFC 6928. +Changing the value on fly would not affect connections using congestion window +from the hostcache. +Caution: +This regulates the burst of packets allowed to be sent in the first RTT. +The value should be relative to the link capacity. +Start with small values for lower-capacity links. +Large bursts can cause buffer overruns and packet drops if routers have small +buffers or the link is experiencing congestion. .It Va rfc3042 Enable the Limited Transmit algorithm as described in RFC 3042. It helps avoid timeouts on lossy links and also when the congestion window Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Oct 27 09:33:47 2015 (r290042) +++ head/sys/netinet/tcp_input.c Tue Oct 27 09:43:05 2015 (r290043) @@ -159,13 +159,10 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3 &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, - "Experimental TCP extensions"); - -VNET_DEFINE(int, tcp_do_initcwnd10) = 1; -SYSCTL_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(tcp_do_initcwnd10), 0, - "Enable RFC 6928 (Increasing initial CWND to 10)"); +VNET_DEFINE(int, tcp_initcwnd_segments) = 10; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, initcwnd_segments, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_initcwnd_segments), 0, + "Slow-start flight size (initial congestion window) in number of segments"); VNET_DEFINE(int, tcp_do_rfc3465) = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET | CTLFLAG_RW, @@ -364,6 +361,7 @@ cc_conn_init(struct tcpcb *tp) * RFC5681 Section 3.1 specifies the default conservative values. * RFC3390 specifies slightly more aggressive values. * RFC6928 increases it to ten segments. + * Support for user specified value for initial flight size. * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely @@ -371,9 +369,9 @@ cc_conn_init(struct tcpcb *tp) */ if (tp->snd_cwnd == 1) tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ - else if (V_tcp_do_initcwnd10) - tp->snd_cwnd = min(10 * tp->t_maxseg, - max(2 * tp->t_maxseg, 14600)); + else if (V_tcp_initcwnd_segments) + tp->snd_cwnd = min(V_tcp_initcwnd_segments * tp->t_maxseg, + max(2 * tp->t_maxseg, V_tcp_initcwnd_segments * 1460)); else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Oct 27 09:33:47 2015 (r290042) +++ head/sys/netinet/tcp_var.h Tue Oct 27 09:43:05 2015 (r290043) @@ -621,7 +621,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX * VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); -VNET_DECLARE(int, tcp_do_initcwnd10); +VNET_DECLARE(int, tcp_initcwnd_segments); VNET_DECLARE(int, tcp_sendspace); VNET_DECLARE(int, tcp_recvspace); VNET_DECLARE(int, path_mtu_discovery); @@ -633,7 +633,7 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) -#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) +#define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) #define V_tcp_sendspace VNET(tcp_sendspace) #define V_tcp_recvspace VNET(tcp_recvspace) #define V_path_mtu_discovery VNET(path_mtu_discovery) From owner-svn-src-head@freebsd.org Tue Oct 27 11:20:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42EEFA1F4C2 for ; Tue, 27 Oct 2015 11:20:43 +0000 (UTC) (envelope-from c4580@plymouth.acenet.us) Received: from plymouth.acenet.us (plymouth.acenet.us [68.171.217.98]) (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 1DC4617F0 for ; Tue, 27 Oct 2015 11:20:42 +0000 (UTC) (envelope-from c4580@plymouth.acenet.us) Received: from c4580 by plymouth.acenet.us with local (Exim 4.86) (envelope-from ) id 1Zr1cn-002CYg-Iz for svn-src-head@freebsd.org; Tue, 27 Oct 2015 06:37:06 -0400 To: svn-src-head@freebsd.org Subject: You have received a new fax, document 00872269 X-PHP-Script: www.siriusbilling.com/post.php for 176.9.128.86 Date: Tue, 27 Oct 2015 10:37:05 +0000 From: "Interfax Online" Reply-To: "Interfax Online" Message-ID: <19311270718b6375607ee5361c1e6e98@siriusbilling.com> X-Priority: 3 MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=3.8 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - plymouth.acenet.us X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [945 501] / [47 12] X-AntiAbuse: Sender Address Domain - plymouth.acenet.us X-Get-Message-Sender-Via: plymouth.acenet.us: authenticated_id: c4580/only user confirmed/virtual account not confirmed X-Authenticated-Sender: plymouth.acenet.us: c4580 X-Source: X-Source-Args: X-Source-Dir: Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 11:20:43 -0000 A new fax document for you. Please check your fax document in the attachment to this e-mail. File name: fax_00872269.doc Scanned: Tue, 27 Oct 2015 02:38:16 +0300 Processed in: 33 seconds Resolution: 100 DPI Filesize: 141 Kb Number of pages: 8 From: Brett Thornton Thank you for using Interfax! From owner-svn-src-head@freebsd.org Tue Oct 27 12:21:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E1A18A6C; Tue, 27 Oct 2015 12:21:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0174918AB; Tue, 27 Oct 2015 12:21:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RCLFuX080885; Tue, 27 Oct 2015 12:21:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RCLF40080880; Tue, 27 Oct 2015 12:21:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510271221.t9RCLF40080880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 27 Oct 2015 12:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290045 - head/sys/ofed/include/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 12:21:17 -0000 Author: hselasky Date: Tue Oct 27 12:21:15 2015 New Revision: 290045 URL: https://svnweb.freebsd.org/changeset/base/290045 Log: Add missing FreeBSD RCS keyword and SVN properties. Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/net/if_inet6.h (contents, props changed) head/sys/ofed/include/net/ip.h (contents, props changed) head/sys/ofed/include/net/ipv6.h (contents, props changed) head/sys/ofed/include/net/netevent.h (contents, props changed) head/sys/ofed/include/net/tcp.h (contents, props changed) Modified: head/sys/ofed/include/net/if_inet6.h ============================================================================== --- head/sys/ofed/include/net/if_inet6.h Tue Oct 27 12:03:14 2015 (r290044) +++ head/sys/ofed/include/net/if_inet6.h Tue Oct 27 12:21:15 2015 (r290045) @@ -25,8 +25,9 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ - #ifndef _NET_IF_INET6_H_ #define _NET_IF_INET6_H_ Modified: head/sys/ofed/include/net/ip.h ============================================================================== --- head/sys/ofed/include/net/ip.h Tue Oct 27 12:03:14 2015 (r290044) +++ head/sys/ofed/include/net/ip.h Tue Oct 27 12:21:15 2015 (r290045) @@ -25,8 +25,9 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ - #ifndef _LINUX_NET_IP_H_ #define _LINUX_NET_IP_H_ Modified: head/sys/ofed/include/net/ipv6.h ============================================================================== --- head/sys/ofed/include/net/ipv6.h Tue Oct 27 12:03:14 2015 (r290044) +++ head/sys/ofed/include/net/ipv6.h Tue Oct 27 12:21:15 2015 (r290045) @@ -25,8 +25,9 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ - #ifndef _LINUX_NET_IPV6_H_ #define _LINUX_NET_IPV6_H_ Modified: head/sys/ofed/include/net/netevent.h ============================================================================== --- head/sys/ofed/include/net/netevent.h Tue Oct 27 12:03:14 2015 (r290044) +++ head/sys/ofed/include/net/netevent.h Tue Oct 27 12:21:15 2015 (r290045) @@ -25,8 +25,9 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ - #ifndef _LINUX_NET_NETEVENT_H_ #define _LINUX_NET_NETEVENT_H_ Modified: head/sys/ofed/include/net/tcp.h ============================================================================== --- head/sys/ofed/include/net/tcp.h Tue Oct 27 12:03:14 2015 (r290044) +++ head/sys/ofed/include/net/tcp.h Tue Oct 27 12:21:15 2015 (r290045) @@ -25,8 +25,9 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ - #ifndef _LINUX_NET_TCP_H_ #define _LINUX_NET_TCP_H_ From owner-svn-src-head@freebsd.org Tue Oct 27 13:44:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67EFBA1E5E3; Tue, 27 Oct 2015 13:44:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 349F61BC6; Tue, 27 Oct 2015 13:44:15 +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 t9RDiEjO008999; Tue, 27 Oct 2015 13:44:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RDiE93008998; Tue, 27 Oct 2015 13:44:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201510271344.t9RDiE93008998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 27 Oct 2015 13:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290047 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 13:44:15 -0000 Author: kib Date: Tue Oct 27 13:44:13 2015 New Revision: 290047 URL: https://svnweb.freebsd.org/changeset/base/290047 Log: Do not perform read-ahead for BA_CLRBUF request when we are low on memory or when dirty buffer queue is too large. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Oct 27 12:42:27 2015 (r290046) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Oct 27 13:44:13 2015 (r290047) @@ -429,7 +429,9 @@ retry: brelse(bp); if (flags & BA_CLRBUF) { int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT; - if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { + if (seqcount != 0 && + (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0 && + !(vm_page_count_severe() || buf_dirty_count_severe())) { error = cluster_read(vp, ip->i_size, lbn, (int)fs->fs_bsize, NOCRED, MAXBSIZE, seqcount, gbflags, &nbp); @@ -998,7 +1000,9 @@ retry: */ if (flags & BA_CLRBUF) { int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT; - if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { + if (seqcount != 0 && + (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0 && + !(vm_page_count_severe() || buf_dirty_count_severe())) { error = cluster_read(vp, ip->i_size, lbn, (int)fs->fs_bsize, NOCRED, MAXBSIZE, seqcount, gbflags, &nbp); From owner-svn-src-head@freebsd.org Tue Oct 27 14:21:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3CDA1F021; Tue, 27 Oct 2015 14:21:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 836821A20; Tue, 27 Oct 2015 14:21:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RELOQg020998; Tue, 27 Oct 2015 14:21:24 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RELO1S020997; Tue, 27 Oct 2015 14:21:24 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201510271421.t9RELO1S020997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 27 Oct 2015 14:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290048 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 14:21:25 -0000 Author: avos Date: Tue Oct 27 14:21:24 2015 New Revision: 290048 URL: https://svnweb.freebsd.org/changeset/base/290048 Log: urtwn(4): fix scanning from AUTH state Tested with RTL8188EU, STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3968 Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Tue Oct 27 13:44:13 2015 (r290047) +++ head/sys/dev/usb/wlan/if_urtwn.c Tue Oct 27 14:21:24 2015 (r290048) @@ -264,6 +264,8 @@ static void urtwn_r88e_get_txpower(stru static void urtwn_set_txpower(struct urtwn_softc *, struct ieee80211_channel *, struct ieee80211_channel *); +static void urtwn_set_rx_bssid_all(struct urtwn_softc *, int); +static void urtwn_set_gain(struct urtwn_softc *, uint8_t); static void urtwn_scan_start(struct ieee80211com *); static void urtwn_scan_end(struct ieee80211com *); static void urtwn_set_channel(struct ieee80211com *); @@ -1544,7 +1546,6 @@ urtwn_newstate(struct ieee80211vap *vap, struct urtwn_softc *sc = ic->ic_softc; struct ieee80211_node *ni; enum ieee80211_state ostate; - uint32_t reg; ostate = vap->iv_state; DPRINTF("%s -> %s\n", ieee80211_state_name[ostate], @@ -1585,38 +1586,11 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_set_led(sc, URTWN_LED_LINK, 0); break; case IEEE80211_S_SCAN: - if (ostate != IEEE80211_S_SCAN) { - /* Allow Rx from any BSSID. */ - urtwn_write_4(sc, R92C_RCR, - urtwn_read_4(sc, R92C_RCR) & - ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN)); - - /* Set gain for scanning. */ - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - - if (!(sc->chip & URTWN_CHIP_88E)) { - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); - } - } /* Pause AC Tx queues. */ urtwn_write_1(sc, R92C_TXPAUSE, urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); break; case IEEE80211_S_AUTH: - /* Set initial gain under link. */ - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - - if (!(sc->chip & URTWN_CHIP_88E)) { - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); - } urtwn_set_chan(sc, ic->ic_curchan, NULL); break; case IEEE80211_S_RUN: @@ -3079,15 +3053,58 @@ urtwn_set_txpower(struct urtwn_softc *sc } static void +urtwn_set_rx_bssid_all(struct urtwn_softc *sc, int enable) +{ + uint32_t reg; + + reg = urtwn_read_4(sc, R92C_RCR); + if (enable) + reg &= ~R92C_RCR_CBSSID_BCN; + else + reg |= R92C_RCR_CBSSID_BCN; + urtwn_write_4(sc, R92C_RCR, reg); +} + +static void +urtwn_set_gain(struct urtwn_softc *sc, uint8_t gain) +{ + uint32_t reg; + + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, gain); + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); + + if (!(sc->chip & URTWN_CHIP_88E)) { + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, gain); + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + } +} + +static void urtwn_scan_start(struct ieee80211com *ic) { - /* XXX do nothing? */ + struct urtwn_softc *sc = ic->ic_softc; + + URTWN_LOCK(sc); + /* Receive beacons / probe responses from any BSSID. */ + urtwn_set_rx_bssid_all(sc, 1); + /* Set gain for scanning. */ + urtwn_set_gain(sc, 0x20); + URTWN_UNLOCK(sc); } static void urtwn_scan_end(struct ieee80211com *ic) { - /* XXX do nothing? */ + struct urtwn_softc *sc = ic->ic_softc; + + URTWN_LOCK(sc); + /* Restore limitations. */ + urtwn_set_rx_bssid_all(sc, 0); + /* Set gain under link. */ + urtwn_set_gain(sc, 0x32); + URTWN_UNLOCK(sc); } static void From owner-svn-src-head@freebsd.org Tue Oct 27 16:12:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38A7DA1EE02 for ; Tue, 27 Oct 2015 16:12:33 +0000 (UTC) (envelope-from ansmish@gmail.com) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) (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 0B1A319C4 for ; Tue, 27 Oct 2015 16:12:33 +0000 (UTC) (envelope-from ansmish@gmail.com) Received: by padhk11 with SMTP id hk11so226940953pad.1 for ; Tue, 27 Oct 2015 09:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=NlqRYNjcwnUYFiOPs7U62GbSq6gRQsncFGpe+nNV+B0=; b=CVhdLnEWSHHM2506TW4NfecfWpfHRdj6lbKmzc4Vp/coy2FO1Obn8HYcnWCpNHqqkl ppTR3LORSEIOqwqEkRSJ6yeeGPqOfDREVWdU4FgA+lLUDwdo0TmEwgZkwl8kI80cSIFy 55izh0TE8t4OI7MAn1GMKmD9+OjA+vEUoOXE/Qdg/QrbersCPnwwl7ihwYGxDtmeQ/bN KRhUxQNx+Puq2culMiB3a4aQn/7LxvvYWw/dCVHp6FEbU5L+P+gpDuHfKzGsWDQh50lN u4pSkvibpTGEvuibwzYzYWVAjw3t0oqbIGBZjvo9PjjlaEvArUyorE1SI9Dm3uNB7ZXn EdsQ== X-Received: by 10.67.1.170 with SMTP id bh10mr28733323pad.17.1445962352416; Tue, 27 Oct 2015 09:12:32 -0700 (PDT) Received: from [10.66.66.202] (124-148-84-116.dyn.iinet.net.au. [124.148.84.116]) by smtp.googlemail.com with ESMTPSA id ss6sm40467245pbc.74.2015.10.27.09.12.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Oct 2015 09:12:31 -0700 (PDT) Message-ID: <562FA26C.8060102@gmail.com> Date: Wed, 28 Oct 2015 00:12:28 +0800 From: Andrew User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 MIME-Version: 1.0 To: svn-src-head@freebsd.org Subject: Re: svn commit: r278111 - in head/sys/cam: . scsi References: <201502022023.t12KN6ir069698@svn.freebsd.org> In-Reply-To: <201502022023.t12KN6ir069698@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 16:12:33 -0000 Hi Alexander I have the exact problem that this patch seems to solve. Unfortunately only just started with freebsd and am not sure how to implement the modified files. Tried searching for any howto's but no luck. Any help would be much appreciated. Cheers Wolf From owner-svn-src-head@freebsd.org Tue Oct 27 16:39:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA511A1F333; Tue, 27 Oct 2015 16:39:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A077917E2; Tue, 27 Oct 2015 16:39:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RGd0na076712; Tue, 27 Oct 2015 16:39:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RGd0OX076710; Tue, 27 Oct 2015 16:39:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510271639.t9RGd0OX076710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 16:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290049 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 16:39:02 -0000 Author: bdrewery Date: Tue Oct 27 16:39:00 2015 New Revision: 290049 URL: https://svnweb.freebsd.org/changeset/base/290049 Log: Add a hint on who can help with share/mk currently. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Oct 27 14:21:24 2015 (r290048) +++ head/MAINTAINERS Tue Oct 27 16:39:00 2015 (r290049) @@ -66,8 +66,7 @@ net80211 adrian Pre-commit review reques nvi peter Try not to break it. libz peter Try not to break it. groff ru Recommends pre-commit review. -share/mk ru This is a vital component of the build system, so I - offer a pre-commit review for anything non-trivial. +share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. ipfw ipfw Pre-commit review preferred. send to ipfw@freebsd.org drm rnoland Just keep me informed of changes, try not to break it. unifdef(1) fanf Pre-commit review requested. From owner-svn-src-head@freebsd.org Tue Oct 27 16:50:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D224FA1F5C7; Tue, 27 Oct 2015 16:50:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 998F21F08; Tue, 27 Oct 2015 16:50:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RGofAG080232; Tue, 27 Oct 2015 16:50:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RGofIb080231; Tue, 27 Oct 2015 16:50:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510271650.t9RGofIb080231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 16:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290050 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 16:50:42 -0000 Author: bdrewery Date: Tue Oct 27 16:50:41 2015 New Revision: 290050 URL: https://svnweb.freebsd.org/changeset/base/290050 Log: Update notes about zfs and geom. Also add a note on how to find the real maintainers in case of bitrot. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Oct 27 16:39:00 2015 (r290049) +++ head/MAINTAINERS Tue Oct 27 16:50:41 2015 (r290050) @@ -18,6 +18,12 @@ However, this is not a 'big stick', it i of guidance. It does not override the communal nature of the tree. It is not a registry of 'turf' or private property. +*** +This list is prone to becoming stale quickly. The best way to find the recent +maintainer of a sub-system is to check recent logs for that directory or +sub-system. +*** + subsystem login notes ----------------------------- kqueue jmg Pre-commit review requested. Documentation Required. @@ -80,6 +86,7 @@ file obrien Insists to keep file blocke contrib/bzip2 obrien Pre-commit review required. contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. contrib/pjdfstest freebsd-testing,ngie Pre-commit review requested. +geom freebsd-geom@FreeBSD.org geom_concat pjd Pre-commit review preferred. geom_eli pjd Pre-commit review preferred. geom_gate pjd Pre-commit review preferred. @@ -91,7 +98,7 @@ geom_shsec pjd Pre-commit review preferr geom_stripe pjd Pre-commit review preferred. geom_zero pjd Pre-commit review preferred. sbin/geom pjd Pre-commit review preferred. -zfs pjd Pre-commit review preferred. +zfs freebsd-fs@FreeBSD.org nfs alfred Will be happy to review code, but not mandatory. rpc.lockd alfred Will be happy to review code, but not mandatory. truss alfred Will be happy to review code, but not mandatory. From owner-svn-src-head@freebsd.org Tue Oct 27 16:52:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A154A1F717; Tue, 27 Oct 2015 16:52:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20EA612D6; Tue, 27 Oct 2015 16:52:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RGqAPF082912; Tue, 27 Oct 2015 16:52:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RGqAtn082911; Tue, 27 Oct 2015 16:52:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510271652.t9RGqAtn082911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 16:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290051 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 16:52:11 -0000 Author: bdrewery Date: Tue Oct 27 16:52:09 2015 New Revision: 290051 URL: https://svnweb.freebsd.org/changeset/base/290051 Log: Update nfs note and remove some other stale ones. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Oct 27 16:50:41 2015 (r290050) +++ head/MAINTAINERS Tue Oct 27 16:52:09 2015 (r290051) @@ -99,10 +99,7 @@ geom_stripe pjd Pre-commit review prefer geom_zero pjd Pre-commit review preferred. sbin/geom pjd Pre-commit review preferred. zfs freebsd-fs@FreeBSD.org -nfs alfred Will be happy to review code, but not mandatory. -rpc.lockd alfred Will be happy to review code, but not mandatory. -truss alfred Will be happy to review code, but not mandatory. -rpc alfred Pre-commit review requested. +nfs freebsd-fs@FreeBSD.org, rmacklem is best for reviews. linux emul emulation Please discuss changes here. bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. From owner-svn-src-head@freebsd.org Tue Oct 27 18:32:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF6FA1FB1A; Tue, 27 Oct 2015 18:32:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id E95AE13DA; Tue, 27 Oct 2015 18:32:04 +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 t9RIW36w016587; Tue, 27 Oct 2015 18:32:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RIW39s016585; Tue, 27 Oct 2015 18:32:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510271832.t9RIW39s016585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Oct 2015 18:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290054 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 18:32:05 -0000 Author: mav Date: Tue Oct 27 18:32:03 2015 New Revision: 290054 URL: https://svnweb.freebsd.org/changeset/base/290054 Log: Reimplement next port handle generation. For some reason port handles should be allocated from HBA-global space, while old code was not very specific, mixing per-HBA and per-VP logic. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Oct 27 17:00:51 2015 (r290053) +++ head/sys/dev/isp/isp.c Tue Oct 27 18:32:03 2015 (r290054) @@ -130,7 +130,7 @@ static int isp_scan_fabric(ispsoftc_t *, static int isp_login_device(ispsoftc_t *, int, uint32_t, isp_pdb_t *, uint16_t *); static int isp_register_fc4_type(ispsoftc_t *, int); static int isp_register_fc4_type_24xx(ispsoftc_t *, int); -static uint16_t isp_nxt_handle(ispsoftc_t *, int, uint16_t); +static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *); static void isp_fw_state(ispsoftc_t *, int); static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); static void isp_mboxcmd(ispsoftc_t *, mbreg_t *); @@ -2901,7 +2901,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp->isp_fabric_params = 0; } if (chan) { - fcp->isp_sns_hdl = NPH_SNS_HDLBASE + chan; + fcp->isp_sns_hdl = NPH_RESERVED - chan; r = isp_plogx(isp, chan, fcp->isp_sns_hdl, SNS_PORT_ID, PLOGX_FLG_CMD_PLOGI | PLOGX_FLG_COND_PLOGI | PLOGX_FLG_SKIP_PRLI, 0); if (r) { isp_prt(isp, ISP_LOGWARN, "%s: Chan %d cannot log into SNS", __func__, chan); @@ -3522,7 +3522,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha { fcparam *fcp = FCPARAM(isp, chan); uint32_t portid; - uint16_t handle, oldhandle, loopid; + uint16_t handle, loopid; isp_pdb_t pdb; int portidx, portlim, r; sns_gid_ft_rsp_t *rs0, *rs1; @@ -3625,11 +3625,6 @@ isp_scan_fabric(ispsoftc_t *isp, int cha fcp->portdb[FL_ID].state = FC_PORTDB_STATE_PENDING_VALID; /* - * Prime the handle we will start using. - */ - oldhandle = FCPARAM(isp, 0)->isp_lasthdl; - - /* * Go through the list and remove duplicate port ids. */ @@ -3822,7 +3817,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha */ if ((fcp->role & ISP_ROLE_INITIATOR) == 0 || isp_login_device(isp, chan, portid, &pdb, - &oldhandle)) { + &FCPARAM(isp, 0)->isp_lasthdl)) { lp->new_portid = portid; lp->state = FC_PORTDB_STATE_DEAD; if (fcp->isp_loopstate != @@ -3839,7 +3834,6 @@ isp_scan_fabric(ispsoftc_t *isp, int cha ISP_MARK_PORTDB(isp, chan, 1); return (-1); } - FCPARAM(isp, 0)->isp_lasthdl = oldhandle; MAKE_WWN_FROM_NODE_NAME(wwnn, pdb.nodename); MAKE_WWN_FROM_NODE_NAME(wwpn, pdb.portname); if (wwpn != lp->port_wwn || @@ -3940,7 +3934,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha * isp_login_device will check for handle and * portid consistency after login. */ - if (isp_login_device(isp, chan, portid, &pdb, &oldhandle)) { + if (isp_login_device(isp, chan, portid, &pdb, + &FCPARAM(isp, 0)->isp_lasthdl)) { if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) { FC_SCRATCH_RELEASE(isp, chan); ISP_MARK_PORTDB(isp, chan, 1); @@ -3953,7 +3948,6 @@ isp_scan_fabric(ispsoftc_t *isp, int cha ISP_MARK_PORTDB(isp, chan, 1); return (-1); } - FCPARAM(isp, 0)->isp_lasthdl = oldhandle; handle = pdb.handle; MAKE_WWN_FROM_NODE_NAME(wwnn, pdb.nodename); @@ -4046,7 +4040,7 @@ isp_login_device(ispsoftc_t *isp, int ch lim = NPH_MAX; } - handle = isp_nxt_handle(isp, chan, *ohp); + handle = isp_next_handle(isp, ohp); for (i = 0; i < lim; i++) { /* * See if we're still logged into something with @@ -4070,7 +4064,6 @@ isp_login_device(ispsoftc_t *isp, int ch return (-1); } if (r == 0) { - *ohp = handle; break; } else if ((r & 0xffff) == MBOX_PORT_ID_USED) { /* @@ -4088,22 +4081,14 @@ isp_login_device(ispsoftc_t *isp, int ch if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) { return (-1); } - if (r == 0) { - *ohp = handle; - } else { + if (r != 0) i = lim; - } break; } else if ((r & 0xffff) == MBOX_LOOP_ID_USED) { - /* - * Try the next loop id. - */ - *ohp = handle; - handle = isp_nxt_handle(isp, chan, handle); + /* Try the next loop id. */ + handle = isp_next_handle(isp, ohp); } else { - /* - * Give up. - */ + /* Give up. */ i = lim; break; } @@ -4288,45 +4273,46 @@ isp_register_fc4_type_24xx(ispsoftc_t *i } static uint16_t -isp_nxt_handle(ispsoftc_t *isp, int chan, uint16_t handle) +isp_next_handle(ispsoftc_t *isp, uint16_t *ohp) { - int i; + fcparam *fcp; + int i, chan, wrap; + uint16_t handle, minh, maxh; + + handle = *ohp; + if (ISP_CAP_2KLOGIN(isp)) { + minh = 0; + maxh = NPH_RESERVED - isp->isp_nchan; /* Reserve for SNS */ + } else { + minh = SNS_ID + 1; + maxh = NPH_MAX - 1; + } + wrap = 0; + +next: if (handle == NIL_HANDLE) { - if (FCPARAM(isp, chan)->isp_topo == TOPO_F_PORT) { - handle = 0; - } else { - handle = SNS_ID+1; - } + handle = minh; } else { - handle += 1; - if (handle >= FL_ID && handle <= SNS_ID) { - handle = SNS_ID+1; - } - if (handle >= NPH_RESERVED && handle <= NPH_IP_BCST) { - handle = NPH_IP_BCST + 1; - } - if (ISP_CAP_2KLOGIN(isp)) { - if (handle == NPH_MAX_2K) { - handle = 0; - } - } else { - if (handle == NPH_MAX) { - handle = 0; + handle++; + if (handle > maxh) { + if (++wrap >= 2) { + isp_prt(isp, ISP_LOGERR, "Out of port handles!"); + return (NIL_HANDLE); } + handle = minh; } } - if (handle == FCPARAM(isp, chan)->isp_loopid) { - return (isp_nxt_handle(isp, chan, handle)); - } - for (i = 0; i < MAX_FC_TARG; i++) { - if (FCPARAM(isp, chan)->portdb[i].state == - FC_PORTDB_STATE_NIL) { + for (chan = 0; chan < isp->isp_nchan; chan++) { + fcp = FCPARAM(isp, chan); + if (fcp->role == ISP_ROLE_NONE) continue; - } - if (FCPARAM(isp, chan)->portdb[i].handle == handle) { - return (isp_nxt_handle(isp, chan, handle)); + for (i = 0; i < MAX_FC_TARG; i++) { + if (fcp->portdb[i].state != FC_PORTDB_STATE_NIL && + fcp->portdb[i].handle == handle) + goto next; } } + *ohp = handle; return (handle); } @@ -5015,7 +5001,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct return (isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0)); } do { - p->handle = isp_nxt_handle(isp, p->channel, p->handle); + isp_next_handle(isp, &p->handle); r = isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0); if ((r & 0xffff) == MBOX_PORT_ID_USED) { p->handle = r >> 16; Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Tue Oct 27 17:00:51 2015 (r290053) +++ head/sys/dev/isp/ispvar.h Tue Oct 27 18:32:03 2015 (r290054) @@ -244,9 +244,6 @@ typedef struct { #define SNS_ID 0x80 /* SNS Server Special ID */ #define NPH_MAX 0xfe -/* Use this handle for the base for multi-id firmware SNS logins */ -#define NPH_SNS_HDLBASE 0x400 - /* These are for 2K Login Firmware cards */ #define NPH_RESERVED 0x7F0 /* begin of reserved N-port handles */ #define NPH_MGT_ID 0x7FA /* Management Server Special ID */ From owner-svn-src-head@freebsd.org Tue Oct 27 20:34:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19587885C; Tue, 27 Oct 2015 20:34:32 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 D3DC2126C; Tue, 27 Oct 2015 20:34:31 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RKYURq053341; Tue, 27 Oct 2015 20:34:30 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RKYUGH053340; Tue, 27 Oct 2015 20:34:30 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201510272034.t9RKYUGH053340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Tue, 27 Oct 2015 20:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290055 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 20:34:32 -0000 Author: dumbbell Date: Tue Oct 27 20:34:30 2015 New Revision: 290055 URL: https://svnweb.freebsd.org/changeset/base/290055 Log: drm/i915: Reduce diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. MFC after: 2 months Modified: head/sys/dev/drm2/i915/i915_dma.c Modified: head/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- head/sys/dev/drm2/i915/i915_dma.c Tue Oct 27 18:32:03 2015 (r290054) +++ head/sys/dev/drm2/i915/i915_dma.c Tue Oct 27 20:34:30 2015 (r290055) @@ -254,7 +254,7 @@ static int i915_dma_resume(struct drm_de drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; struct intel_ring_buffer *ring = LP_RING(dev_priv); - DRM_DEBUG("\n"); + DRM_DEBUG_DRIVER("%s\n", __func__); if (ring->virtual_start == NULL) { DRM_ERROR("can not ioremap virtual address for" @@ -267,13 +267,14 @@ static int i915_dma_resume(struct drm_de DRM_ERROR("Can not find hardware status page\n"); return -EINVAL; } - DRM_DEBUG("hw status page @ %p\n", ring->status_page.page_addr); + DRM_DEBUG_DRIVER("hw status page @ %p\n", + ring->status_page.page_addr); if (ring->status_page.gfx_addr != 0) intel_ring_setup_status_page(ring); else i915_write_hws_pga(dev); - DRM_DEBUG("Enabled hardware status page\n"); + DRM_DEBUG_DRIVER("Enabled hardware status page\n"); return 0; } @@ -562,7 +563,6 @@ static int i915_dispatch_batchbuffer(str } i915_emit_breadcrumb(dev); - return 0; } @@ -576,10 +576,10 @@ static int i915_dispatch_flip(struct drm if (!master_priv->sarea_priv) return -EINVAL; - DRM_DEBUG("%s: page=%d pfCurrentPage=%d\n", - __func__, - dev_priv->current_page, - master_priv->sarea_priv->pf_current_page); + DRM_DEBUG_DRIVER("%s: page=%d pfCurrentPage=%d\n", + __func__, + dev_priv->current_page, + master_priv->sarea_priv->pf_current_page); i915_kernel_lost_context(dev); @@ -622,10 +622,8 @@ static int i915_dispatch_flip(struct drm static int i915_quiescent(struct drm_device *dev) { - struct intel_ring_buffer *ring = LP_RING(dev->dev_private); - i915_kernel_lost_context(dev); - return (intel_wait_ring_idle(ring)); + return intel_wait_ring_idle(LP_RING(dev->dev_private)); } static int i915_flush_ioctl(struct drm_device *dev, void *data, @@ -642,7 +640,7 @@ static int i915_flush_ioctl(struct drm_d ret = i915_quiescent(dev); DRM_UNLOCK(dev); - return (ret); + return ret; } int i915_batchbuffer(struct drm_device *dev, void *data, @@ -653,28 +651,29 @@ int i915_batchbuffer(struct drm_device * drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *) master_priv->sarea_priv; drm_i915_batchbuffer_t *batch = data; - struct drm_clip_rect *cliprects; size_t cliplen; int ret; + struct drm_clip_rect *cliprects = NULL; if (!dev_priv->dri1.allow_batchbuffer) { DRM_ERROR("Batchbuffer ioctl disabled\n"); return -EINVAL; } - DRM_DEBUG("i915 batchbuffer, start %x used %d cliprects %d\n", - batch->start, batch->used, batch->num_cliprects); + DRM_DEBUG_DRIVER("i915 batchbuffer, start %x used %d cliprects %d\n", + batch->start, batch->used, batch->num_cliprects); cliplen = batch->num_cliprects * sizeof(struct drm_clip_rect); if (batch->num_cliprects < 0) return -EFAULT; if (batch->num_cliprects != 0) { cliprects = malloc(batch->num_cliprects * - sizeof(struct drm_clip_rect), DRM_MEM_DMA, - M_WAITOK | M_ZERO); + sizeof(struct drm_clip_rect), + DRM_MEM_DMA, M_WAITOK | M_ZERO); ret = -copyin(batch->cliprects, cliprects, - batch->num_cliprects * sizeof(struct drm_clip_rect)); + batch->num_cliprects * + sizeof(struct drm_clip_rect)); if (ret != 0) goto fail_free; } else @@ -690,6 +689,7 @@ int i915_batchbuffer(struct drm_device * fail_free: free(cliprects, DRM_MEM_DMA); + return ret; } @@ -705,12 +705,12 @@ int i915_cmdbuffer(struct drm_device *de void *batch_data; int ret; + DRM_DEBUG_DRIVER("i915 cmdbuffer, buf %p sz %d cliprects %d\n", + cmdbuf->buf, cmdbuf->sz, cmdbuf->num_cliprects); + if (drm_core_check_feature(dev, DRIVER_MODESET)) return -ENODEV; - DRM_DEBUG("i915 cmdbuffer, buf %p sz %d cliprects %d\n", - cmdbuf->buf, cmdbuf->sz, cmdbuf->num_cliprects); - if (cmdbuf->num_cliprects < 0) return -EINVAL; @@ -722,8 +722,7 @@ int i915_cmdbuffer(struct drm_device *de if (cmdbuf->num_cliprects) { cliprects = malloc(cmdbuf->num_cliprects * - sizeof(struct drm_clip_rect), DRM_MEM_DMA, - M_WAITOK | M_ZERO); + sizeof(struct drm_clip_rect), DRM_MEM_DMA, M_WAITOK | M_ZERO); ret = -copyin(cmdbuf->cliprects, cliprects, cmdbuf->num_cliprects * sizeof(struct drm_clip_rect)); if (ret != 0) @@ -746,6 +745,7 @@ fail_clip_free: free(cliprects, DRM_MEM_DMA); fail_batch_free: free(batch_data, DRM_MEM_DMA); + return ret; } @@ -756,7 +756,7 @@ static int i915_emit_irq(struct drm_devi i915_kernel_lost_context(dev); - DRM_DEBUG("i915: emit_irq\n"); + DRM_DEBUG_DRIVER("\n"); dev_priv->counter++; if (dev_priv->counter > 0x7FFFFFFFUL) @@ -779,10 +779,10 @@ static int i915_wait_irq(struct drm_devi { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; - int ret; + int ret = 0; struct intel_ring_buffer *ring = LP_RING(dev_priv); - DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr, + DRM_DEBUG_DRIVER("irq_nr=%d breadcrumb=%d\n", irq_nr, READ_BREADCRUMB(dev_priv)); if (READ_BREADCRUMB(dev_priv) >= irq_nr) { @@ -920,7 +920,7 @@ static int i915_flip_bufs(struct drm_dev if (drm_core_check_feature(dev, DRIVER_MODESET)) return -ENODEV; - DRM_DEBUG("%s\n", __func__); + DRM_DEBUG_DRIVER("%s\n", __func__); RING_LOCK_TEST_WITH_RETURN(dev, file_priv); @@ -1039,7 +1039,8 @@ static int i915_setparam(struct drm_devi dev_priv->fence_reg_start = param->value; break; default: - DRM_DEBUG("unknown parameter %d\n", param->param); + DRM_DEBUG_DRIVER("unknown parameter %d\n", + param->param); return -EINVAL; } @@ -1051,7 +1052,7 @@ static int i915_set_status_page(struct d { drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_hws_addr_t *hws = data; - struct intel_ring_buffer *ring = LP_RING(dev_priv); + struct intel_ring_buffer *ring; if (drm_core_check_feature(dev, DRIVER_MODESET)) return -ENODEV; @@ -1064,18 +1065,20 @@ static int i915_set_status_page(struct d return -EINVAL; } - DRM_DEBUG("set status page addr 0x%08x\n", (u32)hws->addr); if (drm_core_check_feature(dev, DRIVER_MODESET)) { DRM_ERROR("tried to set status page when mode setting active\n"); return 0; } + DRM_DEBUG_DRIVER("set status page addr 0x%08x\n", (u32)hws->addr); + + ring = LP_RING(dev_priv); ring->status_page.gfx_addr = dev_priv->status_gfx_addr = hws->addr & (0x1ffff<<12); - dev_priv->dri1.gfx_hws_cpu_addr = pmap_mapdev_attr( - dev->agp->base + hws->addr, PAGE_SIZE, - VM_MEMATTR_WRITE_COMBINING); + dev_priv->dri1.gfx_hws_cpu_addr = + pmap_mapdev_attr(dev->agp->base + hws->addr, PAGE_SIZE, + VM_MEMATTR_WRITE_COMBINING); if (dev_priv->dri1.gfx_hws_cpu_addr == NULL) { i915_dma_cleanup(dev); ring->status_page.gfx_addr = dev_priv->status_gfx_addr = 0; @@ -1086,107 +1089,24 @@ static int i915_set_status_page(struct d memset(dev_priv->dri1.gfx_hws_cpu_addr, 0, PAGE_SIZE); I915_WRITE(HWS_PGA, dev_priv->status_gfx_addr); - DRM_DEBUG("load hws HWS_PGA with gfx mem 0x%x\n", - dev_priv->status_gfx_addr); - DRM_DEBUG("load hws at %p\n", dev_priv->hw_status_page); - return 0; -} - -static int -i915_load_modeset_init(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - int ret; - ret = intel_parse_bios(dev); - if (ret) - DRM_INFO("failed to find VBIOS tables\n"); - -#if 0 - intel_register_dsm_handler(); -#endif - - /* Initialise stolen first so that we may reserve preallocated - * objects for the BIOS to KMS transition. - */ - ret = i915_gem_init_stolen(dev); - if (ret) - goto cleanup_vga_switcheroo; - - intel_modeset_init(dev); - - ret = i915_gem_init(dev); - if (ret) - goto cleanup_gem_stolen; - - intel_modeset_gem_init(dev); - - ret = drm_irq_install(dev); - if (ret) - goto cleanup_gem; - - dev->vblank_disable_allowed = 1; - - ret = intel_fbdev_init(dev); - if (ret) - goto cleanup_gem; - - drm_kms_helper_poll_init(dev); - - /* We're off and running w/KMS */ - dev_priv->mm.suspended = 0; - - return 0; - -cleanup_gem: - DRM_LOCK(dev); - i915_gem_cleanup_ringbuffer(dev); - DRM_UNLOCK(dev); - i915_gem_cleanup_aliasing_ppgtt(dev); -cleanup_gem_stolen: - i915_gem_cleanup_stolen(dev); -cleanup_vga_switcheroo: - return (ret); -} - -int i915_master_create(struct drm_device *dev, struct drm_master *master) -{ - struct drm_i915_master_private *master_priv; - - master_priv = malloc(sizeof(*master_priv), DRM_MEM_DMA, - M_NOWAIT | M_ZERO); - if (!master_priv) - return -ENOMEM; - - master->driver_priv = master_priv; + DRM_DEBUG_DRIVER("load hws HWS_PGA with gfx mem 0x%x\n", + dev_priv->status_gfx_addr); + DRM_DEBUG_DRIVER("load hws at %p\n", + dev_priv->hw_status_page); return 0; } -void i915_master_destroy(struct drm_device *dev, struct drm_master *master) -{ - struct drm_i915_master_private *master_priv = master->driver_priv; - - if (!master_priv) - return; - - free(master_priv, DRM_MEM_DMA); - - master->driver_priv = NULL; -} - -static int -i915_get_bridge_dev(struct drm_device *dev) +static int i915_get_bridge_dev(struct drm_device *dev) { - struct drm_i915_private *dev_priv; - - dev_priv = dev->dev_private; + struct drm_i915_private *dev_priv = dev->dev_private; dev_priv->bridge_dev = intel_gtt_get_bridge_device(); - if (dev_priv->bridge_dev == NULL) { + if (!dev_priv->bridge_dev) { DRM_ERROR("bridge device not found\n"); - return (-1); + return -1; } - return (0); + return 0; } #define MCHBAR_I915 0x44 @@ -1200,19 +1120,13 @@ i915_get_bridge_dev(struct drm_device *d static int intel_alloc_mchbar_resource(struct drm_device *dev) { - drm_i915_private_t *dev_priv; - device_t vga; - int reg; - u32 temp_lo, temp_hi; + drm_i915_private_t *dev_priv = dev->dev_private; + int reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915; + u32 temp_lo, temp_hi = 0; u64 mchbar_addr, temp; - dev_priv = dev->dev_private; - reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915; - if (INTEL_INFO(dev)->gen >= 4) temp_hi = pci_read_config(dev_priv->bridge_dev, reg + 4, 4); - else - temp_hi = 0; temp_lo = pci_read_config(dev_priv->bridge_dev, reg, 4); mchbar_addr = ((u64)temp_hi << 32) | temp_lo; @@ -1224,14 +1138,15 @@ intel_alloc_mchbar_resource(struct drm_d #endif /* Get some space for it */ + device_t vga; vga = device_get_parent(dev->dev); dev_priv->mch_res_rid = 0x100; dev_priv->mch_res = BUS_ALLOC_RESOURCE(device_get_parent(vga), dev->dev, SYS_RES_MEMORY, &dev_priv->mch_res_rid, 0, ~0UL, MCHBAR_SIZE, RF_ACTIVE | RF_SHAREABLE); if (dev_priv->mch_res == NULL) { - DRM_ERROR("failed mchbar resource alloc\n"); - return (-ENOMEM); + DRM_DEBUG_DRIVER("failed bus alloc\n"); + return -ENOMEM; } if (INTEL_INFO(dev)->gen >= 4) { @@ -1241,20 +1156,17 @@ intel_alloc_mchbar_resource(struct drm_d } pci_write_config(dev_priv->bridge_dev, reg, rman_get_start(dev_priv->mch_res) & UINT32_MAX, 4); - return (0); + return 0; } static void intel_setup_mchbar(struct drm_device *dev) { - drm_i915_private_t *dev_priv; - int mchbar_reg; + drm_i915_private_t *dev_priv = dev->dev_private; + int mchbar_reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915; u32 temp; bool enabled; - dev_priv = dev->dev_private; - mchbar_reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915; - dev_priv->mchbar_need_disable = false; if (IS_I915G(dev) || IS_I915GM(dev)) { @@ -1289,14 +1201,10 @@ intel_setup_mchbar(struct drm_device *de static void intel_teardown_mchbar(struct drm_device *dev) { - drm_i915_private_t *dev_priv; - device_t vga; - int mchbar_reg; + drm_i915_private_t *dev_priv = dev->dev_private; + int mchbar_reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915; u32 temp; - dev_priv = dev->dev_private; - mchbar_reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915; - if (dev_priv->mchbar_need_disable) { if (IS_I915G(dev) || IS_I915GM(dev)) { temp = pci_read_config(dev_priv->bridge_dev, @@ -1314,6 +1222,7 @@ intel_teardown_mchbar(struct drm_device } if (dev_priv->mch_res != NULL) { + device_t vga; vga = device_get_parent(dev->dev); BUS_DEACTIVATE_RESOURCE(device_get_parent(vga), dev->dev, SYS_RES_MEMORY, dev_priv->mch_res_rid, dev_priv->mch_res); @@ -1323,6 +1232,86 @@ intel_teardown_mchbar(struct drm_device } } +static int i915_load_modeset_init(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret; + + ret = intel_parse_bios(dev); + if (ret) + DRM_INFO("failed to find VBIOS tables\n"); + +#if 0 + intel_register_dsm_handler(); +#endif + + /* Initialise stolen first so that we may reserve preallocated + * objects for the BIOS to KMS transition. + */ + ret = i915_gem_init_stolen(dev); + if (ret) + goto cleanup_vga_switcheroo; + + intel_modeset_init(dev); + + ret = i915_gem_init(dev); + if (ret) + goto cleanup_gem_stolen; + + intel_modeset_gem_init(dev); + + ret = drm_irq_install(dev); + if (ret) + goto cleanup_gem; + + dev->vblank_disable_allowed = 1; + + ret = intel_fbdev_init(dev); + if (ret) + goto cleanup_gem; + + drm_kms_helper_poll_init(dev); + + /* We're off and running w/KMS */ + dev_priv->mm.suspended = 0; + + return 0; + +cleanup_gem: + DRM_LOCK(dev); + i915_gem_cleanup_ringbuffer(dev); + DRM_UNLOCK(dev); + i915_gem_cleanup_aliasing_ppgtt(dev); +cleanup_gem_stolen: + i915_gem_cleanup_stolen(dev); +cleanup_vga_switcheroo: + return ret; +} + +int i915_master_create(struct drm_device *dev, struct drm_master *master) +{ + struct drm_i915_master_private *master_priv; + + master_priv = malloc(sizeof(*master_priv), DRM_MEM_DMA, M_NOWAIT | M_ZERO); + if (!master_priv) + return -ENOMEM; + + master->driver_priv = master_priv; + return 0; +} + +void i915_master_destroy(struct drm_device *dev, struct drm_master *master) +{ + struct drm_i915_master_private *master_priv = master->driver_priv; + + if (!master_priv) + return; + + free(master_priv, DRM_MEM_DMA); + + master->driver_priv = NULL; +} + /** * i915_driver_load - setup chip and create an initial config * @dev: DRM device @@ -1339,7 +1328,7 @@ int i915_driver_load(struct drm_device * struct drm_i915_private *dev_priv = dev->dev_private; const struct intel_device_info *info; unsigned long base, size; - int mmio_bar, ret; + int ret = 0, mmio_bar; info = i915_get_device_id(dev->pci_device); @@ -1347,9 +1336,6 @@ int i915_driver_load(struct drm_device * if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET)) return -ENODEV; - - ret = 0; - /* i915 has 4 more counters */ dev->counters += 4; dev->types[6] = _DRM_STAT_IRQ; @@ -1358,7 +1344,7 @@ int i915_driver_load(struct drm_device * dev->types[9] = _DRM_STAT_DMA; dev_priv = malloc(sizeof(drm_i915_private_t), DRM_MEM_DRIVER, - M_ZERO | M_WAITOK); + M_WAITOK | M_ZERO); dev->dev_private = (void *)dev_priv; dev_priv->dev = dev; @@ -1366,7 +1352,7 @@ int i915_driver_load(struct drm_device * if (i915_get_bridge_dev(dev)) { free(dev_priv, DRM_MEM_DRIVER); - return (-EIO); + return -EIO; } dev_priv->mm.gtt = intel_gtt_get(); @@ -1375,12 +1361,13 @@ int i915_driver_load(struct drm_device * base = drm_get_resource_start(dev, mmio_bar); size = drm_get_resource_len(dev, mmio_bar); - ret = drm_addmap(dev, base, size, _DRM_REGISTERS, - _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map); + ret = drm_addmap(dev, + base, size, + _DRM_REGISTERS, _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map); if (ret != 0) { DRM_ERROR("Failed to allocate mmio_map: %d\n", ret); free(dev_priv, DRM_MEM_DRIVER); - return (ret); + return ret; } dev_priv->tq = taskqueue_create("915", M_WAITOK, @@ -1463,7 +1450,7 @@ int i915_driver_load(struct drm_device * if (IS_GEN5(dev)) intel_gpu_ips_init(dev_priv); - return (0); + return 0; out_gem_unload: /* XXXKIB */ @@ -1546,16 +1533,16 @@ int i915_driver_unload(struct drm_device int i915_driver_open(struct drm_device *dev, struct drm_file *file) { - struct drm_i915_file_private *i915_file_priv; + struct drm_i915_file_private *file_priv; - i915_file_priv = malloc(sizeof(*i915_file_priv), DRM_MEM_FILES, - M_WAITOK | M_ZERO); + file_priv = malloc(sizeof(*file_priv), DRM_MEM_FILES, M_WAITOK | M_ZERO); + + file->driver_priv = file_priv; - mtx_init(&i915_file_priv->mm.lck, "915fp", NULL, MTX_DEF); - INIT_LIST_HEAD(&i915_file_priv->mm.request_list); - file->driver_priv = i915_file_priv; + mtx_init(&file_priv->mm.lck, "915fp", NULL, MTX_DEF); + INIT_LIST_HEAD(&file_priv->mm.request_list); - drm_gem_names_init(&i915_file_priv->context_idr); + drm_gem_names_init(&file_priv->context_idr); return 0; } @@ -1581,6 +1568,7 @@ void i915_driver_lastclose(struct drm_de * up anything. */ if (!dev_priv) return; + if (drm_core_check_feature(dev, DRIVER_MODESET)) { #if 1 KIB_NOTYET(); @@ -1602,12 +1590,12 @@ void i915_driver_preclose(struct drm_dev i915_gem_release(dev, file_priv); } -void i915_driver_postclose(struct drm_device *dev, struct drm_file *file_priv) +void i915_driver_postclose(struct drm_device *dev, struct drm_file *file) { - struct drm_i915_file_private *i915_file_priv = file_priv->driver_priv; + struct drm_i915_file_private *file_priv = file->driver_priv; - mtx_destroy(&i915_file_priv->mm.lck); - free(i915_file_priv, DRM_MEM_FILES); + mtx_destroy(&file_priv->mm.lck); + free(file_priv, DRM_MEM_FILES); } struct drm_ioctl_desc i915_ioctls[] = { From owner-svn-src-head@freebsd.org Tue Oct 27 20:40:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5206D8A44; Tue, 27 Oct 2015 20:40:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 2719019FB; Tue, 27 Oct 2015 20:40:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RKewD9053827; Tue, 27 Oct 2015 20:40:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RKevBs053823; Tue, 27 Oct 2015 20:40:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201510272040.t9RKevBs053823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 27 Oct 2015 20:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290058 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 20:40:59 -0000 Author: avos Date: Tue Oct 27 20:40:57 2015 New Revision: 290058 URL: https://svnweb.freebsd.org/changeset/base/290058 Log: net80211: add ieee80211_restart_all() call. This call may be used when device cannot continue to operate normally (e.g., throws firmware error, watchdog timer expires) and need to be restarted. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3998 Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Oct 27 20:40:19 2015 (r290057) +++ head/sys/net80211/ieee80211.c Tue Oct 27 20:40:57 2015 (r290058) @@ -356,6 +356,8 @@ ieee80211_ifdetach(struct ieee80211com * LIST_REMOVE(ic, ic_next); mtx_unlock(&ic_list_mtx); + taskqueue_drain(taskqueue_thread, &ic->ic_restart_task); + /* * The VAP is responsible for setting and clearing * the VIMAGE context. Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Oct 27 20:40:19 2015 (r290057) +++ head/sys/net80211/ieee80211_proto.c Tue Oct 27 20:40:57 2015 (r290058) @@ -108,6 +108,7 @@ static void update_promisc(void *, int); static void update_channel(void *, int); static void update_chw(void *, int); static void update_wme(void *, int); +static void restart_vaps(void *, int); static void ieee80211_newstate_cb(void *, int); static int @@ -146,6 +147,7 @@ ieee80211_proto_attach(struct ieee80211c TASK_INIT(&ic->ic_bmiss_task, 0, beacon_miss, ic); TASK_INIT(&ic->ic_chw_task, 0, update_chw, ic); TASK_INIT(&ic->ic_wme_task, 0, update_wme, ic); + TASK_INIT(&ic->ic_restart_task, 0, restart_vaps, ic); ic->ic_wme.wme_hipri_switch_hysteresis = AGGRESSIVE_MODE_SWITCH_HYSTERESIS; @@ -1212,6 +1214,15 @@ update_wme(void *arg, int npending) ic->ic_wme.wme_update(ic); } +static void +restart_vaps(void *arg, int npending) +{ + struct ieee80211com *ic = arg; + + ieee80211_suspend_all(ic); + ieee80211_resume_all(ic); +} + /* * Block until the parent is in a known state. This is * used after any operations that dispatch a task (e.g. @@ -1486,6 +1497,19 @@ ieee80211_resume_all(struct ieee80211com IEEE80211_UNLOCK(ic); } +/* + * Restart all vap's running on a device. + */ +void +ieee80211_restart_all(struct ieee80211com *ic) +{ + /* + * NB: do not use ieee80211_runtask here, we will + * block & drain net80211 taskqueue. + */ + taskqueue_enqueue(taskqueue_thread, &ic->ic_restart_task); +} + void ieee80211_beacon_miss(struct ieee80211com *ic) { Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Tue Oct 27 20:40:19 2015 (r290057) +++ head/sys/net80211/ieee80211_proto.h Tue Oct 27 20:40:57 2015 (r290058) @@ -307,6 +307,7 @@ void ieee80211_stop(struct ieee80211vap void ieee80211_stop_all(struct ieee80211com *); void ieee80211_suspend_all(struct ieee80211com *); void ieee80211_resume_all(struct ieee80211com *); +void ieee80211_restart_all(struct ieee80211com *); void ieee80211_dturbo_switch(struct ieee80211vap *, int newflags); void ieee80211_swbmiss(void *arg); void ieee80211_beacon_miss(struct ieee80211com *); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Oct 27 20:40:19 2015 (r290057) +++ head/sys/net80211/ieee80211_var.h Tue Oct 27 20:40:57 2015 (r290058) @@ -134,6 +134,7 @@ struct ieee80211com { struct task ic_bmiss_task; /* deferred beacon miss hndlr */ struct task ic_chw_task; /* deferred HT CHW update */ struct task ic_wme_task; /* deferred WME update */ + struct task ic_restart_task; /* deferred device restart */ counter_u64_t ic_ierrors; /* input errors */ counter_u64_t ic_oerrors; /* output errors */ From owner-svn-src-head@freebsd.org Tue Oct 27 20:49:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5422C8FC6; Tue, 27 Oct 2015 20:49:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2050C1E02; Tue, 27 Oct 2015 20:49:57 +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 t9RKnuL6056697; Tue, 27 Oct 2015 20:49:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RKnuQa056696; Tue, 27 Oct 2015 20:49:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201510272049.t9RKnuQa056696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 27 Oct 2015 20:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290059 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 20:49:57 -0000 Author: emaste Date: Tue Oct 27 20:49:56 2015 New Revision: 290059 URL: https://svnweb.freebsd.org/changeset/base/290059 Log: Add WITHOUT_DEBUG_FILES description Added: head/tools/build/options/WITHOUT_DEBUG_FILES (contents, props changed) Added: head/tools/build/options/WITHOUT_DEBUG_FILES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_DEBUG_FILES Tue Oct 27 20:49:56 2015 (r290059) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to avoid building or installing standalone debug files for each +executable binary and shared library. From owner-svn-src-head@freebsd.org Tue Oct 27 21:16:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A626A1C93C; Tue, 27 Oct 2015 21:16:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C99C81642; Tue, 27 Oct 2015 21:16:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLGTPP066838; Tue, 27 Oct 2015 21:16:29 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLGTUE066837; Tue, 27 Oct 2015 21:16:29 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201510272116.t9RLGTUE066837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 27 Oct 2015 21:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290065 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 21:16:31 -0000 Author: jilles Date: Tue Oct 27 21:16:29 2015 New Revision: 290065 URL: https://svnweb.freebsd.org/changeset/base/290065 Log: libedit: Use correct buffer lengths in vi mode v command. Libedit's vi mode provides a v command to edit the current line in vi(1) (hard-coded to vi, in fact). When Unicode/wide character mode was added, this command started truncating and/or corrupting the edited text. This commit fixes v if the text fits into the buffer. If the text is longer, it is truncated. PR: 203743 Obtained from: NetBSD (originally submitted by me) Modified: head/lib/libedit/vi.c Modified: head/lib/libedit/vi.c ============================================================================== --- head/lib/libedit/vi.c Tue Oct 27 21:08:46 2015 (r290064) +++ head/lib/libedit/vi.c Tue Oct 27 21:16:29 2015 (r290065) @@ -1,4 +1,4 @@ -/* $NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $ */ +/* $NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vi.c,v 1.45 2014/06/18 18:12:28 christos Exp $"); +__RCSID("$NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $"); #endif #endif /* not lint && not SCCSID */ #include @@ -1040,12 +1040,12 @@ vi_histedit(EditLine *el, Int c __attrib while (waitpid(pid, &status, 0) != pid) continue; lseek(fd, (off_t)0, SEEK_SET); - st = read(fd, cp, TMP_BUFSIZ); + st = read(fd, cp, TMP_BUFSIZ - 1); if (st > 0) { - len = (size_t)(el->el_line.lastchar - - el->el_line.buffer); + cp[st] = '\0'; + len = (size_t)(el->el_line.limit - el->el_line.buffer); len = ct_mbstowcs(el->el_line.buffer, cp, len); - if (len > 0 && el->el_line.buffer[len -1] == '\n') + if (len > 0 && el->el_line.buffer[len - 1] == '\n') --len; } else From owner-svn-src-head@freebsd.org Tue Oct 27 21:23:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E15D7A1CCD4; Tue, 27 Oct 2015 21:23:20 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A727F11C1; Tue, 27 Oct 2015 21:23:20 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLNJrU070297; Tue, 27 Oct 2015 21:23:19 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLNJPU070296; Tue, 27 Oct 2015 21:23:19 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201510272123.t9RLNJPU070296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Tue, 27 Oct 2015 21:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290070 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 21:23:21 -0000 Author: dumbbell Date: Tue Oct 27 21:23:19 2015 New Revision: 290070 URL: https://svnweb.freebsd.org/changeset/base/290070 Log: drm/i915: Reduce diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. MFC after: 2 months Modified: head/sys/dev/drm2/i915/i915_drv.c Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Tue Oct 27 21:20:00 2015 (r290069) +++ head/sys/dev/drm2/i915/i915_drv.c Tue Oct 27 21:23:19 2015 (r290070) @@ -42,6 +42,44 @@ __FBSDID("$FreeBSD$"); #include "fb_if.h" +int intel_iommu_enabled = 0; +TUNABLE_INT("drm.i915.intel_iommu_enabled", &intel_iommu_enabled); +int intel_iommu_gfx_mapped = 0; +TUNABLE_INT("drm.i915.intel_iommu_gfx_mapped", &intel_iommu_gfx_mapped); + +int i915_prefault_disable; +TUNABLE_INT("drm.i915.prefault_disable", &i915_prefault_disable); +int i915_semaphores = -1; +TUNABLE_INT("drm.i915.semaphores", &i915_semaphores); +static int i915_try_reset = 1; +TUNABLE_INT("drm.i915.try_reset", &i915_try_reset); +unsigned int i915_lvds_downclock = 0; +TUNABLE_INT("drm.i915.lvds_downclock", &i915_lvds_downclock); +int i915_vbt_sdvo_panel_type = -1; +TUNABLE_INT("drm.i915.vbt_sdvo_panel_type", &i915_vbt_sdvo_panel_type); +unsigned int i915_powersave = 1; +TUNABLE_INT("drm.i915.powersave", &i915_powersave); +int i915_enable_fbc = 0; +TUNABLE_INT("drm.i915.enable_fbc", &i915_enable_fbc); +int i915_enable_rc6 = 0; +TUNABLE_INT("drm.i915.enable_rc6", &i915_enable_rc6); +int i915_lvds_channel_mode; +TUNABLE_INT("drm.i915.lvds_channel_mode", &i915_lvds_channel_mode); +int i915_panel_use_ssc = -1; +TUNABLE_INT("drm.i915.panel_use_ssc", &i915_panel_use_ssc); +int i915_panel_ignore_lid = 0; +TUNABLE_INT("drm.i915.panel_ignore_lid", &i915_panel_ignore_lid); +int i915_panel_invert_brightness; +TUNABLE_INT("drm.i915.panel_invert_brightness", &i915_panel_invert_brightness); +int i915_modeset = 1; +TUNABLE_INT("drm.i915.modeset", &i915_modeset); +int i915_enable_ppgtt = -1; +TUNABLE_INT("drm.i915.enable_ppgtt", &i915_enable_ppgtt); +int i915_enable_hangcheck = 1; +TUNABLE_INT("drm.i915.enable_hangcheck", &i915_enable_hangcheck); +static int i915_enable_unsupported = 0; +TUNABLE_INT("drm.i915.enable_unsupported", &i915_enable_unsupported); + /* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */ static drm_pci_id_list_t i915_pciidlist[] = { i915_PCI_IDS @@ -229,7 +267,7 @@ static const struct intel_device_info in static const struct intel_gfx_device_id { int device; const struct intel_device_info *info; -} pciidlist[] = { /* aka */ +} i915_infolist[] = { /* aka */ INTEL_VGA_DEVICE(0x3577, &intel_i830_info), /* I830_M */ INTEL_VGA_DEVICE(0x2562, &intel_845g_info), /* 845_G */ INTEL_VGA_DEVICE(0x3582, &intel_i85x_info), /* I855_GM */ @@ -316,7 +354,61 @@ static const struct intel_gfx_device_id {0, 0} }; -static int i915_enable_unsupported; +#define PCI_VENDOR_INTEL 0x8086 +#define INTEL_PCH_DEVICE_ID_MASK 0xff00 +#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 +#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 +#define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 +#define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 + +void intel_detect_pch(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + device_t pch; + uint32_t id; + + pch = pci_find_class(PCIC_BRIDGE, PCIS_BRIDGE_ISA); + if (pch != NULL && pci_get_vendor(pch) == PCI_VENDOR_INTEL) { + id = pci_get_device(pch) & INTEL_PCH_DEVICE_ID_MASK; + if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { + dev_priv->pch_type = PCH_IBX; + dev_priv->num_pch_pll = 2; + DRM_DEBUG_KMS("Found Ibex Peak PCH\n"); + } else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) { + dev_priv->pch_type = PCH_CPT; + dev_priv->num_pch_pll = 2; + DRM_DEBUG_KMS("Found CougarPoint PCH\n"); + } else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) { + /* PantherPoint is CPT compatible */ + dev_priv->pch_type = PCH_CPT; + dev_priv->num_pch_pll = 2; + DRM_DEBUG_KMS("Found PatherPoint PCH\n"); + } else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) { + dev_priv->pch_type = PCH_LPT; + dev_priv->num_pch_pll = 0; + DRM_DEBUG_KMS("Found LynxPoint PCH\n"); + } else + DRM_DEBUG_KMS("No PCH detected\n"); + KASSERT(dev_priv->num_pch_pll <= I915_NUM_PLLS, + ("num_pch_pll %d\n", dev_priv->num_pch_pll)); + } else + DRM_DEBUG_KMS("No Intel PCI-ISA bridge found\n"); +} + +bool i915_semaphore_is_enabled(struct drm_device *dev) +{ + if (INTEL_INFO(dev)->gen < 6) + return 0; + + if (i915_semaphores >= 0) + return i915_semaphores; + + /* Enable semaphores on SNB when IO remapping is off */ + if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) + return false; + + return 1; +} static int i915_drm_freeze(struct drm_device *dev) { @@ -355,7 +447,7 @@ static int i915_suspend(device_t kdev) int error; dev = device_get_softc(kdev); - if (dev == NULL || dev->dev_private == NULL) { + if (!dev || !dev->dev_private) { DRM_ERROR("DRM not initialized, aborting suspend.\n"); return ENODEV; } @@ -363,7 +455,7 @@ static int i915_suspend(device_t kdev) DRM_DEBUG_KMS("starting suspend\n"); error = i915_drm_freeze(dev); if (error) - return (-error); + return -error; error = bus_generic_suspend(kdev); DRM_DEBUG_KMS("finished suspend %d\n", error); @@ -429,8 +521,8 @@ static int i915_resume(device_t kdev) #endif ret = i915_drm_thaw(dev); - if (ret != 0) - return (-ret); + if (ret) + return -ret; drm_kms_helper_poll_enable(dev); ret = bus_generic_resume(kdev); @@ -438,189 +530,348 @@ static int i915_resume(device_t kdev) return (ret); } -static int -i915_probe(device_t kdev) +static int i8xx_do_reset(struct drm_device *dev) { - const struct intel_device_info *info; - int error; + struct drm_i915_private *dev_priv = dev->dev_private; + int onems; - error = drm_probe_helper(kdev, i915_pciidlist); - if (error != 0) - return (-error); - info = i915_get_device_id(pci_get_device(kdev)); - if (info == NULL) - return (ENXIO); - return (0); -} + if (IS_I85X(dev)) + return -ENODEV; + + onems = hz / 1000; + if (onems == 0) + onems = 1; + + I915_WRITE(D_STATE, I915_READ(D_STATE) | DSTATE_GFX_RESET_I830); + POSTING_READ(D_STATE); + + if (IS_I830(dev) || IS_845G(dev)) { + I915_WRITE(DEBUG_RESET_I830, + DEBUG_RESET_DISPLAY | + DEBUG_RESET_RENDER | + DEBUG_RESET_FULL); + POSTING_READ(DEBUG_RESET_I830); + pause("i8xxrst1", onems); + + I915_WRITE(DEBUG_RESET_I830, 0); + POSTING_READ(DEBUG_RESET_I830); + } + + pause("i8xxrst2", onems); + + I915_WRITE(D_STATE, I915_READ(D_STATE) & ~DSTATE_GFX_RESET_I830); + POSTING_READ(D_STATE); -int i915_modeset; + return 0; +} -static int -i915_attach(device_t kdev) +static int i965_reset_complete(struct drm_device *dev) { + u8 gdrst; - if (i915_modeset == 1) - i915_driver_info.driver_features |= DRIVER_MODESET; - return (-drm_attach_helper(kdev, i915_pciidlist, &i915_driver_info)); + gdrst = pci_read_config(dev->dev, I965_GDRST, 1); + return (gdrst & GRDOM_RESET_ENABLE) == 0; } -static struct fb_info * -i915_fb_helper_getinfo(device_t kdev) +static int i965_do_reset(struct drm_device *dev) { - struct intel_fbdev *ifbdev; - drm_i915_private_t *dev_priv; - struct drm_device *dev; - struct fb_info *info; + int ret; + u8 gdrst; - dev = device_get_softc(kdev); - dev_priv = dev->dev_private; - ifbdev = dev_priv->fbdev; - if (ifbdev == NULL) - return (NULL); + /* + * Set the domains we want to reset (GRDOM/bits 2 and 3) as + * well as the reset bit (GR/bit 0). Setting the GR bit + * triggers the reset; when done, the hardware will clear it. + */ + gdrst = pci_read_config(dev->dev, I965_GDRST, 1); + pci_write_config(dev->dev, I965_GDRST, + gdrst | GRDOM_RENDER | + GRDOM_RESET_ENABLE, 1); + ret = wait_for(i965_reset_complete(dev), 500); + if (ret) + return ret; - info = ifbdev->helper.fbdev; + /* We can't reset render&media without also resetting display ... */ + gdrst = pci_read_config(dev->dev, I965_GDRST, 1); + pci_write_config(dev->dev, I965_GDRST, + gdrst | GRDOM_MEDIA | + GRDOM_RESET_ENABLE, 1); - return (info); + return wait_for(i965_reset_complete(dev), 500); } -const struct intel_device_info * -i915_get_device_id(int device) +static int ironlake_do_reset(struct drm_device *dev) { - const struct intel_gfx_device_id *did; + struct drm_i915_private *dev_priv = dev->dev_private; + u32 gdrst; + int ret; - for (did = &pciidlist[0]; did->device != 0; did++) { - if (did->device != device) - continue; - if (did->info->not_supported && !i915_enable_unsupported) - return (NULL); - return (did->info); - } - return (NULL); + gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); + I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, + gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE); + ret = wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); + if (ret) + return ret; + + /* We can't reset render&media without also resetting display ... */ + gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); + I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, + gdrst | GRDOM_MEDIA | GRDOM_RESET_ENABLE); + return wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); } -static device_method_t i915_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, i915_probe), - DEVMETHOD(device_attach, i915_attach), - DEVMETHOD(device_suspend, i915_suspend), - DEVMETHOD(device_resume, i915_resume), - DEVMETHOD(device_detach, drm_generic_detach), +static int gen6_do_reset(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int ret; - /* Framebuffer service methods */ - DEVMETHOD(fb_getinfo, i915_fb_helper_getinfo), + /* Hold gt_lock across reset to prevent any register access + * with forcewake not set correctly + */ + mtx_lock(&dev_priv->gt_lock); - DEVMETHOD_END -}; + /* Reset the chip */ -static driver_t i915_driver = { - "drmn", - i915_methods, - sizeof(struct drm_device) -}; + /* GEN6_GDRST is not in the gt power well, no need to check + * for fifo space for the write or forcewake the chip for + * the read + */ + I915_WRITE_NOTRACE(GEN6_GDRST, GEN6_GRDOM_FULL); -extern devclass_t drm_devclass; -DRIVER_MODULE_ORDERED(i915kms, vgapci, i915_driver, drm_devclass, 0, 0, - SI_ORDER_ANY); -MODULE_DEPEND(i915kms, drmn, 1, 1, 1); -MODULE_DEPEND(i915kms, agp, 1, 1, 1); -MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); -MODULE_DEPEND(i915kms, iic, 1, 1, 1); -MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); + /* Spin waiting for the device to ack the reset request */ + ret = _intel_wait_for(dev, + (I915_READ_NOTRACE(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, + 500, 0, "915rst"); -int intel_iommu_enabled = 0; -TUNABLE_INT("drm.i915.intel_iommu_enabled", &intel_iommu_enabled); -int intel_iommu_gfx_mapped = 0; -TUNABLE_INT("drm.i915.intel_iommu_gfx_mapped", &intel_iommu_gfx_mapped); + /* If reset with a user forcewake, try to restore, otherwise turn it off */ + if (dev_priv->forcewake_count) + dev_priv->display.force_wake_get(dev_priv); + else + dev_priv->display.force_wake_put(dev_priv); -int i915_prefault_disable; -TUNABLE_INT("drm.i915.prefault_disable", &i915_prefault_disable); -int i915_semaphores = -1; -TUNABLE_INT("drm.i915.semaphores", &i915_semaphores); -static int i915_try_reset = 1; -TUNABLE_INT("drm.i915.try_reset", &i915_try_reset); -unsigned int i915_lvds_downclock = 0; -TUNABLE_INT("drm.i915.lvds_downclock", &i915_lvds_downclock); -int i915_vbt_sdvo_panel_type = -1; -TUNABLE_INT("drm.i915.vbt_sdvo_panel_type", &i915_vbt_sdvo_panel_type); -unsigned int i915_powersave = 1; -TUNABLE_INT("drm.i915.powersave", &i915_powersave); -int i915_enable_fbc = 0; -TUNABLE_INT("drm.i915.enable_fbc", &i915_enable_fbc); -int i915_enable_rc6 = 0; -TUNABLE_INT("drm.i915.enable_rc6", &i915_enable_rc6); -int i915_lvds_channel_mode; -TUNABLE_INT("drm.i915.lvds_channel_mode", &i915_lvds_channel_mode); -int i915_panel_use_ssc = -1; -TUNABLE_INT("drm.i915.panel_use_ssc", &i915_panel_use_ssc); -int i915_panel_ignore_lid = 0; -TUNABLE_INT("drm.i915.panel_ignore_lid", &i915_panel_ignore_lid); -int i915_panel_invert_brightness; -TUNABLE_INT("drm.i915.panel_invert_brightness", &i915_panel_invert_brightness); -int i915_modeset = 1; -TUNABLE_INT("drm.i915.modeset", &i915_modeset); -int i915_enable_ppgtt = -1; -TUNABLE_INT("drm.i915.enable_ppgtt", &i915_enable_ppgtt); -int i915_enable_hangcheck = 1; -TUNABLE_INT("drm.i915.enable_hangcheck", &i915_enable_hangcheck); -TUNABLE_INT("drm.i915.enable_unsupported", &i915_enable_unsupported); + /* Restore fifo count */ + dev_priv->gt_fifo_count = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES); -#define PCI_VENDOR_INTEL 0x8086 -#define INTEL_PCH_DEVICE_ID_MASK 0xff00 -#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 -#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 -#define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 -#define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 + mtx_unlock(&dev_priv->gt_lock); + return ret; +} -void intel_detect_pch(struct drm_device *dev) +int intel_gpu_reset(struct drm_device *dev) { - struct drm_i915_private *dev_priv; - device_t pch; - uint32_t id; + struct drm_i915_private *dev_priv = dev->dev_private; + int ret = -ENODEV; - dev_priv = dev->dev_private; - pch = pci_find_class(PCIC_BRIDGE, PCIS_BRIDGE_ISA); - if (pch != NULL && pci_get_vendor(pch) == PCI_VENDOR_INTEL) { - id = pci_get_device(pch) & INTEL_PCH_DEVICE_ID_MASK; - if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { - dev_priv->pch_type = PCH_IBX; - dev_priv->num_pch_pll = 2; - DRM_DEBUG_KMS("Found Ibex Peak PCH\n"); - } else if (id == INTEL_PCH_CPT_DEVICE_ID_TYPE) { - dev_priv->pch_type = PCH_CPT; - dev_priv->num_pch_pll = 2; - DRM_DEBUG_KMS("Found CougarPoint PCH\n"); - } else if (id == INTEL_PCH_PPT_DEVICE_ID_TYPE) { - /* PantherPoint is CPT compatible */ - dev_priv->pch_type = PCH_CPT; - dev_priv->num_pch_pll = 2; - DRM_DEBUG_KMS("Found PatherPoint PCH\n"); - } else if (id == INTEL_PCH_LPT_DEVICE_ID_TYPE) { - dev_priv->pch_type = PCH_LPT; - dev_priv->num_pch_pll = 0; - DRM_DEBUG_KMS("Found LynxPoint PCH\n"); - } else - DRM_DEBUG_KMS("No PCH detected\n"); - KASSERT(dev_priv->num_pch_pll <= I915_NUM_PLLS, - ("num_pch_pll %d\n", dev_priv->num_pch_pll)); - } else - DRM_DEBUG_KMS("No Intel PCI-ISA bridge found\n"); + switch (INTEL_INFO(dev)->gen) { + case 7: + case 6: + ret = gen6_do_reset(dev); + break; + case 5: + ret = ironlake_do_reset(dev); + break; + case 4: + ret = i965_do_reset(dev); + break; + case 2: + ret = i8xx_do_reset(dev); + break; + } + + /* Also reset the gpu hangman. */ + if (dev_priv->stop_rings) { + DRM_DEBUG("Simulated gpu hang, resetting stop_rings\n"); + dev_priv->stop_rings = 0; + if (ret == -ENODEV) { + DRM_ERROR("Reset not implemented, but ignoring " + "error for simulated gpu hangs\n"); + ret = 0; + } + } + + return ret; } -bool i915_semaphore_is_enabled(struct drm_device *dev) +/** + * i915_reset - reset chip after a hang + * @dev: drm device to reset + * + * Reset the chip. Useful if a hang is detected. Returns zero on successful + * reset or otherwise an error code. + * + * Procedure is fairly simple: + * - reset the chip using the reset reg + * - re-init context state + * - re-init hardware status page + * - re-init ring buffer + * - re-init interrupt state + * - re-init display + */ +int i915_reset(struct drm_device *dev) { - if (INTEL_INFO(dev)->gen < 6) + drm_i915_private_t *dev_priv = dev->dev_private; + int ret; + + if (!i915_try_reset) return 0; - if (i915_semaphores >= 0) - return i915_semaphores; + if (!sx_try_xlock(&dev->dev_struct_lock)) + return (-EBUSY); - /* Enable semaphores on SNB when IO remapping is off */ - if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) - return false; + dev_priv->stop_rings = 0; - return 1; + i915_gem_reset(dev); + + ret = -ENODEV; + if (time_second - dev_priv->last_gpu_reset < 5) + DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); + else + ret = intel_gpu_reset(dev); + + dev_priv->last_gpu_reset = time_second; + if (ret) { + DRM_ERROR("Failed to reset chip.\n"); + DRM_UNLOCK(dev); + return ret; + } + + /* Ok, now get things going again... */ + + /* + * Everything depends on having the GTT running, so we need to start + * there. Fortunately we don't need to do this unless we reset the + * chip at a PCI level. + * + * Next we need to restore the context, but we don't use those + * yet either... + * + * Ring buffer needs to be re-initialized in the KMS case, or if X + * was running at the time of the reset (i.e. we weren't VT + * switched away). + */ + if (drm_core_check_feature(dev, DRIVER_MODESET) || + !dev_priv->mm.suspended) { + struct intel_ring_buffer *ring; + int i; + + dev_priv->mm.suspended = 0; + + i915_gem_init_swizzling(dev); + + for_each_ring(ring, dev_priv, i) + ring->init(ring); + + i915_gem_context_init(dev); + i915_gem_init_ppgtt(dev); + + /* + * It would make sense to re-init all the other hw state, at + * least the rps/rc6/emon init done within modeset_init_hw. For + * some unknown reason, this blows up my ilk, so don't. + */ + + DRM_UNLOCK(dev); + + if (drm_core_check_feature(dev, DRIVER_MODESET)) + intel_modeset_init_hw(dev); + + drm_irq_uninstall(dev); + drm_irq_install(dev); + } else { + DRM_UNLOCK(dev); + } + + return 0; } +const struct intel_device_info * +i915_get_device_id(int device) +{ + const struct intel_gfx_device_id *did; + + for (did = &i915_infolist[0]; did->device != 0; did++) { + if (did->device != device) + continue; + if (did->info->not_supported && !i915_enable_unsupported) + return (NULL); + return (did->info); + } + return (NULL); +} + +static int i915_probe(device_t kdev) +{ + const struct intel_device_info *intel_info = + i915_get_device_id(pci_get_device(kdev)); + + if (intel_info == NULL) + return (ENXIO); + + return -drm_probe_helper(kdev, i915_pciidlist); +} + +static int i915_attach(device_t kdev) +{ + + if (i915_modeset == 1) + i915_driver_info.driver_features |= DRIVER_MODESET; + return (-drm_attach_helper(kdev, i915_pciidlist, &i915_driver_info)); +} + +static struct fb_info * +i915_fb_helper_getinfo(device_t kdev) +{ + struct intel_fbdev *ifbdev; + drm_i915_private_t *dev_priv; + struct drm_device *dev; + struct fb_info *info; + + dev = device_get_softc(kdev); + dev_priv = dev->dev_private; + ifbdev = dev_priv->fbdev; + if (ifbdev == NULL) + return (NULL); + + info = ifbdev->helper.fbdev; + + return (info); +} + +static device_method_t i915_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, i915_probe), + DEVMETHOD(device_attach, i915_attach), + DEVMETHOD(device_suspend, i915_suspend), + DEVMETHOD(device_resume, i915_resume), + DEVMETHOD(device_detach, drm_generic_detach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, i915_fb_helper_getinfo), + + DEVMETHOD_END +}; + +static driver_t i915_driver = { + "drmn", + i915_methods, + sizeof(struct drm_device) +}; + +extern devclass_t drm_devclass; +DRIVER_MODULE_ORDERED(i915kms, vgapci, i915_driver, drm_devclass, 0, 0, + SI_ORDER_ANY); +MODULE_DEPEND(i915kms, drmn, 1, 1, 1); +MODULE_DEPEND(i915kms, agp, 1, 1, 1); +MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); +MODULE_DEPEND(i915kms, iic, 1, 1, 1); +MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); + +/* We give fast paths for the really cool registers */ +#define NEEDS_FORCE_WAKE(dev_priv, reg) \ + (((dev_priv)->info->gen >= 6) && \ + ((reg) < 0x40000) && \ + ((reg) != FORCEWAKE)) && \ + (!IS_VALLEYVIEW((dev_priv)->dev)) + void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) { @@ -753,264 +1004,6 @@ void vlv_force_wake_put(struct drm_i915_ POSTING_READ(FORCEWAKE_VLV); } -static int i8xx_do_reset(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - int onems; - - if (IS_I85X(dev)) - return -ENODEV; - - onems = hz / 1000; - if (onems == 0) - onems = 1; - - I915_WRITE(D_STATE, I915_READ(D_STATE) | DSTATE_GFX_RESET_I830); - POSTING_READ(D_STATE); - - if (IS_I830(dev) || IS_845G(dev)) { - I915_WRITE(DEBUG_RESET_I830, - DEBUG_RESET_DISPLAY | - DEBUG_RESET_RENDER | - DEBUG_RESET_FULL); - POSTING_READ(DEBUG_RESET_I830); - pause("i8xxrst1", onems); - - I915_WRITE(DEBUG_RESET_I830, 0); - POSTING_READ(DEBUG_RESET_I830); - } - - pause("i8xxrst2", onems); - - I915_WRITE(D_STATE, I915_READ(D_STATE) & ~DSTATE_GFX_RESET_I830); - POSTING_READ(D_STATE); - - return 0; -} - -static int i965_reset_complete(struct drm_device *dev) -{ - u8 gdrst; - - gdrst = pci_read_config(dev->dev, I965_GDRST, 1); - return (gdrst & GRDOM_RESET_ENABLE) == 0; -} - -static int i965_do_reset(struct drm_device *dev) -{ - int ret; - u8 gdrst; - - /* - * Set the domains we want to reset (GRDOM/bits 2 and 3) as - * well as the reset bit (GR/bit 0). Setting the GR bit - * triggers the reset; when done, the hardware will clear it. - */ - gdrst = pci_read_config(dev->dev, I965_GDRST, 1); - pci_write_config(dev->dev, I965_GDRST, - gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE, 1); - - ret = wait_for(i965_reset_complete(dev), 500); - if (ret) - return ret; - - /* We can't reset render&media without also resetting display ... */ - gdrst = pci_read_config(dev->dev, I965_GDRST, 1); - pci_write_config(dev->dev, I965_GDRST, - gdrst | GRDOM_MEDIA | GRDOM_RESET_ENABLE, 1); - - return wait_for(i965_reset_complete(dev), 500); -} - -static int ironlake_do_reset(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - u32 gdrst; - int ret; - - gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); - I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, - gdrst | GRDOM_RENDER | GRDOM_RESET_ENABLE); - ret = wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); - if (ret) - return ret; - - /* We can't reset render&media without also resetting display ... */ - gdrst = I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR); - I915_WRITE(MCHBAR_MIRROR_BASE + ILK_GDSR, - gdrst | GRDOM_MEDIA | GRDOM_RESET_ENABLE); - return wait_for(I915_READ(MCHBAR_MIRROR_BASE + ILK_GDSR) & 0x1, 500); -} - -static int gen6_do_reset(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - int ret; - - /* Hold gt_lock across reset to prevent any register access - * with forcewake not set correctly - */ - mtx_lock(&dev_priv->gt_lock); - - /* Reset the chip */ - - /* GEN6_GDRST is not in the gt power well, no need to check - * for fifo space for the write or forcewake the chip for - * the read - */ - I915_WRITE_NOTRACE(GEN6_GDRST, GEN6_GRDOM_FULL); - - /* Spin waiting for the device to ack the reset request */ - ret = _intel_wait_for(dev, - (I915_READ_NOTRACE(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, - 500, 0, "915rst"); - - /* If reset with a user forcewake, try to restore, otherwise turn it off */ - if (dev_priv->forcewake_count) - dev_priv->display.force_wake_get(dev_priv); - else - dev_priv->display.force_wake_put(dev_priv); - - /* Restore fifo count */ - dev_priv->gt_fifo_count = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES); - - mtx_unlock(&dev_priv->gt_lock); - return (ret); -} - -int intel_gpu_reset(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - int ret = -ENODEV; - - switch (INTEL_INFO(dev)->gen) { - case 7: - case 6: - ret = gen6_do_reset(dev); - break; - case 5: - ret = ironlake_do_reset(dev); - break; - case 4: - ret = i965_do_reset(dev); - break; - case 2: - ret = i8xx_do_reset(dev); - break; - } - - /* Also reset the gpu hangman. */ - if (dev_priv->stop_rings) { - DRM_DEBUG("Simulated gpu hang, resetting stop_rings\n"); - dev_priv->stop_rings = 0; - if (ret == -ENODEV) { - DRM_ERROR("Reset not implemented, but ignoring " - "error for simulated gpu hangs\n"); - ret = 0; - } - } - - return ret; -} - -/** - * i915_reset - reset chip after a hang - * @dev: drm device to reset - * - * Reset the chip. Useful if a hang is detected. Returns zero on successful - * reset or otherwise an error code. - * - * Procedure is fairly simple: - * - reset the chip using the reset reg - * - re-init context state - * - re-init hardware status page - * - re-init ring buffer - * - re-init interrupt state - * - re-init display - */ -int i915_reset(struct drm_device *dev) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - int ret; - - if (!i915_try_reset) - return 0; - - if (!sx_try_xlock(&dev->dev_struct_lock)) - return (-EBUSY); - - dev_priv->stop_rings = 0; - - i915_gem_reset(dev); - - ret = -ENODEV; - if (time_second - dev_priv->last_gpu_reset < 5) - DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); - else - ret = intel_gpu_reset(dev); - - dev_priv->last_gpu_reset = time_second; - if (ret) { - DRM_ERROR("Failed to reset chip.\n"); - DRM_UNLOCK(dev); - return ret; - } - - /* Ok, now get things going again... */ - - /* - * Everything depends on having the GTT running, so we need to start - * there. Fortunately we don't need to do this unless we reset the - * chip at a PCI level. - * - * Next we need to restore the context, but we don't use those - * yet either... - * - * Ring buffer needs to be re-initialized in the KMS case, or if X - * was running at the time of the reset (i.e. we weren't VT - * switched away). - */ - if (drm_core_check_feature(dev, DRIVER_MODESET) || - !dev_priv->mm.suspended) { - struct intel_ring_buffer *ring; - int i; - - dev_priv->mm.suspended = 0; - - i915_gem_init_swizzling(dev); - - for_each_ring(ring, dev_priv, i) - ring->init(ring); - - i915_gem_context_init(dev); - i915_gem_init_ppgtt(dev); - - /* - * It would make sense to re-init all the other hw state, at - * least the rps/rc6/emon init done within modeset_init_hw. For - * some unknown reason, this blows up my ilk, so don't. - */ - DRM_UNLOCK(dev); - - if (drm_core_check_feature(dev, DRIVER_MODESET)) - intel_modeset_init_hw(dev); - - drm_irq_uninstall(dev); - drm_irq_install(dev); - } else { - DRM_UNLOCK(dev); - } - - return 0; -} - -/* We give fast paths for the really cool registers */ -#define NEEDS_FORCE_WAKE(dev_priv, reg) \ - (((dev_priv)->info->gen >= 6) && \ - ((reg) < 0x40000) && \ - ((reg) != FORCEWAKE)) && \ - (!IS_VALLEYVIEW((dev_priv)->dev)) - #define __i915_read(x, y) \ u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \ u##x val = 0; \ @@ -1018,12 +1011,12 @@ u##x i915_read##x(struct drm_i915_privat mtx_lock(&dev_priv->gt_lock); \ if (dev_priv->forcewake_count == 0) \ dev_priv->display.force_wake_get(dev_priv); \ - val = DRM_READ##y(dev_priv->mmio_map, reg); \ + val = DRM_READ##x(dev_priv->mmio_map, reg); \ if (dev_priv->forcewake_count == 0) \ dev_priv->display.force_wake_put(dev_priv); \ mtx_unlock(&dev_priv->gt_lock); \ } else { \ - val = DRM_READ##y(dev_priv->mmio_map, reg); \ + val = DRM_READ##x(dev_priv->mmio_map, reg); \ } \ trace_i915_reg_rw(false, reg, val, sizeof(val)); \ return val; \ @@ -1042,7 +1035,7 @@ void i915_write##x(struct drm_i915_priva if (NEEDS_FORCE_WAKE((dev_priv), (reg))) { \ __fifo_ret = __gen6_gt_wait_for_fifo(dev_priv); \ } \ - DRM_WRITE##y(dev_priv->mmio_map, reg, val); \ + DRM_WRITE##x(dev_priv->mmio_map, reg, val); \ if (__predict_false(__fifo_ret)) { \ gen6_gt_check_fifodbg(dev_priv); \ } \ From owner-svn-src-head@freebsd.org Tue Oct 27 21:24:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C48B6A1CD21; Tue, 27 Oct 2015 21:24:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C88E131B; Tue, 27 Oct 2015 21:24:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLOAG3070413; Tue, 27 Oct 2015 21:24:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLOAMm070402; Tue, 27 Oct 2015 21:24:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510272124.t9RLOAMm070402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 27 Oct 2015 21:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290071 - in head: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/examples contrib/libucl/include contrib/libucl/klib contrib/libucl/lua contrib/libucl/m4 contrib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 21:24:12 -0000 Author: bapt Date: Tue Oct 27 21:24:09 2015 New Revision: 290071 URL: https://svnweb.freebsd.org/changeset/base/290071 Log: Update libucl to latest git snapshot (20151027) Added: head/contrib/libucl/CMakeLists.txt - copied unchanged from r290069, vendor/libucl/dist/CMakeLists.txt head/contrib/libucl/examples/ - copied from r290069, vendor/libucl/dist/examples/ head/contrib/libucl/include/ucl++.h - copied unchanged from r290069, vendor/libucl/dist/include/ucl++.h head/contrib/libucl/m4/ - copied from r290069, vendor/libucl/dist/m4/ head/contrib/libucl/python/ - copied from r290069, vendor/libucl/dist/python/ head/contrib/libucl/src/ucl_msgpack.c - copied unchanged from r290069, vendor/libucl/dist/src/ucl_msgpack.c head/contrib/libucl/src/ucl_sexp.c - copied unchanged from r290069, vendor/libucl/dist/src/ucl_sexp.c head/contrib/libucl/tests/basic/15.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/15.in head/contrib/libucl/tests/basic/15.inc - copied unchanged from r290069, vendor/libucl/dist/tests/basic/15.inc head/contrib/libucl/tests/basic/15.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/15.res head/contrib/libucl/tests/basic/16.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/16.in head/contrib/libucl/tests/basic/16.inc - copied unchanged from r290069, vendor/libucl/dist/tests/basic/16.inc head/contrib/libucl/tests/basic/16.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/16.res head/contrib/libucl/tests/basic/17.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/17.in head/contrib/libucl/tests/basic/17.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/17.res head/contrib/libucl/tests/basic/18.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/18.in head/contrib/libucl/tests/basic/18.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/18.res head/contrib/libucl/tests/basic/19-append.inc - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19-append.inc head/contrib/libucl/tests/basic/19-merge.inc - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19-merge.inc head/contrib/libucl/tests/basic/19-rewrite.inc - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19-rewrite.inc head/contrib/libucl/tests/basic/19.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19.in head/contrib/libucl/tests/basic/19.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/19.res head/contrib/libucl/tests/basic/20.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/20.in head/contrib/libucl/tests/basic/20.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/20.res head/contrib/libucl/tests/basic/21.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/21.in head/contrib/libucl/tests/basic/21.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/21.res head/contrib/libucl/tests/basic/22.in - copied unchanged from r290069, vendor/libucl/dist/tests/basic/22.in head/contrib/libucl/tests/basic/22.res - copied unchanged from r290069, vendor/libucl/dist/tests/basic/22.res head/contrib/libucl/tests/msgpack.test - copied unchanged from r290069, vendor/libucl/dist/tests/msgpack.test head/contrib/libucl/tests/test_msgpack.c - copied unchanged from r290069, vendor/libucl/dist/tests/test_msgpack.c head/contrib/libucl/utils/ucl-tool.c - copied unchanged from r290069, vendor/libucl/dist/utils/ucl-tool.c Deleted: head/contrib/libucl/cmake/ Modified: head/contrib/libucl/ChangeLog.md head/contrib/libucl/README.md head/contrib/libucl/configure.ac head/contrib/libucl/doc/Makefile.am head/contrib/libucl/doc/lua_api.md head/contrib/libucl/include/ucl.h head/contrib/libucl/klib/kvec.h head/contrib/libucl/lua/lua_ucl.c head/contrib/libucl/src/Makefile.am head/contrib/libucl/src/tree.h head/contrib/libucl/src/ucl_chartable.h head/contrib/libucl/src/ucl_emitter.c head/contrib/libucl/src/ucl_emitter_utils.c head/contrib/libucl/src/ucl_hash.c head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/src/xxhash.c head/contrib/libucl/src/xxhash.h head/contrib/libucl/tests/Makefile.am head/contrib/libucl/tests/basic/13.in head/contrib/libucl/tests/test_basic.c head/contrib/libucl/tests/test_schema.c head/contrib/libucl/utils/Makefile.am head/contrib/libucl/utils/chargen.c head/contrib/libucl/utils/objdump.c head/lib/libucl/Makefile Directory Properties: head/contrib/libucl/ (props changed) Copied: head/contrib/libucl/CMakeLists.txt (from r290069, vendor/libucl/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/CMakeLists.txt Tue Oct 27 21:24:09 2015 (r290071, copy of r290069, vendor/libucl/dist/CMakeLists.txt) @@ -0,0 +1,260 @@ +PROJECT(libucl C) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) + +SET(LIBUCL_VERSION_MAJOR 0) +SET(LIBUCL_VERSION_MINOR 5) +SET(LIBUCL_VERSION_PATCH 0) + +SET(LIBUCL_VERSION + "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") + +INCLUDE(CheckCCompilerFlag) +INCLUDE(FindOpenSSL) + +OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) +OPTION(ENABLE_URL_SIGN "Enable signatures check in ucl includes (requires openssl) [default: OFF]" OFF) +OPTION(BUILD_SHARED_LIBS "Build Shared Libraries [default: OFF]" OFF) +OPTION(ENABLE_LUA "Enable lua support [default: OFF]" OFF) +OPTION(ENABLE_LUAJIT "Enable luajit support [default: OFF]" OFF) + +# Find lua installation +MACRO(FindLua) + # Find lua libraries + UNSET(LUA_INCLUDE_DIR CACHE) + UNSET(LUA_LIBRARY CACHE) + CMAKE_PARSE_ARGUMENTS(LUA "" "VERSION_MAJOR;VERSION_MINOR;ROOT" "" ${ARGN}) + + IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) + MESSAGE(FATAL_ERROR "Invalid FindLua invocation: ${ARGN}") + ENDIF() + + IF(ENABLE_LUAJIT MATCHES "ON") + MESSAGE(STATUS "Check for luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + FIND_PATH(LUA_INCLUDE_DIR luajit.h + HINTS + "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" + $ENV{LUA_DIR} + PATH_SUFFIXES "include/luajit-2.0" + "include/luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "include/luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "include/luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "include/luajit" + "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + include/lua include + PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} + ) + FIND_LIBRARY(LUA_LIBRARY + NAMES luajit + "luajit-2.0" + "luajit2.0" + "luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + HINTS + "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" + $ENV{LUA_DIR} + PATH_SUFFIXES lib64 lib + PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} + DOC "Lua library" + ) + + IF(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR) + MESSAGE(STATUS "Fallback from luajit to plain lua") + SET(ENABLE_LUAJIT "OFF") + MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + FIND_PATH(LUA_INCLUDE_DIR lua.h + HINTS + "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" + $ENV{LUA_DIR} + PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + include/lua include + PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} + ) + FIND_LIBRARY(LUA_LIBRARY + NAMES lua + "lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + HINTS + "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" + $ENV{LUA_DIR} + PATH_SUFFIXES lib64 lib + PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} + DOC "Lua library" + ) + ENDIF() + ELSE(ENABLE_LUAJIT MATCHES "ON") + MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + FIND_PATH(LUA_INCLUDE_DIR lua.h + HINTS + "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" + $ENV{LUA_DIR} + PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + include/lua include + PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} + ) + FIND_LIBRARY(LUA_LIBRARY + NAMES lua + "lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" + "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + "lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" + HINTS + "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" + $ENV{LUA_DIR} + PATH_SUFFIXES lib64 lib + PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} + DOC "Lua library" + ) + ENDIF(ENABLE_LUAJIT MATCHES "ON") + + IF(LUA_LIBRARY AND LUA_INCLUDE_DIR) + SET(LUA_FOUND 1) + IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) + SET(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR}) + SET(LUA_VERSION_MINOR ${LUA_VERSION_MINOR}) + ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) + IF(ENABLE_LUAJIT MATCHES "ON") + MESSAGE(STATUS "Found luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + ELSE(ENABLE_LUAJIT MATCHES "ON") + MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + ENDIF(ENABLE_LUAJIT MATCHES "ON") + ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR) +ENDMACRO() + +IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt) +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + +IF(ENABLE_URL_INCLUDE MATCHES "ON") + FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt + DOC "Path where the libfetch library can be found") + IF(LIBFETCH_LIBRARY) + FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include + /opt/include + /usr/local/include + DOC "Path to libfetch header") + ELSE(LIBFETCH_LIBRARY) + # Try to find libcurl + ProcessPackage(CURL libcurl) + IF(NOT CURL_FOUND) + MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") + ENDIF(NOT CURL_FOUND) + ENDIF(LIBFETCH_LIBRARY) +ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") + +SET(CMAKE_C_WARN_FLAGS "") +CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) +CHECK_C_COMPILER_FLAG(-W SUPPORT_W) +CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM) +CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN) +CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES) +IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro) + CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG) +ENDIF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro) +IF(SUPPORT_W) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W") +ENDIF(SUPPORT_W) +IF(SUPPORT_WALL) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wall") +ENDIF(SUPPORT_WALL) +IF(SUPPORT_WPARAM) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-unused-parameter") +ENDIF(SUPPORT_WPARAM) +IF(SUPPORT_WPOINTER_SIGN) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign") +ENDIF(SUPPORT_WPOINTER_SIGN) +IF(SUPPORT_WSTRICT_PROTOTYPES) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes") +ENDIF(SUPPORT_WSTRICT_PROTOTYPES) +IF(SUPPORT_STD_FLAG) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c99") +ENDIF(SUPPORT_STD_FLAG) + +IF(ENABLE_URL_SIGN MATCHES "ON") + IF(OPENSSL_FOUND) + SET(HAVE_OPENSSL 1) + INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}") + ENDIF(OPENSSL_FOUND) +ENDIF(ENABLE_URL_SIGN MATCHES "ON") + +INCLUDE_DIRECTORIES("src") +INCLUDE_DIRECTORIES("include") +INCLUDE_DIRECTORIES("uthash") +INCLUDE_DIRECTORIES("klib") + +SET(UCLSRC src/ucl_util.c + src/ucl_parser.c + src/ucl_emitter.c + src/ucl_emitter_streamline.c + src/ucl_emitter_utils.c + src/ucl_hash.c + src/ucl_schema.c + src/ucl_msgpack.c + src/ucl_sexp.c + src/xxhash.c) + + +SET (LIB_TYPE STATIC) +IF (BUILD_SHARED_LIBS) + SET (LIB_TYPE SHARED) +ENDIF (BUILD_SHARED_LIBS) +ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC}) +SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) + +IF(ENABLE_LUA MATCHES "ON") + IF(ENABLE_LUAJIT MATCHES "ON") + FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") + IF(NOT LUA_FOUND) + MESSAGE(FATAL_ERROR "Lua not found, lua support is required") + ELSE(NOT LUA_FOUND) + INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") + ENDIF(NOT LUA_FOUND) + ELSE(ENABLE_LUAJIT MATCHES "ON") + FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") + IF(NOT LUA_FOUND) + FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") + ENDIF(NOT LUA_FOUND) + IF(NOT LUA_FOUND) + MESSAGE(FATAL_ERROR "Lua not found, lua support is required") + ELSE(NOT LUA_FOUND) + INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") + ENDIF(NOT LUA_FOUND) + ENDIF(ENABLE_LUAJIT MATCHES "ON") + SET(UCL_LUA_SRC lua/lua_ucl.c) + ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) + IF(ENABLE_LUAJIT MATCHES "ON") + TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") + ELSE(ENABLE_LUAJIT MATCHES "ON") + TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") + ENDIF(ENABLE_LUAJIT MATCHES "ON") + TARGET_LINK_LIBRARIES(lua-ucl ucl) + SET_TARGET_PROPERTIES(lua-ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) +ENDIF() + +IF(HAVE_FETCH_H) + TARGET_LINK_LIBRARIES(ucl fetch) +ELSE(HAVE_FETCH_H) + IF(CURL_FOUND) + TARGET_LINK_LIBRARIES(ucl ${CURL_LIBRARIES}) + ENDIF(CURL_FOUND) +ENDIF(HAVE_FETCH_H) +IF(ENABLE_URL_SIGN MATCHES "ON") + IF(OPENSSL_FOUND) + TARGET_LINK_LIBRARIES(ucl ${OPENSSL_LIBRARIES}) + ENDIF(OPENSSL_FOUND) +ENDIF(ENABLE_URL_SIGN MATCHES "ON") Modified: head/contrib/libucl/ChangeLog.md ============================================================================== --- head/contrib/libucl/ChangeLog.md Tue Oct 27 21:23:19 2015 (r290070) +++ head/contrib/libucl/ChangeLog.md Tue Oct 27 21:24:09 2015 (r290071) @@ -32,3 +32,8 @@ ### Libucl 0.7.2 - Fixed serious bugs in schema and arrays iteration + +### Libucl 0.7.3 + +- Fixed a bug with macroes that come after an empty object +- Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) Modified: head/contrib/libucl/README.md ============================================================================== --- head/contrib/libucl/README.md Tue Oct 27 21:23:19 2015 (r290070) +++ head/contrib/libucl/README.md Tue Oct 27 21:24:09 2015 (r290071) @@ -21,7 +21,7 @@ - [Performance](#performance) - [Conclusion](#conclusion) -## Introduction +## Introduction This document describes the main features and principles of the configuration language called `UCL` - universal configuration language. @@ -262,7 +262,20 @@ parser is created but before any configu all files that matches the specified pattern (normally the format of patterns is defined in `glob` manual page for your operating system). This option is meaningless for URL includes. * `url` (default: **true**) - allow URL includes. +* `path` (default: empty) - A UCL_ARRAY of directories to search for the include file. +Search ends after the first patch, unless `glob` is true, then all matches are included. +* `prefix` (default false) - Put included contents inside an object, instead +of loading them into the root. If no `key` is provided, one is automatically generated based on each files basename() +* `key` (default: ) - Key to load contents of include into. If +the key already exists, it must be the correct type +* `target` (default: object) - Specify if the `prefix` `key` should be an +object or an array. * `priority` (default: 0) - specify priority for the include (see below). +* `duplicate` (default: 'append') - specify policy of duplicates resolving: + - `append` - default strategy, if we have new object of higher priority then it replaces old one, if we have new object with less priority it is ignored completely, and if we have two duplicate objects with the same priority then we have a multi-value key (implicit array) + - `merge` - if we have object or array, then new keys are merged inside, if we have a plain object then an implicit array is formed (regardeless of priorities) + - `error` - create error on duplicate keys and stop parsing + - `rewrite` - always rewrite an old value with new one (ignoring priorities) Priorities are used by UCL parser to manage the policy of objects rewriting during including other files as following: Modified: head/contrib/libucl/configure.ac ============================================================================== --- head/contrib/libucl/configure.ac Tue Oct 27 21:23:19 2015 (r290070) +++ head/contrib/libucl/configure.ac Tue Oct 27 21:24:09 2015 (r290071) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) m4_define([med_ver], [7]) -m4_define([min_ver], [2]) -m4_define([so_version], [5:0:1]) +m4_define([min_ver], [3]) +m4_define([so_version], [5:0:2]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) @@ -47,6 +47,7 @@ AC_CHECK_HEADERS_ONCE([libgen.h]) AC_CHECK_HEADERS_ONCE([stdio.h]) AC_CHECK_HEADERS_ONCE([float.h]) AC_CHECK_HEADERS_ONCE([math.h]) +AC_CHECK_HEADERS_ONCE([endian.h sys/endian.h machine/endian.h]) dnl Example of default-disabled feature AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], Modified: head/contrib/libucl/doc/Makefile.am ============================================================================== --- head/contrib/libucl/doc/Makefile.am Tue Oct 27 21:23:19 2015 (r290070) +++ head/contrib/libucl/doc/Makefile.am Tue Oct 27 21:24:09 2015 (r290071) @@ -4,6 +4,6 @@ dist_man_MANS = libucl.3 gen-man: @PANDOC@ tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ - cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' \ -e "s/%%date%%/$$(LANG=C date +'%d %B, %Y')/" | \ - @PANDOC@ -s -f markdown -t man -o libucl.3 + @PANDOC@ -s -f markdown -t man -o libucl.3 Modified: head/contrib/libucl/doc/lua_api.md ============================================================================== --- head/contrib/libucl/doc/lua_api.md Tue Oct 27 21:23:19 2015 (r290070) +++ head/contrib/libucl/doc/lua_api.md Tue Oct 27 21:24:09 2015 (r290071) @@ -16,7 +16,7 @@ if not res then else local obj = parser:get_object() local got = ucl.to_format(obj, 'json') -endif +end local table = { str = 'value', @@ -25,6 +25,7 @@ local table = { func = function () return 'huh' end +} print(ucl.to_format(table, 'ucl')) @@ -115,6 +116,7 @@ local table = { func = function () return 'huh' end +} print(ucl.to_format(table, 'ucl')) Copied: head/contrib/libucl/include/ucl++.h (from r290069, vendor/libucl/dist/include/ucl++.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/include/ucl++.h Tue Oct 27 21:24:09 2015 (r290071, copy of r290069, vendor/libucl/dist/include/ucl++.h) @@ -0,0 +1,422 @@ +/* + * Copyright (c) 2015, Vsevolod Stakhov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 AUTHOR ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once +#include +#include +#include +#include + +#include "ucl.h" + +// C++11 API inspired by json11: https://github.com/dropbox/json11/ + +namespace ucl { + +struct ucl_map_construct_t { }; +constexpr ucl_map_construct_t ucl_map_construct = ucl_map_construct_t(); +struct ucl_array_construct_t { }; +constexpr ucl_array_construct_t ucl_array_construct = ucl_array_construct_t(); + +class Ucl final { +private: + + struct ucl_deleter { + void operator() (ucl_object_t *obj) { + ucl_object_unref (obj); + } + }; + + static int + append_char (unsigned char c, size_t nchars, void *ud) + { + std::string *out = reinterpret_cast(ud); + + out->append (nchars, (char)c); + + return nchars; + } + static int + append_len (unsigned const char *str, size_t len, void *ud) + { + std::string *out = reinterpret_cast(ud); + + out->append ((const char *)str, len); + + return len; + } + static int + append_int (int64_t elt, void *ud) + { + std::string *out = reinterpret_cast(ud); + auto nstr = std::to_string (elt); + + out->append (nstr); + + return nstr.size (); + } + static int + append_double (double elt, void *ud) + { + std::string *out = reinterpret_cast(ud); + auto nstr = std::to_string (elt); + + out->append (nstr); + + return nstr.size (); + } + + static struct ucl_emitter_functions default_emit_funcs() + { + struct ucl_emitter_functions func = { + Ucl::append_char, + Ucl::append_len, + Ucl::append_int, + Ucl::append_double, + nullptr, + nullptr + }; + + return func; + }; + + std::unique_ptr obj; + +public: + class const_iterator { + private: + struct ucl_iter_deleter { + void operator() (ucl_object_iter_t it) { + ucl_object_iterate_free (it); + } + }; + std::shared_ptr it; + std::unique_ptr cur; + public: + typedef std::forward_iterator_tag iterator_category; + + const_iterator(const Ucl &obj) { + it = std::shared_ptr(ucl_object_iterate_new (obj.obj.get()), + ucl_iter_deleter()); + cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + } + + const_iterator() {} + const_iterator(const const_iterator &other) { + it = other.it; + } + ~const_iterator() {} + + const_iterator& operator=(const const_iterator &other) { + it = other.it; + return *this; + } + + bool operator==(const const_iterator &other) const + { + if (cur && other.cur) { + return cur->obj.get() == other.cur->obj.get(); + } + + return !cur && !other.cur; + } + + bool operator!=(const const_iterator &other) const + { + return !(*this == other); + } + + const_iterator& operator++() + { + if (it) { + cur.reset (new Ucl(ucl_object_iterate_safe (it.get(), true))); + } + + if (!*cur) { + it.reset (); + cur.reset (); + } + + return *this; + } + + const Ucl& operator*() const + { + return *cur; + } + const Ucl* operator->() const + { + return cur.get(); + } + }; + + // We grab ownership if get non-const ucl_object_t + Ucl(ucl_object_t *other) { + obj.reset (other); + } + + // Shared ownership + Ucl(const ucl_object_t *other) { + obj.reset (ucl_object_ref (other)); + } + + Ucl(const Ucl &other) { + obj.reset (ucl_object_ref (other.obj.get())); + } + + Ucl(Ucl &&other) { + obj.swap (other.obj); + } + + Ucl() noexcept { + obj.reset (ucl_object_typed_new (UCL_NULL)); + } + Ucl(std::nullptr_t) noexcept { + obj.reset (ucl_object_typed_new (UCL_NULL)); + } + Ucl(double value) { + obj.reset (ucl_object_typed_new (UCL_FLOAT)); + obj->value.dv = value; + } + Ucl(int64_t value) { + obj.reset (ucl_object_typed_new (UCL_INT)); + obj->value.iv = value; + } + Ucl(bool value) { + obj.reset (ucl_object_typed_new (UCL_BOOLEAN)); + obj->value.iv = static_cast(value); + } + Ucl(const std::string &value) { + obj.reset (ucl_object_fromstring_common (value.data (), value.size (), + UCL_STRING_RAW)); + } + Ucl(const char * value) { + obj.reset (ucl_object_fromstring_common (value, 0, UCL_STRING_RAW)); + } + + // Implicit constructor: anything with a to_json() function. + template + Ucl(const T & t) : Ucl(t.to_ucl()) {} + + // Implicit constructor: map-like objects (std::map, std::unordered_map, etc) + template ::value + && std::is_constructible::value, + int>::type = 0> + Ucl(const M & m) { + obj.reset (ucl_object_typed_new (UCL_OBJECT)); + auto cobj = obj.get (); + + for (const auto &e : m) { + ucl_object_insert_key (cobj, ucl_object_ref (e.second.obj.get()), + e.first.data (), e.first.size (), true); + } + } + + // Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc) + template ::value, + int>::type = 0> + Ucl(const V & v) { + obj.reset (ucl_object_typed_new (UCL_ARRAY)); + auto cobj = obj.get (); + + for (const auto &e : v) { + ucl_array_append (cobj, ucl_object_ref (e.obj.get())); + } + } + + ucl_type_t type () const { + if (obj) { + return ucl_object_type (obj.get ()); + } + return UCL_NULL; + } + + const std::string key () const { + std::string res; + + if (obj->key) { + res.assign (obj->key, obj->keylen); + } + + return res; + } + + double number_value () const + { + if (obj) { + return ucl_object_todouble (obj.get()); + } + + return 0.0; + } + + int64_t int_value () const + { + if (obj) { + return ucl_object_toint (obj.get()); + } + + return 0; + } + + bool bool_value () const + { + if (obj) { + return ucl_object_toboolean (obj.get()); + } + + return false; + } + + const std::string string_value () const + { + std::string res; + + if (obj) { + res.assign (ucl_object_tostring (obj.get())); + } + + return res; + } + + const Ucl operator[] (size_t i) const + { + if (type () == UCL_ARRAY) { + return Ucl (ucl_array_find_index (obj.get(), i)); + } + + return Ucl (nullptr); + } + + const Ucl operator[](const std::string &key) const + { + if (type () == UCL_OBJECT) { + return Ucl (ucl_object_find_keyl (obj.get(), + key.data (), key.size ())); + } + + return Ucl (nullptr); + } + // Serialize. + void dump (std::string &out, ucl_emitter_t type = UCL_EMIT_JSON) const + { + struct ucl_emitter_functions cbdata; + + cbdata = Ucl::default_emit_funcs(); + cbdata.ud = reinterpret_cast(&out); + + ucl_object_emit_full (obj.get(), type, &cbdata); + } + + std::string dump (ucl_emitter_t type = UCL_EMIT_JSON) const + { + std::string out; + + dump (out, type); + + return out; + } + + static Ucl parse (const std::string & in, std::string & err) + { + auto parser = ucl_parser_new (UCL_PARSER_DEFAULT); + + if (!ucl_parser_add_chunk (parser, (const unsigned char *)in.data (), + in.size ())) { + err.assign (ucl_parser_get_error (parser)); + ucl_parser_free (parser); + + return nullptr; + } + + auto obj = ucl_parser_get_object (parser); + ucl_parser_free (parser); + + // Obj will handle ownership + return Ucl (obj); + } + + static Ucl parse (const char * in, std::string & err) + { + if (in) { + return parse (std::string(in), err); + } else { + err = "null input"; + return nullptr; + } + } + + static Ucl parse (std::istream &ifs, std::string &err) + { + return Ucl::parse (std::string(std::istreambuf_iterator(ifs), + std::istreambuf_iterator()), err); + } + + bool operator== (const Ucl &rhs) const + { + return ucl_object_compare (obj.get(), rhs.obj.get ()) == 0; + } + bool operator< (const Ucl &rhs) const + { + return ucl_object_compare (obj.get(), rhs.obj.get ()) < 0; + } + bool operator!= (const Ucl &rhs) const { return !(*this == rhs); } + bool operator<= (const Ucl &rhs) const { return !(rhs < *this); } + bool operator> (const Ucl &rhs) const { return (rhs < *this); } + bool operator>= (const Ucl &rhs) const { return !(*this < rhs); } + + operator bool () const + { + if (!obj || type() == UCL_NULL) { + return false; + } + + if (type () == UCL_BOOLEAN) { + return bool_value (); + } + + return true; + } + + const_iterator begin() const + { + return const_iterator(*this); + } + const_iterator cbegin() const + { + return const_iterator(*this); + } + const_iterator end() const + { + return const_iterator(); + } + const_iterator cend() const + { + return const_iterator(); + } +}; + +}; Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Tue Oct 27 21:23:19 2015 (r290070) +++ head/contrib/libucl/include/ucl.h Tue Oct 27 21:24:09 2015 (r290071) @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, Vsevolod Stakhov +/* Copyright (c) 2013-2015, Vsevolod Stakhov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -135,7 +135,9 @@ typedef enum ucl_emitter { UCL_EMIT_JSON = 0, /**< Emit fine formatted JSON */ UCL_EMIT_JSON_COMPACT, /**< Emit compacted JSON */ UCL_EMIT_CONFIG, /**< Emit human readable config format */ - UCL_EMIT_YAML /**< Emit embedded YAML format */ + UCL_EMIT_YAML, /**< Emit embedded YAML format */ + UCL_EMIT_MSGPACK, /**< Emit msgpack output */ + UCL_EMIT_MAX /**< Unsupported emitter type */ } ucl_emitter_t; /** @@ -145,6 +147,7 @@ typedef enum ucl_emitter { * UCL still has to perform copying implicitly. */ typedef enum ucl_parser_flags { + UCL_PARSER_DEFAULT = 0x0, /**< No special flags */ UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */ UCL_PARSER_ZEROCOPY = 0x2, /**< Parse input in zero-copy mode if possible */ UCL_PARSER_NO_TIME = 0x4, /**< Do not parse time and treat time values as strings */ @@ -155,6 +158,7 @@ typedef enum ucl_parser_flags { * String conversion flags, that are used in #ucl_object_fromstring_common function. */ typedef enum ucl_string_flags { + UCL_STRING_RAW = 0x0, /**< Treat string as is */ UCL_STRING_ESCAPE = 0x1, /**< Perform JSON escape */ UCL_STRING_TRIM = 0x2, /**< Trim leading and trailing whitespaces */ UCL_STRING_PARSE_BOOLEAN = 0x4, /**< Parse passed string and detect boolean */ @@ -172,15 +176,36 @@ typedef enum ucl_string_flags { * Basic flags for an object */ typedef enum ucl_object_flags { - UCL_OBJECT_ALLOCATED_KEY = 0x1, /**< An object has key allocated internally */ - UCL_OBJECT_ALLOCATED_VALUE = 0x2, /**< An object has a string value allocated internally */ - UCL_OBJECT_NEED_KEY_ESCAPE = 0x4, /**< The key of an object need to be escaped on output */ - UCL_OBJECT_EPHEMERAL = 0x8, /**< Temporary object that does not need to be freed really */ - UCL_OBJECT_MULTILINE = 0x10, /**< String should be displayed as multiline string */ - UCL_OBJECT_MULTIVALUE = 0x20 /**< Object is a key with multiple values */ + UCL_OBJECT_ALLOCATED_KEY = (1 << 0), /**< An object has key allocated internally */ + UCL_OBJECT_ALLOCATED_VALUE = (1 << 1), /**< An object has a string value allocated internally */ + UCL_OBJECT_NEED_KEY_ESCAPE = (1 << 2), /**< The key of an object need to be escaped on output */ + UCL_OBJECT_EPHEMERAL = (1 << 3), /**< Temporary object that does not need to be freed really */ + UCL_OBJECT_MULTILINE = (1 << 4), /**< String should be displayed as multiline string */ + UCL_OBJECT_MULTIVALUE = (1 << 5), /**< Object is a key with multiple values */ + UCL_OBJECT_INHERITED = (1 << 6), /**< Object has been inherited from another */ + UCL_OBJECT_BINARY = (1 << 7) /**< Object contains raw binary data */ } ucl_object_flags_t; /** + * Duplicate policy types + */ +enum ucl_duplicate_strategy { + UCL_DUPLICATE_APPEND = 0, /**< Default policy to merge based on priorities */ + UCL_DUPLICATE_MERGE, /**< Merge new object with old one */ + UCL_DUPLICATE_REWRITE, /**< Rewrite old keys */ + UCL_DUPLICATE_ERROR /**< Stop parsing on duplicate found */ +}; + +/** + * Input format type + */ +enum ucl_parse_type { + UCL_PARSE_UCL = 0, /**< Default ucl format */ + UCL_PARSE_MSGPACK, /**< Message pack input format */ + UCL_PARSE_CSEXP /**< Canonical S-expressions */ +}; + +/** * UCL object structure. Please mention that the most of fields should not be touched by * UCL users. In future, this structure may be converted to private one. */ @@ -190,7 +215,7 @@ typedef struct ucl_object_s { */ union { int64_t iv; /**< Int value of an object */ - const char *sv; /**< String value of an object */ + const char *sv; /**< String value of an object */ double dv; /**< Double value of an object */ void *av; /**< Array */ void *ov; /**< Object */ @@ -496,6 +521,15 @@ UCL_EXTERN const ucl_object_t* ucl_array unsigned int index); /** + * Return the index of `elt` in the array `top` + * @param top object to get a key from (must be of type UCL_ARRAY) + * @param elt element to find index of (must NOT be NULL) + * @return index of `elt` in the array `top or (unsigned int)-1 if `elt` is not found + */ +UCL_EXTERN unsigned int ucl_array_index_of (ucl_object_t *top, + ucl_object_t *elt); + +/** * Replace an element in an array with a different element, returning the object * that was replaced. This object is not released, caller must unref the * returned object when it is no longer needed. @@ -612,6 +646,19 @@ UCL_EXTERN const ucl_object_t* ucl_objec const char *key); /** + * Return object identified by a key in the specified object, if the first key is + * not found then look for the next one. This process is repeated unless + * the next argument in the list is not NULL. So, `ucl_object_find_any_key(obj, key, NULL)` + * is equal to `ucl_object_find_key(obj, key)` + * @param obj object to get a key from (must be of type UCL_OBJECT) + * @param key key to search + * @param ... list of alternative keys to search (NULL terminated) + * @return object matching the specified key or NULL if key was not found + */ +UCL_EXTERN const ucl_object_t* ucl_object_find_any_key (const ucl_object_t *obj, + const char *key, ...); + +/** * Return object identified by a fixed size key in the specified object * @param obj object to get a key from (must be of type UCL_OBJECT) * @param key key to search @@ -631,6 +678,16 @@ UCL_EXTERN const ucl_object_t *ucl_looku const char *path); /** + * Return object identified by object notation string using arbitrary delimiter + * @param obj object to search in + * @param path dot.notation.path to the path to lookup. May use numeric .index on arrays + * @param sep the sepatorator to use in place of . (incase keys have . in them) + * @return object matched the specified path or NULL if path is not found + */ +UCL_EXTERN const ucl_object_t *ucl_lookup_path_char (const ucl_object_t *obj, + const char *path, char sep); + +/** * Returns a key of an object as a NULL terminated string * @param obj CL object * @return key or NULL if there is no key @@ -683,7 +740,7 @@ UCL_EXTERN int ucl_object_compare (const * @param cmp */ UCL_EXTERN void ucl_object_array_sort (ucl_object_t *ar, - int (*cmp)(const ucl_object_t *o1, const ucl_object_t *o2)); + int (*cmp)(const ucl_object_t **o1, const ucl_object_t **o2)); /** * Get the priority for specific UCL object @@ -769,6 +826,21 @@ typedef bool (*ucl_macro_handler) (const const ucl_object_t *arguments, void* ud); +/** + * Context dependent macro handler for a parser + * @param data the content of macro + * @param len the length of content + * @param arguments arguments object + * @param context previously parsed context + * @param ud opaque user data + * @param err error pointer + * @return true if macro has been parsed + */ +typedef bool (*ucl_context_macro_handler) (const unsigned char *data, size_t len, + const ucl_object_t *arguments, + const ucl_object_t *context, + void* ud); + /* Opaque parser */ struct ucl_parser; @@ -780,16 +852,38 @@ struct ucl_parser; UCL_EXTERN struct ucl_parser* ucl_parser_new (int flags); /** + * Sets the default priority for the parser applied to chunks that does not + * specify priority explicitly + * @param parser parser object + * @param prio default priority (0 .. 16) + * @return true if parser's default priority was set + */ +UCL_EXTERN bool ucl_parser_set_default_priority (struct ucl_parser *parser, + unsigned prio); +/** * Register new handler for a macro * @param parser parser object * @param macro macro name (without leading dot) * @param handler handler (it is called immediately after macro is parsed) * @param ud opaque user data for a handler */ -UCL_EXTERN void ucl_parser_register_macro (struct ucl_parser *parser, const char *macro, +UCL_EXTERN void ucl_parser_register_macro (struct ucl_parser *parser, + const char *macro, ucl_macro_handler handler, void* ud); /** + * Register new context dependent handler for a macro + * @param parser parser object + * @param macro macro name (without leading dot) + * @param handler handler (it is called immediately after macro is parsed) + * @param ud opaque user data for a handler + */ +UCL_EXTERN void ucl_parser_register_context_macro (struct ucl_parser *parser, + const char *macro, + ucl_context_macro_handler handler, + void* ud); + +/** * Handler to detect unregistered variables * @param data variable data * @param len length of variable *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Oct 27 21:25:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B499A1CD7F; Tue, 27 Oct 2015 21:25:42 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC2131511; Tue, 27 Oct 2015 21:25:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLPejM070590; Tue, 27 Oct 2015 21:25:40 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLPeDe070589; Tue, 27 Oct 2015 21:25:40 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201510272125.t9RLPeDe070589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 27 Oct 2015 21:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290072 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 21:25:42 -0000 Author: melifaro Date: Tue Oct 27 21:25:40 2015 New Revision: 290072 URL: https://svnweb.freebsd.org/changeset/base/290072 Log: Eliminate last rtalloc_ign() caller. Differential Revision: https://reviews.freebsd.org/D3927 Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Oct 27 21:24:09 2015 (r290071) +++ head/sys/netpfil/pf/pf.c Tue Oct 27 21:25:40 2015 (r290072) @@ -5262,9 +5262,6 @@ pf_routable(struct pf_addr *addr, sa_fam in_rtalloc_ign((struct route *)&ro, 0, rtableid); break; #endif - default: - rtalloc_ign((struct route *)&ro, 0); /* No/default FIB. */ - break; } if (ro.ro_rt != NULL) { From owner-svn-src-head@freebsd.org Tue Oct 27 21:26:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86EB7A1CDC9; Tue, 27 Oct 2015 21:26:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 514C017B8; Tue, 27 Oct 2015 21:26:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RLQ5Z1070651; Tue, 27 Oct 2015 21:26:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RLQ55g070649; Tue, 27 Oct 2015 21:26:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201510272126.t9RLQ55g070649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 27 Oct 2015 21:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290073 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 21:26:06 -0000 Author: delphij Date: Tue Oct 27 21:26:05 2015 New Revision: 290073 URL: https://svnweb.freebsd.org/changeset/base/290073 Log: Update NetBSD RCS IDs to reflect the changes being upstreamed. MFC after: 13 days X-MFC-With: r290024 Modified: head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.1 ============================================================================== --- head/usr.bin/gzip/gzip.1 Tue Oct 27 21:25:40 2015 (r290072) +++ head/usr.bin/gzip/gzip.1 Tue Oct 27 21:26:05 2015 (r290073) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $ +.\" $NetBSD: gzip.1,v 1.26 2015/10/27 07:36:18 mrg Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Tue Oct 27 21:25:40 2015 (r290072) +++ head/usr.bin/gzip/gzip.c Tue Oct 27 21:26:05 2015 (r290073) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $ */ +/* $NetBSD: gzip.c,v 1.109 2015/10/27 07:36:18 mrg Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green From owner-svn-src-head@freebsd.org Tue Oct 27 22:11:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D34CA1D92A; Tue, 27 Oct 2015 22:11:11 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2F021213; Tue, 27 Oct 2015 22:11:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RMB9nc084065; Tue, 27 Oct 2015 22:11:09 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RMB9Al084047; Tue, 27 Oct 2015 22:11:09 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201510272211.t9RMB9Al084047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 27 Oct 2015 22:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290075 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 22:11:11 -0000 Author: melifaro Date: Tue Oct 27 22:11:09 2015 New Revision: 290075 URL: https://svnweb.freebsd.org/changeset/base/290075 Log: Use m_cat() to reassembly IPv6 packets. Submitted by: jonloony_gmail.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3863 Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Tue Oct 27 22:08:07 2015 (r290074) +++ head/sys/netinet6/frag6.c Tue Oct 27 22:11:09 2015 (r290075) @@ -523,8 +523,8 @@ insert: frag6_deq(af6); while (t->m_next) t = t->m_next; - t->m_next = IP6_REASS_MBUF(af6); - m_adj(t->m_next, af6->ip6af_offset); + m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); + m_cat(t, IP6_REASS_MBUF(af6)); free(af6, M_FTABLE); af6 = af6dwn; } From owner-svn-src-head@freebsd.org Tue Oct 27 22:24:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8576A1F31E; Tue, 27 Oct 2015 22:24:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92CE91F39; Tue, 27 Oct 2015 22:24:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RMOvcq088962; Tue, 27 Oct 2015 22:24:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RMOvMV088961; Tue, 27 Oct 2015 22:24:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201510272224.t9RMOvMV088961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 27 Oct 2015 22:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290079 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 22:24:58 -0000 Author: andrew Date: Tue Oct 27 22:24:57 2015 New Revision: 290079 URL: https://svnweb.freebsd.org/changeset/base/290079 Log: Mark functions as such. This means we call them directly rather than have the dynamic linker copy them, but not relocate them at the new location. This allows us to run sqlite3 without it crashing. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/include/asm.h Modified: head/sys/arm64/include/asm.h ============================================================================== --- head/sys/arm64/include/asm.h Tue Oct 27 22:18:19 2015 (r290078) +++ head/sys/arm64/include/asm.h Tue Oct 27 22:24:57 2015 (r290079) @@ -39,7 +39,7 @@ #define _C_LABEL(x) x #define ENTRY(sym) \ - .text; .globl sym; .align 2; sym: + .text; .globl sym; .align 2; .type sym,#function; sym: #define EENTRY(sym) \ .globl sym; sym: #define END(sym) .size sym, . - sym From owner-svn-src-head@freebsd.org Tue Oct 27 22:59:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEBCDA1F9BB; Tue, 27 Oct 2015 22:59:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 930571F03; Tue, 27 Oct 2015 22:59:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RMxOhd097929; Tue, 27 Oct 2015 22:59:24 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RMxO5a097927; Tue, 27 Oct 2015 22:59:24 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201510272259.t9RMxO5a097927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 27 Oct 2015 22:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290081 - in head/sys: amd64 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 22:59:25 -0000 Author: mckusick Date: Tue Oct 27 22:59:24 2015 New Revision: 290081 URL: https://svnweb.freebsd.org/changeset/base/290081 Log: Bring the tags and links entries for amd64 up to date. Based on how out of date it is, I doubt that anyone other than me and my code-reading students still use it. Modified: head/sys/amd64/Makefile head/sys/kern/Make.tags.inc Modified: head/sys/amd64/Makefile ============================================================================== --- head/sys/amd64/Makefile Tue Oct 27 22:57:58 2015 (r290080) +++ head/sys/amd64/Makefile Tue Oct 27 22:59:24 2015 (r290081) @@ -14,7 +14,7 @@ all: @echo "make links or tags only" # Directories in which to place amd64 tags links -DAMD64= acpica amd64 ia32 include isa linux32 pci +DAMD64= acpica amd64 ia32 include linux linux32 pci vmm links:: -for i in ${COMMDIR1}; do \ @@ -26,8 +26,9 @@ links:: SAMD64= ${SYS}/amd64/acpica/*.[ch] \ ${SYS}/amd64/amd64/*.[ch] ${SYS}/amd64/ia32/*.[ch] \ - ${SYS}/amd64/include/*.[ch] ${SYS}/amd64/isa/*.[ch] \ - ${SYS}/amd64/linux32/*.[ch] ${SYS}/amd64/pci/*.[ch] + ${SYS}/amd64/include/*.[ch] ${SYS}/amd64/linux/*.[ch] \ + ${SYS}/amd64/linux32/*.[ch] ${SYS}/amd64/pci/*.[ch] \ + ${SYS}/amd64/vmm/*.[ch] AAMD64= ${SYS}/amd64/amd64/*.S tags:: Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Tue Oct 27 22:57:58 2015 (r290080) +++ head/sys/kern/Make.tags.inc Tue Oct 27 22:59:24 2015 (r290081) @@ -11,8 +11,9 @@ SYS?= ${.CURDIR}/.. # better solution would be for ctags to generate "struct vmmeter" tags. COMM= ${SYS}/dev/advansys/*.[ch] \ + ${SYS}/sys/vnode.h \ ${SYS}/dev/aha/*.[ch] \ - ${SYS}/dev/aic7xxx/*.[ch] \ + ${SYS}/dev/alc/*.[ch] \ ${SYS}/dev/buslogic/*.[ch] \ ${SYS}/dev/dpt/*.[ch] \ ${SYS}/dev/en/*.[ch] \ @@ -22,15 +23,25 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/dev/ppbus/*.[ch] \ ${SYS}/dev/smbus/*.[ch] \ ${SYS}/dev/vx/*.[ch] \ + ${SYS}/fs/autofs/*.[ch] \ ${SYS}/fs/cd9660/*.[ch] \ + ${SYS}/fs/cuse/*.[ch] \ ${SYS}/fs/deadfs/*.[ch] \ ${SYS}/fs/devfs/*.[ch] \ + ${SYS}/fs/ext2fs/*.[ch] \ ${SYS}/fs/fdescfs/*.[ch] \ ${SYS}/fs/fifofs/*.[ch] \ + ${SYS}/fs/fuse/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ + ${SYS}/fs/nandfs/*.[ch] \ + ${SYS}/fs/nfs/*.[ch] \ + ${SYS}/fs/nfsclient/*.[ch] \ + ${SYS}/fs/nfsserver/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ ${SYS}/fs/procfs/*.[ch] \ + ${SYS}/fs/pseudofs/*.[ch] \ ${SYS}/fs/smbfs/*.[ch] \ + ${SYS}/fs/tmpfs/*.[ch] \ ${SYS}/fs/udf/*.[ch] \ ${SYS}/fs/unionfs/*.[ch] \ ${SYS}/geom/*.[ch] \ @@ -40,10 +51,7 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/netinet6/*.[ch] \ ${SYS}/netipsec/*.[ch] \ ${SYS}/netnatm/*.[ch] \ - ${SYS}/nfs/*.[ch] \ - ${SYS}/nfsclient/*.[ch] \ - ${SYS}/nfsserver/*.[ch] \ - ${SYS}/pci/*.[ch] \ + ${SYS}/ddb/*.[ch] \ ${SYS}/ufs/ffs/*.[ch] \ ${SYS}/ufs/ufs/*.[ch] \ ${SYS}/vm/*.[ch] \ @@ -57,37 +65,43 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/netinet6 \ ${SYS}/netipsec \ ${SYS}/netnatm \ - ${SYS}/nfs \ - ${SYS}/pci \ + ${SYS}/ddb \ ${SYS}/vm \ ${SYS}/sys COMMDIR2= ${SYS}/dev/advansys \ ${SYS}/dev/aha \ - ${SYS}/dev/aic7xxx \ + ${SYS}/dev/alc \ ${SYS}/dev/buslogic \ - ${SYS}/dev/ccd \ - ${SYS}/dev/dec \ ${SYS}/dev/dpt \ ${SYS}/dev/en \ - ${SYS}/dev/hea \ - ${SYS}/dev/hfa \ ${SYS}/dev/iicbus \ ${SYS}/dev/isp \ + ${SYS}/dev/md \ ${SYS}/dev/pdq \ ${SYS}/dev/ppbus \ ${SYS}/dev/smbus \ - ${SYS}/dev/vn \ ${SYS}/dev/vx \ + ${SYS}/fs/autofs \ + ${SYS}/fs/cd9660 \ + ${SYS}/fs/cuse \ ${SYS}/fs/deadfs \ ${SYS}/fs/devfs \ + ${SYS}/fs/ext2fs \ ${SYS}/fs/fdescfs \ ${SYS}/fs/fifofs \ + ${SYS}/fs/fuse \ ${SYS}/fs/msdosfs \ + ${SYS}/fs/nandfs \ + ${SYS}/fs/nfs \ + ${SYS}/fs/nfsclient \ + ${SYS}/fs/nfsserver \ ${SYS}/fs/nullfs \ ${SYS}/fs/procfs \ - ${SYS}/fs/specfs \ + ${SYS}/fs/pseudofs \ + ${SYS}/fs/smbfs \ + ${SYS}/fs/tmpfs \ + ${SYS}/fs/udf \ ${SYS}/fs/unionfs \ - ${SYS}/fs/cd9660 \ ${SYS}/ufs/ffs \ ${SYS}/ufs/ufs From owner-svn-src-head@freebsd.org Tue Oct 27 23:11:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DAB9A1FDBC; Tue, 27 Oct 2015 23:11:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554B915DF; Tue, 27 Oct 2015 23:11:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RNBMv2001059; Tue, 27 Oct 2015 23:11:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RNBMeD001058; Tue, 27 Oct 2015 23:11:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510272311.t9RNBMeD001058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 27 Oct 2015 23:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290082 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 23:11:23 -0000 Author: adrian Date: Tue Oct 27 23:11:22 2015 New Revision: 290082 URL: https://svnweb.freebsd.org/changeset/base/290082 Log: mips: use the correct va for wbinv flushing. arge doesn't trigger this, but ath(4) does. Tested: * AR9331 SoC (Carambola2); ath(4) hostap Submitted by: ian Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Tue Oct 27 22:59:24 2015 (r290081) +++ head/sys/mips/mips/busdma_machdep.c Tue Oct 27 23:11:22 2015 (r290082) @@ -1128,7 +1128,7 @@ bus_dmamap_sync_buf(vm_offset_t buf, int break; case BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE: - mips_dcache_wbinv_range(buf_cl, len); + mips_dcache_wbinv_range(buf, len); break; case BUS_DMASYNC_PREREAD: From owner-svn-src-head@freebsd.org Tue Oct 27 23:35:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96AC2A1F3E6; Tue, 27 Oct 2015 23:35:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55F9F154E; Tue, 27 Oct 2015 23:35:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RNZ4xG009438; Tue, 27 Oct 2015 23:35:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RNZ2e6009420; Tue, 27 Oct 2015 23:35:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510272335.t9RNZ2e6009420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 23:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290083 - in head: etc sbin/atm/atmconfig share/colldef share/examples/smbfs share/examples/smbfs/print share/keys/pkg/trusted share/mklocale share/monetdef share/msgdef share/numericde... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 23:35:05 -0000 Author: bdrewery Date: Tue Oct 27 23:35:02 2015 New Revision: 290083 URL: https://svnweb.freebsd.org/changeset/base/290083 Log: Use more appropriate ${SHAREDIR} rather than /usr/share. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/etc/Makefile head/sbin/atm/atmconfig/Makefile head/share/colldef/Makefile head/share/examples/smbfs/Makefile head/share/examples/smbfs/print/Makefile head/share/keys/pkg/trusted/Makefile head/share/mklocale/Makefile head/share/monetdef/Makefile head/share/msgdef/Makefile head/share/numericdef/Makefile head/share/sendmail/Makefile head/share/skel/Makefile head/share/timedef/Makefile head/usr.bin/vi/catalog/Makefile head/usr.sbin/ndiscvt/Makefile head/usr.sbin/zic/zdump/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/etc/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -394,26 +394,26 @@ distrib-dirs: ${MTREES:N/*} .endif ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys .if ${MK_MAN} != "no" - cd ${DESTDIR}/usr/share/man; \ + cd ${DESTDIR}${SHAREDIR}/man; \ for mandir in man*; do \ ${INSTALL_SYMLINK} ../$$mandir \ - ${DESTDIR}/usr/share/man/en.ISO8859-1/; \ + ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \ ${INSTALL_SYMLINK} ../$$mandir \ - ${DESTDIR}/usr/share/man/en.UTF-8/; \ + ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \ done .if ${MK_OPENSSL} != "no" - cd ${DESTDIR}/usr/share/openssl/man; \ + cd ${DESTDIR}${SHAREDIR}/openssl/man; \ for mandir in man*; do \ ${INSTALL_SYMLINK} ../$$mandir \ - ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \ + ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \ done .endif set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \ while [ $$# -gt 0 ] ; do \ - ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \ + ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \ if [ "${MK_OPENSSL}" != "no" ]; then \ ${INSTALL_SYMLINK} "$$2" \ - "${DESTDIR}/usr/share/openssl/man/$$1"; \ + "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \ fi; \ shift; shift; \ done @@ -421,7 +421,7 @@ distrib-dirs: ${MTREES:N/*} .if ${MK_NLS} != "no" set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \ while [ $$# -gt 0 ] ; do \ - ${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \ + ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \ shift; shift; \ done .endif @@ -429,8 +429,8 @@ distrib-dirs: ${MTREES:N/*} etc-examples: cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${BIN1} ${BIN2} nsmb.conf opieaccess \ - ${DESTDIR}/usr/share/examples/etc + ${DESTDIR}${SHAREDIR}/examples/etc ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \ - DESTDIR=${DESTDIR}/usr/share/examples + DESTDIR=${DESTDIR}${SHAREDIR}/examples .include Modified: head/sbin/atm/atmconfig/Makefile ============================================================================== --- head/sbin/atm/atmconfig/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/sbin/atm/atmconfig/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -10,7 +10,7 @@ PROG= atmconfig SRCS= main.c diag.c natm.c MAN= atmconfig.8 -# CFLAGS+= -DPATH_HELP='".:/usr/share/doc/atm:/usr/local/share/doc/atm"' +# CFLAGS+= -DPATH_HELP='".:${SHAREDIR}/doc/atm:/usr/local/share/doc/atm"' CFLAGS+= -I${.OBJDIR} @@ -31,7 +31,7 @@ WARNS?= 3 .endif FILES= atmconfig.help atmconfig_device.help -FILESDIR= /usr/share/doc/atm +FILESDIR= ${SHAREDIR}/doc/atm SNMP_ATM_DEF= ${.CURDIR}/../../../contrib/ngatm/snmp_atm/atm_tree.def \ ${.CURDIR}/../../../usr.sbin/bsnmpd/modules/snmp_atm/atm_freebsd.def Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/colldef/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -42,7 +42,7 @@ LOCALES= bg_BG.CP1251 \ uk_UA.ISO8859-5 \ uk_UA.KOI8-U -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out Modified: head/share/examples/smbfs/Makefile ============================================================================== --- head/share/examples/smbfs/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/examples/smbfs/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -1,7 +1,7 @@ # $FreeBSD$ NO_OBJ= -BINDIR= /usr/share/examples/smbfs +FILESDIR= ${SHAREDIR}/examples/smbfs FILES= dot.nsmbrc .PATH: ${.CURDIR}/../../../contrib/smbfs/examples Modified: head/share/examples/smbfs/print/Makefile ============================================================================== --- head/share/examples/smbfs/print/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/examples/smbfs/print/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -1,7 +1,7 @@ # $FreeBSD$ NO_OBJ= -BINDIR= /usr/share/examples/smbfs/print +FILESDIR= ${SHAREDIR}/examples/smbfs/print FILES= lj6l ljspool printcap.sample tolj .PATH: ${.CURDIR}/../../../../contrib/smbfs/examples/print Modified: head/share/keys/pkg/trusted/Makefile ============================================================================== --- head/share/keys/pkg/trusted/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/keys/pkg/trusted/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -4,7 +4,7 @@ NO_OBJ= FILES= pkg.freebsd.org.2013102301 -FILESDIR= /usr/share/keys/pkg/trusted +FILESDIR= ${SHAREDIR}/keys/pkg/trusted FILESMODE= 644 .include Modified: head/share/mklocale/Makefile ============================================================================== --- head/share/mklocale/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/mklocale/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -30,7 +30,7 @@ LOCALES= UTF-8 \ zh_HK.Big5HKSCS \ zh_TW.Big5 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out Modified: head/share/monetdef/Makefile ============================================================================== --- head/share/monetdef/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/monetdef/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -90,7 +90,7 @@ LOCALES= af_ZA.ISO8859-1 \ zh_HK.UTF-8 \ zh_TW.Big5 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out Modified: head/share/msgdef/Makefile ============================================================================== --- head/share/msgdef/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/msgdef/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -70,7 +70,7 @@ LOCALES= af_ZA.ISO8859-1 \ zh_TW.Big5 \ zh_TW.UTF-8 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out Modified: head/share/numericdef/Makefile ============================================================================== --- head/share/numericdef/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/numericdef/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -44,7 +44,7 @@ LOCALES= af_ZA.ISO8859-1 \ uk_UA.KOI8-U \ zh_CN.eucCN -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out Modified: head/share/sendmail/Makefile ============================================================================== --- head/share/sendmail/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/sendmail/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -7,7 +7,7 @@ CFDIR= cf CFDIRS!= (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type d -print) CFFILES!= (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type f -print) -DDIR= ${DESTDIR}/usr/share/sendmail +DDIR= ${DESTDIR}${SHAREDIR}/sendmail # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies'') Modified: head/share/skel/Makefile ============================================================================== --- head/share/skel/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/skel/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -5,8 +5,8 @@ FILESGROUPS= FILES1 FILES2 FILES1= dot.cshrc dot.login dot.login_conf dot.mailrc dot.profile \ dot.shrc FILES2= dot.mail_aliases dot.rhosts -FILES1DIR= /usr/share/skel -FILES2DIR= /usr/share/skel +FILES1DIR= ${SHAREDIR}/skel +FILES2DIR= ${SHAREDIR}/skel FILES1MODE= 0644 FILES2MODE= 0600 Modified: head/share/timedef/Makefile ============================================================================== --- head/share/timedef/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/share/timedef/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -96,7 +96,7 @@ LOCALES= am_ET.UTF-8 \ zh_TW.Big5 \ zh_TW.UTF-8 -LOCALEDIR= /usr/share/locale +LOCALEDIR= ${SHAREDIR}/locale .SUFFIXES: .src .out Modified: head/usr.bin/vi/catalog/Makefile ============================================================================== --- head/usr.bin/vi/catalog/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/usr.bin/vi/catalog/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -115,7 +115,7 @@ SVLINKS= sv_SE PLLINKS= pl_PL FILES= ${CATALOGS} -FILESDIR= /usr/share/vi/catalog +FILESDIR= ${SHAREDIR}/vi/catalog SYMLINKS= .for l in ${NLLINKS} SYMLINKS+= dutch ${FILESDIR}/$l.ISO8859-1 Modified: head/usr.sbin/ndiscvt/Makefile ============================================================================== --- head/usr.sbin/ndiscvt/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/usr.sbin/ndiscvt/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -23,7 +23,7 @@ CLEANFILES= y.output FILES= windrv_stub.c FILESNAME= windrv_stub.c -FILESDIR= /usr/share/misc +FILESDIR= ${SHAREDIR}/misc SCRIPTS= ndisgen.sh Modified: head/usr.sbin/zic/zdump/Makefile ============================================================================== --- head/usr.sbin/zic/zdump/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/usr.sbin/zic/zdump/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -7,7 +7,7 @@ MAN= zdump.8 SRCS= zdump.c ialloc.c scheck.c CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS -CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir +CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"${SHAREDIR}/zoneinfo\" -Demkdir=mkdir CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../contrib/tzcode/stdtime WARNS?= 2 Modified: head/usr.sbin/zic/zic/Makefile ============================================================================== --- head/usr.sbin/zic/zic/Makefile Tue Oct 27 23:11:22 2015 (r290082) +++ head/usr.sbin/zic/zic/Makefile Tue Oct 27 23:35:02 2015 (r290083) @@ -7,7 +7,7 @@ MAN= zic.8 SRCS= zic.c ialloc.c scheck.c CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS -CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir +CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"${SHAREDIR}/zoneinfo\" -Demkdir=mkdir CFLAGS+= -DHAVE_STRERROR -DHAVE_UNISTD_H CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../contrib/tzcode/stdtime From owner-svn-src-head@freebsd.org Tue Oct 27 23:35:09 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0206A1F3FE; Tue, 27 Oct 2015 23:35:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B593D157C; Tue, 27 Oct 2015 23:35:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RNZ8Gk009486; Tue, 27 Oct 2015 23:35:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RNZ8Ji009485; Tue, 27 Oct 2015 23:35:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510272335.t9RNZ8Ji009485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 23:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290084 - head/usr.sbin/ndiscvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 23:35:10 -0000 Author: bdrewery Date: Tue Oct 27 23:35:08 2015 New Revision: 290084 URL: https://svnweb.freebsd.org/changeset/base/290084 Log: Remove unneeded NAME override. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/ndiscvt/Makefile Modified: head/usr.sbin/ndiscvt/Makefile ============================================================================== --- head/usr.sbin/ndiscvt/Makefile Tue Oct 27 23:35:02 2015 (r290083) +++ head/usr.sbin/ndiscvt/Makefile Tue Oct 27 23:35:08 2015 (r290084) @@ -22,7 +22,6 @@ CFLAGS+=-I. -I${.CURDIR} -I${.CURDIR}/.. CLEANFILES= y.output FILES= windrv_stub.c -FILESNAME= windrv_stub.c FILESDIR= ${SHAREDIR}/misc SCRIPTS= ndisgen.sh From owner-svn-src-head@freebsd.org Tue Oct 27 23:37:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F70A1F509; Tue, 27 Oct 2015 23:37:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3D7F1A71; Tue, 27 Oct 2015 23:37:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RNbtMR009612; Tue, 27 Oct 2015 23:37:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RNbtGK009611; Tue, 27 Oct 2015 23:37:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201510272337.t9RNbtGK009611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 27 Oct 2015 23:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290085 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 23:37:56 -0000 Author: andrew Date: Tue Oct 27 23:37:54 2015 New Revision: 290085 URL: https://svnweb.freebsd.org/changeset/base/290085 Log: Start to remove support for the Samsung s3c24x0 SoCs by removing the kernel config, and support from NOTES. Deleted: head/sys/arm/conf/LN2410SBC Modified: head/sys/arm/conf/NOTES Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Tue Oct 27 23:35:08 2015 (r290084) +++ head/sys/arm/conf/NOTES Tue Oct 27 23:37:54 2015 (r290085) @@ -19,7 +19,6 @@ files "../mv/discovery/files.db78xxx" files "../mv/kirkwood/files.kirkwood" files "../mv/orion/files.db88f5xxx" files "../mv/orion/files.ts7800" -files "../samsung/s3c2xx0/files.s3c2xx0" files "../xscale/i80321/files.ep80219" files "../xscale/i80321/files.i80219" files "../xscale/i80321/files.i80321" @@ -58,7 +57,6 @@ device at91_board_sam9x25ek device at91_board_tsc4370 device at91rm9200 device nand -device board_ln2410sbc nooptions SMP nooptions MAXCPU From owner-svn-src-head@freebsd.org Tue Oct 27 23:49:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80E2AA1F6FB; Tue, 27 Oct 2015 23:49:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 443951E63; Tue, 27 Oct 2015 23:49:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9RNnWks012455; Tue, 27 Oct 2015 23:49:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9RNnWuj012454; Tue, 27 Oct 2015 23:49:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510272349.t9RNnWuj012454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 27 Oct 2015 23:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290086 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 27 Oct 2015 23:49:33 -0000 Author: bdrewery Date: Tue Oct 27 23:49:32 2015 New Revision: 290086 URL: https://svnweb.freebsd.org/changeset/base/290086 Log: Use proper CONFDIR after r289148 Modified: head/share/mk/bsd.confs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Tue Oct 27 23:37:54 2015 (r290085) +++ head/share/mk/bsd.confs.mk Tue Oct 27 23:49:32 2015 (r290086) @@ -21,7 +21,7 @@ all: buildconfig ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} -${group}DIR?= ${CONFIGDIR}/ +${group}DIR?= ${CONFDIR} STAGE_SETS+= ${group} STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} From owner-svn-src-head@freebsd.org Wed Oct 28 02:15:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62FF6A1F689; Wed, 28 Oct 2015 02:15:11 +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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23F331627; Wed, 28 Oct 2015 02:15:10 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-229-78.lns20.per1.internode.on.net [121.45.229.78]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id t9S2ExrN005992 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 27 Oct 2015 19:15:02 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510261328.t9QDSYRT076892@repo.freebsd.org> From: Julian Elischer Message-ID: <56302F9D.2020308@freebsd.org> Date: Wed, 28 Oct 2015 10:14:53 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510261328.t9QDSYRT076892@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 02:15:11 -0000 On 10/26/15 9:28 PM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 26 13:28:34 2015 > New Revision: 290003 > URL: https://svnweb.freebsd.org/changeset/base/290003 > > Log: > Add support for binding IRQs to CPUs in the LinuxKPI. The new function > added is for BSD only and does not exist in Linux. um, then who would use it and why? > From owner-svn-src-head@freebsd.org Wed Oct 28 02:37:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE134A1FB88; Wed, 28 Oct 2015 02:37:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id B3A6E1155; Wed, 28 Oct 2015 02:37:25 +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 t9S2bOvN061841; Wed, 28 Oct 2015 02:37:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9S2bOn9061836; Wed, 28 Oct 2015 02:37:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510280237.t9S2bOn9061836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 28 Oct 2015 02:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290087 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 02:37:26 -0000 Author: cem Date: Wed Oct 28 02:37:24 2015 New Revision: 290087 URL: https://svnweb.freebsd.org/changeset/base/290087 Log: ioat: Define DMACAPABILITY bits Check for BFILL capability before initiating blockfill operations. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_hw.h head/sys/dev/ioat/ioat_internal.h head/sys/dev/ioat/ioat_test.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue Oct 27 23:49:32 2015 (r290086) +++ head/sys/dev/ioat/ioat.c Wed Oct 28 02:37:24 2015 (r290087) @@ -364,14 +364,16 @@ ioat3_attach(device_t device) struct ioat_descriptor **ring; struct ioat_descriptor *next; struct ioat_dma_hw_descriptor *dma_hw_desc; - uint32_t capabilities; int i, num_descriptors; int error; uint8_t xfercap; error = 0; ioat = DEVICE2SOFTC(device); - capabilities = ioat_read_dmacapability(ioat); + ioat->capabilities = ioat_read_dmacapability(ioat); + + ioat_log_message(1, "Capabilities: %b\n", (int)ioat->capabilities, + IOAT_DMACAP_STR); xfercap = ioat_read_xfercap(ioat); ioat->max_xfer_size = 1 << xfercap; @@ -760,6 +762,12 @@ ioat_blockfill(bus_dmaengine_t dmaengine CTR0(KTR_IOAT, __func__); ioat = to_ioat_softc(dmaengine); + if ((ioat->capabilities & IOAT_DMACAP_BFILL) == 0) { + ioat_log_message(0, "%s: Device lacks BFILL capability\n", + __func__); + return (NULL); + } + if ((dst & (0xffffull << 48)) != 0) { ioat_log_message(0, "%s: High 16 bits of dst invalid\n", __func__); Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Tue Oct 27 23:49:32 2015 (r290086) +++ head/sys/dev/ioat/ioat.h Wed Oct 28 02:37:24 2015 (r290087) @@ -71,6 +71,8 @@ void ioat_release(bus_dmaengine_t dmaeng /* * Issue a blockfill operation. The 64-bit pattern 'fillpattern' is written to * 'len' physically contiguous bytes at 'dst'. + * + * Only supported on devices with the BFILL capability. */ struct bus_dmadesc *ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, uint64_t fillpattern, bus_size_t len, bus_dmaengine_callback_t callback_fn, Modified: head/sys/dev/ioat/ioat_hw.h ============================================================================== --- head/sys/dev/ioat/ioat_hw.h Tue Oct 27 23:49:32 2015 (r290086) +++ head/sys/dev/ioat/ioat_hw.h Wed Oct 28 02:37:24 2015 (r290087) @@ -54,6 +54,21 @@ __FBSDID("$FreeBSD$"); #define IOAT_CS_STATUS_OFFSET 0x0E #define IOAT_DMACAPABILITY_OFFSET 0x10 +#define IOAT_DMACAP_PB (1 << 0) +#define IOAT_DMACAP_DCA (1 << 4) +#define IOAT_DMACAP_BFILL (1 << 6) +#define IOAT_DMACAP_XOR (1 << 8) +#define IOAT_DMACAP_PQ (1 << 9) +#define IOAT_DMACAP_DMA_DIF (1 << 10) +#define IOAT_DMACAP_DWBES (1 << 13) +#define IOAT_DMACAP_RAID16SS (1 << 17) +#define IOAT_DMACAP_DMAMC (1 << 18) +#define IOAT_DMACAP_CTOS (1 << 19) + +#define IOAT_DMACAP_STR \ + "\20\24Completion_Timeout_Support\23DMA_with_Multicasting_Support" \ + "\22RAID_Super_descriptors\16Descriptor_Write_Back_Error_Support" \ + "\13DMA_with_DIF\12PQ\11XOR\07Block_Fill\05DCA\01Page_Break" /* DMA Channel Registers */ #define IOAT_CHANCTRL_OFFSET 0x80 Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Tue Oct 27 23:49:32 2015 (r290086) +++ head/sys/dev/ioat/ioat_internal.h Wed Oct 28 02:37:24 2015 (r290087) @@ -373,6 +373,7 @@ struct ioat_softc { int pci_resource_id; struct resource *pci_resource; uint32_t max_xfer_size; + uint32_t capabilities; struct resource *res; int rid; Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Tue Oct 27 23:49:32 2015 (r290086) +++ head/sys/dev/ioat/ioat_test.c Wed Oct 28 02:37:24 2015 (r290087) @@ -319,6 +319,15 @@ ioat_dma_test(void *arg) return; } + if (test->testkind == IOAT_TEST_FILL && + (to_ioat_softc(dmaengine)->capabilities & IOAT_DMACAP_BFILL) == 0) + { + ioat_test_log(0, + "Hardware doesn't support block fill, aborting test\n"); + test->status[IOAT_TEST_INVALID_INPUT]++; + goto out; + } + index = g_thread_index++; TAILQ_INIT(&test->free_q); TAILQ_INIT(&test->pend_q); From owner-svn-src-head@freebsd.org Wed Oct 28 03:39:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4801EA1F738; Wed, 28 Oct 2015 03:39:20 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 124F21CA0; Wed, 28 Oct 2015 03:39:19 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9S3dJn8080919; Wed, 28 Oct 2015 03:39:19 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9S3dJ2b080918; Wed, 28 Oct 2015 03:39:19 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201510280339.t9S3dJ2b080918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 28 Oct 2015 03:39:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290088 - head/tools/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 03:39:20 -0000 Author: gnn Date: Wed Oct 28 03:39:18 2015 New Revision: 290088 URL: https://svnweb.freebsd.org/changeset/base/290088 Log: Update the README to describe all the current tests in this directory. Modified: head/tools/test/README Modified: head/tools/test/README ============================================================================== --- head/tools/test/README Wed Oct 28 02:37:24 2015 (r290087) +++ head/tools/test/README Wed Oct 28 03:39:18 2015 (r290088) @@ -1,14 +1,24 @@ $FreeBSD$ -This directory is for test programs. +This directory is for standalone test programs, for the FreeBSD +Test Suite, which uses Kyua, please see /usr/src/tests/ -A test program is one that will exercise a particular bit of the system -and try to break it and/or measuring performance on it. +A test program is one that exercises a particular bit of the system +and either tries to break it or measures its performance. Please make a subdir per program, and add a brief description to this file. +auxinfo Return information on page sizes, CPUs, and OS release date. devrandom Programs to test /dev/*random. +hwpmc Automatically trigger every event in hwpmc(4). +iconv Character set conversion tests. malloc A program to test and benchmark malloc(). +net A set of generic test programs for networking. netfibs Programs to test multi-FIB network stacks. posixshm A program to test POSIX shared memory. +ppsapi Test 1 Pulse Per Second (1PPS) input for time control. +pthread_vfork Chack that vfork and pthreads work together. +ptrace Verify that ptrace works with syscalls, vfork etc. +sort Tests for the sort command, including a full regression. testfloat Programs to test floating-point implementations +upsdl Test of mmap funcationality. From owner-svn-src-head@freebsd.org Wed Oct 28 03:43:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC4AEA1F8E8; Wed, 28 Oct 2015 03:43:25 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B723E1032; Wed, 28 Oct 2015 03:43:25 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9S3hOs7083654; Wed, 28 Oct 2015 03:43:24 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9S3hO2J083651; Wed, 28 Oct 2015 03:43:24 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201510280343.t9S3hO2J083651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 28 Oct 2015 03:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290089 - head/tools/test/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 03:43:26 -0000 Author: gnn Date: Wed Oct 28 03:43:24 2015 New Revision: 290089 URL: https://svnweb.freebsd.org/changeset/base/290089 Log: Add a test for the listen queue using two test programs, listen, and connect. The listen program is a simple server that accepts and closes sockets, until a fixed limit, then sets the listen queue to 0 and counts how many remaining connections it processes. The connect program repeatedly opens connections and closes them serving as the driver for the listen program. Sponsored by: Limelight Networks Added: head/tools/test/net/ head/tools/test/net/Makefile (contents, props changed) head/tools/test/net/connect.c (contents, props changed) head/tools/test/net/listen.c (contents, props changed) Added: head/tools/test/net/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/net/Makefile Wed Oct 28 03:43:24 2015 (r290089) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROGS= listen connect +MAN= +WARNS?= 6 + +test: ${PROGS} + +.include Added: head/tools/test/net/connect.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/net/connect.c Wed Oct 28 03:43:24 2015 (r290089) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2015 George V. Neville-Neil + * 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$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PORT 6969 /* Default port */ +#define RECV_LIMIT 64 /* When do we move listen to 0? */ + +void usage(void); + +void usage() +{ + err(EX_USAGE, "connect [-p port]\n"); +} + +int main(int argc, char **argv) +{ + + int ch, cli_sock, count = 0; + int port = PORT; + struct sockaddr_in remoteaddr; + + while ((ch = getopt(argc, argv, "p:")) != -1) { + switch (ch) { + case 'p': + port = atoi(optarg); + break; + case 'h': + default: + usage(); + } + } + + bzero(&remoteaddr, sizeof(remoteaddr)); + remoteaddr.sin_len = sizeof(remoteaddr); + remoteaddr.sin_family = AF_INET; + remoteaddr.sin_port = htons(port); + remoteaddr.sin_addr.s_addr = INADDR_ANY; + + cli_sock = socket(AF_INET, SOCK_STREAM, 0); + + while ((cli_sock = connect(cli_sock, (struct sockaddr *)&remoteaddr, + sizeof(remoteaddr))) >= 0) { + count++; + close(cli_sock); + cli_sock = socket(AF_INET, SOCK_STREAM, 0); + } + + printf("Exiting at %d with errno %d\n", count, errno); + +} Added: head/tools/test/net/listen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/net/listen.c Wed Oct 28 03:43:24 2015 (r290089) @@ -0,0 +1,106 @@ +/*- + * Copyright (c) 2015 George V. Neville-Neil + * 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$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PORT 6969 /* Default port */ +#define LISTEN 5 /* Default backlog */ +#define RECV_LIMIT 64 /* When do we move listen to 0? */ + +void usage(void); + +void usage() +{ + err(EX_USAGE, "listen [-p port] [-l limit]\n"); +} + +int main(int argc, char **argv) +{ + + int ch, srv_sock, cli_sock, recvd = 0; + int port = PORT; + int limit = LISTEN; + struct sockaddr_in localaddr; + + while ((ch = getopt(argc, argv, "p:l:")) != -1) { + switch (ch) { + case 'p': + port = atoi(optarg); + break; + case 'l': + limit = atoi(optarg); + break; + case 'h': + default: + usage(); + } + } + + bzero(&localaddr, sizeof(localaddr)); + localaddr.sin_len = sizeof(localaddr); + localaddr.sin_family = AF_INET; + localaddr.sin_port = htons(port); + localaddr.sin_addr.s_addr = INADDR_ANY; + + srv_sock = socket(AF_INET, SOCK_STREAM, 0); + + if (bind(srv_sock, (struct sockaddr *)&localaddr, + sizeof(struct sockaddr_in)) < 0) + err(EX_OSERR, "Could not bind to INADDR_ANY:%d", port); + + if (listen(srv_sock, limit) < 0) + err(EX_OSERR, "Failed to listen with depth of %d\n", limit); + + while (((cli_sock = accept(srv_sock, NULL, NULL)) >= 0) + && (recvd < RECV_LIMIT)) { + close(cli_sock); + recvd++; + } + + listen(srv_sock, 0); + + while (((cli_sock = accept(srv_sock, NULL, NULL)) >= 0) + && (recvd <= (RECV_LIMIT + limit + 1))) { + close(cli_sock); + recvd++; + } + + if (accept(srv_sock, NULL, NULL) >= 0) + printf ("Late connection at %d\n", recvd); + else + printf("recvd %d\n", recvd); +} From owner-svn-src-head@freebsd.org Wed Oct 28 05:11:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144A2A1FB18; Wed, 28 Oct 2015 05:11:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C95621E77; Wed, 28 Oct 2015 05:11:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9S5B6Hx009508; Wed, 28 Oct 2015 05:11:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9S5B6es009506; Wed, 28 Oct 2015 05:11:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510280511.t9S5B6es009506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 28 Oct 2015 05:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290090 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 05:11:08 -0000 Author: adrian Date: Wed Oct 28 05:11:06 2015 New Revision: 290090 URL: https://svnweb.freebsd.org/changeset/base/290090 Log: Add some debugging code (under ARGE_DEBUG) that counts each interrupt source. This should make it easier to track down interrupt storms from arge. Tested: * AP135 (QCA955x) SoC - defaults to ARGE_DEBUG enabled * Carambola2 (AR9331 SoC) - defaults to ARGE_DEBUG disabled Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Wed Oct 28 03:43:24 2015 (r290089) +++ head/sys/mips/atheros/if_arge.c Wed Oct 28 05:11:06 2015 (r290090) @@ -277,6 +277,28 @@ arge_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } +#ifdef ARGE_DEBUG +static void +arge_attach_intr_sysctl(device_t dev, struct sysctl_oid_list *parent) +{ + struct arge_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + char sn[8]; + int i; + + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "intr", + CTLFLAG_RD, NULL, "Interrupt statistics"); + child = SYSCTL_CHILDREN(tree); + for (i = 0; i < 32; i++) { + snprintf(sn, sizeof(sn), "%d", i); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD, + &sc->intr_stats.count[i], 0, ""); + } +} +#endif + static void arge_attach_sysctl(device_t dev) { @@ -288,6 +310,7 @@ arge_attach_sysctl(device_t dev) SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "debug", CTLFLAG_RW, &sc->arge_debug, 0, "arge interface debugging flags"); + arge_attach_intr_sysctl(dev, SYSCTL_CHILDREN(tree)); #endif SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, @@ -2440,6 +2463,9 @@ arge_intr(void *arg) struct arge_softc *sc = arg; uint32_t status; struct ifnet *ifp = sc->arge_ifp; +#ifdef ARGE_DEBUG + int i; +#endif status = ARGE_READ(sc, AR71XX_DMA_INTR_STATUS); status |= sc->arge_intr_status; @@ -2456,6 +2482,14 @@ arge_intr(void *arg) return; } +#ifdef ARGE_DEBUG + for (i = 0; i < 32; i++) { + if (status & (1 << i)) { + sc->intr_stats.count[1 << i]++; + } + } +#endif + if (status & DMA_INTR_RX_BUS_ERROR) { ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_BUS_ERROR); device_printf(sc->arge_dev, "RX bus error"); Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Wed Oct 28 03:43:24 2015 (r290089) +++ head/sys/mips/atheros/if_argevar.h Wed Oct 28 05:11:06 2015 (r290090) @@ -214,6 +214,9 @@ struct arge_softc { uint32_t intr_stray2; uint32_t intr_ok; } stats; + struct { + uint32_t count[32]; + } intr_stats; }; #endif /* __IF_ARGEVAR_H__ */ From owner-svn-src-head@freebsd.org Wed Oct 28 08:07:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2380BA200BC; Wed, 28 Oct 2015 08:07:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC57C123E; Wed, 28 Oct 2015 08:07:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9DFD91FE023; Wed, 28 Oct 2015 09:06:57 +0100 (CET) Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux To: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> From: Hans Petter Selasky Message-ID: <56308289.4050902@selasky.org> Date: Wed, 28 Oct 2015 09:08:41 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56302F9D.2020308@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 08:07:01 -0000 On 10/28/15 03:14, Julian Elischer wrote: > On 10/26/15 9:28 PM, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Mon Oct 26 13:28:34 2015 >> New Revision: 290003 >> URL: https://svnweb.freebsd.org/changeset/base/290003 >> >> Log: >> Add support for binding IRQs to CPUs in the LinuxKPI. The new function >> added is for BSD only and does not exist in Linux. > > um, then who would use it and why? > Hi Julian, The parameters for bus_bind_intr() are not available outside the LinuxKPI. To support such a functionality we should wrap it, for the sake of maintainability. The LinuxKPI is not a binary compatibility module, and will at some point have API's diverging from Linux, to fit BSD API's better. There is a plan to use this new function alongside some new network drivers which are not yet committed, to support RSS. --HPS From owner-svn-src-head@freebsd.org Wed Oct 28 12:10:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A42EA2077E; Wed, 28 Oct 2015 12:10:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 655BF1CA0; Wed, 28 Oct 2015 12:10:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SCA1bu046156; Wed, 28 Oct 2015 12:10:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SCA1Jd046155; Wed, 28 Oct 2015 12:10:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510281210.t9SCA1Jd046155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 28 Oct 2015 12:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290101 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 12:10:02 -0000 Author: hselasky Date: Wed Oct 28 12:10:01 2015 New Revision: 290101 URL: https://svnweb.freebsd.org/changeset/base/290101 Log: Build fix for i386/XBOX and pc98/GENERIC. Reviewed by: kib Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Oct 28 11:58:18 2015 (r290100) +++ head/sys/i386/i386/pmap.c Wed Oct 28 12:10:01 2015 (r290101) @@ -1259,8 +1259,10 @@ pmap_invalidate_cache_range(vm_offset_t mfence(); } else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { +#ifdef DEV_APIC if (pmap_kextract(sva) == lapic_paddr) return; +#endif /* * Writes are ordered by CLFLUSH on Intel CPUs. */ From owner-svn-src-head@freebsd.org Wed Oct 28 12:30:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75103A20C66; Wed, 28 Oct 2015 12:30:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 321171617; Wed, 28 Oct 2015 12:30:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SCUU6E053916; Wed, 28 Oct 2015 12:30:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SCUU34053915; Wed, 28 Oct 2015 12:30:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510281230.t9SCUU34053915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 28 Oct 2015 12:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290102 - in head: . contrib/ipfilter contrib/llvm/lib/Target/Sparc/AsmParser contrib/llvm/lib/Target/Sparc/Disassembler contrib/llvm/lib/Target/Sparc/InstPrinter sys/amd64/include sys/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 12:30:31 -0000 Author: bapt Date: Wed Oct 28 12:30:29 2015 New Revision: 290102 URL: https://svnweb.freebsd.org/changeset/base/290102 Log: Merge mpsutil(8) branch mpsutil(8)/mprutil(8) are new utilities for managing LSI Fusion-MPT 2/3 controllers (mps(4) and mpr(4)) For now only informational commands have been implemented. This utility has been written by scottl@ [1] and polished by myself[2] Submitted by: scottl Discussed with: scottl Relnotes: yes Sponsored by: Netflix [1] Sponsored by: Gandi.net [2] Added: head/usr.sbin/mpsutil/ - copied from r290100, projects/mpsutil/usr.sbin/mpsutil/ Modified: Directory Properties: head/ (props changed) head/MAINTAINERS (props changed) head/cddl/ (props changed) head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/contrib/apr/ (props changed) head/contrib/binutils/ (props changed) head/contrib/bmake/ (props changed) head/contrib/compiler-rt/ (props changed) head/contrib/dma/ (props changed) head/contrib/dtc/ (props changed) head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/ar/ (props changed) head/contrib/elftoolchain/brandelf/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) head/contrib/expat/ (props changed) head/contrib/file/ (props changed) head/contrib/gcc/ (props changed) head/contrib/groff/ (props changed) head/contrib/ipfilter/ (props changed) head/contrib/ipfilter/ml_ipl.c (props changed) head/contrib/ipfilter/mlfk_ipl.c (props changed) head/contrib/ipfilter/mlh_rule.c (props changed) head/contrib/ipfilter/mli_ipl.c (props changed) head/contrib/ipfilter/mln_ipl.c (props changed) head/contrib/ipfilter/mls_ipl.c (props changed) head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libc++/ (props changed) head/contrib/libcxxrt/ (props changed) head/contrib/libucl/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp (props changed) head/contrib/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp (props changed) head/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp (props changed) head/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.h (props changed) head/contrib/llvm/projects/libunwind/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) head/contrib/llvm/tools/llvm-dwarfdump/ (props changed) head/contrib/llvm/tools/llvm-lto/ (props changed) head/contrib/mdocml/ (props changed) head/contrib/ncurses/ (props changed) head/contrib/netcat/ (props changed) head/contrib/ntp/ (props changed) head/contrib/openpam/ (props changed) head/contrib/pf/ (props changed) head/contrib/sendmail/ (props changed) head/contrib/serf/ (props changed) head/contrib/sqlite3/ (props changed) head/contrib/subversion/ (props changed) head/contrib/tcpdump/ (props changed) head/contrib/top/ (props changed) head/contrib/tzcode/stdtime/ (props changed) head/contrib/tzdata/ (props changed) head/contrib/unbound/ (props changed) head/contrib/wpa/ (props changed) head/crypto/openssh/ (props changed) head/crypto/openssl/ (props changed) head/gnu/lib/ (props changed) head/gnu/usr.bin/binutils/ (props changed) head/gnu/usr.bin/cc/cc_tools/ (props changed) head/gnu/usr.bin/gdb/ (props changed) head/include/ (props changed) head/lib/libc/ (props changed) head/lib/libc/stdtime/ (props changed) head/lib/libutil/ (props changed) head/lib/libvmmapi/ (props changed) head/lib/libz/ (props changed) head/sbin/ (props changed) head/sbin/dumpon/ (props changed) head/sbin/ipfw/ (props changed) head/share/ (props changed) head/share/man/man4/ (props changed) head/share/zoneinfo/ (props changed) head/sys/ (props changed) head/sys/amd64/include/vmm.h (props changed) head/sys/amd64/include/vmm_dev.h (props changed) head/sys/amd64/include/xen/ (props changed) head/sys/amd64/vmm/ (props changed) head/sys/boot/ (props changed) head/sys/boot/powerpc/kboot/ (props changed) head/sys/boot/powerpc/ofw/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) head/sys/conf/ (props changed) head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/ipfilter/ (props changed) head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c (props changed) head/sys/dev/hyperv/ (props changed) head/sys/modules/hyperv/ (props changed) head/targets/ (props changed) head/usr.bin/calendar/ (props changed) head/usr.bin/mkimg/ (props changed) head/usr.bin/procstat/ (props changed) head/usr.sbin/bhyve/ (props changed) head/usr.sbin/bhyvectl/ (props changed) head/usr.sbin/bhyveload/ (props changed) head/usr.sbin/jail/ (props changed) head/usr.sbin/ndiscvt/ (props changed) head/usr.sbin/rtadvctl/ (props changed) head/usr.sbin/rtadvd/ (props changed) head/usr.sbin/rtsold/ (props changed) head/usr.sbin/zic/ (props changed) From owner-svn-src-head@freebsd.org Wed Oct 28 12:31:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5F49A20CD0; Wed, 28 Oct 2015 12:31:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A28C01920; Wed, 28 Oct 2015 12:31:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SCVTPG055937; Wed, 28 Oct 2015 12:31:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SCVTva055936; Wed, 28 Oct 2015 12:31:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510281231.t9SCVTva055936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 28 Oct 2015 12:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290103 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 12:31:30 -0000 Author: bapt Date: Wed Oct 28 12:31:29 2015 New Revision: 290103 URL: https://svnweb.freebsd.org/changeset/base/290103 Log: Connect mpsutil(8) to the build Sponsored by: Gandi.net Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Oct 28 12:30:29 2015 (r290102) +++ head/usr.sbin/Makefile Wed Oct 28 12:31:29 2015 (r290103) @@ -45,6 +45,7 @@ SUBDIR= adduser \ mixer \ mlxcontrol \ mountd \ + mpsutil \ mptutil \ mtest \ ${_mtree} \ From owner-svn-src-head@freebsd.org Wed Oct 28 12:35:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38CAAA20DF2; Wed, 28 Oct 2015 12:35:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0234F1C1A; Wed, 28 Oct 2015 12:35:00 +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 t9SCZ0pn056832; Wed, 28 Oct 2015 12:35:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SCYxnj056822; Wed, 28 Oct 2015 12:34:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510281234.t9SCYxnj056822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 28 Oct 2015 12:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290104 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 12:35:01 -0000 Author: mav Date: Wed Oct 28 12:34:59 2015 New Revision: 290104 URL: https://svnweb.freebsd.org/changeset/base/290104 Log: Improve/fix loop scanning routine. For the most of chips (except anscient ones) port handlers have no relation to port IDs. In such situation old code scanning first 125 handlers was quite naive. Instead of doing that, send to chip single request to get full list of port handlers available on specific virtual port and scan only them. Old code had problems with case of several virtual ports enabled, when port handlers allocated from global address space could easily go above 125. This change was successfully tested on 23xx, 24xx and 25xx chips in loop mode with 4 virtual initiator ports, each seing 50 virtual target ports. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Wed Oct 28 12:31:29 2015 (r290103) +++ head/sys/dev/isp/isp.c Wed Oct 28 12:34:59 2015 (r290104) @@ -119,6 +119,7 @@ static int isp_plogx(ispsoftc_t *, int, static int isp_port_login(ispsoftc_t *, uint16_t, uint32_t); static int isp_port_logout(ispsoftc_t *, uint16_t, uint32_t); static int isp_getpdb(ispsoftc_t *, int, uint16_t, isp_pdb_t *, int); +static int isp_gethandles(ispsoftc_t *, int, uint16_t *, int *, int, int); static void isp_dump_chip_portdb(ispsoftc_t *, int, int); static uint64_t isp_get_wwn(ispsoftc_t *, int, int, int); static int isp_fclink_test(ispsoftc_t *, int, int); @@ -2587,7 +2588,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui if (dolock) { FC_SCRATCH_RELEASE(isp, chan); } - return (mbs.param[0]); + return (mbs.param[0] | (mbs.param[1] << 16)); } if (IS_24XX(isp)) { isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); @@ -2618,6 +2619,78 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui return (0); } +static int +isp_gethandles(ispsoftc_t *isp, int chan, uint16_t *handles, int *num, + int dolock, int loop) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + isp_pnhle_21xx_t el1, *elp1; + isp_pnhle_23xx_t el3, *elp3; + isp_pnhle_24xx_t el4, *elp4; + int i, j; + uint32_t p; + uint16_t h; + + MBSINIT(&mbs, MBOX_GET_ID_LIST, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR, 250000); + if (IS_24XX(isp)) { + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + mbs.param[8] = ISP_FC_SCRLEN; + mbs.param[9] = chan; + } else { + mbs.ibits = (1 << 1)|(1 << 2)|(1 << 3)|(1 << 6); + mbs.param[1] = DMA_WD1(fcp->isp_scdma); + mbs.param[2] = DMA_WD0(fcp->isp_scdma); + mbs.param[3] = DMA_WD3(fcp->isp_scdma); + mbs.param[6] = DMA_WD2(fcp->isp_scdma); + } + if (dolock) { + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (-1); + } + } + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, ISP_FC_SCRLEN, chan); + isp_mboxcmd(isp, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (dolock) { + FC_SCRATCH_RELEASE(isp, chan); + } + return (mbs.param[0] | (mbs.param[1] << 16)); + } + elp1 = fcp->isp_scratch; + elp3 = fcp->isp_scratch; + elp4 = fcp->isp_scratch; + for (i = 0, j = 0; i < mbs.param[1] && j < *num; i++) { + if (IS_24XX(isp)) { + isp_get_pnhle_24xx(isp, &elp4[i], &el4); + p = el4.pnhle_port_id_lo | + (el4.pnhle_port_id_hi << 16); + h = el4.pnhle_handle; + } else if (IS_23XX(isp)) { + isp_get_pnhle_23xx(isp, &elp3[i], &el3); + p = el3.pnhle_port_id_lo | + (el3.pnhle_port_id_hi << 16); + h = el3.pnhle_handle; + } else { /* 21xx */ + isp_get_pnhle_21xx(isp, &elp1[i], &el1); + p = el1.pnhle_port_id_lo | + ((el1.pnhle_port_id_hi_handle & 0xff) << 16); + h = el1.pnhle_port_id_hi_handle >> 8; + } + if (loop && (p >> 8) != (fcp->isp_portid >> 8)) + continue; + handles[j++] = h; + } + *num = j; + if (dolock) + FC_SCRATCH_RELEASE(isp, chan); + return (0); +} + static void isp_dump_chip_portdb(ispsoftc_t *isp, int chan, int dolock) { @@ -3106,79 +3179,68 @@ isp_scan_loop(ispsoftc_t *isp, int chan) { fcportdb_t *lp, tmp; fcparam *fcp = FCPARAM(isp, chan); - int i; + int i, idx, lim, r; isp_pdb_t pdb; - uint16_t handle, lim = 0; + uint16_t handles[LOCAL_LOOP_LIM]; + uint16_t handle; if (fcp->isp_fwstate < FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) { return (-1); } - if (fcp->isp_loopstate > LOOP_SCANNING_LOOP) { return (0); } - - /* - * Check our connection topology. - * - * If we're a public or private loop, we scan 0..125 as handle values. - * The firmware has (typically) peformed a PLOGI for us. We skip this - * step if we're a ISP_24XX in NP-IV mode. - * - * If we're a N-port connection, we treat this is a short loop (0..1). - */ - switch (fcp->isp_topo) { - case TOPO_NL_PORT: - lim = LOCAL_LOOP_LIM; - break; - case TOPO_FL_PORT: - if (IS_24XX(isp) && isp->isp_nchan > 1) { - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Skipping Local Loop Scan", chan); - fcp->isp_loopstate = LOOP_LSCAN_DONE; - return (0); - } - lim = LOCAL_LOOP_LIM; - break; - case TOPO_N_PORT: - lim = 2; - break; - default: - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d no loop topology to scan", chan); + if (fcp->isp_topo != TOPO_NL_PORT && fcp->isp_topo != TOPO_FL_PORT && + fcp->isp_topo != TOPO_N_PORT) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d no loop topology to scan", chan); fcp->isp_loopstate = LOOP_LSCAN_DONE; return (0); } fcp->isp_loopstate = LOOP_SCANNING_LOOP; - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop 0..%d", chan, lim-1); + lim = LOCAL_LOOP_LIM; + r = isp_gethandles(isp, chan, handles, &lim, 1, 1); + if (r != 0) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d getting list of handles failed with %x", chan, r); +fail: + ISP_MARK_PORTDB(isp, chan, 1); + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d FC scan loop DONE (bad)", chan); + return (-1); + } + + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop -- %d ports", + chan, lim); /* * Run through the list and get the port database info for each one. */ - for (handle = 0; handle < lim; handle++) { - int r; + for (idx = 0; idx < lim; idx++) { + handle = handles[idx]; + /* * Don't scan "special" ids. */ - if (handle >= FL_ID && handle <= SNS_ID) { - continue; - } if (ISP_CAP_2KLOGIN(isp)) { - if (handle >= NPH_RESERVED && handle <= NPH_IP_BCST) { + if (handle >= NPH_RESERVED - isp->isp_nchan) + continue; + } else { + if (handle >= FL_ID && handle <= SNS_ID) continue; - } } + /* * In older cards with older f/w GET_PORT_DATABASE has been * known to hang. This trick gets around that problem. */ if (IS_2100(isp) || IS_2200(isp)) { uint64_t node_wwn = isp_get_wwn(isp, chan, handle, 1); - if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) { - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); - return (-1); - } + if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) + goto fail; if (node_wwn == INI_NONE) { continue; } @@ -3192,19 +3254,13 @@ isp_scan_loop(ispsoftc_t *isp, int chan) isp_prt(isp, ISP_LOGDEBUG1, "Chan %d FC scan loop handle %d returned %x", chan, handle, r); - if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) { - ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); - return (-1); - } + if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) + goto fail; continue; } - if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) { - ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); - return (-1); - } + if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) + goto fail; /* * On *very* old 2100 firmware we would end up sometimes @@ -3214,10 +3270,9 @@ isp_scan_loop(ispsoftc_t *isp, int chan) */ if (IS_2100(isp) && pdb.handle != handle) { isp_prt(isp, ISP_LOGWARN, - "Chan %d cannot synchronize port database", chan); - ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); - return (-1); + "Chan %d getpdb() returned wrong handle %x != %x", + chan, pdb.handle, handle); + goto fail; } /* @@ -3273,9 +3328,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) "Chan %d [%d] not probational/zombie (0x%x)", chan, FC_PORTDB_TGT(isp, chan, lp), lp->state); isp_dump_portdb(isp, chan); - ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); - return (-1); + goto fail; } /* @@ -3561,7 +3614,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha loopid = FL_ID; } r = isp_getpdb(isp, chan, loopid, &pdb, 0); - if (r == MBOX_NOT_LOGGED_IN) { + if ((r & 0xffff) == MBOX_NOT_LOGGED_IN) { isp_dump_chip_portdb(isp, chan, 0); } if (r) { @@ -7096,7 +7149,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x07, 0x03), /* 0x1d: MBOX_GET_DEV_QUEUE_STATUS */ ISP_FC_OPMAP(0x00, 0x00), /* 0x1e: */ ISP_FC_OPMAP(0x01, 0x07), /* 0x1f: MBOX_GET_FIRMWARE_STATUS */ - ISP_FC_OPMAP_HALF(0x2, 0x01, 0x0, 0xcf), /* 0x20: MBOX_GET_LOOP_ID */ + ISP_FC_OPMAP_HALF(0x2, 0x01, 0x7e, 0xcf), /* 0x20: MBOX_GET_LOOP_ID */ ISP_FC_OPMAP(0x00, 0x00), /* 0x21: */ ISP_FC_OPMAP(0x01, 0x07), /* 0x22: MBOX_GET_RETRY_COUNT */ ISP_FC_OPMAP(0x00, 0x00), /* 0x23: */ @@ -7181,14 +7234,14 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x0f, 0x0f), /* 0x72: MBOX_INIT_LIP_LOGIN */ ISP_FC_OPMAP(0x00, 0x00), /* 0x73: */ ISP_FC_OPMAP(0x07, 0x01), /* 0x74: LOGIN LOOP PORT */ - ISP_FC_OPMAP(0xcf, 0x03), /* 0x75: GET PORT/NODE NAME LIST */ + ISP_FC_OPMAP_HALF(0x03, 0xcf, 0x00, 0x07), /* 0x75: GET PORT/NODE NAME LIST */ ISP_FC_OPMAP(0x4f, 0x01), /* 0x76: SET VENDOR ID */ ISP_FC_OPMAP(0xcd, 0x01), /* 0x77: INITIALIZE IP MAILBOX */ ISP_FC_OPMAP(0x00, 0x00), /* 0x78: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x79: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x7a: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x7b: */ - ISP_FC_OPMAP(0x4f, 0x03), /* 0x7c: Get ID List */ + ISP_FC_OPMAP_HALF(0x03, 0x4f, 0x00, 0x07), /* 0x7c: Get ID List */ ISP_FC_OPMAP(0xcf, 0x01), /* 0x7d: SEND LFA */ ISP_FC_OPMAP(0x0f, 0x01) /* 0x7e: LUN RESET */ }; Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Wed Oct 28 12:31:29 2015 (r290103) +++ head/sys/dev/isp/isp_library.c Wed Oct 28 12:34:59 2015 (r290104) @@ -1646,6 +1646,44 @@ isp_get_pdb_24xx(ispsoftc_t *isp, isp_pd } } +void +isp_get_pnhle_21xx(ispsoftc_t *isp, isp_pnhle_21xx_t *src, isp_pnhle_21xx_t *dst) +{ + + ISP_IOXGET_16(isp, &src->pnhle_port_id_lo, dst->pnhle_port_id_lo); + ISP_IOXGET_16(isp, &src->pnhle_port_id_hi_handle, dst->pnhle_port_id_hi_handle); +} + +void +isp_get_pnhle_23xx(ispsoftc_t *isp, isp_pnhle_23xx_t *src, isp_pnhle_23xx_t *dst) +{ + + ISP_IOXGET_16(isp, &src->pnhle_port_id_lo, dst->pnhle_port_id_lo); + ISP_IOXGET_16(isp, &src->pnhle_port_id_hi, dst->pnhle_port_id_hi); + ISP_IOXGET_16(isp, &src->pnhle_handle, dst->pnhle_handle); +} + +void +isp_get_pnhle_24xx(ispsoftc_t *isp, isp_pnhle_24xx_t *src, isp_pnhle_24xx_t *dst) +{ + + ISP_IOXGET_16(isp, &src->pnhle_port_id_lo, dst->pnhle_port_id_lo); + ISP_IOXGET_16(isp, &src->pnhle_port_id_hi, dst->pnhle_port_id_hi); + ISP_IOXGET_16(isp, &src->pnhle_handle, dst->pnhle_handle); + ISP_IOXGET_16(isp, &src->pnhle_reserved, dst->pnhle_reserved); +} + +void +isp_get_pnnle(ispsoftc_t *isp, isp_pnnle_t *src, isp_pnnle_t *dst) +{ + int i; + + for (i = 0; i < 8; i++) + ISP_IOXGET_8(isp, &src->pnnle_name[i], dst->pnnle_name[i]); + ISP_IOXGET_16(isp, &src->pnnle_handle, dst->pnnle_handle); + ISP_IOXGET_16(isp, &src->pnnle_reserved, dst->pnnle_reserved); +} + /* * PLOGI/LOGO IOCB canonicalization */ Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Wed Oct 28 12:31:29 2015 (r290103) +++ head/sys/dev/isp/isp_library.h Wed Oct 28 12:34:59 2015 (r290104) @@ -123,6 +123,10 @@ void isp_put_vp_modify(ispsoftc_t *, vp_ void isp_get_vp_modify(ispsoftc_t *, vp_modify_t *, vp_modify_t *); void isp_get_pdb_21xx(ispsoftc_t *, isp_pdb_21xx_t *, isp_pdb_21xx_t *); void isp_get_pdb_24xx(ispsoftc_t *, isp_pdb_24xx_t *, isp_pdb_24xx_t *); +void isp_get_pnhle_21xx(ispsoftc_t *, isp_pnhle_21xx_t *, isp_pnhle_21xx_t *); +void isp_get_pnhle_23xx(ispsoftc_t *, isp_pnhle_23xx_t *, isp_pnhle_23xx_t *); +void isp_get_pnhle_24xx(ispsoftc_t *, isp_pnhle_24xx_t *, isp_pnhle_24xx_t *); +void isp_get_pnnle(ispsoftc_t *, isp_pnnle_t *, isp_pnnle_t *); void isp_get_ridacq(ispsoftc_t *, isp_ridacq_t *, isp_ridacq_t *); void isp_get_plogx(ispsoftc_t *, isp_plogx_t *, isp_plogx_t *); void isp_put_plogx(ispsoftc_t *, isp_plogx_t *, isp_plogx_t *); Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Wed Oct 28 12:31:29 2015 (r290103) +++ head/sys/dev/isp/ispmbox.h Wed Oct 28 12:34:59 2015 (r290104) @@ -156,6 +156,8 @@ #define MBOX_SEND_CHANGE_REQUEST 0x0070 #define MBOX_FABRIC_LOGOUT 0x0071 #define MBOX_INIT_LIP_LOGIN 0x0072 +#define MBOX_GET_PORT_NODE_NAME_LIST 0x0075 +#define MBOX_GET_ID_LIST 0x007C #define MBOX_LUN_RESET 0x007E #define MBOX_DRIVER_HEARTBEAT 0x005B @@ -1342,6 +1344,40 @@ typedef struct { } isp_pdb_t; /* + * Port/Node Name List Element + */ +typedef struct { + uint8_t pnnle_name[8]; + uint16_t pnnle_handle; + uint16_t pnnle_reserved; +} isp_pnnle_t; + +#define PNNL_OPTIONS_NODE_NAMES (1<<0) +#define PNNL_OPTIONS_PORT_DATA (1<<2) +#define PNNL_OPTIONS_INITIATORS (1<<3) + +/* + * Port and N-Port Handle List Element + */ +typedef struct { + uint16_t pnhle_port_id_lo; + uint16_t pnhle_port_id_hi_handle; +} isp_pnhle_21xx_t; + +typedef struct { + uint16_t pnhle_port_id_lo; + uint16_t pnhle_port_id_hi; + uint16_t pnhle_handle; +} isp_pnhle_23xx_t; + +typedef struct { + uint16_t pnhle_port_id_lo; + uint16_t pnhle_port_id_hi; + uint16_t pnhle_handle; + uint16_t pnhle_reserved; +} isp_pnhle_24xx_t; + +/* * Port Database Changed Async Event information for 24XX cards */ #define PDB24XX_AE_OK 0x00 From owner-svn-src-head@freebsd.org Wed Oct 28 13:07:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41BAFA1F6D0; Wed, 28 Oct 2015 13:07:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D9F110F; Wed, 28 Oct 2015 13:07:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SD7vS6067078; Wed, 28 Oct 2015 13:07:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SD7vhm067077; Wed, 28 Oct 2015 13:07:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201510281307.t9SD7vhm067077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 28 Oct 2015 13:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290105 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 13:07:58 -0000 Author: andrew Date: Wed Oct 28 13:07:56 2015 New Revision: 290105 URL: https://svnweb.freebsd.org/changeset/base/290105 Log: Start to remove support for the XScale i80321. As far as I can tell nobody uses this which makes it difficult to support. Deleted: head/sys/arm/conf/EP80219 head/sys/arm/conf/IQ31244 Modified: head/sys/arm/conf/NOTES Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Wed Oct 28 12:34:59 2015 (r290104) +++ head/sys/arm/conf/NOTES Wed Oct 28 13:07:56 2015 (r290105) @@ -19,10 +19,6 @@ files "../mv/discovery/files.db78xxx" files "../mv/kirkwood/files.kirkwood" files "../mv/orion/files.db88f5xxx" files "../mv/orion/files.ts7800" -files "../xscale/i80321/files.ep80219" -files "../xscale/i80321/files.i80219" -files "../xscale/i80321/files.i80321" -files "../xscale/i80321/files.iq31244" files "../xscale/i8134x/files.crb" files "../xscale/i8134x/files.i81342" files "../xscale/ixp425/files.avila" From owner-svn-src-head@freebsd.org Wed Oct 28 13:14:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BED7AA1F9DE; Wed, 28 Oct 2015 13:14:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FAE619B0; Wed, 28 Oct 2015 13:14:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SDEGj9069855; Wed, 28 Oct 2015 13:14:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SDEGUA069854; Wed, 28 Oct 2015 13:14:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201510281314.t9SDEGUA069854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 28 Oct 2015 13:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290106 - head/sys/arm/samsung/s3c2xx0 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 13:14:17 -0000 Author: andrew Date: Wed Oct 28 13:14:16 2015 New Revision: 290106 URL: https://svnweb.freebsd.org/changeset/base/290106 Log: Remove the s3c2xx0 code, it's no longer used. As far as I know I as the main user of this code, however I haven't used it in over two years, and don't expect to in the future. Deleted: head/sys/arm/samsung/s3c2xx0/ From owner-svn-src-head@freebsd.org Wed Oct 28 14:40:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16615A201C2; Wed, 28 Oct 2015 14:40:04 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 CCBEF1034; Wed, 28 Oct 2015 14:40:03 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SEe27A093924; Wed, 28 Oct 2015 14:40:02 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SEe2PR093917; Wed, 28 Oct 2015 14:40:02 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201510281440.t9SEe2PR093917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 28 Oct 2015 14:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290110 - in head: include lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 14:40:04 -0000 Author: ache Date: Wed Oct 28 14:40:02 2015 New Revision: 290110 URL: https://svnweb.freebsd.org/changeset/base/290110 Log: Add _flags2 per jhb@ suggestion since no room left in _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. MFC after: 3 weeks Modified: head/include/stdio.h head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/findfp.c head/lib/libc/stdio/fopen.c head/lib/libc/stdio/freopen.c head/lib/libc/stdio/ftell.c head/lib/libc/stdio/stdio.c Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Wed Oct 28 14:21:53 2015 (r290109) +++ head/include/stdio.h Wed Oct 28 14:40:02 2015 (r290110) @@ -144,6 +144,7 @@ struct __sFILE { int _fl_count; /* recursive lock count */ int _orientation; /* orientation for fwide() */ __mbstate_t _mbstate; /* multibyte conversion state */ + int _flags2; /* additional flags */ }; #ifndef _STDFILE_DECLARED #define _STDFILE_DECLARED @@ -176,6 +177,8 @@ __END_DECLS #define __SALC 0x4000 /* allocate string space dynamically */ #define __SIGN 0x8000 /* ignore this file in _fwalk */ +#define __S2OAP 0x0001 /* O_APPEND mode is set */ + /* * The following three definitions are for ANSI C, which took them * from System V, which brilliantly took internal interface macros and Modified: head/lib/libc/stdio/fdopen.c ============================================================================== --- head/lib/libc/stdio/fdopen.c Wed Oct 28 14:21:53 2015 (r290109) +++ head/lib/libc/stdio/fdopen.c Wed Oct 28 14:40:02 2015 (r290110) @@ -91,9 +91,8 @@ fdopen(int fd, const char *mode) * O_APPEND bit set, assert __SAPP so that __swrite() caller * will _sseek() to the end before write. */ - /* XXX: Reuse __SALC for O_APPEND. */ if (fdflags & O_APPEND) - fp->_flags |= __SALC; + fp->_flags2 |= __S2OAP; else if (oflags & O_APPEND) fp->_flags |= __SAPP; fp->_file = fd; Modified: head/lib/libc/stdio/findfp.c ============================================================================== --- head/lib/libc/stdio/findfp.c Wed Oct 28 14:21:53 2015 (r290109) +++ head/lib/libc/stdio/findfp.c Wed Oct 28 14:40:02 2015 (r290110) @@ -155,6 +155,7 @@ found: /* fp->_fl_mutex = NULL; */ /* once set always set (reused) */ fp->_orientation = 0; memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + fp->_flags2 = 0; return (fp); } Modified: head/lib/libc/stdio/fopen.c ============================================================================== --- head/lib/libc/stdio/fopen.c Wed Oct 28 14:21:53 2015 (r290109) +++ head/lib/libc/stdio/fopen.c Wed Oct 28 14:40:02 2015 (r290110) @@ -92,8 +92,7 @@ fopen(const char * __restrict file, cons * fseek and ftell.) */ if (oflags & O_APPEND) { - /* XXX: Reuse __SALC for O_APPEND. */ - fp->_flags |= __SALC; + fp->_flags2 |= __S2OAP; (void)_sseek(fp, (fpos_t)0, SEEK_END); } return (fp); Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Wed Oct 28 14:21:53 2015 (r290109) +++ head/lib/libc/stdio/freopen.c Wed Oct 28 14:40:02 2015 (r290110) @@ -187,6 +187,7 @@ finish: fp->_lb._size = 0; fp->_orientation = 0; memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + fp->_flags2 = 0; if (f < 0) { /* did not get it after all */ if (isopen) @@ -241,8 +242,7 @@ finish: * fseek and ftell.) */ if (oflags & O_APPEND) { - /* XXX: Reuse __SALC for O_APPEND. */ - fp->_flags |= __SALC; + fp->_flags2 |= __S2OAP; (void) _sseek(fp, (fpos_t)0, SEEK_END); } FUNLOCKFILE(fp); Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Wed Oct 28 14:21:53 2015 (r290109) +++ head/lib/libc/stdio/ftell.c Wed Oct 28 14:40:02 2015 (r290110) @@ -119,8 +119,7 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { - /* XXX: Reuse __SALC for O_APPEND. */ - if (fp->_flags & (__SAPP|__SALC)) { + if ((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP)) { int serrno = errno; errno = 0; Modified: head/lib/libc/stdio/stdio.c ============================================================================== --- head/lib/libc/stdio/stdio.c Wed Oct 28 14:21:53 2015 (r290109) +++ head/lib/libc/stdio/stdio.c Wed Oct 28 14:40:02 2015 (r290110) @@ -117,8 +117,7 @@ _swrite(FILE *fp, char const *buf, int n ret = (*fp->_write)(fp->_cookie, buf, n); /* __SOFF removed even on success in case O_APPEND mode is set. */ if (ret >= 0) { - /* XXX: Reuse __SALC for O_APPEND. */ - if ((fp->_flags & __SOFF) && !(fp->_flags & __SALC) && + if ((fp->_flags & __SOFF) && !(fp->_flags2 & __S2OAP) && fp->_offset <= OFF_MAX - ret) fp->_offset += ret; else From owner-svn-src-head@freebsd.org Wed Oct 28 15:00:22 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D90C1A20710; Wed, 28 Oct 2015 15:00:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A34BE10F3; Wed, 28 Oct 2015 15:00:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SF0LAj099736; Wed, 28 Oct 2015 15:00:21 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SF0L9Q099735; Wed, 28 Oct 2015 15:00:21 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201510281500.t9SF0L9Q099735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 28 Oct 2015 15:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290112 - head/tools/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 15:00:22 -0000 Author: vangyzen Date: Wed Oct 28 15:00:21 2015 New Revision: 290112 URL: https://svnweb.freebsd.org/changeset/base/290112 Log: Fix spelling and grammer in tools/test/README. Reviewed by: gnn Modified: head/tools/test/README Modified: head/tools/test/README ============================================================================== --- head/tools/test/README Wed Oct 28 14:48:32 2015 (r290111) +++ head/tools/test/README Wed Oct 28 15:00:21 2015 (r290112) @@ -1,6 +1,6 @@ $FreeBSD$ -This directory is for standalone test programs, for the FreeBSD +This directory is for standalone test programs. For the FreeBSD Test Suite, which uses Kyua, please see /usr/src/tests/ A test program is one that exercises a particular bit of the system @@ -17,8 +17,8 @@ net A set of generic test programs for netfibs Programs to test multi-FIB network stacks. posixshm A program to test POSIX shared memory. ppsapi Test 1 Pulse Per Second (1PPS) input for time control. -pthread_vfork Chack that vfork and pthreads work together. +pthread_vfork Check that vfork and pthreads work together. ptrace Verify that ptrace works with syscalls, vfork etc. sort Tests for the sort command, including a full regression. testfloat Programs to test floating-point implementations -upsdl Test of mmap funcationality. +upsdl Test of mmap functionality. From owner-svn-src-head@freebsd.org Wed Oct 28 15:33:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DF08A20DDE for ; Wed, 28 Oct 2015 15:33:39 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0065.outbound.protection.outlook.com [157.56.111.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B387A1238 for ; Wed, 28 Oct 2015 15:33:37 +0000 (UTC) (envelope-from rpokala@panasas.com) Received: from CY1PR08MB1803.namprd08.prod.outlook.com (10.162.218.25) by CY1PR08MB1804.namprd08.prod.outlook.com (10.162.218.26) with Microsoft SMTP Server (TLS) id 15.1.306.13; Wed, 28 Oct 2015 15:17:33 +0000 Received: from CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) by CY1PR08MB1803.namprd08.prod.outlook.com ([10.162.218.25]) with mapi id 15.01.0306.003; Wed, 28 Oct 2015 15:17:33 +0000 From: "Pokala, Ravi" To: "svn-src-head@freebsd.org" Subject: Re: svn-src-head Digest, Vol 141, Issue 28 Thread-Topic: svn-src-head Digest, Vol 141, Issue 28 Thread-Index: AQHREXg2fv1QKbl7lkqqo+e8V2MILZ6Ajz6A Date: Wed, 28 Oct 2015 15:17:32 +0000 Message-ID: <3128B445-856B-45E9-B77B-5F0510A9E0D6@panasas.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/0.0.0.151008 authentication-results: spf=none (sender IP is ) smtp.mailfrom=rpokala@panasas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [24.6.178.251] x-microsoft-exchange-diagnostics: 1; CY1PR08MB1804; 5:DTU443uvH1f5hnvAWbxPzFses6CZ4bWxPnztKUjD3M3CrugNI/w1qI8vHi0h0xpfppLwS0yhTrrO/wSh9zsmHsGXL3yuFr677LXC0kAKMmNqg1ko/f580DSv41mao93Ex9qYul2V5s8n2yvLhVXDLQ==; 24:UQcbtubQit35M+YUl4F7sqPyi0utyAvTftu/FrDR5uwqlUATa8JweRCkLLtZbp2AQpJtggorZtG081g8qGoRSbsfKlZKAsC3ycFav3OrHbk=; 20:z9uU5aov8Yq4hniZlDxIkFRcol5ZUF8magi7uB+UinXwU454v4ud2sRBr6CQo5wM8iYN5IGAjXxqXlU+QORB/Q== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR08MB1804; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(3002001)(10201501046)(102215026); SRVR:CY1PR08MB1804; BCL:0; PCL:0; RULEID:; SRVR:CY1PR08MB1804; x-forefront-prvs: 0743E8D0A6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(13464003)(18543002)(164054003)(5403001)(10533003)(2501003)(101416001)(36756003)(2950100001)(86362001)(450100001)(189998001)(5008740100001)(15975445007)(102836002)(81156007)(5002640100001)(10400500002)(77096005)(5001960100002)(76176999)(122556002)(107886002)(54356999)(97736004)(110136002)(82746002)(87936001)(40100003)(83506001)(5890100001)(230783001)(106116001)(11100500001)(106356001)(2351001)(33656002)(19580395003)(4001350100001)(105586002)(5007970100001)(50986999)(83716003)(92566002)(66066001)(5004730100002)(99286002)(19580405001)(2900100001)(104396002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR08MB1804; H:CY1PR08MB1803.namprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: panasas.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <7889DA3FAEA2F14BA13E870873B8F485@namprd08.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: panasas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2015 15:17:32.6556 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: acf01c9d-c699-42af-bdbb-44bf582e60b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR08MB1804 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 15:33:39 -0000 SGkgQWRyaWFuLA0KDQpUaGlzOg0KDQorI2lmZGVmCUFSR0VfREVCVUcNCisJZm9yIChpID0gMDsg aSA8IDMyOyBpKyspIHsNCisJCWlmIChzdGF0dXMgJiAoMSA8PCBpKSkgew0KKwkJCXNjLT5pbnRy X3N0YXRzLmNvdW50WzEgPDwgaV0rKzsNCisJCX0NCisJfQ0KKyNlbmRpZg0KDQpsb29rcyB3cm9u Zy4NCg0KSWYgInN0YXR1cyIgaGFzIHZhbHVlIDB4MDA4MCwgdGhlbiB0aGUgYWJvdmUgd2lsbCB0 cnkgdG8gaW5jcmVtZW50IGluZGV4IDEyOCwgd2hpY2ggaXMgcGFzdCB0aGUgZW5kIG9mIHRoZSBh cnJheS4gSSB0aGluayB5b3UganVzdCBtZWFudCB0aGUgaW5kZXggdG8gYmUgImkiLCBub3QgIjEg PDwgaSIuDQoNClRoYW5rcywNCg0KUmF2aQ0KDQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0t DQoNCj5EYXRlOiBXZWQsIDI4IE9jdCAyMDE1IDA1OjExOjA2ICswMDAwIChVVEMpDQo+RnJvbTog QWRyaWFuIENoYWRkIDxhZHJpYW5ARnJlZUJTRC5vcmc+DQo+VG86IHNyYy1jb21taXR0ZXJzQGZy ZWVic2Qub3JnLCBzdm4tc3JjLWFsbEBmcmVlYnNkLm9yZywNCj4Jc3ZuLXNyYy1oZWFkQGZyZWVi c2Qub3JnDQo+U3ViamVjdDogc3ZuIGNvbW1pdDogcjI5MDA5MCAtIGhlYWQvc3lzL21pcHMvYXRo ZXJvcw0KPk1lc3NhZ2UtSUQ6IDwyMDE1MTAyODA1MTEudDlTNUI2ZXMwMDk1MDZAcmVwby5mcmVl YnNkLm9yZz4NCj5Db250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgNCj4NCj5B dXRob3I6IGFkcmlhbg0KPkRhdGU6IFdlZCBPY3QgMjggMDU6MTE6MDYgMjAxNQ0KPk5ldyBSZXZp c2lvbjogMjkwMDkwDQo+VVJMOiBodHRwczovL3N2bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQv YmFzZS8yOTAwOTANCj4NCj5Mb2c6DQo+ICBBZGQgc29tZSBkZWJ1Z2dpbmcgY29kZSAodW5kZXIg QVJHRV9ERUJVRykgdGhhdCBjb3VudHMgZWFjaCBpbnRlcnJ1cHQgc291cmNlLg0KPiAgDQo+ICBU aGlzIHNob3VsZCBtYWtlIGl0IGVhc2llciB0byB0cmFjayBkb3duIGludGVycnVwdCBzdG9ybXMg ZnJvbSBhcmdlLg0KPiAgDQo+ICBUZXN0ZWQ6DQo+ICANCj4gICogQVAxMzUgKFFDQTk1NXgpIFNv QyAtIGRlZmF1bHRzIHRvIEFSR0VfREVCVUcgZW5hYmxlZA0KPiAgKiBDYXJhbWJvbGEyIChBUjkz MzEgU29DKSAtIGRlZmF1bHRzIHRvIEFSR0VfREVCVUcgZGlzYWJsZWQNCj4NCj5Nb2RpZmllZDoN Cj4gIGhlYWQvc3lzL21pcHMvYXRoZXJvcy9pZl9hcmdlLmMNCj4gIGhlYWQvc3lzL21pcHMvYXRo ZXJvcy9pZl9hcmdldmFyLmgNCj4NCj5Nb2RpZmllZDogaGVhZC9zeXMvbWlwcy9hdGhlcm9zL2lm X2FyZ2UuYw0KPj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPi0tLSBoZWFkL3N5cy9taXBzL2F0aGVy b3MvaWZfYXJnZS5jCVdlZCBPY3QgMjggMDM6NDM6MjQgMjAxNQkocjI5MDA4OSkNCj4rKysgaGVh ZC9zeXMvbWlwcy9hdGhlcm9zL2lmX2FyZ2UuYwlXZWQgT2N0IDI4IDA1OjExOjA2IDIwMTUJKHIy OTAwOTApDQo+QEAgLTI3Nyw2ICsyNzcsMjggQEAgYXJnZV9wcm9iZShkZXZpY2VfdCBkZXYpDQo+ IAlyZXR1cm4gKEJVU19QUk9CRV9OT1dJTERDQVJEKTsNCj4gfQ0KPiANCj4rI2lmZGVmCUFSR0Vf REVCVUcNCj4rc3RhdGljIHZvaWQNCj4rYXJnZV9hdHRhY2hfaW50cl9zeXNjdGwoZGV2aWNlX3Qg ZGV2LCBzdHJ1Y3Qgc3lzY3RsX29pZF9saXN0ICpwYXJlbnQpDQo+K3sNCj4rCXN0cnVjdCBhcmdl X3NvZnRjICpzYyA9IGRldmljZV9nZXRfc29mdGMoZGV2KTsNCj4rCXN0cnVjdCBzeXNjdGxfY3R4 X2xpc3QgKmN0eCA9IGRldmljZV9nZXRfc3lzY3RsX2N0eChkZXYpOw0KPisJc3RydWN0IHN5c2N0 bF9vaWQgKnRyZWUgPSBkZXZpY2VfZ2V0X3N5c2N0bF90cmVlKGRldik7DQo+KwlzdHJ1Y3Qgc3lz Y3RsX29pZF9saXN0ICpjaGlsZCA9IFNZU0NUTF9DSElMRFJFTih0cmVlKTsNCj4rCWNoYXIgc25b OF07DQo+KwlpbnQgaTsNCj4rDQo+Kwl0cmVlID0gU1lTQ1RMX0FERF9OT0RFKGN0eCwgcGFyZW50 LCBPSURfQVVUTywgImludHIiLA0KPisJICAgIENUTEZMQUdfUkQsIE5VTEwsICJJbnRlcnJ1cHQg c3RhdGlzdGljcyIpOw0KPisJY2hpbGQgPSBTWVNDVExfQ0hJTERSRU4odHJlZSk7DQo+Kwlmb3Ig KGkgPSAwOyBpIDwgMzI7IGkrKykgew0KPisJCXNucHJpbnRmKHNuLCBzaXplb2Yoc24pLCAiJWQi LCBpKTsNCj4rCQlTWVNDVExfQUREX1VJTlQoY3R4LCBjaGlsZCwgT0lEX0FVVE8sIHNuLCBDVExG TEFHX1JELA0KPisJCSAgICAmc2MtPmludHJfc3RhdHMuY291bnRbaV0sIDAsICIiKTsNCj4rCX0N Cj4rfQ0KPisjZW5kaWYNCj4rDQo+IHN0YXRpYyB2b2lkDQo+IGFyZ2VfYXR0YWNoX3N5c2N0bChk ZXZpY2VfdCBkZXYpDQo+IHsNCj5AQCAtMjg4LDYgKzMxMCw3IEBAIGFyZ2VfYXR0YWNoX3N5c2N0 bChkZXZpY2VfdCBkZXYpDQo+IAlTWVNDVExfQUREX0lOVChjdHgsIFNZU0NUTF9DSElMRFJFTih0 cmVlKSwgT0lEX0FVVE8sDQo+IAkJImRlYnVnIiwgQ1RMRkxBR19SVywgJnNjLT5hcmdlX2RlYnVn LCAwLA0KPiAJCSJhcmdlIGludGVyZmFjZSBkZWJ1Z2dpbmcgZmxhZ3MiKTsNCj4rCWFyZ2VfYXR0 YWNoX2ludHJfc3lzY3RsKGRldiwgU1lTQ1RMX0NISUxEUkVOKHRyZWUpKTsNCj4gI2VuZGlmDQo+ IA0KPiAJU1lTQ1RMX0FERF9VSU5UKGN0eCwgU1lTQ1RMX0NISUxEUkVOKHRyZWUpLCBPSURfQVVU TywNCj5AQCAtMjQ0MCw2ICsyNDYzLDkgQEAgYXJnZV9pbnRyKHZvaWQgKmFyZykNCj4gCXN0cnVj dCBhcmdlX3NvZnRjCSpzYyA9IGFyZzsNCj4gCXVpbnQzMl90CQlzdGF0dXM7DQo+IAlzdHJ1Y3Qg aWZuZXQJCSppZnAgPSBzYy0+YXJnZV9pZnA7DQo+KyNpZmRlZglBUkdFX0RFQlVHDQo+KwlpbnQg aTsNCj4rI2VuZGlmDQo+IA0KPiAJc3RhdHVzID0gQVJHRV9SRUFEKHNjLCBBUjcxWFhfRE1BX0lO VFJfU1RBVFVTKTsNCj4gCXN0YXR1cyB8PSBzYy0+YXJnZV9pbnRyX3N0YXR1czsNCj5AQCAtMjQ1 Niw2ICsyNDgyLDE0IEBAIGFyZ2VfaW50cih2b2lkICphcmcpDQo+IAkJcmV0dXJuOw0KPiAJfQ0K PiANCj4rI2lmZGVmCUFSR0VfREVCVUcNCj4rCWZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKSB7DQo+ KwkJaWYgKHN0YXR1cyAmICgxIDw8IGkpKSB7DQo+KwkJCXNjLT5pbnRyX3N0YXRzLmNvdW50WzEg PDwgaV0rKzsNCj4rCQl9DQo+Kwl9DQo+KyNlbmRpZg0KPisNCj4gCWlmIChzdGF0dXMgJiBETUFf SU5UUl9SWF9CVVNfRVJST1IpIHsNCj4gCQlBUkdFX1dSSVRFKHNjLCBBUjcxWFhfRE1BX1JYX1NU QVRVUywgRE1BX1JYX1NUQVRVU19CVVNfRVJST1IpOw0KPiAJCWRldmljZV9wcmludGYoc2MtPmFy Z2VfZGV2LCAiUlggYnVzIGVycm9yIik7DQo+DQo+TW9kaWZpZWQ6IGhlYWQvc3lzL21pcHMvYXRo ZXJvcy9pZl9hcmdldmFyLmgNCj49PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4tLS0gaGVhZC9zeXMv bWlwcy9hdGhlcm9zL2lmX2FyZ2V2YXIuaAlXZWQgT2N0IDI4IDAzOjQzOjI0IDIwMTUJKHIyOTAw ODkpDQo+KysrIGhlYWQvc3lzL21pcHMvYXRoZXJvcy9pZl9hcmdldmFyLmgJV2VkIE9jdCAyOCAw NToxMTowNiAyMDE1CShyMjkwMDkwKQ0KPkBAIC0yMTQsNiArMjE0LDkgQEAgc3RydWN0IGFyZ2Vf c29mdGMgew0KPiAJCXVpbnQzMl90CWludHJfc3RyYXkyOw0KPiAJCXVpbnQzMl90CWludHJfb2s7 DQo+IAl9IHN0YXRzOw0KPisJc3RydWN0IHsNCj4rCQl1aW50MzJfdAljb3VudFszMl07DQo+Kwl9 IGludHJfc3RhdHM7DQo+IH07DQo+IA0KPiAjZW5kaWYgLyogX19JRl9BUkdFVkFSX0hfXyAqLw0K Pg0KPg0KPi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0K From owner-svn-src-head@freebsd.org Wed Oct 28 15:52:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E1A9A1F1BD; Wed, 28 Oct 2015 15:52:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 119471E5B; Wed, 28 Oct 2015 15:52:18 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.home.us.delphij.net (unknown [IPv6:2601:646:8f00:8a91:205f:4ab:4288:f303]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 08A062A70D; Wed, 28 Oct 2015 08:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1446047538; x=1446061938; bh=1jB9U4vfW0nSSZpkFtrDa660MCOor+igYaxuikv5uKQ=; h=Subject:To:References:From:Date:In-Reply-To; b=dL76xjSYkz3wEf9d4HLAQDPy6HrCHGYZTsfwEzk/zFWkB+ItbbO11g4F3+UuQ6F4T bKu/w3aMAZj0+3dSG8zgACQ/GBVzW4TtDECicHeuoPj0Stu0SbS5810XV55yegYL+4 zVWY119V65F6InVLS0X1l/0gG5SnTcxEZKWr6KG0= Subject: Re: svn commit: r290110 - in head: include lib/libc/stdio To: "Andrey A. Chernov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510281440.t9SEe2PR093917@repo.freebsd.org> From: Xin Li Message-ID: <5630EF2F.5080102@delphij.net> Date: Wed, 28 Oct 2015 08:52:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510281440.t9SEe2PR093917@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tS1rxd4C4OVPBDUni3BsHs6pF4nWkJThB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 15:52:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tS1rxd4C4OVPBDUni3BsHs6pF4nWkJThB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/28/15 07:40, Andrey A. Chernov wrote: > Author: ache > Date: Wed Oct 28 14:40:02 2015 > New Revision: 290110 > URL: https://svnweb.freebsd.org/changeset/base/290110 >=20 > Log: > Add _flags2 per jhb@ suggestion since no room left in _flags. > Rewrite O_APPEND flag checking using new __S2OAP flag. Is this ABI-safe? (I was somewhat surprised that struct FILE is not opaque, which seems to be unavoidable because some methods are traditionally macros that have direct access to the members; the addition is done in the end of the structure so it looks like the change is safe). Cheers, --tS1rxd4C4OVPBDUni3BsHs6pF4nWkJThB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJWMO8zAAoJEJW2GBstM+nsNnwP/jak8vO85gS7OMLqqLhxRtkk sd/qBTva+6DXMlQ/imVIs37af3CMow7aqCOuoaXHtPTuXrH7sW6+KkI2LRyON8QK SaD8A9L96rGFKeaQBvSXA+qwZsPxyyM+swXQLixq2b8vkyz4zEHfNU8cQ4+Z3CyW bWaKS6OhxMA9u7vjaw6RY6kgFcKlL7PAn1IpDaOfb5BMNbF8PBUKpf38zus6fMJT wkKB4Wgz4lPv2WPCSZrqhHK+Axv6s+VrQE4K8/K0UpOUvLYxPCSUKhyP0BH3CyUp FZXp+kUWkQjVXnxJACDKblT4ObtIIEHRzfRHMvcvjksDsfk6Wum0xas2+Z9dmt0c 07Gc4OM88nxqau4e6UDyJeSFgBFw69L1k6o43fA1IWc3BpuIs0m7gHQ10Dhld3ln sNzg47tJhBhTgYoUV5BQYEZsnY7Qdakvfgu+VfmvMivnIe9NHO3M5KzDN3eIajqE RlhDP33HVIJyuKFSz1NX6n7SCyBnl8SuxYUydT1NA32JGXQxyJBJUY5PBwsr/Dr5 StCDgs0KQB0qx2/mdt6VrZ657DPRo0X6pMGGuQtX1CI/I77/qVGKnkiOG//Ov7U7 yTLjP/p+TupCt4vh4l+t74h8Tk6Ki6S7emufc5Z26gBwqGiDN1MNi/sE3EHSXXQH afchSA/1+FEZHwBTA7yj =OW6k -----END PGP SIGNATURE----- --tS1rxd4C4OVPBDUni3BsHs6pF4nWkJThB-- From owner-svn-src-head@freebsd.org Wed Oct 28 16:11:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37190A1F680; Wed, 28 Oct 2015 16:11:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2661787; Wed, 28 Oct 2015 16:11:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 135FB18A6; Wed, 28 Oct 2015 16:11:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CE5431645F; Wed, 28 Oct 2015 16:11:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 7n5Q0cDeAbkW; Wed, 28 Oct 2015 16:11:00 +0000 (UTC) Subject: Re: svn commit: r290110 - in head: include lib/libc/stdio DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A7E3016459 To: Xin Li , "Andrey A. Chernov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510281440.t9SEe2PR093917@repo.freebsd.org> <5630EF2F.5080102@delphij.net> From: Bryan Drewery Organization: FreeBSD Message-ID: <5630F390.2070808@FreeBSD.org> Date: Wed, 28 Oct 2015 09:10:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5630EF2F.5080102@delphij.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 16:11:03 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 10/28/15 8:52 AM, Xin Li wrote: > > On 10/28/15 07:40, Andrey A. Chernov wrote: >> Author: ache Date: Wed Oct 28 14:40:02 2015 New Revision: 290110 >> URL: https://svnweb.freebsd.org/changeset/base/290110 >> >> Log: Add _flags2 per jhb@ suggestion since no room left in >> _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. > > Is this ABI-safe? (I was somewhat surprised that struct FILE is > not opaque, which seems to be unavoidable because some methods are > traditionally macros that have direct access to the members; the > addition is done in the end of the structure so it looks like the > change is safe). Perl reaches in and uses FILE->_file directly even. There's a lot of work behind fixing that case. - -- Regards, Bryan Drewery -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJWMPOQAAoJEDXXcbtuRpfPE1sH/iZRQk+XU9Uh0Ca06RHBRz/d jROUeRLX4ILWopsRHTd/nZ8XE28R9pynxcLeVc5EbX/9eQVyXSx4xAUBkkPag5aw B7HE+15e1fmH5EjmHeL3jW90U501lYLY9H3kwmngonzUXV2f6Rb2Y3DS+YveKWO3 H9KS9bGYt8c6H0fe7IDI7TuscaJ/ihG1GZucr0pM7pArGrO/c/9hO1T4YIO10K1O KseVcy4sMeae5OXos8bGsFvKWzyeQ58q07Y5K3mv2nEr+FhlR+dyOYLaeNLYw3tG p5lxYiT9UVwFvJZvjEiHxLq8NWf/4r59rmcid5xeh2Pl//Etc3fBnuz6l+50HaM= =vQ8q -----END PGP SIGNATURE----- From owner-svn-src-head@freebsd.org Wed Oct 28 16:22:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD46A1F8C2; Wed, 28 Oct 2015 16:22:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE42A1D37; Wed, 28 Oct 2015 16:22:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SGM0uP025209; Wed, 28 Oct 2015 16:22:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SGM0fZ025207; Wed, 28 Oct 2015 16:22:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510281622.t9SGM0fZ025207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 28 Oct 2015 16:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290113 - in head: targets/pseudo/userland usr.sbin/mpsutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 16:22:02 -0000 Author: bdrewery Date: Wed Oct 28 16:22:00 2015 New Revision: 290113 URL: https://svnweb.freebsd.org/changeset/base/290113 Log: Connect mpsutil for META MODE. Added: head/usr.sbin/mpsutil/Makefile.depend (contents, props changed) Modified: head/targets/pseudo/userland/Makefile.depend Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Wed Oct 28 15:00:21 2015 (r290112) +++ head/targets/pseudo/userland/Makefile.depend Wed Oct 28 16:22:00 2015 (r290113) @@ -564,6 +564,7 @@ DIRDEPS+= \ usr.sbin/mlxcontrol \ usr.sbin/mountd \ usr.sbin/moused \ + usr.sbin/mpsutil \ usr.sbin/mptutil \ usr.sbin/mtest \ usr.sbin/mtree \ Added: head/usr.sbin/mpsutil/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/mpsutil/Makefile.depend Wed Oct 28 16:22:00 2015 (r290113) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + lib/libutil \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From owner-svn-src-head@freebsd.org Wed Oct 28 16:31:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3B14A1FBD8; Wed, 28 Oct 2015 16:31:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE0F12CC; Wed, 28 Oct 2015 16:31:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SGV4RT028318; Wed, 28 Oct 2015 16:31:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SGV4Cn028316; Wed, 28 Oct 2015 16:31:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510281631.t9SGV4Cn028316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 28 Oct 2015 16:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290115 - head/usr.sbin/mpsutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 16:31:05 -0000 Author: bdrewery Date: Wed Oct 28 16:31:04 2015 New Revision: 290115 URL: https://svnweb.freebsd.org/changeset/base/290115 Log: Include libutil's headers directly from src to avoid recording a dirdeps dependency for META MODE. Modified: head/usr.sbin/mpsutil/Makefile head/usr.sbin/mpsutil/Makefile.depend Modified: head/usr.sbin/mpsutil/Makefile ============================================================================== --- head/usr.sbin/mpsutil/Makefile Wed Oct 28 16:28:28 2015 (r290114) +++ head/usr.sbin/mpsutil/Makefile Wed Oct 28 16:31:04 2015 (r290115) @@ -11,7 +11,8 @@ LINKS= ${BINDIR}/mpsutil ${BINDIR}/mprut MLINKS= mpsutil.8 mprutil.8 CFLAGS+= -I${.CURDIR}/../../sys -I. -DUSE_MPT_IOCTLS - +# Avoid dirdep dependency on libutil +CFLAGS+= -I${SRCTOP}/lib/libutil # Here be dragons .ifdef DEBUG Modified: head/usr.sbin/mpsutil/Makefile.depend ============================================================================== --- head/usr.sbin/mpsutil/Makefile.depend Wed Oct 28 16:28:28 2015 (r290114) +++ head/usr.sbin/mpsutil/Makefile.depend Wed Oct 28 16:31:04 2015 (r290115) @@ -9,7 +9,6 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libutil \ .include From owner-svn-src-head@freebsd.org Wed Oct 28 16:51:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D204A1E1F4 for ; Wed, 28 Oct 2015 16:51:53 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.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 DCB1F1E37 for ; Wed, 28 Oct 2015 16:51:52 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lbbes7 with SMTP id es7so10242439lbb.2 for ; Wed, 28 Oct 2015 09:51:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=ENSI6rVm48Bii6WIDMIGhxuQ2l/awJVRvJCRFXOs2Og=; b=hnEJJR5ExOMSLtdNzhnBlvlfD0r+8KlMJ/yWeaGj4cUDVyYS37p4SOUa30Lt2Q7Pu6 AKu2V0sypm1E8UyQYNvI6xFlsHDoN4byFHBmLc78BCesYN13x2VzrnbdamX780mTeb5F r7Z+OEglXJV0ZSNnjmQGZjyIy9YrNWP5ldzSypuPnq52fydNuYmLdjiDkhX5y9h0mt3x jmIh+VDTeEPbqi1xmu6uTCZjIlLFVksnKj4ncYZjwYXBbeXa2ffWTjUvkZzO7utS4CXH CnDgE5iKs6MV1C/JT2EeoYD/JzvPRzp+Fqk4kczppRIlr5YaQp1TjMq6zcHwBzvcqBy9 TyRw== X-Gm-Message-State: ALoCoQnJC4Px3que1aiJFCjX9Ox4EWbXWcqwW15LUmpYevwM1jPasfQWRdhqVbm90nSKyS9q9ebo X-Received: by 10.112.180.198 with SMTP id dq6mr23775147lbc.90.1446050761273; Wed, 28 Oct 2015 09:46:01 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id l79sm410671lfl.2.2015.10.28.09.46.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2015 09:46:00 -0700 (PDT) Subject: Re: svn commit: r290110 - in head: include lib/libc/stdio To: Xin Li , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510281440.t9SEe2PR093917@repo.freebsd.org> <5630EF2F.5080102@delphij.net> From: Andrey Chernov Message-ID: <5630FBB5.5040607@freebsd.org> Date: Wed, 28 Oct 2015 19:45:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5630EF2F.5080102@delphij.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="V6v3m3cu6q546UhetPfTjnwBgkoIFNuOk" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 16:51:53 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --V6v3m3cu6q546UhetPfTjnwBgkoIFNuOk Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable On 28.10.2015 18:52, Xin Li wrote: >=20 > On 10/28/15 07:40, Andrey A. Chernov wrote: >> Author: ache Date: Wed Oct 28 14:40:02 2015 New Revision: 290110=20 >> URL: https://svnweb.freebsd.org/changeset/base/290110 >>=20 >> Log: Add _flags2 per jhb@ suggestion since no room left in >> _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. >=20 > Is this ABI-safe? (I was somewhat surprised that struct FILE is > not opaque, which seems to be unavoidable because some methods are=20 > traditionally macros that have direct access to the members; the=20 > addition is done in the end of the structure so it looks like the > change is safe). According to jhb@, yes. See https://lists.freebsd.org/pipermail/svn-src-head/2015-October/078113.html= --=20 http://ache.vniz.net/ --V6v3m3cu6q546UhetPfTjnwBgkoIFNuOk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWMPvHAAoJEKUckv0MjfbKYDYH/RJN31m/kp7ILTFRdAqOLJSi HwRxweSlgUy6K51j63eMJ4Z5ouYdLoDzISAYfHZi1pNM72kCQMsvbMIrs4askj4M dlR1eew0O0Oj6E793VBU8176Q7zOBABBqMQcTmRn9RDoBfUNVRib1+edHXjGYGSc 9p46PinalFbPn7jxzIm3bF9zadGyA2wMNR2ftvWWMf1xLiSiA8JAaITYFaj+0oF+ AnBgyfZHJ3GTvIoitqRGG9nPxt4+53z+cvOF5Vwfe3fAO2sNyDq1xfsQJf7w2ZSy ANnn3ansJLSi0hzSOqq4TLCkCfWyOD8B7IY2f9tjqNOiIplyeqSnUrb5lZ8TavQ= =IWys -----END PGP SIGNATURE----- --V6v3m3cu6q546UhetPfTjnwBgkoIFNuOk-- From owner-svn-src-head@freebsd.org Wed Oct 28 17:13:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B404A1E88F for ; Wed, 28 Oct 2015 17:13:15 +0000 (UTC) (envelope-from cemeyer@uw.edu) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::22d]) (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 2D45D18A7 for ; Wed, 28 Oct 2015 17:13:15 +0000 (UTC) (envelope-from cemeyer@uw.edu) Received: by padhy1 with SMTP id hy1so6569395pad.0 for ; Wed, 28 Oct 2015 10:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uw_edu.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=HXVBP2LXdmt5KhfIP7d2dwArRwEpGDcH5ObTF+dz8rM=; b=mnX9t3Jya7rnjG5qb/OLDI0aHNn1a9I8Go4RownBL2633CWc6tk6N9P+3B61kmN+iB Y/OEhtOyjP7vYDv5RqAe5EJph002d7H04qMDLXFzmU9tojyslcK2qH78h25XyvhFq2PP xuCQXHx34HQNG8i6KG3zOWHWCypMXZAS6acKQ6mIWSkFkaD/NZg5ynKjKZN5xX51hhkZ lkD59m42nY/Ep+W3hBJOSFBkqKZR75MH0xZzDahPPnuhESH9/3lj7wj906xQapEctDt9 xM7tGhHUswemWvrumVVG82ysIfTg/oFcuHD5mOBkDGoc3eQJ6Ysl7lrdvYU+r+hxmOPK VnqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=HXVBP2LXdmt5KhfIP7d2dwArRwEpGDcH5ObTF+dz8rM=; b=WXP7X4NUU4HeUwer9qRsLAcdFLNIalnz1TkufsOHS+93yPL/YDDOf5AkEKssfC+ApB VjIzvjCs9cwqxh5lEiEO8hah3PYnPOGhAQE67y+V+PgZeDd81unya4lqjdrCWo1cNyTR 0rwjZaXIGgCvfmyQe/C9tSk89JWPZp/R9Biqs/A8CjKvUjbc8Dn7ZdEkGIlY8+/A0P30 oHmhHqUFvIv85CkLPjvUwoKWYhImwuYQcgdGCRSKn2usn2sk8m0FPNep1BvFgEtj2i2t aVMURNUk3siKcJ+LAOPpacgcXHBoFaJIIwsnl4aRK/DcZoyWn36Rx9KCcyc7w68qZSj9 Zbfg== X-Gm-Message-State: ALoCoQkc63W4IfJagMPTBuvFO14rGihhdVNtKkPe9qyFmiM49ptnIpbQRB4US5dloreyU0M4u3Wd X-Received: by 10.66.102.97 with SMTP id fn1mr34940610pab.77.1446052394651; Wed, 28 Oct 2015 10:13:14 -0700 (PDT) Received: from m (c-50-132-89-32.hsd1.wa.comcast.net. [50.132.89.32]) by smtp.gmail.com with ESMTPSA id w8sm46456478pbs.87.2015.10.28.10.13.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2015 10:13:13 -0700 (PDT) From: Conrad Meyer X-Google-Original-From: Conrad Meyer Date: Wed, 28 Oct 2015 10:13:11 -0700 To: Xin Li Cc: "Andrey A. Chernov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290110 - in head: include lib/libc/stdio Message-ID: <20151028101311.34dfedb7@m> In-Reply-To: <5630EF2F.5080102@delphij.net> References: <201510281440.t9SEe2PR093917@repo.freebsd.org> <5630EF2F.5080102@delphij.net> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 17:13:15 -0000 On Wed, 28 Oct 2015 08:52:15 -0700 Xin Li wrote: > On 10/28/15 07:40, Andrey A. Chernov wrote: > > Add _flags2 per jhb@ suggestion since no room left in > > _flags. Rewrite O_APPEND flag checking using new __S2OAP > > flag. > > Is this ABI-safe? (I was somewhat surprised that struct > FILE is not opaque, which seems to be unavoidable because > some methods are traditionally macros that have direct > access to the members; the addition is done in the end of > the structure so it looks like the change is safe). It breaks anything that depends on the size of __sFILE (IMO dead code walking). Otherwise it should be ABI compatible, since the flags2 member is only added at the end. JHB has a patch floating around to remove all the FILE macros and re-private the contents of the FILE struct. As Bryan said already, Perl reaches in directly for the fd number and needs to be fixed before that can land. Best, Conrad From owner-svn-src-head@freebsd.org Wed Oct 28 17:55:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75DB8A1F196; Wed, 28 Oct 2015 17:55:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 425D5116E; Wed, 28 Oct 2015 17:55:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SHtbGp052752; Wed, 28 Oct 2015 17:55:37 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SHtbJ1052751; Wed, 28 Oct 2015 17:55:37 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201510281755.t9SHtbJ1052751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 28 Oct 2015 17:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290116 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 17:55:38 -0000 Author: ae Date: Wed Oct 28 17:55:37 2015 New Revision: 290116 URL: https://svnweb.freebsd.org/changeset/base/290116 Log: Check the size of data available in mbuf, before using them. PR: 202667 MFC after: 1 week Modified: head/sys/net/if_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Wed Oct 28 16:31:04 2015 (r290115) +++ head/sys/net/if_gre.c Wed Oct 28 17:55:37 2015 (r290116) @@ -691,6 +691,14 @@ gre_input(struct mbuf **mp, int *offp, i KASSERT(sc != NULL, ("encap_getarg returned NULL")); ifp = GRE2IFP(sc); + hlen = *offp + sizeof(struct grehdr) + 4 * sizeof(uint32_t); + if (m->m_pkthdr.len < hlen) + goto drop; + if (m->m_len < hlen) { + m = m_pullup(m, hlen); + if (m == NULL) + goto drop; + } gh = (struct grehdr *)mtodo(m, *offp); flags = ntohs(gh->gre_flags); if (flags & ~GRE_FLAGS_MASK) From owner-svn-src-head@freebsd.org Wed Oct 28 18:35:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9F8A1F948 for ; Wed, 28 Oct 2015 18:35:06 +0000 (UTC) (envelope-from xdsl0000474440@inode.at) Received: from b2bfep13.mx.upcmail.net (b2bfep13.mx.upcmail.net [62.179.121.58]) by mx1.freebsd.org (Postfix) with ESMTP id 1D1F21553 for ; Wed, 28 Oct 2015 18:35:05 +0000 (UTC) (envelope-from xdsl0000474440@inode.at) Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep13.mx.upcmail.net (InterMail vM.8.01.05.18 201-2260-151-151-20140610) with ESMTP id <20151028183456.HUXV17909.b2bfep13-int.chello.at@edge12.upcmail.net> for ; Wed, 28 Oct 2015 19:34:56 +0100 Received: from iznogoud.viz ([91.119.142.141]) by edge12.upcmail.net with edge id aiat1r01H33F18j0CiatkT; Wed, 28 Oct 2015 19:34:56 +0100 X-SourceIP: 91.119.142.141 Received: from wolfgang by iznogoud.viz with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ZrVYj-0000dy-0F; Wed, 28 Oct 2015 19:34:53 +0100 From: Wolfgang Jenkner To: Conrad Meyer Cc: Xin Li , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Andrey A. Chernov" Subject: Re: svn commit: r290110 - in head: include lib/libc/stdio Date: Wed, 28 Oct 2015 19:28:19 +0100 References: <201510281440.t9SEe2PR093917@repo.freebsd.org> <5630EF2F.5080102@delphij.net> <20151028101311.34dfedb7__9766.83928533948$1446052407$gmane$org@m> Message-ID: <85vb9q9703.fsf@iznogoud.viz> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 18:35:06 -0000 On Wed, Oct 28 2015, Conrad Meyer wrote: > JHB has a patch floating around to remove all the FILE macros > and re-private the contents of the FILE struct. As Bryan > said already, Perl reaches in directly for the fd number and > needs to be fixed before that can land. And Emacs uses _p and _bf (or rather, _bf._base) via a gnulib module: https://www.gnu.org/software/gnulib/MODULES.html#module=fpending (the interesting stuff is in fpending.m4). From owner-svn-src-head@freebsd.org Wed Oct 28 18:53:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3872A1FFAC; Wed, 28 Oct 2015 18:53:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DFA0147B; Wed, 28 Oct 2015 18:53:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SIrICF070848; Wed, 28 Oct 2015 18:53:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SIrI3C070847; Wed, 28 Oct 2015 18:53:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201510281853.t9SIrI3C070847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 28 Oct 2015 18:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290117 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 18:53:19 -0000 Author: imp Date: Wed Oct 28 18:53:18 2015 New Revision: 290117 URL: https://svnweb.freebsd.org/changeset/base/290117 Log: Add a note to the effect that BUS_ADD_CHILD calls device_add_child_ordered to add the child. device_add_child_ordered doesn't call BUS_ADD_CHILD. Modified: head/sys/kern/bus_if.m Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Wed Oct 28 17:55:37 2015 (r290116) +++ head/sys/kern/bus_if.m Wed Oct 28 18:53:18 2015 (r290117) @@ -209,7 +209,9 @@ METHOD void driver_added { * For busses which use use drivers supporting DEVICE_IDENTIFY() to * enumerate their devices, this method is used to create new * device instances. The new device will be added after the last - * existing child with the same order. + * existing child with the same order. Implementations of bus_add_child + * call device_add_child_ordered to add the child and often add + * a suitable ivar to the device specific to that bus. * * @param _dev the bus device which will be the parent of the * new child device From owner-svn-src-head@freebsd.org Wed Oct 28 19:08:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E0ADA2029A; Wed, 28 Oct 2015 19:08:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 495F81C06; Wed, 28 Oct 2015 19:08:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SJ8qeu073982; Wed, 28 Oct 2015 19:08:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SJ8qTc073980; Wed, 28 Oct 2015 19:08:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510281908.t9SJ8qTc073980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 28 Oct 2015 19:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290118 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 19:08:53 -0000 Author: mav Date: Wed Oct 28 19:08:51 2015 New Revision: 290118 URL: https://svnweb.freebsd.org/changeset/base/290118 Log: Change the way how target mode is enabled on 23xx chips. Without docs I am not completely sure about this, but on my tests new method works better then previous, at least with our latest firmware. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Wed Oct 28 18:53:18 2015 (r290117) +++ head/sys/dev/isp/isp.c Wed Oct 28 19:08:51 2015 (r290118) @@ -1895,7 +1895,7 @@ isp_fibre_init(ispsoftc_t *isp) icbp->icb_logintime = ICB_LOGIN_TOV; #ifdef ISP_TARGET_MODE - if (ISP_FW_NEWER_THAN(isp, 3, 25, 0) && (icbp->icb_fwoptions & ICBOPT_TGT_ENABLE)) { + if (IS_23XX(isp) && (icbp->icb_fwoptions & ICBOPT_TGT_ENABLE)) { icbp->icb_lunenables = 0xffff; icbp->icb_ccnt = DFLT_CMND_CNT; icbp->icb_icnt = DFLT_INOT_CNT; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Oct 28 18:53:18 2015 (r290117) +++ head/sys/dev/isp/isp_freebsd.c Wed Oct 28 19:08:51 2015 (r290118) @@ -1414,7 +1414,8 @@ isp_enable_deferred(ispsoftc_t *isp, int ISP_GET_PC(isp, bus, tm_luns_enabled, luns_already_enabled); isp_prt(isp, ISP_LOGTINFO, "%s: bus %d lun %jx luns_enabled %d", __func__, bus, (uintmax_t)lun, luns_already_enabled); - if (IS_24XX(isp) || (IS_FC(isp) && luns_already_enabled)) { + if (IS_23XX(isp) || IS_24XX(isp) || + (IS_FC(isp) && luns_already_enabled)) { status = CAM_REQ_CMP; } else { int cmd_cnt, not_cnt; @@ -1485,7 +1486,7 @@ isp_disable_lun(ispsoftc_t *isp, union c /* * If we're a 24XX card, we're done. */ - if (IS_24XX(isp)) { + if (IS_23XX(isp) || IS_24XX(isp)) { status = CAM_REQ_CMP; goto done; } @@ -1501,7 +1502,7 @@ isp_disable_lun(ispsoftc_t *isp, union c if (isp_lun_cmd(isp, RQSTYPE_ENABLE_LUN, bus, lun, 0, 0)) { status = CAM_RESRC_UNAVAIL; } else { - mtx_sleep(ccb, &isp->isp_lock, PRIBIO, "isp_disable_lun", 0); + mtx_sleep(&status, &isp->isp_lock, PRIBIO, "isp_disable_lun", 0); } isp->isp_osinfo.rptr = NULL; done: From owner-svn-src-head@freebsd.org Wed Oct 28 19:11:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17EE5A20408; Wed, 28 Oct 2015 19:11:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id DF3651EBE; Wed, 28 Oct 2015 19:11:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SJB6mQ076061; Wed, 28 Oct 2015 19:11:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SJB6nL076059; Wed, 28 Oct 2015 19:11:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201510281911.t9SJB6nL076059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 28 Oct 2015 19:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290119 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 19:11:08 -0000 Author: imp Date: Wed Oct 28 19:11:06 2015 New Revision: 290119 URL: https://svnweb.freebsd.org/changeset/base/290119 Log: BUS_ADD_CHILD calls device_add_child. device_add_child does not call BUS_ADD_CHILD. Make it explicit since it follows the command paradigm rather than the callback paradigm. Add other clarifying notes as well. Modified: head/share/man/man9/BUS_ADD_CHILD.9 head/share/man/man9/device_add_child.9 Modified: head/share/man/man9/BUS_ADD_CHILD.9 ============================================================================== --- head/share/man/man9/BUS_ADD_CHILD.9 Wed Oct 28 19:08:51 2015 (r290118) +++ head/share/man/man9/BUS_ADD_CHILD.9 Wed Oct 28 19:11:06 2015 (r290119) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2004 +.Dd October 28, 2015 .Dt BUS_ADD_CHILD 9 .Os .Sh NAME @@ -44,6 +44,8 @@ The .Fn BUS_ADD_CHILD method is used by the driver identify routine to add devices to the tree. +It can also be used to add children to buses that implement this +routine in other contexts, although the behavior is bus specific. Please see .Xr device_add_child 9 for more details. @@ -53,18 +55,31 @@ however, the bus' .Fn BUS_ADD_CHILD is called. .Pp -Busses implementing +Buses implementing .Fn BUS_ADD_CHILD should insert the device into the tree using .Xr device_add_child 9 before adding things such as their own ivars and resource lists to the device. +.Fn BUS_ADD_CHILD +is not called by +.Xr device_add_child 9 . +.Fn BUS_ADD_CHILD +instead calls +.Xr device_add_child 9 . +.Pp +A panic will result when called for a bus that does not implement +.Fn BUS_ADD_CHILD . +Some buses require a special bus-specific routine to be called instead +of +.Fn BUS_ADD_CHILD . .Sh RETURN VALUES The .Fn BUS_ADD_CHILD method returns .Vt device_t added to the tree, or -.Dv NULL . +.Dv NULL +to indicate failure. .Sh SEE ALSO .Xr device 9 , .Xr device_add_child 9 , Modified: head/share/man/man9/device_add_child.9 ============================================================================== --- head/share/man/man9/device_add_child.9 Wed Oct 28 19:08:51 2015 (r290118) +++ head/share/man/man9/device_add_child.9 Wed Oct 28 19:11:06 2015 (r290119) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 2006 +.Dd October 28, 2015 .Dt DEVICE_ADD_CHILD 9 .Os .Sh NAME @@ -74,14 +74,14 @@ Normally unit numbers will be chosen aut unit number of .Dv -1 should be given. -When a specific unit number is desired (e.g.\& for wiring a particular +When a specific unit number is desired (e.g.,\& for wiring a particular piece of hardware to a pre-configured unit number), that unit should be passed. If the specified unit number is already allocated, a new unit will be allocated and a diagnostic message printed. .Pp If the devices attached to a bus must be probed in a specific order -(e.g.\& for the ISA bus some devices are sensitive to failed probe attempts +(e.g.,\& for the ISA bus some devices are sensitive to failed probe attempts of unrelated drivers and therefore must be probed first), the .Fa order @@ -109,10 +109,18 @@ Authors of bus drivers must likewise be when they are loaded and unloaded to avoid duplication of children devices. .Pp -Identify routines should use +When adding a child to another device node, such as in an identify +routine, use .Xr BUS_ADD_CHILD 9 instead of .Xr device_add_child 9 . +.Xr BUS_ADD_CHILD 9 +will call +.Xr device_add_child 9 +and add the proper bus-specific data to the new child. +.Fn device_add_child +does not call +.Xr BUS_ADD_CHILD 9 . .Sh RETURN VALUES The new device if successful, NULL otherwise. .Sh SEE ALSO From owner-svn-src-head@freebsd.org Wed Oct 28 21:17:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8870DA2029D; Wed, 28 Oct 2015 21:17:40 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE5C1DDA; Wed, 28 Oct 2015 21:17:40 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SLHdVt021346; Wed, 28 Oct 2015 21:17:39 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SLHdEu021342; Wed, 28 Oct 2015 21:17:39 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201510282117.t9SLHdEu021342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Wed, 28 Oct 2015 21:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290120 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 21:17:40 -0000 Author: jah Date: Wed Oct 28 21:17:38 2015 New Revision: 290120 URL: https://svnweb.freebsd.org/changeset/base/290120 Log: Retire pmap_dmap_iscurrent(). It is only a wrapper around pmap_is_current(), and is no longer called. Modified: head/sys/arm/arm/pmap-v6-new.c head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap-v6.h head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Wed Oct 28 19:11:06 2015 (r290119) +++ head/sys/arm/arm/pmap-v6-new.c Wed Oct 28 21:17:38 2015 (r290120) @@ -5947,13 +5947,6 @@ pmap_activate(struct thread *td) critical_exit(); } -int -pmap_dmap_iscurrent(pmap_t pmap) -{ - - return (pmap_is_current(pmap)); -} - /* * Perform the pmap work for mincore. */ Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Oct 28 19:11:06 2015 (r290119) +++ head/sys/arm/arm/pmap-v6.c Wed Oct 28 21:17:38 2015 (r290120) @@ -5398,12 +5398,6 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offs } -int -pmap_dmap_iscurrent(pmap_t pmap) -{ - return(pmap_is_current(pmap)); -} - void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Oct 28 19:11:06 2015 (r290119) +++ head/sys/arm/include/pmap-v6.h Wed Oct 28 21:17:38 2015 (r290120) @@ -265,11 +265,6 @@ void pmap_devmap_bootstrap(const struct #define PMAP_DOMAIN_KERNEL 0 /* The kernel uses domain #0 */ /* - * sys/arm/arm/busdma_machdep-v6.c - */ -int pmap_dmap_iscurrent(pmap_t pmap); - -/* * sys/arm/arm/cpufunc.c */ void pmap_pte_init_mmu_v6(void); Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Wed Oct 28 19:11:06 2015 (r290119) +++ head/sys/arm/include/pmap.h Wed Oct 28 21:17:38 2015 (r290120) @@ -277,7 +277,6 @@ void pmap_map_entry(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa, int prot, int cache); int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t, int); -int pmap_dmap_iscurrent(pmap_t pmap); /* * Definitions for MMU domains From owner-svn-src-head@freebsd.org Wed Oct 28 21:58:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501B8A2097D; Wed, 28 Oct 2015 21:58:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 229A31F18; Wed, 28 Oct 2015 21:58:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1E6A5B9A1; Wed, 28 Oct 2015 17:58:54 -0400 (EDT) From: John Baldwin To: Xin Li Cc: "Andrey A. Chernov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290110 - in head: include lib/libc/stdio Date: Wed, 28 Oct 2015 13:18:24 -0700 Message-ID: <3167315.dHBYRLxVfB@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <5630EF2F.5080102@delphij.net> References: <201510281440.t9SEe2PR093917@repo.freebsd.org> <5630EF2F.5080102@delphij.net> 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.2.7 (bigwig.baldwin.cx); Wed, 28 Oct 2015 17:58:54 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 21:58:55 -0000 On Wednesday, October 28, 2015 08:52:15 AM Xin Li wrote: > > On 10/28/15 07:40, Andrey A. Chernov wrote: > > Author: ache > > Date: Wed Oct 28 14:40:02 2015 > > New Revision: 290110 > > URL: https://svnweb.freebsd.org/changeset/base/290110 > > > > Log: > > Add _flags2 per jhb@ suggestion since no room left in _flags. > > Rewrite O_APPEND flag checking using new __S2OAP flag. > > Is this ABI-safe? (I was somewhat surprised that struct FILE is not > opaque, which seems to be unavoidable because some methods are > traditionally macros that have direct access to the members; the > addition is done in the end of the structure so it looks like the change > is safe). I believe that adding new fields should be safe. Allocating a static FILE object in an application hasn't been supported in a long while. However, we cannot make FILE fully opaque. (I tried and had to revert it.) I have thought about using an #ifdef to hide all of the members not marked for ABI compat though so that they are otherwise only accessible to libc's implementation. This is probably worth doing to at least prevent accidental use of the internal fields. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Oct 28 22:49:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95D3DA203E7; Wed, 28 Oct 2015 22:49:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58692151F; Wed, 28 Oct 2015 22:49:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SMnbV0047362; Wed, 28 Oct 2015 22:49:37 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SMnbS9047361; Wed, 28 Oct 2015 22:49:37 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201510282249.t9SMnbS9047361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 28 Oct 2015 22:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290121 - head/secure/lib/libcrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 22:49:38 -0000 Author: jkim Date: Wed Oct 28 22:49:37 2015 New Revision: 290121 URL: https://svnweb.freebsd.org/changeset/base/290121 Log: Define endianness for non-x86 platforms. MFC after: 3 days Modified: head/secure/lib/libcrypto/Makefile.inc Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Wed Oct 28 21:17:38 2015 (r290120) +++ head/secure/lib/libcrypto/Makefile.inc Wed Oct 28 22:49:37 2015 (r290121) @@ -13,8 +13,16 @@ CFLAGS+= -DTERMIOS -DANSI_SOURCE CFLAGS+= -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto -I${.OBJDIR} CFLAGS+= -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H +.include + +.if ${TARGET_ENDIANNESS} == 1234 +CFLAGS+=-DL_ENDIAN +.elif ${TARGET_ENDIANNESS} == 4321 +CFLAGS+=-DB_ENDIAN +.endif + .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2 +CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m CFLAGS+=-DMD5_ASM @@ -22,7 +30,7 @@ CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+=-DWHIRLPOOL_ASM .elif ${MACHINE_CPUARCH} == "i386" -CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2 +CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m CFLAGS+=-DMD5_ASM From owner-svn-src-head@freebsd.org Wed Oct 28 22:57:52 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64DDA2056F; Wed, 28 Oct 2015 22:57:52 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 A07881A6A; Wed, 28 Oct 2015 22:57:52 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SMvppw050195; Wed, 28 Oct 2015 22:57:51 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SMvpkK050192; Wed, 28 Oct 2015 22:57:51 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201510282257.t9SMvpkK050192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Wed, 28 Oct 2015 22:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290122 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 22:57:53 -0000 Author: hiren Date: Wed Oct 28 22:57:51 2015 New Revision: 290122 URL: https://svnweb.freebsd.org/changeset/base/290122 Log: Calculate the correct amount of bytes that are in-flight for a connection as suggested by RFC 6675. Currently differnt places in the stack tries to guess this in suboptimal ways. The main problem is that current calculations don't take sacked bytes into account. Sacked bytes are the bytes receiver acked via SACK option. This is suboptimal because it assumes that network has more outstanding (unacked) bytes than the actual value and thus sends less data by setting congestion window lower than what's possible which in turn may cause slower recovery from losses. As an example, one of the current calculations looks something like this: snd_nxt - snd_fack + sackhint.sack_bytes_rexmit New proposal from RFC 6675 is: snd_max - snd_una - sackhint.sacked_bytes + sackhint.sack_bytes_rexmit which takes sacked bytes into account which is a new addition to the sackhint struct. Only thing we are missing from RFC 6675 is isLost() i.e. segment being considered lost and thus adjusting pipe based on that which makes this calculation a bit on conservative side. The approach is very simple. We already process each ack with sack info in tcp_sack_doack() and extract sack blocks/holes out of it. We'd now also track this new variable sacked_bytes which keeps track of total sacked bytes reported. One downside to this approach is that we may get incorrect count of sacked_bytes if the other end decides to drop sack info in the ack because of memory pressure or some other reasons. But in this (not very likely) case also the pipe calculation would be conservative which is okay as opposed to being aggressive in sending packets into the network. Next step is to use this more accurate pipe estimation to drive congestion window adjustments. In collaboration with: rrs Reviewed by: jason_eggnet dot com, rrs MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D3971 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 28 22:49:37 2015 (r290121) +++ head/sys/netinet/tcp_input.c Wed Oct 28 22:57:51 2015 (r290122) @@ -148,6 +148,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); +VNET_DEFINE(int, tcp_do_rfc6675_pipe) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_pipe, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_do_rfc6675_pipe), 0, + "Use calculated pipe/in-flight bytes per RFC 6675"); + VNET_DEFINE(int, tcp_do_rfc3042) = 1; #define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW, @@ -2420,6 +2425,12 @@ tcp_do_segment(struct mbuf *m, struct tc ((to.to_flags & TOF_SACK) || !TAILQ_EMPTY(&tp->snd_holes))) tcp_sack_doack(tp, &to, th->th_ack); + else + /* + * Reset the value so that previous (valid) value + * from the last ack with SACK doesn't get used. + */ + tp->sackhint.sacked_bytes = 0; /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, &to); @@ -2483,8 +2494,12 @@ tcp_do_segment(struct mbuf *m, struct tc * we have less than 1/2 the original window's * worth of data in flight. */ - awnd = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; + if (V_tcp_do_rfc6675_pipe) + awnd = tcp_compute_pipe(tp); + else + awnd = (tp->snd_nxt - tp->snd_fack) + + tp->sackhint.sack_bytes_rexmit; + if (awnd < tp->snd_ssthresh) { tp->snd_cwnd += tp->t_maxseg; if (tp->snd_cwnd > tp->snd_ssthresh) @@ -3729,3 +3744,11 @@ tcp_newreno_partial_ack(struct tcpcb *tp tp->snd_cwnd = 0; tp->snd_cwnd += tp->t_maxseg; } + +int +tcp_compute_pipe(struct tcpcb *tp) +{ + return (tp->snd_max - tp->snd_una + + tp->sackhint.sack_bytes_rexmit - + tp->sackhint.sacked_bytes); +} Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Wed Oct 28 22:49:37 2015 (r290121) +++ head/sys/netinet/tcp_sack.c Wed Oct 28 22:57:51 2015 (r290122) @@ -369,6 +369,7 @@ tcp_sack_doack(struct tcpcb *tp, struct * received new blocks from the other side. */ if (to->to_flags & TOF_SACK) { + tp->sackhint.sacked_bytes = 0; /* reset */ for (i = 0; i < to->to_nsacks; i++) { bcopy((to->to_sacks + i * TCPOLEN_SACK), &sack, sizeof(sack)); @@ -379,8 +380,11 @@ tcp_sack_doack(struct tcpcb *tp, struct SEQ_GT(sack.start, th_ack) && SEQ_LT(sack.start, tp->snd_max) && SEQ_GT(sack.end, tp->snd_una) && - SEQ_LEQ(sack.end, tp->snd_max)) + SEQ_LEQ(sack.end, tp->snd_max)) { sack_blocks[num_sack_blks++] = sack; + tp->sackhint.sacked_bytes += + (sack.end-sack.start); + } } } /* Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Oct 28 22:49:37 2015 (r290121) +++ head/sys/netinet/tcp_var.h Wed Oct 28 22:57:51 2015 (r290122) @@ -74,7 +74,11 @@ struct sackhint { tcp_seq last_sack_ack; /* Most recent/largest sacked ack */ int ispare; /* explicit pad for 64bit alignment */ - uint64_t _pad[2]; /* 1 sacked_bytes, 1 TBD */ + int sacked_bytes; /* + * Total sacked bytes reported by the + * receiver via sack option + */ + uint64_t _pad[1]; /* TBD */ }; struct tcptemp { @@ -653,6 +657,9 @@ VNET_DECLARE(int, tcp_ecn_maxretries); VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) +VNET_DECLARE(int, tcp_do_rfc6675_pipe); +#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) + int tcp_addoptions(struct tcpopt *, u_char *); int tcp_ccalgounload(struct cc_algo *unload_algo); struct tcpcb * @@ -743,6 +750,7 @@ void tcp_sack_partialack(struct tcpcb * void tcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); u_long tcp_seq_subtract(u_long, u_long ); +int tcp_compute_pipe(struct tcpcb *); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); From owner-svn-src-head@freebsd.org Wed Oct 28 23:39:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AB5A20C13; Wed, 28 Oct 2015 23:39:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FA31C9F; Wed, 28 Oct 2015 23:39:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SNdYBF062212; Wed, 28 Oct 2015 23:39:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SNdY1X062211; Wed, 28 Oct 2015 23:39:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510282339.t9SNdY1X062211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 28 Oct 2015 23:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290123 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 28 Oct 2015 23:39:35 -0000 Author: adrian Date: Wed Oct 28 23:39:33 2015 New Revision: 290123 URL: https://svnweb.freebsd.org/changeset/base/290123 Log: Oops - use the wrong array offset. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Wed Oct 28 22:57:51 2015 (r290122) +++ head/sys/mips/atheros/if_arge.c Wed Oct 28 23:39:33 2015 (r290123) @@ -2485,7 +2485,7 @@ arge_intr(void *arg) #ifdef ARGE_DEBUG for (i = 0; i < 32; i++) { if (status & (1 << i)) { - sc->intr_stats.count[1 << i]++; + sc->intr_stats.count[i]++; } } #endif From owner-svn-src-head@freebsd.org Thu Oct 29 00:41:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F22CCA1F9EB; Thu, 29 Oct 2015 00:41:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0858164D; Thu, 29 Oct 2015 00:41:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T0f3wp079390; Thu, 29 Oct 2015 00:41:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T0f3ZI079389; Thu, 29 Oct 2015 00:41:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510290041.t9T0f3ZI079389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 00:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290126 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 00:41:05 -0000 Author: bdrewery Date: Thu Oct 29 00:41:03 2015 New Revision: 290126 URL: https://svnweb.freebsd.org/changeset/base/290126 Log: Fix regression from using .USEBEFORE in _SUBDIR in r289705. Using .USEBEFORE had the unintended side-effect of changing the directory for the real target ran in the current directory. For example this meant that the 'make clean' would run in one of the SUBDIR. Sponsored by: EMC / Isilon Storage Division Pointyhat to: bdrewery Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Thu Oct 29 00:36:10 2015 (r290125) +++ head/share/mk/bsd.subdir.mk Thu Oct 29 00:41:03 2015 (r290126) @@ -83,7 +83,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}target=${.TARGET:S,realinstall,install,}; \ - for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done + for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif ${SUBDIR:N.WAIT}: .PHONY .MAKE From owner-svn-src-head@freebsd.org Thu Oct 29 03:22:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BDE5A2004F; Thu, 29 Oct 2015 03:22:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 169851795; Thu, 29 Oct 2015 03:22:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T3MSLq029839; Thu, 29 Oct 2015 03:22:28 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T3MSJW029838; Thu, 29 Oct 2015 03:22:28 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201510290322.t9T3MSJW029838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 29 Oct 2015 03:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290127 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 03:22:29 -0000 Author: kevlo Date: Thu Oct 29 03:22:27 2015 New Revision: 290127 URL: https://svnweb.freebsd.org/changeset/base/290127 Log: Xref otus(4). Modified: head/share/man/man4/wlan.4 Modified: head/share/man/man4/wlan.4 ============================================================================== --- head/share/man/man4/wlan.4 Thu Oct 29 00:41:03 2015 (r290126) +++ head/share/man/man4/wlan.4 Thu Oct 29 03:22:27 2015 (r290127) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2015 +.Dd October 29, 2015 .Dt WLAN 4 .Os .Sh NAME @@ -182,6 +182,7 @@ may not interoperate. .Xr malo 4 , .Xr mwl 4 , .Xr netintro 4 , +.Xr otus 4 , .Xr ral 4 , .Xr rsu 4 , .Xr rum 4 , From owner-svn-src-head@freebsd.org Thu Oct 29 03:28:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAD9A201D7; Thu, 29 Oct 2015 03:28:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 C92D31B45; Thu, 29 Oct 2015 03:28:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T3SSqp030083; Thu, 29 Oct 2015 03:28:28 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T3SSEN030082; Thu, 29 Oct 2015 03:28:28 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201510290328.t9T3SSEN030082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 29 Oct 2015 03:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290128 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 03:28:30 -0000 Author: kevlo Date: Thu Oct 29 03:28:28 2015 New Revision: 290128 URL: https://svnweb.freebsd.org/changeset/base/290128 Log: Add MLINKS for if_otus(4), if_rsu(4) and if_urtwn(4). Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Oct 29 03:22:27 2015 (r290127) +++ head/share/man/man4/Makefile Thu Oct 29 03:28:28 2015 (r290128) @@ -672,6 +672,7 @@ MLINKS+=nge.4 if_nge.4 MLINKS+=${_ntb.4} ${_if_ntb.4} \ ${_ntb.4} ${_ntb_hw.4} MLINKS+=${_nxge.4} ${_if_nxge.4} +MLINKS+=otus.4 if_otus.4 MLINKS+=ow.4 onewire.4 MLINKS+=patm.4 if_patm.4 MLINKS+=pccbb.4 cbb.4 @@ -685,6 +686,7 @@ MLINKS+=rl.4 if_rl.4 MLINKS+=rue.4 if_rue.4 MLINKS+=rum.4 if_rum.4 MLINKS+=run.4 if_run.4 +MLINKS+=rsu.4 if_rsu.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ @@ -713,6 +715,7 @@ MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 +MLINKS+=urtwn.4 if_urtwn.4 MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vxlan.4 if_vxlan.4 From owner-svn-src-head@freebsd.org Thu Oct 29 04:16:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59E32A20975; Thu, 29 Oct 2015 04:16:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1BA111CFC; Thu, 29 Oct 2015 04:16:18 +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 t9T4GHXZ044230; Thu, 29 Oct 2015 04:16:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4GGNt044225; Thu, 29 Oct 2015 04:16:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510290416.t9T4GGNt044225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 04:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290129 - in head: sys/dev/ioat tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 04:16:18 -0000 Author: cem Date: Thu Oct 29 04:16:16 2015 New Revision: 290129 URL: https://svnweb.freebsd.org/changeset/base/290129 Log: ioatcontrol(8): Add and document "raw" testing mode Allows DMA from/to arbitrary KVA or physical address. /dev/ioat_test must be enabled by root and is only R/W root, so this is approximately as dangerous as /dev/mem and /dev/kmem. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_test.c head/sys/dev/ioat/ioat_test.h head/tools/tools/ioat/ioatcontrol.8 head/tools/tools/ioat/ioatcontrol.c Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Thu Oct 29 03:28:28 2015 (r290128) +++ head/sys/dev/ioat/ioat_test.c Thu Oct 29 04:16:16 2015 (r290129) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "ioat.h" @@ -120,6 +121,18 @@ test_transaction *ioat_test_transaction_ return (tx); } +static void +dump_hex(void *p, size_t chunks) +{ + size_t i, j; + + for (i = 0; i < chunks; i++) { + for (j = 0; j < 8; j++) + printf("%08x ", ((uint32_t *)p)[i * 8 + j]); + printf("\n"); + } +} + static bool ioat_compare_ok(struct test_transaction *tx) { @@ -140,9 +153,14 @@ ioat_compare_ok(struct test_transaction != 0) return (false); } - } else if (test->testkind == IOAT_TEST_DMA) + } else if (test->testkind == IOAT_TEST_DMA) { if (memcmp(src, dst, tx->length) != 0) return (false); + } else if (test->testkind == IOAT_TEST_RAW_DMA) { + if (test->raw_write) + dst = test->raw_vtarget; + dump_hex(dst, tx->length / 32); + } } return (true); } @@ -242,6 +260,13 @@ ioat_test_submit_1_tx(struct ioat_test * src = vtophys((vm_offset_t)tx->buf[2*i]); dest = vtophys((vm_offset_t)tx->buf[2*i+1]); + if (test->testkind == IOAT_TEST_RAW_DMA) { + if (test->raw_write) + dest = test->raw_target; + else + src = test->raw_target; + } + if (i == tx->depth - 1) { cb = ioat_dma_test_callback; flags = DMA_INT_EN; @@ -250,7 +275,8 @@ ioat_test_submit_1_tx(struct ioat_test * flags = 0; } - if (test->testkind == IOAT_TEST_DMA) + if (test->testkind == IOAT_TEST_DMA || + test->testkind == IOAT_TEST_RAW_DMA) desc = ioat_copy(dma, dest, src, tx->length, cb, tx, flags); else if (test->testkind == IOAT_TEST_FILL) { @@ -328,6 +354,16 @@ ioat_dma_test(void *arg) goto out; } + if (test->testkind == IOAT_TEST_RAW_DMA) { + if (test->raw_is_virtual) { + test->raw_vtarget = (void *)test->raw_target; + test->raw_target = vtophys(test->raw_vtarget); + } else { + test->raw_vtarget = pmap_mapdev(test->raw_target, + test->buffer_size); + } + } + index = g_thread_index++; TAILQ_INIT(&test->free_q); TAILQ_INIT(&test->pend_q); @@ -373,6 +409,9 @@ ioat_dma_test(void *arg) ioat_test_release_memory(test); out: + if (test->testkind == IOAT_TEST_RAW_DMA && !test->raw_is_virtual) + pmap_unmapdev((vm_offset_t)test->raw_vtarget, + test->buffer_size); ioat_put_dmaengine(dmaengine); } Modified: head/sys/dev/ioat/ioat_test.h ============================================================================== --- head/sys/dev/ioat/ioat_test.h Thu Oct 29 03:28:28 2015 (r290128) +++ head/sys/dev/ioat/ioat_test.h Thu Oct 29 04:16:16 2015 (r290129) @@ -41,6 +41,7 @@ enum ioat_res { enum ioat_test_kind { IOAT_TEST_FILL = 0, IOAT_TEST_DMA, + IOAT_TEST_RAW_DMA, IOAT_NUM_TESTKINDS }; @@ -66,6 +67,12 @@ struct ioat_test { /* If true, check for miscompares after a copy. */ bool verify; + /* DMA directly to/from some memory address */ + uint64_t raw_target; + void *raw_vtarget; + bool raw_write; + bool raw_is_virtual; + /* Internal usage -- not test inputs */ TAILQ_HEAD(, test_transaction) free_q; TAILQ_HEAD(, test_transaction) pend_q; Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Thu Oct 29 03:28:28 2015 (r290128) +++ head/tools/tools/ioat/ioatcontrol.8 Thu Oct 29 04:16:16 2015 (r290129) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2015 +.Dd October 28, 2015 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -40,6 +40,14 @@ .Ar [ bufsize .Ar [ chain-len .Ar [ duration ] ] ] +.Nm +.Fl r +.Op Fl v +.Op Fl V +.Op Fl w +.Ar channel_number +.Ar address +.Ar [ bufsize ] .Sh DESCRIPTION .Nm allows one to issue some number of test operations to the @@ -55,6 +63,29 @@ tests copy) Verify copies/fills for accuracy .El .Pp +Alternatively one can use +.Nm +.Fl r +to issue DMA to or from a specific +.Ar address . +The arguments in "raw" mode are: +.Bl -tag -width Ds +.It Fl v +.Ar address +is a kernel virtual address (by default, +.Ar address +is assumed to be a physical address) +.It Fl V +Dump the resulting hex to syslog +.It Fl w +Write to the specified +.Ar address +(by default, +.Nm +.Fl r +reads) +.El +.Pp .Nm operates in one of two modes; if the .Ar duration @@ -77,6 +108,7 @@ argument determines the size of buffers .Fn ioat_copy invocation. The default is 256 KB. +In raw mode, the default is 4 KB. .Pp The .Ar chain-len Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Thu Oct 29 03:28:28 2015 (r290128) +++ head/tools/tools/ioat/ioatcontrol.c Thu Oct 29 04:16:16 2015 (r290129) @@ -50,24 +50,72 @@ usage(void) printf("Usage: %s [-fV] [ " "[ [duration]]]\n", getprogname()); + printf(" %s -r [-vV] []\n", + getprogname()); exit(EX_USAGE); } +static void +main_raw(struct ioat_test *t, int argc, char **argv) +{ + int fd; + + /* Raw DMA defaults */ + t->testkind = IOAT_TEST_RAW_DMA; + t->transactions = 1; + t->chain_depth = 1; + t->buffer_size = 4 * 1024; + + t->raw_target = strtoull(argv[1], NULL, 0); + if (t->raw_target == 0) { + printf("Target shoudln't be NULL\n"); + exit(EX_USAGE); + } + + if (argc >= 3) { + t->buffer_size = atoi(argv[2]); + if (t->buffer_size == 0) { + printf("Buffer size must be greater than zero\n"); + exit(EX_USAGE); + } + } + + fd = open("/dev/ioat_test", O_RDWR); + if (fd < 0) { + printf("Cannot open /dev/ioat_test\n"); + exit(EX_UNAVAILABLE); + } + + (void)ioctl(fd, IOAT_DMATEST, t); + close(fd); + + exit(prettyprint(t)); +} + int main(int argc, char **argv) { struct ioat_test t; int fd, ch; - bool fflag; + bool fflag, rflag; - while ((ch = getopt(argc, argv, "fV")) != -1) { + while ((ch = getopt(argc, argv, "rfvVw")) != -1) { switch (ch) { case 'f': fflag = true; break; + case 'r': + rflag = true; + break; + case 'v': + t.raw_is_virtual = true; + break; case 'V': t.verify = true; break; + case 'w': + t.raw_write = true; + break; default: usage(); } @@ -78,6 +126,11 @@ main(int argc, char **argv) if (argc < 2) usage(); + if (rflag && fflag) { + printf("Invalid: -r and -f\n"); + usage(); + } + /* Defaults for optional args */ t.buffer_size = 256 * 1024; t.chain_depth = 2; @@ -93,6 +146,11 @@ main(int argc, char **argv) return (EX_USAGE); } + if (rflag) { + main_raw(&t, argc, argv); + return (EX_OK); + } + t.transactions = atoi(argv[1]); if (argc >= 3) { From owner-svn-src-head@freebsd.org Thu Oct 29 04:16:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C65CAA2099D; Thu, 29 Oct 2015 04:16:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E91A1E46; Thu, 29 Oct 2015 04:16:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T4GSD5044280; Thu, 29 Oct 2015 04:16:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4GSG7044279; Thu, 29 Oct 2015 04:16:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510290416.t9T4GSG7044279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 04:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290130 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 04:16:29 -0000 Author: cem Date: Thu Oct 29 04:16:28 2015 New Revision: 290130 URL: https://svnweb.freebsd.org/changeset/base/290130 Log: ntb: Do not attempt to set write-combining on MWs AMD64 pmap assumes ranges will be in the DMAP, which isn't necessarily true for NTB memory windows (especially 64-bit BARs). Suggested by: pmap_change_attr_locked -> kassert_panic Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Oct 29 04:16:16 2015 (r290129) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Oct 29 04:16:28 2015 (r290130) @@ -755,9 +755,13 @@ map_memory_window_bar(struct ntb_softc * save_bar_parameters(bar); } +#if 0 /* XXX: amd64 pmap_change_attr() assumes region lies in DMAP. */ /* Mark bar region as write combining to improve performance. */ rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, VM_MEMATTR_WRITE_COMBINING); +#else + rc = EINVAL; +#endif print_map_success(ntb, bar, "mw"); if (rc == 0) device_printf(ntb->device, From owner-svn-src-head@freebsd.org Thu Oct 29 04:16:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D7FBA209D9; Thu, 29 Oct 2015 04:16:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0CA411F98; Thu, 29 Oct 2015 04:16:40 +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 t9T4Ge7c044331; Thu, 29 Oct 2015 04:16:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4GeaS044329; Thu, 29 Oct 2015 04:16:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510290416.t9T4GeaS044329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 04:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290131 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 04:16:41 -0000 Author: cem Date: Thu Oct 29 04:16:39 2015 New Revision: 290131 URL: https://svnweb.freebsd.org/changeset/base/290131 Log: ioat: Drain/quiesce the device less racily On detach and during a forced HW reset. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Oct 29 04:16:28 2015 (r290130) +++ head/sys/dev/ioat/ioat.c Thu Oct 29 04:16:39 2015 (r290131) @@ -96,7 +96,7 @@ static inline struct ioat_softc *ioat_ge static inline void ioat_put(struct ioat_softc *, enum ioat_ref_kind); static inline void ioat_putn(struct ioat_softc *, uint32_t, enum ioat_ref_kind); -static void ioat_drain(struct ioat_softc *); +static void ioat_drain_locked(struct ioat_softc *); #define ioat_log_message(v, ...) do { \ if ((v) <= g_ioat_debug_level) { \ @@ -271,6 +271,7 @@ ioat_attach(device_t device) ioat_process_events(ioat); ioat_setup_sysctl(device); + ioat->chan_idx = ioat_channel_index; ioat_channel[ioat_channel_index++] = ioat; ioat_test_attach(); @@ -288,7 +289,13 @@ ioat_detach(device_t device) ioat = DEVICE2SOFTC(device); ioat_test_detach(); - ioat_drain(ioat); + + mtx_lock(IOAT_REFLK); + ioat->quiescing = TRUE; + ioat_channel[ioat->chan_idx] = NULL; + + ioat_drain_locked(ioat); + mtx_unlock(IOAT_REFLK); ioat_teardown_intr(ioat); callout_drain(&ioat->timer); @@ -614,10 +621,16 @@ out: bus_dmaengine_t ioat_get_dmaengine(uint32_t index) { + struct ioat_softc *sc; if (index >= ioat_channel_index) return (NULL); - return (&ioat_get(ioat_channel[index], IOAT_DMAENGINE_REF)->dmaengine); + + sc = ioat_channel[index]; + if (sc == NULL || sc->quiescing) + return (NULL); + + return (&ioat_get(sc, IOAT_DMAENGINE_REF)->dmaengine); } void @@ -887,6 +900,10 @@ ioat_reserve_space(struct ioat_softc *io error = EINVAL; goto out; } + if (ioat->quiescing) { + error = ENXIO; + goto out; + } for (;;) { if (ioat_get_ring_space(ioat) >= num_descs) @@ -1238,6 +1255,12 @@ ioat_reset_hw(struct ioat_softc *ioat) uint64_t status; uint32_t chanerr; unsigned timeout; + int error; + + mtx_lock(IOAT_REFLK); + ioat->quiescing = TRUE; + ioat_drain_locked(ioat); + mtx_unlock(IOAT_REFLK); status = ioat_get_chansts(ioat); if (is_ioat_active(status) || is_ioat_idle(status)) @@ -1249,8 +1272,10 @@ ioat_reset_hw(struct ioat_softc *ioat) DELAY(1000); status = ioat_get_chansts(ioat); } - if (timeout == 20) - return (ETIMEDOUT); + if (timeout == 20) { + error = ETIMEDOUT; + goto out; + } KASSERT(ioat_get_active(ioat) == 0, ("active after quiesce")); @@ -1280,8 +1305,10 @@ ioat_reset_hw(struct ioat_softc *ioat) /* Wait at most 20 ms */ for (timeout = 0; ioat_reset_pending(ioat) && timeout < 20; timeout++) DELAY(1000); - if (timeout == 20) - return (ETIMEDOUT); + if (timeout == 20) { + error = ETIMEDOUT; + goto out; + } if (ioat_model_resets_msix(ioat)) { ioat_log_message(1, "device resets registers; restored\n"); @@ -1294,13 +1321,16 @@ ioat_reset_hw(struct ioat_softc *ioat) /* So this really shouldn't happen... */ ioat_log_message(0, "Device is active after a reset?\n"); ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); - return (0); + error = 0; + goto out; } chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); ioat_halted_debug(ioat, chanerr); - if (chanerr != 0) - return (EIO); + if (chanerr != 0) { + error = EIO; + goto out; + } /* * Bring device back online after reset. Writing CHAINADDR brings the @@ -1315,7 +1345,17 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); ioat_write_chainaddr(ioat, ioat->ring[0]->hw_desc_bus_addr); - return (ioat_start_channel(ioat)); + error = 0; + +out: + mtx_lock(IOAT_REFLK); + ioat->quiescing = FALSE; + mtx_unlock(IOAT_REFLK); + + if (error == 0) + error = ioat_start_channel(ioat); + + return (error); } static int @@ -1456,11 +1496,10 @@ ioat_put(struct ioat_softc *ioat, enum i } static void -ioat_drain(struct ioat_softc *ioat) +ioat_drain_locked(struct ioat_softc *ioat) { - mtx_lock(IOAT_REFLK); + mtx_assert(IOAT_REFLK, MA_OWNED); while (ioat->refcnt > 0) msleep(IOAT_REFLK, IOAT_REFLK, 0, "ioat_drain", 0); - mtx_unlock(IOAT_REFLK); } Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Thu Oct 29 04:16:28 2015 (r290130) +++ head/sys/dev/ioat/ioat_internal.h Thu Oct 29 04:16:39 2015 (r290131) @@ -365,6 +365,7 @@ struct ioat_softc { }) int version; + int chan_idx; struct mtx submit_lock; device_t device; @@ -389,6 +390,7 @@ struct ioat_softc { struct callout timer; + boolean_t quiescing; boolean_t is_resize_pending; boolean_t is_completion_pending; boolean_t is_reset_pending; From owner-svn-src-head@freebsd.org Thu Oct 29 04:16:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F30BA20A17; Thu, 29 Oct 2015 04:16:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1C3E910EF; Thu, 29 Oct 2015 04:16:53 +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 t9T4Gqha044381; Thu, 29 Oct 2015 04:16:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4GqDM044380; Thu, 29 Oct 2015 04:16:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510290416.t9T4GqDM044380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 04:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290132 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 04:16:53 -0000 Author: cem Date: Thu Oct 29 04:16:52 2015 New Revision: 290132 URL: https://svnweb.freebsd.org/changeset/base/290132 Log: ioat_test: Handled forced hardware resets gracefully Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_test.c Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Thu Oct 29 04:16:39 2015 (r290131) +++ head/sys/dev/ioat/ioat_test.c Thu Oct 29 04:16:52 2015 (r290132) @@ -284,12 +284,23 @@ ioat_test_submit_1_tx(struct ioat_test * desc = ioat_blockfill(dma, dest, fillpattern, tx->length, cb, tx, flags); } - if (desc == NULL) - panic("Failed to allocate a ring slot " - "-- this shouldn't happen!"); + break; } ioat_release(dma); + + /* + * We couldn't issue an IO -- either the device is being detached or + * the HW reset. Essentially spin until the device comes back up or + * our timer expires. + */ + if (desc == NULL && tx->depth > 0) { + atomic_add_32(&test->status[IOAT_TEST_NO_DMA_ENGINE], tx->depth); + IT_LOCK(); + TAILQ_REMOVE(&test->pend_q, tx, entry); + TAILQ_INSERT_HEAD(&test->free_q, tx, entry); + IT_UNLOCK(); + } } static void From owner-svn-src-head@freebsd.org Thu Oct 29 04:21:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEED7A20B53; Thu, 29 Oct 2015 04:21:35 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 87E641436; Thu, 29 Oct 2015 04:21:35 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T4LYr3046506; Thu, 29 Oct 2015 04:21:34 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4LYaO046504; Thu, 29 Oct 2015 04:21:34 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201510290421.t9T4LYaO046504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 29 Oct 2015 04:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290133 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 04:21:35 -0000 Author: kevlo Date: Thu Oct 29 04:21:34 2015 New Revision: 290133 URL: https://svnweb.freebsd.org/changeset/base/290133 Log: - Add a missing prototype - Fix typos Modified: head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860var.h Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Thu Oct 29 04:16:52 2015 (r290132) +++ head/sys/dev/ral/rt2860.c Thu Oct 29 04:21:34 2015 (r290133) @@ -115,6 +115,7 @@ static void rt2860_tx_intr(struct rt2860 static void rt2860_rx_intr(struct rt2860_softc *); static void rt2860_tbtt_intr(struct rt2860_softc *); static void rt2860_gp_intr(struct rt2860_softc *); +static void rt2860_intr(void *); static int rt2860_tx(struct rt2860_softc *, struct mbuf *, struct ieee80211_node *); static int rt2860_raw_xmit(struct ieee80211_node *, struct mbuf *, @@ -513,7 +514,7 @@ rt2860_alloc_tx_ring(struct rt2860_softc BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ring->desc_dmat); if (error != 0) { - device_printf(sc->sc_dev, "could not create desc DMA map\n"); + device_printf(sc->sc_dev, "could not create desc DMA tag\n"); goto fail; } @@ -1386,7 +1387,7 @@ rt2860_gp_intr(struct rt2860_softc *sc) rt2860_updatestats(sc); } -void +static void rt2860_intr(void *arg) { struct rt2860_softc *sc = arg; @@ -1699,7 +1700,7 @@ rt2860_raw_xmit(struct ieee80211_node *n RAL_LOCK(sc); /* prevent management frames from being sent if we're not ready */ - if (!(sc->sc_flags & RT2860_RUNNNING)) { + if (!(sc->sc_flags & RT2860_RUNNING)) { RAL_UNLOCK(sc); m_freem(m); return ENETDOWN; @@ -1940,7 +1941,7 @@ rt2860_transmit(struct ieee80211com *ic, int error; RAL_LOCK(sc); - if ((sc->sc_flags & RT2860_RUNNNING) == 0) { + if ((sc->sc_flags & RT2860_RUNNING) == 0) { RAL_UNLOCK(sc); return (ENXIO); } @@ -1963,7 +1964,7 @@ rt2860_start(struct rt2860_softc *sc) RAL_LOCK_ASSERT(sc); - if ((sc->sc_flags & RT2860_RUNNNING) == 0) + if ((sc->sc_flags & RT2860_RUNNING) == 0) return; while (!SLIST_EMPTY(&sc->data_pool) && sc->qfullmsk == 0 && @@ -1986,7 +1987,7 @@ rt2860_watchdog(void *arg) RAL_LOCK_ASSERT(sc); - KASSERT(sc->sc_flags & RT2860_RUNNNING, ("not running")); + KASSERT(sc->sc_flags & RT2860_RUNNING, ("not running")); if (sc->sc_invalid) /* card ejected */ return; @@ -2009,12 +2010,12 @@ rt2860_parent(struct ieee80211com *ic) RAL_LOCK(sc); if (ic->ic_nrunning> 0) { - if (!(sc->sc_flags & RT2860_RUNNNING)) { + if (!(sc->sc_flags & RT2860_RUNNING)) { rt2860_init_locked(sc); startall = 1; } else rt2860_update_promisc(ic); - } else if (sc->sc_flags & RT2860_RUNNNING) + } else if (sc->sc_flags & RT2860_RUNNING) rt2860_stop_locked(sc); RAL_UNLOCK(sc); if (startall) @@ -3791,7 +3792,7 @@ rt2860_init(void *arg) rt2860_init_locked(sc); RAL_UNLOCK(sc); - if (sc->sc_flags & RT2860_RUNNNING) + if (sc->sc_flags & RT2860_RUNNING) ieee80211_start_all(ic); } @@ -4051,7 +4052,7 @@ rt2860_init_locked(struct rt2860_softc * if (sc->sc_flags & RT2860_ADVANCED_PS) rt2860_mcu_cmd(sc, RT2860_MCU_CMD_PSLEVEL, sc->pslevel, 0); - sc->sc_flags |= RT2860_RUNNNING; + sc->sc_flags |= RT2860_RUNNING; callout_reset(&sc->watchdog_ch, hz, rt2860_watchdog, sc); } @@ -4072,12 +4073,12 @@ rt2860_stop_locked(struct rt2860_softc * uint32_t tmp; int qid; - if (sc->sc_flags & RT2860_RUNNNING) + if (sc->sc_flags & RT2860_RUNNING) rt2860_set_leds(sc, 0); /* turn all LEDs off */ callout_stop(&sc->watchdog_ch); sc->sc_tx_timer = 0; - sc->sc_flags &= ~RT2860_RUNNNING; + sc->sc_flags &= ~RT2860_RUNNING; /* disable interrupts */ RAL_WRITE(sc, RT2860_INT_MASK, 0); Modified: head/sys/dev/ral/rt2860var.h ============================================================================== --- head/sys/dev/ral/rt2860var.h Thu Oct 29 04:16:52 2015 (r290132) +++ head/sys/dev/ral/rt2860var.h Thu Oct 29 04:21:34 2015 (r290133) @@ -139,7 +139,7 @@ struct rt2860_softc { #define RT2860_ENABLED (1 << 0) #define RT2860_ADVANCED_PS (1 << 1) #define RT2860_PCIE (1 << 2) -#define RT2860_RUNNNING (1 << 3) +#define RT2860_RUNNING (1 << 3) struct ieee80211_node *wcid2ni[RT2860_WCID_MAX]; From owner-svn-src-head@freebsd.org Thu Oct 29 04:51:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 370A7A200E0; Thu, 29 Oct 2015 04:51:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 ED25D1ED6; Thu, 29 Oct 2015 04:51:28 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T4pSn6054883; Thu, 29 Oct 2015 04:51:28 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4pSRE054882; Thu, 29 Oct 2015 04:51:28 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201510290451.t9T4pSRE054882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 29 Oct 2015 04:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290134 - head/sys/dev/ral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 04:51:29 -0000 Author: kevlo Date: Thu Oct 29 04:51:27 2015 New Revision: 290134 URL: https://svnweb.freebsd.org/changeset/base/290134 Log: Remove the static function declaration. Modified: head/sys/dev/ral/rt2860.c Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Thu Oct 29 04:21:34 2015 (r290133) +++ head/sys/dev/ral/rt2860.c Thu Oct 29 04:51:27 2015 (r290134) @@ -115,7 +115,6 @@ static void rt2860_tx_intr(struct rt2860 static void rt2860_rx_intr(struct rt2860_softc *); static void rt2860_tbtt_intr(struct rt2860_softc *); static void rt2860_gp_intr(struct rt2860_softc *); -static void rt2860_intr(void *); static int rt2860_tx(struct rt2860_softc *, struct mbuf *, struct ieee80211_node *); static int rt2860_raw_xmit(struct ieee80211_node *, struct mbuf *, @@ -1387,7 +1386,7 @@ rt2860_gp_intr(struct rt2860_softc *sc) rt2860_updatestats(sc); } -static void +void rt2860_intr(void *arg) { struct rt2860_softc *sc = arg; From owner-svn-src-head@freebsd.org Thu Oct 29 07:53:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8097A20BDF; Thu, 29 Oct 2015 07:53:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 61E7A1A49; Thu, 29 Oct 2015 07:53:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t9T7ricF076526 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 29 Oct 2015 09:53:44 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t9T7ricF076526 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t9T7rhML076525; Thu, 29 Oct 2015 09:53:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Oct 2015 09:53:43 +0200 From: Konstantin Belousov To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290130 - head/sys/dev/ntb/ntb_hw Message-ID: <20151029075343.GO2257@kib.kiev.ua> References: <201510290416.t9T4GSG7044279@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201510290416.t9T4GSG7044279@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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.20 Precedence: list List-Id: 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, 29 Oct 2015 07:53:50 -0000 On Thu, Oct 29, 2015 at 04:16:28AM +0000, Conrad E. Meyer wrote: > Author: cem > Date: Thu Oct 29 04:16:28 2015 > New Revision: 290130 > URL: https://svnweb.freebsd.org/changeset/base/290130 > > Log: > ntb: Do not attempt to set write-combining on MWs > > AMD64 pmap assumes ranges will be in the DMAP, which isn't necessarily > true for NTB memory windows (especially 64-bit BARs). I am not sure what do you mean. pmap_change_attr() handles either DMAP or kernel mapped memory. > > Suggested by: pmap_change_attr_locked -> kassert_panic > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/ntb/ntb_hw/ntb_hw.c > > Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c > ============================================================================== > --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Oct 29 04:16:16 2015 (r290129) > +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Oct 29 04:16:28 2015 (r290130) > @@ -755,9 +755,13 @@ map_memory_window_bar(struct ntb_softc * > save_bar_parameters(bar); > } > > +#if 0 /* XXX: amd64 pmap_change_attr() assumes region lies in DMAP. */ > /* Mark bar region as write combining to improve performance. */ > rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, > VM_MEMATTR_WRITE_COMBINING); > +#else > + rc = EINVAL; > +#endif > print_map_success(ntb, bar, "mw"); > if (rc == 0) > device_printf(ntb->device, From owner-svn-src-head@freebsd.org Thu Oct 29 08:28:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C6EFA2034A; Thu, 29 Oct 2015 08:28:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4D11181E; Thu, 29 Oct 2015 08:28:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T8SeOU015913; Thu, 29 Oct 2015 08:28:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T8SdKw015903; Thu, 29 Oct 2015 08:28:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510290828.t9T8SdKw015903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 29 Oct 2015 08:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290135 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux compat/linuxkpi/common/include/net compat/linuxkpi/common/src conf dev/usb modules/cxgb/iw... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 08:28:42 -0000 Author: hselasky Date: Thu Oct 29 08:28:39 2015 New Revision: 290135 URL: https://svnweb.freebsd.org/changeset/base/290135 Log: Finish process of moving the LinuxKPI module into the default kernel build. - Move all files related to the LinuxKPI into sys/compat/linuxkpi and its subfolders. - Update sys/conf/files and some Makefiles to use new file locations. - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn adds the LinuxKPI to all LINT builds. - The LinuxKPI can be added to the kernel by setting the COMPAT_LINUXKPI option. The OFED kernel option no longer builds the LinuxKPI into the kernel. This was done to keep the build rules for the LinuxKPI in sys/conf/files simple. - Extend the LinuxKPI module to include support for USB by moving the Linux USB compat from usb.ko to linuxkpi.ko. - Bump the FreeBSD_version. - A universe kernel build has been done. Reviewed by: np @ (cxgb and cxgbe related changes only) Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h - copied unchanged from r290045, head/sys/ofed/include/asm/atomic-long.h head/sys/compat/linuxkpi/common/include/asm/atomic.h - copied unchanged from r290042, head/sys/ofed/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/byteorder.h - copied unchanged from r290042, head/sys/ofed/include/asm/byteorder.h head/sys/compat/linuxkpi/common/include/asm/fcntl.h - copied unchanged from r290042, head/sys/ofed/include/asm/fcntl.h head/sys/compat/linuxkpi/common/include/asm/io.h - copied unchanged from r290042, head/sys/ofed/include/asm/io.h head/sys/compat/linuxkpi/common/include/asm/pgtable.h - copied unchanged from r290042, head/sys/ofed/include/asm/pgtable.h head/sys/compat/linuxkpi/common/include/asm/types.h - copied unchanged from r290042, head/sys/ofed/include/asm/types.h head/sys/compat/linuxkpi/common/include/asm/uaccess.h - copied unchanged from r290042, head/sys/ofed/include/asm/uaccess.h head/sys/compat/linuxkpi/common/include/linux/bitops.h - copied unchanged from r290042, head/sys/ofed/include/linux/bitops.h head/sys/compat/linuxkpi/common/include/linux/cache.h - copied unchanged from r290042, head/sys/ofed/include/linux/cache.h head/sys/compat/linuxkpi/common/include/linux/cdev.h - copied unchanged from r290042, head/sys/ofed/include/linux/cdev.h head/sys/compat/linuxkpi/common/include/linux/clocksource.h - copied unchanged from r290042, head/sys/ofed/include/linux/clocksource.h head/sys/compat/linuxkpi/common/include/linux/compat.h - copied unchanged from r290042, head/sys/ofed/include/linux/compat.h head/sys/compat/linuxkpi/common/include/linux/compiler.h - copied unchanged from r290042, head/sys/ofed/include/linux/compiler.h head/sys/compat/linuxkpi/common/include/linux/completion.h - copied unchanged from r290042, head/sys/ofed/include/linux/completion.h head/sys/compat/linuxkpi/common/include/linux/delay.h - copied unchanged from r290042, head/sys/ofed/include/linux/delay.h head/sys/compat/linuxkpi/common/include/linux/device.h - copied unchanged from r290042, head/sys/ofed/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/dma-attrs.h - copied unchanged from r290042, head/sys/ofed/include/linux/dma-attrs.h head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h - copied unchanged from r290042, head/sys/ofed/include/linux/dma-mapping.h head/sys/compat/linuxkpi/common/include/linux/dmapool.h - copied unchanged from r290042, head/sys/ofed/include/linux/dmapool.h head/sys/compat/linuxkpi/common/include/linux/err.h - copied unchanged from r290042, head/sys/ofed/include/linux/err.h head/sys/compat/linuxkpi/common/include/linux/errno.h - copied unchanged from r290042, head/sys/ofed/include/linux/errno.h head/sys/compat/linuxkpi/common/include/linux/etherdevice.h - copied unchanged from r290042, head/sys/ofed/include/linux/etherdevice.h head/sys/compat/linuxkpi/common/include/linux/file.h - copied unchanged from r290042, head/sys/ofed/include/linux/file.h head/sys/compat/linuxkpi/common/include/linux/fs.h - copied unchanged from r290042, head/sys/ofed/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/gfp.h - copied unchanged from r290042, head/sys/ofed/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/hardirq.h - copied unchanged from r290042, head/sys/ofed/include/linux/hardirq.h head/sys/compat/linuxkpi/common/include/linux/idr.h - copied unchanged from r290042, head/sys/ofed/include/linux/idr.h head/sys/compat/linuxkpi/common/include/linux/if_arp.h - copied unchanged from r290042, head/sys/ofed/include/linux/if_arp.h head/sys/compat/linuxkpi/common/include/linux/if_ether.h - copied unchanged from r290042, head/sys/ofed/include/linux/if_ether.h head/sys/compat/linuxkpi/common/include/linux/if_vlan.h - copied unchanged from r290042, head/sys/ofed/include/linux/if_vlan.h head/sys/compat/linuxkpi/common/include/linux/in.h - copied unchanged from r290042, head/sys/ofed/include/linux/in.h head/sys/compat/linuxkpi/common/include/linux/in6.h - copied unchanged from r290042, head/sys/ofed/include/linux/in6.h head/sys/compat/linuxkpi/common/include/linux/inetdevice.h - copied unchanged from r290042, head/sys/ofed/include/linux/inetdevice.h head/sys/compat/linuxkpi/common/include/linux/interrupt.h - copied unchanged from r290042, head/sys/ofed/include/linux/interrupt.h head/sys/compat/linuxkpi/common/include/linux/io-mapping.h - copied unchanged from r290042, head/sys/ofed/include/linux/io-mapping.h head/sys/compat/linuxkpi/common/include/linux/io.h - copied unchanged from r290042, head/sys/ofed/include/linux/io.h head/sys/compat/linuxkpi/common/include/linux/ioctl.h - copied unchanged from r290042, head/sys/ofed/include/linux/ioctl.h head/sys/compat/linuxkpi/common/include/linux/jhash.h - copied unchanged from r290042, head/sys/ofed/include/linux/jhash.h head/sys/compat/linuxkpi/common/include/linux/jiffies.h - copied unchanged from r290042, head/sys/ofed/include/linux/jiffies.h head/sys/compat/linuxkpi/common/include/linux/kdev_t.h - copied unchanged from r290042, head/sys/ofed/include/linux/kdev_t.h head/sys/compat/linuxkpi/common/include/linux/kernel.h - copied unchanged from r290042, head/sys/ofed/include/linux/kernel.h head/sys/compat/linuxkpi/common/include/linux/kmod.h - copied unchanged from r290042, head/sys/ofed/include/linux/kmod.h head/sys/compat/linuxkpi/common/include/linux/kobject.h - copied unchanged from r290042, head/sys/ofed/include/linux/kobject.h head/sys/compat/linuxkpi/common/include/linux/kref.h - copied unchanged from r290042, head/sys/ofed/include/linux/kref.h head/sys/compat/linuxkpi/common/include/linux/kthread.h - copied unchanged from r290042, head/sys/ofed/include/linux/kthread.h head/sys/compat/linuxkpi/common/include/linux/ktime.h - copied unchanged from r290042, head/sys/ofed/include/linux/ktime.h head/sys/compat/linuxkpi/common/include/linux/list.h - copied unchanged from r290042, head/sys/ofed/include/linux/list.h head/sys/compat/linuxkpi/common/include/linux/lockdep.h - copied unchanged from r290042, head/sys/ofed/include/linux/lockdep.h head/sys/compat/linuxkpi/common/include/linux/log2.h - copied unchanged from r290042, head/sys/ofed/include/linux/log2.h head/sys/compat/linuxkpi/common/include/linux/math64.h - copied unchanged from r290042, head/sys/ofed/include/linux/math64.h head/sys/compat/linuxkpi/common/include/linux/miscdevice.h - copied unchanged from r290042, head/sys/ofed/include/linux/miscdevice.h head/sys/compat/linuxkpi/common/include/linux/mm.h - copied unchanged from r290042, head/sys/ofed/include/linux/mm.h head/sys/compat/linuxkpi/common/include/linux/module.h - copied unchanged from r290042, head/sys/ofed/include/linux/module.h head/sys/compat/linuxkpi/common/include/linux/moduleparam.h - copied unchanged from r290042, head/sys/ofed/include/linux/moduleparam.h head/sys/compat/linuxkpi/common/include/linux/mutex.h - copied unchanged from r290042, head/sys/ofed/include/linux/mutex.h head/sys/compat/linuxkpi/common/include/linux/net.h - copied unchanged from r290042, head/sys/ofed/include/linux/net.h head/sys/compat/linuxkpi/common/include/linux/netdevice.h - copied unchanged from r290042, head/sys/ofed/include/linux/netdevice.h head/sys/compat/linuxkpi/common/include/linux/notifier.h - copied unchanged from r290042, head/sys/ofed/include/linux/notifier.h head/sys/compat/linuxkpi/common/include/linux/page.h - copied unchanged from r290042, head/sys/ofed/include/linux/page.h head/sys/compat/linuxkpi/common/include/linux/pci.h - copied unchanged from r290042, head/sys/ofed/include/linux/pci.h head/sys/compat/linuxkpi/common/include/linux/poll.h - copied unchanged from r290042, head/sys/ofed/include/linux/poll.h head/sys/compat/linuxkpi/common/include/linux/printk.h - copied unchanged from r290042, head/sys/ofed/include/linux/printk.h head/sys/compat/linuxkpi/common/include/linux/radix-tree.h - copied unchanged from r290042, head/sys/ofed/include/linux/radix-tree.h head/sys/compat/linuxkpi/common/include/linux/random.h - copied unchanged from r290042, head/sys/ofed/include/linux/random.h head/sys/compat/linuxkpi/common/include/linux/rbtree.h - copied unchanged from r290042, head/sys/ofed/include/linux/rbtree.h head/sys/compat/linuxkpi/common/include/linux/rwlock.h - copied unchanged from r290042, head/sys/ofed/include/linux/rwlock.h head/sys/compat/linuxkpi/common/include/linux/rwsem.h - copied unchanged from r290042, head/sys/ofed/include/linux/rwsem.h head/sys/compat/linuxkpi/common/include/linux/scatterlist.h - copied unchanged from r290042, head/sys/ofed/include/linux/scatterlist.h head/sys/compat/linuxkpi/common/include/linux/sched.h - copied unchanged from r290042, head/sys/ofed/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/semaphore.h - copied unchanged from r290042, head/sys/ofed/include/linux/semaphore.h head/sys/compat/linuxkpi/common/include/linux/slab.h - copied unchanged from r290042, head/sys/ofed/include/linux/slab.h head/sys/compat/linuxkpi/common/include/linux/socket.h - copied unchanged from r290042, head/sys/ofed/include/linux/socket.h head/sys/compat/linuxkpi/common/include/linux/spinlock.h - copied unchanged from r290042, head/sys/ofed/include/linux/spinlock.h head/sys/compat/linuxkpi/common/include/linux/string.h - copied unchanged from r290042, head/sys/ofed/include/linux/string.h head/sys/compat/linuxkpi/common/include/linux/sysfs.h - copied unchanged from r290042, head/sys/ofed/include/linux/sysfs.h head/sys/compat/linuxkpi/common/include/linux/time.h - copied unchanged from r290042, head/sys/ofed/include/linux/time.h head/sys/compat/linuxkpi/common/include/linux/timer.h - copied unchanged from r290042, head/sys/ofed/include/linux/timer.h head/sys/compat/linuxkpi/common/include/linux/types.h - copied unchanged from r290042, head/sys/ofed/include/linux/types.h head/sys/compat/linuxkpi/common/include/linux/uaccess.h - copied unchanged from r290042, head/sys/ofed/include/linux/uaccess.h head/sys/compat/linuxkpi/common/include/linux/usb.h - copied unchanged from r290045, head/sys/dev/usb/usb_compat_linux.h head/sys/compat/linuxkpi/common/include/linux/vmalloc.h - copied unchanged from r290042, head/sys/ofed/include/linux/vmalloc.h head/sys/compat/linuxkpi/common/include/linux/wait.h - copied unchanged from r290042, head/sys/ofed/include/linux/wait.h head/sys/compat/linuxkpi/common/include/linux/workqueue.h - copied unchanged from r290042, head/sys/ofed/include/linux/workqueue.h head/sys/compat/linuxkpi/common/include/net/ - copied from r290045, head/sys/ofed/include/net/ head/sys/compat/linuxkpi/common/src/linux_compat.c - copied unchanged from r290042, head/sys/ofed/include/linux/linux_compat.c head/sys/compat/linuxkpi/common/src/linux_idr.c - copied unchanged from r290042, head/sys/ofed/include/linux/linux_idr.c head/sys/compat/linuxkpi/common/src/linux_kmod.c - copied unchanged from r290042, head/sys/ofed/include/linux/linux_kmod.c head/sys/compat/linuxkpi/common/src/linux_pci.c - copied unchanged from r290042, head/sys/ofed/include/linux/linux_pci.c head/sys/compat/linuxkpi/common/src/linux_radix.c - copied unchanged from r290042, head/sys/ofed/include/linux/linux_radix.c head/sys/compat/linuxkpi/common/src/linux_usb.c - copied, changed from r290134, head/sys/dev/usb/usb_compat_linux.c Deleted: head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_compat_linux.h head/sys/ofed/include/asm/ head/sys/ofed/include/linux/bitops.h head/sys/ofed/include/linux/cache.h head/sys/ofed/include/linux/cdev.h head/sys/ofed/include/linux/clocksource.h head/sys/ofed/include/linux/compat.h head/sys/ofed/include/linux/compiler.h head/sys/ofed/include/linux/completion.h head/sys/ofed/include/linux/delay.h head/sys/ofed/include/linux/device.h head/sys/ofed/include/linux/dma-attrs.h head/sys/ofed/include/linux/dma-mapping.h head/sys/ofed/include/linux/dmapool.h head/sys/ofed/include/linux/err.h head/sys/ofed/include/linux/errno.h head/sys/ofed/include/linux/etherdevice.h head/sys/ofed/include/linux/file.h head/sys/ofed/include/linux/fs.h head/sys/ofed/include/linux/gfp.h head/sys/ofed/include/linux/hardirq.h head/sys/ofed/include/linux/idr.h head/sys/ofed/include/linux/if_arp.h head/sys/ofed/include/linux/if_ether.h head/sys/ofed/include/linux/if_vlan.h head/sys/ofed/include/linux/in.h head/sys/ofed/include/linux/in6.h head/sys/ofed/include/linux/inetdevice.h head/sys/ofed/include/linux/interrupt.h head/sys/ofed/include/linux/io-mapping.h head/sys/ofed/include/linux/io.h head/sys/ofed/include/linux/ioctl.h head/sys/ofed/include/linux/jhash.h head/sys/ofed/include/linux/jiffies.h head/sys/ofed/include/linux/kdev_t.h head/sys/ofed/include/linux/kernel.h head/sys/ofed/include/linux/kmod.h head/sys/ofed/include/linux/kobject.h head/sys/ofed/include/linux/kref.h head/sys/ofed/include/linux/kthread.h head/sys/ofed/include/linux/ktime.h head/sys/ofed/include/linux/linux_compat.c head/sys/ofed/include/linux/linux_idr.c head/sys/ofed/include/linux/linux_kmod.c head/sys/ofed/include/linux/linux_pci.c head/sys/ofed/include/linux/linux_radix.c head/sys/ofed/include/linux/list.h head/sys/ofed/include/linux/lockdep.h head/sys/ofed/include/linux/log2.h head/sys/ofed/include/linux/math64.h head/sys/ofed/include/linux/miscdevice.h head/sys/ofed/include/linux/mm.h head/sys/ofed/include/linux/module.h head/sys/ofed/include/linux/moduleparam.h head/sys/ofed/include/linux/mutex.h head/sys/ofed/include/linux/net.h head/sys/ofed/include/linux/netdevice.h head/sys/ofed/include/linux/notifier.h head/sys/ofed/include/linux/page.h head/sys/ofed/include/linux/pci.h head/sys/ofed/include/linux/poll.h head/sys/ofed/include/linux/printk.h head/sys/ofed/include/linux/radix-tree.h head/sys/ofed/include/linux/random.h head/sys/ofed/include/linux/rbtree.h head/sys/ofed/include/linux/rwlock.h head/sys/ofed/include/linux/rwsem.h head/sys/ofed/include/linux/scatterlist.h head/sys/ofed/include/linux/sched.h head/sys/ofed/include/linux/semaphore.h head/sys/ofed/include/linux/slab.h head/sys/ofed/include/linux/socket.h head/sys/ofed/include/linux/spinlock.h head/sys/ofed/include/linux/string.h head/sys/ofed/include/linux/sysfs.h head/sys/ofed/include/linux/time.h head/sys/ofed/include/linux/timer.h head/sys/ofed/include/linux/types.h head/sys/ofed/include/linux/uaccess.h head/sys/ofed/include/linux/vmalloc.h head/sys/ofed/include/linux/wait.h head/sys/ofed/include/linux/workqueue.h head/sys/ofed/include/net/ Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_dynamic.h head/sys/modules/cxgb/iw_cxgb/Makefile head/sys/modules/cxgbe/iw_cxgbe/Makefile head/sys/modules/ibcore/Makefile head/sys/modules/ipoib/Makefile head/sys/modules/linuxkpi/Makefile head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/modules/mlxen/Makefile head/sys/modules/mthca/Makefile head/sys/modules/rdma/krping/Makefile head/sys/modules/usb/usb/Makefile head/sys/sys/param.h Copied: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h (from r290045, head/sys/ofed/include/asm/atomic-long.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290045, head/sys/ofed/include/asm/atomic-long.h) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ATOMIC_LONG_H_ +#define _ATOMIC_LONG_H_ + +#include +#include +#include + +typedef struct { + volatile u_long counter; +} atomic_long_t; + +#define atomic_long_add(i, v) atomic_long_add_return((i), (v)) +#define atomic_long_inc_return(v) atomic_long_add_return(1, (v)) + +static inline long +atomic_long_add_return(long i, atomic_long_t *v) +{ + return i + atomic_fetchadd_long(&v->counter, i); +} + +static inline void +atomic_long_set(atomic_long_t *v, long i) +{ + atomic_store_rel_long(&v->counter, i); +} + +static inline long +atomic_long_read(atomic_long_t *v) +{ + return atomic_load_acq_long(&v->counter); +} + +static inline long +atomic_long_inc(atomic_long_t *v) +{ + return atomic_fetchadd_long(&v->counter, 1) + 1; +} + +static inline long +atomic_long_dec(atomic_long_t *v) +{ + return atomic_fetchadd_long(&v->counter, -1) - 1; +} + +static inline long +atomic_long_dec_and_test(atomic_long_t *v) +{ + long i = atomic_long_add(-1, v); + return i == 0 ; +} + +#endif /* _ATOMIC_LONG_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/atomic.h (from r290042, head/sys/ofed/include/asm/atomic.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/atomic.h) @@ -0,0 +1,107 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_ATOMIC_H_ +#define _ASM_ATOMIC_H_ + +#include +#include +#include + +typedef struct { + volatile u_int counter; +} atomic_t; + +#define atomic_add(i, v) atomic_add_return((i), (v)) +#define atomic_sub(i, v) atomic_sub_return((i), (v)) +#define atomic_inc_return(v) atomic_add_return(1, (v)) +#define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) +#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) +#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) +#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) +#define atomic_dec_return(v) atomic_sub_return(1, (v)) + +static inline int +atomic_add_return(int i, atomic_t *v) +{ + return i + atomic_fetchadd_int(&v->counter, i); +} + +static inline int +atomic_sub_return(int i, atomic_t *v) +{ + return atomic_fetchadd_int(&v->counter, -i) - i; +} + +static inline void +atomic_set(atomic_t *v, int i) +{ + atomic_store_rel_int(&v->counter, i); +} + +static inline int +atomic_read(atomic_t *v) +{ + return atomic_load_acq_int(&v->counter); +} + +static inline int +atomic_inc(atomic_t *v) +{ + return atomic_fetchadd_int(&v->counter, 1) + 1; +} + +static inline int +atomic_dec(atomic_t *v) +{ + return atomic_fetchadd_int(&v->counter, -1) - 1; +} + +static inline int atomic_add_unless(atomic_t *v, int a, int u) +{ + int c, old; + c = atomic_read(v); + for (;;) { + if (unlikely(c == (u))) + break; + old = atomic_cmpset_int(&v->counter, c, c + (a)); + if (likely(old == c)) + break; + c = old; + } + return c != (u); +} + +#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) + + + + +#endif /* _ASM_ATOMIC_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/byteorder.h (from r290042, head/sys/ofed/include/asm/byteorder.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/byteorder.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/byteorder.h) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_BYTEORDER_H_ +#define _ASM_BYTEORDER_H_ + +#include +#include +#include + +#if BYTE_ORDER == LITTLE_ENDIAN +#define __LITTLE_ENDIAN +#else +#define __BIG_ENDIAN +#endif + +#define cpu_to_le64 htole64 +#define le64_to_cpu le64toh +#define cpu_to_le32 htole32 +#define le32_to_cpu le32toh +#define cpu_to_le16 htole16 +#define le16_to_cpu le16toh +#define cpu_to_be64 htobe64 +#define be64_to_cpu be64toh +#define cpu_to_be32 htobe32 +#define be32_to_cpu be32toh +#define cpu_to_be16 htobe16 +#define be16_to_cpu be16toh +#define __be16_to_cpu be16toh + +#define cpu_to_le64p(x) htole64(*((uint64_t *)x)) +#define le64_to_cpup(x) le64toh(*((uint64_t *)x)) +#define cpu_to_le32p(x) htole32(*((uint32_t *)x)) +#define le32_to_cpup(x) le32toh(*((uint32_t *)x)) +#define cpu_to_le16p(x) htole16(*((uint16_t *)x)) +#define le16_to_cpup(x) le16toh(*((uint16_t *)x)) +#define cpu_to_be64p(x) htobe64(*((uint64_t *)x)) +#define be64_to_cpup(x) be64toh(*((uint64_t *)x)) +#define cpu_to_be32p(x) htobe32(*((uint32_t *)x)) +#define be32_to_cpup(x) be32toh(*((uint32_t *)x)) +#define cpu_to_be16p(x) htobe16(*((uint16_t *)x)) +#define be16_to_cpup(x) be16toh(*((uint16_t *)x)) + +#define cpu_to_le64s(x) do { *((uint64_t *)x) = cpu_to_le64p((x)) } while (0) +#define le64_to_cpus(x) do { *((uint64_t *)x) = le64_to_cpup((x)) } while (0) +#define cpu_to_le32s(x) do { *((uint32_t *)x) = cpu_to_le32p((x)) } while (0) +#define le32_to_cpus(x) do { *((uint32_t *)x) = le32_to_cpup((x)) } while (0) +#define cpu_to_le16s(x) do { *((uint16_t *)x) = cpu_to_le16p((x)) } while (0) +#define le16_to_cpus(x) do { *((uint16_t *)x) = le16_to_cpup((x)) } while (0) +#define cpu_to_be64s(x) do { *((uint64_t *)x) = cpu_to_be64p((x)) } while (0) +#define be64_to_cpus(x) do { *((uint64_t *)x) = be64_to_cpup((x)) } while (0) +#define cpu_to_be32s(x) do { *((uint32_t *)x) = cpu_to_be32p((x)) } while (0) +#define be32_to_cpus(x) do { *((uint32_t *)x) = be32_to_cpup((x)) } while (0) +#define cpu_to_be16s(x) do { *((uint16_t *)x) = cpu_to_be16p((x)) } while (0) +#define be16_to_cpus(x) do { *((uint16_t *)x) = be16_to_cpup((x)) } while (0) + +#define swab16 bswap16 +#define swab32 bswap32 +#define swab64 bswap64 + +static inline void +be16_add_cpu(u16 *var, u16 val) +{ + *var = cpu_to_be16(be16_to_cpu(*var) + val); +} + +#endif /* _ASM_BYTEORDER_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/fcntl.h (from r290042, head/sys/ofed/include/asm/fcntl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/fcntl.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/fcntl.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_FCNTL_H_ +#define _ASM_FCNTL_H_ + +#include + +#endif /* _ASM_FCNTL_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/io.h (from r290042, head/sys/ofed/include/asm/io.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/io.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/io.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_IO_H_ +#define _ASM_IO_H_ + +#include + +#endif /* _ASM_IO_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/pgtable.h (from r290042, head/sys/ofed/include/asm/pgtable.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/pgtable.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/pgtable.h) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_PGTABLE_H_ +#define _ASM_PGTABLE_H_ + +typedef int pgprot_t; + +#endif /* _ASM_PGTABLE_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/types.h (from r290042, head/sys/ofed/include/asm/types.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/types.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/types.h) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_TYPES_H_ +#define _ASM_TYPES_H_ + +#ifdef _KERNEL + +typedef uint8_t u8; +typedef uint8_t __u8; +typedef uint16_t u16; +typedef uint16_t __u16; +typedef uint32_t u32; +typedef uint32_t __u32; +typedef uint64_t u64; +typedef uint64_t __u64; + +typedef int8_t s8; +typedef int8_t __s8; +typedef int16_t s16; +typedef int16_t __s16; +typedef int32_t s32; +typedef int32_t __s32; +typedef int64_t s64; +typedef int64_t __s64; + +/* DMA addresses come in generic and 64-bit flavours. */ +typedef vm_paddr_t dma_addr_t; +typedef vm_paddr_t dma64_addr_t; + +typedef unsigned short umode_t; + +#endif /* _KERNEL */ + +#endif /* _ASM_TYPES_H_ */ Copied: head/sys/compat/linuxkpi/common/include/asm/uaccess.h (from r290042, head/sys/ofed/include/asm/uaccess.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/asm/uaccess.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _ASM_UACCESS_H_ +#define _ASM_UACCESS_H_ + +#include + +static inline long +copy_to_user(void *to, const void *from, unsigned long n) +{ + if (copyout(from, to, n) != 0) + return n; + return 0; +} + +static inline long +copy_from_user(void *to, const void *from, unsigned long n) +{ + if (copyin(from, to, n) != 0) + return n; + return 0; +} + +#endif /* _ASM_UACCESS_H_ */ Copied: head/sys/compat/linuxkpi/common/include/linux/bitops.h (from r290042, head/sys/ofed/include/linux/bitops.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Oct 29 08:28:39 2015 (r290135, copy of r290042, head/sys/ofed/include/linux/bitops.h) @@ -0,0 +1,475 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_BITOPS_H_ +#define _LINUX_BITOPS_H_ + +#include +#include + +#define BIT(nr) (1UL << (nr)) +#ifdef __LP64__ +#define BITS_PER_LONG 64 +#else +#define BITS_PER_LONG 32 +#endif +#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) +#define BITMAP_LAST_WORD_MASK(n) (~0UL >> (BITS_PER_LONG - (n))) +#define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG) +#define BIT_MASK(nr) (1UL << ((nr) & (BITS_PER_LONG - 1))) +#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#define GENMASK(lo, hi) (((2UL << ((hi) - (lo))) - 1UL) << (lo)) +#define BITS_PER_BYTE 8 + +static inline int +__ffs(int mask) +{ + return (ffs(mask) - 1); +} + +static inline int +__fls(int mask) +{ + return (fls(mask) - 1); +} + +static inline int +__ffsl(long mask) +{ + return (ffsl(mask) - 1); +} + +static inline int +__flsl(long mask) +{ + return (flsl(mask) - 1); +} + + +#define ffz(mask) __ffs(~(mask)) + +static inline int get_count_order(unsigned int count) +{ + int order; + + order = fls(count) - 1; + if (count & (count - 1)) + order++; + return order; +} + +static inline unsigned long +find_first_bit(unsigned long *addr, unsigned long size) +{ + long mask; + int bit; + + for (bit = 0; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (*addr == 0) + continue; + return (bit + __ffsl(*addr)); + } + if (size) { + mask = (*addr) & BITMAP_LAST_WORD_MASK(size); + if (mask) + bit += __ffsl(mask); + else + bit += size; + } + return (bit); +} + +static inline unsigned long +find_first_zero_bit(unsigned long *addr, unsigned long size) +{ + long mask; + int bit; + + for (bit = 0; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (~(*addr) == 0) + continue; + return (bit + __ffsl(~(*addr))); + } + if (size) { + mask = ~(*addr) & BITMAP_LAST_WORD_MASK(size); + if (mask) + bit += __ffsl(mask); + else + bit += size; + } + return (bit); +} + +static inline unsigned long +find_last_bit(unsigned long *addr, unsigned long size) +{ + long mask; + int offs; + int bit; + int pos; + + pos = size / BITS_PER_LONG; + offs = size % BITS_PER_LONG; + bit = BITS_PER_LONG * pos; + addr += pos; + if (offs) { + mask = (*addr) & BITMAP_LAST_WORD_MASK(offs); + if (mask) + return (bit + __flsl(mask)); + } + while (--pos) { + addr--; + bit -= BITS_PER_LONG; + if (*addr) + return (bit + __flsl(mask)); + } + return (size); +} + +static inline unsigned long +find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset) +{ + long mask; + int offs; + int bit; + int pos; + + if (offset >= size) + return (size); + pos = offset / BITS_PER_LONG; + offs = offset % BITS_PER_LONG; + bit = BITS_PER_LONG * pos; + addr += pos; + if (offs) { + mask = (*addr) & ~BITMAP_LAST_WORD_MASK(offs); + if (mask) + return (bit + __ffsl(mask)); + if (size - bit <= BITS_PER_LONG) + return (size); + bit += BITS_PER_LONG; + addr++; + } + for (size -= bit; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (*addr == 0) + continue; + return (bit + __ffsl(*addr)); + } + if (size) { + mask = (*addr) & BITMAP_LAST_WORD_MASK(size); + if (mask) + bit += __ffsl(mask); + else + bit += size; + } + return (bit); +} + +static inline unsigned long +find_next_zero_bit(unsigned long *addr, unsigned long size, + unsigned long offset) +{ + long mask; + int offs; + int bit; + int pos; + + if (offset >= size) + return (size); + pos = offset / BITS_PER_LONG; + offs = offset % BITS_PER_LONG; + bit = BITS_PER_LONG * pos; + addr += pos; + if (offs) { + mask = ~(*addr) & ~BITMAP_LAST_WORD_MASK(offs); + if (mask) + return (bit + __ffsl(mask)); + if (size - bit <= BITS_PER_LONG) + return (size); + bit += BITS_PER_LONG; + addr++; + } + for (size -= bit; size >= BITS_PER_LONG; + size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { + if (~(*addr) == 0) + continue; + return (bit + __ffsl(~(*addr))); + } + if (size) { + mask = ~(*addr) & BITMAP_LAST_WORD_MASK(size); + if (mask) + bit += __ffsl(mask); + else + bit += size; + } + return (bit); +} + +static inline void +bitmap_zero(unsigned long *addr, int size) +{ + int len; + + len = BITS_TO_LONGS(size) * sizeof(long); + memset(addr, 0, len); +} + +static inline void +bitmap_fill(unsigned long *addr, int size) +{ + int tail; + int len; + + len = (size / BITS_PER_LONG) * sizeof(long); + memset(addr, 0xff, len); + tail = size & (BITS_PER_LONG - 1); + if (tail) + addr[size / BITS_PER_LONG] = BITMAP_LAST_WORD_MASK(tail); +} + +static inline int +bitmap_full(unsigned long *addr, int size) +{ + unsigned long mask; + int tail; + int len; + int i; + + len = size / BITS_PER_LONG; + for (i = 0; i < len; i++) + if (addr[i] != ~0UL) + return (0); + tail = size & (BITS_PER_LONG - 1); + if (tail) { + mask = BITMAP_LAST_WORD_MASK(tail); + if ((addr[i] & mask) != mask) + return (0); + } + return (1); +} + +static inline int +bitmap_empty(unsigned long *addr, int size) +{ + unsigned long mask; + int tail; + int len; + int i; + + len = size / BITS_PER_LONG; + for (i = 0; i < len; i++) + if (addr[i] != 0) + return (0); + tail = size & (BITS_PER_LONG - 1); + if (tail) { + mask = BITMAP_LAST_WORD_MASK(tail); + if ((addr[i] & mask) != 0) + return (0); + } + return (1); +} + +#define __set_bit(i, a) \ + atomic_set_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + +#define set_bit(i, a) \ + atomic_set_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + +#define __clear_bit(i, a) \ + atomic_clear_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + +#define clear_bit(i, a) \ + atomic_clear_long(&((volatile long *)(a))[BIT_WORD(i)], BIT_MASK(i)) + +#define test_bit(i, a) \ + !!(atomic_load_acq_long(&((volatile long *)(a))[BIT_WORD(i)]) & \ + BIT_MASK(i)) + +static inline long +test_and_clear_bit(long bit, long *var) +{ + long val; + + var += BIT_WORD(bit); + bit %= BITS_PER_LONG; + bit = (1UL << bit); + do { + val = *(volatile long *)var; + } while (atomic_cmpset_long(var, val, val & ~bit) == 0); + + return !!(val & bit); +} + +static inline long +test_and_set_bit(long bit, long *var) +{ + long val; + + var += BIT_WORD(bit); + bit %= BITS_PER_LONG; + bit = (1UL << bit); + do { + val = *(volatile long *)var; + } while (atomic_cmpset_long(var, val, val | bit) == 0); + + return !!(val & bit); +} + +static inline void +bitmap_set(unsigned long *map, int start, int nr) +{ + unsigned long *p = map + BIT_WORD(start); + const int size = start + nr; + int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); + + while (nr - bits_to_set >= 0) { + *p |= mask_to_set; + nr -= bits_to_set; + bits_to_set = BITS_PER_LONG; + mask_to_set = ~0UL; + p++; + } + if (nr) { + mask_to_set &= BITMAP_LAST_WORD_MASK(size); + *p |= mask_to_set; + } +} + +static inline void +bitmap_clear(unsigned long *map, int start, int nr) +{ + unsigned long *p = map + BIT_WORD(start); + const int size = start + nr; + int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); + unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); + + while (nr - bits_to_clear >= 0) { + *p &= ~mask_to_clear; + nr -= bits_to_clear; + bits_to_clear = BITS_PER_LONG; + mask_to_clear = ~0UL; + p++; + } + if (nr) { + mask_to_clear &= BITMAP_LAST_WORD_MASK(size); + *p &= ~mask_to_clear; + } +} + +enum { + REG_OP_ISFREE, + REG_OP_ALLOC, + REG_OP_RELEASE, +}; + +static int __reg_op(unsigned long *bitmap, int pos, int order, int reg_op) +{ + int nbits_reg; + int index; + int offset; + int nlongs_reg; + int nbitsinlong; + unsigned long mask; + int i; + int ret = 0; + + nbits_reg = 1 << order; + index = pos / BITS_PER_LONG; + offset = pos - (index * BITS_PER_LONG); + nlongs_reg = BITS_TO_LONGS(nbits_reg); + nbitsinlong = min(nbits_reg, BITS_PER_LONG); + + mask = (1UL << (nbitsinlong - 1)); + mask += mask - 1; + mask <<= offset; + + switch (reg_op) { + case REG_OP_ISFREE: + for (i = 0; i < nlongs_reg; i++) { + if (bitmap[index + i] & mask) + goto done; + } + ret = 1; + break; + + case REG_OP_ALLOC: + for (i = 0; i < nlongs_reg; i++) + bitmap[index + i] |= mask; + break; + + case REG_OP_RELEASE: + for (i = 0; i < nlongs_reg; i++) + bitmap[index + i] &= ~mask; + break; + } +done: + return ret; +} + +static inline int +bitmap_find_free_region(unsigned long *bitmap, int bits, int order) +{ + int pos; + int end; + + for (pos = 0 ; (end = pos + (1 << order)) <= bits; pos = end) { + if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE)) + continue; + __reg_op(bitmap, pos, order, REG_OP_ALLOC); + return pos; + } + return -ENOMEM; +} + +static inline int +bitmap_allocate_region(unsigned long *bitmap, int pos, int order) +{ + if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE)) + return -EBUSY; + __reg_op(bitmap, pos, order, REG_OP_ALLOC); + return 0; +} + +static inline void +bitmap_release_region(unsigned long *bitmap, int pos, int order) +{ + __reg_op(bitmap, pos, order, REG_OP_RELEASE); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Oct 29 08:45:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ACB1A20666; Thu, 29 Oct 2015 08:45:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50ABF1EF3; Thu, 29 Oct 2015 08:45:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9T8juDb021588; Thu, 29 Oct 2015 08:45:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T8jubi021587; Thu, 29 Oct 2015 08:45:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510290845.t9T8jubi021587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 29 Oct 2015 08:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290136 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 08:45:57 -0000 Author: hselasky Date: Thu Oct 29 08:45:56 2015 New Revision: 290136 URL: https://svnweb.freebsd.org/changeset/base/290136 Log: Add myself to MAINTAINERS. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Oct 29 08:28:39 2015 (r290135) +++ head/MAINTAINERS Thu Oct 29 08:45:56 2015 (r290136) @@ -105,6 +105,9 @@ bs{diff,patch} cperciva Pre-commit revie portsnap cperciva Pre-commit review requested. freebsd-update cperciva Pre-commit review requested. openssl benl,jkim Pre-commit review requested. +sys/dev/usb hselasky If in doubt, ask. +sys/dev/sound/usb hselasky If in doubt, ask. +sys/compat/linuxkpi hselasky If in doubt, ask. sys/netgraph/bluetooth emax Pre-commit review preferred. lib/libbluetooth emax Pre-commit review preferred. lib/libsdp emax Pre-commit review preferred. From owner-svn-src-head@freebsd.org Thu Oct 29 09:50:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69851A1ECCA; Thu, 29 Oct 2015 09:50:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3D9A010A9; Thu, 29 Oct 2015 09:50:49 +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 t9T9omOH042916; Thu, 29 Oct 2015 09:50:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T9omhc042912; Thu, 29 Oct 2015 09:50:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510290950.t9T9omhc042912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Oct 2015 09:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290138 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 09:50:49 -0000 Author: mav Date: Thu Oct 29 09:50:48 2015 New Revision: 290138 URL: https://svnweb.freebsd.org/changeset/base/290138 Log: Some updates to isp(4) manual page. Modified: head/share/man/man4/isp.4 Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Thu Oct 29 09:08:04 2015 (r290137) +++ head/share/man/man4/isp.4 Thu Oct 29 09:50:48 2015 (r290138) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2014 +.Dd October 29, 2015 .Dt ISP 4 .Os .Sh NAME @@ -60,8 +60,7 @@ devices. SCSI features include support for Ultra SCSI and wide mode transactions for .Tn SCSI , -Ultra2 LVD (for the ISP1080 and ISP1280), and Ultra3 LVD (for the -ISP12160). +Ultra2 LVD (ISP1080, ISP1280), and Ultra3 LVD (ISP12160). .Pp Fibre Channel support uses FCP SCSI profile for .Tn FibreChannel , @@ -69,15 +68,13 @@ and utilizes Class 3 and Class 2 connect 3 only, minor patches to the Qlogic 2200 to force Class 2 mode). Support is available for Public and Private loops, and for point-to-point connections (Qlogic 2200 only). -The newer 2-Gigabit cards (2300, 2312, 2322) and 4-Gigabit (2422, 2432) -are also supported. -Command tagging is -supported for all (in fact, +The newer 2-Gigabit cards (2300, 2312, 2322), 4-Gigabit (2422, 2432) +and 8-Gigabit (2532) are also supported. +Command tagging is supported for all (in fact, .Tn FibreChannel requires tagging). Fabric support is enabled by default for other than 2100 cards. -Fabric -support for 2100 cards has been so problematic and these cards are so +Fabric support for 2100 cards has been so problematic and these cards are so old now that it is just not worth your time to try it. .Sh FIRMWARE Firmware is available if the @@ -103,15 +100,16 @@ Qlogic 1020 Fast Wide and Differential F .It ISP1040 Qlogic 1040 Ultra Wide and Differential Ultra Wide PCI cards. Also known as the DEC KZPBA-CA (single ended) and KZPBA-CB (HVD differential). -.It Qlogic 1240 -Qlogic 1240 Dual Bus Ultra Wide and Differential Ultra Wide PCI -cards. .It Qlogic 1020 Qlogic 1020 SCSI cards. .It Qlogic 1040 Qlogic 1040 Ultra SCSI cards. .It Qlogic 1080 -Qlogic 1280 LVD Ultra2 Wide PCI cards. +Qlogic 1080 LVD Ultra2 Wide SCSI cards. +.It Qlogic 10160 +Qlogic 10160 LVD Ultra3 Wide PCI cards. +.It Qlogic 1240 +Qlogic 1240 Dual Bus Ultra Wide and Differential Ultra Wide PCI cards. .It Qlogic 1280 Qlogic 1280 Dual Bus LVD Ultra2 Wide PCI cards. .It Qlogic 12160 @@ -123,21 +121,21 @@ Loop (single, dual). Qlogic 2200 Copper and Optical Fibre Channel Arbitrated Loop PCI cards (single, dual, quad). .It Qlogic 2300 -Qlogic 2300 Optical Fibre Channel PCI cards. +Qlogic 2300 Optical 2Gb Fibre Channel PCI cards. .It Qlogic 2312 -Qlogic 2312 Optical Fibre Channel PCI cards. +Qlogic 2312 Optical 2Gb Fibre Channel PCI cards. .It Qlogic 234X -Qlogic 234X Optical Fibre Channel PCI cards (2312 chipset, single and dual attach). +Qlogic 234X Optical 2Gb Fibre Channel PCI cards (2312 chipset, single and dual attach). .It Qlogic 2322 -Qlogic 2322 Optical Fibre Channel PCIe cards. +Qlogic 2322 Optical 2Gb Fibre Channel PCIe cards. .It Qlogic 200 -Dell Branded version of the QLogic 2312 Fibre Channel PCI cards. +Dell branded version of the QLogic 2312. .It Qlogic 2422 -Qlogic 2422 Optical Fibre Channel PCI cards (4 Gigabit) -.It Qlogic 2432 -Qlogic 2432 Optical Fibre Channel PCIe cards (4 Gigabit) +Qlogic 2422 Optical 4Gb Fibre Channel PCI cards. .It Qlogic 2432 -Qlogic 2532 Optical Fibre Channel PCIe cards (8 Gigabit) +Qlogic 2432 Optical 4Gb Fibre Channel PCIe cards. +.It Qlogic 2532 +Qlogic 2532 Optical 8Gb Fibre Channel PCIe cards. .El .Sh CONFIGURATION OPTIONS Target mode support may be enabled with the @@ -232,13 +230,11 @@ The .Nm driver was written by .An Matthew Jacob -originally for NetBSD at -NASA/Ames Research Center. +originally for NetBSD at NASA/Ames Research Center. +Some later improvement was done by +.An Alexander Motin Aq Mt mav@FreeBSD.org .Sh BUGS The driver currently ignores some NVRAM settings. .Pp -Target mode support is not completely reliable yet. -It works reasonably -well for Fibre Channel, somewhat well for Qlogic 1040 cards, but -does not yet work for the other cards (due to last minute unannounced -changes in firmware interfaces). +Target mode support works reasonably well for 23xx and above Fibre Channel +cars, but not really tested on older ones. From owner-svn-src-head@freebsd.org Thu Oct 29 10:31:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93EBDA1FA47; Thu, 29 Oct 2015 10:31:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5FF30145A; Thu, 29 Oct 2015 10:31:45 +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 t9TAVivk053347; Thu, 29 Oct 2015 10:31:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TAVinD053346; Thu, 29 Oct 2015 10:31:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510291031.t9TAVinD053346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Oct 2015 10:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290139 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 10:31:45 -0000 Author: mav Date: Thu Oct 29 10:31:44 2015 New Revision: 290139 URL: https://svnweb.freebsd.org/changeset/base/290139 Log: Some minor additions to r290138, Modified: head/share/man/man4/isp.4 Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Thu Oct 29 09:50:48 2015 (r290138) +++ head/share/man/man4/isp.4 Thu Oct 29 10:31:44 2015 (r290139) @@ -232,9 +232,9 @@ driver was written by .An Matthew Jacob originally for NetBSD at NASA/Ames Research Center. Some later improvement was done by -.An Alexander Motin Aq Mt mav@FreeBSD.org +.An Alexander Motin Aq Mt mav@FreeBSD.org . .Sh BUGS The driver currently ignores some NVRAM settings. .Pp Target mode support works reasonably well for 23xx and above Fibre Channel -cars, but not really tested on older ones. +cards, but not really tested on older ones. From owner-svn-src-head@freebsd.org Thu Oct 29 13:53:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62565A1F967; Thu, 29 Oct 2015 13:53:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B5641646; Thu, 29 Oct 2015 13:53:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TDrbbF013569; Thu, 29 Oct 2015 13:53:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TDrbvD013568; Thu, 29 Oct 2015 13:53:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510291353.t9TDrbvD013568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 29 Oct 2015 13:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290140 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 13:53:38 -0000 Author: hselasky Date: Thu Oct 29 13:53:37 2015 New Revision: 290140 URL: https://svnweb.freebsd.org/changeset/base/290140 Log: Add missing NULL check in physio(). When destroying a character device the si_devsw field is set to NULL before all references are gone, to indicate the character device is going away. This can cause a NULL-dereference fault inside physio(). The callers of physio() should own a thread reference on the cdev and if si_devsw is seen as non-NULL, it is usable during the execution of the function. Else an ENXIO error code is returned. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_physio.c Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Thu Oct 29 10:31:44 2015 (r290139) +++ head/sys/kern/kern_physio.c Thu Oct 29 13:53:37 2015 (r290140) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); int physio(struct cdev *dev, struct uio *uio, int ioflag) { + struct cdevsw *csw; struct buf *pbuf; struct bio *bp; struct vm_page **pages; @@ -46,6 +47,11 @@ physio(struct cdev *dev, struct uio *uio int error, i, npages, maxpages; vm_prot_t prot; + csw = dev->si_devsw; + /* check if character device is being destroyed */ + if (csw == NULL) + return (ENXIO); + /* XXX: sanity check */ if(dev->si_iosize_max < PAGE_SIZE) { printf("WARNING: %s si_iosize_max=%d, using DFLTPHYS.\n", @@ -165,7 +171,7 @@ physio(struct cdev *dev, struct uio *uio } } - dev->si_devsw->d_strategy(bp); + csw->d_strategy(bp); if (uio->uio_rw == UIO_READ) biowait(bp, "physrd"); else From owner-svn-src-head@freebsd.org Thu Oct 29 14:10:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3900A1FC76; Thu, 29 Oct 2015 14:10:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 CF1681D39; Thu, 29 Oct 2015 14:10:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E5100B9A6; Thu, 29 Oct 2015 10:10:15 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290135 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux compat/linuxkpi/common/include/net compat/linuxkpi/common/src conf dev/usb modules/cxgb/iw... Date: Thu, 29 Oct 2015 06:43:28 -0700 Message-ID: <9821922.q97pI4CWiy@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201510290828.t9T8SdKw015903@repo.freebsd.org> References: <201510290828.t9T8SdKw015903@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.2.7 (bigwig.baldwin.cx); Thu, 29 Oct 2015 10:10:16 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 14:10:17 -0000 On Thursday, October 29, 2015 08:28:39 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Oct 29 08:28:39 2015 > New Revision: 290135 > URL: https://svnweb.freebsd.org/changeset/base/290135 > > Log: > Finish process of moving the LinuxKPI module into the default kernel build. > > - Move all files related to the LinuxKPI into sys/compat/linuxkpi and > its subfolders. > - Update sys/conf/files and some Makefiles to use new file locations. > - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn > adds the LinuxKPI to all LINT builds. > - The LinuxKPI can be added to the kernel by setting the > COMPAT_LINUXKPI option. The OFED kernel option no longer builds the > LinuxKPI into the kernel. This was done to keep the build rules for > the LinuxKPI in sys/conf/files simple. > - Extend the LinuxKPI module to include support for USB by moving the > Linux USB compat from usb.ko to linuxkpi.ko. > - Bump the FreeBSD_version. > - A universe kernel build has been done. > > Reviewed by: np @ (cxgb and cxgbe related changes only) > Sponsored by: Mellanox Technologies Humm. Did you coordinate with dumbbell@ at all? In his reviews on phabricator he had used subdirectories under linuxkpi for different versions Linux kernel versions. At the very least it seems like he should have been on the review for this since he is working in the same area doing a very similar thing? -- John Baldwin From owner-svn-src-head@freebsd.org Thu Oct 29 14:10:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C61D6A1FC71; Thu, 29 Oct 2015 14:10:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 A191C1D2B; Thu, 29 Oct 2015 14:10:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AA7E3B9A0; Thu, 29 Oct 2015 10:10:14 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290130 - head/sys/dev/ntb/ntb_hw Date: Thu, 29 Oct 2015 06:48:50 -0700 Message-ID: <1703515.Ze3qo7rKK1@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20151029075343.GO2257@kib.kiev.ua> References: <201510290416.t9T4GSG7044279@repo.freebsd.org> <20151029075343.GO2257@kib.kiev.ua> 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.2.7 (bigwig.baldwin.cx); Thu, 29 Oct 2015 10:10:14 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 14:10:15 -0000 On Thursday, October 29, 2015 09:53:43 AM Konstantin Belousov wrote: > On Thu, Oct 29, 2015 at 04:16:28AM +0000, Conrad E. Meyer wrote: > > Author: cem > > Date: Thu Oct 29 04:16:28 2015 > > New Revision: 290130 > > URL: https://svnweb.freebsd.org/changeset/base/290130 > > > > Log: > > ntb: Do not attempt to set write-combining on MWs > > > > AMD64 pmap assumes ranges will be in the DMAP, which isn't necessarily > > true for NTB memory windows (especially 64-bit BARs). > I am not sure what do you mean. pmap_change_attr() handles either DMAP > or kernel mapped memory. I think it assumes the DMAP is valid in the nested call here: if (tmpva >= VM_MIN_KERNEL_ADDRESS) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pdpe & PG_PS_FRAME; pa_end = pa_start + NBPDP; } else if (pa_end == (*pdpe & PG_PS_FRAME)) pa_end += NBPDP; else { /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), pa_end - pa_start, mode); if (error != 0) break; /* Start physical address run. */ pa_start = *pdpe & PG_PS_FRAME; pa_end = pa_start + NBPDP; } } That needs to do some sort of range checking on the (pa_start, pa_end) range to only set values that are mapped in the DMAP. In particular, that pmap_change_attr_locked() will fail here: /* * Pages that aren't mapped aren't supported. Also break down 2MB pages * into 4KB pages if required. */ for (tmpva = base; tmpva < base + size; ) { pdpe = pmap_pdpe(kernel_pmap, tmpva); if (*pdpe == 0) return (EINVAL); Since there won't be a valid pdpe, pde, or pte in the DMAP. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Oct 29 14:10:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46488A1FC83; Thu, 29 Oct 2015 14:10:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.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 22FD71D3B; Thu, 29 Oct 2015 14:10:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 35D8DB9AB; Thu, 29 Oct 2015 10:10:17 -0400 (EDT) From: John Baldwin To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290130 - head/sys/dev/ntb/ntb_hw Date: Thu, 29 Oct 2015 06:39:59 -0700 Message-ID: <2379504.sY8Moxo3YJ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201510290416.t9T4GSG7044279@repo.freebsd.org> References: <201510290416.t9T4GSG7044279@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.2.7 (bigwig.baldwin.cx); Thu, 29 Oct 2015 10:10:17 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 14:10:18 -0000 On Thursday, October 29, 2015 04:16:28 AM Conrad E. Meyer wrote: > Author: cem > Date: Thu Oct 29 04:16:28 2015 > New Revision: 290130 > URL: https://svnweb.freebsd.org/changeset/base/290130 > > Log: > ntb: Do not attempt to set write-combining on MWs > > AMD64 pmap assumes ranges will be in the DMAP, which isn't necessarily > true for NTB memory windows (especially 64-bit BARs). > > Suggested by: pmap_change_attr_locked -> kassert_panic > Sponsored by: EMC / Isilon Storage Division Hmm, pmap_mapdev_attr() does the right thing, but there isn't a good way to call that directly (and still get a valid bus handle/tag). I have on my todo to add a bus_map_resource() that would let you allocate a bus handle/tag that 1) is a subset of a resource, and 2) specifies a memory attribute. It would allow you to do this sanely. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Oct 29 14:16:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16AA0A1FF2A; Thu, 29 Oct 2015 14:16:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD8431438; Thu, 29 Oct 2015 14:16:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8F4851FE023; Thu, 29 Oct 2015 15:16:17 +0100 (CET) Subject: Re: svn commit: r290135 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux compat/linuxkpi/common/include/net compat/linuxkpi/common/src conf dev/usb modules/cxgb/iw... To: John Baldwin References: <201510290828.t9T8SdKw015903@repo.freebsd.org> <9821922.q97pI4CWiy@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56322A98.1010904@selasky.org> Date: Thu, 29 Oct 2015 15:18:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <9821922.q97pI4CWiy@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 14:16:20 -0000 On 10/29/15 14:43, John Baldwin wrote: > Humm. Did you coordinate with dumbbell@ at all? In his reviews on phabricator > he had used subdirectories under linuxkpi for different versions Linux kernel > versions. At the very least it seems like he should have been on the review > for this since he is working in the same area doing a very similar thing? Yes, I've kept dumbbell in the loop. We agreed to move all the files to sys/linuxkpi/common for now, until we see more clearly what functions needs to be implemented differently, leaving room for future extensions like he suggested in his https://reviews.freebsd.org/D3182 . --HPS From owner-svn-src-head@freebsd.org Thu Oct 29 14:36:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68061A212FD; Thu, 29 Oct 2015 14:36:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DDEAB1067; Thu, 29 Oct 2015 14:36:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t9TEapxW055655 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 Oct 2015 17:36:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t9TEappP055654; Thu, 29 Oct 2015 17:36:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 29 Oct 2015 17:36:51 +0300 From: Gleb Smirnoff To: Hans Petter Selasky Cc: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux Message-ID: <20151029143651.GN97830@FreeBSD.org> References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56308289.4050902@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 14:36:55 -0000 On Wed, Oct 28, 2015 at 09:08:41AM +0100, Hans Petter Selasky wrote: H> >> Log: H> >> Add support for binding IRQs to CPUs in the LinuxKPI. The new function H> >> added is for BSD only and does not exist in Linux. H> > H> > um, then who would use it and why? H> H> The parameters for bus_bind_intr() are not available outside the H> LinuxKPI. To support such a functionality we should wrap it, for the H> sake of maintainability. H> H> The LinuxKPI is not a binary compatibility module, and will at some H> point have API's diverging from Linux, to fit BSD API's better. This statement makes the name of LinuxKPI quite pointless, as well as the whole idea of the KPI unclear. Can you please explain what is the target of LinuxKPI, then? -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Oct 29 15:04:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19EF0A218B8; Thu, 29 Oct 2015 15:04:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 D35AB1493; Thu, 29 Oct 2015 15:04:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 98C171FE023; Thu, 29 Oct 2015 16:04:28 +0100 (CET) Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux To: Gleb Smirnoff References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> Cc: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <563235E3.1090805@selasky.org> Date: Thu, 29 Oct 2015 16:06:11 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151029143651.GN97830@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 15:04:38 -0000 On 10/29/15 15:36, Gleb Smirnoff wrote: > H> The parameters for bus_bind_intr() are not available outside the > H> LinuxKPI. To support such a functionality we should wrap it, for the > H> sake of maintainability. > H> > H> The LinuxKPI is not a binary compatibility module, and will at some > H> point have API's diverging from Linux, to fit BSD API's better. > > This statement makes the name of LinuxKPI quite pointless, as well > as the whole idea of the KPI unclear. > > Can you please explain what is the target of LinuxKPI, then? Hi, The target of the LinuxKPI is at the moment to support building device drivers and protocol layers which share code between *BSD and Linux. The target is not to kldload a kernel object file from Linux and have it work under FreeBSD. For example when you build a PCI network driver, the PCI enumeration can be shared between Linux and FreeBSD, building only OS specific network handling on top. In the case of r290003 support is added for binding an IRQ vector to a CPU, in a way that can easily be patched into an existing driver using the LinuxKPI. When you build a cross platform Linux/FreeBSD protocol stack, handling of LIST macros, bitmaps, timers, condition variables, mutexes, threads and so on can be shared. Like the basics of modern operating systems. This is the Linux Kernel Programming Interface, LinuxKPI, in FreeBSD. If you have a better name then please speak up. --HPS From owner-svn-src-head@freebsd.org Thu Oct 29 15:16:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 212DCA21B6D; Thu, 29 Oct 2015 15:16:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id E085E1BD1; Thu, 29 Oct 2015 15:16:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TFGlA8037136; Thu, 29 Oct 2015 15:16:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TFGlQo037134; Thu, 29 Oct 2015 15:16:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510291516.t9TFGlQo037134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Oct 2015 15:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290143 - head/sys/amd64/linux32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 15:16:49 -0000 Author: jhb Date: Thu Oct 29 15:16:47 2015 New Revision: 290143 URL: https://svnweb.freebsd.org/changeset/base/290143 Log: Fix build with DEBUG defined. Reported by: hselasky Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Thu Oct 29 14:53:56 2015 (r290142) +++ head/sys/amd64/linux32/linux.h Thu Oct 29 15:16:47 2015 (r290143) @@ -40,7 +40,7 @@ * debugging support */ extern u_char linux_debug_map[]; -#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) +#define ldebug(name) isclr(linux_debug_map, LINUX32_SYS_linux_ ## name) #define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ (long)td->td_proc->p_pid, (long)td->td_tid #define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Thu Oct 29 14:53:56 2015 (r290142) +++ head/sys/amd64/linux32/linux32_sysvec.c Thu Oct 29 15:16:47 2015 (r290143) @@ -105,8 +105,8 @@ MODULE_VERSION(linux, 1); * to syscall 0. This is slightly less bogus than using * ldebug(sigreturn). */ -#define LINUX_SYS_linux_rt_sendsig 0 -#define LINUX_SYS_linux_sendsig 0 +#define LINUX32_SYS_linux_rt_sendsig 0 +#define LINUX32_SYS_linux_sendsig 0 const char *linux_kplatform; static int linux_szsigcode; From owner-svn-src-head@freebsd.org Thu Oct 29 15:17:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2B0CA21BC2; Thu, 29 Oct 2015 15:17:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9891D3D; Thu, 29 Oct 2015 15:17:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t9TFHSYP055899 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 Oct 2015 18:17:28 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t9TFHSUb055898; Thu, 29 Oct 2015 18:17:28 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 29 Oct 2015 18:17:28 +0300 From: Gleb Smirnoff To: Hans Petter Selasky Cc: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux Message-ID: <20151029151728.GO97830@FreeBSD.org> References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> <563235E3.1090805@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563235E3.1090805@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 15:17:33 -0000 On Thu, Oct 29, 2015 at 04:06:11PM +0100, Hans Petter Selasky wrote: H> On 10/29/15 15:36, Gleb Smirnoff wrote: H> > H> The parameters for bus_bind_intr() are not available outside the H> > H> LinuxKPI. To support such a functionality we should wrap it, for the H> > H> sake of maintainability. H> > H> H> > H> The LinuxKPI is not a binary compatibility module, and will at some H> > H> point have API's diverging from Linux, to fit BSD API's better. H> > H> > This statement makes the name of LinuxKPI quite pointless, as well H> > as the whole idea of the KPI unclear. H> > H> > Can you please explain what is the target of LinuxKPI, then? H> H> Hi, H> H> The target of the LinuxKPI is at the moment to support building device H> drivers and protocol layers which share code between *BSD and Linux. The H> target is not to kldload a kernel object file from Linux and have it H> work under FreeBSD. H> H> For example when you build a PCI network driver, the PCI enumeration can H> be shared between Linux and FreeBSD, building only OS specific network H> handling on top. In the case of r290003 support is added for binding an H> IRQ vector to a CPU, in a way that can easily be patched into an H> existing driver using the LinuxKPI. H> H> When you build a cross platform Linux/FreeBSD protocol stack, handling H> of LIST macros, bitmaps, timers, condition variables, mutexes, threads H> and so on can be shared. Like the basics of modern operating systems. H> H> This is the Linux Kernel Programming Interface, LinuxKPI, in FreeBSD. Yes, it is clear, that this isn't an ABI, but API. And the purpose is also quite clear. But above you said "will at some point have API's diverging from Linux", which doesn't make sense together with your explanation. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Oct 29 15:20:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A61A21C27; Thu, 29 Oct 2015 15:20:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB9D1F14; Thu, 29 Oct 2015 15:20:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TFKlYO037308; Thu, 29 Oct 2015 15:20:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TFKlQO037307; Thu, 29 Oct 2015 15:20:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510291520.t9TFKlQO037307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Oct 2015 15:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290144 - head/sys/amd64/linux32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 15:20:48 -0000 Author: jhb Date: Thu Oct 29 15:20:47 2015 New Revision: 290144 URL: https://svnweb.freebsd.org/changeset/base/290144 Log: Update for LINUX32 rename. The assembler didn't complain about undefined symbols but just used 0 after the rename. Modified: head/sys/amd64/linux32/linux32_locore.s Modified: head/sys/amd64/linux32/linux32_locore.s ============================================================================== --- head/sys/amd64/linux32/linux32_locore.s Thu Oct 29 15:16:47 2015 (r290143) +++ head/sys/amd64/linux32/linux32_locore.s Thu Oct 29 15:20:47 2015 (r290144) @@ -28,7 +28,7 @@ NON_GPROF_ENTRY(linux32_sigcode) jmp *LINUX_SIGF_HANDLER(%ebx) .startsigcode: popl %eax - movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ + movl $LINUX32_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ int $0x80 /* enter kernel with args */ .endsigcode: 0: jmp 0b @@ -44,7 +44,7 @@ NON_GPROF_ENTRY(linux32_rt_sigcode) push %eax jmp *LINUX_RT_SIGF_HANDLER(%edi) .startrtsigcode: - movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ + movl $LINUX32_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ int $0x80 /* enter kernel with args */ .endrtsigcode: 0: jmp 0b From owner-svn-src-head@freebsd.org Thu Oct 29 15:27:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445C9A21DD7; Thu, 29 Oct 2015 15:27:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6081418; Thu, 29 Oct 2015 15:27:14 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 65EBD1FE023; Thu, 29 Oct 2015 16:27:08 +0100 (CET) Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux To: Gleb Smirnoff References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> Cc: Julian Elischer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56323B33.8020505@selasky.org> Date: Thu, 29 Oct 2015 16:28:51 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151029143651.GN97830@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 15:27:14 -0000 On 10/29/15 15:36, Gleb Smirnoff wrote: >> The LinuxKPI is not a binary compatibility module, and will at some > H> point have API's diverging from Linux, to fit BSD API's better. > > This statement makes the name of LinuxKPI quite pointless, as well > as the whole idea of the KPI unclear. Hi, To be more clear. Adding bind_irq_to_cpu() is more an exception than the default. A the moment I think Linux doesn't have an equivalent of this function, because of Linux's interrupt model. --HPS From owner-svn-src-head@freebsd.org Thu Oct 29 16:08:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CC9A2177A; Thu, 29 Oct 2015 16:08:37 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::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 43F8D12A8; Thu, 29 Oct 2015 16:08:37 +0000 (UTC) (envelope-from royger@gmail.com) Received: by wikq8 with SMTP id q8so289258818wik.1; Thu, 29 Oct 2015 09:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=IEcSn07YpSWsjmcKeejW0kk1+n+TI8XU02GyYxXsVug=; b=utqEcjuMhgtNQ7nYRd1NF4edK/xtnc5DFZlkL5Tx8dCat6REbt3eVke9xctL60pTd2 RPLcz5az+xwb7i8vG12jfvVLfOtgZF2/TN6Uqccv/BFU353OyZgwp+YPQHG2zV/iBreh CUWda0QfFNZ3pA+lrM6v7WZl3YOMX2bsmPbNl7gw24nWcJiOmYsWnS0FPCffA/410/9a /QkJ7CEpWQ+GYxMZCbACgG0rjXmSEV0zTEYjPVghbwPGYIGBrRtF0B1rShxrTNqIhs+S Y0K2E0NSDqtmhlFvluBhFmZHjEpBGJgTOpO+dKS6ASYBv1W7qaE0gzK9c8wNNY0EQF/d ZBgg== X-Received: by 10.194.143.43 with SMTP id sb11mr3543303wjb.120.1446134915762; Thu, 29 Oct 2015 09:08:35 -0700 (PDT) Received: from MacBook-Air-de-Roger.local (97.Red-81-35-53.dynamicIP.rima-tde.net. [81.35.53.97]) by smtp.gmail.com with ESMTPSA id m143sm4218859wmb.1.2015.10.29.09.08.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 09:08:34 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Subject: Re: svn commit: r289834 - head/sys/x86/x86 To: Oliver Pinter , Adrian Chadd References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> <562E1F8F.3010304@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Message-ID: <5632447B.1020402@FreeBSD.org> Date: Thu, 29 Oct 2015 17:08:27 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 16:08:37 -0000 El 26/10/15 a les 15.24, Oliver Pinter ha escrit: > On 10/26/15, Adrian Chadd wrote: >> Hi, >> >> I'll take a photo of it when it breaks next. >> >> Would you mind reverting it for now until we can figure it out? > > btw, this was the two kernel panic what I got: > > Fatal trap 12: page fault while in kernel mode > cpuid = 11; apic id = 03 > fault virtual address = 0x30 > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff808a2d22 > stack pointer = 0x28:0xfffffe07cc75a6f0 > frame pointer = 0x28:0xfffffe07cc75a770 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 5 (doneq0) > trap number = 12 > panic: page fault > cpuid = 11 > KDB: stack backtrace: > #0 0xffffffff80641647 at kdb_backtrace+0x67 > #1 0xffffffff80606762 at vpanic+0x182 > #2 0xffffffff806067e3 at panic+0x43 > #3 0xffffffff8084eef1 at trap_fatal+0x351 > #4 0xffffffff8084f0e4 at trap_pfault+0x1e4 > #5 0xffffffff8084e82f at trap+0x4bf > #6 0xffffffff80830d57 at calltrap+0x8 > #7 0xffffffff8063beab at _bus_dmamap_load_ccb+0x1fb > #8 0xffffffff8063bc51 at bus_dmamap_load_ccb+0x91 > #9 0xffffffff8042dcad at ata_dmaload+0x11d > #10 0xffffffff8042df7e at ata_begin_transaction+0x7e > #11 0xffffffff8042c18e at ataaction+0x9ce > #12 0xffffffff802a220f at xpt_run_devq+0x5bf > #13 0xffffffff802a17ad at xpt_action_default+0x94d > #14 0xffffffff802c0024 at adastart+0x8b4 > #15 0xffffffff802a2e93 at xpt_run_allocq+0x193 > #16 0xffffffff802c0ea0 at adadone+0x280 > #17 0xffffffff802a5310 at xpt_done_process+0x3a0 > Uptime: 1m40s Hello, I've been able to reproduce this by tweaking blkfront dma tag, and the issue was due to an off-by-one error. I've got an updated patch that applies on top of current HEAD, would any of you two mind giving it a try? https://people.freebsd.org/~royger/bounce_load_ma.patch Thanks, Roger. From owner-svn-src-head@freebsd.org Thu Oct 29 16:48:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B7FDA20052; Thu, 29 Oct 2015 16:48:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 045051349; Thu, 29 Oct 2015 16:48:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TGmDeu063853; Thu, 29 Oct 2015 16:48:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TGmC2U063850; Thu, 29 Oct 2015 16:48:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510291648.t9TGmC2U063850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Oct 2015 16:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290147 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 16:48:14 -0000 Author: mav Date: Thu Oct 29 16:48:12 2015 New Revision: 290147 URL: https://svnweb.freebsd.org/changeset/base/290147 Log: Fix and improve error masking and reporting. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispreg.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Oct 29 16:45:06 2015 (r290146) +++ head/sys/dev/isp/isp.c Thu Oct 29 16:48:12 2015 (r290147) @@ -2562,7 +2562,8 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui isp_pdb_24xx_t bill; } un; - MBSINIT(&mbs, MBOX_GET_PORT_DB, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR, 250000); + MBSINIT(&mbs, MBOX_GET_PORT_DB, + MBLOGALL & ~MBLOGMASK(MBOX_COMMAND_PARAM_ERROR), 250000); if (IS_24XX(isp)) { mbs.ibits = (1 << 9)|(1 << 10); mbs.param[1] = id; @@ -2632,7 +2633,7 @@ isp_gethandles(ispsoftc_t *isp, int chan uint32_t p; uint16_t h; - MBSINIT(&mbs, MBOX_GET_ID_LIST, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR, 250000); + MBSINIT(&mbs, MBOX_GET_ID_LIST, MBLOGALL, 250000); if (IS_24XX(isp)) { mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); @@ -2726,7 +2727,8 @@ isp_get_wwn(ispsoftc_t *isp, int chan, i fcp->isp_loopstate < LOOP_PDB_RCVD) { return (wwn); } - MBSINIT(&mbs, MBOX_GET_PORT_NAME, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR, 500000); + MBSINIT(&mbs, MBOX_GET_PORT_NAME, + MBLOGALL & ~MBLOGMASK(MBOX_COMMAND_PARAM_ERROR), 500000); if (ISP_CAP_2KLOGIN(isp)) { mbs.param[1] = loopid; if (nodename) { @@ -4920,7 +4922,8 @@ isp_control(ispsoftc_t *isp, ispctl_t ct } else { mbs.param[1] = (chan << 15) | (tgt << 8) | XS_LUN(xs); } - MBSINIT(&mbs, MBOX_ABORT, MBLOGALL & ~MBOX_COMMAND_ERROR, 0); + MBSINIT(&mbs, MBOX_ABORT, + MBLOGALL & ~MBLOGMASK(MBOX_COMMAND_ERROR), 0); mbs.param[2] = handle; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { @@ -7431,7 +7434,7 @@ isp_mboxcmd_qnw(ispsoftc_t *isp, mbreg_t static void isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp) { - const char *cname, *xname; + const char *cname, *xname, *sname; char tname[16], mname[16]; unsigned int ibits, obits, box, opcode; @@ -7541,57 +7544,58 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mb isp->isp_mboxbsy = 0; MBOX_RELEASE(isp); - out: - if (mbp->logval == 0 || opcode == MBOX_EXEC_FIRMWARE) { +out: + if (mbp->logval == 0 || mbp->param[0] == MBOX_COMMAND_COMPLETE) + return; + + if ((mbp->param[0] & 0xbfe0) == 0 && + (mbp->logval & MBLOGMASK(mbp->param[0])) == 0) return; - } - /* - * Just to be chatty here... - */ xname = NULL; + sname = ""; switch (mbp->param[0]) { - case MBOX_COMMAND_COMPLETE: - break; case MBOX_INVALID_COMMAND: - if (mbp->logval & MBLOGMASK(MBOX_COMMAND_COMPLETE)) { - xname = "INVALID COMMAND"; - } + xname = "INVALID COMMAND"; break; case MBOX_HOST_INTERFACE_ERROR: - if (mbp->logval & MBLOGMASK(MBOX_HOST_INTERFACE_ERROR)) { - xname = "HOST INTERFACE ERROR"; - } + xname = "HOST INTERFACE ERROR"; break; case MBOX_TEST_FAILED: - if (mbp->logval & MBLOGMASK(MBOX_TEST_FAILED)) { - xname = "TEST FAILED"; - } + xname = "TEST FAILED"; break; case MBOX_COMMAND_ERROR: - if (mbp->logval & MBLOGMASK(MBOX_COMMAND_ERROR)) { - xname = "COMMAND ERROR"; - } + xname = "COMMAND ERROR"; + ISP_SNPRINTF(mname, sizeof(mname), " subcode 0x%x", + mbp->param[1]); + sname = mname; break; case MBOX_COMMAND_PARAM_ERROR: - if (mbp->logval & MBLOGMASK(MBOX_COMMAND_PARAM_ERROR)) { - xname = "COMMAND PARAMETER ERROR"; - } - break; - case MBOX_LOOP_ID_USED: - if (mbp->logval & MBLOGMASK(MBOX_LOOP_ID_USED)) { - xname = "LOOP ID ALREADY IN USE"; - } + xname = "COMMAND PARAMETER ERROR"; break; case MBOX_PORT_ID_USED: - if (mbp->logval & MBLOGMASK(MBOX_PORT_ID_USED)) { - xname = "PORT ID ALREADY IN USE"; - } + xname = "PORT ID ALREADY IN USE"; + break; + case MBOX_LOOP_ID_USED: + xname = "LOOP ID ALREADY IN USE"; break; case MBOX_ALL_IDS_USED: - if (mbp->logval & MBLOGMASK(MBOX_ALL_IDS_USED)) { - xname = "ALL LOOP IDS IN USE"; - } + xname = "ALL LOOP IDS IN USE"; + break; + case MBOX_NOT_LOGGED_IN: + xname = "NOT LOGGED IN"; + break; + case MBOX_LINK_DOWN_ERROR: + xname = "LINK DOWN ERROR"; + break; + case MBOX_LOOPBACK_ERROR: + xname = "LOOPBACK ERROR"; + break; + case MBOX_CHECKSUM_ERROR: + xname = "CHECKSUM ERROR"; + break; + case MBOX_INVALID_PRODUCT_KEY: + xname = "INVALID PRODUCT KEY"; break; case MBOX_REGS_BUSY: xname = "REGISTERS BUSY"; @@ -7605,8 +7609,8 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mb break; } if (xname) { - isp_prt(isp, ISP_LOGALL, "Mailbox Command '%s' failed (%s)", - cname, xname); + isp_prt(isp, ISP_LOGALL, "Mailbox Command '%s' failed (%s%s)", + cname, xname, sname); } } Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Thu Oct 29 16:45:06 2015 (r290146) +++ head/sys/dev/isp/ispmbox.h Thu Oct 29 16:48:12 2015 (r290147) @@ -191,13 +191,17 @@ #define MBOX_LOOP_ID_USED 0x4008 #define MBOX_ALL_IDS_USED 0x4009 #define MBOX_NOT_LOGGED_IN 0x400A +#define MBOX_LINK_DOWN_ERROR 0x400B +#define MBOX_LOOPBACK_ERROR 0x400C +#define MBOX_CHECKSUM_ERROR 0x4010 +#define MBOX_INVALID_PRODUCT_KEY 0x4020 /* pseudo mailbox completion codes */ #define MBOX_REGS_BUSY 0x6000 /* registers in use */ #define MBOX_TIMEOUT 0x6001 /* command timed out */ -#define MBLOGALL 0x000f -#define MBLOGNONE 0x0000 -#define MBLOGMASK(x) ((x) & 0xf) +#define MBLOGALL 0xffffffff +#define MBLOGNONE 0x00000000 +#define MBLOGMASK(x) (1 << (((x) - 1) & 0x1f)) /* * Asynchronous event status codes Modified: head/sys/dev/isp/ispreg.h ============================================================================== --- head/sys/dev/isp/ispreg.h Thu Oct 29 16:45:06 2015 (r290146) +++ head/sys/dev/isp/ispreg.h Thu Oct 29 16:48:12 2015 (r290147) @@ -453,11 +453,9 @@ typedef struct { uint32_t obits; /* bits to add for register copyout */ uint32_t ibitm; /* bits to mask for register copyin */ uint32_t obitm; /* bits to mask for register copyout */ - uint32_t - lineno : 16, - : 12, - logval : 4; + uint32_t logval; /* Bitmask of status codes to log */ uint32_t timeout; + uint32_t lineno; const char *func; } mbreg_t; #define MBSINIT(mbxp, code, loglev, timo) \ From owner-svn-src-head@freebsd.org Thu Oct 29 16:50:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EB0A200FA; Thu, 29 Oct 2015 16:50:29 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4D11E1566; Thu, 29 Oct 2015 16:50:29 +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 t9TGoSNs063989; Thu, 29 Oct 2015 16:50:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TGoSP8063988; Thu, 29 Oct 2015 16:50:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201510291650.t9TGoSP8063988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 29 Oct 2015 16:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290148 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 16:50:29 -0000 Author: imp Date: Thu Oct 29 16:50:28 2015 New Revision: 290148 URL: https://svnweb.freebsd.org/changeset/base/290148 Log: PC Card and Cardbus are now in extended maintenance mode. No need to have them cluttering up MAINTAINERS. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Oct 29 16:48:12 2015 (r290147) +++ head/MAINTAINERS Thu Oct 29 16:50:28 2015 (r290148) @@ -37,8 +37,6 @@ sys/security/audit rwatson Pre-commit re ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org ahc(4) gibbs Pre-commit review requested. ahd(4) gibbs Pre-commit review requested. -PC Card imp Pre-commit review requested. -CardBus imp Pre-commit review requested. pci bus imp,jhb Pre-commit review requested. cdboot jhb Pre-commit review requested. pxeboot jhb Pre-commit review requested. From owner-svn-src-head@freebsd.org Thu Oct 29 18:29:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C536A214D3; Thu, 29 Oct 2015 18:29:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6031DE6; Thu, 29 Oct 2015 18:29:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TITT1g093110; Thu, 29 Oct 2015 18:29:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TITTob093109; Thu, 29 Oct 2015 18:29:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510291829.t9TITTob093109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 18:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290153 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 18:29:30 -0000 Author: bdrewery Date: Thu Oct 29 18:29:28 2015 New Revision: 290153 URL: https://svnweb.freebsd.org/changeset/base/290153 Log: Fix unlikely memory leak. It is unlikely since the first check in the function is that dir[0] is '/', but later code changes may make it real. Coverity CID: 1332104 Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Thu Oct 29 17:51:48 2015 (r290152) +++ head/usr.sbin/pw/pw_user.c Thu Oct 29 18:29:28 2015 (r290153) @@ -107,8 +107,10 @@ mkdir_home_parents(int dfd, const char * errx(EX_UNAVAILABLE, "out of memory"); tmp = strrchr(dirs, '/'); - if (tmp == NULL) + if (tmp == NULL) { + free(dirs); return; + } tmp[0] = '\0'; /* From owner-svn-src-head@freebsd.org Thu Oct 29 18:58:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E2F5A21875; Thu, 29 Oct 2015 18:58:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5A9318E2; Thu, 29 Oct 2015 18:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TIwI2Z001725; Thu, 29 Oct 2015 18:58:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TIwIaF001724; Thu, 29 Oct 2015 18:58:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510291858.t9TIwIaF001724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 18:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290154 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 18:58:20 -0000 Author: bdrewery Date: Thu Oct 29 18:58:18 2015 New Revision: 290154 URL: https://svnweb.freebsd.org/changeset/base/290154 Log: Avoid passing an uninitialized 'i'. Currently nothing was depending on it anyhow. Coverity CID: 1331562 Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Oct 29 18:29:28 2015 (r290153) +++ head/sys/net/route.c Thu Oct 29 18:58:18 2015 (r290154) @@ -845,7 +845,7 @@ rt_foreach_fib_walk(int af, rt_setwarg_t if (rnh == NULL) continue; if (setwa_f != NULL) - setwa_f(rnh, fibnum, i, arg); + setwa_f(rnh, fibnum, AF_UNSPEC, arg); RADIX_NODE_HEAD_LOCK(rnh); rnh->rnh_walktree(rnh, (walktree_f_t *)wa_f, arg); From owner-svn-src-head@freebsd.org Thu Oct 29 19:02:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF6FBA2199F; Thu, 29 Oct 2015 19:02:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A80741C4B; Thu, 29 Oct 2015 19:02:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TJ2Orq004429; Thu, 29 Oct 2015 19:02:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TJ2ODr004428; Thu, 29 Oct 2015 19:02:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510291902.t9TJ2ODr004428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 19:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290155 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 19:02:26 -0000 Author: bdrewery Date: Thu Oct 29 19:02:24 2015 New Revision: 290155 URL: https://svnweb.freebsd.org/changeset/base/290155 Log: getnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse(). This came in recently in r289279. Coverity CID: 1331561 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Oct 29 18:58:18 2015 (r290154) +++ head/sys/kern/vfs_bio.c Thu Oct 29 19:02:24 2015 (r290155) @@ -2885,6 +2885,7 @@ getnewbuf(struct vnode *vp, int slpflag, struct buf *bp; bool metadata, reserved; + bp = NULL; KASSERT((gbflags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC, ("GB_KVAALLOC only makes sense with GB_UNMAPPED")); if (!unmapped_buf_allowed) From owner-svn-src-head@freebsd.org Thu Oct 29 19:07:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC75AA21A31; Thu, 29 Oct 2015 19:07:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7A98E1FF2; Thu, 29 Oct 2015 19:07:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TJ70bF004617; Thu, 29 Oct 2015 19:07:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TJ70UN004616; Thu, 29 Oct 2015 19:07:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510291907.t9TJ70UN004616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 19:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290156 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 19:07:01 -0000 Author: cem Date: Thu Oct 29 19:07:00 2015 New Revision: 290156 URL: https://svnweb.freebsd.org/changeset/base/290156 Log: pmap_change_attr: Only fixup DMAP for DMAPed ranges pmap_change_attr must change the memory type of both the requested KVA and the corresponding DMAP mappings (if such mappings exist), to satisfy an Intel requirement that two or more mappings to the same physical pages must have the same memory type. However, not all kernel mapped pages have corresponding DMAP mappings -- for example, 64-bit BARs. Skip fixing up the DMAP for out-of-bounds addresses. Submitted by: Steve Wahl Reviewed by: alc, jhb Sponsored by: Dell Compellent Differential Revision: https://reviews.freebsd.org/D4030 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Oct 29 19:02:24 2015 (r290155) +++ head/sys/amd64/amd64/pmap.c Thu Oct 29 19:07:00 2015 (r290156) @@ -6411,7 +6411,7 @@ pmap_change_attr_locked(vm_offset_t va, */ for (tmpva = base; tmpva < base + size; ) { pdpe = pmap_pdpe(kernel_pmap, tmpva); - if (*pdpe == 0) + if (pdpe == NULL || *pdpe == 0) return (EINVAL); if (*pdpe & PG_PS) { /* @@ -6484,7 +6484,8 @@ pmap_change_attr_locked(vm_offset_t va, X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pdpe & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pdpe & PG_PS_FRAME; @@ -6513,7 +6514,8 @@ pmap_change_attr_locked(vm_offset_t va, X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pde & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pde & PG_PS_FRAME; @@ -6540,7 +6542,8 @@ pmap_change_attr_locked(vm_offset_t va, X86_PG_PTE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pte & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pte & PG_FRAME; From owner-svn-src-head@freebsd.org Thu Oct 29 19:28:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18276A21EDE; Thu, 29 Oct 2015 19:28:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D92AE1C43; Thu, 29 Oct 2015 19:28:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TJSLoq010373; Thu, 29 Oct 2015 19:28:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TJSLI6010372; Thu, 29 Oct 2015 19:28:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510291928.t9TJSLI6010372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 19:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290157 - head/usr.bin/ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 19:28:23 -0000 Author: bdrewery Date: Thu Oct 29 19:28:21 2015 New Revision: 290157 URL: https://svnweb.freebsd.org/changeset/base/290157 Log: Check archive_entry_new() result. Coverity CID: 1331341 Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Thu Oct 29 19:07:00 2015 (r290156) +++ head/usr.bin/ar/write.c Thu Oct 29 19:28:21 2015 (r290157) @@ -664,6 +664,9 @@ write_objs(struct bsdar *bsdar) if ((bsdar->s_cnt != 0 && !(bsdar->options & AR_SS)) || bsdar->options & AR_S) { entry = archive_entry_new(); + if (entry == NULL) + bsdar_errc(bsdar, EX_SOFTWARE, 0, + "archive_entry_new failed"); archive_entry_copy_pathname(entry, "/"); if ((bsdar->options & AR_D) == 0) archive_entry_set_mtime(entry, time(NULL), 0); @@ -681,6 +684,9 @@ write_objs(struct bsdar *bsdar) /* write the archive string table, if any. */ if (bsdar->as != NULL) { entry = archive_entry_new(); + if (entry == NULL) + bsdar_errc(bsdar, EX_SOFTWARE, 0, + "archive_entry_new failed"); archive_entry_copy_pathname(entry, "//"); archive_entry_set_size(entry, bsdar->as_sz); AC(archive_write_header(a, entry)); @@ -691,6 +697,9 @@ write_objs(struct bsdar *bsdar) /* write normal members. */ TAILQ_FOREACH(obj, &bsdar->v_obj, objs) { entry = archive_entry_new(); + if (entry == NULL) + bsdar_errc(bsdar, EX_SOFTWARE, 0, + "archive_entry_new failed"); archive_entry_copy_pathname(entry, obj->name); archive_entry_set_uid(entry, obj->uid); archive_entry_set_gid(entry, obj->gid); From owner-svn-src-head@freebsd.org Thu Oct 29 19:35:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1535A210CE; Thu, 29 Oct 2015 19:35:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D3B311B8; Thu, 29 Oct 2015 19:35:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TJZ1c3013291; Thu, 29 Oct 2015 19:35:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TJZ1kO013290; Thu, 29 Oct 2015 19:35:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510291935.t9TJZ1kO013290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 19:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290158 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 19:35:02 -0000 Author: cem Date: Thu Oct 29 19:35:01 2015 New Revision: 290158 URL: https://svnweb.freebsd.org/changeset/base/290158 Log: ntb: Revert r290130 now that r290156 has landed Nagged by: vangyzen Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Oct 29 19:28:21 2015 (r290157) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Oct 29 19:35:01 2015 (r290158) @@ -755,13 +755,9 @@ map_memory_window_bar(struct ntb_softc * save_bar_parameters(bar); } -#if 0 /* XXX: amd64 pmap_change_attr() assumes region lies in DMAP. */ /* Mark bar region as write combining to improve performance. */ rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, VM_MEMATTR_WRITE_COMBINING); -#else - rc = EINVAL; -#endif print_map_success(ntb, bar, "mw"); if (rc == 0) device_printf(ntb->device, From owner-svn-src-head@freebsd.org Thu Oct 29 20:26:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34996A217C8; Thu, 29 Oct 2015 20:26:05 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay105.isp.belgacom.be (mailrelay105.isp.belgacom.be [195.238.20.132]) by mx1.freebsd.org (Postfix) with ESMTP id EC69C1399; Thu, 29 Oct 2015 20:26:03 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CXAgAqgDJW/zhosVtegzZTYA+/LAENgVohhXgCgTM5FAEBAQEBAQGBCoQ2AQEEOhwjEAsUBAklDyoeBhOINAEIxUYBAQEBAQEBAwEBAQEBAQEYBIt1hRAHhC0FlkOFHYJwhRBjm1sfAQFCghEdgVc9NIV+AQEB Received: from 56.104-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.104.56]) by relay.skynet.be with ESMTP; 29 Oct 2015 21:25:55 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id t9TKPtdb001413; Thu, 29 Oct 2015 21:25:55 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Thu, 29 Oct 2015 21:25:54 +0100 From: Tijl Coosemans To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kib@FreeBSD.org Subject: Re: svn commit: r289279 - in head/sys: kern vm Message-ID: <20151029212554.799f76eb@kalimero.tijl.coosemans.org> In-Reply-To: <201510140210.t9E2A79H056595@repo.freebsd.org> References: <201510140210.t9E2A79H056595@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 20:26:05 -0000 On Wed, 14 Oct 2015 02:10:07 +0000 (UTC) Jeff Roberson wrote: > Author: jeff > Date: Wed Oct 14 02:10:07 2015 > New Revision: 289279 > URL: https://svnweb.freebsd.org/changeset/base/289279 > > Log: > Parallelize the buffer cache and rewrite getnewbuf(). This results in a > 8x performance improvement in a micro benchmark on a 4 socket machine. > > - Get buffer headers from a per-cpu uma cache that sits in from of the > free queue. > - Use a per-cpu quantum cache in vmem to eliminate contention for kva. > - Use multiple clean queues according to buffer cache size to eliminate > clean queue lock contention. > - Introduce a bufspace daemon that attempts to prevent getnewbuf() callers > from blocking or doing direct recycling. > - Close some bufspace allocation races that could lead to endless > recycling. > - Further the transition to a more modern style of small functions grouped > by prefix in order to improve growing complexity. I have an i386 system that locks up easily after this commit. Booting into single user and running make installkernel triggers it consistently. I haven't been able to reproduce it on amd64. Examining threads with DDB shows that they are all at sched_switch (a few at fork_trampoline). The only lock being held is Giant (by the interrupt handler for ctrl+alt+esc I think). So it doesn't look like a dead lock. It's more a sleeping beauty situation. All threads in the castle are sleeping and there's no prince to wake them up. (kgdb) info thread Id Target Id Frame These are from make installkernel: 72 Thread 100071 (PID=107: install) sched_switch (td=0xc667d000, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 71 Thread 100070 (PID=81: make) sched_switch (td=0xc667d340, newtd=0xc667d000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 70 Thread 100067 (PID=30: make) sched_switch (td=0xc667e000, newtd=0xc667d340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 69 Thread 100066 (PID=25: make) sched_switch (td=0xc667e340, newtd=0xc667e000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 Single user shell: 68 Thread 100065 (PID=17: sh) sched_switch (td=0xc6406000, newtd=0xc667e340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 Kernel threads: 67 Thread 100063 (PID=16: vnlru) sched_switch (td=0xc6406680, newtd=0xc6407340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 66 Thread 100062 (PID=9: syncer) sched_switch (td=0xc64069c0, newtd=0xc667d000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 65 Thread 100061 (PID=8: bufspacedaemon) sched_switch (td=0xc6407000, newtd=0xc62dc000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 64 Thread 100060 (PID=7: bufdaemon) sched_switch (td=0xc6407340, newtd=0xc6408000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 63 Thread 100068 (PID=7: bufdaemon//var worker) sched_switch ( td=0xc667d9c0, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 62 Thread 100069 (PID=7: bufdaemon//usr worker) sched_switch ( td=0xc667d680, newtd=0xc667d000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 61 Thread 100059 (PID=6: pagezero) sched_switch (td=0xc6407680, newtd=0xc55ba680, flags=) at /usr/src/sys/kern/sched_ule.c:1969 60 Thread 100058 (PID=5: vmdaemon) sched_switch (td=0xc64079c0, newtd=0xc6407340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 59 Thread 100057 (PID=4: pagedaemon) sched_switch (td=0xc6408000, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 58 Thread 100064 (PID=4: pagedaemon/uma) sched_switch (td=0xc6406340, newtd=0xc55b9340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 57 Thread 100050 (PID=15: acpi_cooling0) sched_switch (td=0xc62dc340, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 .... Anything else you need to debug this? From owner-svn-src-head@freebsd.org Thu Oct 29 20:31:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A957BA21987; Thu, 29 Oct 2015 20:31:35 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 8D74A18F8; Thu, 29 Oct 2015 20:31:34 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from marvin.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id BC21356486; Thu, 29 Oct 2015 15:31:33 -0500 (CDT) Subject: Re: svn commit: r289279 - in head/sys: kern vm To: Tijl Coosemans , Jeff Roberson References: <201510140210.t9E2A79H056595@repo.freebsd.org> <20151029212554.799f76eb@kalimero.tijl.coosemans.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kib@FreeBSD.org From: Eric van Gyzen Message-ID: <56328224.2010706@vangyzen.net> Date: Thu, 29 Oct 2015 15:31:32 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151029212554.799f76eb@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 20:31:35 -0000 On 10/29/2015 15:25, Tijl Coosemans wrote: > On Wed, 14 Oct 2015 02:10:07 +0000 (UTC) Jeff Roberson wrote: >> Author: jeff >> Date: Wed Oct 14 02:10:07 2015 >> New Revision: 289279 >> URL: https://svnweb.freebsd.org/changeset/base/289279 >> >> Log: >> Parallelize the buffer cache and rewrite getnewbuf(). This results in a >> 8x performance improvement in a micro benchmark on a 4 socket machine. >> >> - Get buffer headers from a per-cpu uma cache that sits in from of the >> free queue. >> - Use a per-cpu quantum cache in vmem to eliminate contention for kva. >> - Use multiple clean queues according to buffer cache size to eliminate >> clean queue lock contention. >> - Introduce a bufspace daemon that attempts to prevent getnewbuf() callers >> from blocking or doing direct recycling. >> - Close some bufspace allocation races that could lead to endless >> recycling. >> - Further the transition to a more modern style of small functions grouped >> by prefix in order to improve growing complexity. > > I have an i386 system that locks up easily after this commit. Booting > into single user and running make installkernel triggers it consistently. I can't help you debug this, but I noticed a follow-up commit that fixed an uninitialized pointer introduced by this commit: https://svnweb.freebsd.org/changeset/base/290155 Pending comments from more enlightened folk, you might try updating to that rev (if you can do so without a lockup...). Eric From owner-svn-src-head@freebsd.org Thu Oct 29 20:33:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70B32A219DF; Thu, 29 Oct 2015 20:33:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 1415B1B0D; Thu, 29 Oct 2015 20:33:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t9TKXYUb063224 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 29 Oct 2015 22:33:34 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t9TKXYUb063224 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t9TKXYRY063223; Thu, 29 Oct 2015 22:33:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Oct 2015 22:33:34 +0200 From: Konstantin Belousov To: Tijl Coosemans Cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289279 - in head/sys: kern vm Message-ID: <20151029203334.GA2257@kib.kiev.ua> References: <201510140210.t9E2A79H056595@repo.freebsd.org> <20151029212554.799f76eb@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151029212554.799f76eb@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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.20 Precedence: list List-Id: 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, 29 Oct 2015 20:33:40 -0000 On Thu, Oct 29, 2015 at 09:25:54PM +0100, Tijl Coosemans wrote: > On Wed, 14 Oct 2015 02:10:07 +0000 (UTC) Jeff Roberson wrote: > > Author: jeff > > Date: Wed Oct 14 02:10:07 2015 > > New Revision: 289279 > > URL: https://svnweb.freebsd.org/changeset/base/289279 > > > > Log: > > Parallelize the buffer cache and rewrite getnewbuf(). This results in a > > 8x performance improvement in a micro benchmark on a 4 socket machine. > > > > - Get buffer headers from a per-cpu uma cache that sits in from of the > > free queue. > > - Use a per-cpu quantum cache in vmem to eliminate contention for kva. > > - Use multiple clean queues according to buffer cache size to eliminate > > clean queue lock contention. > > - Introduce a bufspace daemon that attempts to prevent getnewbuf() callers > > from blocking or doing direct recycling. > > - Close some bufspace allocation races that could lead to endless > > recycling. > > - Further the transition to a more modern style of small functions grouped > > by prefix in order to improve growing complexity. > > I have an i386 system that locks up easily after this commit. Booting > into single user and running make installkernel triggers it consistently. > I haven't been able to reproduce it on amd64. Examining threads with > DDB shows that they are all at sched_switch (a few at fork_trampoline). > The only lock being held is Giant (by the interrupt handler for > ctrl+alt+esc I think). So it doesn't look like a dead lock. It's more > a sleeping beauty situation. All threads in the castle are sleeping and > there's no prince to wake them up. > > (kgdb) info thread > Id Target Id Frame > > These are from make installkernel: > > 72 Thread 100071 (PID=107: install) sched_switch (td=0xc667d000, > newtd=0xc6407000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 71 Thread 100070 (PID=81: make) sched_switch (td=0xc667d340, > newtd=0xc667d000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 70 Thread 100067 (PID=30: make) sched_switch (td=0xc667e000, > newtd=0xc667d340, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 69 Thread 100066 (PID=25: make) sched_switch (td=0xc667e340, > newtd=0xc667e000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > > Single user shell: > > 68 Thread 100065 (PID=17: sh) sched_switch (td=0xc6406000, > newtd=0xc667e340, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > > Kernel threads: > > 67 Thread 100063 (PID=16: vnlru) sched_switch (td=0xc6406680, > newtd=0xc6407340, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 66 Thread 100062 (PID=9: syncer) sched_switch (td=0xc64069c0, > newtd=0xc667d000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 65 Thread 100061 (PID=8: bufspacedaemon) sched_switch (td=0xc6407000, > newtd=0xc62dc000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 64 Thread 100060 (PID=7: bufdaemon) sched_switch (td=0xc6407340, > newtd=0xc6408000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 63 Thread 100068 (PID=7: bufdaemon//var worker) sched_switch ( > td=0xc667d9c0, newtd=0xc6407000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 62 Thread 100069 (PID=7: bufdaemon//usr worker) sched_switch ( > td=0xc667d680, newtd=0xc667d000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 61 Thread 100059 (PID=6: pagezero) sched_switch (td=0xc6407680, > newtd=0xc55ba680, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 60 Thread 100058 (PID=5: vmdaemon) sched_switch (td=0xc64079c0, > newtd=0xc6407340, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 59 Thread 100057 (PID=4: pagedaemon) sched_switch (td=0xc6408000, > newtd=0xc6407000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 58 Thread 100064 (PID=4: pagedaemon/uma) sched_switch (td=0xc6406340, > newtd=0xc55b9340, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > 57 Thread 100050 (PID=15: acpi_cooling0) sched_switch (td=0xc62dc340, > newtd=0xc6407000, flags=) > at /usr/src/sys/kern/sched_ule.c:1969 > .... > > Anything else you need to debug this? Start with gathering the information listed in https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html From owner-svn-src-head@freebsd.org Thu Oct 29 20:34:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5926AA21A1C; Thu, 29 Oct 2015 20:34:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2109A1C89; Thu, 29 Oct 2015 20:34:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TKY2r4030563; Thu, 29 Oct 2015 20:34:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TKY2Is030562; Thu, 29 Oct 2015 20:34:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510292034.t9TKY2Is030562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Oct 2015 20:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290159 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 20:34:03 -0000 Author: mav Date: Thu Oct 29 20:34:01 2015 New Revision: 290159 URL: https://svnweb.freebsd.org/changeset/base/290159 Log: Remove reset delays for which I see neither explanation nor need. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Oct 29 19:35:01 2015 (r290158) +++ head/sys/dev/isp/isp.c Thu Oct 29 20:34:01 2015 (r290159) @@ -1011,33 +1011,15 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } - /* - * Give it a chance to finish starting up. - * Give the 24XX more time. - */ - if (IS_24XX(isp)) { - ISP_DELAY(500000); + if (IS_SCSI(isp)) { /* - * Check to see if the 24XX firmware really started. + * Set CLOCK RATE, but only if asked to. */ - if (mbs.param[1] == 0xdead) { - isp_prt(isp, ISP_LOGERR, "f/w didn't *really* start"); - ISP_RESET0(isp); - return; - } - } else { - ISP_DELAY(250000); - if (IS_SCSI(isp)) { - /* - * Set CLOCK RATE, but only if asked to. - */ - if (isp->isp_clock) { - mbs.param[0] = MBOX_SET_CLOCK_RATE; - mbs.param[1] = isp->isp_clock; - mbs.logval = MBLOGNONE; - isp_mboxcmd(isp, &mbs); - /* we will try not to care if this fails */ - } + if (isp->isp_clock) { + MBSINIT(&mbs, MBOX_SET_CLOCK_RATE, MBLOGALL, 0); + mbs.param[1] = isp->isp_clock; + isp_mboxcmd(isp, &mbs); + /* we will try not to care if this fails */ } } From owner-svn-src-head@freebsd.org Thu Oct 29 20:43:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9A54A21C04; Thu, 29 Oct 2015 20:43:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9682E10A6; Thu, 29 Oct 2015 20:43:14 +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 t9TKhDMO033433; Thu, 29 Oct 2015 20:43:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TKhDpl033432; Thu, 29 Oct 2015 20:43:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510292043.t9TKhDpl033432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 29 Oct 2015 20:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290160 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 20:43:14 -0000 Author: mav Date: Thu Oct 29 20:43:13 2015 New Revision: 290160 URL: https://svnweb.freebsd.org/changeset/base/290160 Log: Remove some unneeded code. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Oct 29 20:34:01 2015 (r290159) +++ head/sys/dev/isp/isp.c Thu Oct 29 20:43:13 2015 (r290160) @@ -2279,10 +2279,6 @@ isp_mark_portdb(ispsoftc_t *isp, int cha fcportdb_t *lp; int i; - if (chan < 0 || chan >= isp->isp_nchan) { - isp_prt(isp, ISP_LOGWARN, "isp_mark_portdb: bad channel %d", chan); - return; - } for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; switch (lp->state) { From owner-svn-src-head@freebsd.org Thu Oct 29 20:45:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 639F0A21CA4; Thu, 29 Oct 2015 20:45:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 322D61322; Thu, 29 Oct 2015 20:45:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TKjrlg033724; Thu, 29 Oct 2015 20:45:53 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TKjrwS033723; Thu, 29 Oct 2015 20:45:53 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201510292045.t9TKjrwS033723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 29 Oct 2015 20:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290161 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 20:45:54 -0000 Author: kp Date: Thu Oct 29 20:45:53 2015 New Revision: 290161 URL: https://svnweb.freebsd.org/changeset/base/290161 Log: pf: Fix IPv6 checksums with route-to. When using route-to (or reply-to) pf sends the packet directly to the output interface. If that interface doesn't support checksum offloading the checksum has to be calculated in software. That was already done in the IPv4 case, but not for the IPv6 case. As a result we'd emit packets with pseudo-header checksums (i.e. incorrect checksums). This issue was exposed by the changes in r289316 when pf stopped performing full checksum calculations for all packets. Submitted by: Luoqi Chen MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Oct 29 20:43:13 2015 (r290160) +++ head/sys/netpfil/pf/pf.c Thu Oct 29 20:45:53 2015 (r290161) @@ -5574,6 +5574,13 @@ pf_route6(struct mbuf **m, struct pf_rul if (ifp->if_flags & IFF_LOOPBACK) m0->m_flags |= M_SKIP_FIREWALL; + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & + ~ifp->if_hwassist) { + uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); + in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); + m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } + /* * If the packet is too large for the outgoing interface, * send back an icmp6 error. From owner-svn-src-head@freebsd.org Thu Oct 29 21:00:13 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCC6A21EBA; Thu, 29 Oct 2015 21:00:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id EF8E41AA4; Thu, 29 Oct 2015 21:00:12 +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 t9TL0COK036883; Thu, 29 Oct 2015 21:00:12 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TL0CD6036882; Thu, 29 Oct 2015 21:00:12 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201510292100.t9TL0CD6036882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 29 Oct 2015 21:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290162 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:00:13 -0000 Author: jtl Date: Thu Oct 29 21:00:11 2015 New Revision: 290162 URL: https://svnweb.freebsd.org/changeset/base/290162 Log: Add myself (jtl) and my mentor to the committers-src.dot file. Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D4029 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Oct 29 20:45:53 2015 (r290161) +++ head/share/misc/committers-src.dot Thu Oct 29 21:00:11 2015 (r290162) @@ -206,6 +206,7 @@ joerg [label="Joerg Wunsch\njoerg@FreeBS jon [label="Jonathan Chen\njon@FreeBSD.org\n2000/10/17"] jonathan [label="Jonathan Anderson\njonathan@FreeBSD.org\n2010/10/07"] jpaetzel [label="Josh Paetzel\njpaetzel@FreeBSD.org\n2011/01/21"] +jtl [label="Jonathan T. Looney\njtl@FreeBSD.org\n2015/10/26"] julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/04/19"] jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] @@ -460,6 +461,7 @@ gnn -> davide gnn -> arybchik gnn -> erj gnn -> kp +gnn -> jtl grehan -> bryanv From owner-svn-src-head@freebsd.org Thu Oct 29 21:04:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12FD7A21FE1; Thu, 29 Oct 2015 21:04:25 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 C42501E30; Thu, 29 Oct 2015 21:04:24 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85 (FreeBSD)) (envelope-from ) id 1ZruMw-000ETz-L1; Thu, 29 Oct 2015 22:04:22 +0100 Subject: Re: svn commit: r290135 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux compat/linuxkpi/common/include/net compat/linuxkpi/common/src conf dev/usb modules/cxgb/iw... To: John Baldwin , Hans Petter Selasky References: <201510290828.t9T8SdKw015903@repo.freebsd.org> <9821922.q97pI4CWiy@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <563289D6.8070103@dumbbell.fr> Date: Thu, 29 Oct 2015 22:04:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <9821922.q97pI4CWiy@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f8jxlWgmmoDL5m8fM54r0MDi2tx40xsdq" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:04:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --f8jxlWgmmoDL5m8fM54r0MDi2tx40xsdq Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 29.10.2015 14:43, John Baldwin wrote: > On Thursday, October 29, 2015 08:28:39 AM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Thu Oct 29 08:28:39 2015 >> New Revision: 290135 >> URL: https://svnweb.freebsd.org/changeset/base/290135 >> >> Log: >> Finish process of moving the LinuxKPI module into the default kernel= build. >> =20 >> - Move all files related to the LinuxKPI into sys/compat/linuxkpi an= d >> its subfolders. >> - Update sys/conf/files and some Makefiles to use new file locations= =2E >> - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in tu= rn >> adds the LinuxKPI to all LINT builds. >> - The LinuxKPI can be added to the kernel by setting the >> COMPAT_LINUXKPI option. The OFED kernel option no longer builds th= e >> LinuxKPI into the kernel. This was done to keep the build rules fo= r >> the LinuxKPI in sys/conf/files simple. >> - Extend the LinuxKPI module to include support for USB by moving th= e >> Linux USB compat from usb.ko to linuxkpi.ko. >> - Bump the FreeBSD_version. >> - A universe kernel build has been done. >> =20 >> Reviewed by: np @ (cxgb and cxgbe related changes only) >> Sponsored by: Mellanox Technologies >=20 > Humm. Did you coordinate with dumbbell@ at all? In his reviews on pha= bricator > he had used subdirectories under linuxkpi for different versions Linux = kernel > versions. At the very least it seems like he should have been on the r= eview > for this since he is working in the same area doing a very similar thin= g? Hi! Hans kept me in the loop. He did the work because Mellanox was interested in this change and I have no time currently to work on this topic. My patch which allows to have multiple versions in parallel can be recreated in the future. We decided to put everything in "common" for now because we have no idea what version of Linux was used to create this layer. And it probably does not track a specific version at all. The layout is made so we can add version-specific implementations on top of the common directory. --=20 Jean-S=E9bastien P=E9dron --f8jxlWgmmoDL5m8fM54r0MDi2tx40xsdq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWMonWXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMXlMP/1138Z5+UiXWsAL5z0dZLlH5 yrtdIhGaL5FSg8WHpAvZkXqOsFU5Mrz9iV9s1Ps1rVt61VEVv+QsXF+MrTWPW3x7 0dwBcUxKKbTRNNv7bOxQSjekMNj4dY/62z8sRZdFLaxgdyKSp3ttFFm8q1C/rhoW Hjk8HV1xixp9W9bBaEoMP9Fe5KksbVtW3+EmGaYFv5erCvn6zPZoQeOR8hbOvO/I Ysk5qY5slFbFmxH8LuYJWAkwQ/AKgL2bvkBFgQLJhyt/Z1iRY9tXU8lrzfs4mk5v gB6cg538lgaBQoWcYjJKHaJ5s7KQmxSjW0AILWofWE50Vjm11rjw8G9EhHw4ltth Qg0CPcRgOxOze1CqwabcLpdFmMZ5XoEpzeA7xKjFEYApxF/DsIiEqvTPLT3NIcUL hfEBWZs1aH1mE+3+ANVQxgVpZH4ov9RKEJb4dCKt8WvwholygM0F9+pceMd7RtW0 cTwdId7VkvyWkjUl07ikaViKtoFUbbEAUfQzMEWuw/eU9bxOSA7bh87b9GBUu0Y/ an5fCKZGxvQRv6tJLZnQW7OZoOwWyOaOnGs/UY2xYyqxzeHSIWFPlbiUcu1ipR0w rPfx0zspTiWBSWxQvtzNgaFzxvi2IJ1Ma8Eyew6Nm+UrrT63c/d5wXEIXBIZ2HhM 0NjU/LDnCeHp3mckNr6X =BH5E -----END PGP SIGNATURE----- --f8jxlWgmmoDL5m8fM54r0MDi2tx40xsdq-- From owner-svn-src-head@freebsd.org Thu Oct 29 21:12:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F4C1A20259; Thu, 29 Oct 2015 21:12:59 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19590131E; Thu, 29 Oct 2015 21:12:59 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TLCwJr042373; Thu, 29 Oct 2015 21:12:58 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TLCwvf042371; Thu, 29 Oct 2015 21:12:58 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201510292112.t9TLCwvf042371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 29 Oct 2015 21:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290163 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:12:59 -0000 Author: dteske Date: Thu Oct 29 21:12:57 2015 New Revision: 290163 URL: https://svnweb.freebsd.org/changeset/base/290163 Log: Ignore per-mdN settings in mdconfig[2] startup PR: base/189696 Submitted by: ganael.laplanche@martymac.org MFC after: 3 days X-MFC-to: stable/10 stable/9 Modified: head/etc/rc.d/mdconfig head/etc/rc.d/mdconfig2 Modified: head/etc/rc.d/mdconfig ============================================================================== --- head/etc/rc.d/mdconfig Thu Oct 29 21:00:11 2015 (r290162) +++ head/etc/rc.d/mdconfig Thu Oct 29 21:12:57 2015 (r290163) @@ -186,6 +186,8 @@ if [ -z "${_mdconfig_list}" ]; then sort_lite -nk1.12` do _mdconfig_unit=${_mdconfig_config#mdconfig_md} + [ "${_mdconfig_unit#*[!0-9]}" = "$_mdconfig_unit" ] || + continue _mdconfig_list="$_mdconfig_list md$_mdconfig_unit" done _mdconfig_list="${_mdconfig_list# }" Modified: head/etc/rc.d/mdconfig2 ============================================================================== --- head/etc/rc.d/mdconfig2 Thu Oct 29 21:00:11 2015 (r290162) +++ head/etc/rc.d/mdconfig2 Thu Oct 29 21:12:57 2015 (r290163) @@ -216,6 +216,8 @@ if [ -z "${_mdconfig2_list}" ]; then sort_lite -nk1.12` do _mdconfig2_unit=${_mdconfig2_config#mdconfig_md} + [ "${_mdconfig2_unit#*[!0-9]}" = "$_mdconfig2_unit" ] || + continue _mdconfig2_list="$_mdconfig2_list md$_mdconfig2_unit" done _mdconfig2_list="${_mdconfig2_list# }" From owner-svn-src-head@freebsd.org Thu Oct 29 21:25:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D7F9A20597; Thu, 29 Oct 2015 21:25:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B20131ACC; Thu, 29 Oct 2015 21:25:47 +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 t9TLPkfV045521; Thu, 29 Oct 2015 21:25:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TLPkfN045519; Thu, 29 Oct 2015 21:25:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510292125.t9TLPkfN045519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 29 Oct 2015 21:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290164 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:25:48 -0000 Author: jhb Date: Thu Oct 29 21:25:46 2015 New Revision: 290164 URL: https://svnweb.freebsd.org/changeset/base/290164 Log: Use movw instead of movl (or plain mov) when moving segment registers into memory. This is a nop on clang's assembler, but some assemblers complain if the size suffix is incorrect. Submitted by: bde Modified: head/sys/i386/i386/exception.s head/sys/i386/include/asmacros.h Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Thu Oct 29 21:12:57 2015 (r290163) +++ head/sys/i386/i386/exception.s Thu Oct 29 21:25:46 2015 (r290164) @@ -158,11 +158,11 @@ IDTVEC(xmm) alltraps: pushal pushl $0 - movl %ds,(%esp) + movw %ds,(%esp) pushl $0 - movl %es,(%esp) + movw %es,(%esp) pushl $0 - movl %fs,(%esp) + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -237,11 +237,11 @@ IDTVEC(lcall_syscall) subl $4,%esp /* skip over tf_trapno */ pushal pushl $0 - movl %ds,(%esp) + movw %ds,(%esp) pushl $0 - movl %es,(%esp) + movw %es,(%esp) pushl $0 - movl %fs,(%esp) + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -266,11 +266,11 @@ IDTVEC(int0x80_syscall) subl $4,%esp /* skip over tf_trapno */ pushal pushl $0 - movl %ds,(%esp) + movw %ds,(%esp) pushl $0 - movl %es,(%esp) + movw %es,(%esp) pushl $0 - movl %fs,(%esp) + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -426,15 +426,15 @@ doreti_iret_fault: subl $8,%esp pushal pushl $0 - movl %ds,(%esp) + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: pushl $0 - movl %es,(%esp) + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: pushl $0 - movl %fs,(%esp) + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: head/sys/i386/include/asmacros.h ============================================================================== --- head/sys/i386/include/asmacros.h Thu Oct 29 21:12:57 2015 (r290163) +++ head/sys/i386/include/asmacros.h Thu Oct 29 21:25:46 2015 (r290164) @@ -147,11 +147,11 @@ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ pushl $0 ; /* save data and extra segments ... */ \ - mov %ds,(%esp) ; \ + movw %ds,(%esp) ; \ pushl $0 ; \ - mov %es,(%esp) ; \ + movw %es,(%esp) ; \ pushl $0 ; \ - mov %fs,(%esp) + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \ From owner-svn-src-head@freebsd.org Thu Oct 29 21:26:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79175A20604; Thu, 29 Oct 2015 21:26:33 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42ABC1C50; Thu, 29 Oct 2015 21:26:33 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TLQWi3045592; Thu, 29 Oct 2015 21:26:32 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TLQWxW045591; Thu, 29 Oct 2015 21:26:32 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201510292126.t9TLQWxW045591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 29 Oct 2015 21:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290165 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:26:33 -0000 Author: gnn Date: Thu Oct 29 21:26:32 2015 New Revision: 290165 URL: https://svnweb.freebsd.org/changeset/base/290165 Log: Set the proper direction to check for policies in this one case. Pointed out by: eri Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/netinet/ip_ipsec.c Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Thu Oct 29 21:25:46 2015 (r290164) +++ head/sys/netinet/ip_ipsec.c Thu Oct 29 21:26:32 2015 (r290165) @@ -159,7 +159,7 @@ ip_ipsec_output(struct mbuf **m, struct { struct secpolicy *sp; - if (!key_havesp(IPSEC_DIR_INBOUND)) + if (!key_havesp(IPSEC_DIR_OUTBOUND)) return 0; /* From owner-svn-src-head@freebsd.org Thu Oct 29 21:32:18 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 949B6A207C6; Thu, 29 Oct 2015 21:32:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 77961100D; Thu, 29 Oct 2015 21:32:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 7062016DA; Thu, 29 Oct 2015 21:32:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 264EB1784A; Thu, 29 Oct 2015 21:32:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id KZSrfCzLXt-B; Thu, 29 Oct 2015 21:32:15 +0000 (UTC) From: Bryan Drewery DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CB50B17840 Subject: Re: svn commit: r289279 - in head/sys: kern vm To: Eric van Gyzen , Tijl Coosemans , Jeff Roberson References: <201510140210.t9E2A79H056595@repo.freebsd.org> <20151029212554.799f76eb@kalimero.tijl.coosemans.org> <56328224.2010706@vangyzen.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kib@FreeBSD.org Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5632905E.6010202@FreeBSD.org> Date: Thu, 29 Oct 2015 14:32:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56328224.2010706@vangyzen.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9N6WHGihGOUR0kSbCeT7g5oIkp0xq6khf" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:32:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9N6WHGihGOUR0kSbCeT7g5oIkp0xq6khf Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/29/2015 1:31 PM, Eric van Gyzen wrote: > On 10/29/2015 15:25, Tijl Coosemans wrote: >> On Wed, 14 Oct 2015 02:10:07 +0000 (UTC) Jeff Roberson wrote: >>> Author: jeff >>> Date: Wed Oct 14 02:10:07 2015 >>> New Revision: 289279 >>> URL: https://svnweb.freebsd.org/changeset/base/289279 >>> >>> Log: >>> Parallelize the buffer cache and rewrite getnewbuf(). This results= in a >>> 8x performance improvement in a micro benchmark on a 4 socket machi= ne. >>> =20 >>> - Get buffer headers from a per-cpu uma cache that sits in from of= the >>> free queue. >>> - Use a per-cpu quantum cache in vmem to eliminate contention for = kva. >>> - Use multiple clean queues according to buffer cache size to elim= inate >>> clean queue lock contention. >>> - Introduce a bufspace daemon that attempts to prevent getnewbuf()= callers >>> from blocking or doing direct recycling. >>> - Close some bufspace allocation races that could lead to endless >>> recycling. >>> - Further the transition to a more modern style of small functions= grouped >>> by prefix in order to improve growing complexity. >> >> I have an i386 system that locks up easily after this commit. Booting= >> into single user and running make installkernel triggers it consistent= ly. >=20 > I can't help you debug this, but I noticed a follow-up commit that fixe= d > an uninitialized pointer introduced by this commit: >=20 > https://svnweb.freebsd.org/changeset/base/290155 >=20 > Pending comments from more enlightened folk, you might try updating to > that rev (if you can do so without a lockup...). I didn't analyze it enough to know if my change was fixing an actual bug and in what case. I think if so it is more likely to have random panics then a consistent lock up though. --=20 Regards, Bryan Drewery --9N6WHGihGOUR0kSbCeT7g5oIkp0xq6khf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWMpBfAAoJEDXXcbtuRpfPwOkIAJa5ZkknxTGob6FpiUC1SEHc y4tZktwTBU3n1M3+0D86fIHiC/a0XAFW4QyxbBZ6f+orH2ZpXN9+IIL6HralBdu4 cfXktYezfUlRcGyRNMmQc6Yg6a5gqVTwE7esVoxF6GKd7IPkN15mDJkceGAAAqZ5 659fD3Ine9IpEyFaDtcOXfgVVJQHIJ5xDJayv04BRVe6srkTan0hx83Lc8vR/eV7 wq4b/Lxi1DwFC48THAsxJFO1rQy0Lg8T9D4k41VCQuCiQa2FMPXBfvUKZUGzCaun ySHdWNwtUV5tW3ufqnzRyFdWqb+3ODam6keeckvBRYAUZUOo1ide0sWagBvEq0w= =TOr/ -----END PGP SIGNATURE----- --9N6WHGihGOUR0kSbCeT7g5oIkp0xq6khf-- From owner-svn-src-head@freebsd.org Thu Oct 29 21:40:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F1A1A20AE8; Thu, 29 Oct 2015 21:40:33 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 3B1E515CB; Thu, 29 Oct 2015 21:40:33 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TLeWKn050630; Thu, 29 Oct 2015 21:40:32 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TLeWaG050607; Thu, 29 Oct 2015 21:40:32 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201510292140.t9TLeWaG050607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 29 Oct 2015 21:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290166 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:40:33 -0000 Author: skra Date: Thu Oct 29 21:40:32 2015 New Revision: 290166 URL: https://svnweb.freebsd.org/changeset/base/290166 Log: Install myself as src committer. Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Oct 29 21:26:32 2015 (r290165) +++ head/share/misc/committers-src.dot Thu Oct 29 21:40:32 2015 (r290166) @@ -286,6 +286,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] +skra [label="Svatopluk Kraus\nslm@FreeBSD.org\n2015/10/28"] slm [label="Stephen McConnell\nslm@FreeBSD.org\n2014/05/07"] smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] @@ -576,6 +577,7 @@ kib -> pluknet kib -> rdivacky kib -> rmacklem kib -> rmh +kib -> skra kib -> stas kib -> tijl kib -> trociny From owner-svn-src-head@freebsd.org Thu Oct 29 21:48:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64CA5A20E4E for ; Thu, 29 Oct 2015 21:48:49 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::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 115F21C0D for ; Thu, 29 Oct 2015 21:48:48 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wijp11 with SMTP id p11so298923369wij.0 for ; Thu, 29 Oct 2015 14:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tybccvY5oNXc6dunYuc/HFK3thaXAv/GQnTyxHXOMCI=; b=v5pVtPB5bJlxuL06Gn4qxyXRkBkwS44Mg8H4EtTkrZ4d485DB2yMOVZcoUgNLcOiQV rlLK1W7vUlkV2BGOxZbYhT8coO0H63K0JF9GIinrPhWMsRS7wfEsRANx5UUjwt6xLadP XByLsWed2jbanvscmkPkqa3GjoYtUKzFeM9sP7x48aZCJiK8vDhjJxCGRQ+IYFS3eZEM cQ4pSOLS3JSoSocHx5QyfXkc08Aud9wNdGOD9rBYpGqDfJoIHF7ktgy8FBM1sQPqAV2f 9zTFf3WF8xDRMV1rUVP/i6GbNdV9aJkRTwsYBtE9c8Ln/ymdkKOjhEvaTLCVU22vVGiU dZtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tybccvY5oNXc6dunYuc/HFK3thaXAv/GQnTyxHXOMCI=; b=lP05wKPX83kLK8KJpDUIFv4h9c7nvCVbdkgD5L8WXq5rUbnDSOhldz2eLD3Xlbmvj+ oKSVhNaiAqrrFYQzuhpVMZ+8fQ15cNnE9n0ysFMA04w+z3KPmc0faW0mO7lFzF7aUBuB /zjNhi+3TKQ91XDZlswiapr1AsYZ3EIG8t9siJuZKhkGKgeVLIxTVBSDLTwtvHLkPeLY 7KbC1B3FW2YM0aKOfmgi6mKQrJz7mSZiS+9841mp+mndp48XwUosdqFUSBSRB3QqUq+y z8BAOyHLHUCT295ToRdwtb3o8nLB2T8lbEx0yq5bnbhn3DN8Crng5MULITwF5GldBUNI HhfQ== X-Gm-Message-State: ALoCoQllFUI788LKRn7ODcGvk6X7hkd6qh4Kdq57vGieFf3ubLroDXACg9/MxFwuMh6QHDdLm2Ad MIME-Version: 1.0 X-Received: by 10.194.115.230 with SMTP id jr6mr4653358wjb.143.1446155327430; Thu, 29 Oct 2015 14:48:47 -0700 (PDT) Received: by 10.194.240.226 with HTTP; Thu, 29 Oct 2015 14:48:47 -0700 (PDT) In-Reply-To: <5632447B.1020402@FreeBSD.org> References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> <562E1F8F.3010304@FreeBSD.org> <5632447B.1020402@FreeBSD.org> Date: Thu, 29 Oct 2015 22:48:47 +0100 Message-ID: Subject: Re: svn commit: r289834 - head/sys/x86/x86 From: Oliver Pinter To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 21:48:49 -0000 Yes, at next week I have time for the test. Please ping me again at Monday. On Thursday, October 29, 2015, Roger Pau Monn=C3=A9 wr= ote: > El 26/10/15 a les 15.24, Oliver Pinter ha escrit: > > On 10/26/15, Adrian Chadd > wrote= : > >> Hi, > >> > >> I'll take a photo of it when it breaks next. > >> > >> Would you mind reverting it for now until we can figure it out? > > > > btw, this was the two kernel panic what I got: > > > > Fatal trap 12: page fault while in kernel mode > > cpuid =3D 11; apic id =3D 03 > > fault virtual address =3D 0x30 > > fault code =3D supervisor read data, page not present > > instruction pointer =3D 0x20:0xffffffff808a2d22 > > stack pointer =3D 0x28:0xfffffe07cc75a6f0 > > frame pointer =3D 0x28:0xfffffe07cc75a770 > > code segment =3D base 0x0, limit 0xfffff, type 0x1b > > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > > current process =3D 5 (doneq0) > > trap number =3D 12 > > panic: page fault > > cpuid =3D 11 > > KDB: stack backtrace: > > #0 0xffffffff80641647 at kdb_backtrace+0x67 > > #1 0xffffffff80606762 at vpanic+0x182 > > #2 0xffffffff806067e3 at panic+0x43 > > #3 0xffffffff8084eef1 at trap_fatal+0x351 > > #4 0xffffffff8084f0e4 at trap_pfault+0x1e4 > > #5 0xffffffff8084e82f at trap+0x4bf > > #6 0xffffffff80830d57 at calltrap+0x8 > > #7 0xffffffff8063beab at _bus_dmamap_load_ccb+0x1fb > > #8 0xffffffff8063bc51 at bus_dmamap_load_ccb+0x91 > > #9 0xffffffff8042dcad at ata_dmaload+0x11d > > #10 0xffffffff8042df7e at ata_begin_transaction+0x7e > > #11 0xffffffff8042c18e at ataaction+0x9ce > > #12 0xffffffff802a220f at xpt_run_devq+0x5bf > > #13 0xffffffff802a17ad at xpt_action_default+0x94d > > #14 0xffffffff802c0024 at adastart+0x8b4 > > #15 0xffffffff802a2e93 at xpt_run_allocq+0x193 > > #16 0xffffffff802c0ea0 at adadone+0x280 > > #17 0xffffffff802a5310 at xpt_done_process+0x3a0 > > Uptime: 1m40s > > Hello, > > I've been able to reproduce this by tweaking blkfront dma tag, and the > issue was due to an off-by-one error. I've got an updated patch that > applies on top of current HEAD, would any of you two mind giving it a try= ? > > https://people.freebsd.org/~royger/bounce_load_ma.patch > > Thanks, Roger. > > From owner-svn-src-head@freebsd.org Thu Oct 29 22:12:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22BC8A21344; Thu, 29 Oct 2015 22:12:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC2FB1888; Thu, 29 Oct 2015 22:12:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TMC3Va058230; Thu, 29 Oct 2015 22:12:03 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TMC35I058229; Thu, 29 Oct 2015 22:12:03 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201510292212.t9TMC35I058229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 29 Oct 2015 22:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290167 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 22:12:05 -0000 Author: gonzo Date: Thu Oct 29 22:12:03 2015 New Revision: 290167 URL: https://svnweb.freebsd.org/changeset/base/290167 Log: Fix LEAVE_HYP macro: spsr is not guaranteed to contain valid value at this point, e.g. on RaspberryPi 2 when control is passed from loader to kernel it contains garbage. So we use cpsr as a base for new cpsr value: if we have reached this point it means current value is OK Reviewed by: andrew Modified: head/sys/arm/arm/locore-v6.S Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Thu Oct 29 21:40:32 2015 (r290166) +++ head/sys/arm/arm/locore-v6.S Thu Oct 29 22:12:03 2015 (r290167) @@ -74,9 +74,11 @@ __FBSDID("$FreeBSD$"); teq r0, #(PSR_HYP32_MODE) /* Hyp Mode? */ ;\ bne 1f ;\ /* Ensure that IRQ, FIQ and Aborts will be disabled after eret */ ;\ - mrs r0, spsr ;\ + mrs r0, cpsr ;\ + bic r0, r0, #(PSR_MODE) ;\ + orr r0, r0, #(PSR_SVC32_MODE) ;\ orr r0, r0, #(PSR_I | PSR_F | PSR_A) ;\ - msr spsr, r0 ;\ + msr spsr_cxsf, r0 ;\ /* Exit hypervisor mode */ ;\ adr lr, 1f ;\ MSR_ELR_HYP(14) ;\ From owner-svn-src-head@freebsd.org Thu Oct 29 23:02:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA2F9A21BF1; Thu, 29 Oct 2015 23:02:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D3911FE3; Thu, 29 Oct 2015 23:02:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TN2YZl074735; Thu, 29 Oct 2015 23:02:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TN2YEp074734; Thu, 29 Oct 2015 23:02:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510292302.t9TN2YEp074734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 23:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290168 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 23:02:35 -0000 Author: bdrewery Date: Thu Oct 29 23:02:34 2015 New Revision: 290168 URL: https://svnweb.freebsd.org/changeset/base/290168 Log: Fix several memory leaks, and crashes, in iconvlist(3). - Both curitem and curitem (via the names list) was always leaked. - malloc(3) failures lead to some leaks. - __bsd___iconv_get_list() failure lead to a crash since its error was not handles and __bsd___iconv_free_list() is not NULL-safe. I have slightly refactored this to avoid extra malloc and free logic in cases of malloc(3) failing. There are still bad assumptions here that I did not deal with. One of which is that the data will always have a '/' so the strchr(3) will not return NULL. Coverity CID: 1130055 1130054 1130053 Modified: head/lib/libc/iconv/bsd_iconv.c Modified: head/lib/libc/iconv/bsd_iconv.c ============================================================================== --- head/lib/libc/iconv/bsd_iconv.c Thu Oct 29 22:12:03 2015 (r290167) +++ head/lib/libc/iconv/bsd_iconv.c Thu Oct 29 23:02:34 2015 (r290168) @@ -207,43 +207,51 @@ __bsd_iconvlist(int (*do_one) (unsigned const char * const *np; char *curitem, *curkey, *slashpos; size_t sz; - unsigned int i, j; + unsigned int i, j, n; i = 0; + names = NULL; - if (__bsd___iconv_get_list(&list, &sz, true)) + if (__bsd___iconv_get_list(&list, &sz, true)) { list = NULL; + goto out; + } qsort((void *)list, sz, sizeof(char *), qsort_helper); while (i < sz) { j = 0; slashpos = strchr(list[i], '/'); - curkey = (char *)malloc(slashpos - list[i] + 2); - names = (char **)malloc(sz * sizeof(char *)); - if ((curkey == NULL) || (names == NULL)) { - __bsd___iconv_free_list(list, sz); - return; - } - strlcpy(curkey, list[i], slashpos - list[i] + 1); + names = malloc(sz * sizeof(char *)); + if (names == NULL) + goto out; + curkey = strndup(list[i], slashpos - list[i]); + if (curkey == NULL) + goto out; names[j++] = curkey; for (; (i < sz) && (memcmp(curkey, list[i], strlen(curkey)) == 0); i++) { slashpos = strchr(list[i], '/'); - curitem = (char *)malloc(strlen(slashpos) + 1); - if (curitem == NULL) { - __bsd___iconv_free_list(list, sz); - return; - } - strlcpy(curitem, &slashpos[1], strlen(slashpos) + 1); - if (strcmp(curkey, curitem) == 0) { + if (strcmp(curkey, &slashpos[1]) == 0) continue; - } + curitem = strdup(&slashpos[1]); + if (curitem == NULL) + goto out; names[j++] = curitem; } np = (const char * const *)names; do_one(j, np, data); + for (n = 0; n < j; n++) + free(names[n]); free(names); + names = NULL; } - __bsd___iconv_free_list(list, sz); +out: + if (names != NULL) { + for (n = 0; n < j; n++) + free(names[n]); + free(names); + } + if (list != NULL) + __bsd___iconv_free_list(list, sz); } __inline const char * From owner-svn-src-head@freebsd.org Thu Oct 29 23:06:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB3FA21D05; Thu, 29 Oct 2015 23:06:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45021128D; Thu, 29 Oct 2015 23:06:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TN6XcT075026; Thu, 29 Oct 2015 23:06:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TN6Xa6075025; Thu, 29 Oct 2015 23:06:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510292306.t9TN6Xa6075025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 23:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290169 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 23:06:34 -0000 Author: bdrewery Date: Thu Oct 29 23:06:33 2015 New Revision: 290169 URL: https://svnweb.freebsd.org/changeset/base/290169 Log: Use memmove(3) to avoid overlapping copy. Reported by: valgrind MFC after: 2 weeks X-MFC-With: r290168 Modified: head/lib/libc/iconv/citrus_esdb.c Modified: head/lib/libc/iconv/citrus_esdb.c ============================================================================== --- head/lib/libc/iconv/citrus_esdb.c Thu Oct 29 23:02:34 2015 (r290168) +++ head/lib/libc/iconv/citrus_esdb.c Thu Oct 29 23:06:33 2015 (r290169) @@ -328,7 +328,7 @@ _citrus_esdb_get_list(char ***rlist, siz (int)_region_size(&data), (const char *)_region_head(&data)); if ((p = strchr(buf1, '/')) != NULL) - memcpy(buf1, p + 1, strlen(p) - 1); + memmove(buf1, p + 1, strlen(p) - 1); if ((p = strstr(buf1, ".esdb")) != NULL) *p = '\0'; snprintf(buf, sizeof(buf), "%s/%.*s", buf1, From owner-svn-src-head@freebsd.org Thu Oct 29 23:56:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7596EA1F618; Thu, 29 Oct 2015 23:56:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35DC81787; Thu, 29 Oct 2015 23:56:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9TNuY4f089546; Thu, 29 Oct 2015 23:56:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9TNuY0d089545; Thu, 29 Oct 2015 23:56:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510292356.t9TNuY0d089545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 29 Oct 2015 23:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290170 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 29 Oct 2015 23:56:35 -0000 Author: bdrewery Date: Thu Oct 29 23:56:34 2015 New Revision: 290170 URL: https://svnweb.freebsd.org/changeset/base/290170 Log: Remove unneeded NULL as this is initialized with M_ZERO. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Thu Oct 29 23:06:33 2015 (r290169) +++ head/sys/dev/filemon/filemon.c Thu Oct 29 23:56:34 2015 (r290170) @@ -195,9 +195,6 @@ filemon_open(struct cdev *dev, int oflag if (filemon == NULL) { filemon = malloc(sizeof(struct filemon), M_FILEMON, M_WAITOK | M_ZERO); - - filemon->fp = NULL; - sx_init(&filemon->lock, "filemon"); } From owner-svn-src-head@freebsd.org Fri Oct 30 00:24:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C96D0A1FECE; Fri, 30 Oct 2015 00:24:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C87711BF; Fri, 30 Oct 2015 00:24:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U0ObMu097975; Fri, 30 Oct 2015 00:24:37 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U0ObWP097973; Fri, 30 Oct 2015 00:24:37 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201510300024.t9U0ObWP097973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 30 Oct 2015 00:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290171 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 00:24:38 -0000 Author: gonzo Date: Fri Oct 30 00:24:37 2015 New Revision: 290171 URL: https://svnweb.freebsd.org/changeset/base/290171 Log: Fix framebuffer compatibility with new RPi firmware. Framebuffer driver receives video memory address from VideoCore through property mailbox channel. Older versions of firmware (and the one that is currently part of sysutils/u-boot-rpi and sysutils/u-boot-rpi2) returned real physical address, newer one returns VideoCore bus address, so we need to convert it to actual physical address. this version works with both older and newer interface. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Thu Oct 29 23:56:34 2015 (r290170) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Fri Oct 30 00:24:37 2015 (r290171) @@ -577,7 +577,7 @@ bcm2835_mbox_fb_init(device_t dev, struc fb->xoffset = msg->offset.body.resp.x; fb->yoffset = msg->offset.body.resp.y; fb->pitch = msg->pitch.body.resp.pitch; - fb->base = msg->buffer.body.resp.fb_address; + fb->base = VCBUS_TO_PHYS(msg->buffer.body.resp.fb_address); fb->size = msg->buffer.body.resp.fb_size; } Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Thu Oct 29 23:56:34 2015 (r290170) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Fri Oct 30 00:24:37 2015 (r290171) @@ -67,6 +67,6 @@ * when address is returned by VC over mailbox interface. e.g. * framebuffer base */ -#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_BASE) +#define VCBUS_TO_PHYS(vca) ((vca) & ~(BCM2835_VCBUS_SDRAM_BASE)) #endif /* _BCM2835_VCBUS_H_ */ From owner-svn-src-head@freebsd.org Fri Oct 30 00:33:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1652BA2016D; Fri, 30 Oct 2015 00:33:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2F1E1929; Fri, 30 Oct 2015 00:33:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U0X3MD001008; Fri, 30 Oct 2015 00:33:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U0X31U001007; Fri, 30 Oct 2015 00:33:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201510300033.t9U0X31U001007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 30 Oct 2015 00:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290173 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 00:33:05 -0000 Author: delphij Date: Fri Oct 30 00:33:03 2015 New Revision: 290173 URL: https://svnweb.freebsd.org/changeset/base/290173 Log: Use strlcpy(). MFC after: 2 weeks Modified: head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/if.c ============================================================================== --- head/usr.sbin/rtadvd/if.c Fri Oct 30 00:30:00 2015 (r290172) +++ head/usr.sbin/rtadvd/if.c Fri Oct 30 00:33:03 2015 (r290173) @@ -358,8 +358,7 @@ update_persist_ifinfo(struct ifilist_hea ELM_MALLOC(ifi, exit(1)); ifi->ifi_ifindex = 0; - strncpy(ifi->ifi_ifname, ifname, sizeof(ifi->ifi_ifname)-1); - ifi->ifi_ifname[sizeof(ifi->ifi_ifname)-1] = '\0'; + strlcpy(ifi->ifi_ifname, ifname, sizeof(ifi->ifi_ifname)); ifi->ifi_rainfo = NULL; ifi->ifi_state = IFI_STATE_UNCONFIGURED; TAILQ_INSERT_TAIL(ifi_head, ifi, ifi_next); From owner-svn-src-head@freebsd.org Fri Oct 30 00:46:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D81A2036B; Fri, 30 Oct 2015 00:46:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA1A1D3F; Fri, 30 Oct 2015 00:46:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U0kqSJ004059; Fri, 30 Oct 2015 00:46:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U0kqiS004058; Fri, 30 Oct 2015 00:46:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201510300046.t9U0kqiS004058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 30 Oct 2015 00:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290174 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 00:46:54 -0000 Author: delphij Date: Fri Oct 30 00:46:52 2015 New Revision: 290174 URL: https://svnweb.freebsd.org/changeset/base/290174 Log: In pw_userlock, set 'name' to NULL when we encounter an all number string because it is also used as an indicator of whether a name or an UID is being used and we may have undefined results as 'name' may contain uninitialized stack contents. MFC after: 2 weeks Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Fri Oct 30 00:33:03 2015 (r290173) +++ head/usr.sbin/pw/pw_user.c Fri Oct 30 00:46:52 2015 (r290174) @@ -282,9 +282,10 @@ pw_userlock(char *arg1, int mode) if (arg1 == NULL) errx(EX_DATAERR, "username or id required"); - if (arg1[strspn(arg1, "0123456789")] == '\0') + if (arg1[strspn(arg1, "0123456789")] == '\0') { id = pw_checkid(arg1, UID_MAX); - else + name = NULL; + } else name = arg1; pwd = (name != NULL) ? GETPWNAM(pw_checkname(name, 0)) : GETPWUID(id); From owner-svn-src-head@freebsd.org Fri Oct 30 00:47:48 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A37EAA203CE for ; Fri, 30 Oct 2015 00:47:48 +0000 (UTC) (envelope-from cemeyer@uw.edu) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (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 6C4BC1E9F for ; Fri, 30 Oct 2015 00:47:48 +0000 (UTC) (envelope-from cemeyer@uw.edu) Received: by padhk11 with SMTP id hk11so55978885pad.1 for ; Thu, 29 Oct 2015 17:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uw_edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=SMGcLermn1V/Qy36zf/zbNnDKI62Aw0oIvPfX1/vPWA=; b=bKyUKHATamieW6gzOsPGfMjE3yBSd8PTGv5v2X67poLZ3yoDF6wQBmsjF3kuP/BSbR BlhEAkzNgafhUKJCFZzbw3cxNR34k6OteJa6sLgac/jIvj2kiMxOfdZ7hnmXLmYFAa76 lwPoreGNhEoBYMWiyviDj5Ti9jKK/Qz7Qe2oof+jheJmwRkriyb7IR+ul/Y76DIo0rWc ClojW5dt1MxVyAWGBjA7PP+7BnebcdC3DQ1LNL0OHBfGYmBjyy/LrRzcSkPZcLavBLrs vbJENuXfFMyciz2pdfIQGmBzqGre/ycA8cs6mX6j955KealTJ4XaSs3rFtqxdpZinEY3 B7+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=SMGcLermn1V/Qy36zf/zbNnDKI62Aw0oIvPfX1/vPWA=; b=Xkkh3es8cIfXRwKDDuKApEh3Lp3ILsMjM6ul13Cn2tZXLL8OVuuf04l0Lt4wF9XCMd GVqVTo0QzMfZPCAX21JVCGCnt3jkxP9jvIaA+ncyuCHxz/kuiisIw+IVWXH0lMaORGPW f0JZQKhOltA3o8Cz5F6rw/EJA3CZJcygYvnsdHK+A0YXfWkoBDEjCpnr+WZdHrnDbsHX 0mIdtuHo5C8LRy9+g6HUTOiPOjt1B5M40ZXnIi17BbxShy1+LsUB0NWuiZKlXchriSTj ECI4x9jD4xbAITKxyl33dqEKWo5T4Xo2OcNNTjfGmP6ywOZg4j/HYIw5F7aYPPUFKDHd G5ig== X-Gm-Message-State: ALoCoQmUZXznZuZxjEX/ijb6+Wohdr3cEfYnUSilupza3S4X9cRA63riAf3qILvCCqHW2IVuLIp3 X-Received: by 10.68.57.205 with SMTP id k13mr5320745pbq.4.1446166068037; Thu, 29 Oct 2015 17:47:48 -0700 (PDT) Received: from m (c-50-132-89-32.hsd1.wa.comcast.net. [50.132.89.32]) by smtp.gmail.com with ESMTPSA id ce3sm4536560pbb.35.2015.10.29.17.47.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 17:47:47 -0700 (PDT) Date: Thu, 29 Oct 2015 17:47:43 -0700 From: Conrad Meyer To: Konstantin Belousov Cc: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290130 - head/sys/dev/ntb/ntb_hw Message-ID: <20151029174743.51650c51@m> In-Reply-To: <20151029075343.GO2257@kib.kiev.ua> References: <201510290416.t9T4GSG7044279@repo.freebsd.org> <20151029075343.GO2257@kib.kiev.ua> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 00:47:48 -0000 On Thu, 29 Oct 2015 09:53:43 +0200 Konstantin Belousov wrote: > On Thu, Oct 29, 2015 at 04:16:28AM +0000, Conrad E. Meyer > wrote: > > Author: cem > > Date: Thu Oct 29 04:16:28 2015 > > New Revision: 290130 > > URL: https://svnweb.freebsd.org/changeset/base/290130 > > > > Log: > > ntb: Do not attempt to set write-combining on MWs > > > > AMD64 pmap assumes ranges will be in the DMAP, which > > isn't necessarily true for NTB memory windows (especially > > 64-bit BARs). > I am not sure what do you mean. pmap_change_attr() handles > either DMAP or kernel mapped memory. What JHB said -- the blind attempts to fixup DMAP memory types fixed in r290156. Best, Conrad From owner-svn-src-head@freebsd.org Fri Oct 30 01:18:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A04A209D1; Fri, 30 Oct 2015 01:18:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 93E5D1AE4; Fri, 30 Oct 2015 01:18:08 +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 t9U1I77Q012766; Fri, 30 Oct 2015 01:18:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U1I7pQ012765; Fri, 30 Oct 2015 01:18:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201510300118.t9U1I7pQ012765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 30 Oct 2015 01:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290175 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 01:18:08 -0000 Author: np Date: Fri Oct 30 01:18:07 2015 New Revision: 290175 URL: https://svnweb.freebsd.org/changeset/base/290175 Log: cxgbe/tom: decide whether to shove segments or not only if there is payload to transmit. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Oct 30 00:46:52 2015 (r290174) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Oct 30 01:18:07 2015 (r290175) @@ -675,7 +675,6 @@ t4_push_frames(struct adapter *sc, struc } } - shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); space = sbspace(sb); if (space <= sb->sb_hiwat * 3 / 8 && @@ -712,6 +711,7 @@ t4_push_frames(struct adapter *sc, struc if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); + shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); if (plen <= max_imm) { /* Immediate data tx */ From owner-svn-src-head@freebsd.org Fri Oct 30 01:19:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CBDCA20A5E; Fri, 30 Oct 2015 01:19:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B274F1CCD; Fri, 30 Oct 2015 01:19:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U1J4Lj012883; Fri, 30 Oct 2015 01:19:04 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U1J482012882; Fri, 30 Oct 2015 01:19:04 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201510300119.t9U1J482012882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 30 Oct 2015 01:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290176 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 01:19:06 -0000 Author: gonzo Date: Fri Oct 30 01:19:04 2015 New Revision: 290176 URL: https://svnweb.freebsd.org/changeset/base/290176 Log: Fix BULK read transfer if destination buffer is not cache line-aligned. We can't use copyout because destination memory is userland address in another process but we have reference to respective page so map the page into kernel address space and copy fragments there Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Fri Oct 30 01:18:07 2015 (r290175) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Fri Oct 30 01:19:04 2015 (r290176) @@ -109,6 +109,22 @@ vchiq_dmamap_cb(void *arg, bus_dma_segme *addr = PHYS_TO_VCBUS(segs[0].ds_addr); } +static int +copyout_page(vm_page_t p, size_t offset, void *kaddr, size_t size) +{ + uint8_t *dst; + + dst = pmap_mapdev(VM_PAGE_TO_PHYS(p), PAGE_SIZE); + if (!dst) + return ENOMEM; + + memcpy(dst + offset, kaddr, size); + + pmap_unmapdev((vm_offset_t)dst, PAGE_SIZE); + + return 0; +} + int __init vchiq_platform_init(VCHIQ_STATE_T *state) { @@ -560,15 +576,19 @@ free_pagelist(BULKINFO_T *bi, int actual if (head_bytes > actual) head_bytes = actual; - memcpy((char *)bi->buf, + copyout_page(pages[0], + pagelist->offset, fragments->headbuf, head_bytes); } if ((actual >= 0) && (head_bytes < actual) && (tail_bytes != 0)) { - memcpy((char *)bi->buf + actual - tail_bytes, - fragments->tailbuf, tail_bytes); + + copyout_page(pages[num_pages-1], + (((vm_offset_t)bi->buf + actual) % PAGE_SIZE) - tail_bytes, + fragments->tailbuf, + tail_bytes); } down(&g_free_fragments_mutex); From owner-svn-src-head@freebsd.org Fri Oct 30 03:28:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 475D3A21EFB; Fri, 30 Oct 2015 03:28:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A0510B5; Fri, 30 Oct 2015 03:28:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U3S1Z1050739; Fri, 30 Oct 2015 03:28:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U3S1N9050737; Fri, 30 Oct 2015 03:28:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300328.t9U3S1N9050737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 03:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290177 - in head: etc/mtree lib/libc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 03:28:02 -0000 Author: ngie Date: Fri Oct 30 03:28:00 2015 New Revision: 290177 URL: https://svnweb.freebsd.org/changeset/base/290177 Log: Integrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite as lib/libc/rpc This testcase requires rpcbind be up in running; otherwise the testcases will time out and be skipped MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/etc/mtree/BSD.tests.dist head/lib/libc/tests/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Oct 30 01:19:04 2015 (r290176) +++ head/etc/mtree/BSD.tests.dist Fri Oct 30 03:28:00 2015 (r290177) @@ -275,6 +275,8 @@ data .. .. + rpc + .. ssp .. stdio Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Fri Oct 30 01:19:04 2015 (r290176) +++ head/lib/libc/tests/Makefile Fri Oct 30 03:28:00 2015 (r290177) @@ -11,6 +11,7 @@ TESTS_SUBDIRS+= hash TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= regex +TESTS_SUBDIRS+= rpc TESTS_SUBDIRS+= stdio TESTS_SUBDIRS+= stdlib TESTS_SUBDIRS+= string From owner-svn-src-head@freebsd.org Fri Oct 30 05:33:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0388EA213DE; Fri, 30 Oct 2015 05:33:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC7371D07; Fri, 30 Oct 2015 05:33:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U5Xc0E087711; Fri, 30 Oct 2015 05:33:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U5Xc5x087710; Fri, 30 Oct 2015 05:33:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300533.t9U5Xc5x087710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 05:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290178 - head/secure/lib/libcrypto/engines/libgost X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 05:33:40 -0000 Author: ngie Date: Fri Oct 30 05:33:38 2015 New Revision: 290178 URL: https://svnweb.freebsd.org/changeset/base/290178 Log: Fix GOST engine cipher linkage by adding e_gost_err.c to SRCS so it picks up undefined symbols, like "ERR_load_GOST_strings" MFC after: 3 days PR: 184805 Submitted by: Ivan IvanZhdanov Sponsored by: EMC / Isilon Storage Division Modified: head/secure/lib/libcrypto/engines/libgost/Makefile Modified: head/secure/lib/libcrypto/engines/libgost/Makefile ============================================================================== --- head/secure/lib/libcrypto/engines/libgost/Makefile Fri Oct 30 03:28:00 2015 (r290177) +++ head/secure/lib/libcrypto/engines/libgost/Makefile Fri Oct 30 05:33:38 2015 (r290178) @@ -3,6 +3,7 @@ SHLIB_NAME?= libgost.so SRCS= gost2001.c gost2001_keyx.c gost89.c gost94_keyx.c gost_ameth.c \ gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c gost_keywrap.c \ - gost_md.c gost_params.c gost_pmeth.c gost_sign.c gosthash.c + gost_md.c gost_params.c gost_pmeth.c gost_sign.c gosthash.c \ + e_gost_err.c .include From owner-svn-src-head@freebsd.org Fri Oct 30 05:50:06 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E456AA21662; Fri, 30 Oct 2015 05:50:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B21581153; Fri, 30 Oct 2015 05:50:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U5o5Yq090835; Fri, 30 Oct 2015 05:50:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U5o54R090834; Fri, 30 Oct 2015 05:50:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300550.t9U5o54R090834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 05:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290179 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 05:50:07 -0000 Author: ngie Date: Fri Oct 30 05:50:05 2015 New Revision: 290179 URL: https://svnweb.freebsd.org/changeset/base/290179 Log: Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/gen/getgrent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Fri Oct 30 05:33:38 2015 (r290178) +++ head/lib/libc/gen/getgrent.c Fri Oct 30 05:50:05 2015 (r290179) @@ -660,14 +660,13 @@ __getgroupmembership(const char *uname, NS_FALLBACK_CB(getgroupmembership_fallback) { NULL, NULL, NULL } }; - int rv; assert(uname != NULL); /* groups may be NULL if just sizing when invoked with maxgrp = 0 */ assert(grpcnt != NULL); *grpcnt = 0; - rv = _nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", + (void)_nsdispatch(NULL, dtab, NSDB_GROUP, "getgroupmembership", defaultsrc, uname, agroup, groups, maxgrp, grpcnt); /* too many groups found? */ From owner-svn-src-head@freebsd.org Fri Oct 30 05:55:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 542C0A217EA; Fri, 30 Oct 2015 05:55:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EE911767; Fri, 30 Oct 2015 05:55:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U5tvxl093587; Fri, 30 Oct 2015 05:55:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U5tuFU093585; Fri, 30 Oct 2015 05:55:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300555.t9U5tuFU093585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 05:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290180 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 05:55:58 -0000 Author: ngie Date: Fri Oct 30 05:55:56 2015 New Revision: 290180 URL: https://svnweb.freebsd.org/changeset/base/290180 Log: Follow up to roundup feature addition in r289203 - Rename -r to -R to avoid the clash with makefs -r in NetBSD - Note that -R is an FFS-specific option because it's not implemented in cd9660 today - Rename the roundup variable to "roundup-size" in the manpage and help text for consistency with other variables. - Bump .Dd (missed in r289203) PR: 203707 MFC after: 1 week X-MFC with: r289203 Differential Revision: https://reviews.freebsd.org/D3959 Reviewed by: adrian (earlier patch), emaste Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Fri Oct 30 05:50:05 2015 (r290179) +++ head/usr.sbin/makefs/makefs.8 Fri Oct 30 05:55:56 2015 (r290180) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd October 29, 2015 .Dt MAKEFS 8 .Os .Sh NAME @@ -53,7 +53,7 @@ .Op Fl m Ar maximum-size .Op Fl N Ar userdb-dir .Op Fl o Ar fs-options -.Op Fl r Ar roundup +.Op Fl R Ar roundup-size .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -196,9 +196,14 @@ Deprecated. See the .Fl Z flag. -.It Fl r Ar roundup -Round the image up to specified block size that should be multiple -of block size. +.It Fl R Ar roundup-size +Round the image up to +.Ar roundup-size . +.Ar roundup-size +should be a multiple of the file system block size. +This option only applies to the +.Sy ffs +file system type. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Fri Oct 30 05:50:05 2015 (r290179) +++ head/usr.sbin/makefs/makefs.c Fri Oct 30 05:55:56 2015 (r290180) @@ -209,10 +209,10 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; - case 'r': + case 'R': /* Round image size up to specified block size */ fsoptions.roundup = - strsuftoll("roundup", optarg, 0, LLONG_MAX); + strsuftoll("roundup-size", optarg, 0, LLONG_MAX); break; case 's': @@ -365,7 +365,7 @@ usage(void) prog = getprogname(); fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" -"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-r roundup ]\n" +"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n" "\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n" "\t[-xZ] [-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); From owner-svn-src-head@freebsd.org Fri Oct 30 06:07:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E6ABA21A06; Fri, 30 Oct 2015 06:07:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6118C1C46; Fri, 30 Oct 2015 06:07:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U67fkC096488; Fri, 30 Oct 2015 06:07:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U67f05096487; Fri, 30 Oct 2015 06:07:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300607.t9U67f05096487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 06:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290181 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 06:07:42 -0000 Author: ngie Date: Fri Oct 30 06:07:41 2015 New Revision: 290181 URL: https://svnweb.freebsd.org/changeset/base/290181 Log: Unbreak bsd.progs.mk with PROGS (but not PROGS_CXX) and when invoking the "one of many" targets, e.g. `make hello_world`, where hello_world is a C program Tested with: PROGS and PROGS_CXX MFC after: 1 week X-MFC with: r289289 Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Oct 30 05:55:56 2015 (r290180) +++ head/share/mk/bsd.progs.mk Fri Oct 30 06:07:41 2015 (r290181) @@ -31,7 +31,7 @@ UPDATE_DEPENDFILE_PROG = ${PROGS:[1]} # They may have asked us to build just one .for t in ${PROGS} .if make($t) -.if ${PROGS_CXX:M${t}} +.if ${PROGS_CXX:U:M${t}} PROG_CXX ?= $t .endif PROG ?= $t From owner-svn-src-head@freebsd.org Fri Oct 30 07:36:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 484C5A218E1; Fri, 30 Oct 2015 07:36:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 126231BB0; Fri, 30 Oct 2015 07:36:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U7aiUa021992; Fri, 30 Oct 2015 07:36:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U7aill021991; Fri, 30 Oct 2015 07:36:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300736.t9U7aill021991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 07:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290182 - head/usr.sbin/rtsold X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 07:36:45 -0000 Author: ngie Date: Fri Oct 30 07:36:43 2015 New Revision: 290182 URL: https://svnweb.freebsd.org/changeset/base/290182 Log: Fix rtsold's usage message - Remove -a from the usage message example dealing with specific interfaces. -a only makes sense when not specifying an interface, such that it's to be run on all interfaces - Fix the pidfile option (it's -p, not -P) - Change `interfaces` to `interface` to match the manpage MFC after: 3 days PR: 173744 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Fri Oct 30 06:07:41 2015 (r290181) +++ head/usr.sbin/rtsold/rtsold.c Fri Oct 30 07:36:43 2015 (r290182) @@ -779,15 +779,15 @@ static void usage(void) { #ifndef SMALL - fprintf(stderr, "usage: rtsold [-adDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] interface ...\n"); + fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " + "[-p pidfile] [-R script-name] -a\n"); #else fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] interfaces...\n"); + "[-p pidfile] [-R script-name] interface ...\n"); fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " - "[-P pidfile] [-R script-name] -a\n"); + "[-p pidfile] [-R script-name] -a\n"); #endif } From owner-svn-src-head@freebsd.org Fri Oct 30 07:41:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E489CA21A39; Fri, 30 Oct 2015 07:41:35 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::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 7ABEE1DE9; Fri, 30 Oct 2015 07:41:35 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by wmeg8 with SMTP id g8so5260914wme.0; Fri, 30 Oct 2015 00:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-type:content-transfer-encoding; bh=TYArdvR25vT6J/bRYgYnZimUisICUCKXYXnZhKkYJPU=; b=hSQNGNPC7QYo9N62jMuOvZCUen0ltFSGex0Mx6JzwVL0jDFhZa3PYrb4od6P2BloEz QNvlcI/6IhCIR7cIn4duAxBAVHkKi1F28HYx6sK4HalshJlksQHfpQE2Hkh2/rnBdnd1 pXcnaOGLW550kjS66TkbBCib0/2BCF3xcAleI90nTwqdltQxvnrarTq/MPWjTMaP0MLi nS7F1ffCqks5nqmqClwILz6A8FGa7edMbXhGRGFWpzxegM28sm6g6ksX/BcQdMZ2VF2J AfLyy2fpS0YNv40k65tmLyBEnqblUnPQ12w16dDLXGO5rw6R/YiuCUaGR6boV9/n+Oxj ZCVQ== X-Received: by 10.28.134.134 with SMTP id i128mr1788559wmd.50.1446190893816; Fri, 30 Oct 2015 00:41:33 -0700 (PDT) Received: from ernst.home (p4FCA66C0.dip0.t-ipconnect.de. [79.202.102.192]) by smtp.gmail.com with ESMTPSA id lv4sm5621591wjb.43.2015.10.30.00.41.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2015 00:41:33 -0700 (PDT) Date: Fri, 30 Oct 2015 08:41:26 +0100 From: Gary Jennejohn To: Hans Petter Selasky Cc: Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux Message-ID: <20151030084126.53f7ffce@ernst.home> In-Reply-To: <56323B33.8020505@selasky.org> References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> <56323B33.8020505@selasky.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 07:41:36 -0000 On Thu, 29 Oct 2015 16:28:51 +0100 Hans Petter Selasky wrote: > On 10/29/15 15:36, Gleb Smirnoff wrote: > >> The LinuxKPI is not a binary compatibility module, and will at some > > H> point have API's diverging from Linux, to fit BSD API's better. > > > > This statement makes the name of LinuxKPI quite pointless, as well > > as the whole idea of the KPI unclear. > > Hi, > > To be more clear. Adding bind_irq_to_cpu() is more an exception than the > default. A the moment I think Linux doesn't have an equivalent of this > function, because of Linux's interrupt model. > My question is whether a "normal" FreeBSD user has any reason to enable LinuxKPI now or in the future. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Fri Oct 30 07:48:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D77AA21B24; Fri, 30 Oct 2015 07:48:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15EBB10D5; Fri, 30 Oct 2015 07:48:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U7m4c8024955; Fri, 30 Oct 2015 07:48:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U7m4PA024954; Fri, 30 Oct 2015 07:48:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300748.t9U7m4PA024954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 07:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290183 - head/lib/libc/tests/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 07:48:05 -0000 Author: ngie Date: Fri Oct 30 07:48:03 2015 New Revision: 290183 URL: https://svnweb.freebsd.org/changeset/base/290183 Log: - Re-enable h_raw with clang 3.7.0+ - Fix the compiler check to allow the test to be compiled for gcc PR: 196430 MFC after: never Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/ssp/Makefile Modified: head/lib/libc/tests/ssp/Makefile ============================================================================== --- head/lib/libc/tests/ssp/Makefile Fri Oct 30 07:36:43 2015 (r290182) +++ head/lib/libc/tests/ssp/Makefile Fri Oct 30 07:48:03 2015 (r290183) @@ -26,7 +26,8 @@ PROGS+= h_memmove PROGS+= h_memset # This testcase doesn't run properly when not compiled with -fsantize=bounds # with clang, which is currently contingent on a compiler_rt update -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500 +.if (${COMPILER_TYPE} != "clang" || \ + (${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION})) PROGS+= h_raw .endif PROGS+= h_read From owner-svn-src-head@freebsd.org Fri Oct 30 08:01:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEA5A21F48; Fri, 30 Oct 2015 08:01:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27AE3180B; Fri, 30 Oct 2015 08:01:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U81rr8030512; Fri, 30 Oct 2015 08:01:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U81rQT030511; Fri, 30 Oct 2015 08:01:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300801.t9U81rQT030511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 08:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290184 - head/contrib/netbsd-tests/lib/libc/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 08:01:54 -0000 Author: ngie Date: Fri Oct 30 08:01:53 2015 New Revision: 290184 URL: https://svnweb.freebsd.org/changeset/base/290184 Log: Fix a set but not used variable warning flagged by gcc 4.9 with lib/libc/ssp/h_readlink MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Fri Oct 30 07:48:03 2015 (r290183) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Fri Oct 30 08:01:53 2015 (r290184) @@ -46,7 +46,6 @@ main(int argc, char *argv[]) { #ifdef __FreeBSD__ char b[512], *sl; - int n; size_t len = atoi(argv[1]); sl = malloc(len); memset(sl, 'a', len); @@ -54,7 +53,7 @@ main(int argc, char *argv[]) unlink("symlink"); if (symlink(sl, "symlink") == -1) err(1, "symlink()"); - n = readlink("symlink", b, len); + (void)readlink("symlink", b, len); unlink("symlink"); #else char b[MAXPATHLEN]; From owner-svn-src-head@freebsd.org Fri Oct 30 08:02:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 495BBA2009B; Fri, 30 Oct 2015 08:02:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 0B2F419EF; Fri, 30 Oct 2015 08:02:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 23BC51FE023; Fri, 30 Oct 2015 09:02:53 +0100 (CET) Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux To: gljennjohn@gmail.com References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> <56323B33.8020505@selasky.org> <20151030084126.53f7ffce@ernst.home> Cc: Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer From: Hans Petter Selasky Message-ID: <56332494.4050709@selasky.org> Date: Fri, 30 Oct 2015 09:04:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151030084126.53f7ffce@ernst.home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 08:02:57 -0000 On 10/30/15 08:41, Gary Jennejohn wrote: > On Thu, 29 Oct 2015 16:28:51 +0100 > Hans Petter Selasky wrote: > >> On 10/29/15 15:36, Gleb Smirnoff wrote: >>>> The LinuxKPI is not a binary compatibility module, and will at some >>> H> point have API's diverging from Linux, to fit BSD API's better. >>> >>> This statement makes the name of LinuxKPI quite pointless, as well >>> as the whole idea of the KPI unclear. >> >> Hi, >> >> To be more clear. Adding bind_irq_to_cpu() is more an exception than the >> default. A the moment I think Linux doesn't have an equivalent of this >> function, because of Linux's interrupt model. >> > > My question is whether a "normal" FreeBSD user has any reason to > enable LinuxKPI now or in the future. > Hi, If drivers which depend on this feature are KLD's there's no reason to enable this by default in GENERIC. The current and future clients of LINUXKPI will possibly be KLD's and then MODULE_DEPEND() will do the magic behind the scenes. Was this your question? --HPS From owner-svn-src-head@freebsd.org Fri Oct 30 08:06:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8C2AA20139; Fri, 30 Oct 2015 08:06:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9391BA2; Fri, 30 Oct 2015 08:06:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9U86OBn030698; Fri, 30 Oct 2015 08:06:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U86OML030697; Fri, 30 Oct 2015 08:06:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510300806.t9U86OML030697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 08:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290185 - head/lib/libc/tests/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 08:06:25 -0000 Author: ngie Date: Fri Oct 30 08:06:24 2015 New Revision: 290185 URL: https://svnweb.freebsd.org/changeset/base/290185 Log: Disable h_raw/h_read with gcc I forgot that these testcases fail with gcc 4.2.1; add a note to that effect MFC after: never Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/ssp/Makefile Modified: head/lib/libc/tests/ssp/Makefile ============================================================================== --- head/lib/libc/tests/ssp/Makefile Fri Oct 30 08:01:53 2015 (r290184) +++ head/lib/libc/tests/ssp/Makefile Fri Oct 30 08:06:24 2015 (r290185) @@ -26,10 +26,15 @@ PROGS+= h_memmove PROGS+= h_memset # This testcase doesn't run properly when not compiled with -fsantize=bounds # with clang, which is currently contingent on a compiler_rt update -.if (${COMPILER_TYPE} != "clang" || \ - (${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION})) +# +# XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right +# now on amd64 when it trips the stack bounds specified in t_ssp.sh . This +# probably needs to be fixed as it's currently hardcoded. +.if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION} PROGS+= h_raw .endif +.endif PROGS+= h_read PROGS+= h_readlink PROGS+= h_snprintf From owner-svn-src-head@freebsd.org Fri Oct 30 08:11:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC1F5A20381; Fri, 30 Oct 2015 08:11:38 +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 mx1.freebsd.org (Postfix) with ESMTPS id 758481F33; Fri, 30 Oct 2015 08:11:38 +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 t9U8BbJp033343; Fri, 30 Oct 2015 08:11:37 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U8Bbte033337; Fri, 30 Oct 2015 08:11:37 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201510300811.t9U8Bbte033337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 30 Oct 2015 08:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290186 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 08:11:38 -0000 Author: ed Date: Fri Oct 30 08:11:37 2015 New Revision: 290186 URL: https://svnweb.freebsd.org/changeset/base/290186 Log: Make truss work for CloudABI processes on aarch64. This change copies over amd64-cloudabi64.c to aarch64-cloudabi.c and adjusts it to fetch the proper registers on aarch64. To reduce the amount of shared code, the errno conversion function is moved into a separate source file. Reviewed by: jhb, andrew Differential Revision: https://reviews.freebsd.org/D4023 Added: head/usr.bin/truss/aarch64-cloudabi64.c - copied, changed from r290090, head/usr.bin/truss/amd64-cloudabi64.c head/usr.bin/truss/cloudabi.c (contents, props changed) head/usr.bin/truss/cloudabi.h (contents, props changed) Modified: head/usr.bin/truss/Makefile head/usr.bin/truss/amd64-cloudabi64.c Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Fri Oct 30 08:06:24 2015 (r290185) +++ head/usr.bin/truss/Makefile Fri Oct 30 08:11:37 2015 (r290186) @@ -2,7 +2,7 @@ NO_WERROR= PROG= truss -SRCS= main.c setup.c syscalls.c ioctl.c +SRCS= cloudabi.c ioctl.c main.c setup.c syscalls.c .PATH: ${.CURDIR:H}/kdump SRCS+= utrace.c @@ -24,6 +24,9 @@ ABI_SYSPATH.amd64-linux32= sys/amd64/lin ABIS+= freebsd # Each ABI is expected to have an ABI.c, MACHINE_ARCH-ABI.c or # MACHINE_CPUARCH-ABI.c file that will be used to map the syscall arguments. +.if ${MACHINE_ARCH} == "aarch64" +ABIS+= cloudabi64 +.endif .if ${MACHINE_CPUARCH} == "i386" ABIS+= i386-linux .endif Copied and modified: head/usr.bin/truss/aarch64-cloudabi64.c (from r290090, head/usr.bin/truss/amd64-cloudabi64.c) ============================================================================== --- head/usr.bin/truss/amd64-cloudabi64.c Wed Oct 28 05:11:06 2015 (r290090, copy source) +++ head/usr.bin/truss/aarch64-cloudabi64.c Fri Oct 30 08:11:37 2015 (r290186) @@ -29,22 +29,22 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include -#include - +#include "cloudabi.h" #include "cloudabi64_syscalls.h" #include "truss.h" static int -amd64_cloudabi64_fetch_args(struct trussinfo *trussinfo, unsigned int narg) +aarch64_cloudabi64_fetch_args(struct trussinfo *trussinfo, unsigned int narg) { struct current_syscall *cs; struct reg regs; lwpid_t tid; + unsigned int i; tid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) { @@ -53,102 +53,13 @@ amd64_cloudabi64_fetch_args(struct truss } cs = &trussinfo->curthread->cs; - if (narg >= 1) - cs->args[0] = regs.r_rdi; - if (narg >= 2) - cs->args[1] = regs.r_rsi; - if (narg >= 3) - cs->args[2] = regs.r_rdx; - if (narg >= 4) - cs->args[3] = regs.r_rcx; - if (narg >= 5) - cs->args[4] = regs.r_r8; - if (narg >= 6) - cs->args[5] = regs.r_r9; + for (i = 0; i < narg && i < 8; i++) + cs->args[i] = regs.x[i]; return (0); } -static const int cloudabi_errno_table[] = { - [CLOUDABI_E2BIG] = E2BIG, - [CLOUDABI_EACCES] = EACCES, - [CLOUDABI_EADDRINUSE] = EADDRINUSE, - [CLOUDABI_EADDRNOTAVAIL] = EADDRNOTAVAIL, - [CLOUDABI_EAFNOSUPPORT] = EAFNOSUPPORT, - [CLOUDABI_EAGAIN] = EAGAIN, - [CLOUDABI_EALREADY] = EALREADY, - [CLOUDABI_EBADF] = EBADF, - [CLOUDABI_EBADMSG] = EBADMSG, - [CLOUDABI_EBUSY] = EBUSY, - [CLOUDABI_ECANCELED] = ECANCELED, - [CLOUDABI_ECHILD] = ECHILD, - [CLOUDABI_ECONNABORTED] = ECONNABORTED, - [CLOUDABI_ECONNREFUSED] = ECONNREFUSED, - [CLOUDABI_ECONNRESET] = ECONNRESET, - [CLOUDABI_EDEADLK] = EDEADLK, - [CLOUDABI_EDESTADDRREQ] = EDESTADDRREQ, - [CLOUDABI_EDOM] = EDOM, - [CLOUDABI_EDQUOT] = EDQUOT, - [CLOUDABI_EEXIST] = EEXIST, - [CLOUDABI_EFAULT] = EFAULT, - [CLOUDABI_EFBIG] = EFBIG, - [CLOUDABI_EHOSTUNREACH] = EHOSTUNREACH, - [CLOUDABI_EIDRM] = EIDRM, - [CLOUDABI_EILSEQ] = EILSEQ, - [CLOUDABI_EINPROGRESS] = EINPROGRESS, - [CLOUDABI_EINTR] = EINTR, - [CLOUDABI_EINVAL] = EINVAL, - [CLOUDABI_EIO] = EIO, - [CLOUDABI_EISCONN] = EISCONN, - [CLOUDABI_EISDIR] = EISDIR, - [CLOUDABI_ELOOP] = ELOOP, - [CLOUDABI_EMFILE] = EMFILE, - [CLOUDABI_EMLINK] = EMLINK, - [CLOUDABI_EMSGSIZE] = EMSGSIZE, - [CLOUDABI_EMULTIHOP] = EMULTIHOP, - [CLOUDABI_ENAMETOOLONG] = ENAMETOOLONG, - [CLOUDABI_ENETDOWN] = ENETDOWN, - [CLOUDABI_ENETRESET] = ENETRESET, - [CLOUDABI_ENETUNREACH] = ENETUNREACH, - [CLOUDABI_ENFILE] = ENFILE, - [CLOUDABI_ENOBUFS] = ENOBUFS, - [CLOUDABI_ENODEV] = ENODEV, - [CLOUDABI_ENOENT] = ENOENT, - [CLOUDABI_ENOEXEC] = ENOEXEC, - [CLOUDABI_ENOLCK] = ENOLCK, - [CLOUDABI_ENOLINK] = ENOLINK, - [CLOUDABI_ENOMEM] = ENOMEM, - [CLOUDABI_ENOMSG] = ENOMSG, - [CLOUDABI_ENOPROTOOPT] = ENOPROTOOPT, - [CLOUDABI_ENOSPC] = ENOSPC, - [CLOUDABI_ENOSYS] = ENOSYS, - [CLOUDABI_ENOTCONN] = ENOTCONN, - [CLOUDABI_ENOTDIR] = ENOTDIR, - [CLOUDABI_ENOTEMPTY] = ENOTEMPTY, - [CLOUDABI_ENOTRECOVERABLE] = ENOTRECOVERABLE, - [CLOUDABI_ENOTSOCK] = ENOTSOCK, - [CLOUDABI_ENOTSUP] = ENOTSUP, - [CLOUDABI_ENOTTY] = ENOTTY, - [CLOUDABI_ENXIO] = ENXIO, - [CLOUDABI_EOVERFLOW] = EOVERFLOW, - [CLOUDABI_EOWNERDEAD] = EOWNERDEAD, - [CLOUDABI_EPERM] = EPERM, - [CLOUDABI_EPIPE] = EPIPE, - [CLOUDABI_EPROTO] = EPROTO, - [CLOUDABI_EPROTONOSUPPORT] = EPROTONOSUPPORT, - [CLOUDABI_EPROTOTYPE] = EPROTOTYPE, - [CLOUDABI_ERANGE] = ERANGE, - [CLOUDABI_EROFS] = EROFS, - [CLOUDABI_ESPIPE] = ESPIPE, - [CLOUDABI_ESRCH] = ESRCH, - [CLOUDABI_ESTALE] = ESTALE, - [CLOUDABI_ETIMEDOUT] = ETIMEDOUT, - [CLOUDABI_ETXTBSY] = ETXTBSY, - [CLOUDABI_EXDEV] = EXDEV, - [CLOUDABI_ENOTCAPABLE] = ENOTCAPABLE, -}; - static int -amd64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval, +aarch64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) { struct reg regs; @@ -160,21 +71,20 @@ amd64_cloudabi64_fetch_retval(struct tru return (-1); } - retval[0] = regs.r_rax; - retval[1] = regs.r_rdx; - *errorp = (regs.r_rflags & PSL_C) != 0; - if (*errorp && *retval >= 0 && *retval < nitems(cloudabi_errno_table) && - cloudabi_errno_table[*retval] != 0) - *retval = cloudabi_errno_table[*retval]; + retval[0] = regs.x[0]; + retval[1] = regs.x[1]; + *errorp = (regs.spsr & PSR_C) != 0; + if (*errorp) + retval[0] = cloudabi_convert_errno(retval[0]); return (0); } -static struct procabi amd64_cloudabi64 = { +static struct procabi aarch64_cloudabi64 = { "CloudABI ELF64", syscallnames, nitems(syscallnames), - amd64_cloudabi64_fetch_args, - amd64_cloudabi64_fetch_retval + aarch64_cloudabi64_fetch_args, + aarch64_cloudabi64_fetch_retval }; -PROCABI(amd64_cloudabi64); +PROCABI(aarch64_cloudabi64); Modified: head/usr.bin/truss/amd64-cloudabi64.c ============================================================================== --- head/usr.bin/truss/amd64-cloudabi64.c Fri Oct 30 08:06:24 2015 (r290185) +++ head/usr.bin/truss/amd64-cloudabi64.c Fri Oct 30 08:11:37 2015 (r290186) @@ -34,8 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include - +#include "cloudabi.h" #include "cloudabi64_syscalls.h" #include "truss.h" @@ -68,85 +67,6 @@ amd64_cloudabi64_fetch_args(struct truss return (0); } -static const int cloudabi_errno_table[] = { - [CLOUDABI_E2BIG] = E2BIG, - [CLOUDABI_EACCES] = EACCES, - [CLOUDABI_EADDRINUSE] = EADDRINUSE, - [CLOUDABI_EADDRNOTAVAIL] = EADDRNOTAVAIL, - [CLOUDABI_EAFNOSUPPORT] = EAFNOSUPPORT, - [CLOUDABI_EAGAIN] = EAGAIN, - [CLOUDABI_EALREADY] = EALREADY, - [CLOUDABI_EBADF] = EBADF, - [CLOUDABI_EBADMSG] = EBADMSG, - [CLOUDABI_EBUSY] = EBUSY, - [CLOUDABI_ECANCELED] = ECANCELED, - [CLOUDABI_ECHILD] = ECHILD, - [CLOUDABI_ECONNABORTED] = ECONNABORTED, - [CLOUDABI_ECONNREFUSED] = ECONNREFUSED, - [CLOUDABI_ECONNRESET] = ECONNRESET, - [CLOUDABI_EDEADLK] = EDEADLK, - [CLOUDABI_EDESTADDRREQ] = EDESTADDRREQ, - [CLOUDABI_EDOM] = EDOM, - [CLOUDABI_EDQUOT] = EDQUOT, - [CLOUDABI_EEXIST] = EEXIST, - [CLOUDABI_EFAULT] = EFAULT, - [CLOUDABI_EFBIG] = EFBIG, - [CLOUDABI_EHOSTUNREACH] = EHOSTUNREACH, - [CLOUDABI_EIDRM] = EIDRM, - [CLOUDABI_EILSEQ] = EILSEQ, - [CLOUDABI_EINPROGRESS] = EINPROGRESS, - [CLOUDABI_EINTR] = EINTR, - [CLOUDABI_EINVAL] = EINVAL, - [CLOUDABI_EIO] = EIO, - [CLOUDABI_EISCONN] = EISCONN, - [CLOUDABI_EISDIR] = EISDIR, - [CLOUDABI_ELOOP] = ELOOP, - [CLOUDABI_EMFILE] = EMFILE, - [CLOUDABI_EMLINK] = EMLINK, - [CLOUDABI_EMSGSIZE] = EMSGSIZE, - [CLOUDABI_EMULTIHOP] = EMULTIHOP, - [CLOUDABI_ENAMETOOLONG] = ENAMETOOLONG, - [CLOUDABI_ENETDOWN] = ENETDOWN, - [CLOUDABI_ENETRESET] = ENETRESET, - [CLOUDABI_ENETUNREACH] = ENETUNREACH, - [CLOUDABI_ENFILE] = ENFILE, - [CLOUDABI_ENOBUFS] = ENOBUFS, - [CLOUDABI_ENODEV] = ENODEV, - [CLOUDABI_ENOENT] = ENOENT, - [CLOUDABI_ENOEXEC] = ENOEXEC, - [CLOUDABI_ENOLCK] = ENOLCK, - [CLOUDABI_ENOLINK] = ENOLINK, - [CLOUDABI_ENOMEM] = ENOMEM, - [CLOUDABI_ENOMSG] = ENOMSG, - [CLOUDABI_ENOPROTOOPT] = ENOPROTOOPT, - [CLOUDABI_ENOSPC] = ENOSPC, - [CLOUDABI_ENOSYS] = ENOSYS, - [CLOUDABI_ENOTCONN] = ENOTCONN, - [CLOUDABI_ENOTDIR] = ENOTDIR, - [CLOUDABI_ENOTEMPTY] = ENOTEMPTY, - [CLOUDABI_ENOTRECOVERABLE] = ENOTRECOVERABLE, - [CLOUDABI_ENOTSOCK] = ENOTSOCK, - [CLOUDABI_ENOTSUP] = ENOTSUP, - [CLOUDABI_ENOTTY] = ENOTTY, - [CLOUDABI_ENXIO] = ENXIO, - [CLOUDABI_EOVERFLOW] = EOVERFLOW, - [CLOUDABI_EOWNERDEAD] = EOWNERDEAD, - [CLOUDABI_EPERM] = EPERM, - [CLOUDABI_EPIPE] = EPIPE, - [CLOUDABI_EPROTO] = EPROTO, - [CLOUDABI_EPROTONOSUPPORT] = EPROTONOSUPPORT, - [CLOUDABI_EPROTOTYPE] = EPROTOTYPE, - [CLOUDABI_ERANGE] = ERANGE, - [CLOUDABI_EROFS] = EROFS, - [CLOUDABI_ESPIPE] = ESPIPE, - [CLOUDABI_ESRCH] = ESRCH, - [CLOUDABI_ESTALE] = ESTALE, - [CLOUDABI_ETIMEDOUT] = ETIMEDOUT, - [CLOUDABI_ETXTBSY] = ETXTBSY, - [CLOUDABI_EXDEV] = EXDEV, - [CLOUDABI_ENOTCAPABLE] = ENOTCAPABLE, -}; - static int amd64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) @@ -163,9 +83,8 @@ amd64_cloudabi64_fetch_retval(struct tru retval[0] = regs.r_rax; retval[1] = regs.r_rdx; *errorp = (regs.r_rflags & PSL_C) != 0; - if (*errorp && *retval >= 0 && *retval < nitems(cloudabi_errno_table) && - cloudabi_errno_table[*retval] != 0) - *retval = cloudabi_errno_table[*retval]; + if (*errorp) + retval[0] = cloudabi_convert_errno(retval[0]); return (0); } Added: head/usr.bin/truss/cloudabi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truss/cloudabi.c Fri Oct 30 08:11:37 2015 (r290186) @@ -0,0 +1,122 @@ +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * + * 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 "cloudabi.h" + +long +cloudabi_convert_errno(long error) +{ + static const int table[] = { + [CLOUDABI_E2BIG] = E2BIG, + [CLOUDABI_EACCES] = EACCES, + [CLOUDABI_EADDRINUSE] = EADDRINUSE, + [CLOUDABI_EADDRNOTAVAIL] = EADDRNOTAVAIL, + [CLOUDABI_EAFNOSUPPORT] = EAFNOSUPPORT, + [CLOUDABI_EAGAIN] = EAGAIN, + [CLOUDABI_EALREADY] = EALREADY, + [CLOUDABI_EBADF] = EBADF, + [CLOUDABI_EBADMSG] = EBADMSG, + [CLOUDABI_EBUSY] = EBUSY, + [CLOUDABI_ECANCELED] = ECANCELED, + [CLOUDABI_ECHILD] = ECHILD, + [CLOUDABI_ECONNABORTED] = ECONNABORTED, + [CLOUDABI_ECONNREFUSED] = ECONNREFUSED, + [CLOUDABI_ECONNRESET] = ECONNRESET, + [CLOUDABI_EDEADLK] = EDEADLK, + [CLOUDABI_EDESTADDRREQ] = EDESTADDRREQ, + [CLOUDABI_EDOM] = EDOM, + [CLOUDABI_EDQUOT] = EDQUOT, + [CLOUDABI_EEXIST] = EEXIST, + [CLOUDABI_EFAULT] = EFAULT, + [CLOUDABI_EFBIG] = EFBIG, + [CLOUDABI_EHOSTUNREACH] = EHOSTUNREACH, + [CLOUDABI_EIDRM] = EIDRM, + [CLOUDABI_EILSEQ] = EILSEQ, + [CLOUDABI_EINPROGRESS] = EINPROGRESS, + [CLOUDABI_EINTR] = EINTR, + [CLOUDABI_EINVAL] = EINVAL, + [CLOUDABI_EIO] = EIO, + [CLOUDABI_EISCONN] = EISCONN, + [CLOUDABI_EISDIR] = EISDIR, + [CLOUDABI_ELOOP] = ELOOP, + [CLOUDABI_EMFILE] = EMFILE, + [CLOUDABI_EMLINK] = EMLINK, + [CLOUDABI_EMSGSIZE] = EMSGSIZE, + [CLOUDABI_EMULTIHOP] = EMULTIHOP, + [CLOUDABI_ENAMETOOLONG] = ENAMETOOLONG, + [CLOUDABI_ENETDOWN] = ENETDOWN, + [CLOUDABI_ENETRESET] = ENETRESET, + [CLOUDABI_ENETUNREACH] = ENETUNREACH, + [CLOUDABI_ENFILE] = ENFILE, + [CLOUDABI_ENOBUFS] = ENOBUFS, + [CLOUDABI_ENODEV] = ENODEV, + [CLOUDABI_ENOENT] = ENOENT, + [CLOUDABI_ENOEXEC] = ENOEXEC, + [CLOUDABI_ENOLCK] = ENOLCK, + [CLOUDABI_ENOLINK] = ENOLINK, + [CLOUDABI_ENOMEM] = ENOMEM, + [CLOUDABI_ENOMSG] = ENOMSG, + [CLOUDABI_ENOPROTOOPT] = ENOPROTOOPT, + [CLOUDABI_ENOSPC] = ENOSPC, + [CLOUDABI_ENOSYS] = ENOSYS, + [CLOUDABI_ENOTCONN] = ENOTCONN, + [CLOUDABI_ENOTDIR] = ENOTDIR, + [CLOUDABI_ENOTEMPTY] = ENOTEMPTY, + [CLOUDABI_ENOTRECOVERABLE] = ENOTRECOVERABLE, + [CLOUDABI_ENOTSOCK] = ENOTSOCK, + [CLOUDABI_ENOTSUP] = ENOTSUP, + [CLOUDABI_ENOTTY] = ENOTTY, + [CLOUDABI_ENXIO] = ENXIO, + [CLOUDABI_EOVERFLOW] = EOVERFLOW, + [CLOUDABI_EOWNERDEAD] = EOWNERDEAD, + [CLOUDABI_EPERM] = EPERM, + [CLOUDABI_EPIPE] = EPIPE, + [CLOUDABI_EPROTO] = EPROTO, + [CLOUDABI_EPROTONOSUPPORT] = EPROTONOSUPPORT, + [CLOUDABI_EPROTOTYPE] = EPROTOTYPE, + [CLOUDABI_ERANGE] = ERANGE, + [CLOUDABI_EROFS] = EROFS, + [CLOUDABI_ESPIPE] = ESPIPE, + [CLOUDABI_ESRCH] = ESRCH, + [CLOUDABI_ESTALE] = ESTALE, + [CLOUDABI_ETIMEDOUT] = ETIMEDOUT, + [CLOUDABI_ETXTBSY] = ETXTBSY, + [CLOUDABI_EXDEV] = EXDEV, + [CLOUDABI_ENOTCAPABLE] = ENOTCAPABLE, + }; + + if (error < 0 || error >= nitems(table) || table[error] == 0) + return (error); + return (table[error]); +} Added: head/usr.bin/truss/cloudabi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truss/cloudabi.h Fri Oct 30 08:11:37 2015 (r290186) @@ -0,0 +1,28 @@ +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * + * 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$ + */ + +long cloudabi_convert_errno(long); From owner-svn-src-head@freebsd.org Fri Oct 30 09:53:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B0D3A21F2C; Fri, 30 Oct 2015 09:53:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id 272BF183C; Fri, 30 Oct 2015 09:53:34 +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 t9U9rXDZ062149; Fri, 30 Oct 2015 09:53:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9U9rXUX062148; Fri, 30 Oct 2015 09:53:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201510300953.t9U9rXUX062148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Oct 2015 09:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290188 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 09:53:34 -0000 Author: kib Date: Fri Oct 30 09:53:33 2015 New Revision: 290188 URL: https://svnweb.freebsd.org/changeset/base/290188 Log: The prefix for CLFLUSHOPT is 0x66. It was right on amd64. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/include/cpufunc.h Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Fri Oct 30 09:24:16 2015 (r290187) +++ head/sys/i386/include/cpufunc.h Fri Oct 30 09:53:33 2015 (r290188) @@ -89,7 +89,7 @@ static __inline void clflushopt(u_long addr) { - __asm __volatile(".byte 66;clflush %0" : : "m" (*(char *)addr)); + __asm __volatile(".byte 0x66;clflush %0" : : "m" (*(char *)addr)); } static __inline void From owner-svn-src-head@freebsd.org Fri Oct 30 10:09:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6C6A203AA; Fri, 30 Oct 2015 10:09:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83B2E1176; Fri, 30 Oct 2015 10:09:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UA94rm065248; Fri, 30 Oct 2015 10:09:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UA94Vw065246; Fri, 30 Oct 2015 10:09:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510301009.t9UA94Vw065246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 30 Oct 2015 10:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290190 - head/tools/regression/security/open_to_operation X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 10:09:05 -0000 Author: ngie Date: Fri Oct 30 10:09:04 2015 New Revision: 290190 URL: https://svnweb.freebsd.org/changeset/base/290190 Log: Fix compiler warnings with open_to_operation.c Other sidenotes: - Remove unused variables with main(..) - Convert errx/exit with -1 to errx/exit with 1 - Fix a bogus test in try_directory_open (expected_errno == expected_errno -> errno == expected_errno) [*] - Fix some warnings related to discarded qualifiers - Remove a bogus else-statement at the end of check_mmap_exec(..) in the successful case. mmap(2), POSIX, Linux, etc all don't state what the behavior is when mixing O_WRONLY + PROT_EXEC, so assume success for now to get the test program to pass again. PR: 201286 [*] MFC after: 1 week Submitted by: David Binderman Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/security/open_to_operation/Makefile head/tools/regression/security/open_to_operation/open_to_operation.c Modified: head/tools/regression/security/open_to_operation/Makefile ============================================================================== --- head/tools/regression/security/open_to_operation/Makefile Fri Oct 30 10:02:57 2015 (r290189) +++ head/tools/regression/security/open_to_operation/Makefile Fri Oct 30 10:09:04 2015 (r290190) @@ -2,6 +2,6 @@ PROG= open_to_operation MAN= -#WARNS= 3 +WARNS?= 3 .include Modified: head/tools/regression/security/open_to_operation/open_to_operation.c ============================================================================== --- head/tools/regression/security/open_to_operation/open_to_operation.c Fri Oct 30 10:02:57 2015 (r290189) +++ head/tools/regression/security/open_to_operation/open_to_operation.c Fri Oct 30 10:09:04 2015 (r290190) @@ -169,9 +169,9 @@ try_directory_open(const char *testname, ok_mode(testname, NULL, mode); close(dfd); } else { - if (expected_errno && expected_errno == expected_errno) + if (expected_errno && expected_errno == errno) ok_mode(testname, NULL, mode); - else if (expected_errno) + else if (expected_errno != 0) notok_mode(testname, "wrong errno", mode); else notok_mode(testname, "failed", mode); @@ -753,7 +753,8 @@ pwritev_wrapper(int d, const void *buf, static ssize_t aio_write_wrapper(int d, const void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -839,7 +840,8 @@ preadv_wrapper(int d, void *buf, size_t static ssize_t aio_read_wrapper(int d, void *buf, size_t nbytes) { - struct aiocb aiocb, *aiocb_array[1]; + struct aiocb aiocb; + struct aiocb const *aiocb_array[] = { &aiocb }; bzero(&aiocb, sizeof(aiocb)); aiocb.aio_fildes = d; @@ -847,7 +849,6 @@ aio_read_wrapper(int d, void *buf, size_ aiocb.aio_nbytes = nbytes; if (aio_read(&aiocb) < 0) return (-1); - aiocb_array[0] = &aiocb; if (aio_suspend(aiocb_array, 1, NULL) < 0) return (-1); return (aio_return(&aiocb)); @@ -1009,12 +1010,8 @@ check_mmap_exec(const char *testname, co if (isdir) notok_mode(testname, "mmap dir succeeded", mode); - else if ((mode & O_ACCMODE) == O_RDONLY || - (mode & O_ACCMODE) == O_RDWR) - ok_mode(testname, "mmap file succeeded", - mode); else - notok_mode(testname, "mmap file succeeded", + ok_mode(testname, "mmap file succeeded", mode); (void)munmap(addr, getpagesize()); } @@ -1069,7 +1066,7 @@ check_mmap_write_private(const char *tes } int -main(int argc, char *argv[]) +main(void) { char dir_path[PATH_MAX], file_path[PATH_MAX]; int dummy, fd; @@ -1084,25 +1081,25 @@ main(int argc, char *argv[]) strlcpy(dir_path, "/tmp/open-dir.XXXXXXXXXXX", sizeof(dir_path)); if (mkdtemp(dir_path) == NULL) - err(-1, "mkdtemp"); + err(1, "mkdtemp"); if (chmod(dir_path, PERM_DIR) < 0) { warn("chmod %s", dir_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } strlcpy(file_path, "/tmp/open-file.XXXXXXXXXXX", sizeof(file_path)); fd = mkstemp(file_path); if (fd < 0) { warn("mkstemp"); (void)rmdir(dir_path); - exit(-1); + exit(1); } close(fd); if (chmod(file_path, PERM_FILE) < 0) { warn("chmod %s", file_path); (void)unlink(file_path); (void)rmdir(dir_path); - exit(-1); + exit(1); } check_directory_open_modes(dir_path, file_modes, file_modes_count); From owner-svn-src-head@freebsd.org Fri Oct 30 10:15:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 849D9A206C3; Fri, 30 Oct 2015 10:15:29 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::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 1B3961793; Fri, 30 Oct 2015 10:15:29 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by wmeg8 with SMTP id g8so8090921wme.1; Fri, 30 Oct 2015 03:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-type:content-transfer-encoding; bh=u9yeyfk/RsRCK16kYr/JoGwSdcNcyxvJMAQXbHge19g=; b=DA9xsIiI2B3VqjbSzQTCPNBz5ZmhRv+nkj7helCGtFQDXnL/lDa7E3QPxLY1Ro/zEF VeW6lc/aHWpuVS/je7daMxLjflvbMm6bAGdJsmk53R80/0J75qSkt0GhjVXbAmTtLVao GCOcMgSAiUhjsI0kXBa3mZSx3MwsfncBIHHKFWDYrEOtbWkq6cBcQORm/4Z8nfuYPsuY SiLH9MZpc7fG8gKBtmKhUCpyjkSLR76fAjO1674xzQi8m0SWKTULmq8fBgVSwUJ6/0cs Fn7TcjDYKDzARGiLKSLWdt3Ownj03AHRdYq+Nd/0Q7nHOqIGVQwHCLmH2n0qz89IaUBP hzWQ== X-Received: by 10.28.51.70 with SMTP id z67mr2251742wmz.25.1446200127292; Fri, 30 Oct 2015 03:15:27 -0700 (PDT) Received: from ernst.home (p4FCA66C0.dip0.t-ipconnect.de. [79.202.102.192]) by smtp.gmail.com with ESMTPSA id d10sm6302384wje.14.2015.10.30.03.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2015 03:15:26 -0700 (PDT) Date: Fri, 30 Oct 2015 11:15:20 +0100 From: Gary Jennejohn To: Hans Petter Selasky Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux Message-ID: <20151030111520.09826845@ernst.home> In-Reply-To: <56332494.4050709@selasky.org> References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> <56323B33.8020505@selasky.org> <20151030084126.53f7ffce@ernst.home> <56332494.4050709@selasky.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 10:15:29 -0000 On Fri, 30 Oct 2015 09:04:36 +0100 Hans Petter Selasky wrote: > On 10/30/15 08:41, Gary Jennejohn wrote: > > On Thu, 29 Oct 2015 16:28:51 +0100 > > Hans Petter Selasky wrote: > > > >> On 10/29/15 15:36, Gleb Smirnoff wrote: > >>>> The LinuxKPI is not a binary compatibility module, and will at some > >>> H> point have API's diverging from Linux, to fit BSD API's better. > >>> > >>> This statement makes the name of LinuxKPI quite pointless, as well > >>> as the whole idea of the KPI unclear. > >> > >> Hi, > >> > >> To be more clear. Adding bind_irq_to_cpu() is more an exception than the > >> default. A the moment I think Linux doesn't have an equivalent of this > >> function, because of Linux's interrupt model. > >> > > > > My question is whether a "normal" FreeBSD user has any reason to > > enable LinuxKPI now or in the future. > > > > Hi, > > If drivers which depend on this feature are KLD's there's no reason to > enable this by default in GENERIC. The current and future clients of > LINUXKPI will possibly be KLD's and then MODULE_DEPEND() will do the > magic behind the scenes. Was this your question? > Well, I guess the answer is "no", if I understand you correctly. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Fri Oct 30 12:00:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D6CA21761; Fri, 30 Oct 2015 12:00: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 mx1.freebsd.org (Postfix) with ESMTPS id 252CF11EF; Fri, 30 Oct 2015 12:00: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 t9UC0Z5p004092; Fri, 30 Oct 2015 12:00:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UC0Zxa004091; Fri, 30 Oct 2015 12:00:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201510301200.t9UC0Zxa004091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 30 Oct 2015 12:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290191 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 12:00:36 -0000 Author: avg Date: Fri Oct 30 12:00:34 2015 New Revision: 290191 URL: https://svnweb.freebsd.org/changeset/base/290191 Log: l2arc: do not call trim_map_free() for blocks with zero b_asize b_asize can be zero if the block is compressed into an empty block (ZIO_COMPRESS_EMPTY) and the trim code asserts that meaningless zero-sized trimming is not attempted. The logic for calling trim_map_free() is extracted into a new function l2arc_trim() to minimize code duplication. PR: 203473 Reported by: Willem Jan Withagen Tested by: Willem Jan Withagen MFC after: 11 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 30 10:09:04 2015 (r290190) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 30 12:00:34 2015 (r290191) @@ -1131,6 +1131,24 @@ static boolean_t l2arc_compress_buf(arc_ static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress); static void l2arc_release_cdata_buf(arc_buf_hdr_t *); +static void +l2arc_trim(const arc_buf_hdr_t *hdr) +{ + l2arc_dev_t *dev = hdr->b_l2hdr.b_dev; + + ASSERT(HDR_HAS_L2HDR(hdr)); + ASSERT(MUTEX_HELD(&dev->l2ad_mtx)); + + if (hdr->b_l2hdr.b_daddr == L2ARC_ADDR_UNSET) + return; + if (hdr->b_l2hdr.b_asize != 0) { + trim_map_free(dev->l2ad_vdev, hdr->b_l2hdr.b_daddr, + hdr->b_l2hdr.b_asize, 0); + } else { + ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_EMPTY); + } +} + static uint64_t buf_hash(uint64_t spa, const dva_t *dva, uint64_t birth) { @@ -2403,10 +2421,7 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) * want to re-destroy the header's L2 portion. */ if (HDR_HAS_L2HDR(hdr)) { - if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) - trim_map_free(dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, - hdr->b_l2hdr.b_asize, 0); + l2arc_trim(hdr); arc_hdr_l2hdr_destroy(hdr); } @@ -4776,10 +4791,7 @@ arc_release(arc_buf_t *buf, void *tag) * to acquire the l2ad_mtx. */ if (HDR_HAS_L2HDR(hdr)) { - if (hdr->b_l2hdr.b_daddr != L2ARC_ADDR_UNSET) - trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, - hdr->b_l2hdr.b_asize, 0); + l2arc_trim(hdr); arc_hdr_l2hdr_destroy(hdr); } @@ -5966,8 +5978,7 @@ top: * Error - drop L2ARC entry. */ list_remove(buflist, hdr); - trim_map_free(hdr->b_l2hdr.b_dev->l2ad_vdev, - hdr->b_l2hdr.b_daddr, hdr->b_l2hdr.b_asize, 0); + l2arc_trim(hdr); hdr->b_flags &= ~ARC_FLAG_HAS_L2HDR; ARCSTAT_INCR(arcstat_l2_asize, -hdr->b_l2hdr.b_asize); From owner-svn-src-head@freebsd.org Fri Oct 30 12:21:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEFCDA21E60; Fri, 30 Oct 2015 12:21:38 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 8551D1FF8; Fri, 30 Oct 2015 12:21:38 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UCLbe3010593; Fri, 30 Oct 2015 12:21:37 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UCLbfS010592; Fri, 30 Oct 2015 12:21:37 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510301221.t9UCLbfS010592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 30 Oct 2015 12:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290192 - head/contrib/gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 12:21:38 -0000 Author: zbb Date: Fri Oct 30 12:21:37 2015 New Revision: 290192 URL: https://svnweb.freebsd.org/changeset/base/290192 Log: Workaround KGDB issues on ARM by ignoring ARM EABI version higher than 5 To make KGDB working, it needs to understand kernel ELF image. By default it is compiled using EABI_5, which is not supported on the gdb-6. As a workaround, treat these images as EABI_2 because they share a lot of things in common. This workaround does not guarantee ALL funtionalities to work. Submitted by: Wojciech Macek Reviewed by: jhb Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4012 Modified: head/contrib/gdb/gdb/arm-tdep.c Modified: head/contrib/gdb/gdb/arm-tdep.c ============================================================================== --- head/contrib/gdb/gdb/arm-tdep.c Fri Oct 30 12:00:34 2015 (r290191) +++ head/contrib/gdb/gdb/arm-tdep.c Fri Oct 30 12:21:37 2015 (r290192) @@ -2580,6 +2580,21 @@ arm_elf_osabi_sniffer (bfd *abfd) osabi = GDB_OSABI_ARM_EABI_V2; break; + case EF_ARM_EABI_VER3: + case EF_ARM_EABI_VER4: + case EF_ARM_EABI_VER5: + /* + * GDB does not support these EABI versions. Fallback + * to the highest known to make the KGDB working with + * kernel ELF image. + */ + osabi = GDB_OSABI_ARM_EABI_V2; + printf ("\n%s:%d " + "arm_elf_osabi_sniffer: Unsupported ARM EABI " + "version 0x%x, falling back to 0x%x\n", + __FILE__, __LINE__, eflags, EF_ARM_EABI_VER2); + break; + case EF_ARM_EABI_UNKNOWN: /* Assume GNU tools. */ osabi = GDB_OSABI_ARM_APCS; From owner-svn-src-head@freebsd.org Fri Oct 30 12:37:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C20FA211FF; Fri, 30 Oct 2015 12:37:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 461681820; Fri, 30 Oct 2015 12:37:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UCbeAo015536; Fri, 30 Oct 2015 12:37:40 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UCbeBi015535; Fri, 30 Oct 2015 12:37:40 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510301237.t9UCbeBi015535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 30 Oct 2015 12:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290193 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 12:37:41 -0000 Author: zbb Date: Fri Oct 30 12:37:40 2015 New Revision: 290193 URL: https://svnweb.freebsd.org/changeset/base/290193 Log: Use PCB/LR from PCB rather from stack on armv7-gdb The kernel dump does not store these values on the stack. Use PCB structure to resolve PC and LR properly. Submitted by: Wojciech Macek Reviewed by: jhb, kib Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4013 Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Fri Oct 30 12:21:37 2015 (r290192) +++ head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Fri Oct 30 12:37:40 2015 (r290193) @@ -63,7 +63,7 @@ kgdb_trgt_fetch_registers(int regno __un #ifndef CROSS_DEBUGGER struct kthr *kt; struct pcb pcb; - int i, reg; + int i; kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid)); if (kt == NULL) @@ -76,12 +76,8 @@ kgdb_trgt_fetch_registers(int regno __un supply_register(i, (char *)&pcb.pcb_regs.sf_r4 + (i - (ARM_A1_REGNUM + 4 )) * 4); } - if (pcb.pcb_regs.sf_sp != 0) { - if (kvm_read(kvm, pcb.pcb_regs.sf_sp + 4 * 4, ®, 4) != 4) - warnx("kvm_read :%s", kvm_geterr(kvm)); - else - supply_register(ARM_PC_REGNUM, (char *)®); - } + supply_register(ARM_PC_REGNUM, (char *)&pcb.pcb_regs.sf_pc); + supply_register(ARM_LR_REGNUM, (char *)&pcb.pcb_regs.sf_lr); #endif } From owner-svn-src-head@freebsd.org Fri Oct 30 13:53:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B43A1E4F8; Fri, 30 Oct 2015 13:53:17 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id B653E1B1A; Fri, 30 Oct 2015 13:53:17 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from bender (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 5ACF6D7900; Fri, 30 Oct 2015 13:52:47 +0000 (UTC) Date: Fri, 30 Oct 2015 13:52:45 +0000 From: Andrew Turner To: Zbigniew Bodek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290192 - head/contrib/gdb/gdb Message-ID: <20151030135245.5c8f31e8@bender> In-Reply-To: <201510301221.t9UCLbfS010592@repo.freebsd.org> References: <201510301221.t9UCLbfS010592@repo.freebsd.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 13:53:18 -0000 On Fri, 30 Oct 2015 12:21:37 +0000 (UTC) Zbigniew Bodek wrote: > Author: zbb > Date: Fri Oct 30 12:21:37 2015 > New Revision: 290192 > URL: https://svnweb.freebsd.org/changeset/base/290192 > > Log: > Workaround KGDB issues on ARM by ignoring ARM EABI version higher > than 5 > To make KGDB working, it needs to understand kernel ELF image. > By default it is compiled using EABI_5, which is not supported > on the gdb-6. As a workaround, treat these images as EABI_2 because > they share a lot of things in common. Why is this needed? The kernel should have the correct note to mark it as a FreeBSD binary which means gdb should use the FreeBSD. Is there something odd happening with kgdb that stops this working? Andrew From owner-svn-src-head@freebsd.org Fri Oct 30 14:50:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F774A1EF97; Fri, 30 Oct 2015 14:50:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6852D19A2; Fri, 30 Oct 2015 14:50:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UEoTv6054258; Fri, 30 Oct 2015 14:50:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UEoTCF054257; Fri, 30 Oct 2015 14:50:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510301450.t9UEoTCF054257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 30 Oct 2015 14:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290195 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 14:50:30 -0000 Author: hselasky Date: Fri Oct 30 14:50:29 2015 New Revision: 290195 URL: https://svnweb.freebsd.org/changeset/base/290195 Log: Reduce the DWC OTG interrupt load by not reading all the host channel status registers for every interrupt. Check a common host channel status interrupt register first, then conditionally read the individual host channel status registers. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Fri Oct 30 13:05:39 2015 (r290194) +++ head/sys/dev/usb/controller/dwc_otg.c Fri Oct 30 14:50:29 2015 (r290195) @@ -2558,6 +2558,7 @@ dwc_otg_interrupt_poll_locked(struct dwc struct usb_xfer *xfer; uint32_t count; uint32_t temp; + uint32_t haint; uint8_t got_rx_status; uint8_t x; @@ -2575,14 +2576,18 @@ repeat: DPRINTF("Yield\n"); return; } + /* get all host channel interrupts */ - for (x = 0; x != sc->sc_host_ch_max; x++) { + haint = DWC_OTG_READ_4(sc, DOTG_HAINT); + while (1) { + x = ffs(haint) - 1; + if (x >= sc->sc_host_ch_max) + break; temp = DWC_OTG_READ_4(sc, DOTG_HCINT(x)); - if (temp != 0) { - DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), temp); - temp &= ~HCINT_SOFTWARE_ONLY; - sc->sc_chan_state[x].hcint |= temp; - } + DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), temp); + temp &= ~HCINT_SOFTWARE_ONLY; + sc->sc_chan_state[x].hcint |= temp; + haint &= ~(1U << x); } if (sc->sc_last_rx_status == 0) { From owner-svn-src-head@freebsd.org Fri Oct 30 14:53:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F7BA200F8; Fri, 30 Oct 2015 14:53:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E57771D27; Fri, 30 Oct 2015 14:53:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DED221B08; Fri, 30 Oct 2015 14:53:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 99A7DFF33; Fri, 30 Oct 2015 14:53:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id RSTnqshgoKep; Fri, 30 Oct 2015 14:52:56 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8679EFF30 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r290003 - head/sys/ofed/include/linux From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: <20151030111520.09826845@ernst.home> Date: Fri, 30 Oct 2015 07:52:54 -0700 Cc: Hans Petter Selasky , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <0F2249D2-D5F9-4C8C-BA90-DEFEA7C7B00F@FreeBSD.org> References: <201510261328.t9QDSYRT076892@repo.freebsd.org> <56302F9D.2020308@freebsd.org> <56308289.4050902@selasky.org> <20151029143651.GN97830@FreeBSD.org> <56323B33.8020505@selasky.org> <20151030084126.53f7ffce@ernst.home> <56332494.4050709@selasky.org> <20151030111520.09826845@ernst.home> To: "gljennjohn@gmail.com" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 14:53:03 -0000 > On Oct 30, 2015, at 03:15, Gary Jennejohn wrote: >=20 > On Fri, 30 Oct 2015 09:04:36 +0100 > Hans Petter Selasky wrote: >=20 >>> On 10/30/15 08:41, Gary Jennejohn wrote: >>> On Thu, 29 Oct 2015 16:28:51 +0100 >>> Hans Petter Selasky wrote: >>>=20 >>>> On 10/29/15 15:36, Gleb Smirnoff wrote: =20 >>>>>> The LinuxKPI is not a binary compatibility module, and will at some >>>>> H> point have API's diverging from Linux, to fit BSD API's better. =20= >>>>>=20 >>>>> This statement makes the name of LinuxKPI quite pointless, as well >>>>> as the whole idea of the KPI unclear. =20 >>>>=20 >>>> Hi, >>>>=20 >>>> To be more clear. Adding bind_irq_to_cpu() is more an exception than th= e >>>> default. A the moment I think Linux doesn't have an equivalent of this >>>> function, because of Linux's interrupt model. >>>=20 >>> My question is whether a "normal" FreeBSD user has any reason to >>> enable LinuxKPI now or in the future. >>=20 >> Hi, >>=20 >> If drivers which depend on this feature are KLD's there's no reason to=20= >> enable this by default in GENERIC. The current and future clients of=20 >> LINUXKPI will possibly be KLD's and then MODULE_DEPEND() will do the=20 >> magic behind the scenes. Was this your question? >=20 > Well, I guess the answer is "no", if I understand you correctly. >=20 >=20 Only device driver developers need to think about this. Users don't. It's pu= rely to make development simpler. If a user uses such a driver it will load t= his module automatically. It won't let anyone load a Linux driver, it is onl= y for FreeBSD drivers using Linux-like code to make porting and maintenance s= impler.= From owner-svn-src-head@freebsd.org Fri Oct 30 15:35:05 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A10A207A3; Fri, 30 Oct 2015 15:35:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id 38DE01C3D; Fri, 30 Oct 2015 15:35:05 +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 t9UFZ4ft068215; Fri, 30 Oct 2015 15:35:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UFZ4Xv068214; Fri, 30 Oct 2015 15:35:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201510301535.t9UFZ4Xv068214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Oct 2015 15:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290196 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 15:35:05 -0000 Author: trasz Date: Fri Oct 30 15:35:04 2015 New Revision: 290196 URL: https://svnweb.freebsd.org/changeset/base/290196 Log: Make root mount wait mechanism smarter, by making it wait only if the root device doesn't yet exist. Reviewed by: kib@, marcel@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3709 Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Fri Oct 30 14:50:29 2015 (r290195) +++ head/sys/kern/vfs_mountroot.c Fri Oct 30 15:35:04 2015 (r290196) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); static int parse_mount(char **); static struct mntarg *parse_mountroot_options(struct mntarg *, const char *); +static int vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev); /* * The vnode of the system's root (/ in the filesystem, without chroot @@ -673,7 +674,7 @@ parse_mount(char **conf) char *errmsg; struct mntarg *ma; char *dev, *fs, *opts, *tok; - int delay, error, timeout; + int error; error = parse_token(conf, &tok); if (error) @@ -710,20 +711,9 @@ parse_mount(char **conf) goto out; } - if (strcmp(fs, "zfs") != 0 && strstr(fs, "nfs") == NULL && - dev[0] != '\0' && !parse_mount_dev_present(dev)) { - printf("mountroot: waiting for device %s ...\n", dev); - delay = hz / 10; - timeout = root_mount_timeout * hz; - do { - pause("rmdev", delay); - timeout -= delay; - } while (timeout > 0 && !parse_mount_dev_present(dev)); - if (timeout <= 0) { - error = ENODEV; - goto out; - } - } + error = vfs_mountroot_wait_if_neccessary(fs, dev); + if (error != 0) + goto out; ma = NULL; ma = mount_arg(ma, "fstype", fs, -1); @@ -931,6 +921,51 @@ vfs_mountroot_wait(void) } } +static int +vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev) +{ + int delay, timeout; + + /* + * In case of ZFS and NFS we don't have a way to wait for + * specific device. + */ + if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL || + dev[0] == '\0') { + vfs_mountroot_wait(); + return (0); + } + + /* + * Otherwise, no point in waiting if the device is already there. + * Note that we must wait for GEOM to finish reconfiguring itself, + * eg for geom_part(4) to finish tasting. + */ + DROP_GIANT(); + g_waitidle(); + PICKUP_GIANT(); + if (parse_mount_dev_present(dev)) + return (0); + + /* + * No luck. Let's wait. This code looks weird, but it's that way + * to behave exactly as it used to work before. + */ + vfs_mountroot_wait(); + printf("mountroot: waiting for device %s...\n", dev); + delay = hz / 10; + timeout = root_mount_timeout * hz; + do { + pause("rmdev", delay); + timeout -= delay; + } while (timeout > 0 && !parse_mount_dev_present(dev)); + + if (timeout <= 0) + return (ENODEV); + + return (0); +} + void vfs_mountroot(void) { @@ -942,8 +977,6 @@ vfs_mountroot(void) td = curthread; - vfs_mountroot_wait(); - sb = sbuf_new_auto(); vfs_mountroot_conf0(sb); sbuf_finish(sb); From owner-svn-src-head@freebsd.org Fri Oct 30 15:52:11 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D114CA20C38; Fri, 30 Oct 2015 15:52:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8D8B3161C; Fri, 30 Oct 2015 15:52:11 +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 t9UFqAhx073644; Fri, 30 Oct 2015 15:52:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UFqAtv073641; Fri, 30 Oct 2015 15:52:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201510301552.t9UFqAtv073641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 30 Oct 2015 15:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290197 - in head: etc/defaults etc/rc.d sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 15:52:11 -0000 Author: trasz Date: Fri Oct 30 15:52:10 2015 New Revision: 290197 URL: https://svnweb.freebsd.org/changeset/base/290197 Log: After r290196, the kernel won't wait for stuff like gmirror nodes if they are not required for mounting rootfs. However, it's possible that some setups try to mount them in mountcritlocal (ie from fstab). Export the list of current root mount holds using a new sysctl, vfs.root_mount_hold, and make mountcritlocal retry if "mount -a" fails and the list is not empty. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3709 Modified: head/etc/defaults/rc.conf head/etc/rc.d/mountcritlocal head/sys/kern/vfs_mountroot.c Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Fri Oct 30 15:35:04 2015 (r290196) +++ head/etc/defaults/rc.conf Fri Oct 30 15:52:10 2015 (r290197) @@ -84,6 +84,7 @@ geli_autodetach="YES" # Automatically de #geli_mirror_home_flags="-k /etc/geli/home.keys" root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. +root_hold_delay="30" # Time to wait for root mount hold release. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. fsck_y_flags="" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. Modified: head/etc/rc.d/mountcritlocal ============================================================================== --- head/etc/rc.d/mountcritlocal Fri Oct 30 15:35:04 2015 (r290196) +++ head/etc/rc.d/mountcritlocal Fri Oct 30 15:52:10 2015 (r290197) @@ -15,7 +15,7 @@ stop_cmd=sync mountcritlocal_start() { - local err + local err holders waited # Set up the list of network filesystem types for which mounting # should be delayed until after network initialization. @@ -35,8 +35,42 @@ mountcritlocal_start() mount_excludes="${mount_excludes}${fstype}," done mount_excludes=${mount_excludes%,} + + # Originally, root mount hold had to be released before mounting the root + # filesystem. This delayed the boot, so it was changed to only wait if + # the root device isn't readily available. This can result in this script + # executing before all the devices - such as graid(8) - are available. + # Thus, should the mount fail, we will wait for the root mount hold release + # and retry. mount -a -t ${mount_excludes} err=$? + if [ $? -ne 0 ]; then + echo + echo 'Mounting /etc/fstab filesystems failed,' \ + 'will retry after root mount hold release' + + waited=0 + while [ ${waited} -lt ${root_hold_delay} ]; do + holders="$(sysctl -n vfs.root_mount_hold)" + if [ -z "${holders}" ]; then + break; + fi + if [ ${waited} -eq 0 ]; then + echo -n "Waiting ${root_hold_delay}s" \ + "for the root mount holders: ${holders}" + else + echo -n . + fi + if [ ${waited} -eq ${root_hold_delay} ]; then + break 2 + fi + sleep 1 + waited=$(($waited + 1)) + done + mount -a -t ${mount_excludes} + err=$? + fi + check_startmsgs && echo '.' case ${err} in @@ -44,7 +78,7 @@ mountcritlocal_start() ;; *) echo 'Mounting /etc/fstab filesystems failed,' \ - ' startup aborted' + 'startup aborted' stop_boot true ;; esac Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Fri Oct 30 15:35:04 2015 (r290196) +++ head/sys/kern/vfs_mountroot.c Fri Oct 30 15:52:10 2015 (r290197) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); static int parse_mount(char **); static struct mntarg *parse_mountroot_options(struct mntarg *, const char *); +static int sysctl_vfs_root_mount_hold(SYSCTL_HANDLER_ARGS); static int vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev); /* @@ -130,6 +131,35 @@ static int root_mount_complete; static int root_mount_timeout = 3; TUNABLE_INT("vfs.mountroot.timeout", &root_mount_timeout); +SYSCTL_PROC(_vfs, OID_AUTO, root_mount_hold, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_vfs_root_mount_hold, "A", + "List of root mount hold tokens"); + +static int +sysctl_vfs_root_mount_hold(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct root_hold_token *h; + int error; + + sbuf_new(&sb, NULL, 256, SBUF_AUTOEXTEND | SBUF_INCLUDENUL); + + mtx_lock(&root_holds_mtx); + LIST_FOREACH(h, &root_holds, list) { + if (h != LIST_FIRST(&root_holds)) + sbuf_putc(&sb, ' '); + sbuf_printf(&sb, "%s", h->who); + } + mtx_unlock(&root_holds_mtx); + + error = sbuf_finish(&sb); + if (error == 0) + error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + sbuf_delete(&sb); + return (error); +} + struct root_hold_token * root_mount_hold(const char *identifier) { From owner-svn-src-head@freebsd.org Fri Oct 30 16:06:35 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE84A20EFF; Fri, 30 Oct 2015 16:06:35 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 29EF01DC5; Fri, 30 Oct 2015 16:06:35 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UG6YUp076690; Fri, 30 Oct 2015 16:06:34 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UG6YKn076689; Fri, 30 Oct 2015 16:06:34 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201510301606.t9UG6YKn076689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Fri, 30 Oct 2015 16:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290198 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 16:06:35 -0000 Author: jimharris Date: Fri Oct 30 16:06:34 2015 New Revision: 290198 URL: https://svnweb.freebsd.org/changeset/base/290198 Log: nvme: fix race condition in split bio completion path Fixes race condition observed under following circumstances: 1) I/O split on 128KB boundary with Intel NVMe controller. Current Intel controllers produce better latency when I/Os do not span a 128KB boundary - even if the I/O size itself is less than 128KB. 2) Per-CPU I/O queues are enabled. 3) Child I/Os are submitted on different submission queues. 4) Interrupts for child I/O completions occur almost simultaneously. 5) ithread for child I/O A increments bio_inbed, then immediately is preempted (rendezvous IPI, higher priority interrupt). 6) ithread for child I/O B increments bio_inbed, then completes parent bio since all children are now completed. 7) parent bio is freed, and immediately reallocated for a VFS or gpart bio (including setting bio_children to 1 and clearing bio_driver1). 8) ithread for child I/O A resumes processing. bio_children for what it thinks is the parent bio is set to 1, so it thinks it needs to complete the parent bio. Result is either calling a NULL callback function, or double freeing the bio to its uma zone. PR: 203746 Reported by: Drew Gallatin , Marc Goroff Tested by: Drew Gallatin MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Fri Oct 30 15:52:10 2015 (r290197) +++ head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:06:34 2015 (r290198) @@ -239,7 +239,7 @@ static void nvme_bio_child_inbed(struct bio *parent, int bio_error) { struct nvme_completion parent_cpl; - int inbed; + int children, inbed; if (bio_error != 0) { parent->bio_flags |= BIO_ERROR; @@ -248,10 +248,13 @@ nvme_bio_child_inbed(struct bio *parent, /* * atomic_fetchadd will return value before adding 1, so we still - * must add 1 to get the updated inbed number. + * must add 1 to get the updated inbed number. Save bio_children + * before incrementing to guard against race conditions when + * two children bios complete on different queues. */ + children = atomic_load_acq_int(&parent->bio_children); inbed = atomic_fetchadd_int(&parent->bio_inbed, 1) + 1; - if (inbed == parent->bio_children) { + if (inbed == children) { bzero(&parent_cpl, sizeof(parent_cpl)); if (parent->bio_flags & BIO_ERROR) parent_cpl.status.sc = NVME_SC_DATA_TRANSFER_ERROR; From owner-svn-src-head@freebsd.org Fri Oct 30 16:35:20 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DAB1A2156B; Fri, 30 Oct 2015 16:35:20 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E2F0D1A79; Fri, 30 Oct 2015 16:35:19 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UGZJNF085368; Fri, 30 Oct 2015 16:35:19 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UGZI0F085365; Fri, 30 Oct 2015 16:35:18 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201510301635.t9UGZI0F085365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Fri, 30 Oct 2015 16:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290199 - in head/sys/dev: nvd nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 16:35:20 -0000 Author: jimharris Date: Fri Oct 30 16:35:18 2015 New Revision: 290199 URL: https://svnweb.freebsd.org/changeset/base/290199 Log: nvd, nvme: report stripesize through GEOM disk layer MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Fri Oct 30 16:06:34 2015 (r290198) +++ head/sys/dev/nvd/nvd.c Fri Oct 30 16:35:18 2015 (r290199) @@ -279,6 +279,7 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); + disk->d_stripesize = nvme_ns_get_stripesize(ns); if (TAILQ_EMPTY(&disk_head)) disk->d_unit = 0; Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Oct 30 16:06:34 2015 (r290198) +++ head/sys/dev/nvme/nvme.h Fri Oct 30 16:35:18 2015 (r290199) @@ -870,6 +870,7 @@ const char * nvme_ns_get_serial_number(s const char * nvme_ns_get_model_number(struct nvme_namespace *ns); const struct nvme_namespace_data * nvme_ns_get_data(struct nvme_namespace *ns); +uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns); int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, nvme_cb_fn_t cb_fn); Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:06:34 2015 (r290198) +++ head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:35:18 2015 (r290199) @@ -210,6 +210,13 @@ nvme_ns_get_data(struct nvme_namespace * return (&ns->data); } +uint32_t +nvme_ns_get_stripesize(struct nvme_namespace *ns) +{ + + return (ns->stripesize); +} + static void nvme_ns_bio_done(void *arg, const struct nvme_completion *status) { From owner-svn-src-head@freebsd.org Fri Oct 30 17:05:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD0CA21C91; Fri, 30 Oct 2015 17:05:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E8D4C1A96; Fri, 30 Oct 2015 17:05:53 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UH5qFi094018; Fri, 30 Oct 2015 17:05:52 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UH5qMD094017; Fri, 30 Oct 2015 17:05:52 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201510301705.t9UH5qMD094017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 30 Oct 2015 17:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290200 - head/lib/libc/tests/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 17:05:54 -0000 Author: sbruno Date: Fri Oct 30 17:05:52 2015 New Revision: 290200 URL: https://svnweb.freebsd.org/changeset/base/290200 Log: Not all targets support by clang have a tested or enabled ubsan yet. Only enable h_raw on x86 targets for today so that a buildworld runs to completion for clang enabled targets that are not x86. This should be removed when validation of the sanitizer has occured for all targets supported by FreeBSD and clang. Modified: head/lib/libc/tests/ssp/Makefile Modified: head/lib/libc/tests/ssp/Makefile ============================================================================== --- head/lib/libc/tests/ssp/Makefile Fri Oct 30 16:35:18 2015 (r290199) +++ head/lib/libc/tests/ssp/Makefile Fri Oct 30 17:05:52 2015 (r290200) @@ -30,11 +30,15 @@ PROGS+= h_memset # XXX: the h_raw/h_read testcases don't cause a SIGABRT with in-tree gcc right # now on amd64 when it trips the stack bounds specified in t_ssp.sh . This # probably needs to be fixed as it's currently hardcoded. +# +# sanitizer is not tested or supported for ARM right now. sbruno +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" .if ${COMPILER_TYPE} == "clang" .if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION} PROGS+= h_raw .endif .endif +.endif PROGS+= h_read PROGS+= h_readlink PROGS+= h_snprintf From owner-svn-src-head@freebsd.org Fri Oct 30 17:12:16 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4A2A21EA7; Fri, 30 Oct 2015 17:12:16 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98EF11E56; Fri, 30 Oct 2015 17:12:16 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UHCFXP096814; Fri, 30 Oct 2015 17:12:15 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UHCFPd096813; Fri, 30 Oct 2015 17:12:15 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201510301712.t9UHCFPd096813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 30 Oct 2015 17:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290201 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 17:12:16 -0000 Author: sjg Date: Fri Oct 30 17:12:15 2015 New Revision: 290201 URL: https://svnweb.freebsd.org/changeset/base/290201 Log: Do not FALLTHROUGH for SIOC{ADD,DEL}MULTI ifmedia_ioctl() returns EINVAL Differential Revision: 3897 Submitted by: aronen@juniper.net Reviewed by: marcel Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Oct 30 17:05:52 2015 (r290200) +++ head/sys/dev/xen/netfront/netfront.c Fri Oct 30 17:12:15 2015 (r290201) @@ -1663,7 +1663,7 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, error = 0; } #endif - /* FALLTHROUGH */ + break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); From owner-svn-src-head@freebsd.org Fri Oct 30 17:30:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93024A222BF; Fri, 30 Oct 2015 17:30:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5961619; Fri, 30 Oct 2015 17:30:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 78F221C55; Fri, 30 Oct 2015 17:30:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1E3A9102A0; Fri, 30 Oct 2015 17:30:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id MX9vHzXtt7h5; Fri, 30 Oct 2015 17:30:38 +0000 (UTC) Subject: Re: svn commit: r290201 - head/sys/dev/xen/netfront DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 369D21029A To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510301712.t9UHCFPd096813@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <5633A93B.2010508@FreeBSD.org> Date: Fri, 30 Oct 2015 10:30:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510301712.t9UHCFPd096813@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 17:30:41 -0000 On 10/30/15 10:12 AM, Simon J. Gerraty wrote: > Author: sjg > Date: Fri Oct 30 17:12:15 2015 > New Revision: 290201 > URL: https://svnweb.freebsd.org/changeset/base/290201 > > Log: > Do not FALLTHROUGH for SIOC{ADD,DEL}MULTI > > ifmedia_ioctl() returns EINVAL > > Differential Revision: 3897 > Submitted by: aronen@juniper.net > Reviewed by: marcel Putting on the last line will properly close and associate the commit with the review: Differential Revision: https://reviews.freebsd.org/D3897 -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Fri Oct 30 19:20:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F06A1F83C; Fri, 30 Oct 2015 19:20:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB831568; Fri, 30 Oct 2015 19:20:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UJKfJU031956; Fri, 30 Oct 2015 19:20:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UJKf7b031954; Fri, 30 Oct 2015 19:20:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201510301920.t9UJKf7b031954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Oct 2015 19:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290202 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 19:20:42 -0000 Author: kib Date: Fri Oct 30 19:20:40 2015 New Revision: 290202 URL: https://svnweb.freebsd.org/changeset/base/290202 Log: Use C99 array initialization, which also makes the code self-documented, and eases addition of new ops. For the similar reasons, eliminate UMTX_OP_MAX. nitems() handles the only use of the symbol. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_umtx.c head/sys/sys/umtx.h Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Oct 30 17:12:15 2015 (r290201) +++ head/sys/kern/kern_umtx.c Fri Oct 30 19:20:40 2015 (r290202) @@ -3439,43 +3439,44 @@ __umtx_op_sem2_wake(struct thread *td, s typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); -static _umtx_op_func op_table[] = { - __umtx_op_unimpl, /* UMTX_OP_RESERVED0 */ - __umtx_op_unimpl, /* UMTX_OP_RESERVED1 */ - __umtx_op_wait, /* UMTX_OP_WAIT */ - __umtx_op_wake, /* UMTX_OP_WAKE */ - __umtx_op_trylock_umutex, /* UMTX_OP_MUTEX_TRYLOCK */ - __umtx_op_lock_umutex, /* UMTX_OP_MUTEX_LOCK */ - __umtx_op_unlock_umutex, /* UMTX_OP_MUTEX_UNLOCK */ - __umtx_op_set_ceiling, /* UMTX_OP_SET_CEILING */ - __umtx_op_cv_wait, /* UMTX_OP_CV_WAIT*/ - __umtx_op_cv_signal, /* UMTX_OP_CV_SIGNAL */ - __umtx_op_cv_broadcast, /* UMTX_OP_CV_BROADCAST */ - __umtx_op_wait_uint, /* UMTX_OP_WAIT_UINT */ - __umtx_op_rw_rdlock, /* UMTX_OP_RW_RDLOCK */ - __umtx_op_rw_wrlock, /* UMTX_OP_RW_WRLOCK */ - __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ - __umtx_op_wait_uint_private, /* UMTX_OP_WAIT_UINT_PRIVATE */ - __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ - __umtx_op_wait_umutex, /* UMTX_OP_MUTEX_WAIT */ - __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ +static const _umtx_op_func op_table[] = { + [UMTX_OP_RESERVED0] = __umtx_op_unimpl, + [UMTX_OP_RESERVED1] = __umtx_op_unimpl, + [UMTX_OP_WAIT] = __umtx_op_wait, + [UMTX_OP_WAKE] = __umtx_op_wake, + [UMTX_OP_MUTEX_TRYLOCK] = __umtx_op_trylock_umutex, + [UMTX_OP_MUTEX_LOCK] = __umtx_op_lock_umutex, + [UMTX_OP_MUTEX_UNLOCK] = __umtx_op_unlock_umutex, + [UMTX_OP_SET_CEILING] = __umtx_op_set_ceiling, + [UMTX_OP_CV_WAIT] = __umtx_op_cv_wait, + [UMTX_OP_CV_SIGNAL] = __umtx_op_cv_signal, + [UMTX_OP_CV_BROADCAST] = __umtx_op_cv_broadcast, + [UMTX_OP_WAIT_UINT] = __umtx_op_wait_uint, + [UMTX_OP_RW_RDLOCK] = __umtx_op_rw_rdlock, + [UMTX_OP_RW_WRLOCK] = __umtx_op_rw_wrlock, + [UMTX_OP_RW_UNLOCK] = __umtx_op_rw_unlock, + [UMTX_OP_WAIT_UINT_PRIVATE] = __umtx_op_wait_uint_private, + [UMTX_OP_WAKE_PRIVATE] = __umtx_op_wake_private, + [UMTX_OP_MUTEX_WAIT] = __umtx_op_wait_umutex, + [UMTX_OP_MUTEX_WAKE] = __umtx_op_wake_umutex, #if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) - __umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */ - __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ + [UMTX_OP_SEM_WAIT] = __umtx_op_sem_wait, + [UMTX_OP_SEM_WAKE] = __umtx_op_sem_wake, #else - __umtx_op_unimpl, /* UMTX_OP_SEM_WAIT */ - __umtx_op_unimpl, /* UMTX_OP_SEM_WAKE */ + [UMTX_OP_SEM_WAIT] = __umtx_op_unimpl, + [UMTX_OP_SEM_WAKE] = __umtx_op_unimpl, #endif - __umtx_op_nwake_private, /* UMTX_OP_NWAKE_PRIVATE */ - __umtx_op_wake2_umutex, /* UMTX_OP_MUTEX_WAKE2 */ - __umtx_op_sem2_wait, /* UMTX_OP_SEM2_WAIT */ - __umtx_op_sem2_wake, /* UMTX_OP_SEM2_WAKE */ + [UMTX_OP_NWAKE_PRIVATE] = __umtx_op_nwake_private, + [UMTX_OP_MUTEX_WAKE2] = __umtx_op_wake2_umutex, + [UMTX_OP_SEM2_WAIT] = __umtx_op_sem2_wait, + [UMTX_OP_SEM2_WAKE] = __umtx_op_sem2_wake, }; int sys__umtx_op(struct thread *td, struct _umtx_op_args *uap) { - if ((unsigned)uap->op < UMTX_OP_MAX) + + if ((unsigned)uap->op < nitems(op_table)) return (*op_table[uap->op])(td, uap); return (EINVAL); } @@ -3734,44 +3735,46 @@ __umtx_op_nwake_private32(struct thread } static _umtx_op_func op_table_compat32[] = { - __umtx_op_unimpl, /* UMTX_OP_RESERVED0 */ - __umtx_op_unimpl, /* UMTX_OP_RESERVED1 */ - __umtx_op_wait_compat32, /* UMTX_OP_WAIT */ - __umtx_op_wake, /* UMTX_OP_WAKE */ - __umtx_op_trylock_umutex, /* UMTX_OP_MUTEX_LOCK */ - __umtx_op_lock_umutex_compat32, /* UMTX_OP_MUTEX_TRYLOCK */ - __umtx_op_unlock_umutex, /* UMTX_OP_MUTEX_UNLOCK */ - __umtx_op_set_ceiling, /* UMTX_OP_SET_CEILING */ - __umtx_op_cv_wait_compat32, /* UMTX_OP_CV_WAIT*/ - __umtx_op_cv_signal, /* UMTX_OP_CV_SIGNAL */ - __umtx_op_cv_broadcast, /* UMTX_OP_CV_BROADCAST */ - __umtx_op_wait_compat32, /* UMTX_OP_WAIT_UINT */ - __umtx_op_rw_rdlock_compat32, /* UMTX_OP_RW_RDLOCK */ - __umtx_op_rw_wrlock_compat32, /* UMTX_OP_RW_WRLOCK */ - __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ - __umtx_op_wait_uint_private_compat32, /* UMTX_OP_WAIT_UINT_PRIVATE */ - __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ - __umtx_op_wait_umutex_compat32, /* UMTX_OP_MUTEX_WAIT */ - __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ + [UMTX_OP_RESERVED0] = __umtx_op_unimpl, + [UMTX_OP_RESERVED1] = __umtx_op_unimpl, + [UMTX_OP_WAIT] = __umtx_op_wait_compat32, + [UMTX_OP_WAKE] = __umtx_op_wake, + [UMTX_OP_MUTEX_LOCK] = __umtx_op_trylock_umutex, + [UMTX_OP_MUTEX_TRYLOCK] = __umtx_op_lock_umutex_compat32, + [UMTX_OP_MUTEX_UNLOCK] = __umtx_op_unlock_umutex, + [UMTX_OP_SET_CEILING] = __umtx_op_set_ceiling, + [UMTX_OP_CV_WAIT] = __umtx_op_cv_wait_compat32, + [UMTX_OP_CV_SIGNAL] = __umtx_op_cv_signal, + [UMTX_OP_CV_BROADCAST] = __umtx_op_cv_broadcast, + [UMTX_OP_WAIT_UINT] = __umtx_op_wait_compat32, + [UMTX_OP_RW_RDLOCK] = __umtx_op_rw_rdlock_compat32, + [UMTX_OP_RW_WRLOCK] = __umtx_op_rw_wrlock_compat32, + [UMTX_OP_RW_UNLOCK] = __umtx_op_rw_unlock, + [UMTX_OP_WAIT_UINT_PRIVATE] = __umtx_op_wait_uint_private_compat32, + [UMTX_OP_WAKE_PRIVATE] = __umtx_op_wake_private, + [UMTX_OP_MUTEX_WAIT] = __umtx_op_wait_umutex_compat32, + [UMTX_OP_MUTEX_WAKE] = __umtx_op_wake_umutex, #if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) - __umtx_op_sem_wait_compat32, /* UMTX_OP_SEM_WAIT */ - __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ + [UMTX_OP_SEM_WAIT] = __umtx_op_sem_wait_compat32, + [UMTX_OP_SEM_WAKE] = __umtx_op_sem_wake, #else - __umtx_op_unimpl, /* UMTX_OP_SEM_WAIT */ - __umtx_op_unimpl, /* UMTX_OP_SEM_WAKE */ + [UMTX_OP_SEM_WAIT] = __umtx_op_unimpl, + [UMTX_OP_SEM_WAKE] = __umtx_op_unimpl, #endif - __umtx_op_nwake_private32, /* UMTX_OP_NWAKE_PRIVATE */ - __umtx_op_wake2_umutex, /* UMTX_OP_MUTEX_WAKE2 */ - __umtx_op_sem2_wait_compat32, /* UMTX_OP_SEM2_WAIT */ - __umtx_op_sem2_wake, /* UMTX_OP_SEM2_WAKE */ + [UMTX_OP_NWAKE_PRIVATE] = __umtx_op_nwake_private32, + [UMTX_OP_MUTEX_WAKE2] = __umtx_op_wake2_umutex, + [UMTX_OP_SEM2_WAIT] = __umtx_op_sem2_wait_compat32, + [UMTX_OP_SEM2_WAKE] = __umtx_op_sem2_wake, }; int freebsd32_umtx_op(struct thread *td, struct freebsd32_umtx_op_args *uap) { - if ((unsigned)uap->op < UMTX_OP_MAX) + + if ((unsigned)uap->op < nitems(op_table_compat32)) { return (*op_table_compat32[uap->op])(td, - (struct _umtx_op_args *)uap); + (struct _umtx_op_args *)uap); + } return (EINVAL); } #endif Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Fri Oct 30 17:12:15 2015 (r290201) +++ head/sys/sys/umtx.h Fri Oct 30 19:20:40 2015 (r290202) @@ -83,7 +83,6 @@ #define UMTX_OP_MUTEX_WAKE2 22 #define UMTX_OP_SEM2_WAIT 23 #define UMTX_OP_SEM2_WAKE 24 -#define UMTX_OP_MAX 25 /* Flags for UMTX_OP_CV_WAIT */ #define CVWAIT_CHECK_UNPARKING 0x01 From owner-svn-src-head@freebsd.org Fri Oct 30 19:32:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 771B7A1FCCE; Fri, 30 Oct 2015 19:32:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 40B5D1F04; Fri, 30 Oct 2015 19:32:31 +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 t9UJWULY037594; Fri, 30 Oct 2015 19:32:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UJWUYi037593; Fri, 30 Oct 2015 19:32:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201510301932.t9UJWUYi037593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Oct 2015 19:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290204 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 19:32:31 -0000 Author: kib Date: Fri Oct 30 19:32:30 2015 New Revision: 290204 URL: https://svnweb.freebsd.org/changeset/base/290204 Log: Also mark compat32 umtx op table as constant. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Oct 30 19:26:55 2015 (r290203) +++ head/sys/kern/kern_umtx.c Fri Oct 30 19:32:30 2015 (r290204) @@ -3734,7 +3734,7 @@ __umtx_op_nwake_private32(struct thread return (error); } -static _umtx_op_func op_table_compat32[] = { +static const _umtx_op_func op_table_compat32[] = { [UMTX_OP_RESERVED0] = __umtx_op_unimpl, [UMTX_OP_RESERVED1] = __umtx_op_unimpl, [UMTX_OP_WAIT] = __umtx_op_wait_compat32, From owner-svn-src-head@freebsd.org Fri Oct 30 20:14:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 057D3A2180E; Fri, 30 Oct 2015 20:14:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id C25F6156A; Fri, 30 Oct 2015 20:14:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UKEWAO049600; Fri, 30 Oct 2015 20:14:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UKEWNq049599; Fri, 30 Oct 2015 20:14:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201510302014.t9UKEWNq049599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 30 Oct 2015 20:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290205 - head/bin/ls/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 20:14:34 -0000 Author: emaste Date: Fri Oct 30 20:14:32 2015 New Revision: 290205 URL: https://svnweb.freebsd.org/changeset/base/290205 Log: Update ls -l tests to use mtime, not birthtime PR: 204155 Reviewed by: ngie, rodrigc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4040 Modified: head/bin/ls/tests/ls_tests.sh Modified: head/bin/ls/tests/ls_tests.sh ============================================================================== --- head/bin/ls/tests/ls_tests.sh Fri Oct 30 19:32:30 2015 (r290204) +++ head/bin/ls/tests/ls_tests.sh Fri Oct 30 20:14:32 2015 (r290205) @@ -418,10 +418,10 @@ T_flag_body() atf_check -e empty -o empty -s exit:0 touch a.file - birthtime_in_secs=$(stat -f %B -t %s a.file) - birthtime=$(date -j -f %s $birthtime_in_secs +"[[:space:]]+%b[[:space:]]+%e[[:space:]]+%H:%M:%S[[:space:]]+%Y") + mtime_in_secs=$(stat -f %m -t %s a.file) + mtime=$(date -j -f %s $mtime_in_secs +"[[:space:]]+%b[[:space:]]+%e[[:space:]]+%H:%M:%S[[:space:]]+%Y") - atf_check -e empty -o match:"$birthtime"'[[:space:]]+a\.file' \ + atf_check -e empty -o match:"$mtime"'[[:space:]]+a\.file' \ -s exit:0 ls -lT a.file } @@ -626,10 +626,10 @@ l_flag_body() atf_check -e empty -o empty -s exit:0 touch a.file - birthtime_in_secs=$(stat -f "%B" -t "%s" a.file) - birthtime=$(date -j -f "%s" $birthtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M") + mtime_in_secs=$(stat -f "%m" -t "%s" a.file) + mtime=$(date -j -f "%s" $mtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M") - expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Su[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$birthtime[[:space:]]+a\\.file" a.file) + expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Su[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$mtime[[:space:]]+a\\.file" a.file) atf_check -e empty -o match:"$expected_output" -s exit:0 ls -l a.file } From owner-svn-src-head@freebsd.org Fri Oct 30 20:47:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F5FA21F7B; Fri, 30 Oct 2015 20:47:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE2C129C; Fri, 30 Oct 2015 20:47:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UKlgJ3058378; Fri, 30 Oct 2015 20:47:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UKlgu0058377; Fri, 30 Oct 2015 20:47:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201510302047.t9UKlgu0058377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Oct 2015 20:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290206 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 20:47:43 -0000 Author: kib Date: Fri Oct 30 20:47:42 2015 New Revision: 290206 URL: https://svnweb.freebsd.org/changeset/base/290206 Log: Minor (and incomplete) style cleanup. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Oct 30 20:14:32 2015 (r290205) +++ head/sys/kern/kern_umtx.c Fri Oct 30 20:47:42 2015 (r290206) @@ -813,7 +813,7 @@ umtx_key_get(const void *addr, int type, if (vm_map_lookup(&map, (vm_offset_t)addr, VM_PROT_WRITE, &entry, &key->info.shared.object, &pindex, &prot, &wired) != KERN_SUCCESS) { - return EFAULT; + return (EFAULT); } if ((share == PROCESS_SHARE) || @@ -1163,7 +1163,7 @@ do_wake2_umutex(struct thread *td, struc int error; int count; - switch(flags & (UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT)) { + switch (flags & (UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT)) { case 0: type = TYPE_NORMAL_UMUTEX; break; @@ -3402,14 +3402,16 @@ __umtx_op_sem_wait(struct thread *td, st static int __umtx_op_sem_wake(struct thread *td, struct _umtx_op_args *uap) { - return do_sem_wake(td, uap->obj); + + return (do_sem_wake(td, uap->obj)); } #endif static int __umtx_op_wake2_umutex(struct thread *td, struct _umtx_op_args *uap) { - return do_wake2_umutex(td, uap->obj, uap->val); + + return (do_wake2_umutex(td, uap->obj, uap->val)); } static int @@ -3434,7 +3436,8 @@ __umtx_op_sem2_wait(struct thread *td, s static int __umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap) { - return do_sem2_wake(td, uap->obj); + + return (do_sem2_wake(td, uap->obj)); } typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); From owner-svn-src-head@freebsd.org Fri Oct 30 20:51:36 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73086A22042; Fri, 30 Oct 2015 20:51:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C28AC15E5; Fri, 30 Oct 2015 20:51:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UKpZFS058575; Fri, 30 Oct 2015 20:51:35 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UKpYM0058570; Fri, 30 Oct 2015 20:51:34 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201510302051.t9UKpYM0058570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 30 Oct 2015 20:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290207 - in head: . crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bi... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 20:51:36 -0000 Author: jkim Date: Fri Oct 30 20:51:33 2015 New Revision: 290207 URL: https://svnweb.freebsd.org/changeset/base/290207 Log: Merge OpenSSL 1.0.2d. Added: head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/aesni-mb-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/aesni-sha256-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesp8-ppc.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/aesp8-ppc.pl head/crypto/openssl/crypto/aes/asm/aest4-sparcv9.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/aest4-sparcv9.pl head/crypto/openssl/crypto/aes/asm/aesv8-armx.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/aesv8-armx.pl head/crypto/openssl/crypto/aes/asm/bsaes-armv7.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/bsaes-armv7.pl head/crypto/openssl/crypto/aes/asm/vpaes-ppc.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/aes/asm/vpaes-ppc.pl head/crypto/openssl/crypto/arm64cpuid.S - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/arm64cpuid.S head/crypto/openssl/crypto/bn/asm/mips3.s - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/asm/mips3.s head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/asm/rsaz-avx2.pl head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/asm/rsaz-x86_64.pl head/crypto/openssl/crypto/bn/asm/sparct4-mont.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/asm/sparct4-mont.pl head/crypto/openssl/crypto/bn/asm/sparcv9-gf2m.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9-gf2m.pl head/crypto/openssl/crypto/bn/asm/vis3-mont.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/asm/vis3-mont.pl head/crypto/openssl/crypto/bn/rsaz_exp.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/rsaz_exp.c head/crypto/openssl/crypto/bn/rsaz_exp.h - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/bn/rsaz_exp.h head/crypto/openssl/crypto/camellia/asm/cmllt4-sparcv9.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/camellia/asm/cmllt4-sparcv9.pl head/crypto/openssl/crypto/cms/cms_kari.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/cms/cms_kari.c head/crypto/openssl/crypto/des/asm/dest4-sparcv9.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/des/asm/dest4-sparcv9.pl head/crypto/openssl/crypto/dh/dh_kdf.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/dh/dh_kdf.c head/crypto/openssl/crypto/dh/dh_rfc5114.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/dh/dh_rfc5114.c head/crypto/openssl/crypto/ec/asm/ - copied from r289848, vendor-crypto/openssl/dist/crypto/ec/asm/ head/crypto/openssl/crypto/ec/ecp_nistz256.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/ec/ecp_nistz256.c head/crypto/openssl/crypto/ec/ecp_nistz256_table.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/ec/ecp_nistz256_table.c head/crypto/openssl/crypto/ecdh/ech_kdf.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/ecdh/ech_kdf.c head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha256.c head/crypto/openssl/crypto/md5/asm/md5-sparcv9.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/md5/asm/md5-sparcv9.pl head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/modes/asm/aesni-gcm-x86_64.pl head/crypto/openssl/crypto/modes/asm/ghashp8-ppc.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/modes/asm/ghashp8-ppc.pl head/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/modes/asm/ghashv8-armx.pl head/crypto/openssl/crypto/modes/wrap128.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/modes/wrap128.c head/crypto/openssl/crypto/perlasm/sparcv9_modes.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/perlasm/sparcv9_modes.pl head/crypto/openssl/crypto/ppc_arch.h - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/ppc_arch.h head/crypto/openssl/crypto/sha/asm/sha1-armv8.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-armv8.pl head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/sha/asm/sha256-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha512-armv8.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-armv8.pl head/crypto/openssl/crypto/sha/asm/sha512p8-ppc.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/sha/asm/sha512p8-ppc.pl head/crypto/openssl/crypto/sparc_arch.h - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/sparc_arch.h head/crypto/openssl/crypto/x509/vpm_int.h - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/x509/vpm_int.h head/crypto/openssl/crypto/x509v3/v3_scts.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/x509v3/v3_scts.c head/crypto/openssl/crypto/x509v3/v3nametest.c - copied unchanged from r289848, vendor-crypto/openssl/dist/crypto/x509v3/v3nametest.c head/crypto/openssl/doc/crypto/ASN1_TIME_set.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/ASN1_TIME_set.pod head/crypto/openssl/doc/crypto/EC_GFp_simple_method.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/EC_GFp_simple_method.pod head/crypto/openssl/doc/crypto/EC_GROUP_copy.pod - copied, changed from r289848, vendor-crypto/openssl/dist/doc/crypto/EC_GROUP_copy.pod head/crypto/openssl/doc/crypto/EC_GROUP_new.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/EC_GROUP_new.pod head/crypto/openssl/doc/crypto/EC_KEY_new.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/EC_KEY_new.pod head/crypto/openssl/doc/crypto/EC_POINT_add.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/EC_POINT_add.pod head/crypto/openssl/doc/crypto/EC_POINT_new.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/EC_POINT_new.pod head/crypto/openssl/doc/crypto/OPENSSL_instrument_bus.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/OPENSSL_instrument_bus.pod head/crypto/openssl/doc/crypto/SSLeay_version.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/SSLeay_version.pod head/crypto/openssl/doc/crypto/X509_check_host.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/X509_check_host.pod head/crypto/openssl/doc/crypto/d2i_ECPKParameters.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/d2i_ECPKParameters.pod head/crypto/openssl/doc/crypto/ec.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/crypto/ec.pod head/crypto/openssl/doc/ssl/SSL_CONF_CTX_new.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CONF_CTX_new.pod head/crypto/openssl/doc/ssl/SSL_CONF_CTX_set1_prefix.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CONF_CTX_set1_prefix.pod head/crypto/openssl/doc/ssl/SSL_CONF_CTX_set_flags.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CONF_CTX_set_flags.pod head/crypto/openssl/doc/ssl/SSL_CONF_CTX_set_ssl_ctx.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CONF_CTX_set_ssl_ctx.pod head/crypto/openssl/doc/ssl/SSL_CONF_cmd.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CONF_cmd.pod head/crypto/openssl/doc/ssl/SSL_CONF_cmd_argv.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CONF_cmd_argv.pod head/crypto/openssl/doc/ssl/SSL_CTX_add1_chain_cert.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_add1_chain_cert.pod head/crypto/openssl/doc/ssl/SSL_CTX_get0_param.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_get0_param.pod head/crypto/openssl/doc/ssl/SSL_CTX_set1_curves.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set1_curves.pod head/crypto/openssl/doc/ssl/SSL_CTX_set1_verify_cert_store.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set1_verify_cert_store.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_cert_cb.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_cert_cb.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_custom_cli_ext.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_custom_cli_ext.pod head/crypto/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod - copied unchanged from r289848, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_use_serverinfo.pod head/crypto/openssl/ssl/ssl_conf.c - copied unchanged from r289848, vendor-crypto/openssl/dist/ssl/ssl_conf.c head/crypto/openssl/ssl/t1_ext.c - copied unchanged from r289848, vendor-crypto/openssl/dist/ssl/t1_ext.c head/crypto/openssl/ssl/t1_trce.c - copied unchanged from r289848, vendor-crypto/openssl/dist/ssl/t1_trce.c head/crypto/openssl/util/copy-if-different.pl - copied unchanged from r289848, vendor-crypto/openssl/dist/util/copy-if-different.pl head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/rsaz-avx2.S (contents, props changed) head/secure/lib/libcrypto/amd64/rsaz-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S (contents, props changed) head/secure/lib/libcrypto/engines/libcapi/ head/secure/lib/libcrypto/engines/libcapi/Makefile (contents, props changed) head/secure/lib/libcrypto/man/ASN1_TIME_set.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_GROUP_copy.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_GROUP_new.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_KEY_new.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_POINT_add.3 (contents, props changed) head/secure/lib/libcrypto/man/EC_POINT_new.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 (contents, props changed) head/secure/lib/libcrypto/man/SSLeay_version.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_check_host.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_ECPKParameters.3 (contents, props changed) head/secure/lib/libcrypto/man/ec.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_new.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_cmd.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_get0_param.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set1_curves.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 (contents, props changed) Deleted: head/crypto/openssl/crypto/bn/asm/modexp512-x86_64.pl head/crypto/openssl/crypto/engine/eng_rsax.c head/crypto/openssl/crypto/evp/evp_fips.c head/crypto/openssl/ssl/d1_enc.c head/secure/lib/libcrypto/amd64/modexp512-x86_64.S head/secure/lib/libcrypto/i386/cast-586.s Modified: head/ObsoleteFiles.inc head/UPDATING head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/FAQ head/crypto/openssl/Makefile head/crypto/openssl/Makefile.org head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/apps.h head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/ciphers.c head/crypto/openssl/apps/cms.c head/crypto/openssl/apps/crl.c head/crypto/openssl/apps/dgst.c head/crypto/openssl/apps/dhparam.c head/crypto/openssl/apps/ecparam.c head/crypto/openssl/apps/genrsa.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.cnf head/crypto/openssl/apps/pkcs8.c head/crypto/openssl/apps/s_apps.h head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/s_socket.c head/crypto/openssl/apps/smime.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/verify.c head/crypto/openssl/apps/x509.c head/crypto/openssl/config head/crypto/openssl/crypto/Makefile head/crypto/openssl/crypto/aes/Makefile head/crypto/openssl/crypto/aes/aes_wrap.c head/crypto/openssl/crypto/aes/aes_x86core.c head/crypto/openssl/crypto/aes/asm/aes-586.pl head/crypto/openssl/crypto/aes/asm/aes-armv4.pl head/crypto/openssl/crypto/aes/asm/aes-mips.pl head/crypto/openssl/crypto/aes/asm/aes-ppc.pl head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-x86.pl head/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl head/crypto/openssl/crypto/aes/asm/bsaes-x86_64.pl head/crypto/openssl/crypto/aes/asm/vpaes-x86.pl head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl head/crypto/openssl/crypto/arm_arch.h head/crypto/openssl/crypto/armcap.c head/crypto/openssl/crypto/armv4cpuid.S head/crypto/openssl/crypto/asn1/Makefile head/crypto/openssl/crypto/asn1/a_gentm.c head/crypto/openssl/crypto/asn1/a_time.c head/crypto/openssl/crypto/asn1/a_utctm.c head/crypto/openssl/crypto/asn1/ameth_lib.c head/crypto/openssl/crypto/asn1/asn1.h head/crypto/openssl/crypto/asn1/asn1_locl.h head/crypto/openssl/crypto/asn1/t_x509.c head/crypto/openssl/crypto/asn1/x_crl.c head/crypto/openssl/crypto/asn1/x_x509.c head/crypto/openssl/crypto/bio/b_dump.c head/crypto/openssl/crypto/bio/b_sock.c head/crypto/openssl/crypto/bio/bio.h head/crypto/openssl/crypto/bio/bio_err.c head/crypto/openssl/crypto/bio/bss_acpt.c head/crypto/openssl/crypto/bio/bss_conn.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bio/bss_fd.c head/crypto/openssl/crypto/bn/Makefile head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl head/crypto/openssl/crypto/bn/asm/armv4-mont.pl head/crypto/openssl/crypto/bn/asm/mips-mont.pl head/crypto/openssl/crypto/bn/asm/mips.pl head/crypto/openssl/crypto/bn/asm/ppc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc.pl head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/bn/bn.h head/crypto/openssl/crypto/bn/bn_asm.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_gf2m.c head/crypto/openssl/crypto/bn/bn_lcl.h head/crypto/openssl/crypto/bn/bntest.c head/crypto/openssl/crypto/buffer/buf_str.c head/crypto/openssl/crypto/buffer/buffer.h head/crypto/openssl/crypto/camellia/Makefile head/crypto/openssl/crypto/camellia/asm/cmll-x86_64.pl head/crypto/openssl/crypto/cast/cast_lcl.h head/crypto/openssl/crypto/cms/Makefile head/crypto/openssl/crypto/cms/cms.h head/crypto/openssl/crypto/cms/cms_asn1.c head/crypto/openssl/crypto/cms/cms_env.c head/crypto/openssl/crypto/cms/cms_err.c head/crypto/openssl/crypto/cms/cms_lcl.h head/crypto/openssl/crypto/cms/cms_lib.c head/crypto/openssl/crypto/cms/cms_sd.c head/crypto/openssl/crypto/cms/cms_smime.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/cversion.c head/crypto/openssl/crypto/des/Makefile head/crypto/openssl/crypto/des/asm/des-586.pl head/crypto/openssl/crypto/des/asm/des_enc.m4 head/crypto/openssl/crypto/des/des_locl.h head/crypto/openssl/crypto/des/read_pwd.c head/crypto/openssl/crypto/dh/Makefile head/crypto/openssl/crypto/dh/dh.h head/crypto/openssl/crypto/dh/dh_ameth.c head/crypto/openssl/crypto/dh/dh_asn1.c head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dh_err.c head/crypto/openssl/crypto/dh/dh_key.c head/crypto/openssl/crypto/dh/dh_pmeth.c head/crypto/openssl/crypto/dh/dhtest.c head/crypto/openssl/crypto/dsa/dsa.h head/crypto/openssl/crypto/dsa/dsa_ameth.c head/crypto/openssl/crypto/dsa/dsa_err.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_locl.h head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dsa/dsa_pmeth.c head/crypto/openssl/crypto/ebcdic.c head/crypto/openssl/crypto/ec/Makefile head/crypto/openssl/crypto/ec/ec.h head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_curve.c head/crypto/openssl/crypto/ec/ec_cvt.c head/crypto/openssl/crypto/ec/ec_err.c head/crypto/openssl/crypto/ec/ec_lcl.h head/crypto/openssl/crypto/ec/ec_lib.c head/crypto/openssl/crypto/ec/ec_pmeth.c head/crypto/openssl/crypto/ec/eck_prn.c head/crypto/openssl/crypto/ec/ecp_nistp521.c head/crypto/openssl/crypto/ecdh/Makefile head/crypto/openssl/crypto/ecdh/ecdh.h head/crypto/openssl/crypto/ecdh/ecdhtest.c head/crypto/openssl/crypto/ecdh/ech_ossl.c head/crypto/openssl/crypto/ecdsa/ecdsa.h head/crypto/openssl/crypto/ecdsa/ecs_err.c head/crypto/openssl/crypto/ecdsa/ecs_lib.c head/crypto/openssl/crypto/ecdsa/ecs_locl.h head/crypto/openssl/crypto/ecdsa/ecs_ossl.c head/crypto/openssl/crypto/engine/Makefile head/crypto/openssl/crypto/engine/eng_all.c head/crypto/openssl/crypto/engine/eng_cryptodev.c head/crypto/openssl/crypto/engine/engine.h head/crypto/openssl/crypto/evp/Makefile head/crypto/openssl/crypto/evp/c_allc.c head/crypto/openssl/crypto/evp/digest.c head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c head/crypto/openssl/crypto/evp/e_camellia.c head/crypto/openssl/crypto/evp/e_des.c head/crypto/openssl/crypto/evp/e_des3.c head/crypto/openssl/crypto/evp/e_null.c head/crypto/openssl/crypto/evp/encode.c head/crypto/openssl/crypto/evp/evp.h head/crypto/openssl/crypto/evp/evp_enc.c head/crypto/openssl/crypto/evp/evp_err.c head/crypto/openssl/crypto/evp/evp_extra_test.c head/crypto/openssl/crypto/evp/evp_lib.c head/crypto/openssl/crypto/evp/evp_locl.h head/crypto/openssl/crypto/evp/evp_test.c head/crypto/openssl/crypto/evp/evptests.txt head/crypto/openssl/crypto/evp/m_dss.c head/crypto/openssl/crypto/evp/m_dss1.c head/crypto/openssl/crypto/evp/m_ecdsa.c head/crypto/openssl/crypto/evp/m_sha1.c head/crypto/openssl/crypto/evp/m_sigver.c head/crypto/openssl/crypto/evp/p_lib.c head/crypto/openssl/crypto/evp/pmeth_lib.c head/crypto/openssl/crypto/hmac/hm_ameth.c head/crypto/openssl/crypto/hmac/hmac.c head/crypto/openssl/crypto/hmac/hmactest.c head/crypto/openssl/crypto/jpake/jpake.c head/crypto/openssl/crypto/md32_common.h head/crypto/openssl/crypto/md5/Makefile head/crypto/openssl/crypto/md5/md5_locl.h head/crypto/openssl/crypto/modes/Makefile head/crypto/openssl/crypto/modes/asm/ghash-armv4.pl head/crypto/openssl/crypto/modes/asm/ghash-s390x.pl head/crypto/openssl/crypto/modes/asm/ghash-sparcv9.pl head/crypto/openssl/crypto/modes/asm/ghash-x86.pl head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl head/crypto/openssl/crypto/modes/cbc128.c head/crypto/openssl/crypto/modes/gcm128.c head/crypto/openssl/crypto/modes/modes.h head/crypto/openssl/crypto/modes/modes_lcl.h head/crypto/openssl/crypto/o_str.c head/crypto/openssl/crypto/o_time.c head/crypto/openssl/crypto/o_time.h head/crypto/openssl/crypto/objects/obj_dat.h head/crypto/openssl/crypto/objects/obj_mac.h head/crypto/openssl/crypto/objects/obj_mac.num head/crypto/openssl/crypto/objects/obj_xref.h head/crypto/openssl/crypto/objects/obj_xref.txt head/crypto/openssl/crypto/objects/objects.txt head/crypto/openssl/crypto/objects/objxref.pl head/crypto/openssl/crypto/ocsp/ocsp.h head/crypto/openssl/crypto/ocsp/ocsp_ht.c head/crypto/openssl/crypto/ocsp/ocsp_lib.c head/crypto/openssl/crypto/opensslconf.h head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/ossl_typ.h head/crypto/openssl/crypto/pem/Makefile head/crypto/openssl/crypto/pem/pem.h head/crypto/openssl/crypto/pem/pem_all.c head/crypto/openssl/crypto/pem/pem_err.c head/crypto/openssl/crypto/pem/pem_lib.c head/crypto/openssl/crypto/pem/pem_pkey.c head/crypto/openssl/crypto/perlasm/ppc-xlate.pl head/crypto/openssl/crypto/perlasm/x86_64-xlate.pl head/crypto/openssl/crypto/perlasm/x86asm.pl head/crypto/openssl/crypto/perlasm/x86gas.pl head/crypto/openssl/crypto/perlasm/x86masm.pl head/crypto/openssl/crypto/perlasm/x86nasm.pl head/crypto/openssl/crypto/pkcs12/p12_decr.c head/crypto/openssl/crypto/pkcs12/p12_p8e.c head/crypto/openssl/crypto/ppccap.c head/crypto/openssl/crypto/ppccpuid.pl head/crypto/openssl/crypto/rc4/Makefile head/crypto/openssl/crypto/rc4/asm/rc4-586.pl head/crypto/openssl/crypto/rc4/rc4_enc.c head/crypto/openssl/crypto/rc5/rc5_locl.h head/crypto/openssl/crypto/rsa/Makefile head/crypto/openssl/crypto/rsa/rsa.h head/crypto/openssl/crypto/rsa/rsa_ameth.c head/crypto/openssl/crypto/rsa/rsa_asn1.c head/crypto/openssl/crypto/rsa/rsa_err.c head/crypto/openssl/crypto/rsa/rsa_oaep.c head/crypto/openssl/crypto/rsa/rsa_pmeth.c head/crypto/openssl/crypto/rsa/rsa_sign.c head/crypto/openssl/crypto/sha/Makefile head/crypto/openssl/crypto/sha/asm/sha1-586.pl head/crypto/openssl/crypto/sha/asm/sha1-armv4-large.pl head/crypto/openssl/crypto/sha/asm/sha1-mips.pl head/crypto/openssl/crypto/sha/asm/sha1-ppc.pl head/crypto/openssl/crypto/sha/asm/sha1-sparcv9.pl head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha256-586.pl head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl head/crypto/openssl/crypto/sha/asm/sha512-586.pl head/crypto/openssl/crypto/sha/asm/sha512-armv4.pl head/crypto/openssl/crypto/sha/asm/sha512-ia64.pl head/crypto/openssl/crypto/sha/asm/sha512-mips.pl head/crypto/openssl/crypto/sha/asm/sha512-ppc.pl head/crypto/openssl/crypto/sha/asm/sha512-sparcv9.pl head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl head/crypto/openssl/crypto/sha/sha512.c head/crypto/openssl/crypto/sparccpuid.S head/crypto/openssl/crypto/sparcv9cap.c head/crypto/openssl/crypto/srp/Makefile head/crypto/openssl/crypto/srp/srptest.c head/crypto/openssl/crypto/stack/safestack.h head/crypto/openssl/crypto/stack/stack.c head/crypto/openssl/crypto/stack/stack.h head/crypto/openssl/crypto/symhacks.h head/crypto/openssl/crypto/ts/ts_rsp_sign.c head/crypto/openssl/crypto/ts/ts_rsp_verify.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/whrlpool/asm/wp-mmx.pl head/crypto/openssl/crypto/whrlpool/asm/wp-x86_64.pl head/crypto/openssl/crypto/x509/Makefile head/crypto/openssl/crypto/x509/verify_extra_test.c head/crypto/openssl/crypto/x509/x509.h head/crypto/openssl/crypto/x509/x509_cmp.c head/crypto/openssl/crypto/x509/x509_err.c head/crypto/openssl/crypto/x509/x509_lu.c head/crypto/openssl/crypto/x509/x509_set.c head/crypto/openssl/crypto/x509/x509_trs.c head/crypto/openssl/crypto/x509/x509_txt.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509/x509_vfy.h head/crypto/openssl/crypto/x509/x509_vpm.c head/crypto/openssl/crypto/x509/x_all.c head/crypto/openssl/crypto/x509v3/Makefile head/crypto/openssl/crypto/x509v3/ext_dat.h head/crypto/openssl/crypto/x509v3/v3_lib.c head/crypto/openssl/crypto/x509v3/v3_purp.c head/crypto/openssl/crypto/x509v3/v3_utl.c head/crypto/openssl/crypto/x509v3/v3err.c head/crypto/openssl/crypto/x509v3/x509v3.h head/crypto/openssl/crypto/x86_64cpuid.pl head/crypto/openssl/crypto/x86cpuid.pl head/crypto/openssl/doc/apps/c_rehash.pod head/crypto/openssl/doc/apps/ciphers.pod head/crypto/openssl/doc/apps/cms.pod head/crypto/openssl/doc/apps/genpkey.pod head/crypto/openssl/doc/apps/ocsp.pod head/crypto/openssl/doc/apps/pkcs8.pod head/crypto/openssl/doc/apps/req.pod head/crypto/openssl/doc/apps/s_client.pod head/crypto/openssl/doc/apps/s_server.pod head/crypto/openssl/doc/apps/smime.pod head/crypto/openssl/doc/apps/verify.pod head/crypto/openssl/doc/apps/x509.pod head/crypto/openssl/doc/crypto/ASN1_STRING_length.pod head/crypto/openssl/doc/crypto/ASN1_STRING_print_ex.pod head/crypto/openssl/doc/crypto/BIO_f_ssl.pod head/crypto/openssl/doc/crypto/BIO_find_type.pod head/crypto/openssl/doc/crypto/BIO_s_accept.pod head/crypto/openssl/doc/crypto/BIO_s_connect.pod head/crypto/openssl/doc/crypto/BN_BLINDING_new.pod head/crypto/openssl/doc/crypto/BN_CTX_new.pod head/crypto/openssl/doc/crypto/BN_generate_prime.pod head/crypto/openssl/doc/crypto/BN_rand.pod head/crypto/openssl/doc/crypto/CMS_add0_cert.pod head/crypto/openssl/doc/crypto/CMS_get0_RecipientInfos.pod head/crypto/openssl/doc/crypto/CMS_get0_SignerInfos.pod head/crypto/openssl/doc/crypto/CMS_verify.pod head/crypto/openssl/doc/crypto/DH_generate_parameters.pod head/crypto/openssl/doc/crypto/DSA_generate_parameters.pod head/crypto/openssl/doc/crypto/ERR_remove_state.pod head/crypto/openssl/doc/crypto/EVP_BytesToKey.pod head/crypto/openssl/doc/crypto/EVP_DigestInit.pod head/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod head/crypto/openssl/doc/crypto/EVP_PKEY_CTX_ctrl.pod head/crypto/openssl/doc/crypto/EVP_PKEY_cmp.pod head/crypto/openssl/doc/crypto/OPENSSL_VERSION_NUMBER.pod head/crypto/openssl/doc/crypto/OPENSSL_config.pod head/crypto/openssl/doc/crypto/OPENSSL_ia32cap.pod head/crypto/openssl/doc/crypto/OPENSSL_load_builtin_modules.pod head/crypto/openssl/doc/crypto/OpenSSL_add_all_algorithms.pod head/crypto/openssl/doc/crypto/PKCS7_verify.pod head/crypto/openssl/doc/crypto/RAND_egd.pod head/crypto/openssl/doc/crypto/RSA_generate_key.pod head/crypto/openssl/doc/crypto/X509_NAME_add_entry_by_txt.pod head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_error.pod head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod head/crypto/openssl/doc/crypto/crypto.pod head/crypto/openssl/doc/crypto/d2i_DSAPublicKey.pod head/crypto/openssl/doc/crypto/d2i_X509.pod head/crypto/openssl/doc/crypto/d2i_X509_CRL.pod head/crypto/openssl/doc/crypto/ecdsa.pod head/crypto/openssl/doc/crypto/evp.pod head/crypto/openssl/doc/crypto/hmac.pod head/crypto/openssl/doc/crypto/i2d_PKCS7_bio_stream.pod head/crypto/openssl/doc/crypto/rand.pod head/crypto/openssl/doc/crypto/sha.pod head/crypto/openssl/doc/ssl/SSL_CIPHER_get_name.pod head/crypto/openssl/doc/ssl/SSL_COMP_add_compression_method.pod head/crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod head/crypto/openssl/doc/ssl/SSL_CTX_sess_set_cache_size.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_cert_store.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_cipher_list.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_rsa_callback.pod head/crypto/openssl/doc/ssl/SSL_CTX_use_certificate.pod head/crypto/openssl/doc/ssl/SSL_CTX_use_psk_identity_hint.pod head/crypto/openssl/doc/ssl/SSL_accept.pod head/crypto/openssl/doc/ssl/SSL_do_handshake.pod head/crypto/openssl/doc/ssl/SSL_shutdown.pod head/crypto/openssl/doc/ssl/ssl.pod head/crypto/openssl/doc/ssleay.txt head/crypto/openssl/e_os.h head/crypto/openssl/e_os2.h head/crypto/openssl/engines/Makefile head/crypto/openssl/engines/ccgost/Makefile head/crypto/openssl/engines/ccgost/gost89.c head/crypto/openssl/engines/ccgost/gost_crypt.c head/crypto/openssl/engines/ccgost/gost_pmeth.c head/crypto/openssl/engines/e_capi.c head/crypto/openssl/engines/vendor_defns/hwcryptohook.h head/crypto/openssl/ssl/Makefile head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/d1_clnt.c head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/d1_meth.c head/crypto/openssl/ssl/d1_pkt.c head/crypto/openssl/ssl/d1_srtp.c head/crypto/openssl/ssl/d1_srvr.c head/crypto/openssl/ssl/dtls1.h head/crypto/openssl/ssl/heartbeat_test.c head/crypto/openssl/ssl/s23_clnt.c head/crypto/openssl/ssl/s23_srvr.c head/crypto/openssl/ssl/s2_clnt.c head/crypto/openssl/ssl/s2_lib.c head/crypto/openssl/ssl/s3_both.c head/crypto/openssl/ssl/s3_cbc.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/srtp.h head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl3.h head/crypto/openssl/ssl/ssl_algs.c head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/ssl_rsa.c head/crypto/openssl/ssl/ssl_sess.c head/crypto/openssl/ssl/ssl_txt.c head/crypto/openssl/ssl/ssltest.c head/crypto/openssl/ssl/t1_clnt.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/t1_meth.c head/crypto/openssl/ssl/t1_srvr.c head/crypto/openssl/ssl/tls1.h head/crypto/openssl/util/files.pl head/crypto/openssl/util/libeay.num head/crypto/openssl/util/mk1mf.pl head/crypto/openssl/util/mkdef.pl head/crypto/openssl/util/mkerr.pl head/crypto/openssl/util/mkstack.pl head/crypto/openssl/util/pl/BC-32.pl head/crypto/openssl/util/pl/VC-32.pl head/crypto/openssl/util/pl/unix.pl head/crypto/openssl/util/ssleay.num head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/amd64/aes-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S head/secure/lib/libcrypto/amd64/aesni-x86_64.S head/secure/lib/libcrypto/amd64/bsaes-x86_64.S head/secure/lib/libcrypto/amd64/cmll-x86_64.S head/secure/lib/libcrypto/amd64/ghash-x86_64.S head/secure/lib/libcrypto/amd64/md5-x86_64.S head/secure/lib/libcrypto/amd64/rc4-x86_64.S head/secure/lib/libcrypto/amd64/sha1-x86_64.S head/secure/lib/libcrypto/amd64/sha256-x86_64.S head/secure/lib/libcrypto/amd64/sha512-x86_64.S head/secure/lib/libcrypto/amd64/vpaes-x86_64.S head/secure/lib/libcrypto/amd64/wp-x86_64.S head/secure/lib/libcrypto/amd64/x86_64-gf2m.S head/secure/lib/libcrypto/amd64/x86_64-mont.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/amd64/x86_64cpuid.S head/secure/lib/libcrypto/engines/Makefile head/secure/lib/libcrypto/engines/libgost/Makefile head/secure/lib/libcrypto/i386/aes-586.s head/secure/lib/libcrypto/i386/aesni-x86.s head/secure/lib/libcrypto/i386/bn-586.s head/secure/lib/libcrypto/i386/des-586.s head/secure/lib/libcrypto/i386/ghash-x86.s head/secure/lib/libcrypto/i386/rc4-586.s head/secure/lib/libcrypto/i386/sha1-586.s head/secure/lib/libcrypto/i386/sha256-586.s head/secure/lib/libcrypto/i386/sha512-586.s head/secure/lib/libcrypto/i386/vpaes-x86.s head/secure/lib/libcrypto/i386/wp-mmx.s head/secure/lib/libcrypto/i386/x86-gf2m.s head/secure/lib/libcrypto/i386/x86-mont.s head/secure/lib/libcrypto/i386/x86cpuid.s head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h head/secure/lib/libssl/Makefile head/secure/lib/libssl/Makefile.man head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/c_rehash.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 head/sys/sys/param.h Directory Properties: head/crypto/openssl/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 30 20:47:42 2015 (r290206) +++ head/ObsoleteFiles.inc Fri Oct 30 20:51:33 2015 (r290207) @@ -38,6 +38,15 @@ # xargs -n1 | sort | uniq -d; # done +# 20151030: OpenSSL 1.0.2d import +OLD_FILES+=usr/share/openssl/man/man3/CMS_set1_signer_certs.3.gz +OLD_FILES+=usr/share/openssl/man/man3/EVP_PKEY_ctrl.3.gz +OLD_FILES+=usr/share/openssl/man/man3/EVP_PKEY_ctrl_str.3.gz +OLD_FILES+=usr/share/openssl/man/man3/d2i_509_CRL_fp.3.gz +OLD_LIBS+=lib/libcrypto.so.7 +OLD_LIBS+=usr/lib/libssl.so.7 +OLD_LIBS+=usr/lib32/libcrypto.so.7 +OLD_LIBS+=usr/lib32/libssl.so.7 # 20151015: test symbols moved to /usr/lib/debug OLD_DIRS+=usr/tests/lib/atf/libatf-c++/.debug OLD_FILES+=usr/tests/lib/atf/libatf-c++/.debug/atf_c++_test.debug Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 30 20:47:42 2015 (r290206) +++ head/UPDATING Fri Oct 30 20:51:33 2015 (r290207) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20151030: + The OpenSSL has been upgraded to 1.0.2d. Any binaries requiring + libcrypto.so.7 or libssl.so.7 must be recompiled. + 20151020: Qlogic 24xx/25xx firmware images were updated from 5.5.0 to 7.3.0. Kernel modules isp_2400_multi and isp_2500_multi were removed and Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Fri Oct 30 20:47:42 2015 (r290206) +++ head/crypto/openssl/CHANGES Fri Oct 30 20:51:33 2015 (r290207) @@ -2,7 +2,7 @@ OpenSSL CHANGES _______________ - Changes between 1.0.1o and 1.0.1p [9 Jul 2015] + Changes between 1.0.2c and 1.0.2d [9 Jul 2015] *) Alternate chains certificate forgery @@ -17,13 +17,13 @@ (Google/BoringSSL). [Matt Caswell] - Changes between 1.0.1n and 1.0.1o [12 Jun 2015] + Changes between 1.0.2b and 1.0.2c [12 Jun 2015] *) Fix HMAC ABI incompatibility. The previous version introduced an ABI incompatibility in the handling of HMAC. The previous ABI has now been restored. - Changes between 1.0.1m and 1.0.1n [11 Jun 2015] + Changes between 1.0.2a and 1.0.2b [11 Jun 2015] *) Malformed ECParameters causes infinite loop @@ -91,10 +91,65 @@ (CVE-2015-1791) [Matt Caswell] + *) Removed support for the two export grade static DH ciphersuites + EXP-DH-RSA-DES-CBC-SHA and EXP-DH-DSS-DES-CBC-SHA. These two ciphersuites + were newly added (along with a number of other static DH ciphersuites) to + 1.0.2. However the two export ones have *never* worked since they were + introduced. It seems strange in any case to be adding new export + ciphersuites, and given "logjam" it also does not seem correct to fix them. + [Matt Caswell] + + *) Only support 256-bit or stronger elliptic curves with the + 'ecdh_auto' setting (server) or by default (client). Of supported + curves, prefer P-256 (both). + [Emilia Kasper] + *) Reject DH handshakes with parameters shorter than 768 bits. [Kurt Roeckx and Emilia Kasper] - Changes between 1.0.1l and 1.0.1m [19 Mar 2015] + Changes between 1.0.2 and 1.0.2a [19 Mar 2015] + + *) ClientHello sigalgs DoS fix + + If a client connects to an OpenSSL 1.0.2 server and renegotiates with an + invalid signature algorithms extension a NULL pointer dereference will + occur. This can be exploited in a DoS attack against the server. + + This issue was was reported to OpenSSL by David Ramos of Stanford + University. + (CVE-2015-0291) + [Stephen Henson and Matt Caswell] + + *) Multiblock corrupted pointer fix + + OpenSSL 1.0.2 introduced the "multiblock" performance improvement. This + feature only applies on 64 bit x86 architecture platforms that support AES + NI instructions. A defect in the implementation of "multiblock" can cause + OpenSSL's internal write buffer to become incorrectly set to NULL when + using non-blocking IO. Typically, when the user application is using a + socket BIO for writing, this will only result in a failed connection. + However if some other BIO is used then it is likely that a segmentation + fault will be triggered, thus enabling a potential DoS attack. + + This issue was reported to OpenSSL by Daniel Danner and Rainer Mueller. + (CVE-2015-0290) + [Matt Caswell] + + *) Segmentation fault in DTLSv1_listen fix + + The DTLSv1_listen function is intended to be stateless and processes the + initial ClientHello from many peers. It is common for user code to loop + over the call to DTLSv1_listen until a valid ClientHello is received with + an associated cookie. A defect in the implementation of DTLSv1_listen means + that state is preserved in the SSL object from one invocation to the next + that can lead to a segmentation fault. Errors processing the initial + ClientHello can trigger this scenario. An example of such an error could be + that a DTLS1.0 only client is attempting to connect to a DTLS1.2 only + server. + + This issue was reported to OpenSSL by Per Allansson. + (CVE-2015-0207) + [Matt Caswell] *) Segmentation fault in ASN1_TYPE_cmp fix @@ -107,6 +162,20 @@ (CVE-2015-0286) [Stephen Henson] + *) Segmentation fault for invalid PSS parameters fix + + The signature verification routines will crash with a NULL pointer + dereference if presented with an ASN.1 signature using the RSA PSS + algorithm and invalid parameters. Since these routines are used to verify + certificate signature algorithms this can be used to crash any + certificate verification operation and exploited in a DoS attack. Any + application which performs certificate verification is vulnerable including + OpenSSL clients and servers which enable client authentication. + + This issue was was reported to OpenSSL by Brian Carpenter. + (CVE-2015-0208) + [Stephen Henson] + *) ASN.1 structure reuse memory corruption fix Reusing a structure in ASN.1 parsing may allow an attacker to cause @@ -145,6 +214,36 @@ (CVE-2015-0293) [Emilia Käsper] + *) Empty CKE with client auth and DHE fix + + If client auth is used then a server can seg fault in the event of a DHE + ciphersuite being selected and a zero length ClientKeyExchange message + being sent by the client. This could be exploited in a DoS attack. + (CVE-2015-1787) + [Matt Caswell] + + *) Handshake with unseeded PRNG fix + + Under certain conditions an OpenSSL 1.0.2 client can complete a handshake + with an unseeded PRNG. The conditions are: + - The client is on a platform where the PRNG has not been seeded + automatically, and the user has not seeded manually + - A protocol specific client method version has been used (i.e. not + SSL_client_methodv23) + - A ciphersuite is used that does not require additional random data from + the PRNG beyond the initial ClientHello client random (e.g. PSK-RC4-SHA). + + If the handshake succeeds then the client random that has been used will + have been generated from a PRNG with insufficient entropy and therefore the + output may be predictable. + + For example using the following command with an unseeded openssl will + succeed on an unpatched platform: + + openssl s_client -psk 1a2b3c4d -tls1_2 -cipher PSK-RC4-SHA + (CVE-2015-0285) + [Matt Caswell] + *) Use After Free following d2i_ECPrivatekey error fix A malformed EC private key file consumed via the d2i_ECPrivateKey function @@ -171,6 +270,336 @@ *) Removed the export ciphers from the DEFAULT ciphers [Kurt Roeckx] + Changes between 1.0.1l and 1.0.2 [22 Jan 2015] + + *) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g. + ARMv5 through ARMv8, as opposite to "locking" it to single one. + So far those who have to target multiple plaforms would compromise + and argue that binary targeting say ARMv5 would still execute on + ARMv8. "Universal" build resolves this compromise by providing + near-optimal performance even on newer platforms. + [Andy Polyakov] + + *) Accelerated NIST P-256 elliptic curve implementation for x86_64 + (other platforms pending). + [Shay Gueron & Vlad Krasnov (Intel Corp), Andy Polyakov] + + *) Add support for the SignedCertificateTimestampList certificate and + OCSP response extensions from RFC6962. + [Rob Stradling] + + *) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.) + for corner cases. (Certain input points at infinity could lead to + bogus results, with non-infinity inputs mapped to infinity too.) + [Bodo Moeller] + + *) Initial support for PowerISA 2.0.7, first implemented in POWER8. + This covers AES, SHA256/512 and GHASH. "Initial" means that most + common cases are optimized and there still is room for further + improvements. Vector Permutation AES for Altivec is also added. + [Andy Polyakov] + + *) Add support for little-endian ppc64 Linux target. + [Marcelo Cerri (IBM)] + + *) Initial support for AMRv8 ISA crypto extensions. This covers AES, + SHA1, SHA256 and GHASH. "Initial" means that most common cases + are optimized and there still is room for further improvements. + Both 32- and 64-bit modes are supported. + [Andy Polyakov, Ard Biesheuvel (Linaro)] + + *) Improved ARMv7 NEON support. + [Andy Polyakov] + + *) Support for SPARC Architecture 2011 crypto extensions, first + implemented in SPARC T4. This covers AES, DES, Camellia, SHA1, + SHA256/512, MD5, GHASH and modular exponentiation. + [Andy Polyakov, David Miller] + + *) Accelerated modular exponentiation for Intel processors, a.k.a. + RSAZ. + [Shay Gueron & Vlad Krasnov (Intel Corp)] + + *) Support for new and upcoming Intel processors, including AVX2, + BMI and SHA ISA extensions. This includes additional "stitched" + implementations, AESNI-SHA256 and GCM, and multi-buffer support + for TLS encrypt. + + This work was sponsored by Intel Corp. + [Andy Polyakov] + + *) Support for DTLS 1.2. This adds two sets of DTLS methods: DTLS_*_method() + supports both DTLS 1.2 and 1.0 and should use whatever version the peer + supports and DTLSv1_2_*_method() which supports DTLS 1.2 only. + [Steve Henson] + + *) Use algorithm specific chains in SSL_CTX_use_certificate_chain_file(): + this fixes a limiation in previous versions of OpenSSL. + [Steve Henson] + + *) Extended RSA OAEP support via EVP_PKEY API. Options to specify digest, + MGF1 digest and OAEP label. + [Steve Henson] + + *) Add EVP support for key wrapping algorithms, to avoid problems with + existing code the flag EVP_CIPHER_CTX_WRAP_ALLOW has to be set in + the EVP_CIPHER_CTX or an error is returned. Add AES and DES3 wrap + algorithms and include tests cases. + [Steve Henson] + + *) Add functions to allocate and set the fields of an ECDSA_METHOD + structure. + [Douglas E. Engert, Steve Henson] + + *) New functions OPENSSL_gmtime_diff and ASN1_TIME_diff to find the + difference in days and seconds between two tm or ASN1_TIME structures. + [Steve Henson] + + *) Add -rev test option to s_server to just reverse order of characters + received by client and send back to server. Also prints an abbreviated + summary of the connection parameters. + [Steve Henson] + + *) New option -brief for s_client and s_server to print out a brief summary + of connection parameters. + [Steve Henson] + + *) Add callbacks for arbitrary TLS extensions. + [Trevor Perrin and Ben Laurie] + + *) New option -crl_download in several openssl utilities to download CRLs + from CRLDP extension in certificates. + [Steve Henson] + + *) New options -CRL and -CRLform for s_client and s_server for CRLs. + [Steve Henson] + + *) New function X509_CRL_diff to generate a delta CRL from the difference + of two full CRLs. Add support to "crl" utility. + [Steve Henson] + + *) New functions to set lookup_crls function and to retrieve + X509_STORE from X509_STORE_CTX. + [Steve Henson] + + *) Print out deprecated issuer and subject unique ID fields in + certificates. + [Steve Henson] + + *) Extend OCSP I/O functions so they can be used for simple general purpose + HTTP as well as OCSP. New wrapper function which can be used to download + CRLs using the OCSP API. + [Steve Henson] + + *) Delegate command line handling in s_client/s_server to SSL_CONF APIs. + [Steve Henson] + + *) SSL_CONF* functions. These provide a common framework for application + configuration using configuration files or command lines. + [Steve Henson] + + *) SSL/TLS tracing code. This parses out SSL/TLS records using the + message callback and prints the results. Needs compile time option + "enable-ssl-trace". New options to s_client and s_server to enable + tracing. + [Steve Henson] + + *) New ctrl and macro to retrieve supported points extensions. + Print out extension in s_server and s_client. + [Steve Henson] + + *) New functions to retrieve certificate signature and signature + OID NID. + [Steve Henson] + + *) Add functions to retrieve and manipulate the raw cipherlist sent by a + client to OpenSSL. + [Steve Henson] + + *) New Suite B modes for TLS code. These use and enforce the requirements + of RFC6460: restrict ciphersuites, only permit Suite B algorithms and + only use Suite B curves. The Suite B modes can be set by using the + strings "SUITEB128", "SUITEB192" or "SUITEB128ONLY" for the cipherstring. + [Steve Henson] + + *) New chain verification flags for Suite B levels of security. Check + algorithms are acceptable when flags are set in X509_verify_cert. + [Steve Henson] + + *) Make tls1_check_chain return a set of flags indicating checks passed + by a certificate chain. Add additional tests to handle client + certificates: checks for matching certificate type and issuer name + comparison. + [Steve Henson] + + *) If an attempt is made to use a signature algorithm not in the peer + preference list abort the handshake. If client has no suitable + signature algorithms in response to a certificate request do not + use the certificate. + [Steve Henson] + + *) If server EC tmp key is not in client preference list abort handshake. + [Steve Henson] + + *) Add support for certificate stores in CERT structure. This makes it + possible to have different stores per SSL structure or one store in + the parent SSL_CTX. Include distint stores for certificate chain + verification and chain building. New ctrl SSL_CTRL_BUILD_CERT_CHAIN + to build and store a certificate chain in CERT structure: returing + an error if the chain cannot be built: this will allow applications + to test if a chain is correctly configured. + + Note: if the CERT based stores are not set then the parent SSL_CTX + store is used to retain compatibility with existing behaviour. + + [Steve Henson] + + *) New function ssl_set_client_disabled to set a ciphersuite disabled + mask based on the current session, check mask when sending client + hello and checking the requested ciphersuite. + [Steve Henson] + + *) New ctrls to retrieve and set certificate types in a certificate + request message. Print out received values in s_client. If certificate + types is not set with custom values set sensible values based on + supported signature algorithms. + [Steve Henson] + + *) Support for distinct client and server supported signature algorithms. + [Steve Henson] + + *) Add certificate callback. If set this is called whenever a certificate + is required by client or server. An application can decide which + certificate chain to present based on arbitrary criteria: for example + supported signature algorithms. Add very simple example to s_server. + This fixes many of the problems and restrictions of the existing client + certificate callback: for example you can now clear an existing + certificate and specify the whole chain. + [Steve Henson] + + *) Add new "valid_flags" field to CERT_PKEY structure which determines what + the certificate can be used for (if anything). Set valid_flags field + in new tls1_check_chain function. Simplify ssl_set_cert_masks which used + to have similar checks in it. + + Add new "cert_flags" field to CERT structure and include a "strict mode". + This enforces some TLS certificate requirements (such as only permitting + certificate signature algorithms contained in the supported algorithms + extension) which some implementations ignore: this option should be used + with caution as it could cause interoperability issues. + [Steve Henson] + + *) Update and tidy signature algorithm extension processing. Work out + shared signature algorithms based on preferences and peer algorithms + and print them out in s_client and s_server. Abort handshake if no + shared signature algorithms. + [Steve Henson] + + *) Add new functions to allow customised supported signature algorithms + for SSL and SSL_CTX structures. Add options to s_client and s_server + to support them. + [Steve Henson] + + *) New function SSL_certs_clear() to delete all references to certificates + from an SSL structure. Before this once a certificate had been added + it couldn't be removed. + [Steve Henson] + + *) Integrate hostname, email address and IP address checking with certificate + verification. New verify options supporting checking in opensl utility. + [Steve Henson] + + *) Fixes and wildcard matching support to hostname and email checking + functions. Add manual page. + [Florian Weimer (Red Hat Product Security Team)] + + *) New functions to check a hostname email or IP address against a + certificate. Add options x509 utility to print results of checks against + a certificate. + [Steve Henson] + + *) Fix OCSP checking. + [Rob Stradling and Ben Laurie] + + *) Initial experimental support for explicitly trusted non-root CAs. + OpenSSL still tries to build a complete chain to a root but if an + intermediate CA has a trust setting included that is used. The first + setting is used: whether to trust (e.g., -addtrust option to the x509 + utility) or reject. + [Steve Henson] + + *) Add -trusted_first option which attempts to find certificates in the + trusted store even if an untrusted chain is also supplied. + [Steve Henson] + + *) MIPS assembly pack updates: support for MIPS32r2 and SmartMIPS ASE, + platform support for Linux and Android. + [Andy Polyakov] + + *) Support for linux-x32, ILP32 environment in x86_64 framework. + [Andy Polyakov] + + *) Experimental multi-implementation support for FIPS capable OpenSSL. + When in FIPS mode the approved implementations are used as normal, + when not in FIPS mode the internal unapproved versions are used instead. + This means that the FIPS capable OpenSSL isn't forced to use the + (often lower perfomance) FIPS implementations outside FIPS mode. + [Steve Henson] + + *) Transparently support X9.42 DH parameters when calling + PEM_read_bio_DHparameters. This means existing applications can handle + the new parameter format automatically. + [Steve Henson] + + *) Initial experimental support for X9.42 DH parameter format: mainly + to support use of 'q' parameter for RFC5114 parameters. + [Steve Henson] + + *) Add DH parameters from RFC5114 including test data to dhtest. + [Steve Henson] + + *) Support for automatic EC temporary key parameter selection. If enabled + the most preferred EC parameters are automatically used instead of + hardcoded fixed parameters. Now a server just has to call: + SSL_CTX_set_ecdh_auto(ctx, 1) and the server will automatically + support ECDH and use the most appropriate parameters. + [Steve Henson] + + *) Enhance and tidy EC curve and point format TLS extension code. Use + static structures instead of allocation if default values are used. + New ctrls to set curves we wish to support and to retrieve shared curves. + Print out shared curves in s_server. New options to s_server and s_client + to set list of supported curves. + [Steve Henson] + + *) New ctrls to retrieve supported signature algorithms and + supported curve values as an array of NIDs. Extend openssl utility + to print out received values. + [Steve Henson] + + *) Add new APIs EC_curve_nist2nid and EC_curve_nid2nist which convert + between NIDs and the more common NIST names such as "P-256". Enhance + ecparam utility and ECC method to recognise the NIST names for curves. + [Steve Henson] + + *) Enhance SSL/TLS certificate chain handling to support different + chains for each certificate instead of one chain in the parent SSL_CTX. + [Steve Henson] + + *) Support for fixed DH ciphersuite client authentication: where both + server and client use DH certificates with common parameters. + [Steve Henson] + + *) Support for fixed DH ciphersuites: those requiring DH server + certificates. + [Steve Henson] + + *) New function i2d_re_X509_tbs for re-encoding the TBS portion of + the certificate. + Note: Related 1.0.2-beta specific macros X509_get_cert_info, + X509_CINF_set_modified, X509_CINF_get_issuer, X509_CINF_get_extensions and + X509_CINF_get_signature were reverted post internal team review. + Changes between 1.0.1k and 1.0.1l [15 Jan 2015] *) Build fixes for the Windows and OpenVMS platforms Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Fri Oct 30 20:47:42 2015 (r290206) +++ head/crypto/openssl/Configure Fri Oct 30 20:51:33 2015 (r290207) @@ -105,6 +105,25 @@ my $usage="Usage: Configure [no- my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED"; +# TODO(openssl-team): fix problems and investigate if (at least) the following +# warnings can also be enabled: +# -Wconditional-uninitialized, -Wswitch-enum, -Wunused-macros, +# -Wmissing-field-initializers, -Wmissing-variable-declarations, +# -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, +# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token +# -Wextended-offsetof +my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof"; + +# These are used in addition to $gcc_devteam_warn when the compiler is clang. +# TODO(openssl-team): fix problems and investigate if (at least) the +# following warnings can also be enabled: -Wconditional-uninitialized, +# -Wswitch-enum, -Wunused-macros, -Wmissing-field-initializers, +# -Wmissing-variable-declarations, +# -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, +# -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token +# -Wextended-offsetof +my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; + my $strict_warnings = 0; my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; @@ -124,24 +143,25 @@ my $tlib="-lnsl -lsocket"; my $bits1="THIRTY_TWO_BIT "; my $bits2="SIXTY_FOUR_BIT "; -my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o x86-gf2m.o:des-586.o crypt586.o:aes-586.o vpaes-x86.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o:ghash-x86.o:"; +my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o x86-gf2m.o::des-586.o crypt586.o:aes-586.o vpaes-x86.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o:ghash-x86.o:"; my $x86_elf_asm="$x86_asm:elf"; -my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o:"; -my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void"; -my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void"; -my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::::void"; -my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o:::::sha1-alpha.o:::::::ghash-alpha.o::void"; -my $mips32_asm=":bn-mips.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o::::::::"; -my $mips64_asm=":bn-mips.o mips-mont.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o sha512-mips.o::::::::"; -my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o s390x-gf2m.o::aes-s390x.o aes-ctr.o aes-xts.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::ghash-s390x.o:"; -my $armv4_asm="armcap.o armv4cpuid.o:bn_asm.o armv4-mont.o armv4-gf2m.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::ghash-armv4.o::void"; -my $parisc11_asm="pariscid.o:bn_asm.o parisc-mont.o::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::32"; -my $parisc20_asm="pariscid.o:pa-risc2W.o parisc-mont.o::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::64"; -my $ppc32_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::::"; -my $ppc64_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::::"; -my $no_asm=":::::::::::::::void"; +my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o:ecp_nistz256.o ecp_nistz256-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o aesni-gcm-x86_64.o:"; +my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void"; +my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o vis3-mont.o sparct4-mont.o sparcv9-gf2m.o::des_enc-sparc.o fcrypt_b.o dest4-sparcv9.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o::::::camellia.o cmll_misc.o cmll_cbc.o cmllt4-sparcv9.o:ghash-sparcv9.o::void"; +my $sparcv8_asm=":sparcv8.o::des_enc-sparc.o fcrypt_b.o:::::::::::::void"; +my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::sha1-alpha.o:::::::ghash-alpha.o::void"; +my $mips64_asm=":bn-mips.o mips-mont.o:::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o sha512-mips.o::::::::"; +my $mips32_asm=$mips64_asm; $mips32_asm =~ s/\s*sha512\-mips\.o//; +my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o s390x-gf2m.o:::aes-s390x.o aes-ctr.o aes-xts.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::ghash-s390x.o:"; +my $armv4_asm="armcap.o armv4cpuid.o:bn_asm.o armv4-mont.o armv4-gf2m.o:::aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::ghash-armv4.o ghashv8-armx.o::void"; +my $aarch64_asm="armcap.o arm64cpuid.o mem_clr.o::::aes_core.o aes_cbc.o aesv8-armx.o:::sha1-armv8.o sha256-armv8.o sha512-armv8.o:::::::ghashv8-armx.o:"; +my $parisc11_asm="pariscid.o:bn_asm.o parisc-mont.o:::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::32"; +my $parisc20_asm="pariscid.o:pa-risc2W.o parisc-mont.o:::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::64"; +my $ppc64_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o:::aes_core.o aes_cbc.o aes-ppc.o vpaes-ppc.o aesp8-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o sha256p8-ppc.o sha512p8-ppc.o:::::::ghashp8-ppc.o:"; +my $ppc32_asm=$ppc64_asm; +my $no_asm="::::::::::::::::void"; # As for $BSDthreads. Idea is to maintain "collective" set of flags, # which would cover all BSD flavors. -pthread applies to them all, @@ -152,7 +172,7 @@ my $no_asm=":::::::::::::::void"; # seems to be sufficient? my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT"; -#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $modes_obj : $engines_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib +#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $ec_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $modes_obj : $engines_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib my %table=( # File 'TABLE' (created by 'make TABLE') contains the data from this list, @@ -174,14 +194,14 @@ my %table=( "debug-ben-debug-64", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-ben-macos", "cc:$gcc_devteam_warn -arch i386 -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::-Wl,-search_paths_first::::", "debug-ben-macos-gcc46", "gcc-mp-4.6:$gcc_devteam_warn -Wconversion -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::::::", -"debug-ben-darwin64","cc:$gcc_devteam_warn -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"debug-ben-darwin64","cc:$gcc_devteam_warn -g -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"debug-ben-debug-64-clang", "clang:$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-bodo", "gcc:$gcc_devteam_warn -Wno-error=overlength-strings -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", -"debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", "debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -Wno-overlength-strings -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -ggdb -g3 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -193,9 +213,9 @@ my %table=( "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", "debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o::des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "dist", "cc:-O::(unknown)::::::", @@ -225,7 +245,7 @@ my %table=( "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64", #### Solaris x86 with Sun C setups -"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris-x86-cc","cc:-fast -xarch=generic -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64", #### SPARC Solaris with GNU C setups @@ -300,7 +320,7 @@ my %table=( "hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "hpux-parisc1_1-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${parisc11_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1", "hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32", -"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64", +"hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o:::::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64", # More attempts at unified 10.X and 11.X targets for HP C compiler. # @@ -347,20 +367,57 @@ my %table=( # throw in -D[BL]_ENDIAN, whichever appropriate... "linux-generic32","gcc:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ppc", "gcc:-DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -# It's believed that majority of ARM toolchains predefine appropriate -march. -# If you compiler does not, do complement config command line with one! -"linux-armv4", "gcc:-O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +####################################################################### +# Note that -march is not among compiler options in below linux-armv4 +# target line. Not specifying one is intentional to give you choice to: +# +# a) rely on your compiler default by not specifying one; +# b) specify your target platform explicitly for optimal performance, +# e.g. -march=armv6 or -march=armv7-a; +# c) build "universal" binary that targets *range* of platforms by +# specifying minimum and maximum supported architecture; +# +# As for c) option. It actually makes no sense to specify maximum to be +# less than ARMv7, because it's the least requirement for run-time +# switch between platform-specific code paths. And without run-time +# switch performance would be equivalent to one for minimum. Secondly, +# there are some natural limitations that you'd have to accept and +# respect. Most notably you can *not* build "universal" binary for +# big-endian platform. This is because ARMv7 processor always picks +# instructions in little-endian order. Another similar limitation is +# that -mthumb can't "cross" -march=armv6t2 boundary, because that's +# where it became Thumb-2. Well, this limitation is a bit artificial, +# because it's not really impossible, but it's deemed too tricky to +# support. And of course you have to be sure that your binutils are +# actually up to the task of handling maximum target platform. With all +# this in mind here is an example of how to configure "universal" build: +# +# ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8 +# +"linux-armv4", "gcc: -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-aarch64","gcc: -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +# Configure script adds minimally required -march for assembly support, +# if no -march was specified at command line. mips32 and mips64 below +# refer to contemporary MIPS Architecture specifications, MIPS32 and +# MIPS64, rather than to kernel bitness. +"linux-mips32", "gcc:-mabi=32 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-mips64", "gcc:-mabi=n32 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:n32:dlfcn:linux-shared:-fPIC:-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32", +"linux64-mips64", "gcc:-mabi=64 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips64_asm}:64:dlfcn:linux-shared:-fPIC:-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", #### IA-32 targets... -"linux-ia32-icc", "icc:-DL_ENDIAN -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-ia32-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-elf", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-aout", "gcc:-DL_ENDIAN -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out", #### "linux-generic64","gcc:-O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ppc64", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", -"linux-ia64", "gcc:-DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"linux-ia64-ecc","ecc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-ppc64le","gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:$ppc64_asm:linux64le:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::", +"linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-x86_64-clang", "clang: -m64 -DL_ENDIAN -O3 -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32", "linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", #### So called "highgprs" target for z/Architecture CPUs # "Highgprs" is kernel feature first implemented in Linux 2.6.32, see @@ -407,6 +464,7 @@ my %table=( "android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"android-mips","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### *BSD [do see comment about ${BSDthreads} above!] "BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -421,7 +479,7 @@ my %table=( # triggered by RIPEMD160 code. "BSD-sparc64", "gcc:-DB_ENDIAN -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "BSD-ia64", "gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"BSD-x86_64", "gcc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"BSD-x86_64", "cc:-DL_ENDIAN -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -454,11 +512,11 @@ my %table=( # UnixWare 2.0x fails destest with -O. "unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", "unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", -"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}-1:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}-1:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", # SCO 5 - Ben Laurie says the -O breaks the SCO cc. -"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}-1:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}-1:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### IBM's AIX. "aix3-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::", @@ -518,9 +576,9 @@ my %table=( # Visual C targets # # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 -"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32", +"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o ia64-mont.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32", "VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32", -"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32", +"debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32", "debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32", # x86 Win32 target defaults to ANSI API, if you want UNICODE, complement # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE' @@ -547,9 +605,8 @@ my %table=( "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", # Cygwin -"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", -"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", -"debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", +"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", +"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", # NetWare from David Ward (dsward@novell.com) # requires either MetroWerks NLM development tools, or gcc / nlmconv @@ -581,7 +638,8 @@ my %table=( "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", # iPhoneOS/iOS "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", @@ -634,6 +692,7 @@ my $idx_lflags = $idx++; my $idx_bn_ops = $idx++; my $idx_cpuid_obj = $idx++; my $idx_bn_obj = $idx++; +my $idx_ec_obj = $idx++; my $idx_des_obj = $idx++; my $idx_aes_obj = $idx++; my $idx_bf_obj = $idx++; @@ -714,11 +773,13 @@ my %disabled = ( # "what" => "co "ec_nistp_64_gcc_128" => "default", "gmp" => "default", "jpake" => "experimental", + "libunbound" => "experimental", "md2" => "default", "rc5" => "default", "rfc3779" => "default", "sctp" => "default", "shared" => "default", + "ssl-trace" => "default", "store" => "experimental", "unit-test" => "default", "zlib" => "default", @@ -728,7 +789,7 @@ my @experimental = (); # This is what $depflags will look like with the above defaults # (we need this to see if we should advise the user to run "make depend"): -my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST"; +my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST"; # Explicit "no-..." options will be collected in %disabled along with the defaults. # To remove something from %disabled, use "enable-foo" (unless it's experimental). @@ -873,16 +934,7 @@ PROCESS_ARGS: } elsif (/^[-+]/) { - if (/^-[lL](.*)$/ or /^-Wl,/) - { - $libs.=$_." "; - } - elsif (/^-[^-]/ or /^\+/) - { - $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei; - $flags.=$_." "; - } - elsif (/^--prefix=(.*)$/) + if (/^--prefix=(.*)$/) { $prefix=$1; } @@ -926,10 +978,14 @@ PROCESS_ARGS: { $cross_compile_prefix=$1; } - else + elsif (/^-[lL](.*)$/ or /^-Wl,/) + { + $libs.=$_." "; + } + else # common if (/^[-+]/), just pass down... { - print STDERR $usage; - exit(1); + $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei; + $flags.=$_." "; } } elsif ($_ =~ /^([^:]+):(.+)$/) @@ -1156,6 +1212,7 @@ my $cc = $fields[$idx_cc]; if($ENV{CC}) { $cc = $ENV{CC}; } + my $cflags = $fields[$idx_cflags]; my $unistd = $fields[$idx_unistd]; my $thread_cflag = $fields[$idx_thread_cflag]; @@ -1164,6 +1221,7 @@ my $lflags = $fields[$idx_lflags]; my $bn_ops = $fields[$idx_bn_ops]; my $cpuid_obj = $fields[$idx_cpuid_obj]; my $bn_obj = $fields[$idx_bn_obj]; +my $ec_obj = $fields[$idx_ec_obj]; my $des_obj = $fields[$idx_des_obj]; my $aes_obj = $fields[$idx_aes_obj]; my $bf_obj = $fields[$idx_bf_obj]; @@ -1209,6 +1267,12 @@ if ($target =~ /^mingw/ && `$cc --target $shared_ldflag =~ s/\-mno\-cygwin\s*//; } +if ($target =~ /linux.*\-mips/ && !$no_asm && $flags !~ /\-m(ips|arch=)/) { + # minimally required architecture flags for assembly modules + $cflags="-mips2 $cflags" if ($target =~ /mips32/); + $cflags="-mips3 $cflags" if ($target =~ /mips64/); +} + my $no_shared_warn=0; my $no_user_cflags=0; @@ -1335,7 +1399,7 @@ $lflags="$libs$lflags" if ($libs ne ""); if ($no_asm) { - $cpuid_obj=$bn_obj= + $cpuid_obj=$bn_obj=$ec_obj= $des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=$cmll_obj= $modes_obj=$sha1_obj=$md5_obj=$rmd160_obj=$wp_obj=$engines_obj=""; } @@ -1416,6 +1480,7 @@ if ($target =~ /\-icc$/) # Intel C compi } if ($iccver>=8) { + $cflags=~s/\-KPIC/-fPIC/; # Eliminate unnecessary dependency from libirc.a. This is # essential for shared library support, as otherwise # apps/openssl can end up in endless loop upon startup... @@ -1423,12 +1488,17 @@ if ($target =~ /\-icc$/) # Intel C compi } if ($iccver>=9) { - $cflags.=" -i-static"; - $cflags=~s/\-no_cpprt/-no-cpprt/; + $lflags.=" -i-static"; + $lflags=~s/\-no_cpprt/-no-cpprt/; } if ($iccver>=10) { - $cflags=~s/\-i\-static/-static-intel/; + $lflags=~s/\-i\-static/-static-intel/; + } + if ($iccver>=11) + { + $cflags.=" -no-intel-extensions"; # disable Cilk + $lflags=~s/\-no\-cpprt/-no-cxxlib/; } } @@ -1509,7 +1579,7 @@ if ($rmd160_obj =~ /\.o$/) } if ($aes_obj =~ /\.o$/) { - $cflags.=" -DAES_ASM"; + $cflags.=" -DAES_ASM" if ($aes_obj =~ m/\baes\-/);; # aes-ctr.o is not a real file, only indication that assembler # module implements AES_ctr32_encrypt... $cflags.=" -DAES_CTR_ASM" if ($aes_obj =~ s/\s*aes\-ctr\.o//); @@ -1531,10 +1601,14 @@ else { $wp_obj="wp_block.o"; } $cmll_obj=$cmll_enc unless ($cmll_obj =~ /.o$/); -if ($modes_obj =~ /ghash/) +if ($modes_obj =~ /ghash\-/) { $cflags.=" -DGHASH_ASM"; } +if ($ec_obj =~ /ecp_nistz256/) + { + $cflags.=" -DECP_NISTZ256_ASM"; + } # "Stringify" the C flags string. This permits it to be made part of a string # and works as well on command lines. @@ -1574,12 +1648,21 @@ if ($shlib_version_number =~ /(^[0-9]*)\ if ($strict_warnings) { + my $ecc = $cc; + $ecc = "clang" if `$cc --version 2>&1` =~ /clang/; my $wopt; - die "ERROR --strict-warnings requires gcc" unless ($cc =~ /gcc$/); + die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/); foreach $wopt (split /\s+/, $gcc_devteam_warn) { $cflags .= " $wopt" unless ($cflags =~ /$wopt/) } + if ($ecc eq "clang") + { + foreach $wopt (split /\s+/, $clang_devteam_warn) + { + $cflags .= " $wopt" unless ($cflags =~ /$wopt/) + } + } } open(IN,') s/^EXE_EXT=.*$/EXE_EXT= $exe_ext/; s/^CPUID_OBJ=.*$/CPUID_OBJ= $cpuid_obj/; s/^BN_ASM=.*$/BN_ASM= $bn_obj/; + s/^EC_ASM=.*$/EC_ASM= $ec_obj/; s/^DES_ENC=.*$/DES_ENC= $des_obj/; s/^AES_ENC=.*$/AES_ENC= $aes_obj/; s/^BF_ENC=.*$/BF_ENC= $bf_obj/; @@ -1699,6 +1783,7 @@ print "CFLAG =$cflags\n"; print "EX_LIBS =$lflags\n"; print "CPUID_OBJ =$cpuid_obj\n"; print "BN_ASM =$bn_obj\n"; +print "EC_ASM =$ec_obj\n"; print "DES_ENC =$des_obj\n"; print "AES_ENC =$aes_obj\n"; print "BF_ENC =$bf_obj\n"; @@ -1997,7 +2082,7 @@ BEGIN VALUE "ProductVersion", "$version\\0" // Optional: //VALUE "Comments", "\\0" - VALUE "LegalCopyright", "Copyright © 1998-2005 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" + VALUE "LegalCopyright", "Copyright © 1998-2005 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" //VALUE "LegalTrademarks", "\\0" //VALUE "PrivateBuild", "\\0" //VALUE "SpecialBuild", "\\0" @@ -2106,12 +2191,12 @@ sub print_table_entry { my $target = shift; - (my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags, - my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj, - my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj, - my $rc5_obj,my $wp_obj,my $cmll_obj,my $modes_obj, my $engines_obj, - my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag, - my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)= + my ($cc, $cflags, $unistd, $thread_cflag, $sys_id, $lflags, + $bn_ops, $cpuid_obj, $bn_obj, $ec_obj, $des_obj, $aes_obj, $bf_obj, + $md5_obj, $sha1_obj, $cast_obj, $rc4_obj, $rmd160_obj, + $rc5_obj, $wp_obj, $cmll_obj, $modes_obj, $engines_obj, + $perlasm_scheme, $dso_scheme, $shared_target, $shared_cflag, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Oct 30 21:23:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 577C9A2272E; Fri, 30 Oct 2015 21:23:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2313018B2; Fri, 30 Oct 2015 21:23:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9ULNEHl069646; Fri, 30 Oct 2015 21:23:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9ULNEW9069645; Fri, 30 Oct 2015 21:23:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510302123.t9ULNEW9069645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 30 Oct 2015 21:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290208 - head/cddl/usr.sbin/dtrace/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 21:23:15 -0000 Author: bdrewery Date: Fri Oct 30 21:23:14 2015 New Revision: 290208 URL: https://svnweb.freebsd.org/changeset/base/290208 Log: Remove unneeded _RECURSING_PROGS check. It is definitely not needed after r288158, and is a private variable as well that should not be checked here. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Modified: head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Fri Oct 30 20:51:33 2015 (r290207) +++ head/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Fri Oct 30 21:23:14 2015 (r290208) @@ -4,7 +4,6 @@ TESTGROUP= ${.CURDIR:H:T}/${.CURDIR:T} TESTSRC= ${.CURDIR:H:H:H:H:H}/contrib/opensolaris/cmd/dtrace/test/tst/${TESTGROUP} TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/${TESTGROUP} -.if !defined(_RECURSING_PROGS) FILESGROUPS+= FILES ${TESTGROUP} ${TESTGROUP}EXE ${TESTGROUP}= ${TESTFILES} @@ -25,7 +24,6 @@ ${TESTWRAPPER}.sh: ${GENTEST} ${EXCLUDE} sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${TESTGROUP}:S/ */ /} > ${.TARGET} CLEANFILES+= ${TESTWRAPPER}.sh -.endif # !defined(_RECURSING_PROGS) .PATH: ${TESTSRC} From owner-svn-src-head@freebsd.org Fri Oct 30 21:45:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93E0A22B2C; Fri, 30 Oct 2015 21:45:29 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay112.isp.belgacom.be (mailrelay112.isp.belgacom.be [195.238.20.139]) by mx1.freebsd.org (Postfix) with ESMTP id 66DDE11F0; Fri, 30 Oct 2015 21:45:27 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B7AgDA4zNW/zhosVteFoMlU2+/MgENgVojhXYCgTU5FAEBAQEBAQGBCoQ2AQEEOhwjEAsOBgQJJQ8SGB4GE4gbAxYBCL9DDYRCAQEBAQEBAQMBAQEBAQEZBIt1glOGbQWWQ4UdgnCDIoFuY5QOh1EfAQFCghEdgVc9NAEBhXwBAQE Received: from 56.104-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.104.56]) by relay.skynet.be with ESMTP; 30 Oct 2015 22:44:17 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id t9ULiGdx001139; Fri, 30 Oct 2015 22:44:17 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Fri, 30 Oct 2015 22:44:16 +0100 From: Tijl Coosemans To: Konstantin Belousov Cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289279 - in head/sys: kern vm Message-ID: <20151030224416.51580e0f@kalimero.tijl.coosemans.org> In-Reply-To: <20151029203334.GA2257@kib.kiev.ua> References: <201510140210.t9E2A79H056595@repo.freebsd.org> <20151029212554.799f76eb@kalimero.tijl.coosemans.org> <20151029203334.GA2257@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 21:45:29 -0000 On Thu, 29 Oct 2015 22:33:34 +0200 Konstantin Belousov wrote: > On Thu, Oct 29, 2015 at 09:25:54PM +0100, Tijl Coosemans wrote: >> On Wed, 14 Oct 2015 02:10:07 +0000 (UTC) Jeff Roberson wrote: >>> Author: jeff >>> Date: Wed Oct 14 02:10:07 2015 >>> New Revision: 289279 >>> URL: https://svnweb.freebsd.org/changeset/base/289279 >>> >>> Log: >>> Parallelize the buffer cache and rewrite getnewbuf(). This results in a >>> 8x performance improvement in a micro benchmark on a 4 socket machine. >>> >>> - Get buffer headers from a per-cpu uma cache that sits in from of the >>> free queue. >>> - Use a per-cpu quantum cache in vmem to eliminate contention for kva. >>> - Use multiple clean queues according to buffer cache size to eliminate >>> clean queue lock contention. >>> - Introduce a bufspace daemon that attempts to prevent getnewbuf() callers >>> from blocking or doing direct recycling. >>> - Close some bufspace allocation races that could lead to endless >>> recycling. >>> - Further the transition to a more modern style of small functions grouped >>> by prefix in order to improve growing complexity. >> >> I have an i386 system that locks up easily after this commit. Booting >> into single user and running make installkernel triggers it consistently. >> I haven't been able to reproduce it on amd64. Examining threads with >> DDB shows that they are all at sched_switch (a few at fork_trampoline). >> The only lock being held is Giant (by the interrupt handler for >> ctrl+alt+esc I think). So it doesn't look like a dead lock. It's more >> a sleeping beauty situation. All threads in the castle are sleeping and >> there's no prince to wake them up. >> >> (kgdb) info thread >> Id Target Id Frame >> >> These are from make installkernel: >> >> 72 Thread 100071 (PID=107: install) sched_switch (td=0xc667d000, >> newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 71 Thread 100070 (PID=81: make) sched_switch (td=0xc667d340, >> newtd=0xc667d000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 70 Thread 100067 (PID=30: make) sched_switch (td=0xc667e000, >> newtd=0xc667d340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 69 Thread 100066 (PID=25: make) sched_switch (td=0xc667e340, >> newtd=0xc667e000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> >> Single user shell: >> >> 68 Thread 100065 (PID=17: sh) sched_switch (td=0xc6406000, >> newtd=0xc667e340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> >> Kernel threads: >> >> 67 Thread 100063 (PID=16: vnlru) sched_switch (td=0xc6406680, >> newtd=0xc6407340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 66 Thread 100062 (PID=9: syncer) sched_switch (td=0xc64069c0, >> newtd=0xc667d000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 65 Thread 100061 (PID=8: bufspacedaemon) sched_switch (td=0xc6407000, >> newtd=0xc62dc000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 64 Thread 100060 (PID=7: bufdaemon) sched_switch (td=0xc6407340, >> newtd=0xc6408000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 63 Thread 100068 (PID=7: bufdaemon//var worker) sched_switch ( >> td=0xc667d9c0, newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 62 Thread 100069 (PID=7: bufdaemon//usr worker) sched_switch ( >> td=0xc667d680, newtd=0xc667d000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 61 Thread 100059 (PID=6: pagezero) sched_switch (td=0xc6407680, >> newtd=0xc55ba680, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 60 Thread 100058 (PID=5: vmdaemon) sched_switch (td=0xc64079c0, >> newtd=0xc6407340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 59 Thread 100057 (PID=4: pagedaemon) sched_switch (td=0xc6408000, >> newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 58 Thread 100064 (PID=4: pagedaemon/uma) sched_switch (td=0xc6406340, >> newtd=0xc55b9340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 57 Thread 100050 (PID=15: acpi_cooling0) sched_switch (td=0xc62dc340, >> newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> .... >> >> Anything else you need to debug this? > > Start with gathering the information listed in > https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html https://people.freebsd.org/~tijl/r289279-dead.txt r290155 doesn't fix it by the way. From owner-svn-src-head@freebsd.org Fri Oct 30 22:23:01 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABB6CA210C8; Fri, 30 Oct 2015 22:23:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 943CA10A9; Fri, 30 Oct 2015 22:23:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8CDF717F0; Fri, 30 Oct 2015 22:23:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 46EB710693; Fri, 30 Oct 2015 22:23:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 7ckM51s8x3IB; Fri, 30 Oct 2015 22:22:58 +0000 (UTC) Subject: Re: svn commit: r289279 - in head/sys: kern vm DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 1DC2E1068E To: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201510140210.t9E2A79H056595@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5633EDC4.4050907@FreeBSD.org> Date: Fri, 30 Oct 2015 15:23:00 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <201510140210.t9E2A79H056595@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8hdwCcLAuVUU2moDgCxWjfI7lIqvnAe5h" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 22:23:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8hdwCcLAuVUU2moDgCxWjfI7lIqvnAe5h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/13/2015 7:10 PM, Jeff Roberson wrote: > Author: jeff > Date: Wed Oct 14 02:10:07 2015 > New Revision: 289279 > URL: https://svnweb.freebsd.org/changeset/base/289279 >=20 > Log: > Parallelize the buffer cache and rewrite getnewbuf(). This results i= n a > 8x performance improvement in a micro benchmark on a 4 socket machine= =2E > =20 > - Get buffer headers from a per-cpu uma cache that sits in from of t= he > free queue. > - Use a per-cpu quantum cache in vmem to eliminate contention for kv= a. > - Use multiple clean queues according to buffer cache size to elimin= ate > clean queue lock contention. > - Introduce a bufspace daemon that attempts to prevent getnewbuf() c= allers > from blocking or doing direct recycling. > - Close some bufspace allocation races that could lead to endless > recycling. > - Further the transition to a more modern style of small functions g= rouped > by prefix in order to improve growing complexity. > =20 > Sponsored by: EMC / Isilon > Reviewed by: kib > Tested by: pho >=20 > Modified: > head/sys/kern/vfs_bio.c > head/sys/vm/vm_init.c =2E.. > +static void > +bufkva_reclaim(vmem_t *vmem, int flags) > +{ > + int i; > + > + for (i =3D 0; i < 5; i++) What is the significance of '5' here? It seems arbitrary without comments or a tunable that other code is based on. > + if (buf_scan(true) !=3D 0) > + break; > + return; > +} --=20 Regards, Bryan Drewery --8hdwCcLAuVUU2moDgCxWjfI7lIqvnAe5h Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWM+3EAAoJEDXXcbtuRpfPDk4H/juqqo5tgykglYFAfPHK3rsn Yoqn/61xEX8hYoZ5hEE3vJR+gDrwu/CCi+ls8jPOj3q/DxPtI8NK9XVhbAgaGhfm wO9unNtVmjb2UDaEH6iUIelPqDBWUP99h/K39Pw8vGpWf5l5+D864tiRxykf6WQk dWRAA13iq0vzFUVBbwilZL5ETTtg0fDxcXflJ++Hy6PFttqmDR6aX5J8/XLdkTFn WhWqo3Afm93ALa0eCm/daJNX6oW/VdahuuuD9s+M1eVSlE6YVsdagBj9dFLkO4kw IQsfBYGzSOB7NX+swQXPJBtN8PN0XdTs7Rac3ClhmQQdMjeJChsalWkwsGGh4Cs= =hpf0 -----END PGP SIGNATURE----- --8hdwCcLAuVUU2moDgCxWjfI7lIqvnAe5h-- From owner-svn-src-head@freebsd.org Fri Oct 30 22:53:31 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6FCDA2183F; Fri, 30 Oct 2015 22:53:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1D6A1E50; Fri, 30 Oct 2015 22:53:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UMrU95095835; Fri, 30 Oct 2015 22:53:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UMrULs095834; Fri, 30 Oct 2015 22:53:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302253.t9UMrULs095834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 22:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290210 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 22:53:32 -0000 Author: adrian Date: Fri Oct 30 22:53:30 2015 New Revision: 290210 URL: https://svnweb.freebsd.org/changeset/base/290210 Log: arge: do a read-after-write on all arge register writes, not just MDIO writes. This flushes out the write to the system before anything continues. The mips74k guide, chapter 3.3.3 (write gathering) notes that writes can be buffered in FIFOs - even uncached ones - so we can't guarantee the device has felt its effects. Now, since we're all lazy driver authors and don't pepper read/write barriers everywhere, fake it here. tested: * mips74k - QCA9558 SoC (AP135 reference board) Modified: head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Fri Oct 30 21:32:29 2015 (r290209) +++ head/sys/mips/atheros/if_argevar.h Fri Oct 30 22:53:30 2015 (r290210) @@ -68,6 +68,7 @@ #define ARGE_WRITE(sc, reg, val) do { \ bus_write_4(sc->arge_res, (reg), (val)); \ ARGE_BARRIER_WRITE((sc)); \ + ARGE_READ((sc), (reg)); \ } while (0) #define ARGE_READ(sc, reg) bus_read_4(sc->arge_res, (reg)) @@ -87,10 +88,7 @@ * FIFO(s) before we continue issuing MDIO bus updates. */ #define ARGE_MDIO_WRITE(_sc, _reg, _val) \ - do { \ - ARGE_WRITE((_sc), (_reg), (_val)); \ - ARGE_READ((_sc), (_reg)); \ - } while (0) + ARGE_WRITE((_sc), (_reg), (_val)) #define ARGE_MDIO_READ(_sc, _reg) \ ARGE_READ((_sc), (_reg)) #define ARGE_MDIO_BARRIER_READ(_sc) ARGE_BARRIER_READ(_sc) From owner-svn-src-head@freebsd.org Fri Oct 30 22:55:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52DA6A218D2; Fri, 30 Oct 2015 22:55:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2D71FE9; Fri, 30 Oct 2015 22:55:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UMtgtB095967; Fri, 30 Oct 2015 22:55:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UMtghR095966; Fri, 30 Oct 2015 22:55:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302255.t9UMtghR095966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 22:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290211 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 22:55:43 -0000 Author: adrian Date: Fri Oct 30 22:55:41 2015 New Revision: 290211 URL: https://svnweb.freebsd.org/changeset/base/290211 Log: arge: ensure there's enough space in the TX ring before attempting to send frames. This matches the other check for space. "enough" is a misnomer, for "reasons". The biggest reason is that the TX ring is actually a circular linked list, with no head/tail pointers. This is just a bit more headroom between head/tail so we have time to schedule frames before we hit where the hardware is at. Ideally this would be tunable and a little larger. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 30 22:53:30 2015 (r290210) +++ head/sys/mips/atheros/if_arge.c Fri Oct 30 22:55:41 2015 (r290211) @@ -1501,7 +1501,7 @@ arge_encap(struct arge_softc *sc, struct } /* Check number of available descriptors. */ - if (sc->arge_cdata.arge_tx_cnt + nsegs >= (ARGE_TX_RING_COUNT - 1)) { + if (sc->arge_cdata.arge_tx_cnt + nsegs >= (ARGE_TX_RING_COUNT - 2)) { bus_dmamap_unload(sc->arge_cdata.arge_tx_tag, txd->tx_dmamap); sc->stats.tx_pkts_nosegs++; return (ENOBUFS); From owner-svn-src-head@freebsd.org Fri Oct 30 23:00:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714E9A21944; Fri, 30 Oct 2015 23:00:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8FC11A0; Fri, 30 Oct 2015 23:00:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UN0mEC098208; Fri, 30 Oct 2015 23:00:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UN0m76098207; Fri, 30 Oct 2015 23:00:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302300.t9UN0m76098207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 23:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290212 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 23:00:49 -0000 Author: adrian Date: Fri Oct 30 23:00:47 2015 New Revision: 290212 URL: https://svnweb.freebsd.org/changeset/base/290212 Log: arge_mdio: add explicit read barriers for MDIO_READs. The mips74k programmers guide notes that reads can be re-ordered, even uncached ones, so we need an explicit SYNC between them. Yes, this is a case of a driver author actively doing a bus barrier operation. This ends up being necessary when the mips74k core is run in write-back mode rather than write-through mode. That's coming in an upcoming commit. Tested: * mips74k, QCA9558 SoC (AP135 reference board), arge<->arge interface routing traffic tests. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 30 22:55:41 2015 (r290211) +++ head/sys/mips/atheros/if_arge.c Fri Oct 30 23:00:47 2015 (r290212) @@ -1081,8 +1081,10 @@ arge_miibus_readreg(device_t dev, int ph i = ARGE_MII_TIMEOUT; while ((ARGE_MDIO_READ(sc, AR71XX_MAC_MII_INDICATOR) & - MAC_MII_INDICATOR_BUSY) && (i--)) + MAC_MII_INDICATOR_BUSY) && (i--)) { + ARGE_MDIO_BARRIER_READ(sc); DELAY(5); + } if (i < 0) { mtx_unlock(&miibus_mtx); @@ -1092,6 +1094,7 @@ arge_miibus_readreg(device_t dev, int ph } result = ARGE_MDIO_READ(sc, AR71XX_MAC_MII_STATUS) & MAC_MII_STATUS_MASK; + ARGE_MDIO_BARRIER_READ(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_CMD, MAC_MII_CMD_WRITE); mtx_unlock(&miibus_mtx); @@ -1119,8 +1122,10 @@ arge_miibus_writereg(device_t dev, int p i = ARGE_MII_TIMEOUT; while ((ARGE_MDIO_READ(sc, AR71XX_MAC_MII_INDICATOR) & - MAC_MII_INDICATOR_BUSY) && (i--)) + MAC_MII_INDICATOR_BUSY) && (i--)) { + ARGE_MDIO_BARRIER_READ(sc); DELAY(5); + } mtx_unlock(&miibus_mtx); From owner-svn-src-head@freebsd.org Fri Oct 30 23:07:34 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C13CA21B7A; Fri, 30 Oct 2015 23:07:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA3FA195E; Fri, 30 Oct 2015 23:07:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UN7WfX099319; Fri, 30 Oct 2015 23:07:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UN7WvT099318; Fri, 30 Oct 2015 23:07:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302307.t9UN7WvT099318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 23:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290213 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 23:07:34 -0000 Author: adrian Date: Fri Oct 30 23:07:32 2015 New Revision: 290213 URL: https://svnweb.freebsd.org/changeset/base/290213 Log: arge: do an explicit flush between updating the TX ring and starting transmit. The MIPS busdma sync operations currently are a big no-op on coherent memory. This isn't strictly correct behaviour as we need a SYNC in here to ensure that the writes have finished and are visible in main memory before the MMIO accesses occur. This will have to be addressed in a later commit. But, before that happens, let's at least do a flush here to make things more "correct". This is required for even remotely sensible behaviour on mips74k with write-through memory enabled. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 30 23:00:47 2015 (r290212) +++ head/sys/mips/atheros/if_arge.c Fri Oct 30 23:07:32 2015 (r290213) @@ -1550,6 +1550,9 @@ arge_encap(struct arge_softc *sc, struct sc->arge_cdata.arge_tx_ring_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* Flush writes */ + ARGE_BARRIER_WRITE(sc); + /* Start transmitting */ ARGEDEBUG(sc, ARGE_DBG_TX, "%s: setting DMA_TX_CONTROL_EN\n", __func__); From owner-svn-src-head@freebsd.org Fri Oct 30 23:09:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A166A21C76; Fri, 30 Oct 2015 23:09:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 110C51B9C; Fri, 30 Oct 2015 23:09:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UN994Z099417; Fri, 30 Oct 2015 23:09:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UN9919099416; Fri, 30 Oct 2015 23:09:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302309.t9UN9919099416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 23:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290214 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 23:09:10 -0000 Author: adrian Date: Fri Oct 30 23:09:08 2015 New Revision: 290214 URL: https://svnweb.freebsd.org/changeset/base/290214 Log: arge: just use 1U since it's a 32 bit unsigned destination value. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 30 23:07:32 2015 (r290213) +++ head/sys/mips/atheros/if_arge.c Fri Oct 30 23:09:08 2015 (r290214) @@ -2492,7 +2492,7 @@ arge_intr(void *arg) #ifdef ARGE_DEBUG for (i = 0; i < 32; i++) { - if (status & (1 << i)) { + if (status & (1U << i)) { sc->intr_stats.count[i]++; } } From owner-svn-src-head@freebsd.org Fri Oct 30 23:18:04 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 304F9A21F09; Fri, 30 Oct 2015 23:18:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00BF6114B; Fri, 30 Oct 2015 23:18:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UNI2OS002412; Fri, 30 Oct 2015 23:18:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UNI2Bq002411; Fri, 30 Oct 2015 23:18:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302318.t9UNI2Bq002411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 23:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290215 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 23:18:04 -0000 Author: adrian Date: Fri Oct 30 23:18:02 2015 New Revision: 290215 URL: https://svnweb.freebsd.org/changeset/base/290215 Log: arge: attempt to close a transmit race by only enabling the descriptor at the end of setup. This driver and the linux ag71xx driver both treat the transmit ring as a circular linked list of descriptors. There's no "end" pointer that is ever NULL - instead, it expects the MAC to hit a finished descriptor (ARGE_DESC_EMPTY) and stop. Now, since it's a circular buffer, we may end up with the hardware hitting the beginning of our multi-descriptor frame before we've finished setting it up. It then DMA's it in, starts sending it, and we finish writing out the new descriptor. The hardware may then write its completion for the next descriptor out; then we do, and when we next read it it'll show up as "not done" and transmit completion stops. This unfortunately manifests itself as the transmit queue always being active and a massive TX interrupt storm. We need to actively ACK packets back from the transmit engine and if we don't (eg because we think the transmit isn't finished but it is) then the unit will just keep generating interrupts. I hit this finally with the below testing setup. This fixed it for me. Strictly speaking I should put in a sync in between writing out all of the descriptors and writing out that final descriptor. Tested: * QCA9558 SoC (AP135 reference board) w/ arge1 + vlans acting as a router, and iperf -d (tcp, bidirectional traffic.) Obtained from: Linux OpenWRT (ag71xx_main.c.) Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 30 23:09:08 2015 (r290214) +++ head/sys/mips/atheros/if_arge.c Fri Oct 30 23:18:02 2015 (r290215) @@ -1519,12 +1519,27 @@ arge_encap(struct arge_softc *sc, struct /* * Make a list of descriptors for this packet. DMA controller will * walk through it while arge_link is not zero. + * + * Since we're in a endless circular buffer, ensure that + * the first descriptor in a multi-descriptor ring is always + * set to EMPTY, then un-do it when we're done populating. */ prev_prod = prod; desc = prev_desc = NULL; for (i = 0; i < nsegs; i++) { + uint32_t tmp; + desc = &sc->arge_rdata.arge_tx_ring[prod]; - desc->packet_ctrl = ARGE_DMASIZE(txsegs[i].ds_len); + + /* + * Set DESC_EMPTY so the hardware (hopefully) stops at this + * point. We don't want it to start transmitting descriptors + * before we've finished fleshing this out. + */ + tmp = ARGE_DMASIZE(txsegs[i].ds_len); + if (i == 0) + tmp |= ARGE_DESC_EMPTY; + desc->packet_ctrl = tmp; /* XXX Note: only relevant for older MACs; but check length! */ if ((sc->arge_hw_flags & ARGE_HW_FLG_TX_DESC_ALIGN_4BYTE) && @@ -1545,6 +1560,12 @@ arge_encap(struct arge_softc *sc, struct /* Update producer index. */ sc->arge_cdata.arge_tx_prod = prod; + /* + * The descriptors are updated, so enable the first one. + */ + desc = &sc->arge_rdata.arge_tx_ring[prev_prod]; + desc->packet_ctrl &= ~ ARGE_DESC_EMPTY; + /* Sync descriptors. */ bus_dmamap_sync(sc->arge_cdata.arge_tx_ring_tag, sc->arge_cdata.arge_tx_ring_map, From owner-svn-src-head@freebsd.org Fri Oct 30 23:57:21 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A25C3A22672; Fri, 30 Oct 2015 23:57:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BF891159; Fri, 30 Oct 2015 23:57:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UNvKMK013891; Fri, 30 Oct 2015 23:57:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UNvKOS013890; Fri, 30 Oct 2015 23:57:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302357.t9UNvKOS013890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 23:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290216 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 23:57:21 -0000 Author: adrian Date: Fri Oct 30 23:57:20 2015 New Revision: 290216 URL: https://svnweb.freebsd.org/changeset/base/290216 Log: arge: fix barrier macro. Modified: head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Fri Oct 30 23:18:02 2015 (r290215) +++ head/sys/mips/atheros/if_argevar.h Fri Oct 30 23:57:20 2015 (r290216) @@ -93,7 +93,7 @@ ARGE_READ((_sc), (_reg)) #define ARGE_MDIO_BARRIER_READ(_sc) ARGE_BARRIER_READ(_sc) #define ARGE_MDIO_BARRIER_WRITE(_sc) ARGE_BARRIER_WRITE(_sc) -#define ARGE_MDIO_BARRIER_RW(_sc) ARGE_BARRIER_READ_RW(_sc) +#define ARGE_MDIO_BARRIER_RW(_sc) ARGE_BARRIER_RW(_sc) #define ARGE_DESC_EMPTY (1U << 31) #define ARGE_DESC_MORE (1 << 24) From owner-svn-src-head@freebsd.org Fri Oct 30 23:59:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CAEA22704; Fri, 30 Oct 2015 23:59:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8CC61302; Fri, 30 Oct 2015 23:59:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UNxq6u014022; Fri, 30 Oct 2015 23:59:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UNxqJ0014021; Fri, 30 Oct 2015 23:59:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510302359.t9UNxqJ0014021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 30 Oct 2015 23:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290217 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 30 Oct 2015 23:59:54 -0000 Author: adrian Date: Fri Oct 30 23:59:52 2015 New Revision: 290217 URL: https://svnweb.freebsd.org/changeset/base/290217 Log: arge_mdio: fix barriers; correctly check MII indicator register. * use barriers in a slightly better fashion. You can blame this glass of whiskey on putting barriers in the wrong spot. Grr adrian. * steal/rewrite the mdio busy check from ag7100 from openwrt and refactor the existing code out. This is .. more correct. This seems to fix the boot-to-boot variation that I've been seeing and it quietens the switch port status flapping. Tested: * QCA9558 SoC (AP135.) Obtained from: Linux OpenWRT Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 30 23:57:20 2015 (r290216) +++ head/sys/mips/atheros/if_arge.c Fri Oct 30 23:59:52 2015 (r290217) @@ -1067,34 +1067,47 @@ arge_hinted_child(device_t bus, const ch } static int +arge_mdio_busy(struct arge_softc *sc) +{ + int i,result; + + for (i = 0; i < ARGE_MII_TIMEOUT; i++) { + DELAY(5); + ARGE_MDIO_BARRIER_READ(sc); + result = ARGE_MDIO_READ(sc, AR71XX_MAC_MII_INDICATOR); + if (! result) + return (0); + DELAY(5); + } + return (-1); +} + +static int arge_miibus_readreg(device_t dev, int phy, int reg) { struct arge_softc * sc = device_get_softc(dev); - int i, result; + int result; uint32_t addr = (phy << MAC_MII_PHY_ADDR_SHIFT) | (reg & MAC_MII_REG_MASK); mtx_lock(&miibus_mtx); + ARGE_MDIO_BARRIER_RW(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_CMD, MAC_MII_CMD_WRITE); + ARGE_MDIO_BARRIER_WRITE(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_ADDR, addr); + ARGE_MDIO_BARRIER_WRITE(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_CMD, MAC_MII_CMD_READ); - i = ARGE_MII_TIMEOUT; - while ((ARGE_MDIO_READ(sc, AR71XX_MAC_MII_INDICATOR) & - MAC_MII_INDICATOR_BUSY) && (i--)) { - ARGE_MDIO_BARRIER_READ(sc); - DELAY(5); - } - - if (i < 0) { + if (arge_mdio_busy(sc) != 0) { mtx_unlock(&miibus_mtx); ARGEDEBUG(sc, ARGE_DBG_MII, "%s timedout\n", __func__); /* XXX: return ERRNO istead? */ return (-1); } - result = ARGE_MDIO_READ(sc, AR71XX_MAC_MII_STATUS) & MAC_MII_STATUS_MASK; ARGE_MDIO_BARRIER_READ(sc); + result = ARGE_MDIO_READ(sc, AR71XX_MAC_MII_STATUS) & MAC_MII_STATUS_MASK; + ARGE_MDIO_BARRIER_RW(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_CMD, MAC_MII_CMD_WRITE); mtx_unlock(&miibus_mtx); @@ -1109,7 +1122,6 @@ static int arge_miibus_writereg(device_t dev, int phy, int reg, int data) { struct arge_softc * sc = device_get_softc(dev); - int i; uint32_t addr = (phy << MAC_MII_PHY_ADDR_SHIFT) | (reg & MAC_MII_REG_MASK); @@ -1117,24 +1129,20 @@ arge_miibus_writereg(device_t dev, int p phy, reg, data); mtx_lock(&miibus_mtx); + ARGE_MDIO_BARRIER_RW(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_ADDR, addr); + ARGE_MDIO_BARRIER_WRITE(sc); ARGE_MDIO_WRITE(sc, AR71XX_MAC_MII_CONTROL, data); + ARGE_MDIO_BARRIER_WRITE(sc); - i = ARGE_MII_TIMEOUT; - while ((ARGE_MDIO_READ(sc, AR71XX_MAC_MII_INDICATOR) & - MAC_MII_INDICATOR_BUSY) && (i--)) { - ARGE_MDIO_BARRIER_READ(sc); - DELAY(5); - } - - mtx_unlock(&miibus_mtx); - - if (i < 0) { + if (arge_mdio_busy(sc) != 0) { + mtx_unlock(&miibus_mtx); ARGEDEBUG(sc, ARGE_DBG_MII, "%s timedout\n", __func__); /* XXX: return ERRNO istead? */ return (-1); } + mtx_unlock(&miibus_mtx); return (0); } From owner-svn-src-head@freebsd.org Sat Oct 31 00:04:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD606A2284A; Sat, 31 Oct 2015 00:04:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0D3183C; Sat, 31 Oct 2015 00:04:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V04iTr016793; Sat, 31 Oct 2015 00:04:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V04iU0016792; Sat, 31 Oct 2015 00:04:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510310004.t9V04iU0016792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 31 Oct 2015 00:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290218 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 00:04:45 -0000 Author: adrian Date: Sat Oct 31 00:04:44 2015 New Revision: 290218 URL: https://svnweb.freebsd.org/changeset/base/290218 Log: mips74k: use cache-writeback for memory, not writethrough. When I ported this code from netbsd I was .. slightly mips74k greener. I used writethrough because (a) it's what netbsd did, and (b) if I used writethrough then things "didn't work." Fast-forward a couple years, more MIPS hacking and a whole lot more understanding of the bus APIs (the last few commits notwithstanding; it's been a long week, ok?) and I have this working for arge, argemdio, spi and ath. Hans has it working for USB. The ath barrier code will come in a later commit. This gets the routing throughput up from 220mbit -> 337mbit. I'm sure the bridging throughput will be similarly improved. Tested: * QCA955x SoC, routing workload. Modified: head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Fri Oct 30 23:59:52 2015 (r290217) +++ head/sys/mips/include/cpuregs.h Sat Oct 31 00:04:44 2015 (r290218) @@ -151,7 +151,7 @@ #if defined(CPU_MIPS74KC) #define MIPS_CCA_UNCACHED 0x02 -#define MIPS_CCA_CACHED 0x00 +#define MIPS_CCA_CACHED 0x03 #endif #ifndef MIPS_CCA_UNCACHED From owner-svn-src-head@freebsd.org Sat Oct 31 00:17:10 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F305CA22A4D; Sat, 31 Oct 2015 00:17:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (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 B6D511DB5; Sat, 31 Oct 2015 00:17:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igpw7 with SMTP id w7so23107450igp.0; Fri, 30 Oct 2015 17:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=2zIhD26kVKe7wUGNBlMYJCX+LrBE/L4x/rciGH90J5s=; b=SN1bjqzsCERZHgykzQ4+euUcPA6u04JJFlnluMnD1IfCZwsSpHWysnoZgMHREkY31h pU8CdvLgVzvFE6F4CMcx0UfYgf3Ok5d5cfKOXvd95Xw6HA3DMPtkcUGmPmYLHnU8TlSl z608NmI9CNZWFbe95hJWOw0E+WBRYJQinAkjlK6qQXpiNDkvj2y2C//mhUywYVHrNrd7 O+OXJRGR9TLUQjLYo/bQi/Rrx00IDjU7yx6K8WjLcxhz8isow3tX9T6cceddn0XpoBJj Uc2n1zk40BUWWosLpTahxt3GbH/weC6SVkSqQ/U22QSBT5V10NpZs0WRheZi+b/iqXWl 4dHg== MIME-Version: 1.0 X-Received: by 10.50.155.41 with SMTP id vt9mr1031961igb.22.1446250628910; Fri, 30 Oct 2015 17:17:08 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.46.66 with HTTP; Fri, 30 Oct 2015 17:17:08 -0700 (PDT) In-Reply-To: <201510310004.t9V04iU0016792@repo.freebsd.org> References: <201510310004.t9V04iU0016792@repo.freebsd.org> Date: Fri, 30 Oct 2015 17:17:08 -0700 X-Google-Sender-Auth: 21OiJE1Yn7ir8W-misqqKuOdoow Message-ID: Subject: Re: svn commit: r290218 - head/sys/mips/include From: Adrian Chadd To: "src-committers@freebsd.org" , "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.20 Precedence: list List-Id: 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, 31 Oct 2015 00:17:10 -0000 .. bridging is now up to 720mbit. When I started all of this poking the bridging performance on the QCA9558 SoC was 120mbit from arge0->arge1. ... and I think i'm done. Please report bugs. -adrian From owner-svn-src-head@freebsd.org Sat Oct 31 00:29:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB284A22CB7; Sat, 31 Oct 2015 00:29:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8284814C7; Sat, 31 Oct 2015 00:29:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V0TQxB023041; Sat, 31 Oct 2015 00:29:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V0TQRM023040; Sat, 31 Oct 2015 00:29:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510310029.t9V0TQRM023040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 31 Oct 2015 00:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290219 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 00:29:27 -0000 Author: adrian Date: Sat Oct 31 00:29:26 2015 New Revision: 290219 URL: https://svnweb.freebsd.org/changeset/base/290219 Log: mips: do mips_sync() on sync operations to uncachable memory. mips24k/mips74k document that we need an explicit SYNC so to order things correctly, even with access to uncachable memory. We were doing calls to SYNC in the cache ops (inv, wbinv) but we weren't doing it for uncachable memory. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Sat Oct 31 00:04:44 2015 (r290218) +++ head/sys/mips/mips/busdma_machdep.c Sat Oct 31 00:29:26 2015 (r290219) @@ -1220,11 +1220,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (STAILQ_FIRST(&map->bpages)) _bus_dmamap_sync_bp(dmat, map, op); - if (dmat->flags & BUS_DMA_COHERENT) - return; - - if (map->flags & DMAMAP_UNCACHEABLE) + if ((dmat->flags & BUS_DMA_COHERENT) || + (map->flags & DMAMAP_UNCACHEABLE)) { + if (op & BUS_DMASYNC_PREWRITE) + mips_sync(); return; + } aligned = (map->flags & DMAMAP_CACHE_ALIGNED) ? 1 : 0; From owner-svn-src-head@freebsd.org Sat Oct 31 00:31:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE5DA22D40; Sat, 31 Oct 2015 00:31:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::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 4A7A3180E; Sat, 31 Oct 2015 00:31:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbdj2 with SMTP id dj2so21976053igb.1; Fri, 30 Oct 2015 17:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=pJjyqe/YX4NOxdSe7JzwiqYd/PX8DAOcmC+Iq5CK2MQ=; b=tzDCE0iWEMN7gMxl9nI/WlGEBKikIxbaQ6/RVPlrD0Wr8E4NFm/mKkJeeSMYOshHZT YP14+D9jupS5uCU4FctHQyqEUocAsfVPM5VVHLrvgL2DPZTA7xBafC4sUKS/t2tucYzF Zo+ahm9LcbbcGYw3HP/Mq6+2JHHwTv/u6bQ2YmHZ6lW8sYBMwyj+rqHXC/vrghT3XoW4 Q/Q0TYEqUMVO4rhLyj780QQ93etQmU1pyJYYDuPZjqmG/fXX5iTwOJ794PeXYpvbVl9h /K7rN4RPYu4yG4hAahFL/5D9PZg+Dc+JgrhliIZvdqjPhE+nn7S8U6jR2dot7Bx5hQDE erPA== MIME-Version: 1.0 X-Received: by 10.50.178.141 with SMTP id cy13mr999582igc.61.1446251497726; Fri, 30 Oct 2015 17:31:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.46.66 with HTTP; Fri, 30 Oct 2015 17:31:37 -0700 (PDT) In-Reply-To: <201510310029.t9V0TQRM023040@repo.freebsd.org> References: <201510310029.t9V0TQRM023040@repo.freebsd.org> Date: Fri, 30 Oct 2015 17:31:37 -0700 X-Google-Sender-Auth: RgTIAMYT_X3G29LgJ6S-t0f1LPI Message-ID: Subject: Re: svn commit: r290219 - head/sys/mips/mips From: Adrian Chadd To: "src-committers@freebsd.org" , "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.20 Precedence: list List-Id: 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, 31 Oct 2015 00:31:38 -0000 patch from: ian sorry ian! -a On 30 October 2015 at 17:29, Adrian Chadd wrote: > Author: adrian > Date: Sat Oct 31 00:29:26 2015 > New Revision: 290219 > URL: https://svnweb.freebsd.org/changeset/base/290219 > > Log: > mips: do mips_sync() on sync operations to uncachable memory. > > mips24k/mips74k document that we need an explicit SYNC so to order > things correctly, even with access to uncachable memory. > We were doing calls to SYNC in the cache ops (inv, wbinv) but we > weren't doing it for uncachable memory. > > Modified: > head/sys/mips/mips/busdma_machdep.c > > Modified: head/sys/mips/mips/busdma_machdep.c > ============================================================================== > --- head/sys/mips/mips/busdma_machdep.c Sat Oct 31 00:04:44 2015 (r290218) > +++ head/sys/mips/mips/busdma_machdep.c Sat Oct 31 00:29:26 2015 (r290219) > @@ -1220,11 +1220,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus > if (STAILQ_FIRST(&map->bpages)) > _bus_dmamap_sync_bp(dmat, map, op); > > - if (dmat->flags & BUS_DMA_COHERENT) > - return; > - > - if (map->flags & DMAMAP_UNCACHEABLE) > + if ((dmat->flags & BUS_DMA_COHERENT) || > + (map->flags & DMAMAP_UNCACHEABLE)) { > + if (op & BUS_DMASYNC_PREWRITE) > + mips_sync(); > return; > + } > > aligned = (map->flags & DMAMAP_CACHE_ALIGNED) ? 1 : 0; > > From owner-svn-src-head@freebsd.org Sat Oct 31 02:08:47 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D4EA21251; Sat, 31 Oct 2015 02:08:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 C46BB19C6; Sat, 31 Oct 2015 02:08:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V27UhG051753; Sat, 31 Oct 2015 02:07:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V27U7U051752; Sat, 31 Oct 2015 02:07:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510310207.t9V27U7U051752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 31 Oct 2015 02:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290220 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 02:08:47 -0000 Author: bdrewery Date: Sat Oct 31 02:07:30 2015 New Revision: 290220 URL: https://svnweb.freebsd.org/changeset/base/290220 Log: Don't hide stderr when checking ${CC} --version. This can have important debugging information such as 'cc: not found' or 'ccache: error: Could not find compiler "cc" in PATH'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sat Oct 31 00:29:26 2015 (r290219) +++ head/share/mk/bsd.compiler.mk Sat Oct 31 02:07:30 2015 (r290220) @@ -52,7 +52,7 @@ ${var}= ${${var}.${_cc_hash}} COMPILER_TYPE= none COMPILER_VERSION= 0 .elif !defined(COMPILER_TYPE) || !defined(COMPILER_VERSION) -_v!= ${CC} --version 2>/dev/null || echo 0.0.0 +_v!= ${CC} --version || echo 0.0.0 .if !defined(COMPILER_TYPE) . if ${CC:T:M*gcc*} From owner-svn-src-head@freebsd.org Sat Oct 31 02:09:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2CFA212A5; Sat, 31 Oct 2015 02:09:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 794F01B19; Sat, 31 Oct 2015 02:09:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V28dgO051811; Sat, 31 Oct 2015 02:08:39 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V28dIh051810; Sat, 31 Oct 2015 02:08:39 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201510310208.t9V28dIh051810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 31 Oct 2015 02:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290221 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 02:09:55 -0000 Author: jhibbits Date: Sat Oct 31 02:08:39 2015 New Revision: 290221 URL: https://svnweb.freebsd.org/changeset/base/290221 Log: Print unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc. Sponsored by: Alex Perez/Intertial Computing Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:07:30 2015 (r290220) +++ head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:08:39 2015 (r290221) @@ -176,12 +176,12 @@ cpu_startup(void *dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), + printf("real memory = %lu (%lu MB)\n", ptoa(physmem), ptoa(physmem) / 1048576); realmem = physmem; if (bootverbose) - printf("available KVA = %zd (%zd MB)\n", + printf("available KVA = %zu (%zu MB)\n", virtual_end - virtual_avail, (virtual_end - virtual_avail) / 1048576); @@ -199,7 +199,7 @@ cpu_startup(void *dummy) #ifdef __powerpc64__ printf("0x%016lx - 0x%016lx, %ld bytes (%ld pages)\n", #else - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", + printf("0x%08x - 0x%08x, %u bytes (%lu pages)\n", #endif phys_avail[indx], phys_avail[indx + 1] - 1, size1, size1 / PAGE_SIZE); @@ -208,7 +208,7 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ld (%ld MB)\n", ptoa(vm_cnt.v_free_count), + printf("avail memory = %lu (%lu MB)\n", ptoa(vm_cnt.v_free_count), ptoa(vm_cnt.v_free_count) / 1048576); /* From owner-svn-src-head@freebsd.org Sat Oct 31 02:18:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12699A214FE; Sat, 31 Oct 2015 02:18:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (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 BC8DA1EFA; Sat, 31 Oct 2015 02:18:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by qkdl128 with SMTP id l128so12926083qkd.0; Fri, 30 Oct 2015 19:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mJ7nqpYGEts/Og/cC1m8iAIeiwNLs6d94uARkmH5byg=; b=oDIfUbQEQ7iX8rBTJRwgI2nC3DMflwBBkffPCKDCmSqzBMh10ZDRUIHrjU1lpS81K9 vsA4NK1wBFDU0B9nzxXM2i+uMesZdSCw/48Kc9d4X7IaEho2jZ7BTmjhe2X4yj/wOb3o gY+B5HC01h0jVi3yIsqfT6RUT5twTMU9pW6I8XfB2NCi0YvJgp/8EkiT8hB7gr3NpyJ/ I0e90igWxGsLJOIbhG6LRYdQAUT3Jgq9nM9V1jH8GhWp1sWN/tW1DK2KNc/RtIeQtC2M MZACiRCRBtSN6YoB07i49wp9wN6XREDK8SK6xwPPxVfgLlIYj9vZxxEXscu7S6tDlR1k xAfA== MIME-Version: 1.0 X-Received: by 10.55.72.85 with SMTP id v82mr14897003qka.3.1446257881910; Fri, 30 Oct 2015 19:18:01 -0700 (PDT) Received: by 10.140.88.209 with HTTP; Fri, 30 Oct 2015 19:18:01 -0700 (PDT) In-Reply-To: <201510310207.t9V27U7U051752@repo.freebsd.org> References: <201510310207.t9V27U7U051752@repo.freebsd.org> Date: Fri, 30 Oct 2015 19:18:01 -0700 Message-ID: Subject: Re: svn commit: r290220 - head/share/mk From: NGie Cooper To: Bryan Drewery Cc: "src-committers@freebsd.org" , "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.20 Precedence: list List-Id: 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, 31 Oct 2015 02:18:03 -0000 On Fri, Oct 30, 2015 at 7:07 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Sat Oct 31 02:07:30 2015 > New Revision: 290220 > URL: https://svnweb.freebsd.org/changeset/base/290220 > > Log: > Don't hide stderr when checking ${CC} --version. > > This can have important debugging information such as 'cc: not found' or > 'ccache: error: Could not find compiler "cc" in PATH'. Won't this spam installworld/distribution a lot? From owner-svn-src-head@freebsd.org Sat Oct 31 02:27:37 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFB4DA2173A; Sat, 31 Oct 2015 02:27:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-x22c.google.com (mail-yk0-x22c.google.com [IPv6:2607:f8b0:4002:c07::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 A939212FE; Sat, 31 Oct 2015 02:27:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by ykek133 with SMTP id k133so94240341yke.2; Fri, 30 Oct 2015 19:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2p4/N8MI9Vze+8PSgv/ePdVXwe9WUqpgLgVbzqeRKzg=; b=uuR2CpGjEw/xHO4QlUiiEgVZhwSKoxrHfDOMnjYuUnnEl7K+JOecUeEMicPey1M1QH OtYTdZqfimpbKL2flbfQPpCt6tmB/UTMtDpbCE+U4Ckpjml2/7/0vldGvA1Ln35ft3l2 p+f+SDaSw6zL/4hN8io5IP1NNtZpMU0G4uUcJ8um+Q4LTLxEjxFdbE6pn23B3vQRy8AU +gPcOROgICaOrco3KnhaUIj8vouC8mGnLu8182Rm1qoyi0i+i47E18MRvfg4OmIxjNt5 hHZEUx5e2PYeYpoHIp5BN/HNgN6koFava+qOEmo/CZKTPshBl2EIiuzaTyu8pmZNgUL4 pwAA== MIME-Version: 1.0 X-Received: by 10.129.88.87 with SMTP id m84mr8619142ywb.73.1446258455851; Fri, 30 Oct 2015 19:27:35 -0700 (PDT) Received: by 10.37.97.76 with HTTP; Fri, 30 Oct 2015 19:27:35 -0700 (PDT) In-Reply-To: <201510310208.t9V28dIh051810@repo.freebsd.org> References: <201510310208.t9V28dIh051810@repo.freebsd.org> Date: Fri, 30 Oct 2015 19:27:35 -0700 Message-ID: Subject: Re: svn commit: r290221 - head/sys/powerpc/powerpc From: Conrad Meyer To: Justin Hibbits Cc: src-committers@freebsd.org, 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.20 Precedence: list List-Id: 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, 31 Oct 2015 02:27:37 -0000 Comments inline. On Fri, Oct 30, 2015 at 7:08 PM, Justin Hibbits wrote: > Author: jhibbits > Date: Sat Oct 31 02:08:39 2015 > New Revision: 290221 > URL: https://svnweb.freebsd.org/changeset/base/290221 > > Log: > Print unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc. >... > ============================================================================== > --- head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:07:30 2015 (r290220) > +++ head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:08:39 2015 (r290221) > @@ -176,12 +176,12 @@ cpu_startup(void *dummy) > #ifdef PERFMON > perfmon_init(); > #endif > - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), > + printf("real memory = %lu (%lu MB)\n", ptoa(physmem), > ptoa(physmem) / 1048576); Shouldn't this be "real memory = %ju (%lu MB)\n" and (uintmax_t)ptoa(physmem), or it may overflow on >4GB RAM systems? > realmem = physmem; > > if (bootverbose) > - printf("available KVA = %zd (%zd MB)\n", > + printf("available KVA = %zu (%zu MB)\n", > virtual_end - virtual_avail, > (virtual_end - virtual_avail) / 1048576); > > @@ -199,7 +199,7 @@ cpu_startup(void *dummy) > #ifdef __powerpc64__ > printf("0x%016lx - 0x%016lx, %ld bytes (%ld pages)\n", > #else > - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", > + printf("0x%08x - 0x%08x, %u bytes (%lu pages)\n", It seems wrong that bytes is only %u here and pages is a %lu. I think bytes should probably be %ju too? What is the type of size1? > #endif > phys_avail[indx], phys_avail[indx + 1] - 1, size1, > size1 / PAGE_SIZE); > @@ -208,7 +208,7 @@ cpu_startup(void *dummy) > > vm_ksubmap_init(&kmi); > > - printf("avail memory = %ld (%ld MB)\n", ptoa(vm_cnt.v_free_count), > + printf("avail memory = %lu (%lu MB)\n", ptoa(vm_cnt.v_free_count), > ptoa(vm_cnt.v_free_count) / 1048576); Same as with the first printf. Best, Conrad From owner-svn-src-head@freebsd.org Sat Oct 31 02:40:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F4E3A21A4F; Sat, 31 Oct 2015 02:40:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 5F07E19ED; Sat, 31 Oct 2015 02:40:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by ioll68 with SMTP id l68so98638997iol.3; Fri, 30 Oct 2015 19:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references; bh=SkDZYFSsJmYsSZSs5SUsTiXFDK7GF3HBpL5pSZ+3i6U=; b=neFoYzO+meYC1FMbhm3LVDX6FXH8PzDZl3GpGPb6ntf3NTf5OWcE9olg4jE3bx9cWW BsXDkP8YXPl5r05UTwitlrejTJDaZ+OFYcv2Lh5ohI1eqO+B5RzBn2krOGLl97MLrAyk YilohFN5bQIhnHRRNAG/e0FeZ4HVdAQ7D65lcOTMokX94enPU/DtTc6EKEdrJ6l4wQv2 T9Pj8IiTgJoRkqqJoKFytGgHFcjaW1wZMTbc4Nr3Dl6nRgGkt+w5dgVGDQFy7U/Lc4PV WheL/fvROYL1yKxKk0tBkLxzusysjePFF1i6xIU0LGmIpuL71yUHHkQ3gLoBZFO/qti/ /ODg== X-Received: by 10.107.47.24 with SMTP id j24mr12728222ioo.168.1446259201843; Fri, 30 Oct 2015 19:40:01 -0700 (PDT) Received: from blackstar.knownspace (c-98-240-160-157.hsd1.mn.comcast.net. [98.240.160.157]) by smtp.gmail.com with ESMTPSA id rj10sm1955396igc.20.2015.10.30.19.40.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 30 Oct 2015 19:40:00 -0700 (PDT) Sender: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <39CCA88E-6D59-4F09-B054-DF765B8C9708@freebsd.org> From: Justin Hibbits To: Conrad Meyer In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r290221 - head/sys/powerpc/powerpc Date: Fri, 30 Oct 2015 21:41:32 -0500 References: <201510310208.t9V28dIh051810@repo.freebsd.org> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 02:40:02 -0000 On Oct 30, 2015, at 9:27 PM, Conrad Meyer wrote: > Comments inline. > > On Fri, Oct 30, 2015 at 7:08 PM, Justin Hibbits > wrote: >> Author: jhibbits >> Date: Sat Oct 31 02:08:39 2015 >> New Revision: 290221 >> URL: https://svnweb.freebsd.org/changeset/base/290221 >> >> Log: >> Print unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc. >> ... >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:07:30 >> 2015 (r290220) >> +++ head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:08:39 >> 2015 (r290221) >> @@ -176,12 +176,12 @@ cpu_startup(void *dummy) >> #ifdef PERFMON >> perfmon_init(); >> #endif >> - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), >> + printf("real memory = %lu (%lu MB)\n", ptoa(physmem), >> ptoa(physmem) / 1048576); > > Shouldn't this be "real memory = %ju (%lu MB)\n" and > (uintmax_t)ptoa(physmem), or it may overflow on >4GB RAM systems? Yes, it should, and it will. However, currently ptoa() casts to unsigned long, and I didn't want to change that yet (I will eventually). In fact, the machine I'm testing on has 8GB, which I've had to artificially limit to <4GB because of the various memory accounting size limits. > >> realmem = physmem; >> >> if (bootverbose) >> - printf("available KVA = %zd (%zd MB)\n", >> + printf("available KVA = %zu (%zu MB)\n", >> virtual_end - virtual_avail, >> (virtual_end - virtual_avail) / 1048576); >> >> @@ -199,7 +199,7 @@ cpu_startup(void *dummy) >> #ifdef __powerpc64__ >> printf("0x%016lx - 0x%016lx, %ld bytes (%ld >> pages)\n", >> #else >> - printf("0x%08x - 0x%08x, %d bytes (%ld >> pages)\n", >> + printf("0x%08x - 0x%08x, %u bytes (%lu >> pages)\n", > > It seems wrong that bytes is only %u here and pages is a %lu. I think > bytes should probably be %ju too? What is the type of size1? You're right. It should be long. However, it's 6-of-one in this case, since on powerpc (32-bit) sizeof(long) == sizeof(int), so it doesn't matter too much yet. size1 is a vm_offset_t, which is 32-bits in this case. phys_avail[] is also an array of vm_offset_t's, and I intend to change it to vm_paddr_t, and cast to uintmax_t for printf purposes, but again, that's longer term (a lot of the powerpc bootup needs a cleanup, anyway). > >> #endif >> phys_avail[indx], phys_avail[indx + 1] - >> 1, size1, >> size1 / PAGE_SIZE); >> @@ -208,7 +208,7 @@ cpu_startup(void *dummy) >> >> vm_ksubmap_init(&kmi); >> >> - printf("avail memory = %ld (%ld MB)\n", >> ptoa(vm_cnt.v_free_count), >> + printf("avail memory = %lu (%lu MB)\n", >> ptoa(vm_cnt.v_free_count), >> ptoa(vm_cnt.v_free_count) / 1048576); > > Same as with the first printf. See above. It's on my list, I just wanted something cleaner for now. > > Best, > Conrad - Justin From owner-svn-src-head@freebsd.org Sat Oct 31 03:30:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88B2AA21529; Sat, 31 Oct 2015 03:30:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4E81CF0; Sat, 31 Oct 2015 03:30:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6699F19DA; Sat, 31 Oct 2015 03:30:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 18F4C10ABA; Sat, 31 Oct 2015 03:30:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id hY3CBVCcVdbk; Sat, 31 Oct 2015 03:30:42 +0000 (UTC) From: Bryan Drewery DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C034810AB5 Subject: Re: svn commit: r290220 - head/share/mk To: NGie Cooper References: <201510310207.t9V27U7U051752@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <563435E1.9020108@FreeBSD.org> Date: Fri, 30 Oct 2015 20:30:41 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2kEN6fkPLOFgMUqFHgBdQc80aivE19HqV" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 03:30:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2kEN6fkPLOFgMUqFHgBdQc80aivE19HqV Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable > On Oct 30, 2015, at 19:18, NGie Cooper wrote: >=20 >> On Fri, Oct 30, 2015 at 7:07 PM, Bryan Drewery = wrote: >> Author: bdrewery >> Date: Sat Oct 31 02:07:30 2015 >> New Revision: 290220 >> URL: https://svnweb.freebsd.org/changeset/base/290220 >>=20 >> Log: >> Don't hide stderr when checking ${CC} --version. >>=20 >> This can have important debugging information such as 'cc: not found'= or >> 'ccache: error: Could not find compiler "cc" in PATH'. >=20 > Won't this spam installworld/distribution a lot? Not for me. What do you expect from stderr that is non-fatal? The only cases I've had so far resulted in the .error triggering later due to not being able to determine compiler type. Also, install depending on the compiler type is wrong. We need to eliminate the cases where it determines SUBDIR or FILES to fix this. I'd like to effectively set CC=3Dfalse during install but can't while those checks exist. Bryan --2kEN6fkPLOFgMUqFHgBdQc80aivE19HqV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWNDXhAAoJEDXXcbtuRpfPDBYIALZOGPQlXGw9txvsdpt2ESOW jUdPZfmvHYtXR3tET5KOwZEYhR46DbUf+2ucmhQKGh3Y8ZxRBTcaOrasFiWqm7KP ZPUIxYkirkMDiyrNEVzvGhWy/CznYX70XwaxBxx8kqWGfcbZI+oAN2AlM0jdVV4I rNms6T2PFZLvDT6nPlu8KvhpEAM7ck4YO/mspYm9/hGwO3yPB0T4TdsxsM+nvysW 3WAIffA5CxvCeGRpVAvnZNbq4DN4k3Kc3E6sRuJGDWziRFsdBrKBv1jIrfuyH2WF hR2KDV6mupQvF6OHhmBkU24kc9KIBCs31O3Tw2n868sBJ38MWa3M8Nu0Nl1bdhk= =6dff -----END PGP SIGNATURE----- --2kEN6fkPLOFgMUqFHgBdQc80aivE19HqV-- From owner-svn-src-head@freebsd.org Sat Oct 31 03:32:25 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD4AA21695; Sat, 31 Oct 2015 03:32:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CFA261EBD; Sat, 31 Oct 2015 03:32:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C7C9D1A52; Sat, 31 Oct 2015 03:32:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6C35710AD2; Sat, 31 Oct 2015 03:32:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 5rNReA8HNt-S; Sat, 31 Oct 2015 03:32:20 +0000 (UTC) Subject: Re: svn commit: r290220 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 00C5C10AC3 To: NGie Cooper References: <201510310207.t9V27U7U051752@repo.freebsd.org> <563435E1.9020108@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56343647.7000306@FreeBSD.org> Date: Fri, 30 Oct 2015 20:32:23 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <563435E1.9020108@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SsTCxFBOI3u2A4DEGLq0a3vnf5LNW3cOO" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 03:32:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SsTCxFBOI3u2A4DEGLq0a3vnf5LNW3cOO Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/30/2015 8:30 PM, Bryan Drewery wrote: >=20 >=20 >> On Oct 30, 2015, at 19:18, NGie Cooper wrote: >> >>> On Fri, Oct 30, 2015 at 7:07 PM, Bryan Drewery = wrote: >>> Author: bdrewery >>> Date: Sat Oct 31 02:07:30 2015 >>> New Revision: 290220 >>> URL: https://svnweb.freebsd.org/changeset/base/290220 >>> >>> Log: >>> Don't hide stderr when checking ${CC} --version. >>> >>> This can have important debugging information such as 'cc: not found= ' or >>> 'ccache: error: Could not find compiler "cc" in PATH'. >> >> Won't this spam installworld/distribution a lot? >=20 > Not for me. >=20 > What do you expect from stderr that is non-fatal? The only cases I've > had so far resulted in the .error triggering later due to not being abl= e > to determine compiler type. >=20 > Also, install depending on the compiler type is wrong. We need to > eliminate the cases where it determines SUBDIR or FILES to fix this. I'= d > like to effectively set CC=3Dfalse during install but can't while those= > checks exist. >=20 Setting CC=3Dfalse would cause the warnings, but that's a symptom of the larger problem I mentioned about even using bsd.compiler.mk in install. --=20 Regards, Bryan Drewery --SsTCxFBOI3u2A4DEGLq0a3vnf5LNW3cOO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWNDZHAAoJEDXXcbtuRpfPIFYH/2wGg064z+2mfnluoh32C88y oOL/iJI35Eo2mysVSm9xdkTUtHx/Zvbx7F0yYM1gL6xIyxNYDkywmqDKgA5VXSxY 0fCSn62SjcRTU5222sY7s86NWYqxwwpijvqTwLbLgbeDPASsc7iMl0sCQD+y+r5V 7RrkuQmY5HVmfBis9aprOIxK31Chf9NT8X9xzaH/lecMmVn2Q4iB9NQ3dMdkdxBp rcAJyLkwoosPi6kXtrtFWY39NBFC39O/poxQd0VYrFAKVTgq8k6UEZ4enoxwTYMO g8iel00Y/UvZ6KXcvwLkWfxPFfzDhT0wulcNm9q4yKSWcB8ttG1FEwS7NzOsQQ4= =Dxd/ -----END PGP SIGNATURE----- --SsTCxFBOI3u2A4DEGLq0a3vnf5LNW3cOO-- From owner-svn-src-head@freebsd.org Sat Oct 31 03:51:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B20DA218FA; Sat, 31 Oct 2015 03:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1FF1714DD; Sat, 31 Oct 2015 03:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 183A01E1D; Sat, 31 Oct 2015 03:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B7E8610AF6; Sat, 31 Oct 2015 03:51:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id I3b-KhcF3ZYB; Sat, 31 Oct 2015 03:51:04 +0000 (UTC) Subject: Re: svn commit: r290220 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DA20510AEE To: NGie Cooper References: <201510310207.t9V27U7U051752@repo.freebsd.org> <563435E1.9020108@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56343AAB.7000105@FreeBSD.org> Date: Fri, 30 Oct 2015 20:51:07 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <563435E1.9020108@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ELRiFOWpRiFmekgQBp0eGo5NRHNo2sknB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 03:51:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ELRiFOWpRiFmekgQBp0eGo5NRHNo2sknB Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/30/2015 8:30 PM, Bryan Drewery wrote: >=20 >=20 >> On Oct 30, 2015, at 19:18, NGie Cooper wrote: >> >>> On Fri, Oct 30, 2015 at 7:07 PM, Bryan Drewery = wrote: >>> Author: bdrewery >>> Date: Sat Oct 31 02:07:30 2015 >>> New Revision: 290220 >>> URL: https://svnweb.freebsd.org/changeset/base/290220 >>> >>> Log: >>> Don't hide stderr when checking ${CC} --version. >>> >>> This can have important debugging information such as 'cc: not found= ' or >>> 'ccache: error: Could not find compiler "cc" in PATH'. >> >> Won't this spam installworld/distribution a lot? >=20 > Not for me. >=20 > What do you expect from stderr that is non-fatal? The only cases I've > had so far resulted in the .error triggering later due to not being abl= e > to determine compiler type. >=20 I missed that it was added to avoid spam in ports though. I'm looking into fixing that better. --=20 Regards, Bryan Drewery --ELRiFOWpRiFmekgQBp0eGo5NRHNo2sknB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWNDqrAAoJEDXXcbtuRpfPzrQH/R14VpQcc+Aqn9owkW4vTNmd mG5FSIS/lrQGwxkzGr5J7roT8DJalB4mag9m5PsnSQqwPaQ0TLPHq+yCjcMOenrU nywkMtUQn6y2yuv90tR69vEvd1G9AWuvMQ22g/b69X11VvaUN6vQsJdINYGoMn9W CwFzg2mpQITPmvEEBCa17xGgHhRA7brTvdsZTW48ABR0A/yuQOU1Jm+HU94uIRLy cGBYijMuRmI0GFlgvQFWc+s/e0pNtFswyPIShmNKAiDznMuZu/Tj8HrPdDVjCFvV antVqoomGqQXCD1eYEXfeyZTKFAPrV56T32Ogmg7X2+DIF9eSWjE0ur1rjpJwOc= =kMpT -----END PGP SIGNATURE----- --ELRiFOWpRiFmekgQBp0eGo5NRHNo2sknB-- From owner-svn-src-head@freebsd.org Sat Oct 31 03:54:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54FF1A21A7D; Sat, 31 Oct 2015 03:54:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA7F1820; Sat, 31 Oct 2015 03:54:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 339E31E99; Sat, 31 Oct 2015 03:54:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CBC7810B01; Sat, 31 Oct 2015 03:54:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id tvcggRgovE4Q; Sat, 31 Oct 2015 03:54:32 +0000 (UTC) Subject: Re: svn commit: r290220 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8804210AF8 To: NGie Cooper References: <201510310207.t9V27U7U051752@repo.freebsd.org> <563435E1.9020108@FreeBSD.org> <56343AAB.7000105@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56343B7A.4090201@FreeBSD.org> Date: Fri, 30 Oct 2015 20:54:34 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56343AAB.7000105@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlgLaRLTcPXAOBUJpPp2sTVw1jWBFjqPD" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 03:54:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UlgLaRLTcPXAOBUJpPp2sTVw1jWBFjqPD Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/30/2015 8:51 PM, Bryan Drewery wrote: > On 10/30/2015 8:30 PM, Bryan Drewery wrote: >> >> >>> On Oct 30, 2015, at 19:18, NGie Cooper wrote:= >>> >>>> On Fri, Oct 30, 2015 at 7:07 PM, Bryan Drewery wrote: >>>> Author: bdrewery >>>> Date: Sat Oct 31 02:07:30 2015 >>>> New Revision: 290220 >>>> URL: https://svnweb.freebsd.org/changeset/base/290220 >>>> >>>> Log: >>>> Don't hide stderr when checking ${CC} --version. >>>> >>>> This can have important debugging information such as 'cc: not foun= d' or >>>> 'ccache: error: Could not find compiler "cc" in PATH'. >>> >>> Won't this spam installworld/distribution a lot? >> >> Not for me. >> >> What do you expect from stderr that is non-fatal? The only cases I've >> had so far resulted in the .error triggering later due to not being ab= le >> to determine compiler type. >> >=20 > I missed that it was added to avoid spam in ports though. I'm looking > into fixing that better. >=20 >=20 It's already been fixed in r288911 which prevented bsd.compiler.mk from getting pulled into ports. --=20 Regards, Bryan Drewery --UlgLaRLTcPXAOBUJpPp2sTVw1jWBFjqPD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWNDt6AAoJEDXXcbtuRpfPLsYH/joggQCE+0rg+yRA2kPCghlN fo/bmk1G3AET9hkVYWL+sGpCEz2u65/BJo4A9DCMWYPP3LKdHL4AjK/WX1wmCFWr 6TEl6YU9yEeKsGklbsYuBrLyPlH+Xe64LJVtKrSQl3gVeejLLB6hqXC20HyKL9Lg nf2TzRdP6A+3rP+vQndjzSAODutOzNXbkhfF1K8izt+662LpV08iJplPJjLqkhq1 JLuf2kAyGMsFEagpgtZvO0ndGcfVlR3x1v1Mocdj6ONYu9YLXxlabY1UL9bCPnEs 3qVmn4AH3nzvGyYIB2U71kNcRnVPYfSvsmcRQXQn+tUYBWExke0OlrgMCk2pzWA= =Tiib -----END PGP SIGNATURE----- --UlgLaRLTcPXAOBUJpPp2sTVw1jWBFjqPD-- From owner-svn-src-head@freebsd.org Sat Oct 31 04:39:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43635A2224D; Sat, 31 Oct 2015 04:39:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040181C69; Sat, 31 Oct 2015 04:39:29 +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 t9V4dTYo095684; Sat, 31 Oct 2015 04:39:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V4dSEO095679; Sat, 31 Oct 2015 04:39:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201510310439.t9V4dSEO095679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 31 Oct 2015 04:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290222 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 04:39:30 -0000 Author: imp Date: Sat Oct 31 04:39:28 2015 New Revision: 290222 URL: https://svnweb.freebsd.org/changeset/base/290222 Log: Move all the paths into a new path.h to centralize them. Added: head/libexec/rtld-elf/paths.h (contents, props changed) Modified: head/libexec/rtld-elf/libmap.c head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Sat Oct 31 02:08:39 2015 (r290221) +++ head/libexec/rtld-elf/libmap.c Sat Oct 31 04:39:28 2015 (r290222) @@ -16,15 +16,7 @@ #include "debug.h" #include "rtld.h" #include "libmap.h" - -#ifndef _PATH_LIBMAP_CONF -#define _PATH_LIBMAP_CONF "/etc/libmap.conf" -#endif - -#ifdef COMPAT_32BIT -#undef _PATH_LIBMAP_CONF -#define _PATH_LIBMAP_CONF "/etc/libmap32.conf" -#endif +#include "paths.h" TAILQ_HEAD(lm_list, lm); struct lm { Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Sat Oct 31 02:08:39 2015 (r290221) +++ head/libexec/rtld-elf/malloc.c Sat Oct 31 04:39:28 2015 (r290222) @@ -45,7 +45,6 @@ static char *rcsid = "$FreeBSD$"; #include #include -#include #include #include #include Added: head/libexec/rtld-elf/paths.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/paths.h Sat Oct 31 04:39:28 2015 (r290222) @@ -0,0 +1,64 @@ +/*- + * Copyright 1996, 1997, 1998, 1999, 2000 John D. Polstra. + * Copyright 2003 Alexander Kabaev . + * Copyright 2009-2012 Konstantin Belousov . + * Copyright 2012 John Marino . + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef PATHS_H +#define PATHS_H + +#undef _PATH_ELF_HINTS + +#ifdef COMPAT_32BIT +#define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" +#define _PATH_LIBMAP_CONF "/etc/libmap32.conf" +#define _PATH_RTLD "/libexec/ld-elf32.so.1" +#define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" +#define LD_ "LD_32_" +#endif + +#ifndef _PATH_ELF_HINTS +#define _PATH_ELF_HINTS "/var/run/ld-elf.so.hints" +#endif + +#ifndef _PATH_LIBMAP_CONF +#define _PATH_LIBMAP_CONF "/etc/libmap.conf" +#endif + +#ifndef _PATH_RTLD +#define _PATH_RTLD "/libexec/ld-elf.so.1" +#endif + +#ifndef STANDARD_LIBRARY_PATH +#define STANDARD_LIBRARY_PATH "/lib:/usr/lib" +#endif + +#ifndef LD_ +#define LD_ "LD_" +#endif + +#endif /* PATHS_H */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Oct 31 02:08:39 2015 (r290221) +++ head/libexec/rtld-elf/rtld.c Sat Oct 31 04:39:28 2015 (r290222) @@ -56,16 +56,11 @@ #include "debug.h" #include "rtld.h" #include "libmap.h" +#include "paths.h" #include "rtld_tls.h" #include "rtld_printf.h" #include "notes.h" -#ifndef COMPAT_32BIT -#define PATH_RTLD "/libexec/ld-elf.so.1" -#else -#define PATH_RTLD "/libexec/ld-elf32.so.1" -#endif - /* Types. */ typedef void (*func_ptr_type)(); typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); @@ -1892,7 +1887,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * digest_dynamic2(&obj_rtld, dyn_rpath, dyn_soname, dyn_runpath); /* Replace the path with a dynamically allocated copy. */ - obj_rtld.path = xstrdup(PATH_RTLD); + obj_rtld.path = xstrdup(_PATH_RTLD); r_debug.r_brk = r_debug_state; r_debug.r_state = RT_CONSISTENT; Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Sat Oct 31 02:08:39 2015 (r290221) +++ head/libexec/rtld-elf/rtld.h Sat Oct 31 04:39:28 2015 (r290222) @@ -41,22 +41,6 @@ #include "rtld_lock.h" #include "rtld_machdep.h" -#ifdef COMPAT_32BIT -#undef STANDARD_LIBRARY_PATH -#undef _PATH_ELF_HINTS -#define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" -/* For running 32 bit binaries */ -#define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" -#define LD_ "LD_32_" -#endif - -#ifndef STANDARD_LIBRARY_PATH -#define STANDARD_LIBRARY_PATH "/lib:/usr/lib" -#endif -#ifndef LD_ -#define LD_ "LD_" -#endif - #define NEW(type) ((type *) xmalloc(sizeof(type))) #define CNEW(type) ((type *) xcalloc(1, sizeof(type))) From owner-svn-src-head@freebsd.org Sat Oct 31 04:39:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FE07A22290; Sat, 31 Oct 2015 04:39:57 +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 mx1.freebsd.org (Postfix) with ESMTPS id C19151DBE; Sat, 31 Oct 2015 04:39:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V4dtk1095738; Sat, 31 Oct 2015 04:39:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V4dt0Q095735; Sat, 31 Oct 2015 04:39:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201510310439.t9V4dt0Q095735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 31 Oct 2015 04:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290223 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 04:39:57 -0000 Author: imp Date: Sat Oct 31 04:39:55 2015 New Revision: 290223 URL: https://svnweb.freebsd.org/changeset/base/290223 Log: Rather than using the #define for path names, indirect through a char * variable that could change for different executable types detected. Modified: head/libexec/rtld-elf/libmap.c head/libexec/rtld-elf/paths.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Sat Oct 31 04:39:28 2015 (r290222) +++ head/libexec/rtld-elf/libmap.c Sat Oct 31 04:39:55 2015 (r290223) @@ -68,7 +68,7 @@ lm_init(char *libmap_override) dbg("lm_init(\"%s\")", libmap_override); TAILQ_INIT(&lmp_head); - lmc_parse_file(_PATH_LIBMAP_CONF); + lmc_parse_file(ld_path_libmap_conf); if (libmap_override) { /* Modified: head/libexec/rtld-elf/paths.h ============================================================================== --- head/libexec/rtld-elf/paths.h Sat Oct 31 04:39:28 2015 (r290222) +++ head/libexec/rtld-elf/paths.h Sat Oct 31 04:39:55 2015 (r290223) @@ -61,4 +61,10 @@ #define LD_ "LD_" #endif +extern char *ld_path_elf_hints; +extern char *ld_path_libmap_conf; +extern char *ld_path_rtld; +extern char *ld_standard_library_path; +extern char *ld_env_prefix; + #endif /* PATHS_H */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Oct 31 04:39:28 2015 (r290222) +++ head/libexec/rtld-elf/rtld.c Sat Oct 31 04:39:55 2015 (r290223) @@ -255,6 +255,15 @@ int tls_max_index = 1; /* Largest modul bool ld_library_path_rpath = false; /* + * Globals for path names, and such + */ +char *ld_path_elf_hints = _PATH_ELF_HINTS; +char *ld_path_libmap_conf = _PATH_LIBMAP_CONF; +char *ld_path_rtld = _PATH_RTLD; +char *ld_standard_library_path = STANDARD_LIBRARY_PATH; +char *ld_env_prefix = LD_; + +/* * Fill in a DoneList with an allocation large enough to hold all of * the currently-loaded objects. Keep this as a macro since it calls * alloca and we want that to occur within the scope of the caller. @@ -449,7 +458,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ ld_utrace = getenv(LD_ "UTRACE"); if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) - ld_elf_hints_path = _PATH_ELF_HINTS; + ld_elf_hints_path = ld_path_elf_hints; if (ld_debug != NULL && *ld_debug != '\0') debug = 1; @@ -1506,7 +1515,7 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, refobj->rpath)) != NULL) || (pathname = search_library_pathfds(name, ld_library_dirs, fdp)) != NULL || (pathname = search_library_path(name, gethints(false))) != NULL || - (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) + (pathname = search_library_path(name, ld_standard_library_path)) != NULL) return (pathname); } else { nodeflib = objgiven ? refobj->z_nodeflib : false; @@ -1520,7 +1529,7 @@ find_library(const char *xname, const Ob (pathname = search_library_pathfds(name, ld_library_dirs, fdp)) != NULL || (pathname = search_library_path(name, gethints(nodeflib))) != NULL || (objgiven && !nodeflib && - (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)) + (pathname = search_library_path(name, ld_standard_library_path)) != NULL)) return (pathname); } @@ -1690,7 +1699,7 @@ gethints(bool nostdlib) hargs.request = RTLD_DI_SERINFOSIZE; hargs.serinfo = &hmeta; - path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); + path_enumerate(ld_standard_library_path, fill_search_info, &sargs); path_enumerate(p, fill_search_info, &hargs); SLPinfo = xmalloc(smeta.dls_size); @@ -1709,7 +1718,7 @@ gethints(bool nostdlib) hargs.serpath = &hintinfo->dls_serpath[0]; hargs.strspace = (char *)&hintinfo->dls_serpath[hmeta.dls_cnt]; - path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &sargs); + path_enumerate(ld_standard_library_path, fill_search_info, &sargs); path_enumerate(p, fill_search_info, &hargs); /* @@ -1887,7 +1896,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * digest_dynamic2(&obj_rtld, dyn_rpath, dyn_soname, dyn_runpath); /* Replace the path with a dynamically allocated copy. */ - obj_rtld.path = xstrdup(_PATH_RTLD); + obj_rtld.path = xstrdup(ld_path_rtld); r_debug.r_brk = r_debug_state; r_debug.r_state = RT_CONSISTENT; @@ -3501,7 +3510,7 @@ do_search_info(const Obj_Entry *obj, int path_enumerate(obj->runpath, fill_search_info, &args); path_enumerate(gethints(obj->z_nodeflib), fill_search_info, &args); if (!obj->z_nodeflib) - path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args); + path_enumerate(ld_standard_library_path, fill_search_info, &args); if (request == RTLD_DI_SERINFOSIZE) { @@ -3539,7 +3548,7 @@ do_search_info(const Obj_Entry *obj, int args.flags = LA_SER_DEFAULT; if (!obj->z_nodeflib && - path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args) != NULL) + path_enumerate(ld_standard_library_path, fill_search_info, &args) != NULL) return (-1); return (0); } From owner-svn-src-head@freebsd.org Sat Oct 31 04:53:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3877A2279D; Sat, 31 Oct 2015 04:53:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6FA091646; Sat, 31 Oct 2015 04:53:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V4r7hb001367; Sat, 31 Oct 2015 04:53:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V4r7v6001366; Sat, 31 Oct 2015 04:53:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201510310453.t9V4r7v6001366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 31 Oct 2015 04:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290224 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 04:53:08 -0000 Author: imp Date: Sat Oct 31 04:53:07 2015 New Revision: 290224 URL: https://svnweb.freebsd.org/changeset/base/290224 Log: The error classification from lower layers is a poor indicator of whether an error is recoverable. Always re-dirty the buffer on errors from write requests. The invalidation we used to do for errors not EIO doesn't need to be done for a device that's really gone, since that's done in a different path. Reviewed by: mckusick@, kib@ Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Oct 31 04:39:55 2015 (r290223) +++ head/sys/kern/vfs_bio.c Sat Oct 31 04:53:07 2015 (r290224) @@ -2266,19 +2266,17 @@ brelse(struct buf *bp) bdirty(bp); } if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && - bp->b_error == EIO && !(bp->b_flags & B_INVAL)) { + !(bp->b_flags & B_INVAL)) { /* * Failed write, redirty. Must clear BIO_ERROR to prevent - * pages from being scrapped. If the error is anything - * other than an I/O error (EIO), assume that retrying - * is futile. + * pages from being scrapped. */ bp->b_ioflags &= ~BIO_ERROR; bdirty(bp); } else if ((bp->b_flags & (B_NOCACHE | B_INVAL)) || (bp->b_ioflags & BIO_ERROR) || (bp->b_bufsize <= 0)) { /* - * Either a failed I/O or we were asked to free or not + * Either a failed read I/O or we were asked to free or not * cache the buffer. */ bp->b_flags |= B_INVAL; From owner-svn-src-head@freebsd.org Sat Oct 31 04:58:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D36A22832; Sat, 31 Oct 2015 04:58:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::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 6F42D193F; Sat, 31 Oct 2015 04:58:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pacfv9 with SMTP id fv9so96378932pac.3; Fri, 30 Oct 2015 21:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6xn0zGNP8OE98n1TyLGUtopmWZ4yZcbkZL5NhOCnYrQ=; b=lkq0qhya2EYpDynye+vLIRbr9fWaHfelR1bA1/YxSD4vm/y1bOnEZ5nq+RdPWOO5eq nOkPFSPzsDVa7etNPPebfXVGqnJubFeO9bpgRuNHbSS5sqqvUa50dTFkwkwbBCCDF6vT SELiNtz8rXQI8l+wIOEVZQMOWBXOZh0rgzonA8HqHo1/7igaoaw4udd/qLlDmsCEIkAM ZizUlt2iUoxajNVszBHtv67Ut37qSBPZT+cQSgqEI4BOAfi7dem3/6fltKM67vY80Uvl GNi+GSv2dc7ql1s0oZWbkChqlgVSewd9YfS5hAM7eibK8zi4XAUp8J5uJm76DRRh372D xmUg== X-Received: by 10.68.131.202 with SMTP id oo10mr12865508pbb.40.1446267518939; Fri, 30 Oct 2015 21:58:38 -0700 (PDT) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id n1sm11275427pap.7.2015.10.30.21.58.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Oct 2015 21:58:38 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r290220 - head/share/mk From: NGie Cooper In-Reply-To: <563435E1.9020108@FreeBSD.org> Date: Fri, 30 Oct 2015 21:58:37 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <372E031B-090F-44FD-AD18-DF84767C1A77@gmail.com> References: <201510310207.t9V27U7U051752@repo.freebsd.org> <563435E1.9020108@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 04:58:39 -0000 > On Oct 30, 2015, at 20:30, Bryan Drewery wrote: >=20 >> On Oct 30, 2015, at 19:18, NGie Cooper wrote: >>=20 >>> On Fri, Oct 30, 2015 at 7:07 PM, Bryan Drewery = wrote: >>> Author: bdrewery >>> Date: Sat Oct 31 02:07:30 2015 >>> New Revision: 290220 >>> URL: https://svnweb.freebsd.org/changeset/base/290220 >>>=20 >>> Log: >>> Don't hide stderr when checking ${CC} --version. >>>=20 >>> This can have important debugging information such as 'cc: not = found' or >>> 'ccache: error: Could not find compiler "cc" in PATH'. >>=20 >> Won't this spam installworld/distribution a lot? >=20 > Not for me. >=20 > What do you expect from stderr that is non-fatal? The only cases I've > had so far resulted in the .error triggering later due to not being = able > to determine compiler type. >=20 > Also, install depending on the compiler type is wrong. We need to > eliminate the cases where it determines SUBDIR or FILES to fix this. = I'd > like to effectively set CC=3Dfalse during install but can't while = those > checks exist. I=92ll have to run the build again. I=92ve seen a lot of noise without = it redirected to /dev/null in the past, but it=92s likely ok. I=92d like CC=3Dfalse to work too with installworld/distribution. I = think it=92s really bad that it=92s not the default variable right now = because it could cause things to get recompiled at install, which = inevitably leads to confusing emails later from end-users.= From owner-svn-src-head@freebsd.org Sat Oct 31 07:59:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29E4A22978; Sat, 31 Oct 2015 07:59:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7547E175A; Sat, 31 Oct 2015 07:59:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id B25131040C6A; Sat, 31 Oct 2015 18:59:29 +1100 (AEDT) Date: Sat, 31 Oct 2015 18:59:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290221 - head/sys/powerpc/powerpc In-Reply-To: <39CCA88E-6D59-4F09-B054-DF765B8C9708@freebsd.org> Message-ID: <20151031180405.Y1413@besplex.bde.org> References: <201510310208.t9V28dIh051810@repo.freebsd.org> <39CCA88E-6D59-4F09-B054-DF765B8C9708@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.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=7iV3e-sPVvSGcJGrOnoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 07:59:39 -0000 On Fri, 30 Oct 2015, Justin Hibbits wrote: > On Oct 30, 2015, at 9:27 PM, Conrad Meyer wrote: > >> Comments inline. >> >> On Fri, Oct 30, 2015 at 7:08 PM, Justin Hibbits >> wrote: >>> Author: jhibbits >>> Date: Sat Oct 31 02:08:39 2015 >>> New Revision: 290221 >>> URL: https://svnweb.freebsd.org/changeset/base/290221 >>> >>> Log: >>> Print unsigned memory sizes, to handle >2GB RAM on 32-bit powerpc. >>> ... >>> ========= >>> ===================================================================== >>> --- head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:07:30 2015 >>> (r290220) >>> +++ head/sys/powerpc/powerpc/machdep.c Sat Oct 31 02:08:39 2015 >>> (r290221) >>> @@ -176,12 +176,12 @@ cpu_startup(void *dummy) >>> #ifdef PERFMON >>> perfmon_init(); >>> #endif >>> - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), >>> + printf("real memory = %lu (%lu MB)\n", ptoa(physmem), >>> ptoa(physmem) / 1048576); >> >> Shouldn't this be "real memory = %ju (%lu MB)\n" and >> (uintmax_t)ptoa(physmem), or it may overflow on >4GB RAM systems? No. Any overflow that may occur happens in ptoa() before this cast can effect it. Such overflow is supposed to be prevented by bogusly casting to the undocumented type unsigned long in the undocumented macro ptoa(). %lu is correct since it matches this type. Any mismatch (except the old sign mismatch) would be detected by printf format checking. Casting to uintmax_t would have no effect except to bloat the code from 32 bits to 64 bits in the 32-bit case and simplify matching the printf format with the type. There are about 100 different combinations of bogus types, bogus casts, no casts, and printf formats in various arches. Perhaps the bogus cast in powerpc32 ptoa() doesn't actually work. It only works up to 4GB. i386 used to have that limit and had to be changed for PAE. It now uses no cast in ptoa(). Callers must cast the arg to vm_paddr_t for efficiency or uintmax_t for simplicity. That is best since it forces them to be careful with types. The i386 code corresponding to the above uses uintmax_t for everything for simplicity. The bogus types start with physmem being long. That is more than large enough, at least on 32-bit arches, since its units are pages. But it is inconsistent with vm's page counters mostly having type u_int except where. On 64-bit arches, long is much longer than u_int, so using it tends to mask bugs, but on 32-bit arches it is shorter than u_int, so using it tends to unmask bugs. In the above, its signedness makes little difference since the bogus cast in the macro kills its sign bit. > Yes, it should, and it will. However, currently ptoa() casts to unsigned > long, and I didn't want to change that yet (I will eventually). In fact, the > machine I'm testing on has 8GB, which I've had to artificially limit to <4GB > because of the various memory accounting size limits. Similar to i386 with PAE. >>> realmem = physmem; >>> >>> if (bootverbose) >>> - printf("available KVA = %zd (%zd MB)\n", >>> + printf("available KVA = %zu (%zu MB)\n", >>> virtual_end - virtual_avail, >>> (virtual_end - virtual_avail) / 1048576); >>> This has logical type mismatches. The types are vm_offset_t, and it is assumed that this is the same as size_t so that it matches size_t. This defeats the reason for existence of fancy types like vm_offset_t. MD code can more easily just hard-code vm_offset_t and size_t as u_int ot u_long everywhere. This only works for virtual addresses. The types remain useful in MI code and for keeping really different things like physical memory sizes different. %zu is also logically wrong for the size in MB. size_t is only logically correct for sizes in bytes. The expression for the size in MB normally has type size_t too, but this is MD. vm has a vm_size_t type to add to the confusion. It is hard to remember to convert between offsets and sizes when they are physically identical. But IIRC, vm doesn't have a type for its page counts where the differences are physical. >>> @@ -199,7 +199,7 @@ cpu_startup(void *dummy) >>> #ifdef __powerpc64__ >>> printf("0x%016lx - 0x%016lx, %ld bytes (%ld >>> pages)\n", >>> #else >>> - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", >>> + printf("0x%08x - 0x%08x, %u bytes (%lu pages)\n", >> >> It seems wrong that bytes is only %u here and pages is a %lu. I think >> bytes should probably be %ju too? What is the type of size1? This is perfectly backwards. Byte counts are large so they need to have type vm_paddr_t or larger. Page counts are small so they can be signed int. But surely the types are correct here since the printf format checker would have detected any mismatch except for signs? Bogus long format specifiers are likely to be needed to match the bogus long type of physmem. All of the code just before here has type errors. It starts with the style bugs of a nested declaration of vm_offset_t size1 and an initializer in this declaration. size1 is not an offset at all. It is actually a size, and its correct type is vm_size_t (or to be honestly sloppy, u_long). The expression for it is the difference of 2 vm_offset_t's which should also be vm_size_t's, but IIRC that is an old API bug, like the type of physmem. Most the types being printed are vm_offet_t's (which should be vm_size_t's)... > You're right. It should be long. However, it's 6-of-one in this case, since > on powerpc (32-bit) sizeof(long) == sizeof(int), so it doesn't matter too > much yet. size1 is a vm_offset_t, which is 32-bits in this case. > phys_avail[] is also an array of vm_offset_t's, and I intend to change it to > vm_paddr_t, and cast to uintmax_t for printf purposes, but again, that's > longer term (a lot of the powerpc bootup needs a cleanup, anyway). ... Not really. It is the long that is most bogus. The vm_offset_t's (which should be vm_size_t's) have the correct type. This is u_int on 32-bit arches, although u_long would work. The bogus long is from the type of PAGE_SIZE being bogusly long, so expressions using it tend to promote to long. sparc64 has the same bug. This is a bogus way of avoiding some overflow bugs. But it doesn't even avoid overflow on 32-bit arches in the 2G-4G range. The above divides by PAGE_SIZE so there is no problem. Multiplication by a signed int page count can give unnecessary overflow in the range. But muiltiplication by an unsigned int page count doesn't even do that. >>> @@ -208,7 +208,7 @@ cpu_startup(void *dummy) >>> >>> vm_ksubmap_init(&kmi); >>> >>> - printf("avail memory = %ld (%ld MB)\n", ptoa(vm_cnt.v_free_count), >>> + printf("avail memory = %lu (%lu MB)\n", ptoa(vm_cnt.v_free_count), >>> ptoa(vm_cnt.v_free_count) / 1048576); >> >> Same as with the first printf. > > See above. It's on my list, I just wanted something cleaner for now. sparc64 does this one even more bogusly by not using ptoa() but a direct multiplication by PAGE_SIZE with no cast. This asks for overflow, but works due to PAGE_SIZE being bogusly long. Hmm, division by PAGE_SIZE in the above is a style bug too. There is a macro for converting in that direction too. All of the related conversion macros are badly organized or named or duplicated, and undocumented. Bruce From owner-svn-src-head@freebsd.org Sat Oct 31 08:21:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0308A22EC1; Sat, 31 Oct 2015 08:21:03 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::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 AE1191E2E; Sat, 31 Oct 2015 08:21:03 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: by obbza9 with SMTP id za9so61201040obb.1; Sat, 31 Oct 2015 01:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eRxwaYghq/OlkMYXUjBpMnO0R1e152QNHoXQGYhZF4o=; b=r7SVaANpGJ5QzMHnYoVbA/3QpHY8Hc0ezUsps71FqFKOnhNDMGI5/K8gX7vqhqP+6j cjqRcmI6i/cJ7P+REbwsGGbHNFNHheY0FCVp1WhFaLmFDFyYQhGW5+GeU9C4IUyXtIob BtL5wumDGUsc9bmrAzgoEnMxs66aiiC+S7EeUWGOOf/cdJFRG1e+XpDNYDkxw77P1m2H IDf3SHFweP+tYHOzhX9tT3PlODCeGwRmfOyS3uBq9rGAuCRUzatRFpcC8IkR+2yH4HW3 COTtRC3LKAO/BLuzlKVw1D23chXKJ2DJAzC5Ev7MwRZVKQSY/tGySq3IXlWZRMWzausD ffUg== MIME-Version: 1.0 X-Received: by 10.60.23.70 with SMTP id k6mr8315349oef.5.1446279662896; Sat, 31 Oct 2015 01:21:02 -0700 (PDT) Received: by 10.182.167.6 with HTTP; Sat, 31 Oct 2015 01:21:02 -0700 (PDT) In-Reply-To: <201510221638.t9MGc1cc053885@repo.freebsd.org> References: <201510221638.t9MGc1cc053885@repo.freebsd.org> Date: Sat, 31 Oct 2015 16:21:02 +0800 Message-ID: Subject: Re: svn commit: r289759 - in head/sys/arm: arm include From: Ganbold Tsagaankhuu To: "Jason A. Harmening" Cc: src-committers@freebsd.org, 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.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 08:21:04 -0000 On Fri, Oct 23, 2015 at 12:38 AM, Jason A. Harmening wrote: > Author: jah > Date: Thu Oct 22 16:38:01 2015 > New Revision: 289759 > URL: https://svnweb.freebsd.org/changeset/base/289759 > > Log: > Use pmap_quick* functions in armv6 busdma, for bounce buffers and cache > maintenance. This makes it safe to sync buffers that have no VA mapping > associated with the busdma map, but may have other mappings, possibly on > different CPUs. This also makes it safe to sync unmapped bounce buffers in > non-sleepable thread contexts. > > Similar to r286787 for x86, this treats userspace buffers the same as > unmapped buffers and no longer borrows the UVA for sync operations. > > Submitted by: Svatopluk Kraus (earlier > revision) > Tested by: Svatopluk Kraus > Differential Revision: https://reviews.freebsd.org/D3869 It seems I can't boot Odroid C1 with this change. http://pastebin.ca/3227678 r289758 works for me. Am I missing something? thanks, Ganbold > > > Modified: > head/sys/arm/arm/busdma_machdep-v6.c > head/sys/arm/include/cpu-v6.h > > Modified: head/sys/arm/arm/busdma_machdep-v6.c > > ============================================================================== > --- head/sys/arm/arm/busdma_machdep-v6.c Thu Oct 22 15:42:53 2015 > (r289758) > +++ head/sys/arm/arm/busdma_machdep-v6.c Thu Oct 22 16:38:01 2015 > (r289759) > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#include > +#include > #include > > #define MAX_BPAGES 64 > @@ -104,14 +104,16 @@ struct bounce_page { > vm_offset_t vaddr; /* kva of bounce buffer */ > bus_addr_t busaddr; /* Physical address */ > vm_offset_t datavaddr; /* kva of client data */ > - bus_addr_t dataaddr; /* client physical address */ > + vm_page_t datapage; /* physical page of client data */ > + vm_offset_t dataoffs; /* page offset of client data */ > bus_size_t datacount; /* client data count */ > STAILQ_ENTRY(bounce_page) links; > }; > > struct sync_list { > vm_offset_t vaddr; /* kva of client data */ > - bus_addr_t busaddr; /* client physical address */ > + vm_page_t pages; /* starting page of client data */ > + vm_offset_t dataoffs; /* page offset of client data */ > bus_size_t datacount; /* client data count */ > }; > > @@ -181,7 +183,6 @@ struct bus_dmamap { > int pagesreserved; > bus_dma_tag_t dmat; > struct memdesc mem; > - pmap_t pmap; > bus_dmamap_callback_t *callback; > void *callback_arg; > int flags; > @@ -206,12 +207,14 @@ static bus_addr_t add_bounce_page(bus_dm > vm_offset_t vaddr, bus_addr_t addr, > bus_size_t size); > static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page > *bpage); > -static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, > - void *buf, bus_size_t buflen, int flags); > +static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, pmap_t pmap, > + bus_dmamap_t map, void *buf, bus_size_t buflen, int flags); > static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, > vm_paddr_t buf, bus_size_t buflen, int flags); > static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, > int flags); > +static void dma_preread_safe(vm_offset_t va, vm_paddr_t pa, vm_size_t > size); > +static void dma_dcache_sync(struct sync_list *sl, bus_dmasync_op_t op); > > static busdma_bufalloc_t coherent_allocator; /* Cache of coherent > buffers */ > static busdma_bufalloc_t standard_allocator; /* Cache of standard > buffers */ > @@ -896,7 +899,8 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma > while (buflen != 0) { > sgsize = MIN(buflen, dmat->maxsegsz); > if (must_bounce(dmat, map, curaddr, sgsize) != 0) { > - sgsize = MIN(sgsize, PAGE_SIZE); > + sgsize = MIN(sgsize, > + PAGE_SIZE - (curaddr & PAGE_MASK)); > map->pagesneeded++; > } > curaddr += sgsize; > @@ -907,7 +911,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma > } > > static void > -_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, > +_bus_dmamap_count_pages(bus_dma_tag_t dmat, pmap_t pmap, bus_dmamap_t map, > void *buf, bus_size_t buflen, int flags) > { > vm_offset_t vaddr; > @@ -927,10 +931,10 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm > vendaddr = (vm_offset_t)buf + buflen; > > while (vaddr < vendaddr) { > - if (__predict_true(map->pmap == kernel_pmap)) > + if (__predict_true(pmap == kernel_pmap)) > paddr = pmap_kextract(vaddr); > else > - paddr = pmap_extract(map->pmap, vaddr); > + paddr = pmap_extract(pmap, vaddr); > if (must_bounce(dmat, map, paddr, > min(vendaddr - vaddr, (PAGE_SIZE - > ((vm_offset_t)vaddr & > PAGE_MASK)))) != 0) { > @@ -1043,7 +1047,9 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat > int *segp) > { > bus_addr_t curaddr; > + bus_addr_t sl_end = 0; > bus_size_t sgsize; > + struct sync_list *sl; > int error; > > if (segs == NULL) > @@ -1052,7 +1058,7 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat > counter_u64_add(maploads_total, 1); > counter_u64_add(maploads_physmem, 1); > > - if (might_bounce(dmat, map, buflen, buflen)) { > + if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { > _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); > if (map->pagesneeded != 0) { > counter_u64_add(maploads_bounced, 1); > @@ -1062,14 +1068,35 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat > } > } > > + sl = map->slist + map->sync_count - 1; > + > while (buflen > 0) { > curaddr = buf; > sgsize = MIN(buflen, dmat->maxsegsz); > if (map->pagesneeded != 0 && must_bounce(dmat, map, > curaddr, > sgsize)) { > - sgsize = MIN(sgsize, PAGE_SIZE); > + sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & > PAGE_MASK)); > curaddr = add_bounce_page(dmat, map, 0, curaddr, > sgsize); > + } else { > + if (map->sync_count > 0) > + sl_end = VM_PAGE_TO_PHYS(sl->pages) + > + sl->dataoffs + sl->datacount; > + > + if (map->sync_count == 0 || curaddr != sl_end) { > + if (++map->sync_count > dmat->nsegments) > + break; > + sl++; > + sl->vaddr = 0; > + sl->datacount = sgsize; > + /* > + * PHYS_TO_VM_PAGE() will truncate > + * unaligned addresses. > + */ > + sl->pages = PHYS_TO_VM_PAGE(curaddr); > + sl->dataoffs = curaddr & PAGE_MASK; > + } else > + sl->datacount += sgsize; > } > sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, > segs, > segp); > @@ -1114,7 +1141,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm > { > bus_size_t sgsize; > bus_addr_t curaddr; > - vm_offset_t vaddr; > + bus_addr_t sl_pend = 0; > + vm_offset_t kvaddr, vaddr, sl_vend = 0; > struct sync_list *sl; > int error; > > @@ -1132,10 +1160,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm > map->flags |= DMAMAP_MBUF; > } > > - map->pmap = pmap; > - > if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { > - _bus_dmamap_count_pages(dmat, map, buf, buflen, flags); > + _bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, > flags); > if (map->pagesneeded != 0) { > counter_u64_add(maploads_bounced, 1); > error = _bus_dmamap_reserve_pages(dmat, map, > flags); > @@ -1144,22 +1170,25 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm > } > } > > - sl = NULL; > + sl = map->slist + map->sync_count - 1; > vaddr = (vm_offset_t)buf; > > while (buflen > 0) { > /* > * Get the physical address for this segment. > */ > - if (__predict_true(map->pmap == kernel_pmap)) > + if (__predict_true(pmap == kernel_pmap)) { > curaddr = pmap_kextract(vaddr); > - else > - curaddr = pmap_extract(map->pmap, vaddr); > + kvaddr = vaddr; > + } else { > + curaddr = pmap_extract(pmap, vaddr); > + kvaddr = 0; > + } > > /* > * Compute the segment size, and adjust counts. > */ > - sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); > + sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); > if (sgsize > dmat->maxsegsz) > sgsize = dmat->maxsegsz; > if (buflen < sgsize) > @@ -1167,21 +1196,30 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm > > if (map->pagesneeded != 0 && must_bounce(dmat, map, > curaddr, > sgsize)) { > - curaddr = add_bounce_page(dmat, map, vaddr, > curaddr, > + curaddr = add_bounce_page(dmat, map, kvaddr, > curaddr, > sgsize); > } else { > - sl = &map->slist[map->sync_count - 1]; > + if (map->sync_count > 0) { > + sl_pend = VM_PAGE_TO_PHYS(sl->pages) + > + sl->dataoffs + sl->datacount; > + sl_vend = sl->vaddr + sl->datacount; > + } > + > if (map->sync_count == 0 || > -#ifdef ARM_L2_PIPT > - curaddr != sl->busaddr + sl->datacount || > -#endif > - vaddr != sl->vaddr + sl->datacount) { > + (kvaddr != 0 && kvaddr != sl_vend) || > + (curaddr != sl_pend)) { > + > if (++map->sync_count > dmat->nsegments) > goto cleanup; > sl++; > - sl->vaddr = vaddr; > + sl->vaddr = kvaddr; > sl->datacount = sgsize; > - sl->busaddr = curaddr; > + /* > + * PHYS_TO_VM_PAGE() will truncate > + * unaligned addresses. > + */ > + sl->pages = PHYS_TO_VM_PAGE(curaddr); > + sl->dataoffs = curaddr & PAGE_MASK; > } else > sl->datacount += sgsize; > } > @@ -1252,64 +1290,94 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b > map->flags &= ~DMAMAP_MBUF; > } > > -#ifdef notyetbounceuser > -/* If busdma uses user pages, then the interrupt handler could > - * be use the kernel vm mapping. Both bounce pages and sync list > - * do not cross page boundaries. > - * Below is a rough sequence that a person would do to fix the > - * user page reference in the kernel vmspace. This would be > - * done in the dma post routine. > - */ > -void > -_bus_dmamap_fix_user(vm_offset_t buf, bus_size_t len, > - pmap_t pmap, int op) > +static void > +dma_preread_safe(vm_offset_t va, vm_paddr_t pa, vm_size_t size) > { > - bus_size_t sgsize; > - bus_addr_t curaddr; > - vm_offset_t va; > - > /* > - * each synclist entry is contained within a single page. > - * this would be needed if BUS_DMASYNC_POSTxxxx was implemented > + * Write back any partial cachelines immediately before and > + * after the DMA region. We don't need to round the address > + * down to the nearest cacheline or specify the exact size, > + * as dcache_wb_poc() will do the rounding for us and works > + * at cacheline granularity. > */ > - curaddr = pmap_extract(pmap, buf); > - va = pmap_dma_map(curaddr); > - switch (op) { > - case SYNC_USER_INV: > - cpu_dcache_wb_range(va, sgsize); > - break; > + if (va & cpuinfo.dcache_line_mask) > + dcache_wb_poc(va, pa, 1); > + if ((va + size) & cpuinfo.dcache_line_mask) > + dcache_wb_poc(va + size, pa + size, 1); > > - case SYNC_USER_COPYTO: > - bcopy((void *)va, (void *)bounce, sgsize); > - break; > + dcache_dma_preread(va, pa, size); > +} > > - case SYNC_USER_COPYFROM: > - bcopy((void *) bounce, (void *)va, sgsize); > - break; > +static void > +dma_dcache_sync(struct sync_list *sl, bus_dmasync_op_t op) > +{ > + uint32_t len, offset; > + vm_page_t m; > + vm_paddr_t pa; > + vm_offset_t va, tempva; > + bus_size_t size; > + > + offset = sl->dataoffs; > + m = sl->pages; > + size = sl->datacount; > + pa = VM_PAGE_TO_PHYS(m) | offset; > + > + for ( ; size != 0; size -= len, pa += len, offset = 0, ++m) { > + tempva = 0; > + if (sl->vaddr == 0) { > + len = min(PAGE_SIZE - offset, size); > + tempva = pmap_quick_enter_page(m); > + va = tempva | offset; > + } else { > + len = sl->datacount; > + va = sl->vaddr; > + } > + KASSERT(pa == (VM_PAGE_TO_PHYS(m) | offset), > + ("unexpected vm_page_t phys: 0x%08x != 0x%08x", > + VM_PAGE_TO_PHYS(m) | offset, pa)); > > - default: > - break; > - } > + switch (op) { > + case BUS_DMASYNC_PREWRITE: > + case BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD: > + dcache_wb_poc(va, pa, len); > + break; > + case BUS_DMASYNC_PREREAD: > + /* > + * An mbuf may start in the middle of a cacheline. > There > + * will be no cpu writes to the beginning of that > line > + * (which contains the mbuf header) while dma is in > + * progress. Handle that case by doing a > writeback of > + * just the first cacheline before invalidating the > + * overall buffer. Any mbuf in a chain may have > this > + * misalignment. Buffers which are not mbufs > bounce if > + * they are not aligned to a cacheline. > + */ > + dma_preread_safe(va, pa, len); > + break; > + case BUS_DMASYNC_POSTREAD: > + case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: > + dcache_inv_poc(va, pa, len); > + break; > + default: > + panic("unsupported combination of sync operations: > " > + "0x%08x\n", op); > + } > > - pmap_dma_unmap(va); > + if (tempva != 0) > + pmap_quick_remove_page(tempva); > + } > } > -#endif > - > -#ifdef ARM_L2_PIPT > -#define l2cache_wb_range(va, pa, size) cpu_l2cache_wb_range(pa, size) > -#define l2cache_wbinv_range(va, pa, size) cpu_l2cache_wbinv_range(pa, > size) > -#define l2cache_inv_range(va, pa, size) cpu_l2cache_inv_range(pa, size) > -#else > -#define l2cache_wb_range(va, pa, size) cpu_l2cache_wb_range(va, size) > -#define l2cache_wbinv_range(va, pa, size) cpu_l2cache_wbinv_range(va, > size) > -#define l2cache_inv_range(va, pa, size) cpu_l2cache_inv_range(va, size) > -#endif > > void > _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t > op) > { > struct bounce_page *bpage; > struct sync_list *sl, *end; > + vm_offset_t datavaddr, tempvaddr; > + > + if (op == BUS_DMASYNC_POSTWRITE) > + return; > + > /* > * If the buffer was from user space, it is possible that this is > not > * the same vm map, especially on a POST operation. It's not > clear that > @@ -1317,8 +1385,6 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus > * we're able to test direct userland dma, panic on a map mismatch. > */ > if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { > - if (!pmap_dmap_iscurrent(map->pmap)) > - panic("_bus_dmamap_sync: wrong user map for bounce > sync."); > > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " > "performing bounce", __func__, dmat, dmat->flags, op); > @@ -1329,18 +1395,18 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus > */ > if (op & BUS_DMASYNC_PREWRITE) { > while (bpage != NULL) { > - if (bpage->datavaddr != 0) > - bcopy((void *)bpage->datavaddr, > - (void *)bpage->vaddr, > - bpage->datacount); > - else > - physcopyout(bpage->dataaddr, > - (void *)bpage->vaddr, > - bpage->datacount); > - > cpu_dcache_wb_range((vm_offset_t)bpage->vaddr, > + tempvaddr = 0; > + datavaddr = bpage->datavaddr; > + if (datavaddr == 0) { > + tempvaddr = pmap_quick_enter_page( > + bpage->datapage); > + datavaddr = tempvaddr | > bpage->dataoffs; > + } > + bcopy((void *)datavaddr, (void > *)bpage->vaddr, > bpage->datacount); > - l2cache_wb_range((vm_offset_t)bpage->vaddr, > - (vm_offset_t)bpage->busaddr, > + if (tempvaddr != 0) > + pmap_quick_remove_page(tempvaddr); > + dcache_wb_poc(bpage->vaddr, bpage->busaddr, > bpage->datacount); > bpage = STAILQ_NEXT(bpage, links); > } > @@ -1361,10 +1427,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus > if ((op & BUS_DMASYNC_PREREAD) && !(op & > BUS_DMASYNC_PREWRITE)) { > bpage = STAILQ_FIRST(&map->bpages); > while (bpage != NULL) { > - > cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, > - bpage->datacount); > - > l2cache_inv_range((vm_offset_t)bpage->vaddr, > - (vm_offset_t)bpage->busaddr, > + dcache_dma_preread(bpage->vaddr, > bpage->busaddr, > bpage->datacount); > bpage = STAILQ_NEXT(bpage, links); > } > @@ -1381,19 +1444,19 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus > */ > if (op & BUS_DMASYNC_POSTREAD) { > while (bpage != NULL) { > - > l2cache_inv_range((vm_offset_t)bpage->vaddr, > - (vm_offset_t)bpage->busaddr, > + dcache_inv_poc(bpage->vaddr, > bpage->busaddr, > bpage->datacount); > - > cpu_dcache_inv_range((vm_offset_t)bpage->vaddr, > + tempvaddr = 0; > + datavaddr = bpage->datavaddr; > + if (datavaddr == 0) { > + tempvaddr = pmap_quick_enter_page( > + bpage->datapage); > + datavaddr = tempvaddr | > bpage->dataoffs; > + } > + bcopy((void *)bpage->vaddr, (void > *)datavaddr, > bpage->datacount); > - if (bpage->datavaddr != 0) > - bcopy((void *)bpage->vaddr, > - (void *)bpage->datavaddr, > - bpage->datacount); > - else > - physcopyin((void *)bpage->vaddr, > - bpage->dataaddr, > - bpage->datacount); > + if (tempvaddr != 0) > + pmap_quick_remove_page(tempvaddr); > bpage = STAILQ_NEXT(bpage, links); > } > dmat->bounce_zone->total_bounced++; > @@ -1424,68 +1487,13 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus > * outer-to-inner for POSTREAD invalidation is not a mistake. > */ > if (map->sync_count != 0) { > - if (!pmap_dmap_iscurrent(map->pmap)) > - panic("_bus_dmamap_sync: wrong user map for > sync."); > - > sl = &map->slist[0]; > end = &map->slist[map->sync_count]; > CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " > "performing sync", __func__, dmat, dmat->flags, op); > > - switch (op) { > - case BUS_DMASYNC_PREWRITE: > - case BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD: > - while (sl != end) { > - cpu_dcache_wb_range(sl->vaddr, > sl->datacount); > - l2cache_wb_range(sl->vaddr, sl->busaddr, > - sl->datacount); > - sl++; > - } > - break; > - > - case BUS_DMASYNC_PREREAD: > - /* > - * An mbuf may start in the middle of a cacheline. > There > - * will be no cpu writes to the beginning of that > line > - * (which contains the mbuf header) while dma is in > - * progress. Handle that case by doing a > writeback of > - * just the first cacheline before invalidating the > - * overall buffer. Any mbuf in a chain may have > this > - * misalignment. Buffers which are not mbufs > bounce if > - * they are not aligned to a cacheline. > - */ > - while (sl != end) { > - if (sl->vaddr & arm_dcache_align_mask) { > - KASSERT(map->flags & DMAMAP_MBUF, > - ("unaligned buffer is not an > mbuf")); > - cpu_dcache_wb_range(sl->vaddr, 1); > - l2cache_wb_range(sl->vaddr, > - sl->busaddr, 1); > - } > - cpu_dcache_inv_range(sl->vaddr, > sl->datacount); > - l2cache_inv_range(sl->vaddr, sl->busaddr, > - sl->datacount); > - sl++; > - } > - break; > - > - case BUS_DMASYNC_POSTWRITE: > - break; > - > - case BUS_DMASYNC_POSTREAD: > - case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: > - while (sl != end) { > - l2cache_inv_range(sl->vaddr, sl->busaddr, > - sl->datacount); > - cpu_dcache_inv_range(sl->vaddr, > sl->datacount); > - sl++; > - } > - break; > - > - default: > - panic("unsupported combination of sync operations: > 0x%08x\n", op); > - break; > - } > + for ( ; sl != end; ++sl) > + dma_dcache_sync(sl, op); > } > } > > @@ -1679,7 +1687,9 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ > bpage->busaddr |= addr & PAGE_MASK; > } > bpage->datavaddr = vaddr; > - bpage->dataaddr = addr; > + /* PHYS_TO_VM_PAGE() will truncate unaligned addresses. */ > + bpage->datapage = PHYS_TO_VM_PAGE(addr); > + bpage->dataoffs = addr & PAGE_MASK; > bpage->datacount = size; > STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); > return (bpage->busaddr); > > Modified: head/sys/arm/include/cpu-v6.h > > ============================================================================== > --- head/sys/arm/include/cpu-v6.h Thu Oct 22 15:42:53 2015 > (r289758) > +++ head/sys/arm/include/cpu-v6.h Thu Oct 22 16:38:01 2015 > (r289759) > @@ -471,6 +471,31 @@ dcache_inv_poc(vm_offset_t va, vm_paddr_ > } > > /* > + * Discard D-cache lines to PoC, prior to overwrite by DMA engine > + * > + * Invalidate caches, discarding data in dirty lines. This is useful > + * if the memory is about to be overwritten, e.g. by a DMA engine. > + * Invalidate caches from innermost to outermost to follow the flow > + * of dirty cachelines. > + */ > +static __inline void > +dcache_dma_preread(vm_offset_t va, vm_paddr_t pa, vm_size_t size) > +{ > + vm_offset_t eva = va + size; > + > + /* invalidate L1 first */ > + dsb(); > + va &= ~cpuinfo.dcache_line_mask; > + for ( ; va < eva; va += cpuinfo.dcache_line_size) { > + _CP15_DCIMVAC(va); > + } > + dsb(); > + > + /* then L2 */ > + cpu_l2cache_inv_range(pa, size); > +} > + > +/* > * Write back D-cache to PoC > * > * Caches are written back from innermost to outermost as dirty cachelines > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Sat Oct 31 09:45:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9A7AA2233C; Sat, 31 Oct 2015 09:45:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7535F1B7B; Sat, 31 Oct 2015 09:45:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V9jB4Y084481; Sat, 31 Oct 2015 09:45:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V9jBLS084480; Sat, 31 Oct 2015 09:45:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510310945.t9V9jBLS084480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 31 Oct 2015 09:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290226 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 09:45:12 -0000 Author: bapt Date: Sat Oct 31 09:45:11 2015 New Revision: 290226 URL: https://svnweb.freebsd.org/changeset/base/290226 Log: newsyslog: treat 'c' flag in the config as 'C' When -C was introduced in r114137 the plan was to have -C and -c being used for "create" due to a typo in FreeBSD <= 4.8 a temporary compatibility hack has been added to make -c being like -G aka GLOB and a warning was issued for the user to be aware of the futur change for -c. 12 years later it is more than time to remove that hack and finish the what was intent in r114137 Submitted by: Alexandre Perrin Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4000 Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat Oct 31 09:32:39 2015 (r290225) +++ head/usr.sbin/newsyslog/newsyslog.c Sat Oct 31 09:45:11 2015 (r290226) @@ -1271,20 +1271,6 @@ no_trimat: working->flags |= CE_BINARY; break; case 'c': - /* - * XXX - Ick! Ugly! Remove ASAP! - * We want `c' and `C' for "create". But we - * will temporarily treat `c' as `g', because - * FreeBSD releases <= 4.8 have a typo of - * checking ('G' || 'c') for CE_GLOB. - */ - if (*q == 'c') { - warnx("Assuming 'g' for 'c' in flags for line:\n%s", - errline); - warnx("The 'c' flag will eventually mean 'CREATE'"); - working->flags |= CE_GLOB; - break; - } working->flags |= CE_CREATE; break; case 'd': From owner-svn-src-head@freebsd.org Sat Oct 31 09:50:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DB8A223CD; Sat, 31 Oct 2015 09:50:32 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003: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 8374C1D20; Sat, 31 Oct 2015 09:50:32 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by oiad129 with SMTP id d129so72306392oia.0; Sat, 31 Oct 2015 02:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=oHzSnsDIcArLtVDEfLg+FpQ3KZTMnKFnIijU7+Udf/8=; b=ogIqKGjBgypwcQabV/D8f+J1gv6jLyW1et8XT4T5+WfPf99/4R1rMu+g9uDPJzAhoC 3xweqj3POj6KJxMRV+JroUCH5n2eQp2ZbNXy9JA1an8Lszk35mAfqWNSV+D4+vCiYd8S gmH4+j5rASezXlvxpUXFZktg8hr6VkJLSjHhquem4/seFDXe88onMHcGRROOxRiPGkSv FaoTZqbvh5OM3IULv8T2Jhn432z7Z/vBy0HdmC14VnZhh7MkSrUs89pRDrLAmp9g1L6S TYRsTr6omploRwt0qYhz3RkumcRC50JfQ/E9FQSUVKOM9khifJCFxU64ifsCkJEGI/x5 B2GQ== X-Received: by 10.202.217.7 with SMTP id q7mr8330575oig.29.1446285031846; Sat, 31 Oct 2015 02:50:31 -0700 (PDT) Received: from corona.austin.rr.com (cpe-72-177-6-10.austin.res.rr.com. [72.177.6.10]) by smtp.googlemail.com with ESMTPSA id a4sm4638885obx.9.2015.10.31.02.50.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Oct 2015 02:50:30 -0700 (PDT) Subject: Re: svn commit: r289759 - in head/sys/arm: arm include To: Ganbold Tsagaankhuu , "Jason A. Harmening" References: <201510221638.t9MGc1cc053885@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jason Harmening X-Enigmail-Draft-Status: N1110 Message-ID: <56348FF8.3010602@gmail.com> Date: Sat, 31 Oct 2015 04:55:04 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4nUDo2LCQnhKi1QM4Cf5mN1cWsfkcxHK3" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 09:50:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4nUDo2LCQnhKi1QM4Cf5mN1cWsfkcxHK3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/31/15 03:21, Ganbold Tsagaankhuu wrote: > On Fri, Oct 23, 2015 at 12:38 AM, Jason A. Harmening > wrote: >=20 >> Author: jah >> Date: Thu Oct 22 16:38:01 2015 >> New Revision: 289759 >> URL: https://svnweb.freebsd.org/changeset/base/289759 >> >> Log: >> Use pmap_quick* functions in armv6 busdma, for bounce buffers and ca= che >> maintenance. This makes it safe to sync buffers that have no VA mappi= ng >> associated with the busdma map, but may have other mappings, possibly = on >> different CPUs. This also makes it safe to sync unmapped bounce buffe= rs in >> non-sleepable thread contexts. >> >> Similar to r286787 for x86, this treats userspace buffers the same a= s >> unmapped buffers and no longer borrows the UVA for sync operations. >> >> Submitted by: Svatopluk Kraus (earlier >> revision) >> Tested by: Svatopluk Kraus >> Differential Revision: https://reviews.freebsd.org/D3869 >=20 >=20 >=20 > It seems I can't boot Odroid C1 with this change. >=20 > http://pastebin.ca/3227678 >=20 > r289758 works for me. >=20 > Am I missing something? >=20 > thanks, >=20 > Ganbold >=20 > Hmmm, the fault address of 0x20 and the fact that this is happening during mi_startup() make me wonder if the per-cpu pageframes used by pmap_quick* haven't been initialized yet. I wonder if changing the order of qpages_init in sys/arm/arm/pmap-v6[-new].c to something other than SI_ORDER_ANY would he= lp? It seems like we'd want SI_ORDER_FOURTH or SI_ORDER_MIDDLE, since mp_start() is SI_ORDER_THIRD. It would be nice to know what's calling bus_dmamap_sync() in this case. I can't figure that out, but maybe that's because I haven't had coffee y= et. Unfortunately I'm going to have limited time to help debug this over the next week, as I'm moving across the country starting (hopefully) today. --Jason --4nUDo2LCQnhKi1QM4Cf5mN1cWsfkcxHK3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJWNI/4XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRENkY3MTQyREU0MTU4MTgyRkZDNUU2ODVC QjlGOEJGOTkyODQxRDFCAAoJELufi/mShB0bg1IH/jQQrZm6C/egXU5rqQNw80aX ZFmJ8fqcWRifyoycEzRu2Rc+4V0vOFQxrwztA9JHbao43jZfkQRcbpvgHVc7sv9U eqjkzfi8j6cn5jUBCqOrh1+sSbjOUjxmUvm/DYAjkNgzh1j0eYcLHIoJ5483nVpv J1TnqmG2uQik2OhYDVD7W12mubQEqFbb+5gPLWSeoi8aMLPUEEBhVKR7ftsCr9F3 L+NY6O+zkI1KDCkMw4y5rCJRZm+y5ERcrh+rBJFtoKpZqoWxGtbzyAc/IUlqBRvN xcmKBhNHumuNGCIqq61ug8GQpt+pc+kDMqiGV1sQNK2gbpVtXYS6R26ocA1o5kE= =hFMs -----END PGP SIGNATURE----- --4nUDo2LCQnhKi1QM4Cf5mN1cWsfkcxHK3-- From owner-svn-src-head@freebsd.org Sat Oct 31 10:16:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99BBA229A8; Sat, 31 Oct 2015 10:16:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B386D1794; Sat, 31 Oct 2015 10:16:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9VAGi8N093029; Sat, 31 Oct 2015 10:16:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9VAGiX7093028; Sat, 31 Oct 2015 10:16:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201510311016.t9VAGiX7093028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 31 Oct 2015 10:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290227 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 10:16:46 -0000 Author: andrew Date: Sat Oct 31 10:16:44 2015 New Revision: 290227 URL: https://svnweb.freebsd.org/changeset/base/290227 Log: We have long double on arm64, and the tests pass so enable them. Sponsored by: ABT Systems Ltd Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Sat Oct 31 09:45:11 2015 (r290226) +++ head/lib/msun/tests/Makefile Sat Oct 31 10:16:44 2015 (r290227) @@ -7,7 +7,9 @@ CFLAGS+= -DHAVE_FENV_H # Not sure why this isn't defined for all architectures, since most # have long double. -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif From owner-svn-src-head@freebsd.org Sat Oct 31 15:09:32 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1D92A2206D; Sat, 31 Oct 2015 15:09:32 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 6E6741EDF; Sat, 31 Oct 2015 15:09:32 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9VF9VIW082771; Sat, 31 Oct 2015 15:09:31 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9VF9VpI082768; Sat, 31 Oct 2015 15:09:31 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201510311509.t9VF9VpI082768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sat, 31 Oct 2015 15:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290228 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 15:09:32 -0000 Author: dumbbell Date: Sat Oct 31 15:09:31 2015 New Revision: 290228 URL: https://svnweb.freebsd.org/changeset/base/290228 Log: drm/i915: Reduce diff with Linux 3.8 There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver. MFC after: 2 months Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c head/sys/dev/drm2/i915/intel_pm.c head/sys/dev/drm2/i915/intel_ringbuffer.h Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_execbuffer.c Sat Oct 31 10:16:44 2015 (r290227) +++ head/sys/dev/drm2/i915/i915_gem_execbuffer.c Sat Oct 31 15:09:31 2015 (r290228) @@ -221,9 +221,10 @@ eb_create(int size) { struct eb_objects *eb; - eb = malloc(sizeof(*eb), DRM_I915_GEM, M_WAITOK | M_ZERO); + eb = malloc(sizeof(*eb), + DRM_I915_GEM, M_WAITOK | M_ZERO); eb->buckets = hashinit(size, DRM_I915_GEM, &eb->hashmask); - return (eb); + return eb; } static void @@ -250,9 +251,10 @@ eb_get_object(struct eb_objects *eb, uns LIST_FOREACH(obj, &eb->buckets[handle & eb->hashmask], exec_node) { if (obj->exec_handle == handle) - return (obj); + return obj; } - return (NULL); + + return NULL; } static void @@ -374,7 +376,7 @@ i915_gem_execbuffer_relocate_entry(struc /* We can't wait for rendering with pagefaults disabled */ if (obj->active && (curthread->td_pflags & TDP_NOFAULTING) != 0) - return (-EFAULT); + return -EFAULT; reloc->delta += target_offset; if (use_cpu_reloc(obj)) { @@ -389,7 +391,7 @@ i915_gem_execbuffer_relocate_entry(struc sf = sf_buf_alloc(obj->pages[OFF_TO_IDX(reloc->offset)], SFB_NOWAIT); if (sf == NULL) - return (-ENOMEM); + return -ENOMEM; vaddr = (void *)sf_buf_kva(sf); *(uint32_t *)(vaddr + page_offset) = reloc->delta; sf_buf_free(sf); @@ -509,14 +511,13 @@ i915_gem_execbuffer_relocate(struct drm_ i915_gem_retire_requests(dev); ret = 0; - pflags = vm_fault_disable_pagefaults(); /* This is the fast path and we cannot handle a pagefault whilst * holding the device lock lest the user pass in the relocations * contained within a mmaped bo. For in such a case we, the page * fault handler would call i915_gem_fault() and we would try to * acquire the device lock again. Obviously this is bad. */ - + pflags = vm_fault_disable_pagefaults(); list_for_each_entry(obj, objects, exec_list) { ret = i915_gem_execbuffer_relocate_object(obj, eb); if (ret) @@ -585,7 +586,8 @@ i915_gem_execbuffer_reserve(struct intel struct drm_i915_gem_object *obj; struct list_head ordered_objects; bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4; - int ret, retry; + int retry; + int ret; dev_priv = ring->dev->dev_private; INIT_LIST_HEAD(&ordered_objects); @@ -957,11 +959,12 @@ validate_exec_list(struct drm_i915_gem_e return -EINVAL; length = exec[i].relocation_count * - sizeof(struct drm_i915_gem_relocation_entry); + sizeof(struct drm_i915_gem_relocation_entry); if (length == 0) { (*map)[i] = NULL; continue; } + /* * Since both start and end of the relocation region * may be not aligned on the page boundary, be @@ -977,7 +980,7 @@ validate_exec_list(struct drm_i915_gem_e if ((*maplen)[i] == -1) { free(ma, DRM_I915_GEM); (*map)[i] = NULL; - return (-EFAULT); + return -EFAULT; } } @@ -1058,7 +1061,7 @@ i915_gem_fix_mi_batchbuffer_end(struct d char *mkva; uint64_t po_r, po_w; uint32_t cmd; - + po_r = batch_obj->base.dev->agp->base + batch_obj->gtt_offset + batch_start_offset + batch_len; if (batch_len > 0) @@ -1088,7 +1091,7 @@ DRM_DEBUG("batchbuffer does not end by M int i915_fix_mi_batchbuffer_end = 0; - static int +static int i915_reset_gen7_sol_offsets(struct drm_device *dev, struct intel_ring_buffer *ring) { @@ -1125,13 +1128,13 @@ i915_gem_do_execbuffer(struct drm_device struct drm_i915_gem_object *batch_obj; struct drm_clip_rect *cliprects = NULL; struct intel_ring_buffer *ring; - vm_page_t **relocs_ma; - int *relocs_len; u32 ctx_id = i915_execbuffer2_get_context_id(*args); u32 exec_start, exec_len; u32 seqno; u32 mask; int ret, mode, i; + vm_page_t **relocs_ma; + int *relocs_len; if (!i915_gem_check_execbuffer(args)) { DRM_DEBUG("execbuf with invalid offset/length\n"); @@ -1141,10 +1144,10 @@ i915_gem_do_execbuffer(struct drm_device if (args->batch_len == 0) return (0); - ret = validate_exec_list(exec, args->buffer_count, &relocs_ma, - &relocs_len); - if (ret != 0) - goto pre_struct_lock_err; + ret = validate_exec_list(exec, args->buffer_count, + &relocs_ma, &relocs_len); + if (ret) + goto pre_mutex_err; switch (args->flags & I915_EXEC_RING_MASK) { case I915_EXEC_DEFAULT: @@ -1157,7 +1160,7 @@ i915_gem_do_execbuffer(struct drm_device DRM_DEBUG("Ring %s doesn't support contexts\n", ring->name); ret = -EPERM; - goto pre_struct_lock_err; + goto pre_mutex_err; } break; case I915_EXEC_BLT: @@ -1166,20 +1169,20 @@ i915_gem_do_execbuffer(struct drm_device DRM_DEBUG("Ring %s doesn't support contexts\n", ring->name); ret = -EPERM; - goto pre_struct_lock_err; + goto pre_mutex_err; } break; default: DRM_DEBUG("execbuf with unknown ring: %d\n", (int)(args->flags & I915_EXEC_RING_MASK)); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } if (!intel_ring_initialized(ring)) { DRM_DEBUG("execbuf with invalid ring: %d\n", (int)(args->flags & I915_EXEC_RING_MASK)); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } mode = args->flags & I915_EXEC_CONSTANTS_MASK; @@ -1192,13 +1195,13 @@ i915_gem_do_execbuffer(struct drm_device mode != dev_priv->relative_constants_mode) { if (INTEL_INFO(dev)->gen < 4) { ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } if (INTEL_INFO(dev)->gen > 5 && mode == I915_EXEC_CONSTANTS_REL_SURFACE) { ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } /* The HW changed the meaning on this bit on gen6 */ @@ -1209,57 +1212,57 @@ i915_gem_do_execbuffer(struct drm_device default: DRM_DEBUG("execbuf with unknown constants: %d\n", mode); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } if (args->buffer_count < 1) { DRM_DEBUG("execbuf with %d buffers\n", args->buffer_count); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } if (args->num_cliprects != 0) { if (ring != &dev_priv->rings[RCS]) { DRM_DEBUG("clip rectangles are only valid with the render ring\n"); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } if (INTEL_INFO(dev)->gen >= 5) { DRM_DEBUG("clip rectangles are only valid on pre-gen5\n"); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) { DRM_DEBUG("execbuf with %u cliprects\n", args->num_cliprects); ret = -EINVAL; - goto pre_struct_lock_err; + goto pre_mutex_err; } - cliprects = malloc( sizeof(*cliprects) * args->num_cliprects, - DRM_I915_GEM, M_WAITOK | M_ZERO); + cliprects = malloc(args->num_cliprects * sizeof(*cliprects), + DRM_I915_GEM, M_WAITOK | M_ZERO); ret = -copyin((void *)(uintptr_t)args->cliprects_ptr, cliprects, sizeof(*cliprects) * args->num_cliprects); if (ret != 0) - goto pre_struct_lock_err; + goto pre_mutex_err; } ret = i915_mutex_lock_interruptible(dev); if (ret) - goto pre_struct_lock_err; + goto pre_mutex_err; if (dev_priv->mm.suspended) { DRM_UNLOCK(dev); ret = -EBUSY; - goto pre_struct_lock_err; + goto pre_mutex_err; } eb = eb_create(args->buffer_count); if (eb == NULL) { DRM_UNLOCK(dev); ret = -ENOMEM; - goto pre_struct_lock_err; + goto pre_mutex_err; } /* Look up object handles */ @@ -1350,7 +1353,7 @@ i915_gem_do_execbuffer(struct drm_device mode != dev_priv->relative_constants_mode) { ret = intel_ring_begin(ring, 4); if (ret) - goto err; + goto err; intel_ring_emit(ring, MI_NOOP); intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1)); @@ -1375,9 +1378,6 @@ i915_gem_do_execbuffer(struct drm_device args->batch_start_offset, args->batch_len); } - CTR4(KTR_DRM, "ring_dispatch %s %d exec %x %x", ring->name, seqno, - exec_start, exec_len); - if (cliprects) { for (i = 0; i < args->num_cliprects; i++) { ret = i915_emit_box(dev, &cliprects[i], @@ -1397,6 +1397,9 @@ i915_gem_do_execbuffer(struct drm_device goto err; } + CTR4(KTR_DRM, "ring_dispatch %s %d exec %x %x", ring->name, seqno, + exec_start, exec_len); + i915_gem_execbuffer_move_to_active(&objects, ring, seqno); i915_gem_execbuffer_retire_commands(dev, file, ring); @@ -1411,9 +1414,10 @@ err: list_del_init(&obj->exec_list); drm_gem_object_unreference(&obj->base); } + DRM_UNLOCK(dev); -pre_struct_lock_err: +pre_mutex_err: for (i = 0; i < args->buffer_count; i++) { if (relocs_ma[i] != NULL) { vm_page_unhold_pages(relocs_ma[i], relocs_len[i]); @@ -1461,7 +1465,7 @@ i915_gem_execbuffer(struct drm_device *d args->buffer_count, ret); free(exec_list, DRM_I915_GEM); free(exec2_list, DRM_I915_GEM); - return (ret); + return ret; } for (i = 0; i < args->buffer_count; i++) { @@ -1525,8 +1529,8 @@ i915_gem_execbuffer2(struct drm_device * } /* XXXKIB user-controllable malloc size */ - exec2_list = malloc(sizeof(*exec2_list) * args->buffer_count, - DRM_I915_GEM, M_WAITOK); + exec2_list = malloc(sizeof(*exec2_list)*args->buffer_count, + DRM_I915_GEM, M_WAITOK); ret = -copyin((void *)(uintptr_t)args->buffers_ptr, exec2_list, sizeof(*exec2_list) * args->buffer_count); if (ret != 0) { Modified: head/sys/dev/drm2/i915/intel_pm.c ============================================================================== --- head/sys/dev/drm2/i915/intel_pm.c Sat Oct 31 10:16:44 2015 (r290227) +++ head/sys/dev/drm2/i915/intel_pm.c Sat Oct 31 15:09:31 2015 (r290228) @@ -602,7 +602,7 @@ static void i915_ironlake_get_mem_freq(s dev_priv->mem_freq = 1600; break; default: - DRM_DEBUG("unknown memory frequency 0x%02x\n", + DRM_DEBUG_DRIVER("unknown memory frequency 0x%02x\n", ddrpll & 0xff); dev_priv->mem_freq = 0; break; @@ -633,7 +633,7 @@ static void i915_ironlake_get_mem_freq(s dev_priv->fsb_freq = 6400; break; default: - DRM_DEBUG("unknown fsb frequency 0x%04x\n", + DRM_DEBUG_DRIVER("unknown fsb frequency 0x%04x\n", csipll & 0x3ff); dev_priv->fsb_freq = 0; break; @@ -2706,7 +2706,7 @@ unsigned long i915_chipset_val(struct dr * zero and give the hw a chance to gather more samples. */ if (diff1 <= 10) - return (dev_priv->chipset_power); + return dev_priv->chipset_power; count1 = I915_READ(DMIEC); count2 = I915_READ(DDREC); @@ -2739,7 +2739,7 @@ unsigned long i915_chipset_val(struct dr dev_priv->last_time1 = now; dev_priv->chipset_power = ret; - return (ret); + return ret; } unsigned long i915_mch_val(struct drm_i915_private *dev_priv) @@ -3192,6 +3192,18 @@ void intel_init_emon(struct drm_device * dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); } +static void ibx_init_clock_gating(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + + /* + * On Ibex Peak and Cougar Point, we need to disable clock + * gating for the panel power sequencer or it will fail to + * start up when no ports are active. + */ + I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); +} + static void ironlake_init_clock_gating(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -3261,6 +3273,24 @@ static void ironlake_init_clock_gating(s _3D_CHICKEN2_WM_READ_PIPELINED); } +static void cpt_init_clock_gating(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + int pipe; + + /* + * On Ibex Peak and Cougar Point, we need to disable clock + * gating for the panel power sequencer or it will fail to + * start up when no ports are active. + */ + I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); + I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | + DPLS_EDP_PPS_FIX_DIS); + /* Without this, mode sets may fail silently on FDI */ + for_each_pipe(pipe) + I915_WRITE(TRANS_CHICKEN2(pipe), TRANS_AUTOTRAIN_GEN_STALL_DIS); +} + static void gen6_init_clock_gating(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -3510,36 +3540,6 @@ static void i830_init_clock_gating(struc I915_WRITE(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE); } -static void ibx_init_clock_gating(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - - /* - * On Ibex Peak and Cougar Point, we need to disable clock - * gating for the panel power sequencer or it will fail to - * start up when no ports are active. - */ - I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); -} - -static void cpt_init_clock_gating(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - int pipe; - - /* - * On Ibex Peak and Cougar Point, we need to disable clock - * gating for the panel power sequencer or it will fail to - * start up when no ports are active. - */ - I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); - I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | - DPLS_EDP_PPS_FIX_DIS); - /* Without this, mode sets may fail silently on FDI */ - for_each_pipe(pipe) - I915_WRITE(TRANS_CHICKEN2(pipe), TRANS_AUTOTRAIN_GEN_STALL_DIS); -} - void intel_init_clock_gating(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; Modified: head/sys/dev/drm2/i915/intel_ringbuffer.h ============================================================================== --- head/sys/dev/drm2/i915/intel_ringbuffer.h Sat Oct 31 10:16:44 2015 (r290227) +++ head/sys/dev/drm2/i915/intel_ringbuffer.h Sat Oct 31 15:09:31 2015 (r290228) @@ -81,15 +81,15 @@ struct intel_ring_buffer { int (*init)(struct intel_ring_buffer *ring); void (*write_tail)(struct intel_ring_buffer *ring, - uint32_t value); + u32 value); int (*flush)(struct intel_ring_buffer *ring, - uint32_t invalidate_domains, - uint32_t flush_domains); + u32 invalidate_domains, + u32 flush_domains); int (*add_request)(struct intel_ring_buffer *ring, uint32_t *seqno); uint32_t (*get_seqno)(struct intel_ring_buffer *ring); int (*dispatch_execbuffer)(struct intel_ring_buffer *ring, - uint32_t offset, uint32_t length); + u32 offset, u32 length); #define I915_DISPATCH_SECURE 0x1 #define I915_DISPATCH_PINNED 0x2 void (*cleanup)(struct intel_ring_buffer *ring); @@ -155,7 +155,7 @@ intel_ring_flag(struct intel_ring_buffer return 1 << ring->id; } -static inline uint32_t +static inline u32 intel_ring_sync_index(struct intel_ring_buffer *ring, struct intel_ring_buffer *other) { @@ -180,7 +180,7 @@ intel_read_status_page(struct intel_ring { /* Ensure that the compiler doesn't optimize away the load. */ __compiler_membar(); - return (atomic_load_acq_32(ring->status_page.page_addr + reg)); + return atomic_load_acq_32(ring->status_page.page_addr + reg); } void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); @@ -221,7 +221,6 @@ static inline u32 intel_ring_get_tail(st void i915_trace_irq_get(struct intel_ring_buffer *ring, uint32_t seqno); /* DRI warts */ -int intel_render_ring_init_dri(struct drm_device *dev, uint64_t start, - uint32_t size); +int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size); #endif /* _INTEL_RINGBUFFER_H_ */ From owner-svn-src-head@freebsd.org Sat Oct 31 20:38:08 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 226A1A22C5F; Sat, 31 Oct 2015 20:38:08 +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 mx1.freebsd.org (Postfix) with ESMTPS id CD67B1510; Sat, 31 Oct 2015 20:38:07 +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 t9VKc6BJ096850; Sat, 31 Oct 2015 20:38:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9VKc6Zk096843; Sat, 31 Oct 2015 20:38:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510312038.t9VKc6Zk096843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 31 Oct 2015 20:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290229 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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, 31 Oct 2015 20:38:08 -0000 Author: cem Date: Sat Oct 31 20:38:06 2015 New Revision: 290229 URL: https://svnweb.freebsd.org/changeset/base/290229 Log: ioat: Handle channel-fatal HW errors safely Certain invalid operations trigger hardware error conditions. Error conditions that only halt one channel can be detected and recovered by resetting the channel. Error conditions that halt the whole device are generally not recoverable. Add a sysctl to inject channel-fatal HW errors, 'dev.ioat..force_hw_error=1'. When a halt due to a channel error is detected, ioat(4) blocks new operations from being queued on the channel, completes any outstanding operations with an error status, and resets the channel before allowing new operations to be queued again. Update ioat.4 to document error recovery; document blockfill introduced in r290021 while we are here; document ioat_put_dmaengine() added in r289907; document DMA_NO_WAIT added in r289982. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_hw.h head/sys/dev/ioat/ioat_internal.h head/sys/dev/ioat/ioat_test.c Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Sat Oct 31 15:09:31 2015 (r290228) +++ head/share/man/man4/ioat.4 Sat Oct 31 20:38:06 2015 (r290229) @@ -24,14 +24,25 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2015 +.Dd October 31, 2015 .Dt IOAT 4 .Os .Sh NAME .Nm I/OAT .Nd Intel I/O Acceleration Technology .Sh SYNOPSIS +To compile this driver into your kernel, +place the following line in your kernel configuration file: +.Bd -ragged -offset indent .Cd "device ioat" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ioat_load="YES" +.Ed +.Pp In .Xr loader.conf 5 : .Pp @@ -46,11 +57,13 @@ In (only critical errors; maximum of 3) .Pp .Ft typedef void -.Fn (*bus_dmaengine_callback_t) "void *arg" +.Fn (*bus_dmaengine_callback_t) "void *arg" "int error" .Pp .Ft bus_dmaengine_t .Fn ioat_get_dmaengine "uint32_t channel_index" .Ft void +.Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine" +.Ft void .Fn ioat_acquire "bus_dmaengine_t dmaengine" .Ft void .Fn ioat_release "bus_dmaengine_t dmaengine" @@ -65,6 +78,16 @@ In .Fa "uint32_t flags" .Fc .Ft struct bus_dmadesc * +.Fo ioat_blockfill +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t dst" +.Fa "uint64_t fillpattern" +.Fa "bus_size_t len" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * .Fo ioat_null .Fa "bus_dmaengine_t dmaengine" .Fa "bus_dmaengine_callback_t callback_fn" @@ -82,7 +105,9 @@ There is a number of DMA channels per CP Each may be used independently. Operations on a single channel proceed sequentially. .Pp -Copy operations may be used to offload memory copies to the DMA engines. +Blockfill operations can be used to write a 64-bit pattern to memory. +.Pp +Copy operations can be used to offload memory copies to the DMA engines. .Pp Null operations do nothing, but may be used to test the interrupt and callback mechanism. @@ -92,6 +117,26 @@ All operations can optionally trigger an flag. For example, a user might submit multiple operations to the same channel and only enable an interrupt and callback for the last operation. +.Pp +All operations are safe to use in a non-blocking context with the +.Ar DMA_NO_WAIT +flag. +(Of course, allocations may fail and operations requested with +.Ar DMA_NO_WAIT +may return NULL.) +.Pp +All operations, as well as +.Fn ioat_get_dmaengine , +can return NULL in special circumstances. +For example, if the +.Nm +driver is being unloaded, or the administrator has induced a hardware reset, or +a usage error has resulted in a hardware error state that needs to be recovered +from. +.Pp +It is invalid to attempt to submit new DMA operations in a +.Fa bus_dmaengine_callback_t +context. .Sh USAGE A typical user will lookup the DMA engine object for a given channel with .Fn ioat_get_dmaengine . @@ -101,10 +146,11 @@ the .Ar bus_dmaengine_t object for exclusive access to enqueue operations on that channel. Then, they will submit one or more operations using -.Fn ioat_copy +.Fn ioat_blockfill , +.Fn ioat_copy , or .Fn ioat_null . -Finally, they will +After queueing one or more individual DMA operations, they will .Fn ioat_release the .Ar bus_dmaengine_t @@ -114,6 +160,19 @@ The routine they provided for the argument will be invoked with the provided .Fa callback_arg when the operation is complete. +When they are finished with the +.Ar bus_dmaengine_t , +the user should +.Fn ioat_put_dmaengine . +.Pp +Users MUST NOT block between +.Fn ioat_acquire +and +.Fn ioat_release . +Users SHOULD NOT hold +.Ar bus_dmaengine_t +references for a very long time to enable fault recovery and kernel module +unload. .Pp For an example of usage, see .Pa src/sys/dev/ioat/ioat_test.c . @@ -135,19 +194,23 @@ The .Nm driver was developed by .An \&Jim Harris Aq Mt jimharris@FreeBSD.org , +.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com , and -.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com . +.An \&Conrad Meyer Aq Mt cem@FreeBSD.org . This manual page was written by .An \&Conrad Meyer Aq Mt cem@FreeBSD.org . .Sh CAVEATS Copy operation takes bus addresses as parameters, not virtual addresses. .Pp -Copies larger than max transfer size (1MB) are not supported. +Buffers for individual copy operations must be physically contiguous. +.Pp +Copies larger than max transfer size (1MB, but may vary by hardware) are not +supported. Future versions will likely support this by breaking up the transfer into smaller sizes. .Sh BUGS The .Nm -driver only supports copy and null operations at this time. +driver only supports blockfill, copy, and null operations at this time. The driver does not yet support advanced DMA modes, such as XOR, that some I/OAT devices support. Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Sat Oct 31 15:09:31 2015 (r290228) +++ head/sys/dev/ioat/ioat.c Sat Oct 31 20:38:06 2015 (r290229) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,6 +66,7 @@ static void ioat_dmamap_cb(void *arg, bu int error); static void ioat_interrupt_handler(void *arg); static boolean_t ioat_model_resets_msix(struct ioat_softc *ioat); +static int chanerr_to_errno(uint32_t); static void ioat_process_events(struct ioat_softc *ioat); static inline uint32_t ioat_get_active(struct ioat_softc *ioat); static inline uint32_t ioat_get_ring_space(struct ioat_softc *ioat); @@ -83,6 +85,7 @@ static int ring_grow(struct ioat_softc * struct ioat_descriptor **); static int ring_shrink(struct ioat_softc *, uint32_t oldorder, struct ioat_descriptor **); +static void ioat_halted_debug(struct ioat_softc *, uint32_t); static void ioat_timer_callback(void *arg); static void dump_descriptor(void *hw_desc); static void ioat_submit_single(struct ioat_softc *ioat); @@ -94,8 +97,12 @@ static int sysctl_handle_reset(SYSCTL_HA static inline struct ioat_softc *ioat_get(struct ioat_softc *, enum ioat_ref_kind); static inline void ioat_put(struct ioat_softc *, enum ioat_ref_kind); +static inline void _ioat_putn(struct ioat_softc *, uint32_t, + enum ioat_ref_kind, boolean_t); static inline void ioat_putn(struct ioat_softc *, uint32_t, enum ioat_ref_kind); +static inline void ioat_putn_locked(struct ioat_softc *, uint32_t, + enum ioat_ref_kind); static void ioat_drain_locked(struct ioat_softc *); #define ioat_log_message(v, ...) do { \ @@ -388,9 +395,15 @@ ioat3_attach(device_t device) /* TODO: need to check DCA here if we ever do XOR/PQ */ mtx_init(&ioat->submit_lock, "ioat_submit", NULL, MTX_DEF); - mtx_init(&ioat->cleanup_lock, "ioat_process_events", NULL, MTX_DEF); + mtx_init(&ioat->cleanup_lock, "ioat_cleanup", NULL, MTX_DEF); callout_init(&ioat->timer, 1); + /* Establish lock order for Witness */ + mtx_lock(&ioat->submit_lock); + mtx_lock(&ioat->cleanup_lock); + mtx_unlock(&ioat->cleanup_lock); + mtx_unlock(&ioat->submit_lock); + ioat->is_resize_pending = FALSE; ioat->is_completion_pending = FALSE; ioat->is_reset_pending = FALSE; @@ -566,13 +579,30 @@ ioat_interrupt_handler(void *arg) ioat_process_events(ioat); } +static int +chanerr_to_errno(uint32_t chanerr) +{ + + if (chanerr == 0) + return (0); + if ((chanerr & (IOAT_CHANERR_XSADDERR | IOAT_CHANERR_XDADDERR)) != 0) + return (EFAULT); + if ((chanerr & (IOAT_CHANERR_RDERR | IOAT_CHANERR_WDERR)) != 0) + return (EIO); + /* This one is probably our fault: */ + if ((chanerr & IOAT_CHANERR_NDADDERR) != 0) + return (EIO); + return (EIO); +} + static void ioat_process_events(struct ioat_softc *ioat) { struct ioat_descriptor *desc; struct bus_dmadesc *dmadesc; uint64_t comp_update, status; - uint32_t completed; + uint32_t completed, chanerr; + int error; mtx_lock(&ioat->cleanup_lock); @@ -590,8 +620,8 @@ ioat_process_events(struct ioat_softc *i dmadesc = &desc->bus_dmadesc; CTR1(KTR_IOAT, "completing desc %d", ioat->tail); - if (dmadesc->callback_fn) - (*dmadesc->callback_fn)(dmadesc->callback_arg); + if (dmadesc->callback_fn != NULL) + dmadesc->callback_fn(dmadesc->callback_arg, 0); completed++; ioat->tail++; @@ -613,6 +643,44 @@ out: ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); wakeup(&ioat->tail); + + if (!is_ioat_halted(comp_update)) + return; + + /* + * Fatal programming error on this DMA channel. Flush any outstanding + * work with error status and restart the engine. + */ + ioat_log_message(0, "Channel halted due to fatal programming error\n"); + mtx_lock(&ioat->submit_lock); + mtx_lock(&ioat->cleanup_lock); + ioat->quiescing = TRUE; + + chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); + ioat_halted_debug(ioat, chanerr); + + while (ioat_get_active(ioat) > 0) { + desc = ioat_get_ring_entry(ioat, ioat->tail); + dmadesc = &desc->bus_dmadesc; + CTR1(KTR_IOAT, "completing err desc %d", ioat->tail); + + if (dmadesc->callback_fn != NULL) + dmadesc->callback_fn(dmadesc->callback_arg, + chanerr_to_errno(chanerr)); + + ioat_putn_locked(ioat, 1, IOAT_ACTIVE_DESCR_REF); + ioat->tail++; + } + + /* Clear error status */ + ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); + + mtx_unlock(&ioat->cleanup_lock); + mtx_unlock(&ioat->submit_lock); + + ioat_log_message(0, "Resetting channel to recover from error\n"); + error = ioat_reset_hw(ioat); + KASSERT(error == 0, ("%s: reset failed: %d", __func__, error)); } /* @@ -841,6 +909,7 @@ ioat_alloc_ring_entry(struct ioat_softc if (hw_desc == NULL) goto out; + memset(&desc->bus_dmadesc, 0, sizeof(desc->bus_dmadesc)); desc->u.generic = hw_desc; error = bus_dmamap_load(ioat->hw_desc_tag, ioat->hw_desc_map, hw_desc, @@ -1168,13 +1237,13 @@ ioat_halted_debug(struct ioat_softc *ioa if (chanerr == 0) return; - mtx_lock(&ioat->submit_lock); + mtx_assert(&ioat->cleanup_lock, MA_OWNED); + desc = ioat_get_ring_entry(ioat, ioat->tail + 0); dump_descriptor(desc->u.raw); desc = ioat_get_ring_entry(ioat, ioat->tail + 1); dump_descriptor(desc->u.raw); - mtx_unlock(&ioat->submit_lock); } static void @@ -1182,53 +1251,43 @@ ioat_timer_callback(void *arg) { struct ioat_descriptor **newring; struct ioat_softc *ioat; - uint64_t status; - uint32_t chanerr, order; + uint32_t order; ioat = arg; ioat_log_message(1, "%s\n", __func__); if (ioat->is_completion_pending) { - status = ioat_get_chansts(ioat); - - /* - * When halted due to errors, check for channel programming - * errors before advancing the completion state. - */ - if (is_ioat_halted(status)) { - chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); - ioat_halted_debug(ioat, chanerr); - } ioat_process_events(ioat); - } else { - mtx_lock(&ioat->submit_lock); - order = ioat->ring_size_order; - if (ioat->is_resize_pending || order == IOAT_MIN_ORDER) { - mtx_unlock(&ioat->submit_lock); - goto out; - } - ioat->is_resize_pending = TRUE; + return; + } + + /* Slowly scale the ring down if idle. */ + mtx_lock(&ioat->submit_lock); + order = ioat->ring_size_order; + if (ioat->is_resize_pending || order == IOAT_MIN_ORDER) { mtx_unlock(&ioat->submit_lock); + goto out; + } + ioat->is_resize_pending = TRUE; + mtx_unlock(&ioat->submit_lock); - newring = ioat_prealloc_ring(ioat, 1 << (order - 1), FALSE, - M_NOWAIT); + newring = ioat_prealloc_ring(ioat, 1 << (order - 1), FALSE, + M_NOWAIT); - mtx_lock(&ioat->submit_lock); - KASSERT(ioat->ring_size_order == order, - ("resize_pending protects order")); + mtx_lock(&ioat->submit_lock); + KASSERT(ioat->ring_size_order == order, + ("resize_pending protects order")); - if (newring != NULL) - ring_shrink(ioat, order, newring); + if (newring != NULL) + ring_shrink(ioat, order, newring); - ioat->is_resize_pending = FALSE; - mtx_unlock(&ioat->submit_lock); + ioat->is_resize_pending = FALSE; + mtx_unlock(&ioat->submit_lock); out: - /* Slowly scale the ring down if idle. */ - if (ioat->ring_size_order > IOAT_MIN_ORDER) - callout_reset(&ioat->timer, 10 * hz, - ioat_timer_callback, ioat); - } + if (ioat->ring_size_order > IOAT_MIN_ORDER) + callout_reset(&ioat->timer, 10 * hz, + ioat_timer_callback, ioat); } /* @@ -1326,8 +1385,10 @@ ioat_reset_hw(struct ioat_softc *ioat) } chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); - ioat_halted_debug(ioat, chanerr); if (chanerr != 0) { + mtx_lock(&ioat->cleanup_lock); + ioat_halted_debug(ioat, chanerr); + mtx_unlock(&ioat->cleanup_lock); error = EIO; goto out; } @@ -1359,6 +1420,79 @@ out: } static int +sysctl_handle_chansts(SYSCTL_HANDLER_ARGS) +{ + struct ioat_softc *ioat; + struct sbuf sb; + uint64_t status; + int error; + + ioat = arg1; + + status = ioat_get_chansts(ioat) & IOAT_CHANSTS_STATUS; + + sbuf_new_for_sysctl(&sb, NULL, 256, req); + switch (status) { + case IOAT_CHANSTS_ACTIVE: + sbuf_printf(&sb, "ACTIVE"); + break; + case IOAT_CHANSTS_IDLE: + sbuf_printf(&sb, "IDLE"); + break; + case IOAT_CHANSTS_SUSPENDED: + sbuf_printf(&sb, "SUSPENDED"); + break; + case IOAT_CHANSTS_HALTED: + sbuf_printf(&sb, "HALTED"); + break; + case IOAT_CHANSTS_ARMED: + sbuf_printf(&sb, "ARMED"); + break; + default: + sbuf_printf(&sb, "UNKNOWN"); + break; + } + error = sbuf_finish(&sb); + sbuf_delete(&sb); + + if (error != 0 || req->newptr == NULL) + return (error); + return (EINVAL); +} + +static int +sysctl_handle_error(SYSCTL_HANDLER_ARGS) +{ + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + int error, arg; + + ioat = arg1; + + arg = 0; + error = SYSCTL_OUT(req, &arg, sizeof(arg)); + if (error != 0 || req->newptr == NULL) + return (error); + + error = SYSCTL_IN(req, &arg, sizeof(arg)); + if (error != 0) + return (error); + + if (arg != 0) { + ioat_acquire(&ioat->dmaengine); + desc = ioat_op_generic(ioat, IOAT_OP_COPY, 1, + 0xffff000000000000ull, 0xffff000000000000ull, NULL, NULL, + 0); + if (desc == NULL) + error = ENOMEM; + else + ioat_submit_single(ioat); + ioat_release(&ioat->dmaengine); + } + return (error); +} + +static int sysctl_handle_reset(SYSCTL_HANDLER_ARGS) { struct ioat_softc *ioat; @@ -1435,6 +1569,12 @@ ioat_setup_sysctl(device_t device) SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "force_hw_reset", CTLTYPE_INT | CTLFLAG_RW, ioat, 0, sysctl_handle_reset, "I", "Set to non-zero to reset the hardware"); + SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "force_hw_error", + CTLTYPE_INT | CTLFLAG_RW, ioat, 0, sysctl_handle_error, "I", + "Set to non-zero to inject a recoverable hardware error"); + SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "chansts", + CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", + "String of the channel status"); } static inline struct ioat_softc * @@ -1458,6 +1598,21 @@ ioat_get(struct ioat_softc *ioat, enum i static inline void ioat_putn(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind) { + + _ioat_putn(ioat, n, kind, FALSE); +} + +static inline void +ioat_putn_locked(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind) +{ + + _ioat_putn(ioat, n, kind, TRUE); +} + +static inline void +_ioat_putn(struct ioat_softc *ioat, uint32_t n, enum ioat_ref_kind kind, + boolean_t locked) +{ uint32_t old; KASSERT(kind < IOAT_NUM_REF_KINDS, ("bogus")); @@ -1479,13 +1634,18 @@ ioat_putn(struct ioat_softc *ioat, uint3 return; } - mtx_lock(IOAT_REFLK); + if (locked) + mtx_assert(IOAT_REFLK, MA_OWNED); + else + mtx_lock(IOAT_REFLK); + old = atomic_fetchadd_32(&ioat->refcnt, -n); KASSERT(old >= n, ("refcnt error")); if (old == n) wakeup(IOAT_REFLK); - mtx_unlock(IOAT_REFLK); + if (!locked) + mtx_unlock(IOAT_REFLK); } static inline void Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Sat Oct 31 15:09:31 2015 (r290228) +++ head/sys/dev/ioat/ioat.h Sat Oct 31 20:38:06 2015 (r290229) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); typedef void *bus_dmaengine_t; struct bus_dmadesc; -typedef void (*bus_dmaengine_callback_t)(void *arg); +typedef void (*bus_dmaengine_callback_t)(void *arg, int error); /* * Called first to acquire a reference to the DMA channel Modified: head/sys/dev/ioat/ioat_hw.h ============================================================================== --- head/sys/dev/ioat/ioat_hw.h Sat Oct 31 15:09:31 2015 (r290228) +++ head/sys/dev/ioat/ioat_hw.h Sat Oct 31 20:38:06 2015 (r290229) @@ -81,7 +81,9 @@ __FBSDID("$FreeBSD$"); #define IOAT_CHANCTRL_ERR_COMPLETION_EN 0x0004 #define IOAT_CHANCTRL_INT_REARM 0x0001 #define IOAT_CHANCTRL_RUN (IOAT_CHANCTRL_INT_REARM |\ - IOAT_CHANCTRL_ANY_ERR_ABORT_EN) + IOAT_CHANCTRL_ERR_COMPLETION_EN |\ + IOAT_CHANCTRL_ANY_ERR_ABORT_EN |\ + IOAT_CHANCTRL_ERR_INT_EN) #define IOAT_CHANCMD_OFFSET 0x84 #define IOAT_CHANCMD_RESET 0x20 @@ -98,6 +100,7 @@ __FBSDID("$FreeBSD$"); #define IOAT_CHANSTS_IDLE 0x1 #define IOAT_CHANSTS_SUSPENDED 0x2 #define IOAT_CHANSTS_HALTED 0x3 +#define IOAT_CHANSTS_ARMED 0x4 #define IOAT_CHANSTS_UNAFFILIATED_ERROR 0x8ULL #define IOAT_CHANSTS_SOFT_ERROR 0x10ULL Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Sat Oct 31 15:09:31 2015 (r290228) +++ head/sys/dev/ioat/ioat_internal.h Sat Oct 31 20:38:06 2015 (r290229) @@ -343,8 +343,6 @@ struct ioat_descriptor { struct ioat_raw_hw_descriptor *raw; } u; uint32_t id; - uint32_t length; - enum validate_flags *validate_result; bus_addr_t hw_desc_bus_addr; }; Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Sat Oct 31 15:09:31 2015 (r290228) +++ head/sys/dev/ioat/ioat_test.c Sat Oct 31 20:38:06 2015 (r290229) @@ -166,11 +166,14 @@ ioat_compare_ok(struct test_transaction } static void -ioat_dma_test_callback(void *arg) +ioat_dma_test_callback(void *arg, int error) { struct test_transaction *tx; struct ioat_test *test; + if (error != 0) + ioat_test_log(0, "%s: Got error: %d\n", __func__, error); + tx = arg; test = tx->test;