From owner-svn-src-stable@freebsd.org Sun Nov 8 00:50:47 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB932A22507; Sun, 8 Nov 2015 00:50:47 +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 92CE21D50; Sun, 8 Nov 2015 00:50:47 +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 tA80oki4048481; Sun, 8 Nov 2015 00:50:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA80ok3p048479; Sun, 8 Nov 2015 00:50:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511080050.tA80ok3p048479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 8 Nov 2015 00:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290527 - in stable/9: sbin/camcontrol share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 00:50:48 -0000 Author: ngie Date: Sun Nov 8 00:50:46 2015 New Revision: 290527 URL: https://svnweb.freebsd.org/changeset/base/290527 Log: MFstable/10 r290385: MFC r289913,r289916: r289913: 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 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division r289916: 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. PR: 200619 Reported by: Michael Baptist Submitted by: Lars Skodje Sponsored by: EMC / Isilon Storage Division Modified: stable/9/sbin/camcontrol/modeedit.c stable/9/share/misc/scsi_modes Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/camcontrol/ (props changed) stable/9/share/ (props changed) stable/9/share/misc/ (props changed) Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Sun Nov 8 00:50:18 2015 (r290526) +++ stable/9/sbin/camcontrol/modeedit.c Sun Nov 8 00:50:46 2015 (r290527) @@ -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') Modified: stable/9/share/misc/scsi_modes ============================================================================== --- stable/9/share/misc/scsi_modes Sun Nov 8 00:50:18 2015 (r290526) +++ stable/9/share/misc/scsi_modes Sun Nov 8 00:50:46 2015 (r290527) @@ -106,7 +106,7 @@ {EBACKERR} t1 {LogErr} t1 {Reserved} *t4 - {MRIE} b4 + {MRIE} t4 {Interval Timer} i4 {Report Count} i4 } From owner-svn-src-stable@freebsd.org Sun Nov 8 13:37:18 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D79A296E4; Sun, 8 Nov 2015 13:37:18 +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 127FE108B; Sun, 8 Nov 2015 13:37:17 +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 tA8DbHcT072204; Sun, 8 Nov 2015 13:37:17 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8DbGEL072196; Sun, 8 Nov 2015 13:37:16 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201511081337.tA8DbGEL072196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 8 Nov 2015 13:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290544 - in stable/10: include lib/libc/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 13:37:18 -0000 Author: ache Date: Sun Nov 8 13:37:16 2015 New Revision: 290544 URL: https://svnweb.freebsd.org/changeset/base/290544 Log: MFC: r289863,r289931,r290110,r290230,r290231,r290232 r290232: Microoptimize. r290231: Addition to prev. commit. In some edge cases fp->_p can be changed in _sseek(), recalculate. r290230: Don't seek to the end if write buffer is empty (in append modes). PR: 204156 r290110: Add _flags2 per jhb@ suggestion since no room left in _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. r289931: According to POSIX, a write operation shall start at the current size of the stream (if mode had 'a' as the first character). r289863: 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(). Modified: stable/10/include/stdio.h stable/10/lib/libc/stdio/fdopen.c stable/10/lib/libc/stdio/findfp.c stable/10/lib/libc/stdio/fmemopen.c stable/10/lib/libc/stdio/fopen.c stable/10/lib/libc/stdio/freopen.c stable/10/lib/libc/stdio/ftell.c stable/10/lib/libc/stdio/stdio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/include/stdio.h ============================================================================== --- stable/10/include/stdio.h Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/include/stdio.h Sun Nov 8 13:37:16 2015 (r290544) @@ -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: stable/10/lib/libc/stdio/fdopen.c ============================================================================== --- stable/10/lib/libc/stdio/fdopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/fdopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -90,7 +90,9 @@ fdopen(int fd, const char *mode) * O_APPEND bit set, assert __SAPP so that __swrite() caller * will _sseek() to the end before write. */ - if ((oflags & O_APPEND) && !(fdflags & O_APPEND)) + if (fdflags & O_APPEND) + fp->_flags2 |= __S2OAP; + else if (oflags & O_APPEND) fp->_flags |= __SAPP; fp->_file = fd; fp->_cookie = fp; Modified: stable/10/lib/libc/stdio/findfp.c ============================================================================== --- stable/10/lib/libc/stdio/findfp.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/findfp.c Sun Nov 8 13:37:16 2015 (r290544) @@ -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: stable/10/lib/libc/stdio/fmemopen.c ============================================================================== --- stable/10/lib/libc/stdio/fmemopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/fmemopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -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. Modified: stable/10/lib/libc/stdio/fopen.c ============================================================================== --- stable/10/lib/libc/stdio/fopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/fopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -91,7 +91,9 @@ fopen(const char * __restrict file, cons * we can do about this. (We could set __SAPP and check in * fseek and ftell.) */ - if (oflags & O_APPEND) + if (oflags & O_APPEND) { + fp->_flags2 |= __S2OAP; (void)_sseek(fp, (fpos_t)0, SEEK_END); + } return (fp); } Modified: stable/10/lib/libc/stdio/freopen.c ============================================================================== --- stable/10/lib/libc/stdio/freopen.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/freopen.c Sun Nov 8 13:37:16 2015 (r290544) @@ -186,6 +186,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) @@ -239,8 +240,10 @@ finish: * we can do about this. (We could set __SAPP and check in * fseek and ftell.) */ - if (oflags & O_APPEND) + if (oflags & O_APPEND) { + fp->_flags2 |= __S2OAP; (void) _sseek(fp, (fpos_t)0, SEEK_END); + } FUNLOCKFILE(fp); return (fp); } Modified: stable/10/lib/libc/stdio/ftell.c ============================================================================== --- stable/10/lib/libc/stdio/ftell.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/ftell.c Sun Nov 8 13:37:16 2015 (r290544) @@ -88,7 +88,6 @@ _ftello(FILE *fp, fpos_t *offset) { fpos_t pos; size_t n; - int dflags; if (fp->_seek == NULL) { errno = ESPIPE; /* historic practice */ @@ -119,29 +118,33 @@ _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) { - dflags = 0; - if (fp->_flags & __SAPP) - dflags = O_APPEND; - else if (fp->_file != -1 && - (dflags = _fcntl(fp->_file, F_GETFL)) < 0) - return (1); - if ((dflags & O_APPEND) && - (pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { - if ((fp->_flags & __SOPT) || __sflush(fp) || - (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) - return (1); - else { - *offset = pos; - return (0); - } - } + } else if ((fp->_flags & __SWR) && fp->_p != NULL && + (n = fp->_p - fp->_bf._base) > 0) { /* * Writing. Any buffered characters cause the * position to be greater than that in the * underlying object. */ - n = fp->_p - fp->_bf._base; + if ((fp->_flags & __SAPP) || (fp->_flags2 & __S2OAP)) { + int serrno = errno; + + errno = 0; + if ((pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { + if (errno == ESPIPE || + (fp->_flags & __SOPT) || __sflush(fp) || + (pos = + _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) + return (1); + else { + errno = serrno; + *offset = pos; + return (0); + } + } + errno = serrno; + /* fp->_p can be changed in _sseek(), recalculate. */ + n = fp->_p - fp->_bf._base; + } if (pos > OFF_MAX - n) { errno = EOVERFLOW; return (1); Modified: stable/10/lib/libc/stdio/stdio.c ============================================================================== --- stable/10/lib/libc/stdio/stdio.c Sun Nov 8 12:24:19 2015 (r290543) +++ stable/10/lib/libc/stdio/stdio.c Sun Nov 8 13:37:16 2015 (r290544) @@ -117,7 +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) { - if ((fp->_flags & (__SAPP|__SOFF)) == (__SAPP|__SOFF) && + if ((fp->_flags & __SOFF) && !(fp->_flags2 & __S2OAP) && fp->_offset <= OFF_MAX - ret) fp->_offset += ret; else From owner-svn-src-stable@freebsd.org Sun Nov 8 14:22:59 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A92A29286; Sun, 8 Nov 2015 14:22:59 +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 BB7F2151A; Sun, 8 Nov 2015 14:22:58 +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 tA8EMvdD086376; Sun, 8 Nov 2015 14:22:57 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA8EMvpj086375; Sun, 8 Nov 2015 14:22:57 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201511081422.tA8EMvpj086375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sun, 8 Nov 2015 14:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290546 - stable/10/usr.bin/bsdiff/bsdiff X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 14:22:59 -0000 Author: ache Date: Sun Nov 8 14:22:57 2015 New Revision: 290546 URL: https://svnweb.freebsd.org/changeset/base/290546 Log: MFC: r290329,r290336 PR: 204230 r290329: Use meaningful errno for ssize_t overflow in read(). Catch size_t overflow in malloc(). r290336: Check for (old|new)size + 1 overflows off_t. Modified: stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Sun Nov 8 13:44:21 2015 (r290545) +++ stable/10/usr.bin/bsdiff/bsdiff/bsdiff.c Sun Nov 8 14:22:57 2015 (r290546) @@ -31,7 +31,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include #include @@ -221,8 +224,17 @@ int main(int argc,char *argv[]) /* Allocate oldsize+1 bytes instead of oldsize bytes to ensure that we never try to malloc(0) and get a NULL pointer */ if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) || - ((oldsize=lseek(fd,0,SEEK_END))==-1) || - ((old=malloc(oldsize+1))==NULL) || + ((oldsize=lseek(fd,0,SEEK_END))==-1)) + err(1, "%s", argv[1]); + + if (oldsize > SSIZE_MAX || + (uintmax_t)oldsize >= SIZE_T_MAX / sizeof(off_t) || + oldsize == OFF_MAX) { + errno = EFBIG; + err(1, "%s", argv[1]); + } + + if (((old=malloc(oldsize+1))==NULL) || (lseek(fd,0,SEEK_SET)!=0) || (read(fd,old,oldsize)!=oldsize) || (close(fd)==-1)) err(1,"%s",argv[1]); @@ -237,8 +249,16 @@ int main(int argc,char *argv[]) /* Allocate newsize+1 bytes instead of newsize bytes to ensure that we never try to malloc(0) and get a NULL pointer */ if(((fd=open(argv[2],O_RDONLY|O_BINARY,0))<0) || - ((newsize=lseek(fd,0,SEEK_END))==-1) || - ((new=malloc(newsize+1))==NULL) || + ((newsize=lseek(fd,0,SEEK_END))==-1)) + err(1, "%s", argv[2]); + + if (newsize > SSIZE_MAX || (uintmax_t)newsize >= SIZE_T_MAX || + newsize == OFF_MAX) { + errno = EFBIG; + err(1, "%s", argv[2]); + } + + if (((new=malloc(newsize+1))==NULL) || (lseek(fd,0,SEEK_SET)!=0) || (read(fd,new,newsize)!=newsize) || (close(fd)==-1)) err(1,"%s",argv[2]); From owner-svn-src-stable@freebsd.org Mon Nov 9 01:53:56 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE7FA2486D; Mon, 9 Nov 2015 01:53:56 +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 2E07D1E6E; Mon, 9 Nov 2015 01:53:56 +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 tA91rtrH086377; Mon, 9 Nov 2015 01:53:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA91rt5P086375; Mon, 9 Nov 2015 01:53:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201511090153.tA91rt5P086375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2015 01:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290569 - stable/10/usr.bin/gzip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 01:53:56 -0000 Author: delphij Date: Mon Nov 9 01:53:54 2015 New Revision: 290569 URL: https://svnweb.freebsd.org/changeset/base/290569 Log: MFC r290024,290073: 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 Modified: stable/10/usr.bin/gzip/gzip.1 stable/10/usr.bin/gzip/gzip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/gzip.1 ============================================================================== --- stable/10/usr.bin/gzip/gzip.1 Mon Nov 9 01:49:25 2015 (r290568) +++ stable/10/usr.bin/gzip/gzip.1 Mon Nov 9 01:53:54 2015 (r290569) @@ -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. @@ -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 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: stable/10/usr.bin/gzip/gzip.c ============================================================================== --- stable/10/usr.bin/gzip/gzip.c Mon Nov 9 01:49:25 2015 (r290568) +++ stable/10/usr.bin/gzip/gzip.c Mon Nov 9 01:53:54 2015 (r290569) @@ -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 @@ -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-stable@freebsd.org Mon Nov 9 06:50:44 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A21EDA2A12F; Mon, 9 Nov 2015 06:50:44 +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 614501BE9; Mon, 9 Nov 2015 06:50: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 tA96oh1Y069728; Mon, 9 Nov 2015 06:50:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96ohTg069724; Mon, 9 Nov 2015 06:50:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090650.tA96ohTg069724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 06:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290574 - in stable/10: bin/dd bin/dd/tests contrib/netbsd-tests/bin/dd etc/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:50:44 -0000 Author: ngie Date: Mon Nov 9 06:50:42 2015 New Revision: 290574 URL: https://svnweb.freebsd.org/changeset/base/290574 Log: MFC r289487: Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as bin/dd/tests Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used in validating the characters read from /dev/zero Sponsored by: EMC / Isilon Storage Division Added: stable/10/bin/dd/tests/ - copied from r289487, head/bin/dd/tests/ Modified: stable/10/bin/dd/Makefile stable/10/bin/dd/tests/Makefile stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh stable/10/etc/mtree/BSD.tests.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/Makefile ============================================================================== --- stable/10/bin/dd/Makefile Mon Nov 9 06:30:26 2015 (r290573) +++ stable/10/bin/dd/Makefile Mon Nov 9 06:50:42 2015 (r290574) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= dd SRCS= args.c conv.c conv_tab.c dd.c misc.c position.c @@ -24,4 +26,8 @@ test: ${PROG} gen .endfor @rm -f gen +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/dd/tests/Makefile ============================================================================== --- head/bin/dd/tests/Makefile Sun Oct 18 05:49:58 2015 (r289487) +++ stable/10/bin/dd/tests/Makefile Mon Nov 9 06:50:42 2015 (r290574) @@ -1,5 +1,10 @@ # $FreeBSD$ +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/dd +TESTSDIR= ${TESTSBASE}/bin/dd + NETBSD_ATF_TESTS_SH= dd_test .include Modified: stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh ============================================================================== --- stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh Mon Nov 9 06:30:26 2015 (r290573) +++ stable/10/contrib/netbsd-tests/bin/dd/t_dd.sh Mon Nov 9 06:50:42 2015 (r290574) @@ -44,6 +44,12 @@ length_head() { "the one expected to fail. (NetBSD PR bin/8521)" } length_body() { + # Begin FreeBSD + if ! df /dev/fd | grep -q '^fdescfs'; then + atf_skip "fdescfs is not mounted on /dev/fd" + fi + # End FreeBSD + test_dd_length 512 \ "dd if=/dev/zero of=/dev/fd/5 count=1 5>&1 >/dev/null 2>/dev/null" test_dd_length 512 \ Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 06:30:26 2015 (r290573) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 06:50:42 2015 (r290574) @@ -10,6 +10,8 @@ .. date .. + dd + .. expr .. ls From owner-svn-src-stable@freebsd.org Mon Nov 9 06:55:06 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A20A2A235; Mon, 9 Nov 2015 06:55: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 E9B3C1334; Mon, 9 Nov 2015 06:55: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 tA96t5t0072465; Mon, 9 Nov 2015 06:55:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA96t5nx072464; Mon, 9 Nov 2015 06:55:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090655.tA96t5nx072464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 06:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290575 - stable/10/secure/lib/libcrypto/engines/libgost X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:55:06 -0000 Author: ngie Date: Mon Nov 9 06:55:04 2015 New Revision: 290575 URL: https://svnweb.freebsd.org/changeset/base/290575 Log: MFC r290178: Fix GOST engine cipher linkage by adding e_gost_err.c to SRCS so it picks up undefined symbols, like "ERR_load_GOST_strings" PR: 184805 Submitted by: Ivan IvanZhdanov Sponsored by: EMC / Isilon Storage Division Modified: stable/10/secure/lib/libcrypto/engines/libgost/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/secure/lib/libcrypto/engines/libgost/Makefile ============================================================================== --- stable/10/secure/lib/libcrypto/engines/libgost/Makefile Mon Nov 9 06:50:42 2015 (r290574) +++ stable/10/secure/lib/libcrypto/engines/libgost/Makefile Mon Nov 9 06:55:04 2015 (r290575) @@ -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-stable@freebsd.org Mon Nov 9 07:07:26 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD0EA2A472; Mon, 9 Nov 2015 07:07: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 4BBD71992; Mon, 9 Nov 2015 07:07: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 tA977PfD075279; Mon, 9 Nov 2015 07:07:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA977Pxt075278; Mon, 9 Nov 2015 07:07:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090707.tA977Pxt075278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290576 - stable/10/usr.sbin/rtsold X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:07:26 -0000 Author: ngie Date: Mon Nov 9 07:07:25 2015 New Revision: 290576 URL: https://svnweb.freebsd.org/changeset/base/290576 Log: MFC r290182: 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 PR: 173744 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/rtsold/rtsold.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/10/usr.sbin/rtsold/rtsold.c Mon Nov 9 06:55:04 2015 (r290575) +++ stable/10/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:07:25 2015 (r290576) @@ -834,15 +834,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-stable@freebsd.org Mon Nov 9 07:10:33 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948A2A2A4D5; Mon, 9 Nov 2015 07:10:33 +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 61CE51AFB; Mon, 9 Nov 2015 07:10:33 +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 tA97AW36075465; Mon, 9 Nov 2015 07:10:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97AWbC075464; Mon, 9 Nov 2015 07:10:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090710.tA97AWbC075464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290577 - stable/9/usr.sbin/rtsold X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:10:33 -0000 Author: ngie Date: Mon Nov 9 07:10:32 2015 New Revision: 290577 URL: https://svnweb.freebsd.org/changeset/base/290577 Log: MFstable/10 r290576: MFC r290182: 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 PR: 173744 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/rtsold/rtsold.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/rtsold/ (props changed) Modified: stable/9/usr.sbin/rtsold/rtsold.c ============================================================================== --- stable/9/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:07:25 2015 (r290576) +++ stable/9/usr.sbin/rtsold/rtsold.c Mon Nov 9 07:10:32 2015 (r290577) @@ -839,15 +839,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-stable@freebsd.org Mon Nov 9 07:16:18 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E691A2A64D; Mon, 9 Nov 2015 07:16:18 +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 5E0DB1EAB; Mon, 9 Nov 2015 07:16:18 +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 tA97GHB8078267; Mon, 9 Nov 2015 07:16:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97GHdI078266; Mon, 9 Nov 2015 07:16:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090716.tA97GHdI078266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290578 - stable/10/contrib/netbsd-tests/lib/libc/ssp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:16:18 -0000 Author: ngie Date: Mon Nov 9 07:16:17 2015 New Revision: 290578 URL: https://svnweb.freebsd.org/changeset/base/290578 Log: MFC r290184: Fix a set but not used variable warning flagged by gcc 4.9 with lib/libc/ssp/h_readlink Sponsored by: EMC / Isilon Storage Division Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Mon Nov 9 07:10:32 2015 (r290577) +++ stable/10/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Mon Nov 9 07:16:17 2015 (r290578) @@ -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-stable@freebsd.org Mon Nov 9 07:18:10 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE616A2A6C8; Mon, 9 Nov 2015 07:18: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 98EA61018; Mon, 9 Nov 2015 07:18:10 +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 tA97I96m078386; Mon, 9 Nov 2015 07:18:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97I9wN078385; Mon, 9 Nov 2015 07:18:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090718.tA97I9wN078385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290579 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:18:10 -0000 Author: ngie Date: Mon Nov 9 07:18:09 2015 New Revision: 290579 URL: https://svnweb.freebsd.org/changeset/base/290579 Log: MFC r289903: Add libvmmapi to OptionalObsoleteFiles.inc when MK_BHYVE == no Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 9 07:16:17 2015 (r290578) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 9 07:18:09 2015 (r290579) @@ -172,6 +172,10 @@ OLD_DIRS+=etc/autofs .endif .if ${MK_BHYVE} == no +OLD_FILES+=usr/lib/libvmmapi.a +OLD_FILES+=usr/lib/libvmmapi.so +OLD_LIBS+=usr/lib/libvmmapi.so.5 +OLD_FILES+=usr/include/vmmapi.h OLD_FILES+=usr/sbin/bhyve OLD_FILES+=usr/sbin/bhyvectl OLD_FILES+=usr/sbin/bhyveload From owner-svn-src-stable@freebsd.org Mon Nov 9 07:26:35 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F9DA2A885; Mon, 9 Nov 2015 07:26:35 +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 A2F5E1468; Mon, 9 Nov 2015 07:26:35 +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 tA97QYqK081313; Mon, 9 Nov 2015 07:26:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97QYh6081311; Mon, 9 Nov 2015 07:26:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090726.tA97QYh6081311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290580 - stable/10/tools/regression/security/open_to_operation X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:26:36 -0000 Author: ngie Date: Mon Nov 9 07:26:34 2015 New Revision: 290580 URL: https://svnweb.freebsd.org/changeset/base/290580 Log: MFC r290190,r290251: r290190: 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 [*] Submitted by: David Binderman Sponsored by: EMC / Isilon Storage Division r290251: Use nitems(x) instead of sizeof(x)/sizeof(x[0]) Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/security/open_to_operation/Makefile stable/10/tools/regression/security/open_to_operation/open_to_operation.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/security/open_to_operation/Makefile ============================================================================== --- stable/10/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:18:09 2015 (r290579) +++ stable/10/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:26:34 2015 (r290580) @@ -2,6 +2,6 @@ PROG= open_to_operation MAN= -#WARNS= 3 +WARNS?= 3 .include Modified: stable/10/tools/regression/security/open_to_operation/open_to_operation.c ============================================================================== --- stable/10/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:18:09 2015 (r290579) +++ stable/10/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:26:34 2015 (r290580) @@ -119,10 +119,10 @@ __FBSDID("$FreeBSD$"); */ static const int file_modes[] = { O_RDONLY, O_WRONLY, O_RDWR, O_RDONLY | O_TRUNC, O_WRONLY | O_TRUNC, O_RDWR | O_TRUNC }; -static const int file_modes_count = sizeof(file_modes) / sizeof(int); +static const int file_modes_count = nitems(file_modes); static const int dir_modes[] = { O_RDONLY }; -static const int dir_modes_count = sizeof(dir_modes) / sizeof(int); +static const int dir_modes_count = nitems(dir_modes); static int testnum; static int aio_present; @@ -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-stable@freebsd.org Mon Nov 9 07:28:18 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AA7EA2A8E4; Mon, 9 Nov 2015 07:28:18 +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 3B71D161E; Mon, 9 Nov 2015 07:28:18 +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 tA97SH6j081445; Mon, 9 Nov 2015 07:28:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97SHLv081443; Mon, 9 Nov 2015 07:28:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090728.tA97SHLv081443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290581 - stable/9/tools/regression/security/open_to_operation X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:28:18 -0000 Author: ngie Date: Mon Nov 9 07:28:17 2015 New Revision: 290581 URL: https://svnweb.freebsd.org/changeset/base/290581 Log: MFstable/10 r290580: MFC r290190,r290251: r290190: 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 [*] Submitted by: David Binderman Sponsored by: EMC / Isilon Storage Division r290251: Use nitems(x) instead of sizeof(x)/sizeof(x[0]) Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/security/open_to_operation/Makefile stable/9/tools/regression/security/open_to_operation/open_to_operation.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/security/open_to_operation/Makefile ============================================================================== --- stable/9/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:26:34 2015 (r290580) +++ stable/9/tools/regression/security/open_to_operation/Makefile Mon Nov 9 07:28:17 2015 (r290581) @@ -2,6 +2,6 @@ PROG= open_to_operation NO_MAN= -#WARNS= 3 +WARNS?= 3 .include Modified: stable/9/tools/regression/security/open_to_operation/open_to_operation.c ============================================================================== --- stable/9/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:26:34 2015 (r290580) +++ stable/9/tools/regression/security/open_to_operation/open_to_operation.c Mon Nov 9 07:28:17 2015 (r290581) @@ -119,10 +119,10 @@ __FBSDID("$FreeBSD$"); */ static const int file_modes[] = { O_RDONLY, O_WRONLY, O_RDWR, O_RDONLY | O_TRUNC, O_WRONLY | O_TRUNC, O_RDWR | O_TRUNC }; -static const int file_modes_count = sizeof(file_modes) / sizeof(int); +static const int file_modes_count = nitems(file_modes); static const int dir_modes[] = { O_RDONLY }; -static const int dir_modes_count = sizeof(dir_modes) / sizeof(int); +static const int dir_modes_count = nitems(dir_modes); static int testnum; static int aio_present; @@ -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-stable@freebsd.org Mon Nov 9 07:34:32 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 490CAA2AAD9; Mon, 9 Nov 2015 07:34:32 +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 158B41C1C; Mon, 9 Nov 2015 07:34:32 +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 tA97YVPX084159; Mon, 9 Nov 2015 07:34:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97YVk9084158; Mon, 9 Nov 2015 07:34:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090734.tA97YVk9084158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290582 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:34:32 -0000 Author: ngie Date: Mon Nov 9 07:34:30 2015 New Revision: 290582 URL: https://svnweb.freebsd.org/changeset/base/290582 Log: MFC r290179: Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/gen/getgrent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getgrent.c ============================================================================== --- stable/10/lib/libc/gen/getgrent.c Mon Nov 9 07:28:17 2015 (r290581) +++ stable/10/lib/libc/gen/getgrent.c Mon Nov 9 07:34:30 2015 (r290582) @@ -659,14 +659,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-stable@freebsd.org Mon Nov 9 07:36:56 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4F2A2ABB2; Mon, 9 Nov 2015 07:36:56 +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 8E8AF1DAB; Mon, 9 Nov 2015 07:36:56 +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 tA97atjC084298; Mon, 9 Nov 2015 07:36:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97at7T084297; Mon, 9 Nov 2015 07:36:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090736.tA97at7T084297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290583 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:36:56 -0000 Author: ngie Date: Mon Nov 9 07:36:55 2015 New Revision: 290583 URL: https://svnweb.freebsd.org/changeset/base/290583 Log: MFstable/10 r290582: MFC r290179: Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/gen/getgrent.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getgrent.c ============================================================================== --- stable/9/lib/libc/gen/getgrent.c Mon Nov 9 07:34:30 2015 (r290582) +++ stable/9/lib/libc/gen/getgrent.c Mon Nov 9 07:36:55 2015 (r290583) @@ -659,14 +659,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-stable@freebsd.org Mon Nov 9 07:41:30 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D86FA2ACF4; Mon, 9 Nov 2015 07:41:30 +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 05B681FBD; Mon, 9 Nov 2015 07:41:29 +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 tA97fT6i085416; Mon, 9 Nov 2015 07:41:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97fS7b085252; Mon, 9 Nov 2015 07:41:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090741.tA97fS7b085252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290584 - in stable/10: etc/mtree lib/libc/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:41:30 -0000 Author: ngie Date: Mon Nov 9 07:41:28 2015 New Revision: 290584 URL: https://svnweb.freebsd.org/changeset/base/290584 Log: MFC r290177: 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 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libc/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:36:55 2015 (r290583) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:41:28 2015 (r290584) @@ -109,6 +109,8 @@ data .. .. + rpc + .. ssp .. stdio Modified: stable/10/lib/libc/tests/Makefile ============================================================================== --- stable/10/lib/libc/tests/Makefile Mon Nov 9 07:36:55 2015 (r290583) +++ stable/10/lib/libc/tests/Makefile Mon Nov 9 07:41:28 2015 (r290584) @@ -13,6 +13,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-stable@freebsd.org Mon Nov 9 07:49:40 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6861A2AFFD; Mon, 9 Nov 2015 07:49: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 9F53B1532; Mon, 9 Nov 2015 07:49:40 +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 tA97nd0N087455; Mon, 9 Nov 2015 07:49:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97nd3C087453; Mon, 9 Nov 2015 07:49:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090749.tA97nd3C087453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290585 - in stable/10: etc/mtree tests/sys tests/sys/posixshm tools/regression/posixshm tools/test/posixshm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:49:40 -0000 Author: ngie Date: Mon Nov 9 07:49:39 2015 New Revision: 290585 URL: https://svnweb.freebsd.org/changeset/base/290585 Log: MFC r289441: Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD test suite as tests/sys/posixshm Some other highlights: - Convert the testcases over to ATF - Don't use hardcoded paths to /tmp (which violate the ATF/kyua samdbox); use mkstemp to generate temporary paths for non-SHM_ANON shm objects. Sponsored by: EMC / Isilon Storage Division Added: stable/10/tests/sys/posixshm/ - copied from r289441, head/tests/sys/posixshm/ Deleted: stable/10/tools/regression/posixshm/ stable/10/tools/test/posixshm/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/tests/sys/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:41:28 2015 (r290584) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:49:39 2015 (r290585) @@ -234,6 +234,8 @@ unlink .. .. + posixshm + .. vfs .. vm Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Mon Nov 9 07:41:28 2015 (r290584) +++ stable/10/tests/sys/Makefile Mon Nov 9 07:49:39 2015 (r290585) @@ -11,6 +11,7 @@ TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet +TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm From owner-svn-src-stable@freebsd.org Mon Nov 9 07:56:08 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58331A29359; Mon, 9 Nov 2015 07:56:08 +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 1FFC91A85; Mon, 9 Nov 2015 07:56:08 +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 tA97u7wx090304; Mon, 9 Nov 2015 07:56:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA97u6ic090298; Mon, 9 Nov 2015 07:56:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090756.tA97u6ic090298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 07:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290586 - in stable/10: etc/mtree usr.sbin/makefs usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 07:56:08 -0000 Author: ngie Date: Mon Nov 9 07:56:06 2015 New Revision: 290586 URL: https://svnweb.freebsd.org/changeset/base/290586 Log: MFC r289739,r289743,r289897,r289901: r289739: Correctly reintroduce the rudimentary smoke tests I botched up in r289684 Sponsored by: EMC / Isilon Storage Division r289743: Revise "create_test_inputs" to simplify the file structure as these testcases don't need to be nested as much as bin/ls/ls_tests.sh do when verifying ls -a, ls -A, etc. This allows the tests to make all paths relative to the top of the temporary directory instead of always tacking on $ATF_TMPDIR, thus complicating things unnecessarily Create non-empty files in create_test_inputs as well now, similar to create_test_inputs2 in bin/ls/ls_tests.sh Compare the input files to the output file contents using diff where possible: - Skip over the fifo comparison for now because it always fails - Skip over the symlink comparison on cd9660 because it always fails today Sponsored by: EMC / Isilon Storage Division r289897: Add more cd9660/FFS makefs testcases General changes: - Parameterize out the mount command. - Use mtree to verify the contents of an image (check_image_contents) instead of using diff (diff verifies content, but not file metadata). - Move common logic out to functions (common_cleanup, mount_image, check_image_contents) - Add stub testcases for makefs -D (crashes with SIGBUS, similar to bug # 192839) - Add a note about the ISO-9660 and rockridge specs - Add testcases that exercise: -- Creating disk images from an mtree and multiple directories. -- -F flag use (not really an extensive testcase right now) cd9660-specific test changes: - Remove an XXX comment about symlinks; I forgot that non-rockridge images turn symlinks into hardlinks. - Add testcases that exercise: -- -o allow-deep-trees -- -o allow-max-name stub testcase (doesn't seem to be implemented in makefs) -- -o preparer (existence in image; not conformance to spec) -- -o publisher (existence in image; not conformance to spec) -- -o rockridge (basic) Sponsored by: EMC / Isilon Storage Division r289901: Remove an ls -l I was using for debugging Sponsored by: EMC / Isilon Storage Division Added: stable/10/usr.sbin/makefs/tests/ - copied from r289739, head/usr.sbin/makefs/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.sbin/makefs/Makefile stable/10/usr.sbin/makefs/tests/Makefile stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:49:39 2015 (r290585) +++ stable/10/etc/mtree/BSD.tests.dist Mon Nov 9 07:56:06 2015 (r290586) @@ -402,6 +402,8 @@ .. fstyp .. + makefs + .. newsyslog .. nmtree Modified: stable/10/usr.sbin/makefs/Makefile ============================================================================== --- stable/10/usr.sbin/makefs/Makefile Mon Nov 9 07:49:39 2015 (r290585) +++ stable/10/usr.sbin/makefs/Makefile Mon Nov 9 07:56:06 2015 (r290586) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= makefs CFLAGS+=-I${.CURDIR} @@ -38,4 +40,8 @@ LDADD+= ${LIBNETBSD} DPADD+= ${LIBSBUF} ${LIBUTIL} LDADD+= -lsbuf -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.sbin/makefs/tests/Makefile ============================================================================== --- head/usr.sbin/makefs/tests/Makefile Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/Makefile Mon Nov 9 07:56:06 2015 (r290586) @@ -1,5 +1,7 @@ # $FreeBSD$ +TESTSDIR= ${TESTSBASE}/usr.sbin/makefs + ATF_TESTS_SH+= makefs_cd9660_tests ATF_TESTS_SH+= makefs_ffs_tests Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 07:56:06 2015 (r290586) @@ -27,36 +27,262 @@ # $FreeBSD$ # -. "$(dirname "$0")/makefs_tests_common.sh" +# A note on specs: +# - A copy of the ISO-9660 spec can be found here: +# http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf +# - Any references to `rockridge` are referring to the `Rock Ridge` extensions +# of the ISO-9660 spec. A copy of the draft `IEEE-P1282` spec can be found +# here: +# http://www.ymi.com/ymi/sites/default/files/pdf/Rockridge.pdf MAKEFS="makefs -t cd9660" -TEST_IMAGE="test.iso" +MOUNT="mount_cd9660" + +. "$(dirname "$0")/makefs_tests_common.sh" + +common_cleanup() +{ + if ! test_md_device=$(cat $TEST_MD_DEVICE_FILE); then + echo "$TEST_MD_DEVICE_FILE could not be opened; has an md(4) device been attached?" + return + fi + + umount -f /dev/$test_md_device || : + mdconfig -d -u $test_md_device || : +} + +check_base_iso9660_image_contents() +{ + # Symlinks are treated like files when rockridge support isn't + # specified + check_image_contents "$@" -X c + + atf_check -e empty -o empty -s exit:0 test -L $TEST_INPUTS_DIR/c + atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c +} + +atf_test_case D_flag cleanup +D_flag_body() +{ + atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839" + + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + atf_check -e empty -o empty -s exit:0 \ + cp $TEST_SPEC_FILE spec2.mtree + atf_check -e empty -o save:dupe_$TEST_SPEC_FILE -s exit:0 \ + cat $TEST_SPEC_FILE spec2.mtree + + atf_check -e empty -o not-empty -s not-exit:0 \ + $MAKEFS -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -D -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR +} +D_flag_cleanup() +{ + common_cleanup +} + +atf_test_case F_flag cleanup +F_flag_body() +{ + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +F_flag_cleanup() +{ + common_cleanup +} + +atf_test_case from_mtree_spec_file cleanup +from_mtree_spec_file_body() +{ + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k type,link,size -p $TEST_INPUTS_DIR + cd $TEST_INPUTS_DIR + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE + cd - + + mount_image + check_base_iso9660_image_contents +} +from_mtree_spec_file_cleanup() +{ + common_cleanup +} + +atf_test_case from_multiple_dirs cleanup +from_multiple_dirs_body() +{ + test_inputs_dir2=$TMPDIR/inputs2 + + create_test_inputs + + atf_check -e empty -o empty -s exit:0 mkdir -p $test_inputs_dir2 + atf_check -e empty -o empty -s exit:0 \ + touch $test_inputs_dir2/multiple_dirs_test_file + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 + + mount_image + check_base_iso9660_image_contents -d $test_inputs_dir2 +} +from_multiple_dirs_cleanup() +{ + common_cleanup +} -atf_test_case basic_cd9660 cleanup -basic_cd9660_body() +atf_test_case from_single_dir cleanup +from_single_dir_body() { create_test_inputs atf_check -e empty -o empty -s exit:0 \ $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR - atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ - mdconfig -a -f $TEST_IMAGE + + mount_image + check_base_iso9660_image_contents +} +from_single_dir_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_allow_deep_trees cleanup +o_flag_allow_deep_trees_body() +{ + create_test_inputs + + # Make sure the "more than 8 levels deep" requirement is met. + atf_check -e empty -o empty -s exit:0 \ + mkdir -p $TEST_INPUTS_DIR/a/b/c/d/e/f/g/h/i/j + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o allow-deep-trees $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_allow_deep_trees_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_allow_max_name cleanup +o_flag_allow_max_name_body() +{ + atf_expect_fail "-o allow-max-name doesn't appear to be implemented on FreeBSD's copy of makefs [yet]" + + create_test_inputs + + long_path=$TEST_INPUTS_DIR/$(jot -s '' -b 0 37) + + # Make sure the "37 char name" limit requirement is met. + atf_check -e empty -o empty -s exit:0 touch $long_path + atf_check -e empty -o empty -s exit:0 \ - mount_cd9660 /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR - atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR + $MAKEFS -o allow-max-name $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_allow_max_name_cleanup() +{ + common_cleanup } -basic_cd9660_cleanup() + +atf_test_case o_flag_preparer +o_flag_preparer_body() { - ls -a + create_test_dirs - test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return + preparer='My Very First ISO' + preparer_uppercase="$(echo $preparer | tr '[[:lower:]]' '[[:upper:]]')" - umount -f /dev/$test_md_device - mdconfig -d -u $test_md_device + atf_check -e empty -o empty -s exit:0 touch $TEST_INPUTS_DIR/dummy_file + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o preparer="$preparer" $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o match:"$preparer_uppercase" -s exit:0 \ + strings $TEST_IMAGE +} + +atf_test_case o_flag_publisher +o_flag_publisher_body() +{ + create_test_dirs + + publisher='My Super Awesome Publishing Company LTD' + publisher_uppercase="$(echo $publisher | tr '[[:lower:]]' '[[:upper:]]')" + + atf_check -e empty -o empty -s exit:0 touch $TEST_INPUTS_DIR/dummy_file + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o publisher="$publisher" $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o match:"$publisher_uppercase" -s exit:0 \ + strings $TEST_IMAGE +} + +atf_test_case o_flag_rockridge cleanup +o_flag_rockridge_body() +{ + create_test_dirs + + # Make sure the "more than 8 levels deep" requirement is met. + atf_check -e empty -o empty -s exit:0 \ + mkdir -p $TEST_INPUTS_DIR/a/b/c/d/e/f/g/h/i/j + + # Make sure the "pathname larger than 255 chars" requirement is met. + # + # $long_path's needs to be nested in a directory, as creating it + # outright as a 256 char filename via touch will fail with ENAMETOOLONG + long_path=$TEST_INPUTS_DIR/$(jot -s '/' -b "$(jot -s '' -b 0 64)" 4) + atf_check -e empty -o empty -s exit:0 mkdir -p "$(dirname $long_path)" + atf_check -e empty -o empty -s exit:0 touch "$long_path" + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o rockridge $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_image_contents -X .rr_moved + + # .rr_moved is a special directory created when you have deep directory + # trees with rock ridge extensions on + atf_check -e empty -o empty -s exit:0 \ + test -d $TEST_MOUNT_DIR/.rr_moved +} +o_flag_rockridge_cleanup() +{ + common_cleanup } atf_init_test_cases() { + atf_add_test_case D_flag + atf_add_test_case F_flag + + atf_add_test_case from_mtree_spec_file + atf_add_test_case from_multiple_dirs + atf_add_test_case from_single_dir - atf_add_test_case basic_cd9660 + atf_add_test_case o_flag_allow_deep_trees + atf_add_test_case o_flag_allow_max_name + atf_add_test_case o_flag_preparer + atf_add_test_case o_flag_publisher + atf_add_test_case o_flag_rockridge } Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_ffs_tests.sh Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Nov 9 07:56:06 2015 (r290586) @@ -27,38 +27,146 @@ # $FreeBSD$ # +MAKEFS="makefs -t ffs" +MOUNT="mount" + . "$(dirname "$0")/makefs_tests_common.sh" -MAKEFS="makefs -t ffs" -TEST_IMAGE="test.img" +TEST_TUNEFS_OUTPUT=$TMPDIR/tunefs.output + +common_cleanup() +{ + if ! test_md_device=$(cat $TEST_MD_DEVICE_FILE); then + echo "$TEST_MD_DEVICE_FILE could not be opened; has an md(4) device been attached?" + return + fi + + umount -f /dev/$test_md_device || : + mdconfig -d -u $test_md_device || : +} + +check_ffs_image_contents() +{ + atf_check -e save:$TEST_TUNEFS_OUTPUT -o empty -s exit:0 \ + tunefs -p /dev/$(cat $TEST_MD_DEVICE_FILE) + + check_image_contents "$@" +} -atf_test_case basic_ffs cleanup -basic_ffs_body() +atf_test_case D_flag cleanup +D_flag_body() { + atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839" + create_test_inputs + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR atf_check -e empty -o not-empty -s exit:0 \ - $MAKEFS -M 1m $TEST_IMAGE $TEST_INPUTS_DIR - atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ - mdconfig -a -f $TEST_IMAGE - atf_check -e save:$ATF_TMPDIR/tunefs.output -o empty -s exit:0 \ - tunefs -p /dev/$(cat $TEST_MD_DEVICE_FILE) + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o empty -s exit:0 \ - mount /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR - atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR + cp $TEST_SPEC_FILE spec2.mtree + atf_check -e empty -o save:dupe_$TEST_SPEC_FILE -s exit:0 \ + cat $TEST_SPEC_FILE spec2.mtree + + atf_check -e empty -o not-empty -s not-exit:0 \ + $MAKEFS -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -D -F dupe_$TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR +} +D_flag_cleanup() +{ + common_cleanup } -basic_ffs_cleanup() + +atf_test_case F_flag cleanup +F_flag_body() { - ls -a + create_test_inputs - test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -cp $TEST_INPUTS_DIR + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR - umount -f /dev/$test_md_device - mdconfig -d -u $test_md_device + mount_image + check_ffs_image_contents +} +F_flag_cleanup() +{ + common_cleanup +} + +atf_test_case from_mtree_spec_file cleanup +from_mtree_spec_file_body() +{ + create_test_inputs + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k type,link,size -p $TEST_INPUTS_DIR + + cd $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE + cd - + + mount_image + check_ffs_image_contents +} +from_mtree_spec_file_cleanup() +{ + common_cleanup +} + +atf_test_case from_multiple_dirs cleanup +from_multiple_dirs_body() +{ + test_inputs_dir2=$TMPDIR/inputs2 + + create_test_inputs + + atf_check -e empty -o empty -s exit:0 mkdir -p $test_inputs_dir2 + atf_check -e empty -o empty -s exit:0 \ + touch $test_inputs_dir2/multiple_dirs_test_file + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 + + mount_image + check_image_contents -d $test_inputs_dir2 +} +from_multiple_dirs_cleanup() +{ + common_cleanup +} + +atf_test_case from_single_dir cleanup +from_single_dir_body() +{ + create_test_inputs + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_ffs_image_contents +} +from_single_dir_cleanup() +{ + common_cleanup } atf_init_test_cases() { - atf_add_test_case basic_ffs + atf_add_test_case D_flag + atf_add_test_case F_flag + + atf_add_test_case from_mtree_spec_file + atf_add_test_case from_multiple_dirs + atf_add_test_case from_single_dir + + } Modified: stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_tests_common.sh Thu Oct 22 05:32:45 2015 (r289739) +++ stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Nov 9 07:56:06 2015 (r290586) @@ -27,30 +27,73 @@ # $FreeBSD$ # -TEST_MD_DEVICE_FILE="md.output" -TEST_MOUNT_DIR="mnt" +KB=1024 +: ${TMPDIR=/tmp} +TEST_IMAGE="$TMPDIR/test.img" +TEST_INPUTS_DIR="$TMPDIR/inputs" +TEST_MD_DEVICE_FILE="$TMPDIR/md.output" +TEST_MOUNT_DIR="$TMPDIR/mnt" +TEST_SPEC_FILE="$TMPDIR/mtree.spec" -create_test_dir() +check_image_contents() { - [ -z "$ATF_TMPDIR" ] || return 0 - - export ATF_TMPDIR=$(pwd) - - TEST_MD_DEVICE_FILE="${ATF_TMPDIR}/${TEST_MD_DEVICE_FILE}" - TEST_MOUNT_DIR="${ATF_TMPDIR}/${TEST_MOUNT_DIR}" - - # XXX: need to nest this because of how kyua creates $TMPDIR; otherwise - # it will run into EPERM issues later - TEST_INPUTS_DIR="${ATF_TMPDIR}/test/inputs" + local directories=$TEST_INPUTS_DIR + local excludes mtree_excludes_arg mtree_file + local mtree_keywords="type,link,size" + + while getopts "d:f:m:X:" flag; do + case "$flag" in + d) + directories="$directories $OPTARG" + ;; + f) + mtree_file=$OPTARG + ;; + m) + mtree_keywords=$OPTARG + ;; + X) + excludes="$excludes $OPTARG" + ;; + *) + echo "usage: check_image_contents [-d directory ...] [-f mtree-file] [-m mtree-keywords] [-X exclude]" + atf_fail "unhandled option: $flag" + ;; + esac + done + + if [ -n "$excludes" ]; then + echo "$excludes" | tr ' ' '\n' > excludes.txt + mtree_excludes_arg="-X excludes.txt" + fi + + if [ -z "$mtree_file" ]; then + mtree_file=input_spec.mtree + for directory in $directories; do + mtree -c -k $mtree_keywords -p $directory $mtree_excludes_arg + done > $mtree_file + fi + + echo "<---- Input spec BEGIN ---->" + cat $mtree_file + echo "<---- Input spec END ---->" + atf_check -e empty -o empty -s exit:0 \ + mtree -UW -f $mtree_file \ + -p $TEST_MOUNT_DIR \ + $mtree_excludes_arg +} +create_test_dirs() +{ atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_MOUNT_DIR atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_INPUTS_DIR - cd $TEST_INPUTS_DIR } create_test_inputs() { - create_test_dir + create_test_dirs + + cd $TEST_INPUTS_DIR atf_check -e empty -s exit:0 mkdir -m 0755 -p a/b/1 atf_check -e empty -s exit:0 ln -s a/b c @@ -58,7 +101,9 @@ create_test_inputs() atf_check -e empty -s exit:0 ln d e atf_check -e empty -s exit:0 touch .f atf_check -e empty -s exit:0 mkdir .g - atf_check -e empty -s exit:0 mkfifo h + # XXX: fifos on the filesystem don't match fifos created by makefs for + # some odd reason. + #atf_check -e empty -s exit:0 mkfifo h atf_check -e ignore -s exit:0 dd if=/dev/zero of=i count=1000 bs=1 atf_check -e empty -s exit:0 touch klmn atf_check -e empty -s exit:0 touch opqr @@ -78,4 +123,23 @@ create_test_inputs() atf_check -e empty -s exit:0 touch 0b00001100 atf_check -e empty -s exit:0 touch 0b00001101 atf_check -e empty -s exit:0 touch 0b00001110 + + for filesize in 1 512 $(( 2 * $KB )) $(( 10 * $KB )) $(( 512 * $KB )); \ + do + atf_check -e ignore -o empty -s exit:0 \ + dd if=/dev/zero of=${filesize}.file bs=1 \ + count=1 oseek=${filesize} conv=sparse + files="${files} ${filesize}.file" + done + + cd - } + +mount_image() +{ + atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ + mdconfig -a -f $TEST_IMAGE + atf_check -e empty -o empty -s exit:0 \ + $MOUNT /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR +} + From owner-svn-src-stable@freebsd.org Mon Nov 9 08:03:16 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F90A29AAF; Mon, 9 Nov 2015 08:03:16 +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 885C21EB8; Mon, 9 Nov 2015 08:03:16 +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 tA983Fns093167; Mon, 9 Nov 2015 08:03:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA983FTI093166; Mon, 9 Nov 2015 08:03:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090803.tA983FTI093166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290587 - stable/10/usr.sbin/makefs/cd9660 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:03:16 -0000 Author: ngie Date: Mon Nov 9 08:03:15 2015 New Revision: 290587 URL: https://svnweb.freebsd.org/changeset/base/290587 Log: MFC r289687,r289693: r289687: Free buffer before returning from cd9660_write_path_table to avoid leaking it after returning from the function PR: 203647 Submitted by: Thomas Schmitt Coverity CID: 978431 Sponsored by: EMC / Isilon Storage Division r289693: Unbreak makefs -t cd9660 after r289687 buffer_head needs to be freed -- not buffer Detected by jemalloc, i.e. running makefs failed the arena assert because my copy of malloc on CURRENT is compiled with the default !MALLOC_PRODUCTION asserts on Pointyhat to: ngie PR: 203647 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/cd9660/cd9660_write.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 07:56:06 2015 (r290586) +++ stable/10/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:03:15 2015 (r290587) @@ -165,7 +165,7 @@ cd9660_write_path_table(FILE *fd, off_t diskStructure.pathTableLength); unsigned char *buffer; unsigned char *buffer_head; - int len; + int len, ret; path_table_entry temp_entry; cd9660node *ptcur; @@ -213,8 +213,10 @@ cd9660_write_path_table(FILE *fd, off_t ptcur = ptcur->ptnext; } - return cd9660_write_filedata(fd, sector, buffer_head, + ret = cd9660_write_filedata(fd, sector, buffer_head, path_table_sectors); + free(buffer_head); + return ret; } From owner-svn-src-stable@freebsd.org Mon Nov 9 08:05:16 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2850A29B47; Mon, 9 Nov 2015 08:05:16 +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 6F14B1072; Mon, 9 Nov 2015 08:05:16 +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 tA985F5N093319; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA985FnO093318; Mon, 9 Nov 2015 08:05:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090805.tA985FnO093318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290588 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:05:16 -0000 Author: ngie Date: Mon Nov 9 08:05:15 2015 New Revision: 290588 URL: https://svnweb.freebsd.org/changeset/base/290588 Log: MFstable/10 r290587: MFC r289687,r289693: r289687: Free buffer before returning from cd9660_write_path_table to avoid leaking it after returning from the function PR: 203647 Submitted by: Thomas Schmitt Coverity CID: 978431 Sponsored by: EMC / Isilon Storage Division r289693: Unbreak makefs -t cd9660 after r289687 buffer_head needs to be freed -- not buffer Detected by jemalloc, i.e. running makefs failed the arena assert because my copy of malloc on CURRENT is compiled with the default !MALLOC_PRODUCTION asserts on Pointyhat to: ngie PR: 203647 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:03:15 2015 (r290587) +++ stable/9/usr.sbin/makefs/cd9660/cd9660_write.c Mon Nov 9 08:05:15 2015 (r290588) @@ -165,7 +165,7 @@ cd9660_write_path_table(FILE *fd, off_t diskStructure.pathTableLength); unsigned char *buffer; unsigned char *buffer_head; - int len; + int len, ret; path_table_entry temp_entry; cd9660node *ptcur; @@ -213,8 +213,10 @@ cd9660_write_path_table(FILE *fd, off_t ptcur = ptcur->ptnext; } - return cd9660_write_filedata(fd, sector, buffer_head, + ret = cd9660_write_filedata(fd, sector, buffer_head, path_table_sectors); + free(buffer_head); + return ret; } From owner-svn-src-stable@freebsd.org Mon Nov 9 08:59:57 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 750BFA268D1; Mon, 9 Nov 2015 08:59:57 +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 48E601823; Mon, 9 Nov 2015 08:59: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 tA98xurk008165; Mon, 9 Nov 2015 08:59:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA98xtWb008161; Mon, 9 Nov 2015 08:59:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090859.tA98xtWb008161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 08:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290589 - stable/10/usr.sbin/makefs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 08:59:57 -0000 Author: ngie Date: Mon Nov 9 08:59:55 2015 New Revision: 290589 URL: https://svnweb.freebsd.org/changeset/base/290589 Log: MFC r289203,r290180: r289203 (by adrian): makefs: introduce a new option to specify what to round the resulting image up to. From ticket: While trying to run FreeBSD/mips on some device having very small flash media, one is forced to compress file system with mkulzma(8) utility. It is desirable to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8) and big compression block size like 65535 bytes to mkulzma at the same time. Then one obtains very good comression ratios (like 75% and more) but faces the following problem. geom_uncompress kernel module reports GEOM provider size rounded up to its compression block size. Generally, this changes original media size and now it fails to match the size of embedded UFS file system that leads to other problems, f.e. geom_label kernel module does not like this and skips the file system while tasting the GEOM and looking for UFS label. This makes it impossible to refer to the file system using known UFS label instead of something like /dev/map/rootfs.uncompress. The following patch introduces new command line option "-r roundup" for makefs that makes it round up the image to specified block size. Hence, geom_uncompress does not change GEOM media size for images rounded that way and geom_label accepts such GEOMs just fine. With the patch applied, one can use following commands: $ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs $ mkulzma -s 65536 -o fs.img.ulzma fs.img PR: bin/203707 Submitted by: r290180: 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 Differential Revision: https://reviews.freebsd.org/D3959 Reviewed by: adrian (earlier patch), emaste Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/ffs.c stable/10/usr.sbin/makefs/makefs.8 stable/10/usr.sbin/makefs/makefs.c stable/10/usr.sbin/makefs/makefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs.c Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/ffs.c Mon Nov 9 08:59:55 2015 (r290589) @@ -410,6 +410,10 @@ ffs_validate(const char *dir, fsnode *ro /* round up to the next block */ fsopts->size = roundup(fsopts->size, ffs_opts->bsize); + /* round up to requested block size, if any */ + if (fsopts->roundup > 0) + fsopts->size = roundup(fsopts->size, fsopts->roundup); + /* calculate density if necessary */ if (ffs_opts->density == -1) ffs_opts->density = fsopts->size / fsopts->inodes + 1; Modified: stable/10/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/10/usr.sbin/makefs/makefs.8 Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/makefs.8 Mon Nov 9 08:59:55 2015 (r290589) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd October 29, 2015 .Dt MAKEFS 8 .Os .Sh NAME @@ -53,6 +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-size .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -195,6 +196,14 @@ Deprecated. See the .Fl Z flag. +.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: stable/10/usr.sbin/makefs/makefs.c ============================================================================== --- stable/10/usr.sbin/makefs/makefs.c Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/makefs.c Mon Nov 9 08:59:55 2015 (r290589) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pr:s:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -209,6 +209,12 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; + case 'R': + /* Round image size up to specified block size */ + fsoptions.roundup = + strsuftoll("roundup-size", optarg, 0, LLONG_MAX); + break; + case 's': fsoptions.minsize = fsoptions.maxsize = strsuftoll("size", optarg, 1LL, LLONG_MAX); @@ -359,9 +365,9 @@ 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] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" -"\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\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); exit(1); } Modified: stable/10/usr.sbin/makefs/makefs.h ============================================================================== --- stable/10/usr.sbin/makefs/makefs.h Mon Nov 9 08:05:15 2015 (r290588) +++ stable/10/usr.sbin/makefs/makefs.h Mon Nov 9 08:59:55 2015 (r290589) @@ -130,6 +130,7 @@ typedef struct { int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ int sparse; /* sparse image, don't fill it with zeros */ + off_t roundup; /* round image size up to this value */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-stable@freebsd.org Mon Nov 9 09:02:32 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04EFAA26CFF; Mon, 9 Nov 2015 09:02:32 +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 D27761C5F; Mon, 9 Nov 2015 09:02:31 +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 tA992Un0010905; Mon, 9 Nov 2015 09:02:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA992Ugh010901; Mon, 9 Nov 2015 09:02:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090902.tA992Ugh010901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290590 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:02:32 -0000 Author: ngie Date: Mon Nov 9 09:02:30 2015 New Revision: 290590 URL: https://svnweb.freebsd.org/changeset/base/290590 Log: MFstable/10 r290589: MFC r289203,r290180: r289203 (by adrian): makefs: introduce a new option to specify what to round the resulting image up to. From ticket: While trying to run FreeBSD/mips on some device having very small flash media, one is forced to compress file system with mkulzma(8) utility. It is desirable to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8) and big compression block size like 65535 bytes to mkulzma at the same time. Then one obtains very good comression ratios (like 75% and more) but faces the following problem. geom_uncompress kernel module reports GEOM provider size rounded up to its compression block size. Generally, this changes original media size and now it fails to match the size of embedded UFS file system that leads to other problems, f.e. geom_label kernel module does not like this and skips the file system while tasting the GEOM and looking for UFS label. This makes it impossible to refer to the file system using known UFS label instead of something like /dev/map/rootfs.uncompress. The following patch introduces new command line option "-r roundup" for makefs that makes it round up the image to specified block size. Hence, geom_uncompress does not change GEOM media size for images rounded that way and geom_label accepts such GEOMs just fine. With the patch applied, one can use following commands: $ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs $ mkulzma -s 65536 -o fs.img.ulzma fs.img PR: bin/203707 Submitted by: r290180: 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 Differential Revision: https://reviews.freebsd.org/D3959 Reviewed by: adrian (earlier patch), emaste Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/ffs.c stable/9/usr.sbin/makefs/makefs.8 stable/9/usr.sbin/makefs/makefs.c stable/9/usr.sbin/makefs/makefs.h Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs.c Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/ffs.c Mon Nov 9 09:02:30 2015 (r290590) @@ -410,6 +410,10 @@ ffs_validate(const char *dir, fsnode *ro /* round up to the next block */ fsopts->size = roundup(fsopts->size, ffs_opts->bsize); + /* round up to requested block size, if any */ + if (fsopts->roundup > 0) + fsopts->size = roundup(fsopts->size, fsopts->roundup); + /* calculate density if necessary */ if (ffs_opts->density == -1) ffs_opts->density = fsopts->size / fsopts->inodes + 1; Modified: stable/9/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/9/usr.sbin/makefs/makefs.8 Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.8 Mon Nov 9 09:02:30 2015 (r290590) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2013 +.Dd October 29, 2015 .Dt MAKEFS 8 .Os .Sh NAME @@ -53,6 +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-size .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -195,6 +196,14 @@ Deprecated. See the .Fl Z flag. +.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: stable/9/usr.sbin/makefs/makefs.c ============================================================================== --- stable/9/usr.sbin/makefs/makefs.c Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.c Mon Nov 9 09:02:30 2015 (r290590) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pr:s:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -209,6 +209,12 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; + case 'R': + /* Round image size up to specified block size */ + fsoptions.roundup = + strsuftoll("roundup-size", optarg, 0, LLONG_MAX); + break; + case 's': fsoptions.minsize = fsoptions.maxsize = strsuftoll("size", optarg, 1LL, LLONG_MAX); @@ -359,9 +365,9 @@ 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] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" -"\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\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); exit(1); } Modified: stable/9/usr.sbin/makefs/makefs.h ============================================================================== --- stable/9/usr.sbin/makefs/makefs.h Mon Nov 9 08:59:55 2015 (r290589) +++ stable/9/usr.sbin/makefs/makefs.h Mon Nov 9 09:02:30 2015 (r290590) @@ -130,6 +130,7 @@ typedef struct { int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ int sparse; /* sparse image, don't fill it with zeros */ + off_t roundup; /* round image size up to this value */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-stable@freebsd.org Mon Nov 9 09:03:25 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCF9A26DC4; Mon, 9 Nov 2015 09:03: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 547641DF4; Mon, 9 Nov 2015 09:03: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 tA993OMo011021; Mon, 9 Nov 2015 09:03:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA993OX7011020; Mon, 9 Nov 2015 09:03:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090903.tA993OX7011020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290591 - stable/10/usr.sbin/makefs/cd9660 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:03:25 -0000 Author: ngie Date: Mon Nov 9 09:03:24 2015 New Revision: 290591 URL: https://svnweb.freebsd.org/changeset/base/290591 Log: MFC r289899: Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field Bug 203648 Submitted by: Thomas Schmitt Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:02:30 2015 (r290590) +++ stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:03:24 2015 (r290591) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,13 +656,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRI pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_dev) > 32) - cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, + if (sizeof (fnode->inode->st.st_rdev) > 4) + cd9660_bothendian_dword( + (uint64_t)fnode->inode->st.st_rdev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } From owner-svn-src-stable@freebsd.org Mon Nov 9 09:04:13 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FADA26E7E; Mon, 9 Nov 2015 09:04:13 +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 E6F091F4A; Mon, 9 Nov 2015 09:04:12 +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 tA994Ccb011111; Mon, 9 Nov 2015 09:04:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA994C1n011110; Mon, 9 Nov 2015 09:04:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090904.tA994C1n011110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290592 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:04:13 -0000 Author: ngie Date: Mon Nov 9 09:04:11 2015 New Revision: 290592 URL: https://svnweb.freebsd.org/changeset/base/290592 Log: MFC r289902: Add a regression test for r289899 to validate rockridge encoding of device types Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:03:24 2015 (r290591) +++ stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:04:11 2015 (r290592) @@ -271,6 +271,32 @@ o_flag_rockridge_cleanup() common_cleanup } +atf_test_case o_flag_rockridge_dev_nodes cleanup +o_flag_rockridge_dev_nodes_head() +{ + atf_set "descr" "Functional tests to ensure that dev nodes are handled properly with rockridge extensions (NetBSD kern/48852; FreeBSD bug 203648)" +} +o_flag_rockridge_dev_nodes_body() +{ + create_test_dirs + + (tar -cvf - -C /dev null && touch .tar_ok) | \ + atf_check -e not-empty -o empty -s exit:0 tar -xvf - -C "$TEST_INPUTS_DIR" + + atf_check -e empty -o empty -s exit:0 test -c $TEST_INPUTS_DIR/null + atf_check -e empty -o empty -s exit:0 test -f .tar_ok + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o rockridge $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_image_contents +} +o_flag_rockridge_dev_nodes_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { atf_add_test_case D_flag @@ -285,4 +311,5 @@ atf_init_test_cases() atf_add_test_case o_flag_preparer atf_add_test_case o_flag_publisher atf_add_test_case o_flag_rockridge + atf_add_test_case o_flag_rockridge_dev_nodes } From owner-svn-src-stable@freebsd.org Mon Nov 9 09:05:11 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28787A26F13; Mon, 9 Nov 2015 09:05:11 +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 CE16D1114; Mon, 9 Nov 2015 09:05:10 +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 tA9959c2011220; Mon, 9 Nov 2015 09:05:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9959Xv011219; Mon, 9 Nov 2015 09:05:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090905.tA9959Xv011219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290593 - stable/9/usr.sbin/makefs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:05:11 -0000 Author: ngie Date: Mon Nov 9 09:05:09 2015 New Revision: 290593 URL: https://svnweb.freebsd.org/changeset/base/290593 Log: MFstable/10 r290591: MFC r289899: Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field Bug 203648 Submitted by: Thomas Schmitt Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:04:11 2015 (r290592) +++ stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c Mon Nov 9 09:05:09 2015 (r290593) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,13 +656,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRI pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_dev) > 32) - cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, + if (sizeof (fnode->inode->st.st_rdev) > 4) + cd9660_bothendian_dword( + (uint64_t)fnode->inode->st.st_rdev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } From owner-svn-src-stable@freebsd.org Mon Nov 9 09:20:03 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECB28A2955D; Mon, 9 Nov 2015 09:20: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 C33761A37; Mon, 9 Nov 2015 09:20:02 +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 tA99K10b014455; Mon, 9 Nov 2015 09:20:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99K17Y014452; Mon, 9 Nov 2015 09:20:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090920.tA99K17Y014452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290594 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:20:03 -0000 Author: ngie Date: Mon Nov 9 09:20:01 2015 New Revision: 290594 URL: https://svnweb.freebsd.org/changeset/base/290594 Log: MFC r290265,r290267,r290270: r290265: Add testcases for -t cd9660 -o isolevel=[1-3] -- -o isolevel=1 currently fails because of path comparison issues, so mark it as an expected failure. -- -o isolevel=3 is not implemented, so expect it to fail as an out of bounds value [*]. PR: 203645 Sponsored by: EMC / Isilon Storage Division r290267: Clean up mtree keyword support a slight bit and add a few more default keywords - Parameterize the mtree keywords as $DEFAULT_MTREE_KEYWORDS - Test with the extra mtree keywords, `mode,gid,uid`. - Add a note about mtrees with time support not working with makefs right now Sponsored by: EMC / Isilon Storage Division r290270: Add testcases for -t ffs -o version=[12] Verify the filesystem type using dumpfs. Add preliminary support for NetBSD (needs to be validated) Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:05:09 2015 (r290593) +++ stable/10/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Nov 9 09:20:01 2015 (r290594) @@ -113,7 +113,7 @@ from_mtree_spec_file_body() create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ - mtree -c -k type,link,size -p $TEST_INPUTS_DIR + mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR cd $TEST_INPUTS_DIR atf_check -e empty -o empty -s exit:0 \ $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE @@ -208,6 +208,61 @@ o_flag_allow_max_name_cleanup() common_cleanup } +atf_test_case o_flag_isolevel_1 cleanup +o_flag_isolevel_1_body() +{ + atf_expect_fail "this testcase needs work; the filenames generated seem incorrect/corrupt" + + create_test_inputs + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o isolevel=1 $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_isolevel_1_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_isolevel_2 cleanup +o_flag_isolevel_2_body() +{ + create_test_inputs + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o isolevel=2 $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + check_base_iso9660_image_contents +} +o_flag_isolevel_2_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_isolevel_3 cleanup +o_flag_isolevel_3_body() +{ + create_test_inputs + + # XXX: isolevel=3 isn't implemented yet. See FreeBSD bug # 203645 + if true; then + atf_check -e match:'makefs: ISO Level 3 is greater than 2\.' -o empty -s not-exit:0 \ + $MAKEFS -o isolevel=3 $TEST_IMAGE $TEST_INPUTS_DIR + else + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o isolevel=3 $TEST_IMAGE $TEST_INPUTS_DIR + mount_image + check_base_iso9660_image_contents + fi +} +o_flag_isolevel_3_cleanup() +{ + common_cleanup +} + atf_test_case o_flag_preparer o_flag_preparer_body() { @@ -308,6 +363,9 @@ atf_init_test_cases() atf_add_test_case o_flag_allow_deep_trees atf_add_test_case o_flag_allow_max_name + atf_add_test_case o_flag_isolevel_1 + atf_add_test_case o_flag_isolevel_2 + atf_add_test_case o_flag_isolevel_3 atf_add_test_case o_flag_preparer atf_add_test_case o_flag_publisher atf_add_test_case o_flag_rockridge Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Nov 9 09:05:09 2015 (r290593) +++ stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Nov 9 09:20:01 2015 (r290594) @@ -105,7 +105,7 @@ from_mtree_spec_file_body() create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ - mtree -c -k type,link,size -p $TEST_INPUTS_DIR + mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR cd $TEST_INPUTS_DIR atf_check -e empty -o not-empty -s exit:0 \ @@ -158,6 +158,70 @@ from_single_dir_cleanup() common_cleanup } +atf_test_case o_flag_version_1 cleanup +o_flag_version_1_body() +{ + ffs_version=1 + + platform=$(uname) + case "$platform" in + FreeBSD) + ffs_label=UFS${ffs_version} + ;; + NetBSD) + ffs_label=FFSv${ffs_version} + ;; + *) + atf_skip "Unsupported platform" + ;; + esac + + create_test_inputs + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + check_ffs_image_contents +} +o_flag_version_1_cleanup() +{ + common_cleanup +} + +atf_test_case o_flag_version_2 cleanup +o_flag_version_2_body() +{ + ffs_version=2 + + platform=$(uname) + case "$platform" in + FreeBSD) + ffs_label=UFS${ffs_version} + ;; + NetBSD) + ffs_label=FFSv${ffs_version} + ;; + *) + atf_skip "Unsupported platform" + ;; + esac + + create_test_inputs + + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + check_ffs_image_contents +} +o_flag_version_2_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { @@ -168,5 +232,6 @@ atf_init_test_cases() atf_add_test_case from_multiple_dirs atf_add_test_case from_single_dir - + atf_add_test_case o_flag_version_1 + atf_add_test_case o_flag_version_2 } Modified: stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Nov 9 09:05:09 2015 (r290593) +++ stable/10/usr.sbin/makefs/tests/makefs_tests_common.sh Mon Nov 9 09:20:01 2015 (r290594) @@ -29,6 +29,13 @@ KB=1024 : ${TMPDIR=/tmp} +# TODO: add mtree `time` support; get a lot of errors like this right now when +# passing generating disk images with keyword mtree support, like: +# +# `[...]/mtree.spec:8: error: time: invalid value '1446458503'` +# +#DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time" +DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link" TEST_IMAGE="$TMPDIR/test.img" TEST_INPUTS_DIR="$TMPDIR/inputs" TEST_MD_DEVICE_FILE="$TMPDIR/md.output" @@ -39,7 +46,7 @@ check_image_contents() { local directories=$TEST_INPUTS_DIR local excludes mtree_excludes_arg mtree_file - local mtree_keywords="type,link,size" + local mtree_keywords="$DEFAULT_MTREE_KEYWORDS" while getopts "d:f:m:X:" flag; do case "$flag" in From owner-svn-src-stable@freebsd.org Mon Nov 9 09:22:13 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 660CAA297E6; Mon, 9 Nov 2015 09:22:13 +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 16D4D1DE6; Mon, 9 Nov 2015 09:22:13 +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 tA99MCjT017160; Mon, 9 Nov 2015 09:22:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99MC9n017159; Mon, 9 Nov 2015 09:22:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090922.tA99MC9n017159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290595 - stable/10/usr.sbin/makefs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:22:13 -0000 Author: ngie Date: Mon Nov 9 09:22:11 2015 New Revision: 290595 URL: https://svnweb.freebsd.org/changeset/base/290595 Log: MFC r290264: Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by dereferencing a NULL function pointer Add some asserts to ensure that isolevel is always either 1 or 2. PR: 203645 Reported by: Thomas Schmitt Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/cd9660.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660.c Mon Nov 9 09:20:01 2015 (r290594) +++ stable/10/usr.sbin/makefs/cd9660.c Mon Nov 9 09:22:11 2015 (r290595) @@ -296,8 +296,8 @@ cd9660_parse_opts(const char *option, fs int rv; /* Set up allowed options - integer options ONLY */ option_t cd9660_options[] = { - { "l", &diskStructure.isoLevel, 1, 3, "ISO Level" }, - { "isolevel", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "l", &diskStructure.isoLevel, 1, 2, "ISO Level" }, + { "isolevel", &diskStructure.isoLevel, 1, 2, "ISO Level" }, { "verbose", &diskStructure.verbose_level, 0, 2, "Turns on verbose output" }, { "v", &diskStructure.verbose_level, 0 , 2, @@ -1055,6 +1055,7 @@ cd9660_rename_filename(cd9660node *iter, if (diskStructure.verbose_level > 0) printf("Rename_filename called\n"); + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* TODO : A LOT of chanes regarding 8.3 filenames */ if (diskStructure.isoLevel == 1) maxlength = 8; @@ -1730,6 +1731,7 @@ cd9660_joliet_convert_filename(const cha static int cd9660_convert_filename(const char *oldname, char *newname, int is_file) { + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* NEW */ cd9660_filename_conversion_functor conversion_function = 0; if (diskStructure.isoLevel == 1) From owner-svn-src-stable@freebsd.org Mon Nov 9 09:23:14 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D618FA2993A; Mon, 9 Nov 2015 09:23:14 +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 84F2E1F9F; Mon, 9 Nov 2015 09:23:14 +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 tA99NDxs017288; Mon, 9 Nov 2015 09:23:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99NDxe017287; Mon, 9 Nov 2015 09:23:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090923.tA99NDxe017287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290596 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:23:14 -0000 Author: ngie Date: Mon Nov 9 09:23:13 2015 New Revision: 290596 URL: https://svnweb.freebsd.org/changeset/base/290596 Log: MFstable/10 r290595: MFC r290264: Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by dereferencing a NULL function pointer Add some asserts to ensure that isolevel is always either 1 or 2. PR: 203645 Reported by: Thomas Schmitt Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/cd9660.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/9/usr.sbin/makefs/cd9660.c Mon Nov 9 09:22:11 2015 (r290595) +++ stable/9/usr.sbin/makefs/cd9660.c Mon Nov 9 09:23:13 2015 (r290596) @@ -296,8 +296,8 @@ cd9660_parse_opts(const char *option, fs int rv; /* Set up allowed options - integer options ONLY */ option_t cd9660_options[] = { - { "l", &diskStructure.isoLevel, 1, 3, "ISO Level" }, - { "isolevel", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "l", &diskStructure.isoLevel, 1, 2, "ISO Level" }, + { "isolevel", &diskStructure.isoLevel, 1, 2, "ISO Level" }, { "verbose", &diskStructure.verbose_level, 0, 2, "Turns on verbose output" }, { "v", &diskStructure.verbose_level, 0 , 2, @@ -1055,6 +1055,7 @@ cd9660_rename_filename(cd9660node *iter, if (diskStructure.verbose_level > 0) printf("Rename_filename called\n"); + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* TODO : A LOT of chanes regarding 8.3 filenames */ if (diskStructure.isoLevel == 1) maxlength = 8; @@ -1730,6 +1731,7 @@ cd9660_joliet_convert_filename(const cha static int cd9660_convert_filename(const char *oldname, char *newname, int is_file) { + assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); /* NEW */ cd9660_filename_conversion_functor conversion_function = 0; if (diskStructure.isoLevel == 1) From owner-svn-src-stable@freebsd.org Mon Nov 9 09:23:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF91A2999A; Mon, 9 Nov 2015 09:23:36 +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 579F0117D; Mon, 9 Nov 2015 09:23:36 +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 tA99NZMO017355; Mon, 9 Nov 2015 09:23:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99NZS1017354; Mon, 9 Nov 2015 09:23:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090923.tA99NZS1017354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290597 - stable/10/usr.sbin/makefs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:23:36 -0000 Author: ngie Date: Mon Nov 9 09:23:35 2015 New Revision: 290597 URL: https://svnweb.freebsd.org/changeset/base/290597 Log: MFC r290268: Sync minor whitespace / type changes in ffs_csum_swap and ffs_sb_swap with src/sys/ufs/ffs/ffs_bswap.c@1.39 Obtained from: NetBSD Sponsored by: EMC / Isilon Storage Division Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:13 2015 (r290596) +++ stable/10/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:35 2015 (r290597) @@ -67,7 +67,7 @@ void ffs_csumtotal_swap(struct csum_tota void ffs_sb_swap(struct fs *o, struct fs *n) { - int i; + size_t i; u_int32_t *o32, *n32; /* @@ -97,7 +97,7 @@ ffs_sb_swap(struct fs *o, struct fs *n) n->fs_csaddr = bswap64(o->fs_csaddr); n->fs_pendingblocks = bswap64(o->fs_pendingblocks); n->fs_pendinginodes = bswap32(o->fs_pendinginodes); - + /* These fields overlap with the second half of the * historic FS_42POSTBLFMT postbl table */ @@ -171,9 +171,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, void ffs_csum_swap(struct csum *o, struct csum *n, int size) { - int i; + size_t i; u_int32_t *oint, *nint; - + oint = (u_int32_t*)o; nint = (u_int32_t*)n; From owner-svn-src-stable@freebsd.org Mon Nov 9 09:24:30 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD64A29A3C; Mon, 9 Nov 2015 09:24:30 +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 071291308; Mon, 9 Nov 2015 09:24:29 +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 tA99OT5H017446; Mon, 9 Nov 2015 09:24:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99OTIY017445; Mon, 9 Nov 2015 09:24:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090924.tA99OTIY017445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290598 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:24:30 -0000 Author: ngie Date: Mon Nov 9 09:24:28 2015 New Revision: 290598 URL: https://svnweb.freebsd.org/changeset/base/290598 Log: MFstable/10 r290597: MFC r290268: Sync minor whitespace / type changes in ffs_csum_swap and ffs_sb_swap with src/sys/ufs/ffs/ffs_bswap.c@1.39 Obtained from: NetBSD Sponsored by: EMC / Isilon Storage Division Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:23:35 2015 (r290597) +++ stable/9/usr.sbin/makefs/ffs/ffs_bswap.c Mon Nov 9 09:24:28 2015 (r290598) @@ -67,7 +67,7 @@ void ffs_csumtotal_swap(struct csum_tota void ffs_sb_swap(struct fs *o, struct fs *n) { - int i; + size_t i; u_int32_t *o32, *n32; /* @@ -97,7 +97,7 @@ ffs_sb_swap(struct fs *o, struct fs *n) n->fs_csaddr = bswap64(o->fs_csaddr); n->fs_pendingblocks = bswap64(o->fs_pendingblocks); n->fs_pendinginodes = bswap32(o->fs_pendinginodes); - + /* These fields overlap with the second half of the * historic FS_42POSTBLFMT postbl table */ @@ -171,9 +171,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, void ffs_csum_swap(struct csum *o, struct csum *n, int size) { - int i; + size_t i; u_int32_t *oint, *nint; - + oint = (u_int32_t*)o; nint = (u_int32_t*)n; From owner-svn-src-stable@freebsd.org Mon Nov 9 09:28:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6E8A29B35; Mon, 9 Nov 2015 09:28:36 +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 087F41597; Mon, 9 Nov 2015 09:28:35 +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 tA99SZbK017673; Mon, 9 Nov 2015 09:28:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99SZVp017672; Mon, 9 Nov 2015 09:28:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090928.tA99SZVp017672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290599 - stable/10/usr.sbin/makefs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:28:36 -0000 Author: ngie Date: Mon Nov 9 09:28:34 2015 New Revision: 290599 URL: https://svnweb.freebsd.org/changeset/base/290599 Log: MFC r266930,r289225: r266930 (by jmg): convert to using the _daddr_t types like newfs was... Put the superblock in the correct possition for UFS2... There is a bug in FFS that if we don't put it here (for UFS2), it will forcefully relocate the superblock, and I believe cause data loss.. I have a fix for that, but w/ how many releases are broken, we won't be able to switch to the better _FLOPPY (block 0) for this for a while.. r289225 (by sbruno): makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel module sanity checks do not like zero fs_old_size value and skips such UFS1 file system while tasting (fs_old_size derives from sblock.fs_providersize). PR: 203704 Submitted by: eugen@grosbein.net Reviewed by: marcel Modified: stable/10/usr.sbin/makefs/ffs/mkfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- stable/10/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:24:28 2015 (r290598) +++ stable/10/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:28:34 2015 (r290599) @@ -248,15 +248,16 @@ ffs_mkfs(const char *fsys, const fsinfo_ exit(21); } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); - sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_size = sblock.fs_providersize = fssize = + dbtofsb(&sblock, fssize); if (Oflag <= 1) { sblock.fs_magic = FS_UFS1_MAGIC; sblock.fs_sblockloc = SBLOCK_UFS1; - sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int32_t)); + sizeof (ufs1_daddr_t)); sblock.fs_old_inodefmt = FS_44INODEFMT; sblock.fs_old_cgoffset = 0; sblock.fs_old_cgmask = 0xffffffff; @@ -272,15 +273,11 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_old_nrpos = 1; } else { sblock.fs_magic = FS_UFS2_MAGIC; -#if 0 /* XXX makefs is used for small filesystems. */ sblock.fs_sblockloc = SBLOCK_UFS2; -#else - sblock.fs_sblockloc = SBLOCK_UFS1; -#endif - sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int64_t)); + sizeof (ufs2_daddr_t)); } sblock.fs_sblkno = From owner-svn-src-stable@freebsd.org Mon Nov 9 09:29:40 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E09A29BF8; Mon, 9 Nov 2015 09:29: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 13E6E1900; Mon, 9 Nov 2015 09:29:40 +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 tA99Tdkb017925; Mon, 9 Nov 2015 09:29:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA99TdqI017924; Mon, 9 Nov 2015 09:29:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201511090929.tA99TdqI017924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 9 Nov 2015 09:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290600 - stable/9/usr.sbin/makefs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 09:29:40 -0000 Author: ngie Date: Mon Nov 9 09:29:38 2015 New Revision: 290600 URL: https://svnweb.freebsd.org/changeset/base/290600 Log: MFstable/10 r290599: MFC r266930,r289225: r266930 (by jmg): convert to using the _daddr_t types like newfs was... Put the superblock in the correct possition for UFS2... There is a bug in FFS that if we don't put it here (for UFS2), it will forcefully relocate the superblock, and I believe cause data loss.. I have a fix for that, but w/ how many releases are broken, we won't be able to switch to the better _FLOPPY (block 0) for this for a while.. r289225 (by sbruno): makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel module sanity checks do not like zero fs_old_size value and skips such UFS1 file system while tasting (fs_old_size derives from sblock.fs_providersize). PR: 203704 Submitted by: eugen@grosbein.net Reviewed by: marcel Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:28:34 2015 (r290599) +++ stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:29:38 2015 (r290600) @@ -248,15 +248,16 @@ ffs_mkfs(const char *fsys, const fsinfo_ exit(21); } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); - sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_size = sblock.fs_providersize = fssize = + dbtofsb(&sblock, fssize); if (Oflag <= 1) { sblock.fs_magic = FS_UFS1_MAGIC; sblock.fs_sblockloc = SBLOCK_UFS1; - sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int32_t)); + sizeof (ufs1_daddr_t)); sblock.fs_old_inodefmt = FS_44INODEFMT; sblock.fs_old_cgoffset = 0; sblock.fs_old_cgmask = 0xffffffff; @@ -272,15 +273,11 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_old_nrpos = 1; } else { sblock.fs_magic = FS_UFS2_MAGIC; -#if 0 /* XXX makefs is used for small filesystems. */ sblock.fs_sblockloc = SBLOCK_UFS2; -#else - sblock.fs_sblockloc = SBLOCK_UFS1; -#endif - sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int64_t)); + sizeof (ufs2_daddr_t)); } sblock.fs_sblkno = From owner-svn-src-stable@freebsd.org Mon Nov 9 11:25:01 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78DFAA2A350; Mon, 9 Nov 2015 11:25:01 +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 29DEA1371; Mon, 9 Nov 2015 11:25:01 +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 tA9BP0ZI052302; Mon, 9 Nov 2015 11:25:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BP0Jg052300; Mon, 9 Nov 2015 11:25:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091125.tA9BP0Jg052300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290607 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:25:01 -0000 Author: hselasky Date: Mon Nov 9 11:24:59 2015 New Revision: 290607 URL: https://svnweb.freebsd.org/changeset/base/290607 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/10/sys/dev/usb/net/if_cdce.c stable/10/sys/dev/usb/net/if_urndis.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/10/sys/dev/usb/net/if_cdce.c Mon Nov 9 10:41:27 2015 (r290606) +++ stable/10/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:24:59 2015 (r290607) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); Modified: stable/10/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/10/sys/dev/usb/net/if_urndis.c Mon Nov 9 10:41:27 2015 (r290606) +++ stable/10/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:24:59 2015 (r290607) @@ -848,7 +848,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid ethernet size " "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); goto tr_setup; - } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { + } else if (msg.rm_datalen > (uint32_t)(MCLBYTES - ETHER_ALIGN)) { ifp->if_ierrors++; DPRINTF("invalid ethernet size " "%u > %u\n", @@ -862,6 +862,7 @@ urndis_bulk_read_callback(struct usb_xfe /* check if we have a buffer */ if (m != NULL) { + m->m_len = m->m_pkthdr.len = msg.rm_datalen + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset + msg.rm_dataoffset + From owner-svn-src-stable@freebsd.org Mon Nov 9 11:27:33 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29EC9A2A462; Mon, 9 Nov 2015 11:27:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C990D159D; Mon, 9 Nov 2015 11:27:32 +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 tA9BRV6T052432; Mon, 9 Nov 2015 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BRVSu052430; Mon, 9 Nov 2015 11:27:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091127.tA9BRVSu052430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290608 - stable/9/sys/dev/usb/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:27:33 -0000 Author: hselasky Date: Mon Nov 9 11:27:31 2015 New Revision: 290608 URL: https://svnweb.freebsd.org/changeset/base/290608 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/9/sys/dev/usb/net/if_cdce.c stable/9/sys/dev/usb/net/if_urndis.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/9/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:24:59 2015 (r290607) +++ stable/9/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:27:31 2015 (r290608) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); Modified: stable/9/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/9/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:24:59 2015 (r290607) +++ stable/9/sys/dev/usb/net/if_urndis.c Mon Nov 9 11:27:31 2015 (r290608) @@ -848,7 +848,7 @@ urndis_bulk_read_callback(struct usb_xfe DPRINTF("invalid ethernet size " "%u < %u\n", msg.rm_datalen, (unsigned)sizeof(struct ether_header)); goto tr_setup; - } else if (msg.rm_datalen > (uint32_t)MCLBYTES) { + } else if (msg.rm_datalen > (uint32_t)(MCLBYTES - ETHER_ALIGN)) { ifp->if_ierrors++; DPRINTF("invalid ethernet size " "%u > %u\n", @@ -862,6 +862,7 @@ urndis_bulk_read_callback(struct usb_xfe /* check if we have a buffer */ if (m != NULL) { + m->m_len = m->m_pkthdr.len = msg.rm_datalen + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset + msg.rm_dataoffset + From owner-svn-src-stable@freebsd.org Mon Nov 9 11:29:56 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04527A2A4C1; Mon, 9 Nov 2015 11:29:56 +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 C0B0A180C; Mon, 9 Nov 2015 11:29:55 +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 tA9BTsXa052564; Mon, 9 Nov 2015 11:29:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9BTsYP052563; Mon, 9 Nov 2015 11:29:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511091129.tA9BTsYP052563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Nov 2015 11:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r290609 - stable/8/sys/dev/usb/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 11:29:56 -0000 Author: hselasky Date: Mon Nov 9 11:29:54 2015 New Revision: 290609 URL: https://svnweb.freebsd.org/changeset/base/290609 Log: MFC r290441: Fix for unaligned IP-header. The mbuf length fields must be set before m_adj() is called else m_adj() will not always adjust the mbuf and an unaligned read exception can trigger inside the network stack. This can happen on platforms where unaligned reads are not supported. Adjust a length check to include the 2-byte ethernet alignment while at it. Modified: stable/8/sys/dev/usb/net/if_cdce.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:27:31 2015 (r290608) +++ stable/8/sys/dev/usb/net/if_cdce.c Mon Nov 9 11:29:54 2015 (r290609) @@ -1381,6 +1381,7 @@ cdce_ncm_bulk_read_callback(struct usb_x /* check if we have a buffer */ if (m) { + m->m_len = m->m_pkthdr.len = temp + ETHER_ALIGN; m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset, m->m_data, temp); From owner-svn-src-stable@freebsd.org Tue Nov 10 07:17:40 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49828A2B63D; Tue, 10 Nov 2015 07:17:40 +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 14081197C; Tue, 10 Nov 2015 07:17:40 +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 tAA7HdkX019741; Tue, 10 Nov 2015 07:17:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA7Hdpe019739; Tue, 10 Nov 2015 07:17:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201511100717.tAA7Hdpe019739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Nov 2015 07:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290634 - stable/10/bin/rm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 07:17:40 -0000 Author: bapt Date: Tue Nov 10 07:17:38 2015 New Revision: 290634 URL: https://svnweb.freebsd.org/changeset/base/290634 Log: MFC r290480 Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1 edition 2013. No need anymore to disable the protection if one set the POXILY_CORRECT environment variable. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D4092 Modified: stable/10/bin/rm/rm.1 stable/10/bin/rm/rm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/rm/rm.1 ============================================================================== --- stable/10/bin/rm/rm.1 Tue Nov 10 02:29:19 2015 (r290633) +++ stable/10/bin/rm/rm.1 Tue Nov 10 07:17:38 2015 (r290634) @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd April 25, 2013 +.Dd November 7, 2015 .Dt RM 1 .Os .Sh NAME @@ -235,7 +235,7 @@ not the standard error output. The .Nm command conforms to -.St -p1003.2 . +.St -p1003.1-2013 . .Pp The simplified .Nm unlink Modified: stable/10/bin/rm/rm.c ============================================================================== --- stable/10/bin/rm/rm.c Tue Nov 10 02:29:19 2015 (r290633) +++ stable/10/bin/rm/rm.c Tue Nov 10 07:17:38 2015 (r290634) @@ -155,8 +155,7 @@ main(int argc, char *argv[]) } checkdot(argv); - if (getenv("POSIXLY_CORRECT") == NULL) - checkslash(argv); + checkslash(argv); uid = geteuid(); (void)signal(SIGINFO, siginfo); From owner-svn-src-stable@freebsd.org Tue Nov 10 08:39:09 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 209D4A2BB03; Tue, 10 Nov 2015 08:39:09 +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 E093E1D5D; Tue, 10 Nov 2015 08:39:08 +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 tAA8d8QC042885; Tue, 10 Nov 2015 08:39:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAA8d7Hk042884; Tue, 10 Nov 2015 08:39:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201511100839.tAA8d7Hk042884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 Nov 2015 08:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290638 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 08:39:09 -0000 Author: kib Date: Tue Nov 10 08:39:07 2015 New Revision: 290638 URL: https://svnweb.freebsd.org/changeset/base/290638 Log: MFC r290047: Do not perform read-ahead for BA_CLRBUF request when we are low on memory or when dirty buffer queue is too large. Modified: stable/10/sys/ufs/ffs/ffs_balloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_balloc.c Tue Nov 10 08:11:27 2015 (r290637) +++ stable/10/sys/ufs/ffs/ffs_balloc.c Tue Nov 10 08:39:07 2015 (r290638) @@ -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-stable@freebsd.org Wed Nov 11 01:32:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A42A2A498; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5897D1AFE; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB1WZ8m001533; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB1WZVK001531; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511110132.tAB1WZVK001531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Nov 2015 01:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290668 - in stable: 10/sys/i386/i386 10/sys/i386/include 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 01:32:36 -0000 Author: jhb Date: Wed Nov 11 01:32:35 2015 New Revision: 290668 URL: https://svnweb.freebsd.org/changeset/base/290668 Log: MFC 284324,290164: Workaround debuggers that try to read the full 32-bit words holding selectors in trapframes. 284324: Ensure that the upper 16 bits of segment registers manually saved in trapframes are cleared by explicitly pushing a zero and then moving the segment register into the low 16 bits. Certain Intel processors treat a push of a segment register as a move of the segment register into the low 16 bits leaving the upper 16 bits of the word in the stack unchanged. 290164: 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. Modified: stable/10/sys/i386/i386/exception.s stable/10/sys/i386/include/asmacros.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/i386/i386/exception.s stable/9/sys/i386/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/i386/i386/exception.s ============================================================================== --- stable/10/sys/i386/i386/exception.s Wed Nov 11 00:45:41 2015 (r290667) +++ stable/10/sys/i386/i386/exception.s Wed Nov 11 01:32:35 2015 (r290668) @@ -158,9 +158,12 @@ IDTVEC(xmm) .type alltraps,@function alltraps: pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -234,9 +237,12 @@ IDTVEC(lcall_syscall) pushl $7 /* sizeof "lcall 7,0" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -260,9 +266,12 @@ IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -417,13 +426,16 @@ doreti_iret: doreti_iret_fault: subl $8,%esp pushal - pushl %ds + pushl $0 + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: - pushl %es + pushl $0 + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: - pushl %fs + pushl $0 + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: stable/10/sys/i386/include/asmacros.h ============================================================================== --- stable/10/sys/i386/include/asmacros.h Wed Nov 11 00:45:41 2015 (r290667) +++ stable/10/sys/i386/include/asmacros.h Wed Nov 11 01:32:35 2015 (r290668) @@ -146,9 +146,12 @@ pushl $0 ; /* dummy error code */ \ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ - pushl %ds ; /* save data and extra segments ... */ \ - pushl %es ; \ - pushl %fs + pushl $0 ; /* save data and extra segments ... */ \ + movw %ds,(%esp) ; \ + pushl $0 ; \ + movw %es,(%esp) ; \ + pushl $0 ; \ + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \ From owner-svn-src-stable@freebsd.org Wed Nov 11 01:32:37 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6177A2A49F; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB6A41AFF; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB1WZIp001540; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB1WZLu001538; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511110132.tAB1WZLu001538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Nov 2015 01:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290668 - in stable: 10/sys/i386/i386 10/sys/i386/include 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 01:32:37 -0000 Author: jhb Date: Wed Nov 11 01:32:35 2015 New Revision: 290668 URL: https://svnweb.freebsd.org/changeset/base/290668 Log: MFC 284324,290164: Workaround debuggers that try to read the full 32-bit words holding selectors in trapframes. 284324: Ensure that the upper 16 bits of segment registers manually saved in trapframes are cleared by explicitly pushing a zero and then moving the segment register into the low 16 bits. Certain Intel processors treat a push of a segment register as a move of the segment register into the low 16 bits leaving the upper 16 bits of the word in the stack unchanged. 290164: 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. Modified: stable/9/sys/i386/i386/exception.s stable/9/sys/i386/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/i386/i386/exception.s stable/10/sys/i386/include/asmacros.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/i386/i386/exception.s ============================================================================== --- stable/9/sys/i386/i386/exception.s Wed Nov 11 00:45:41 2015 (r290667) +++ stable/9/sys/i386/i386/exception.s Wed Nov 11 01:32:35 2015 (r290668) @@ -158,9 +158,12 @@ IDTVEC(xmm) .type alltraps,@function alltraps: pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -234,9 +237,12 @@ IDTVEC(lcall_syscall) pushl $7 /* sizeof "lcall 7,0" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -260,9 +266,12 @@ IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -417,13 +426,16 @@ doreti_iret: doreti_iret_fault: subl $8,%esp pushal - pushl %ds + pushl $0 + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: - pushl %es + pushl $0 + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: - pushl %fs + pushl $0 + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: stable/9/sys/i386/include/asmacros.h ============================================================================== --- stable/9/sys/i386/include/asmacros.h Wed Nov 11 00:45:41 2015 (r290667) +++ stable/9/sys/i386/include/asmacros.h Wed Nov 11 01:32:35 2015 (r290668) @@ -146,9 +146,12 @@ pushl $0 ; /* dummy error code */ \ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ - pushl %ds ; /* save data and extra segments ... */ \ - pushl %es ; \ - pushl %fs + pushl $0 ; /* save data and extra segments ... */ \ + movw %ds,(%esp) ; \ + pushl $0 ; \ + movw %es,(%esp) ; \ + pushl $0 ; \ + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \ From owner-svn-src-stable@freebsd.org Wed Nov 11 12:36:43 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE9EAA2B9F9; Wed, 11 Nov 2015 12:36:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788F014CB; Wed, 11 Nov 2015 12:36:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tABCagB9091016; Wed, 11 Nov 2015 12:36:42 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tABCagb8091015; Wed, 11 Nov 2015 12:36:42 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201511111236.tABCagb8091015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 11 Nov 2015 12:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290669 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 12:36:43 -0000 Author: kp Date: Wed Nov 11 12:36:42 2015 New Revision: 290669 URL: https://svnweb.freebsd.org/changeset/base/290669 Log: MFC r290161: 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 Modified: stable/10/sys/netpfil/pf/pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Wed Nov 11 01:32:35 2015 (r290668) +++ stable/10/sys/netpfil/pf/pf.c Wed Nov 11 12:36:42 2015 (r290669) @@ -5576,6 +5576,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-stable@freebsd.org Thu Nov 12 01:21:23 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE25EA2C25B; Thu, 12 Nov 2015 01:21: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 898D21ED9; Thu, 12 Nov 2015 01:21:23 +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 tAC1LMtb019947; Thu, 12 Nov 2015 01:21:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC1LMhJ019946; Thu, 12 Nov 2015 01:21:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511120121.tAC1LMhJ019946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Nov 2015 01:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290694 - in stable/10/gnu/usr.bin/binutils: ar ranlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 01:21:24 -0000 Author: bdrewery Date: Thu Nov 12 01:21:22 2015 New Revision: 290694 URL: https://svnweb.freebsd.org/changeset/base/290694 Log: Remove empty directories leftover from r255974. Deleted: stable/10/gnu/usr.bin/binutils/ar/ stable/10/gnu/usr.bin/binutils/ranlib/ From owner-svn-src-stable@freebsd.org Thu Nov 12 03:26:07 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A7EA2D4E6; Thu, 12 Nov 2015 03:26:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A1C8419A3; Thu, 12 Nov 2015 03:26:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3Q6Qh057360; Thu, 12 Nov 2015 03:26:06 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3Q6dw057354; Thu, 12 Nov 2015 03:26:06 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120326.tAC3Q6dw057354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290698 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:26:08 -0000 Author: edwin Date: Thu Nov 12 03:26:05 2015 New Revision: 290698 URL: https://svnweb.freebsd.org/changeset/base/290698 Log: MFC of 290697,tzdata10: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/zone.tab stable/10/contrib/tzdata/zone1970.tab Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/asia Thu Nov 12 03:26:05 2015 (r290698) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/australasia Thu Nov 12 03:26:05 2015 (r290698) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/europe Thu Nov 12 03:26:05 2015 (r290698) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/northamerica Thu Nov 12 03:26:05 2015 (r290698) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/10/contrib/tzdata/zone.tab ============================================================================== --- stable/10/contrib/tzdata/zone.tab Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/zone.tab Thu Nov 12 03:26:05 2015 (r290698) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/10/contrib/tzdata/zone1970.tab ============================================================================== --- stable/10/contrib/tzdata/zone1970.tab Thu Nov 12 03:25:04 2015 (r290697) +++ stable/10/contrib/tzdata/zone1970.tab Thu Nov 12 03:26:05 2015 (r290698) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-stable@freebsd.org Thu Nov 12 03:28:34 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D97A2D548; Thu, 12 Nov 2015 03:28:34 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 ECFAF1B33; Thu, 12 Nov 2015 03:28:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3SW0v057491; Thu, 12 Nov 2015 03:28:32 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3SWgS057483; Thu, 12 Nov 2015 03:28:32 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120328.tAC3SWgS057483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290699 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:28:34 -0000 Author: edwin Date: Thu Nov 12 03:28:32 2015 New Revision: 290699 URL: https://svnweb.freebsd.org/changeset/base/290699 Log: MFC of 290697,tzdata9: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/europe stable/9/contrib/tzdata/northamerica stable/9/contrib/tzdata/zone.tab stable/9/contrib/tzdata/zone1970.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/asia Thu Nov 12 03:28:32 2015 (r290699) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/australasia Thu Nov 12 03:28:32 2015 (r290699) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/9/contrib/tzdata/europe ============================================================================== --- stable/9/contrib/tzdata/europe Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/europe Thu Nov 12 03:28:32 2015 (r290699) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/9/contrib/tzdata/northamerica ============================================================================== --- stable/9/contrib/tzdata/northamerica Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/northamerica Thu Nov 12 03:28:32 2015 (r290699) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/9/contrib/tzdata/zone.tab ============================================================================== --- stable/9/contrib/tzdata/zone.tab Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/zone.tab Thu Nov 12 03:28:32 2015 (r290699) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/9/contrib/tzdata/zone1970.tab ============================================================================== --- stable/9/contrib/tzdata/zone1970.tab Thu Nov 12 03:26:05 2015 (r290698) +++ stable/9/contrib/tzdata/zone1970.tab Thu Nov 12 03:28:32 2015 (r290699) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-stable@freebsd.org Thu Nov 12 03:29:38 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 735A2A2D5C0; Thu, 12 Nov 2015 03:29:38 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2F7501D81; Thu, 12 Nov 2015 03:29:38 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3TbSk057800; Thu, 12 Nov 2015 03:29:37 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3Tat7057794; Thu, 12 Nov 2015 03:29:36 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120329.tAC3Tat7057794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r290700 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:29:38 -0000 Author: edwin Date: Thu Nov 12 03:29:36 2015 New Revision: 290700 URL: https://svnweb.freebsd.org/changeset/base/290700 Log: MFC of 290697,tzdata8: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/zone.tab stable/8/share/zoneinfo/zone1970.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/asia Thu Nov 12 03:29:36 2015 (r290700) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/8/share/zoneinfo/australasia ============================================================================== --- stable/8/share/zoneinfo/australasia Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/australasia Thu Nov 12 03:29:36 2015 (r290700) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/europe Thu Nov 12 03:29:36 2015 (r290700) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/northamerica Thu Nov 12 03:29:36 2015 (r290700) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/8/share/zoneinfo/zone.tab ============================================================================== --- stable/8/share/zoneinfo/zone.tab Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/zone.tab Thu Nov 12 03:29:36 2015 (r290700) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/8/share/zoneinfo/zone1970.tab ============================================================================== --- stable/8/share/zoneinfo/zone1970.tab Thu Nov 12 03:28:32 2015 (r290699) +++ stable/8/share/zoneinfo/zone1970.tab Thu Nov 12 03:29:36 2015 (r290700) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-stable@freebsd.org Thu Nov 12 03:30:06 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BC09A2D624; Thu, 12 Nov 2015 03:30:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 188D01ECF; Thu, 12 Nov 2015 03:30:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3U5tK057893; Thu, 12 Nov 2015 03:30:05 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3U4do057886; Thu, 12 Nov 2015 03:30:04 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120330.tAC3U4do057886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r290701 - stable/7/share/zoneinfo X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:30:06 -0000 Author: edwin Date: Thu Nov 12 03:30:04 2015 New Revision: 290701 URL: https://svnweb.freebsd.org/changeset/base/290701 Log: MFC of 290697,tzdata7: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/europe stable/7/share/zoneinfo/northamerica stable/7/share/zoneinfo/zone.tab stable/7/share/zoneinfo/zone1970.tab Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/asia Thu Nov 12 03:30:04 2015 (r290701) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/7/share/zoneinfo/australasia ============================================================================== --- stable/7/share/zoneinfo/australasia Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/australasia Thu Nov 12 03:30:04 2015 (r290701) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/7/share/zoneinfo/europe ============================================================================== --- stable/7/share/zoneinfo/europe Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/europe Thu Nov 12 03:30:04 2015 (r290701) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/7/share/zoneinfo/northamerica ============================================================================== --- stable/7/share/zoneinfo/northamerica Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/northamerica Thu Nov 12 03:30:04 2015 (r290701) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/7/share/zoneinfo/zone.tab ============================================================================== --- stable/7/share/zoneinfo/zone.tab Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/zone.tab Thu Nov 12 03:30:04 2015 (r290701) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/7/share/zoneinfo/zone1970.tab ============================================================================== --- stable/7/share/zoneinfo/zone1970.tab Thu Nov 12 03:29:36 2015 (r290700) +++ stable/7/share/zoneinfo/zone1970.tab Thu Nov 12 03:30:04 2015 (r290701) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-stable@freebsd.org Thu Nov 12 03:30:33 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30878A2D678; Thu, 12 Nov 2015 03:30:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E25C21022; Thu, 12 Nov 2015 03:30:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAC3UWDm057967; Thu, 12 Nov 2015 03:30:32 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC3UVG3057961; Thu, 12 Nov 2015 03:30:31 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201511120330.tAC3UVG3057961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Thu, 12 Nov 2015 03:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r290702 - stable/6/share/zoneinfo X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 03:30:33 -0000 Author: edwin Date: Thu Nov 12 03:30:31 2015 New Revision: 290702 URL: https://svnweb.freebsd.org/changeset/base/290702 Log: MFC of 290697,tzdata6: Update to tzdata2015g: Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25. Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time. Fiji's 2016 fall-back transition is scheduled for January 17, not 24. Fort Nelson, British Columbia will not fall back on 2015-11-01. It has effectively been on MST (-0700) since it advanced its clocks on 2015-03-08. New zone America/Fort_Nelson. Modified: stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/australasia stable/6/share/zoneinfo/europe stable/6/share/zoneinfo/northamerica stable/6/share/zoneinfo/zone.tab stable/6/share/zoneinfo/zone1970.tab Directory Properties: stable/6/share/zoneinfo/ (props changed) Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/asia Thu Nov 12 03:30:31 2015 (r290702) @@ -131,7 +131,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May # Azerbaijan # From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23): # According to the resolution of Cabinet of Ministers, 1997 -# Resolution available at: http://aif.az/docs/daylight_res.pdf +# From Paul Eggert (2015-09-17): It was Resolution No. 21 (1997-03-17). +# http://code.az/files/daylight_res.pdf # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 max - Mar lastSun 4:00 1:00 S Rule Azer 1997 max - Oct lastSun 5:00 0 - @@ -1717,11 +1718,12 @@ Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # the 8:30 time zone on August 15, one example: # http://www.bbc.com/news/world-asia-33815049 # -# From Paul Eggert (2015-08-07): -# No transition time is specified; assume 00:00. +# From Paul Eggert (2015-08-15): +# Bells rang out midnight (00:00) Friday as part of the celebrations. See: +# Talmadge E. North Korea celebrates new time zone, 'Pyongyang Time' +# http://news.yahoo.com/north-korea-celebrates-time-zone-pyongyang-time-164038128.html # There is no common English-language abbreviation for this time zone. -# Use %z rather than invent one. We can't assume %z works everywhere yet, -# so for now substitute its output manually. +# Use KST, as that's what we already use for 1954-1961 in ROK. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 @@ -1735,7 +1737,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 A 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 2015 Aug 15 + 9:00 - KST 2015 Aug 15 00:00 8:30 - KST ############################################################################### Modified: stable/6/share/zoneinfo/australasia ============================================================================== --- stable/6/share/zoneinfo/australasia Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/australasia Thu Nov 12 03:30:31 2015 (r290702) @@ -335,10 +335,17 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # DST will start Nov. 2 this year. # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-NOVEMBER-2ND.aspx -# From Paul Eggert (2014-10-20): +# From a government order dated 2015-08-26 and published as Legal Notice No. 77 +# in the Government of Fiji Gazette Supplement No. 24 (2015-08-28), +# via Ken Rylander (2015-09-02): +# the daylight saving period is 1 hour in advance of the standard time +# commencing at 2.00 am on Sunday 1st November, 2015 and ending at +# 3.00 am on Sunday 17th January, 2016. + +# From Paul Eggert (2015-09-01): # For now, guess DST from 02:00 the first Sunday in November to -# 03:00 the first Sunday on or after January 18. Although ad hoc, it -# matches this year's plan and seems more likely to match future +# 03:00 the third Sunday in January. Although ad hoc, it matches +# transitions since late 2014 and seems more likely to match future # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -351,7 +358,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S -Rule Fiji 2015 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2015 max - Jan Sun>=15 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time @@ -510,7 +517,10 @@ Zone Pacific/Niue -11:19:40 - LMT 1901 # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston 11:12 - NMT 1951 # Norfolk Mean Time - 11:30 - NFT # Norfolk Time + 11:30 - NFT 1974 Oct 27 02:00 # Norfolk T. + 11:30 1:00 NFST 1975 Mar 2 02:00 + 11:30 - NFT 2015 Oct 4 02:00 + 11:00 - NFT # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1550,6 +1560,20 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # started DST on June 3. Possibly DST was observed other years # in Midway, but we have no record of it. +# Norfolk + +# From Alexander Krivenyshev (2015-09-23): +# Norfolk Island will change ... from +1130 to +1100: +# https://www.comlaw.gov.au/Details/F2015L01483/Explanatory%20Statement/Text +# ... at 12.30 am (by legal time in New South Wales) on 4 October 2015. +# http://www.norfolkisland.gov.nf/nia/MediaRelease/Media%20Release%20Norfolk%20Island%20Standard%20Time%20Change.pdf + +# From Paul Eggert (2015-09-23): +# Transitions before 2015 are from timeanddate.com, which consulted +# the Norfolk Island Museum and the Australian Bureau of Meteorology's +# Norfolk Island station, and found no record of Norfolk observing DST +# other than in 1974/5. See: +# http://www.timeanddate.com/time/australia/norfolk-island.html # Pitcairn Modified: stable/6/share/zoneinfo/europe ============================================================================== --- stable/6/share/zoneinfo/europe Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/europe Thu Nov 12 03:30:31 2015 (r290702) @@ -3150,6 +3150,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # http://www.balkaneu.com/eventful-elections-turkey/ 2014-03-30. # I guess the best we can do is document the official time. +# From Fatih (2015-09-29): +# It's officially announced now by the Ministry of Energy. +# Turkey delays winter time to 8th of November 04:00 +# http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S Rule Turkey 1916 only - Oct 1 0:00 0 - @@ -3219,6 +3224,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 - EET 2011 Mar 28 1:00u 2:00 EU EE%sT 2014 Mar 30 1:00u 2:00 - EET 2014 Mar 31 1:00u + 2:00 EU EE%sT 2015 Oct 25 1:00u + 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Modified: stable/6/share/zoneinfo/northamerica ============================================================================== --- stable/6/share/zoneinfo/northamerica Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/northamerica Thu Nov 12 03:30:31 2015 (r290702) @@ -1826,6 +1826,22 @@ Zone America/Edmonton -7:33:52 - LMT 190 # The transition dates (and times) are guesses. +# From Matt Johnson (2015-09-21): +# Fort Nelson, BC, Canada will cancel DST this year. So while previously they +# were aligned with America/Vancouver, they're now aligned with +# America/Dawson_Creek. +# http://www.northernrockies.ca/EN/meta/news/archives/2015/northern-rockies-time-change.html +# +# From Tim Parenti (2015-09-23): +# This requires a new zone for the Northern Rockies Regional Municipality, +# America/Fort_Nelson. The resolution of 2014-12-08 was reached following a +# 2014-11-15 poll with nearly 75% support. Effectively, the municipality has +# been on MST (-0700) like Dawson Creek since it advanced its clocks on +# 2015-03-08. +# +# From Paul Eggert (2015-09-23): +# Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Vanc 1918 only - Apr 14 2:00 1:00 D Rule Vanc 1918 only - Oct 27 2:00 0 S @@ -1844,6 +1860,12 @@ Zone America/Dawson_Creek -8:00:56 - LMT -8:00 Canada P%sT 1947 -8:00 Vanc P%sT 1972 Aug 30 2:00 -7:00 - MST +Zone America/Fort_Nelson -8:10:47 - LMT 1884 + -8:00 Vanc P%sT 1946 + -8:00 - PST 1947 + -8:00 Vanc P%sT 1987 + -8:00 Canada P%sT 2015 Mar 8 2:00 + -7:00 - MST Zone America/Creston -7:46:04 - LMT 1884 -7:00 - MST 1916 Oct 1 -8:00 - PST 1918 Jun 2 Modified: stable/6/share/zoneinfo/zone.tab ============================================================================== --- stable/6/share/zoneinfo/zone.tab Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/zone.tab Thu Nov 12 03:30:31 2015 (r290702) @@ -129,6 +129,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon Modified: stable/6/share/zoneinfo/zone1970.tab ============================================================================== --- stable/6/share/zoneinfo/zone1970.tab Thu Nov 12 03:30:04 2015 (r290701) +++ stable/6/share/zoneinfo/zone1970.tab Thu Nov 12 03:30:31 2015 (r290702) @@ -127,6 +127,7 @@ CA +6227-11421 America/Yellowknife Mount CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia +CA +5848-12242 America/Fort_Nelson Mountain Standard Time - Fort Nelson, British Columbia CA +4916-12307 America/Vancouver Pacific Time - west British Columbia CA +6043-13503 America/Whitehorse Pacific Time - south Yukon CA +6404-13925 America/Dawson Pacific Time - north Yukon From owner-svn-src-stable@freebsd.org Thu Nov 12 08:47:12 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55263A2C680; Thu, 12 Nov 2015 08:47:12 +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 1E57713DD; Thu, 12 Nov 2015 08:47:12 +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 tAC8lBcR049830; Thu, 12 Nov 2015 08:47:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAC8lBZw049829; Thu, 12 Nov 2015 08:47:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511120847.tAC8lBZw049829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 Nov 2015 08:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290705 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 08:47:12 -0000 Author: hselasky Date: Thu Nov 12 08:47:10 2015 New Revision: 290705 URL: https://svnweb.freebsd.org/changeset/base/290705 Log: MFC r290140: 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 Modified: stable/10/sys/kern/kern_physio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_physio.c ============================================================================== --- stable/10/sys/kern/kern_physio.c Thu Nov 12 05:53:32 2015 (r290704) +++ stable/10/sys/kern/kern_physio.c Thu Nov 12 08:47:10 2015 (r290705) @@ -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-stable@freebsd.org Thu Nov 12 10:16:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8347CA2D1FF; Thu, 12 Nov 2015 10:16:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2CE1AF7; Thu, 12 Nov 2015 10:16:36 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACAGZsn075944; Thu, 12 Nov 2015 10:16:35 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACAGZ3k075943; Thu, 12 Nov 2015 10:16:35 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511121016.tACAGZ3k075943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 12 Nov 2015 10:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290712 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:16:36 -0000 Author: smh Date: Thu Nov 12 10:16:35 2015 New Revision: 290712 URL: https://svnweb.freebsd.org/changeset/base/290712 Log: MFC r290399: Allow zfs_recover to be changed at runtime Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:12:20 2015 (r290711) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:16:35 2015 (r290712) @@ -259,7 +259,7 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, boolean_t zfs_recover = B_FALSE; SYSCTL_DECL(_vfs_zfs); TUNABLE_INT("vfs.zfs.recover", &zfs_recover); -SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, +SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RWTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); /* From owner-svn-src-stable@freebsd.org Thu Nov 12 10:20:38 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55454A2D30F; Thu, 12 Nov 2015 10:20:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD5C1D57; Thu, 12 Nov 2015 10:20:38 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACAKbxw076150; Thu, 12 Nov 2015 10:20:37 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACAKb8N076149; Thu, 12 Nov 2015 10:20:37 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511121020.tACAKb8N076149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 12 Nov 2015 10:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290713 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 10:20:38 -0000 Author: smh Date: Thu Nov 12 10:20:36 2015 New Revision: 290713 URL: https://svnweb.freebsd.org/changeset/base/290713 Log: MFC r290401 & r290466 Provide information about bad DVA Sponsored by: Multiplay Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:16:35 2015 (r290712) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Nov 12 10:20:36 2015 (r290713) @@ -1807,7 +1807,13 @@ dva_get_dsize_sync(spa_t *spa, const dva ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0); if (asize != 0 && spa->spa_deflate) { - vdev_t *vd = vdev_lookup_top(spa, DVA_GET_VDEV(dva)); + uint64_t vdev = DVA_GET_VDEV(dva); + vdev_t *vd = vdev_lookup_top(spa, vdev); + if (vd == NULL) { + panic( + "dva_get_dsize_sync(): bad DVA %llu:%llu", + (u_longlong_t)vdev, (u_longlong_t)asize); + } dsize = (asize >> SPA_MINBLOCKSHIFT) * vd->vdev_deflate_ratio; } From owner-svn-src-stable@freebsd.org Thu Nov 12 22:45:53 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C39A2E15D; Thu, 12 Nov 2015 22:45:53 +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 D3BA5180A; Thu, 12 Nov 2015 22:45:52 +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 tACMjp9e006161; Thu, 12 Nov 2015 22:45:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACMjpj8006159; Thu, 12 Nov 2015 22:45:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122245.tACMjpj8006159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 22:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290730 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:45:53 -0000 Author: jhb Date: Thu Nov 12 22:45:51 2015 New Revision: 290730 URL: https://svnweb.freebsd.org/changeset/base/290730 Log: MFC 285773,285775,285776: Various fixes for stack unwinding in DDB on x86. 285773: Remove some dead code from DDB's amd64 stack unwinder. The amd64 port copied some code from i386 to fetch function arguments and display them in backtraces. However, it was commented out and can't easily be implemented since the function arguments are passed in registers rather than on the stack in amd64. Remove it in preparation for some bug fixes in this area. 285775: Improve stack unwinding on i386 and amd64 after an IP fault. If we can't find a symbol corresponding to the faulting instruction, assume that the previously-executed function is a call and attempt to find the calling function using the return address on the stack. Otherwise we end up associating the last stack frame with the current call, which is incorrect and causes the unwinder to skip printing of the calling function, resulting in a confusing backtrace. 285776: Let the unwinder handle faults during function prologues or epilogues. The i386 and amd64 DDB stack unwinders contain code to detect and handle the case where the first frame is not completely set up or torn down. This code was accidentally unused however, since db_backtrace() was never called with a non-NULL trap frame. This change fixes that. Also remove get_rsp() from the amd64 code. It appears to have come from i386, which needs to take into account whether the exception triggered a CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64, SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for kernel-mode exceptions. As a result, we can also remove custom print functions for these registers. Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/i386/i386/db_trace.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/i386/i386/db_trace.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -61,8 +61,6 @@ static db_varfcn_t db_dr5; static db_varfcn_t db_dr6; static db_varfcn_t db_dr7; static db_varfcn_t db_frame; -static db_varfcn_t db_rsp; -static db_varfcn_t db_ss; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -76,12 +74,12 @@ struct db_variable db_regs[] = { { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", NULL, db_ss }, + { "ss", DB_OFFSET(tf_ss), db_frame }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, { "rbx", DB_OFFSET(tf_rbx), db_frame }, - { "rsp", NULL, db_rsp }, + { "rsp", DB_OFFSET(tf_rsp), db_frame }, { "rbp", DB_OFFSET(tf_rbp), db_frame }, { "rsi", DB_OFFSET(tf_rsi), db_frame }, { "rdi", DB_OFFSET(tf_rdi), db_frame }, @@ -130,13 +128,6 @@ DB_DRX_FUNC(dr5) DB_DRX_FUNC(dr6) DB_DRX_FUNC(dr7) -static __inline long -get_rsp(struct trapframe *tf) -{ - return ((ISPL(tf->tf_cs)) ? tf->tf_rsp : - (db_expr_t)tf + offsetof(struct trapframe, tf_rsp)); -} - static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,34 +144,6 @@ db_frame(struct db_variable *vp, db_expr return (1); } -static int -db_rsp(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = get_rsp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_rsp = *valuep; - return (1); -} - -static int -db_ss(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_ss = *valuep; - return (1); -} - #define NORMAL 0 #define TRAP 1 #define INTERRUPT 2 @@ -188,9 +151,7 @@ db_ss(struct db_variable *vp, db_expr_t #define TRAP_INTERRUPT 5 static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); -static int db_numargs(struct amd64_frame *); -static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t, - void *); +static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); static const char * watchtype_str(int type); @@ -198,62 +159,11 @@ int amd64_set_watch(int watchnum, unsig int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); -/* - * Figure out how many arguments were passed into the frame at "fp". - */ -static int -db_numargs(fp) - struct amd64_frame *fp; -{ -#if 1 - return (0); /* regparm, needs dwarf2 info */ -#else - long *argp; - int inst; - int args; - - argp = (long *)db_get_value((long)&fp->f_retaddr, 8, FALSE); - /* - * XXX etext is wrong for LKMs. We should attempt to interpret - * the instruction at the return address in all cases. This - * may require better fault handling. - */ - if (argp < (long *)btext || argp >= (long *)etext) { - args = 5; - } else { - inst = db_get_value((long)argp, 4, FALSE); - if ((inst & 0xff) == 0x59) /* popl %ecx */ - args = 1; - else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ - args = ((inst >> 16) & 0xff) / 4; - else - args = 5; - } - return (args); -#endif -} - static void -db_print_stack_entry(name, narg, argnp, argp, callpc, frame) - const char *name; - int narg; - char **argnp; - long *argp; - db_addr_t callpc; - void *frame; +db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s(", name); -#if 0 - while (narg) { - if (argnp) - db_printf("%s=", *argnp++); - db_printf("%lr", (long)db_get_value((long)argp, 8, FALSE)); - argp++; - if (--narg != 0) - db_printf(","); - } -#endif - db_printf(") at "); + + db_printf("%s() at ", name != NULL ? name : "??"); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -348,7 +258,7 @@ db_nextframe(struct amd64_frame **fp, db return; } - db_print_stack_entry(name, 0, 0, 0, rip, &(*fp)->f_frame); + db_print_stack_entry(name, rip, &(*fp)->f_frame); /* * Point to base of trapframe which is just above the @@ -357,7 +267,7 @@ db_nextframe(struct amd64_frame **fp, db tf = (struct trapframe *)((long)*fp + 16); if (INKERNEL((long) tf)) { - rsp = get_rsp(tf); + rsp = tf->tf_rsp; rip = tf->tf_rip; rbp = tf->tf_rbp; switch (frame_type) { @@ -384,17 +294,13 @@ db_nextframe(struct amd64_frame **fp, db } static int -db_backtrace(struct thread *td, struct trapframe *tf, - struct amd64_frame *frame, db_addr_t pc, int count) +db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, + db_addr_t pc, register_t sp, int count) { struct amd64_frame *actframe; -#define MAXNARG 16 - char *argnames[MAXNARG], **argnp = NULL; const char *name; - long *argp; db_expr_t offset; c_db_sym_t sym; - int narg; boolean_t first; if (count == -1) @@ -418,48 +324,51 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, pc, NULL); + pc = db_get_value(sp, 8, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { int instr; instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffffff) == 0xe5894855) { /* pushq %rbp; movq %rsp, %rbp */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if ((instr & 0xffffff) == 0xe58948) { /* movq %rsp, %rbp */ - actframe = (void *)get_rsp(tf); + actframe = (void *)tf->tf_rsp; if (tf->tf_rbp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0xc3) { /* ret */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } } else if (strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. */ - db_print_stack_entry(name, 0, 0, 0, pc, - actframe); + db_print_stack_entry(name, pc, actframe); break; } - first = FALSE; - } - - argp = &actframe->f_arg0; - narg = MAXNARG; - if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) { - argnp = argnames; - } else { - narg = db_numargs(frame); } - db_print_stack_entry(name, narg, argnp, argp, pc, actframe); + db_print_stack_entry(name, pc, actframe); if (actframe != frame) { /* `frame' belongs to caller. */ @@ -473,7 +382,7 @@ db_backtrace(struct thread *td, struct t if (INKERNEL((long)pc) && !INKERNEL((long)frame)) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); - db_print_stack_entry(name, 0, 0, 0, pc, frame); + db_print_stack_entry(name, pc, frame); break; } if (!INKERNEL((long) frame)) { @@ -495,17 +404,19 @@ db_trace_self(void) frame = (struct amd64_frame *)rbp; callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, - ctx->pcb_rip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct amd64_frame *)ctx->pcb_rbp, + ctx->pcb_rip, ctx->pcb_rsp, count)); } int Modified: stable/10/sys/i386/i386/db_trace.c ============================================================================== --- stable/10/sys/i386/i386/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/10/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -390,7 +390,7 @@ db_nextframe(struct i386_frame **fp, db_ static int db_backtrace(struct thread *td, struct trapframe *tf, struct i386_frame *frame, - db_addr_t pc, int count) + db_addr_t pc, register_t sp, int count) { struct i386_frame *actframe; #define MAXNARG 16 @@ -447,7 +447,21 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, 0, 0, 0, pc, + NULL); + pc = db_get_value(sp, 4, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ @@ -475,7 +489,6 @@ db_backtrace(struct thread *td, struct t actframe); break; } - first = FALSE; } argp = &actframe->f_arg0; @@ -522,17 +535,19 @@ db_trace_self(void) frame = (struct i386_frame *)ebp; callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, - ctx->pcb_eip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct i386_frame *)ctx->pcb_ebp, + ctx->pcb_eip, ctx->pcb_esp, count)); } int From owner-svn-src-stable@freebsd.org Thu Nov 12 22:45:53 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45314A2E162; Thu, 12 Nov 2015 22:45:53 +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 224D3180C; Thu, 12 Nov 2015 22:45:53 +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 tACMjqYi006168; Thu, 12 Nov 2015 22:45:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACMjqkV006166; Thu, 12 Nov 2015 22:45:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122245.tACMjqkV006166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 22:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290730 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 22:45:53 -0000 Author: jhb Date: Thu Nov 12 22:45:51 2015 New Revision: 290730 URL: https://svnweb.freebsd.org/changeset/base/290730 Log: MFC 285773,285775,285776: Various fixes for stack unwinding in DDB on x86. 285773: Remove some dead code from DDB's amd64 stack unwinder. The amd64 port copied some code from i386 to fetch function arguments and display them in backtraces. However, it was commented out and can't easily be implemented since the function arguments are passed in registers rather than on the stack in amd64. Remove it in preparation for some bug fixes in this area. 285775: Improve stack unwinding on i386 and amd64 after an IP fault. If we can't find a symbol corresponding to the faulting instruction, assume that the previously-executed function is a call and attempt to find the calling function using the return address on the stack. Otherwise we end up associating the last stack frame with the current call, which is incorrect and causes the unwinder to skip printing of the calling function, resulting in a confusing backtrace. 285776: Let the unwinder handle faults during function prologues or epilogues. The i386 and amd64 DDB stack unwinders contain code to detect and handle the case where the first frame is not completely set up or torn down. This code was accidentally unused however, since db_backtrace() was never called with a non-NULL trap frame. This change fixes that. Also remove get_rsp() from the amd64 code. It appears to have come from i386, which needs to take into account whether the exception triggered a CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64, SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for kernel-mode exceptions. As a result, we can also remove custom print functions for these registers. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/i386/i386/db_trace.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/i386/i386/db_trace.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -61,8 +61,6 @@ static db_varfcn_t db_dr5; static db_varfcn_t db_dr6; static db_varfcn_t db_dr7; static db_varfcn_t db_frame; -static db_varfcn_t db_rsp; -static db_varfcn_t db_ss; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -76,12 +74,12 @@ struct db_variable db_regs[] = { { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", NULL, db_ss }, + { "ss", DB_OFFSET(tf_ss), db_frame }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, { "rbx", DB_OFFSET(tf_rbx), db_frame }, - { "rsp", NULL, db_rsp }, + { "rsp", DB_OFFSET(tf_rsp), db_frame }, { "rbp", DB_OFFSET(tf_rbp), db_frame }, { "rsi", DB_OFFSET(tf_rsi), db_frame }, { "rdi", DB_OFFSET(tf_rdi), db_frame }, @@ -130,13 +128,6 @@ DB_DRX_FUNC(dr5) DB_DRX_FUNC(dr6) DB_DRX_FUNC(dr7) -static __inline long -get_rsp(struct trapframe *tf) -{ - return ((ISPL(tf->tf_cs)) ? tf->tf_rsp : - (db_expr_t)tf + offsetof(struct trapframe, tf_rsp)); -} - static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,34 +144,6 @@ db_frame(struct db_variable *vp, db_expr return (1); } -static int -db_rsp(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = get_rsp(kdb_frame); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_rsp = *valuep; - return (1); -} - -static int -db_ss(struct db_variable *vp, db_expr_t *valuep, int op) -{ - - if (kdb_frame == NULL) - return (0); - - if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) - kdb_frame->tf_ss = *valuep; - return (1); -} - #define NORMAL 0 #define TRAP 1 #define INTERRUPT 2 @@ -188,9 +151,7 @@ db_ss(struct db_variable *vp, db_expr_t #define TRAP_INTERRUPT 5 static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); -static int db_numargs(struct amd64_frame *); -static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t, - void *); +static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); static const char * watchtype_str(int type); @@ -198,62 +159,11 @@ int amd64_set_watch(int watchnum, unsig int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); -/* - * Figure out how many arguments were passed into the frame at "fp". - */ -static int -db_numargs(fp) - struct amd64_frame *fp; -{ -#if 1 - return (0); /* regparm, needs dwarf2 info */ -#else - long *argp; - int inst; - int args; - - argp = (long *)db_get_value((long)&fp->f_retaddr, 8, FALSE); - /* - * XXX etext is wrong for LKMs. We should attempt to interpret - * the instruction at the return address in all cases. This - * may require better fault handling. - */ - if (argp < (long *)btext || argp >= (long *)etext) { - args = 5; - } else { - inst = db_get_value((long)argp, 4, FALSE); - if ((inst & 0xff) == 0x59) /* popl %ecx */ - args = 1; - else if ((inst & 0xffff) == 0xc483) /* addl $Ibs, %esp */ - args = ((inst >> 16) & 0xff) / 4; - else - args = 5; - } - return (args); -#endif -} - static void -db_print_stack_entry(name, narg, argnp, argp, callpc, frame) - const char *name; - int narg; - char **argnp; - long *argp; - db_addr_t callpc; - void *frame; +db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { - db_printf("%s(", name); -#if 0 - while (narg) { - if (argnp) - db_printf("%s=", *argnp++); - db_printf("%lr", (long)db_get_value((long)argp, 8, FALSE)); - argp++; - if (--narg != 0) - db_printf(","); - } -#endif - db_printf(") at "); + + db_printf("%s() at ", name != NULL ? name : "??"); db_printsym(callpc, DB_STGY_PROC); if (frame != NULL) db_printf("/frame 0x%lx", (register_t)frame); @@ -348,7 +258,7 @@ db_nextframe(struct amd64_frame **fp, db return; } - db_print_stack_entry(name, 0, 0, 0, rip, &(*fp)->f_frame); + db_print_stack_entry(name, rip, &(*fp)->f_frame); /* * Point to base of trapframe which is just above the @@ -357,7 +267,7 @@ db_nextframe(struct amd64_frame **fp, db tf = (struct trapframe *)((long)*fp + 16); if (INKERNEL((long) tf)) { - rsp = get_rsp(tf); + rsp = tf->tf_rsp; rip = tf->tf_rip; rbp = tf->tf_rbp; switch (frame_type) { @@ -384,17 +294,13 @@ db_nextframe(struct amd64_frame **fp, db } static int -db_backtrace(struct thread *td, struct trapframe *tf, - struct amd64_frame *frame, db_addr_t pc, int count) +db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, + db_addr_t pc, register_t sp, int count) { struct amd64_frame *actframe; -#define MAXNARG 16 - char *argnames[MAXNARG], **argnp = NULL; const char *name; - long *argp; db_expr_t offset; c_db_sym_t sym; - int narg; boolean_t first; if (count == -1) @@ -418,48 +324,51 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, pc, NULL); + pc = db_get_value(sp, 8, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { int instr; instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffffff) == 0xe5894855) { /* pushq %rbp; movq %rsp, %rbp */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if ((instr & 0xffffff) == 0xe58948) { /* movq %rsp, %rbp */ - actframe = (void *)get_rsp(tf); + actframe = (void *)tf->tf_rsp; if (tf->tf_rbp == 0) { /* Fake frame better. */ frame = actframe; } } else if ((instr & 0xff) == 0xc3) { /* ret */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } else if (offset == 0) { /* Probably an assembler symbol. */ - actframe = (void *)(get_rsp(tf) - 8); + actframe = (void *)(tf->tf_rsp - 8); } } else if (strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. */ - db_print_stack_entry(name, 0, 0, 0, pc, - actframe); + db_print_stack_entry(name, pc, actframe); break; } - first = FALSE; - } - - argp = &actframe->f_arg0; - narg = MAXNARG; - if (sym != NULL && db_sym_numargs(sym, &narg, argnames)) { - argnp = argnames; - } else { - narg = db_numargs(frame); } - db_print_stack_entry(name, narg, argnp, argp, pc, actframe); + db_print_stack_entry(name, pc, actframe); if (actframe != frame) { /* `frame' belongs to caller. */ @@ -473,7 +382,7 @@ db_backtrace(struct thread *td, struct t if (INKERNEL((long)pc) && !INKERNEL((long)frame)) { sym = db_search_symbol(pc, DB_STGY_ANY, &offset); db_symbol_values(sym, &name, NULL); - db_print_stack_entry(name, 0, 0, 0, pc, frame); + db_print_stack_entry(name, pc, frame); break; } if (!INKERNEL((long) frame)) { @@ -495,17 +404,19 @@ db_trace_self(void) frame = (struct amd64_frame *)rbp; callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct amd64_frame *)ctx->pcb_rbp, - ctx->pcb_rip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct amd64_frame *)ctx->pcb_rbp, + ctx->pcb_rip, ctx->pcb_rsp, count)); } int Modified: stable/9/sys/i386/i386/db_trace.c ============================================================================== --- stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:24:39 2015 (r290729) +++ stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) @@ -390,7 +390,7 @@ db_nextframe(struct i386_frame **fp, db_ static int db_backtrace(struct thread *td, struct trapframe *tf, struct i386_frame *frame, - db_addr_t pc, int count) + db_addr_t pc, register_t sp, int count) { struct i386_frame *actframe; #define MAXNARG 16 @@ -447,7 +447,21 @@ db_backtrace(struct thread *td, struct t */ actframe = frame; if (first) { - if (tf != NULL) { + first = FALSE; + if (sym == C_DB_SYM_NULL && sp != 0) { + /* + * If a symbol couldn't be found, we've probably + * jumped to a bogus location, so try and use + * the return address to find our caller. + */ + db_print_stack_entry(name, 0, 0, 0, pc, + NULL); + pc = db_get_value(sp, 4, FALSE); + if (db_search_symbol(pc, DB_STGY_PROC, + &offset) == C_DB_SYM_NULL) + break; + continue; + } else if (tf != NULL) { instr = db_get_value(pc, 4, FALSE); if ((instr & 0xffffff) == 0x00e58955) { /* pushl %ebp; movl %esp, %ebp */ @@ -475,7 +489,6 @@ db_backtrace(struct thread *td, struct t actframe); break; } - first = FALSE; } argp = &actframe->f_arg0; @@ -522,17 +535,19 @@ db_trace_self(void) frame = (struct i386_frame *)ebp; callpc = (db_addr_t)db_get_value((int)&frame->f_retaddr, 4, FALSE); frame = frame->f_frame; - db_backtrace(curthread, NULL, frame, callpc, -1); + db_backtrace(curthread, NULL, frame, callpc, 0, -1); } int db_trace_thread(struct thread *thr, int count) { struct pcb *ctx; + struct trapframe *tf; ctx = kdb_thr_ctx(thr); - return (db_backtrace(thr, NULL, (struct i386_frame *)ctx->pcb_ebp, - ctx->pcb_eip, count)); + tf = thr == kdb_thread ? kdb_frame : NULL; + return (db_backtrace(thr, tf, (struct i386_frame *)ctx->pcb_ebp, + ctx->pcb_eip, ctx->pcb_esp, count)); } int From owner-svn-src-stable@freebsd.org Thu Nov 12 23:01:30 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 922D9A2E4F8; Thu, 12 Nov 2015 23:01:30 +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 7701410FC; Thu, 12 Nov 2015 23:01:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6F1471283; Thu, 12 Nov 2015 23:01:30 +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 23B7C14EF2; Thu, 12 Nov 2015 23:01:30 +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 QB1mbB88lhes; Thu, 12 Nov 2015 23:01:27 +0000 (UTC) Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 017C214EEA To: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201510261621.t9QGLuL2028872@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56451A45.40605@FreeBSD.org> Date: Thu, 12 Nov 2015 15:01:25 -0800 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: <201510261621.t9QGLuL2028872@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:01:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/26/2015 9:21 AM, Eric van Gyzen wrote: > Author: vangyzen > Date: Mon Oct 26 16:21:56 2015 > New Revision: 290014 > URL: https://svnweb.freebsd.org/changeset/base/290014 >=20 > Log: > Disable SSE in libthr Please also mention 'MFC rREV'. Thanks! --=20 Regards, Bryan Drewery --jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9 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 iQEcBAEBAgAGBQJWRRpFAAoJEDXXcbtuRpfPn6AIAJl7iSmKfDHJTvBIW+HhtmhM 0OXAt1ZALbu8Bv3z5zjEEIbW9EQPbEPFiuJZlFB2vbhHo6PWHAisC7/qrlwqt3As UE6JfgX+sO9QxJPGL94zHF7C0RkEw55zHWmc4ohqEJOkmXw24AsSjagxU1MZfMT0 SV052RptKfNw2sTlhEh0Lmw/LfjbcKamyYcxcAQZBRYwgHULNTnHdgHMkXd9Fh3D ZZEhtr5+LQF6gAP1S9DxHhG5Qh50u+zZPb9a1VEbTl2e0kPIn2L2vvKpJ2SsCnlu uSYso4kv0dXcTvoac3wzTgqBoGVRLZbtfBlr5qhGL/LPWsXqhIf/HmPSbK3uYSQ= =ug/I -----END PGP SIGNATURE----- --jC8t3i7Ad4TtnavJRLEqVcbTuVq63MFx9-- From owner-svn-src-stable@freebsd.org Thu Nov 12 23:49:50 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 331A8A2EB58; Thu, 12 Nov 2015 23:49:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E32180B; Thu, 12 Nov 2015 23:49:49 +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 tACNnmcJ024387; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACNnmBo024382; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122349.tACNnmBo024382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 23:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290731 - in stable: 10/sys/amd64/amd64 10/sys/ddb 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/ddb 9/sys/i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:49:50 -0000 Author: jhb Date: Thu Nov 12 23:49:47 2015 New Revision: 290731 URL: https://svnweb.freebsd.org/changeset/base/290731 Log: MFC 285783: Various changes to the registers displayed in DDB for x86. - Fix segment registers to only display the low 16 bits. - Remove unused handlers and entries for the debug registers. - Display xcr0 (if valid) in 'show sysregs'. - Add '0x' prefix to MSR values to match other values in 'show sysregs'. - MFamd64: Display various MSRs in 'show sysregs'. - Add a 'show dbregs' to display the value of debug registers. - Dynamically size the column width for register values to properly align columns on 64-bit platforms. - Display %gs for i386 in 'show registers'. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/machdep.c stable/9/sys/ddb/db_print.c stable/9/sys/i386/i386/db_trace.c stable/9/sys/i386/i386/machdep.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/amd64/amd64/machdep.c stable/10/sys/ddb/db_print.c stable/10/sys/i386/i386/db_trace.c stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/amd64/amd64/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -52,15 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -69,12 +62,12 @@ CTASSERT(sizeof(struct dbreg) == sizeof( */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, - { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", DB_OFFSET(tf_ss), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", DB_OFFSET(tf_gs), db_frame_seg }, + { "ss", DB_OFFSET(tf_ss), db_frame_seg }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, @@ -93,40 +86,24 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; +struct db_variable *db_eregs = db_regs + nitems(db_regs); -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: stable/9/sys/amd64/amd64/machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/amd64/amd64/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1215,11 +1215,26 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%016lx\n", rcr2()); db_printf("cr3\t0x%016lx\n", rcr3()); db_printf("cr4\t0x%016lx\n", rcr4()); - db_printf("EFER\t%016lx\n", rdmsr(MSR_EFER)); - db_printf("FEATURES_CTL\t%016lx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - db_printf("DEBUG_CTL\t%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); - db_printf("PAT\t%016lx\n", rdmsr(MSR_PAT)); - db_printf("GSBASE\t%016lx\n", rdmsr(MSR_GSBASE)); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016lx\n", rxcr(0)); + db_printf("EFER\t0x%016lx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t%016lx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + db_printf("DEBUG_CTL\t0x%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); + db_printf("PAT\t0x%016lx\n", rdmsr(MSR_PAT)); + db_printf("GSBASE\t0x%016lx\n", rdmsr(MSR_GSBASE)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%016lx\n", rdr0()); + db_printf("dr1\t0x%016lx\n", rdr1()); + db_printf("dr2\t0x%016lx\n", rdr2()); + db_printf("dr3\t0x%016lx\n", rdr3()); + db_printf("dr6\t0x%016lx\n", rdr6()); + db_printf("dr7\t0x%016lx\n", rdr7()); } #endif Modified: stable/9/sys/ddb/db_print.c ============================================================================== --- stable/9/sys/ddb/db_print.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/ddb/db_print.c Thu Nov 12 23:49:47 2015 (r290731) @@ -56,7 +56,8 @@ db_show_regs(db_expr_t _1, boolean_t _2, for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; - db_printf("%-12s%#10lr", regp->name, (unsigned long)value); + db_printf("%-12s%#*lr", regp->name, + (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value); db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); if (name != NULL && offset <= (unsigned long)db_maxoff && offset != value) { Modified: stable/9/sys/i386/i386/db_trace.c ============================================================================== --- stable/9/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/i386/i386/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -48,16 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_esp; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; +static db_varfcn_t db_gs; static db_varfcn_t db_ss; /* @@ -65,10 +59,11 @@ static db_varfcn_t db_ss; */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", NULL, db_gs }, { "ss", NULL, db_ss }, { "eax", DB_OFFSET(tf_eax), db_frame }, { "ecx", DB_OFFSET(tf_ecx), db_frame }, @@ -80,40 +75,8 @@ struct db_variable db_regs[] = { { "edi", DB_OFFSET(tf_edi), db_frame }, { "eip", DB_OFFSET(tf_eip), db_frame }, { "efl", DB_OFFSET(tf_eflags), db_frame }, -#define DB_N_SHOW_REGS 15 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; - -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +struct db_variable *db_eregs = db_regs + nitems(db_regs); static __inline int get_esp(struct trapframe *tf) @@ -139,6 +102,22 @@ db_frame(struct db_variable *vp, db_expr } static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} + +static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,6 +132,17 @@ db_esp(struct db_variable *vp, db_expr_t } static int +db_gs(struct db_variable *vp, db_expr_t *valuep, int op) +{ + + if (op == DB_VAR_GET) + *valuep = rgs(); + else + load_gs(*valuep); + return (1); +} + +static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/9/sys/i386/i386/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1962,6 +1962,29 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016llx\n", rxcr(0)); + if (amd_feature & (AMDID_NX | AMDID_LM)) + db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t0x%016llx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + if ((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); + if (cpu_feature & CPUID_PAT) + db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%08x\n", rdr0()); + db_printf("dr1\t0x%08x\n", rdr1()); + db_printf("dr2\t0x%08x\n", rdr2()); + db_printf("dr3\t0x%08x\n", rdr3()); + db_printf("dr6\t0x%08x\n", rdr6()); + db_printf("dr7\t0x%08x\n", rdr7()); } #endif From owner-svn-src-stable@freebsd.org Thu Nov 12 23:49:49 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D31EA2EB53; Thu, 12 Nov 2015 23:49: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 591C5180A; Thu, 12 Nov 2015 23:49:49 +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 tACNnmU9024377; Thu, 12 Nov 2015 23:49:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACNnl3u024372; Thu, 12 Nov 2015 23:49:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511122349.tACNnl3u024372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Nov 2015 23:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290731 - in stable: 10/sys/amd64/amd64 10/sys/ddb 10/sys/i386/i386 9/sys/amd64/amd64 9/sys/ddb 9/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 23:49:49 -0000 Author: jhb Date: Thu Nov 12 23:49:47 2015 New Revision: 290731 URL: https://svnweb.freebsd.org/changeset/base/290731 Log: MFC 285783: Various changes to the registers displayed in DDB for x86. - Fix segment registers to only display the low 16 bits. - Remove unused handlers and entries for the debug registers. - Display xcr0 (if valid) in 'show sysregs'. - Add '0x' prefix to MSR values to match other values in 'show sysregs'. - MFamd64: Display various MSRs in 'show sysregs'. - Add a 'show dbregs' to display the value of debug registers. - Dynamically size the column width for register values to properly align columns on 64-bit platforms. - Display %gs for i386 in 'show registers'. Modified: stable/10/sys/amd64/amd64/db_trace.c stable/10/sys/amd64/amd64/machdep.c stable/10/sys/ddb/db_print.c stable/10/sys/i386/i386/db_trace.c stable/10/sys/i386/i386/machdep.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/machdep.c stable/9/sys/ddb/db_print.c stable/9/sys/i386/i386/db_trace.c stable/9/sys/i386/i386/machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/amd64/amd64/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -52,15 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); @@ -69,12 +62,12 @@ CTASSERT(sizeof(struct dbreg) == sizeof( */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, - { "gs", DB_OFFSET(tf_gs), db_frame }, - { "ss", DB_OFFSET(tf_ss), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", DB_OFFSET(tf_gs), db_frame_seg }, + { "ss", DB_OFFSET(tf_ss), db_frame_seg }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, { "rdx", DB_OFFSET(tf_rdx), db_frame }, @@ -93,40 +86,24 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; +struct db_variable *db_eregs = db_regs + nitems(db_regs); -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} static int db_frame(struct db_variable *vp, db_expr_t *valuep, int op) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/amd64/amd64/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -1238,11 +1238,26 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%016lx\n", rcr2()); db_printf("cr3\t0x%016lx\n", rcr3()); db_printf("cr4\t0x%016lx\n", rcr4()); - db_printf("EFER\t%016lx\n", rdmsr(MSR_EFER)); - db_printf("FEATURES_CTL\t%016lx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - db_printf("DEBUG_CTL\t%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); - db_printf("PAT\t%016lx\n", rdmsr(MSR_PAT)); - db_printf("GSBASE\t%016lx\n", rdmsr(MSR_GSBASE)); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016lx\n", rxcr(0)); + db_printf("EFER\t0x%016lx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t%016lx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + db_printf("DEBUG_CTL\t0x%016lx\n", rdmsr(MSR_DEBUGCTLMSR)); + db_printf("PAT\t0x%016lx\n", rdmsr(MSR_PAT)); + db_printf("GSBASE\t0x%016lx\n", rdmsr(MSR_GSBASE)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%016lx\n", rdr0()); + db_printf("dr1\t0x%016lx\n", rdr1()); + db_printf("dr2\t0x%016lx\n", rdr2()); + db_printf("dr3\t0x%016lx\n", rdr3()); + db_printf("dr6\t0x%016lx\n", rdr6()); + db_printf("dr7\t0x%016lx\n", rdr7()); } #endif Modified: stable/10/sys/ddb/db_print.c ============================================================================== --- stable/10/sys/ddb/db_print.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/ddb/db_print.c Thu Nov 12 23:49:47 2015 (r290731) @@ -56,7 +56,8 @@ db_show_regs(db_expr_t _1, boolean_t _2, for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; - db_printf("%-12s%#10lr", regp->name, (unsigned long)value); + db_printf("%-12s%#*lr", regp->name, + (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value); db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset); if (name != NULL && offset <= (unsigned long)db_maxoff && offset != value) { Modified: stable/10/sys/i386/i386/db_trace.c ============================================================================== --- stable/10/sys/i386/i386/db_trace.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/i386/i386/db_trace.c Thu Nov 12 23:49:47 2015 (r290731) @@ -48,16 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include -static db_varfcn_t db_dr0; -static db_varfcn_t db_dr1; -static db_varfcn_t db_dr2; -static db_varfcn_t db_dr3; -static db_varfcn_t db_dr4; -static db_varfcn_t db_dr5; -static db_varfcn_t db_dr6; -static db_varfcn_t db_dr7; static db_varfcn_t db_esp; static db_varfcn_t db_frame; +static db_varfcn_t db_frame_seg; +static db_varfcn_t db_gs; static db_varfcn_t db_ss; /* @@ -65,10 +59,11 @@ static db_varfcn_t db_ss; */ #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "cs", DB_OFFSET(tf_cs), db_frame }, - { "ds", DB_OFFSET(tf_ds), db_frame }, - { "es", DB_OFFSET(tf_es), db_frame }, - { "fs", DB_OFFSET(tf_fs), db_frame }, + { "cs", DB_OFFSET(tf_cs), db_frame_seg }, + { "ds", DB_OFFSET(tf_ds), db_frame_seg }, + { "es", DB_OFFSET(tf_es), db_frame_seg }, + { "fs", DB_OFFSET(tf_fs), db_frame_seg }, + { "gs", NULL, db_gs }, { "ss", NULL, db_ss }, { "eax", DB_OFFSET(tf_eax), db_frame }, { "ecx", DB_OFFSET(tf_ecx), db_frame }, @@ -80,40 +75,8 @@ struct db_variable db_regs[] = { { "edi", DB_OFFSET(tf_edi), db_frame }, { "eip", DB_OFFSET(tf_eip), db_frame }, { "efl", DB_OFFSET(tf_eflags), db_frame }, -#define DB_N_SHOW_REGS 15 /* Don't show registers after here. */ - { "dr0", NULL, db_dr0 }, - { "dr1", NULL, db_dr1 }, - { "dr2", NULL, db_dr2 }, - { "dr3", NULL, db_dr3 }, - { "dr4", NULL, db_dr4 }, - { "dr5", NULL, db_dr5 }, - { "dr6", NULL, db_dr6 }, - { "dr7", NULL, db_dr7 }, }; -struct db_variable *db_eregs = db_regs + DB_N_SHOW_REGS; - -#define DB_DRX_FUNC(reg) \ -static int \ -db_ ## reg (vp, valuep, op) \ - struct db_variable *vp; \ - db_expr_t * valuep; \ - int op; \ -{ \ - if (op == DB_VAR_GET) \ - *valuep = r ## reg (); \ - else \ - load_ ## reg (*valuep); \ - return (1); \ -} - -DB_DRX_FUNC(dr0) -DB_DRX_FUNC(dr1) -DB_DRX_FUNC(dr2) -DB_DRX_FUNC(dr3) -DB_DRX_FUNC(dr4) -DB_DRX_FUNC(dr5) -DB_DRX_FUNC(dr6) -DB_DRX_FUNC(dr7) +struct db_variable *db_eregs = db_regs + nitems(db_regs); static __inline int get_esp(struct trapframe *tf) @@ -139,6 +102,22 @@ db_frame(struct db_variable *vp, db_expr } static int +db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) +{ + uint16_t *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); +} + +static int db_esp(struct db_variable *vp, db_expr_t *valuep, int op) { @@ -153,6 +132,17 @@ db_esp(struct db_variable *vp, db_expr_t } static int +db_gs(struct db_variable *vp, db_expr_t *valuep, int op) +{ + + if (op == DB_VAR_GET) + *valuep = rgs(); + else + load_gs(*valuep); + return (1); +} + +static int db_ss(struct db_variable *vp, db_expr_t *valuep, int op) { Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Thu Nov 12 22:45:51 2015 (r290730) +++ stable/10/sys/i386/i386/machdep.c Thu Nov 12 23:49:47 2015 (r290731) @@ -2043,6 +2043,29 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); + if (rcr4() & CR4_XSAVE) + db_printf("xcr0\t0x%016llx\n", rxcr(0)); + if (amd_feature & (AMDID_NX | AMDID_LM)) + db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); + if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) + db_printf("FEATURES_CTL\t0x%016llx\n", + rdmsr(MSR_IA32_FEATURE_CONTROL)); + if ((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); + if (cpu_feature & CPUID_PAT) + db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); +} + +DB_SHOW_COMMAND(dbregs, db_show_dbregs) +{ + + db_printf("dr0\t0x%08x\n", rdr0()); + db_printf("dr1\t0x%08x\n", rdr1()); + db_printf("dr2\t0x%08x\n", rdr2()); + db_printf("dr3\t0x%08x\n", rdr3()); + db_printf("dr6\t0x%08x\n", rdr6()); + db_printf("dr7\t0x%08x\n", rdr7()); } #endif From owner-svn-src-stable@freebsd.org Fri Nov 13 00:47:46 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C35DA2C5EF; Fri, 13 Nov 2015 00:47:46 +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 0D6D118A7; Fri, 13 Nov 2015 00:47:45 +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 tAD0lj11050558; Fri, 13 Nov 2015 00:47:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0ljtZ050556; Fri, 13 Nov 2015 00:47:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130047.tAD0ljtZ050556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290733 - in stable/9/sys/i386: i386 include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:47:46 -0000 Author: jhb Date: Fri Nov 13 00:47:44 2015 New Revision: 290733 URL: https://svnweb.freebsd.org/changeset/base/290733 Log: Fix i386 build. stable/9 does not have XSAVE support. Pointy hat to: jhb Modified: stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/specialreg.h Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:34:57 2015 (r290732) +++ stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) @@ -1962,8 +1962,6 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs db_printf("cr2\t0x%08x\n", rcr2()); db_printf("cr3\t0x%08x\n", rcr3()); db_printf("cr4\t0x%08x\n", rcr4()); - if (rcr4() & CR4_XSAVE) - db_printf("xcr0\t0x%016llx\n", rxcr(0)); if (amd_feature & (AMDID_NX | AMDID_LM)) db_printf("EFER\t0x%016llx\n", rdmsr(MSR_EFER)); if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) Modified: stable/9/sys/i386/include/specialreg.h ============================================================================== --- stable/9/sys/i386/include/specialreg.h Fri Nov 13 00:34:57 2015 (r290732) +++ stable/9/sys/i386/include/specialreg.h Fri Nov 13 00:47:44 2015 (r290733) @@ -281,6 +281,7 @@ #define MSR_APICBASE 0x01b #define MSR_EBL_CR_POWERON 0x02a #define MSR_TEST_CTL 0x033 +#define MSR_IA32_FEATURE_CONTROL 0x03a #define MSR_BIOS_UPDT_TRIG 0x079 #define MSR_BBL_CR_D0 0x088 #define MSR_BBL_CR_D1 0x089 From owner-svn-src-stable@freebsd.org Fri Nov 13 00:50:37 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 205D8A2C6EF; Fri, 13 Nov 2015 00:50:37 +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 E50961BFF; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0oZNw053105; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0oZj4053101; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130050.tAD0oZj4053101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290734 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 10/sys/i386/include 9/sys/amd64/amd64 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:50:37 -0000 Author: jhb Date: Fri Nov 13 00:50:34 2015 New Revision: 290734 URL: https://svnweb.freebsd.org/changeset/base/290734 Log: MFC 284325: Report the values of x86 segment registers to remote debuggers. While here, also report %eflags from the i386 trapframe. Modified: stable/9/sys/amd64/amd64/gdb_machdep.c stable/9/sys/i386/i386/gdb_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/gdb_machdep.h Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/gdb_machdep.c stable/10/sys/i386/i386/gdb_machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/include/gdb_machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/amd64/amd64/gdb_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); @@ -76,6 +78,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 14: return (&kdb_thrctx->pcb_r14); case 15: return (&kdb_thrctx->pcb_r15); case 16: return (&kdb_thrctx->pcb_rip); + case 18: return (&_kcodesel); + case 19: return (&_kdatasel); } return (NULL); } Modified: stable/9/sys/i386/i386/gdb_machdep.c ============================================================================== --- stable/9/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -45,14 +45,22 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); + static uint32_t _kprivsel = GSEL(GPRIV_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == curthread) { + if (kdb_thread == curthread) { switch (regnum) { case 0: return (&kdb_frame->tf_eax); case 1: return (&kdb_frame->tf_ecx); case 2: return (&kdb_frame->tf_edx); + case 9: return (&kdb_frame->tf_eflags); + case 10: return (&kdb_frame->tf_cs); + case 12: return (&kdb_frame->tf_ds); + case 13: return (&kdb_frame->tf_es); + case 14: return (&kdb_frame->tf_fs); } } switch (regnum) { @@ -62,6 +70,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 6: return (&kdb_thrctx->pcb_esi); case 7: return (&kdb_thrctx->pcb_edi); case 8: return (&kdb_thrctx->pcb_eip); + case 10: return (&_kcodesel); + case 11: return (&_kdatasel); + case 12: return (&_kdatasel); + case 13: return (&_kdatasel); + case 14: return (&_kprivsel); + case 15: return (&kdb_thrctx->pcb_gs); } return (NULL); } Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/i386/machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -3172,6 +3172,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_ebx = tf->tf_ebx; pcb->pcb_eip = tf->tf_eip; pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8; + pcb->pcb_gs = rgs(); } int Modified: stable/9/sys/i386/include/gdb_machdep.h ============================================================================== --- stable/9/sys/i386/include/gdb_machdep.h Fri Nov 13 00:47:44 2015 (r290733) +++ stable/9/sys/i386/include/gdb_machdep.h Fri Nov 13 00:50:34 2015 (r290734) @@ -30,7 +30,7 @@ #define _MACHINE_GDB_MACHDEP_H_ #define GDB_BUFSZ 400 -#define GDB_NREGS 14 +#define GDB_NREGS 16 #define GDB_REG_PC 8 static __inline size_t From owner-svn-src-stable@freebsd.org Fri Nov 13 00:50:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749F4A2C6EB; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0F71BFD; Fri, 13 Nov 2015 00:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD0oZgn053091; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD0oZuX053082; Fri, 13 Nov 2015 00:50:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511130050.tAD0oZuX053082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 00:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290734 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 10/sys/i386/include 9/sys/amd64/amd64 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 00:50:36 -0000 Author: jhb Date: Fri Nov 13 00:50:34 2015 New Revision: 290734 URL: https://svnweb.freebsd.org/changeset/base/290734 Log: MFC 284325: Report the values of x86 segment registers to remote debuggers. While here, also report %eflags from the i386 trapframe. Modified: stable/10/sys/amd64/amd64/gdb_machdep.c stable/10/sys/i386/i386/gdb_machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/include/gdb_machdep.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/gdb_machdep.c stable/9/sys/i386/i386/gdb_machdep.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/include/gdb_machdep.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/gdb_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/amd64/amd64/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); @@ -76,6 +78,8 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 14: return (&kdb_thrctx->pcb_r14); case 15: return (&kdb_thrctx->pcb_r15); case 16: return (&kdb_thrctx->pcb_rip); + case 18: return (&_kcodesel); + case 19: return (&_kdatasel); } return (NULL); } Modified: stable/10/sys/i386/i386/gdb_machdep.c ============================================================================== --- stable/10/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/i386/i386/gdb_machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -45,14 +45,22 @@ __FBSDID("$FreeBSD$"); void * gdb_cpu_getreg(int regnum, size_t *regsz) { + static uint32_t _kcodesel = GSEL(GCODE_SEL, SEL_KPL); + static uint32_t _kdatasel = GSEL(GDATA_SEL, SEL_KPL); + static uint32_t _kprivsel = GSEL(GPRIV_SEL, SEL_KPL); *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == curthread) { + if (kdb_thread == curthread) { switch (regnum) { case 0: return (&kdb_frame->tf_eax); case 1: return (&kdb_frame->tf_ecx); case 2: return (&kdb_frame->tf_edx); + case 9: return (&kdb_frame->tf_eflags); + case 10: return (&kdb_frame->tf_cs); + case 12: return (&kdb_frame->tf_ds); + case 13: return (&kdb_frame->tf_es); + case 14: return (&kdb_frame->tf_fs); } } switch (regnum) { @@ -62,6 +70,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz case 6: return (&kdb_thrctx->pcb_esi); case 7: return (&kdb_thrctx->pcb_edi); case 8: return (&kdb_thrctx->pcb_eip); + case 10: return (&_kcodesel); + case 11: return (&_kdatasel); + case 12: return (&_kdatasel); + case 13: return (&_kdatasel); + case 14: return (&_kprivsel); + case 15: return (&kdb_thrctx->pcb_gs); } return (NULL); } Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/i386/i386/machdep.c Fri Nov 13 00:50:34 2015 (r290734) @@ -3616,6 +3616,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_ebx = tf->tf_ebx; pcb->pcb_eip = tf->tf_eip; pcb->pcb_esp = (ISPL(tf->tf_cs)) ? tf->tf_esp : (int)(tf + 1) - 8; + pcb->pcb_gs = rgs(); } int Modified: stable/10/sys/i386/include/gdb_machdep.h ============================================================================== --- stable/10/sys/i386/include/gdb_machdep.h Fri Nov 13 00:47:44 2015 (r290733) +++ stable/10/sys/i386/include/gdb_machdep.h Fri Nov 13 00:50:34 2015 (r290734) @@ -30,7 +30,7 @@ #define _MACHINE_GDB_MACHDEP_H_ #define GDB_BUFSZ 400 -#define GDB_NREGS 14 +#define GDB_NREGS 16 #define GDB_REG_PC 8 static __inline size_t From owner-svn-src-stable@freebsd.org Fri Nov 13 01:01:17 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8022FA2C902; Fri, 13 Nov 2015 01:01:17 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7BA1165; Fri, 13 Nov 2015 01:01:17 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD11GQ2057796; Fri, 13 Nov 2015 01:01:16 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD11Gr1057794; Fri, 13 Nov 2015 01:01:16 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511130101.tAD11Gr1057794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 13 Nov 2015 01:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290735 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:01:17 -0000 Author: smh Date: Fri Nov 13 01:01:16 2015 New Revision: 290735 URL: https://svnweb.freebsd.org/changeset/base/290735 Log: MFC r290440: Correct posix_openpt reference in pty(3) Sponsored by: Multiplay Modified: stable/10/lib/libutil/pty.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/pty.3 ============================================================================== --- stable/10/lib/libutil/pty.3 Fri Nov 13 00:50:34 2015 (r290734) +++ stable/10/lib/libutil/pty.3 Fri Nov 13 01:01:16 2015 (r290735) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd December 29, 1996 +.Dd November 11, 2015 .Dt PTY 3 .Os .Sh NAME @@ -120,7 +120,7 @@ function may fail and set the global var .Dv errno for any of the errors specified for the .Xr grantpt 3 , -.Xr posix_openpt 3 , +.Xr posix_openpt 2 , .Xr ptsname 3 , and .Xr unlockpt 3 From owner-svn-src-stable@freebsd.org Fri Nov 13 01:04:01 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67311A2CADE; Fri, 13 Nov 2015 01:04:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE6215CE; Fri, 13 Nov 2015 01:04:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD140qS058995; Fri, 13 Nov 2015 01:04:00 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD140e7058989; Fri, 13 Nov 2015 01:04:00 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201511130104.tAD140e7058989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 13 Nov 2015 01:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290736 - in stable/10: sbin/ifconfig share/man/man4 sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:04:01 -0000 Author: smh Date: Fri Nov 13 01:03:59 2015 New Revision: 290736 URL: https://svnweb.freebsd.org/changeset/base/290736 Log: MFC r290450: Add sysctl to control LACP strict compliance default Sponsored by: Multiplay Modified: stable/10/sbin/ifconfig/ifconfig.8 stable/10/share/man/man4/lagg.4 stable/10/sys/net/ieee8023ad_lacp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.8 Fri Nov 13 01:01:16 2015 (r290735) +++ stable/10/sbin/ifconfig/ifconfig.8 Fri Nov 13 01:03:59 2015 (r290736) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 12, 2015 +.Dd November 6, 2015 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2449,6 +2449,21 @@ which are shifted by the number of this Enable lacp fast-timeout on the interface. .It Cm -lacp_fast_timeout Disable lacp fast-timeout on the interface. +.It Cm lacp_strict +Enable lacp strict compliance on the interface. +The default value can be set via the +.Va net.link.lagg.lacp.default_strict_mode +.Xr sysctl 8 +variable. +.Li 0 +means +.Dq disabled +and +.Li 1 +means +.Dq enabled . +.It Cm -lacp_strict +Disable lacp strict compliance on the interface. .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: stable/10/share/man/man4/lagg.4 ============================================================================== --- stable/10/share/man/man4/lagg.4 Fri Nov 13 01:01:16 2015 (r290735) +++ stable/10/share/man/man4/lagg.4 Fri Nov 13 01:03:59 2015 (r290736) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2014 +.Dd November 6, 2015 .Dt LAGG 4 .Os .Sh NAME @@ -156,6 +156,7 @@ Gigabit Ethernet interfaces: .Bd -literal -offset indent # ifconfig bge0 up # ifconfig bge1 up +# ifconfig lagg0 create # ifconfig lagg0 laggproto lacp laggport bge0 laggport bge1 \e 192.168.1.1 netmask 255.255.255.0 .Ed @@ -168,6 +169,7 @@ device will be used: # ifconfig em0 up # ifconfig ath0 ether 00:11:22:33:44:55 # ifconfig create wlan0 wlandev ath0 ssid my_net up +# ifconfig lagg0 create # ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e 192.168.1.1 netmask 255.255.255.0 .Ed Modified: stable/10/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.c Fri Nov 13 01:01:16 2015 (r290735) +++ stable/10/sys/net/ieee8023ad_lacp.c Fri Nov 13 01:03:59 2015 (r290736) @@ -193,6 +193,11 @@ SYSCTL_NODE(_net_link_lagg, OID_AUTO, la SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)"); +static VNET_DEFINE(int, lacp_default_strict_mode) = 1; +SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, default_strict_mode, CTLFLAG_RWTUN, + &VNET_NAME(lacp_default_strict_mode), 0, + "LACP strict protocol compliance default"); + #define LACP_DPRINTF(a) if (V_lacp_debug & 0x01) { lacp_dprintf a ; } #define LACP_TRACE(a) if (V_lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); } #define LACP_TPRINTF(a) if (V_lacp_debug & 0x04) { lacp_dprintf a ; } @@ -765,7 +770,7 @@ lacp_attach(struct lagg_softc *sc) lsc->lsc_hashkey = arc4random(); lsc->lsc_active_aggregator = NULL; - lsc->lsc_strict_mode = 1; + lsc->lsc_strict_mode = VNET(lacp_default_strict_mode); LACP_LOCK_INIT(lsc); TAILQ_INIT(&lsc->lsc_aggregators); LIST_INIT(&lsc->lsc_ports); @@ -1703,7 +1708,7 @@ lacp_sm_rx_record_default(struct lacp_po if (lp->lp_lsc->lsc_strict_mode) lp->lp_partner = lacp_partner_admin_strict; else - lp->lp_partner = lacp_partner_admin_optimistic;; + lp->lp_partner = lacp_partner_admin_optimistic; lp->lp_state |= LACP_STATE_DEFAULTED; lacp_sm_ptx_update_timeout(lp, oldpstate); } From owner-svn-src-stable@freebsd.org Fri Nov 13 01:25:03 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C80DAA2D1CA; Fri, 13 Nov 2015 01:25:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9522B12A2; Fri, 13 Nov 2015 01:25:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1P2Zh068036; Fri, 13 Nov 2015 01:25:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1P2kH068035; Fri, 13 Nov 2015 01:25:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130125.tAD1P2kH068035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290737 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:25:03 -0000 Author: markj Date: Fri Nov 13 01:25:02 2015 New Revision: 290737 URL: https://svnweb.freebsd.org/changeset/base/290737 Log: MFC r290320: Have elf_lookup() return an error if the specified non-weak symbol could not be found. Otherwise, relocations against such symbols will be silently ignored instead of causing an error to be raised. Modified: stable/10/sys/kern/link_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/link_elf.c ============================================================================== --- stable/10/sys/kern/link_elf.c Fri Nov 13 01:03:59 2015 (r290736) +++ stable/10/sys/kern/link_elf.c Fri Nov 13 01:25:02 2015 (r290737) @@ -1544,6 +1544,10 @@ elf_lookup(linker_file_t lf, Elf_Size sy } addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + if (addr == 0 && ELF_ST_BIND(sym->st_info) != STB_WEAK) { + *res = 0; + return (EINVAL); + } if (elf_set_find(&set_pcpu_list, addr, &start, &base)) addr = addr - start + base; From owner-svn-src-stable@freebsd.org Fri Nov 13 01:27:21 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 865EBA2D248; Fri, 13 Nov 2015 01:27:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B69F14B2; Fri, 13 Nov 2015 01:27:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1RKRD068527; Fri, 13 Nov 2015 01:27:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1RKrd068526; Fri, 13 Nov 2015 01:27:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130127.tAD1RKrd068526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290738 - stable/10/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:27:21 -0000 Author: markj Date: Fri Nov 13 01:27:20 2015 New Revision: 290738 URL: https://svnweb.freebsd.org/changeset/base/290738 Log: MFC r289866: DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that array type sizes are encoded correctly. PR: 203772 Modified: stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Fri Nov 13 01:25:02 2015 (r290737) +++ stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Fri Nov 13 01:27:20 2015 (r290738) @@ -675,6 +675,10 @@ tdesc_array_create(dwarf_t *dw, Dwarf_Di ar->ad_nelems = uval + 1; else if (die_signed(dw, dim, DW_AT_upper_bound, &sval, 0)) ar->ad_nelems = sval + 1; + else if (die_unsigned(dw, dim, DW_AT_count, &uval, 0)) + ar->ad_nelems = uval; + else if (die_signed(dw, dim, DW_AT_count, &sval, 0)) + ar->ad_nelems = sval; else ar->ad_nelems = 0; From owner-svn-src-stable@freebsd.org Fri Nov 13 01:37:09 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90DA0A2D467; Fri, 13 Nov 2015 01:37:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5091AED; Fri, 13 Nov 2015 01:37:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD1b8ZP073025; Fri, 13 Nov 2015 01:37:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD1b8DW073024; Fri, 13 Nov 2015 01:37:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130137.tAD1b8DW073024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 01:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290739 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 01:37:09 -0000 Author: markj Date: Fri Nov 13 01:37:08 2015 New Revision: 290739 URL: https://svnweb.freebsd.org/changeset/base/290739 Log: MFC r289867: Remove an erroneous semicolon. Modified: stable/10/sys/sys/_bitset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/_bitset.h ============================================================================== --- stable/10/sys/sys/_bitset.h Fri Nov 13 01:27:20 2015 (r290738) +++ stable/10/sys/sys/_bitset.h Fri Nov 13 01:37:08 2015 (r290739) @@ -50,7 +50,7 @@ #define BITSET_DEFINE(t, _s) \ struct t { \ long __bits[__bitset_words((_s))]; \ -}; +} #define BITSET_T_INITIALIZER(x) \ { .__bits = { x } } From owner-svn-src-stable@freebsd.org Fri Nov 13 02:05:56 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36DA0A2D9B6; Fri, 13 Nov 2015 02:05:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDC71775; Fri, 13 Nov 2015 02:05:55 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from coconut.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 07D695648F; Thu, 12 Nov 2015 20:05:53 -0600 (CST) Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201510261621.t9QGLuL2028872@repo.freebsd.org> <56451A45.40605@FreeBSD.org> From: Eric van Gyzen Message-ID: <5645457E.9070303@FreeBSD.org> Date: Thu, 12 Nov 2015 20:05:50 -0600 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: <56451A45.40605@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 02:05:56 -0000 On 11/12/15 5:01 PM, Bryan Drewery wrote: > On 10/26/2015 9:21 AM, Eric van Gyzen wrote: >> Author: vangyzen >> Date: Mon Oct 26 16:21:56 2015 >> New Revision: 290014 >> URL: https://svnweb.freebsd.org/changeset/base/290014 >> >> Log: >> Disable SSE in libthr > > Please also mention 'MFC rREV'. Thanks! Will do. On this commit, I remembered it about 17 ms after I typed :x. :-/ Eric From owner-svn-src-stable@freebsd.org Fri Nov 13 02:16:10 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1BFA2DB90; Fri, 13 Nov 2015 02:16:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 317BD1B9A; Fri, 13 Nov 2015 02:16:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD2G9n3084471; Fri, 13 Nov 2015 02:16:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD2G9BI084469; Fri, 13 Nov 2015 02:16:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201511130216.tAD2G9BI084469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2015 02:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290741 - in stable/10/sys: sys vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 02:16:10 -0000 Author: markj Date: Fri Nov 13 02:16:08 2015 New Revision: 290741 URL: https://svnweb.freebsd.org/changeset/base/290741 Log: MFC r287235: Remove weighted page handling from vm_page_advise(). Modified: stable/10/sys/sys/pcpu.h stable/10/sys/vm/vm_page.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/pcpu.h ============================================================================== --- stable/10/sys/sys/pcpu.h Fri Nov 13 01:47:56 2015 (r290740) +++ stable/10/sys/sys/pcpu.h Fri Nov 13 02:16:08 2015 (r290741) @@ -162,7 +162,7 @@ struct pcpu { long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; void *pc_netisr; /* netisr SWI cookie */ - int pc_dnweight; /* vm_page_dontneed() */ + int pc_unused1; /* unused field */ int pc_domain; /* Memory domain. */ struct rm_queue pc_rm_queue; /* rmlock list of trackers */ uintptr_t pc_dynamic; /* Dynamic per-cpu data area */ Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Fri Nov 13 01:47:56 2015 (r290740) +++ stable/10/sys/vm/vm_page.c Fri Nov 13 02:16:08 2015 (r290741) @@ -2430,19 +2430,26 @@ _vm_page_deactivate(vm_page_t m, int ath struct vm_pagequeue *pq; int queue; - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); /* - * Ignore if already inactive. + * Ignore if the page is already inactive, unless it is unlikely to be + * reactivated. */ - if ((queue = m->queue) == PQ_INACTIVE) + if ((queue = m->queue) == PQ_INACTIVE && !athead) return; if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { - if (queue != PQ_NONE) - vm_page_dequeue(m); - m->flags &= ~PG_WINATCFLS; pq = &vm_phys_domain(m)->vmd_pagequeues[PQ_INACTIVE]; - vm_pagequeue_lock(pq); + /* Avoid multiple acquisitions of the inactive queue lock. */ + if (queue == PQ_INACTIVE) { + vm_pagequeue_lock(pq); + vm_page_dequeue_locked(m); + } else { + if (queue != PQ_NONE) + vm_page_dequeue(m); + m->flags &= ~PG_WINATCFLS; + vm_pagequeue_lock(pq); + } m->queue = PQ_INACTIVE; if (athead) TAILQ_INSERT_HEAD(&pq->pq_pl, m, plinks.q); @@ -2618,34 +2625,18 @@ vm_page_cache(vm_page_t m) /* * vm_page_advise * - * Cache, deactivate, or do nothing as appropriate. This routine - * is used by madvise(). - * - * Generally speaking we want to move the page into the cache so - * it gets reused quickly. However, this can result in a silly syndrome - * due to the page recycling too quickly. Small objects will not be - * fully cached. On the other hand, if we move the page to the inactive - * queue we wind up with a problem whereby very large objects - * unnecessarily blow away our inactive and cache queues. - * - * The solution is to move the pages based on a fixed weighting. We - * either leave them alone, deactivate them, or move them to the cache, - * where moving them to the cache has the highest weighting. - * By forcing some pages into other queues we eventually force the - * system to balance the queues, potentially recovering other unrelated - * space from active. The idea is to not force this to happen too - * often. + * Deactivate or do nothing, as appropriate. This routine is used + * by madvise() and vop_stdadvise(). * * The object and page must be locked. */ void vm_page_advise(vm_page_t m, int advice) { - int dnw, head; vm_page_assert_locked(m); VM_OBJECT_ASSERT_WLOCKED(m->object); - if (advice == MADV_FREE) { + if (advice == MADV_FREE) /* * Mark the page clean. This will allow the page to be freed * up by the system. However, such pages are often reused @@ -2656,24 +2647,12 @@ vm_page_advise(vm_page_t m, int advice) * nor do we try to put it in the cache (which would cause a * page fault on reuse). * - * But we do make the page is freeable as we can without + * But we do make the page as freeable as we can without * actually taking the step of unmapping it. */ m->dirty = 0; - m->act_count = 0; - } else if (advice != MADV_DONTNEED) + else if (advice != MADV_DONTNEED) return; - dnw = PCPU_GET(dnweight); - PCPU_INC(dnweight); - - /* - * Occasionally leave the page alone. - */ - if ((dnw & 0x01F0) == 0 || m->queue == PQ_INACTIVE) { - if (m->act_count >= ACT_INIT) - --m->act_count; - return; - } /* * Clear any references to the page. Otherwise, the page daemon will @@ -2684,20 +2663,12 @@ vm_page_advise(vm_page_t m, int advice) if (advice != MADV_FREE && m->dirty == 0 && pmap_is_modified(m)) vm_page_dirty(m); - if (m->dirty || (dnw & 0x0070) == 0) { - /* - * Deactivate the page 3 times out of 32. - */ - head = 0; - } else { - /* - * Cache the page 28 times out of every 32. Note that - * the page is deactivated instead of cached, but placed - * at the head of the queue instead of the tail. - */ - head = 1; - } - _vm_page_deactivate(m, head); + /* + * Place clean pages at the head of the inactive queue rather than the + * tail, thus defeating the queue's LRU operation and ensuring that the + * page will be reused quickly. + */ + _vm_page_deactivate(m, m->dirty == 0); } /* From owner-svn-src-stable@freebsd.org Fri Nov 13 09:09:01 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B418A2C0D8; Fri, 13 Nov 2015 09:09: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 5EFEB120D; Fri, 13 Nov 2015 09:09:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD990Oh003919; Fri, 13 Nov 2015 09:09:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD990FD003916; Fri, 13 Nov 2015 09:09:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130909.tAD990FD003916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290745 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: fs/zfs sys/sysevent X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:09:01 -0000 Author: mav Date: Fri Nov 13 09:08:59 2015 New Revision: 290745 URL: https://svnweb.freebsd.org/changeset/base/290745 Log: MFC r287745: 5997 FRU field not set during pool creation and never updated ZFS already supports storing the vdev FRU in a vdev property. There is code in libzfs to work with this property, and there is code in the zfs-retire FMA module that looks for that information. But there is no code actually setting or updating the FRU. To address this, ZFS is changed to send a handful of new events whenever a vdev is added, attached, cleared, or onlined, as well as when a pool is created or imported. Note that syseventd is not currently available on FreeBSD and thus some work is needed to actually support the new ZFS events (e.g. in zfsd) to actually use this capability, this changeset is mostly a diff reduction from upstream. illumos/illumos-gate@1437283407f89cab03860accf49408f94559bc34 Illumos issues: 5997 FRU field not set during pool creation and never updated https://www.illumos.org/issues/5997 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:00:39 2015 (r290744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:08:59 2015 (r290745) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2013, 2014, Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2015, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -3771,6 +3771,7 @@ spa_create(const char *pool, nvlist_t *n txg_wait_synced(spa->spa_dsl_pool, txg); spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_CREATE); spa_history_log_version(spa, "create"); @@ -4234,6 +4235,7 @@ spa_import(const char *pool, nvlist_t *c spa_configfile_set(spa, props, B_FALSE); spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_IMPORT); mutex_exit(&spa_namespace_lock); return (0); @@ -4364,9 +4366,12 @@ spa_import(const char *pool, nvlist_t *c */ spa_async_request(spa, SPA_ASYNC_AUTOEXPAND); - mutex_exit(&spa_namespace_lock); spa_history_log_version(spa, "import"); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_IMPORT); + + mutex_exit(&spa_namespace_lock); + #ifdef __FreeBSD__ #ifdef _KERNEL zvol_create_minors(pool); @@ -4712,6 +4717,7 @@ spa_vdev_add(spa_t *spa, nvlist_t *nvroo mutex_enter(&spa_namespace_lock); spa_config_update(spa, SPA_CONFIG_UPDATE_POOL); + spa_event_notify(spa, NULL, ESC_ZFS_VDEV_ADD); mutex_exit(&spa_namespace_lock); return (0); @@ -4906,6 +4912,11 @@ spa_vdev_attach(spa_t *spa, uint64_t gui */ dsl_resilver_restart(spa->spa_dsl_pool, dtl_max_txg); + if (spa->spa_bootfs) + spa_event_notify(spa, newvd, ESC_ZFS_BOOTFS_VDEV_ATTACH); + + spa_event_notify(spa, newvd, ESC_ZFS_VDEV_ATTACH); + /* * Commit the config */ @@ -4920,9 +4931,6 @@ spa_vdev_attach(spa_t *spa, uint64_t gui spa_strfree(oldvdpath); spa_strfree(newvdpath); - if (spa->spa_bootfs) - spa_event_notify(spa, newvd, ESC_ZFS_BOOTFS_VDEV_ATTACH); - return (0); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:00:39 2015 (r290744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:08:59 2015 (r290745) @@ -2503,6 +2503,7 @@ int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) { vdev_t *vd, *tvd, *pvd, *rvd = spa->spa_root_vdev; + boolean_t postevent = B_FALSE; spa_vdev_state_enter(spa, SCL_NONE); @@ -2512,6 +2513,10 @@ vdev_online(spa_t *spa, uint64_t guid, u if (!vd->vdev_ops->vdev_op_leaf) return (spa_vdev_state_exit(spa, NULL, ENOTSUP)); + postevent = + (vd->vdev_offline == B_TRUE || vd->vdev_tmpoffline == B_TRUE) ? + B_TRUE : B_FALSE; + tvd = vd->vdev_top; vd->vdev_offline = B_FALSE; vd->vdev_tmpoffline = B_FALSE; @@ -2547,6 +2552,10 @@ vdev_online(spa_t *spa, uint64_t guid, u return (spa_vdev_state_exit(spa, vd, ENOTSUP)); spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); } + + if (postevent) + spa_event_notify(spa, vd, ESC_ZFS_VDEV_ONLINE); + return (spa_vdev_state_exit(spa, vd, 0)); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Fri Nov 13 09:00:39 2015 (r290744) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h Fri Nov 13 09:08:59 2015 (r290745) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_SYSEVENT_EVENTDEFS_H @@ -249,9 +249,14 @@ extern "C" { #define ESC_ZFS_RESILVER_START "ESC_ZFS_resilver_start" #define ESC_ZFS_RESILVER_FINISH "ESC_ZFS_resilver_finish" #define ESC_ZFS_VDEV_REMOVE "ESC_ZFS_vdev_remove" +#define ESC_ZFS_POOL_CREATE "ESC_ZFS_pool_create" #define ESC_ZFS_POOL_DESTROY "ESC_ZFS_pool_destroy" +#define ESC_ZFS_POOL_IMPORT "ESC_ZFS_pool_import" +#define ESC_ZFS_VDEV_ADD "ESC_ZFS_vdev_add" +#define ESC_ZFS_VDEV_ATTACH "ESC_ZFS_vdev_attach" #define ESC_ZFS_VDEV_CLEAR "ESC_ZFS_vdev_clear" #define ESC_ZFS_VDEV_CHECK "ESC_ZFS_vdev_check" +#define ESC_ZFS_VDEV_ONLINE "ESC_ZFS_vdev_online" #define ESC_ZFS_CONFIG_SYNC "ESC_ZFS_config_sync" #define ESC_ZFS_SCRUB_START "ESC_ZFS_scrub_start" #define ESC_ZFS_SCRUB_FINISH "ESC_ZFS_scrub_finish" From owner-svn-src-stable@freebsd.org Fri Nov 13 09:14:31 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AE4FA2C319; Fri, 13 Nov 2015 09:14:31 +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 5F87C18C9; Fri, 13 Nov 2015 09:14:31 +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 tAD9EU19006960; Fri, 13 Nov 2015 09:14:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9EUu4006959; Fri, 13 Nov 2015 09:14:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130914.tAD9EUu4006959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290746 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:14:31 -0000 Author: mav Date: Fri Nov 13 09:14:30 2015 New Revision: 290746 URL: https://svnweb.freebsd.org/changeset/base/290746 Log: MFC r289190: 6250 zvol_dump_init() can hold txg open Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Albert Lee Reviewed by: Xin Li Approved by: Garrett D'Amore Author: George Wilson illumos/illumos-gate@b10bba72460aeaa53119c76ff5e647fd5585bece Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Nov 13 09:08:59 2015 (r290745) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Nov 13 09:14:30 2015 (r290746) @@ -2336,13 +2336,15 @@ zvol_dump_init(zvol_state_t *zv, boolean vdev_t *vd = spa->spa_root_vdev; nvlist_t *nv = NULL; uint64_t version = spa_version(spa); - enum zio_checksum checksum; + uint64_t checksum, compress, refresrv, vbs, dedup; ASSERT(MUTEX_HELD(&zfsdev_state_lock)); ASSERT(vd->vdev_ops == &vdev_root_ops); error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, 0, DMU_OBJECT_END); + if (error != 0) + return (error); /* wait for dmu_free_long_range to actually free the blocks */ txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); @@ -2366,24 +2368,42 @@ zvol_dump_init(zvol_state_t *zv, boolean 2, ZFS_SPACE_CHECK_RESERVED); } + if (!resize) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_COMPRESSION), &compress, NULL); + if (error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_CHECKSUM), &checksum, + NULL); + } + if (error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_REFRESERVATION), + &refresrv, NULL); + } + if (error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &vbs, + NULL); + } + if (version >= SPA_VERSION_DEDUP && error == 0) { + error = dsl_prop_get_integer(zv->zv_name, + zfs_prop_to_name(ZFS_PROP_DEDUP), &dedup, NULL); + } + } + if (error != 0) + return (error); + tx = dmu_tx_create(os); dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL); dmu_tx_hold_bonus(tx, ZVOL_OBJ); error = dmu_tx_assign(tx, TXG_WAIT); - if (error) { + if (error != 0) { dmu_tx_abort(tx); return (error); } /* - * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum - * function. Otherwise, use the old default -- OFF. - */ - checksum = spa_feature_is_active(spa, - SPA_FEATURE_MULTI_VDEV_CRASH_DUMP) ? ZIO_CHECKSUM_NOPARITY : - ZIO_CHECKSUM_OFF; - - /* * If we are resizing the dump device then we only need to * update the refreservation to match the newly updated * zvolsize. Otherwise, we save off the original state of the @@ -2394,37 +2414,30 @@ zvol_dump_init(zvol_state_t *zv, boolean zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1, &zv->zv_volsize, tx); } else { - uint64_t checksum, compress, refresrv, vbs, dedup; - - error = dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_COMPRESSION), &compress, NULL); - error = error ? error : dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_CHECKSUM), &checksum, NULL); - error = error ? error : dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_REFRESERVATION), &refresrv, NULL); - error = error ? error : dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &vbs, NULL); - if (version >= SPA_VERSION_DEDUP) { - error = error ? error : - dsl_prop_get_integer(zv->zv_name, - zfs_prop_to_name(ZFS_PROP_DEDUP), &dedup, NULL); - } - - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, + error = zap_update(os, ZVOL_ZAP_OBJ, zfs_prop_to_name(ZFS_PROP_COMPRESSION), 8, 1, &compress, tx); - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, - zfs_prop_to_name(ZFS_PROP_CHECKSUM), 8, 1, &checksum, tx); - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, - zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1, - &refresrv, tx); - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, - zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), 8, 1, - &vbs, tx); - error = error ? error : dmu_object_set_blocksize( - os, ZVOL_OBJ, SPA_OLD_MAXBLOCKSIZE, 0, tx); - if (version >= SPA_VERSION_DEDUP) { - error = error ? error : zap_update(os, ZVOL_ZAP_OBJ, + if (error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, + zfs_prop_to_name(ZFS_PROP_CHECKSUM), 8, 1, + &checksum, tx); + } + if (error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, + zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 8, 1, + &refresrv, tx); + } + if (error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, + zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), 8, 1, + &vbs, tx); + } + if (error == 0) { + error = dmu_object_set_blocksize( + os, ZVOL_OBJ, SPA_OLD_MAXBLOCKSIZE, 0, tx); + } + if (version >= SPA_VERSION_DEDUP && error == 0) { + error = zap_update(os, ZVOL_ZAP_OBJ, zfs_prop_to_name(ZFS_PROP_DEDUP), 8, 1, &dedup, tx); } @@ -2437,7 +2450,15 @@ zvol_dump_init(zvol_state_t *zv, boolean * We only need update the zvol's property if we are initializing * the dump area for the first time. */ - if (!resize) { + if (error == 0 && !resize) { + /* + * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum + * function. Otherwise, use the old default -- OFF. + */ + checksum = spa_feature_is_active(spa, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP) ? ZIO_CHECKSUM_NOPARITY : + ZIO_CHECKSUM_OFF; + VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_REFRESERVATION), 0) == 0); @@ -2456,13 +2477,11 @@ zvol_dump_init(zvol_state_t *zv, boolean error = zfs_set_prop_nvlist(zv->zv_name, ZPROP_SRC_LOCAL, nv, NULL); nvlist_free(nv); - - if (error) - return (error); } /* Allocate the space for the dump */ - error = zvol_prealloc(zv); + if (error == 0) + error = zvol_prealloc(zv); return (error); } From owner-svn-src-stable@freebsd.org Fri Nov 13 09:16:08 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B84A2C3BD; Fri, 13 Nov 2015 09:16:08 +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 341FA1A37; Fri, 13 Nov 2015 09:16:08 +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 tAD9G7rB007069; Fri, 13 Nov 2015 09:16:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9G7TU007068; Fri, 13 Nov 2015 09:16:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130916.tAD9G7TU007068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290747 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:16:08 -0000 Author: mav Date: Fri Nov 13 09:16:07 2015 New Revision: 290747 URL: https://svnweb.freebsd.org/changeset/base/290747 Log: MFC r289191, r289194: 6251 add tunable to disable free_bpobj processing Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Simon Klinkert Reviewed by: Richard Elling Reviewed by: Albert Lee Reviewed by: Xin Li Approved by: Garrett D'Amore Author: George Wilson illumos/illumos-gate@139510fb6efa97dbe5f5479594b308d940cab8d1 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Nov 13 09:14:30 2015 (r290746) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Nov 13 09:16:07 2015 (r290747) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #include @@ -111,6 +111,14 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, free_ma extern int zfs_txg_timeout; +/* + * Enable/disable the processing of the free_bpobj object. + */ +boolean_t zfs_free_bpobj_enabled = B_TRUE; + +SYSCTL_INT(_vfs_zfs, OID_AUTO, free_bpobj_enabled, CTLFLAG_RWTUN, + &zfs_free_bpobj_enabled, 0, "Enable free_bpobj processing"); + /* the order has to match pool_scan_type */ static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = { NULL, @@ -1460,7 +1468,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * * have to worry about traversing it. It is also faster to free the * blocks than to scrub them. */ - if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { + if (zfs_free_bpobj_enabled && + spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { scn->scn_is_bptree = B_FALSE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); From owner-svn-src-stable@freebsd.org Fri Nov 13 09:16:58 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D0BA2C454; Fri, 13 Nov 2015 09:16:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2070E1BB8; Fri, 13 Nov 2015 09:16:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9GvhC007143; Fri, 13 Nov 2015 09:16:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9GvdF007142; Fri, 13 Nov 2015 09:16:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130916.tAD9GvdF007142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290748 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:16:58 -0000 Author: mav Date: Fri Nov 13 09:16:56 2015 New Revision: 290748 URL: https://svnweb.freebsd.org/changeset/base/290748 Log: MFC r289192: 6281 prefetching should apply to 1MB reads Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Alexander Motin Reviewed by: Dan McDonald Reviewed by: Justin Gibbs Reviewed by: Xin Li Approved by: Gordon Ross Author: George Wilson illumos/illumos-gate@632802744ef6d17e06d6980a95f631615c3b060f Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Nov 13 09:16:07 2015 (r290747) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Nov 13 09:16:56 2015 (r290748) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -49,7 +49,7 @@ uint32_t zfetch_max_streams = 8; uint32_t zfetch_min_sec_reap = 2; /* max bytes to prefetch per stream (default 8MB) */ uint32_t zfetch_max_distance = 8 * 1024 * 1024; -/* number of bytes in a array_read at which we stop prefetching (1MB) */ +/* max number of bytes in an array_read in which we allow prefetching (1MB) */ uint64_t zfetch_array_rd_sz = 1024 * 1024; SYSCTL_DECL(_vfs_zfs); From owner-svn-src-stable@freebsd.org Fri Nov 13 09:17:49 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E2A3A2C4E4; Fri, 13 Nov 2015 09:17: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 679871D04; Fri, 13 Nov 2015 09:17: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 tAD9HmQ4007226; Fri, 13 Nov 2015 09:17:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9HmW9007225; Fri, 13 Nov 2015 09:17:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130917.tAD9HmW9007225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290749 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:17:49 -0000 Author: mav Date: Fri Nov 13 09:17:48 2015 New Revision: 290749 URL: https://svnweb.freebsd.org/changeset/base/290749 Log: MFC r289295: 5219 l2arc_write_buffers() may write beyond target_sz Reviewed by: Matthew Ahrens Reviewed by: Saso Kiselkov Reviewed by: George Wilson Reviewed by: Steven Hartland Reviewed by: Justin Gibbs Approved by: Matthew Ahrens Author: Andriy Gapon illumos/illumos-gate@d7d9a6d919f92d74ea0510a53f8441396048e800 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:16:56 2015 (r290748) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:17:48 2015 (r290749) @@ -6246,7 +6246,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_de boolean_t *headroom_boost) { arc_buf_hdr_t *hdr, *hdr_prev, *head; - uint64_t write_asize, write_sz, headroom, buf_compress_minsz; + uint64_t write_asize, write_sz, headroom, + buf_compress_minsz; void *buf_data; boolean_t full; l2arc_write_callback_t *cb; @@ -6408,6 +6409,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de * using it to denote the header's state change. */ hdr->b_l2hdr.b_daddr = L2ARC_ADDR_UNSET; + hdr->b_flags |= ARC_FLAG_HAS_L2HDR; mutex_enter(&dev->l2ad_mtx); From owner-svn-src-stable@freebsd.org Fri Nov 13 09:18:34 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEA5A2C53C; Fri, 13 Nov 2015 09:18:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82B681E57; Fri, 13 Nov 2015 09:18:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9IXIU007305; Fri, 13 Nov 2015 09:18:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9IXXl007304; Fri, 13 Nov 2015 09:18:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130918.tAD9IXXl007304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290750 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:18:34 -0000 Author: mav Date: Fri Nov 13 09:18:33 2015 New Revision: 290750 URL: https://svnweb.freebsd.org/changeset/base/290750 Log: MFC r289297: 6288 dmu_buf_will_dirty could be faster Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Justin Gibbs Reviewed by: Richard Elling Approved by: Robert Mustacchi Author: Matthew Ahrens illumos/illumos-gate@0f2e7d03b8f588387cb8dd8dd500cbe5ff4484e0 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:17:48 2015 (r290749) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:18:33 2015 (r290750) @@ -1110,6 +1110,32 @@ dbuf_release_bp(dmu_buf_impl_t *db) (void) arc_release(db->db_buf, db); } +/* + * We already have a dirty record for this TXG, and we are being + * dirtied again. + */ +static void +dbuf_redirty(dbuf_dirty_record_t *dr) +{ + dmu_buf_impl_t *db = dr->dr_dbuf; + + ASSERT(MUTEX_HELD(&db->db_mtx)); + + if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID) { + /* + * If this buffer has already been written out, + * we now need to reset its state. + */ + dbuf_unoverride(dr); + if (db->db.db_object != DMU_META_DNODE_OBJECT && + db->db_state != DB_NOFILL) { + /* Already released on initial dirty, so just thaw. */ + ASSERT(arc_released(db->db_buf)); + arc_buf_thaw(db->db_buf); + } + } +} + dbuf_dirty_record_t * dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) { @@ -1182,16 +1208,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t if (dr && dr->dr_txg == tx->tx_txg) { DB_DNODE_EXIT(db); - if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID) { - /* - * If this buffer has already been written out, - * we now need to reset its state. - */ - dbuf_unoverride(dr); - if (db->db.db_object != DMU_META_DNODE_OBJECT && - db->db_state != DB_NOFILL) - arc_buf_thaw(db->db_buf); - } + dbuf_redirty(dr); mutex_exit(&db->db_mtx); return (dr); } @@ -1495,6 +1512,30 @@ dmu_buf_will_dirty(dmu_buf_t *db_fake, d ASSERT(tx->tx_txg != 0); ASSERT(!refcount_is_zero(&db->db_holds)); + /* + * Quick check for dirtyness. For already dirty blocks, this + * reduces runtime of this function by >90%, and overall performance + * by 50% for some workloads (e.g. file deletion with indirect blocks + * cached). + */ + mutex_enter(&db->db_mtx); + dbuf_dirty_record_t *dr; + for (dr = db->db_last_dirty; + dr != NULL && dr->dr_txg >= tx->tx_txg; dr = dr->dr_next) { + /* + * It's possible that it is already dirty but not cached, + * because there are some calls to dbuf_dirty() that don't + * go through dmu_buf_will_dirty(). + */ + if (dr->dr_txg == tx->tx_txg && db->db_state == DB_CACHED) { + /* This dbuf is already dirty and cached. */ + dbuf_redirty(dr); + mutex_exit(&db->db_mtx); + return; + } + } + mutex_exit(&db->db_mtx); + DB_DNODE_ENTER(db); if (RW_WRITE_HELD(&DB_DNODE(db)->dn_struct_rwlock)) rf |= DB_RF_HAVESTRUCT; From owner-svn-src-stable@freebsd.org Fri Nov 13 09:20:48 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DACFA2C7E2; Fri, 13 Nov 2015 09:20:48 +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 1CAB42000; Fri, 13 Nov 2015 09:20: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 tAD9Kl1j007437; Fri, 13 Nov 2015 09:20:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9Kl3W007436; Fri, 13 Nov 2015 09:20:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130920.tAD9Kl3W007436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290751 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:20:48 -0000 Author: mav Date: Fri Nov 13 09:20:46 2015 New Revision: 290751 URL: https://svnweb.freebsd.org/changeset/base/290751 Log: MFC r289299: 6286 ZFS internal error when set large block on bootfs Reviewed by: Paul Dagnelie Reviewed by: George Wilson Reviewed by: Andriy Gapon Approved by: Robert Mustacchi Author: Matthew Ahrens illumos/illumos-gate@6de9bb5603e65b16816b7ab29e39bac820e2da2b Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:18:33 2015 (r290750) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:20:46 2015 (r290751) @@ -27,7 +27,7 @@ * Copyright 2014 Xin Li . All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -3920,7 +3920,7 @@ zfs_check_settable(const char *dsname, n */ if (zfs_is_bootfs(dsname) && intval > SPA_OLD_MAXBLOCKSIZE) { - return (SET_ERROR(EDOM)); + return (SET_ERROR(ERANGE)); } /* @@ -3929,7 +3929,7 @@ zfs_check_settable(const char *dsname, n */ if (intval > zfs_max_recordsize || intval > SPA_MAXBLOCKSIZE) - return (SET_ERROR(EDOM)); + return (SET_ERROR(ERANGE)); if ((err = spa_open(dsname, &spa, FTAG)) != 0) return (err); From owner-svn-src-stable@freebsd.org Fri Nov 13 09:21:33 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08381A2C850; Fri, 13 Nov 2015 09:21:33 +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 C4A0D12C7; Fri, 13 Nov 2015 09:21: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 tAD9LVFb009955; Fri, 13 Nov 2015 09:21:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9LVEn009954; Fri, 13 Nov 2015 09:21:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130921.tAD9LVEn009954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290752 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:21:33 -0000 Author: mav Date: Fri Nov 13 09:21:31 2015 New Revision: 290752 URL: https://svnweb.freebsd.org/changeset/base/290752 Log: MFC r289305: 6293 ztest failure: error == 28 (0xc == 0x1c) in ztest_tx_assign() Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Richard Elling Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@8fe00bfb8790ad51653f67b01d5ac14256cbb404 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:20:46 2015 (r290751) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:21:31 2015 (r290752) @@ -5298,6 +5298,16 @@ arc_init(void) arc_c_max = arc_c_min; arc_c_max = MAX(arc_c * 5, arc_c_max); + /* + * In userland, there's only the memory pressure that we artificially + * create (see arc_available_memory()). Don't let arc_c get too + * small, because it can cause transactions to be larger than + * arc_c, causing arc_tempreserve_space() to fail. + */ +#ifndef _KERNEL + arc_c_min = arc_c_max / 2; +#endif + #ifdef _KERNEL /* * Allow the tunables to override our calculations if they are From owner-svn-src-stable@freebsd.org Fri Nov 13 09:22:55 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E3AA2C8FD; Fri, 13 Nov 2015 09:22:55 +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 12C1E15EE; Fri, 13 Nov 2015 09:22:55 +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 tAD9MsYV010177; Fri, 13 Nov 2015 09:22:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9MsXq010176; Fri, 13 Nov 2015 09:22:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130922.tAD9MsXq010176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290753 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:22:55 -0000 Author: mav Date: Fri Nov 13 09:22:53 2015 New Revision: 290753 URL: https://svnweb.freebsd.org/changeset/base/290753 Log: MFC r289307: 6295 metaslab_condense's dbgmsg should include vdev id Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Xin Li Reviewed by: Justin Gibbs Approved by: Richard Lowe Author: Joe Stein illumos/illumos-gate@daec38ecb4fb5e73e4ca9e99be84f6b8c50c02fa Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Nov 13 09:21:31 2015 (r290752) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Nov 13 09:22:53 2015 (r290753) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -1815,10 +1815,11 @@ metaslab_condense(metaslab_t *msp, uint6 ASSERT(msp->ms_loaded); - spa_dbgmsg(spa, "condensing: txg %llu, msp[%llu] %p, " - "smp size %llu, segments %lu, forcing condense=%s", txg, - msp->ms_id, msp, space_map_length(msp->ms_sm), - avl_numnodes(&msp->ms_tree->rt_root), + spa_dbgmsg(spa, "condensing: txg %llu, msp[%llu] %p, vdev id %llu, " + "spa %s, smp size %llu, segments %lu, forcing condense=%s", txg, + msp->ms_id, msp, msp->ms_group->mg_vd->vdev_id, + msp->ms_group->mg_vd->vdev_spa->spa_name, + space_map_length(msp->ms_sm), avl_numnodes(&msp->ms_tree->rt_root), msp->ms_condense_wanted ? "TRUE" : "FALSE"); msp->ms_condense_wanted = B_FALSE; From owner-svn-src-stable@freebsd.org Fri Nov 13 09:23:50 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57FC2A2C9D8; Fri, 13 Nov 2015 09:23:50 +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 133021869; Fri, 13 Nov 2015 09:23: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 tAD9NnfR010267; Fri, 13 Nov 2015 09:23:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9NmIN010262; Fri, 13 Nov 2015 09:23:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130923.tAD9NmIN010262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290754 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:23:50 -0000 Author: mav Date: Fri Nov 13 09:23:48 2015 New Revision: 290754 URL: https://svnweb.freebsd.org/changeset/base/290754 Log: MFC r289309: 6267 dn_bonus evicted too early Reviewed by: Richard Yao Reviewed by: Xin LI Reviewed by: Matthew Ahrens Approved by: Richard Lowe Author: Justin T. Gibbs illumos/illumos-gate@d2058105c61ec61df3a2dd3f839fed8c3fe7bfd6 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Nov 13 09:23:48 2015 (r290754) @@ -267,7 +267,7 @@ dbuf_verify_user(dmu_buf_impl_t *db, dbv */ ASSERT3U(holds, >=, db->db_dirtycnt); } else { - if (db->db_immediate_evict == TRUE) + if (db->db_user_immediate_evict == TRUE) ASSERT3U(holds, >=, db->db_dirtycnt); else ASSERT3U(holds, >, 0); @@ -1870,8 +1870,9 @@ dbuf_create(dnode_t *dn, uint8_t level, db->db_blkptr = blkptr; db->db_user = NULL; - db->db_immediate_evict = 0; - db->db_freed_in_flight = 0; + db->db_user_immediate_evict = FALSE; + db->db_freed_in_flight = FALSE; + db->db_pending_evict = FALSE; if (blkid == DMU_BONUS_BLKID) { ASSERT3P(parent, ==, dn->dn_dbuf); @@ -2427,12 +2428,13 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, arc_buf_freeze(db->db_buf); if (holds == db->db_dirtycnt && - db->db_level == 0 && db->db_immediate_evict) + db->db_level == 0 && db->db_user_immediate_evict) dbuf_evict_user(db); if (holds == 0) { if (db->db_blkid == DMU_BONUS_BLKID) { dnode_t *dn; + boolean_t evict_dbuf = db->db_pending_evict; /* * If the dnode moves here, we cannot cross this @@ -2447,7 +2449,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, * Decrementing the dbuf count means that the bonus * buffer's dnode hold is no longer discounted in * dnode_move(). The dnode cannot move until after - * the dnode_rele_and_unlock() below. + * the dnode_rele() below. */ DB_DNODE_EXIT(db); @@ -2457,35 +2459,10 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, */ mutex_exit(&db->db_mtx); - /* - * If the dnode has been freed, evict the bonus - * buffer immediately. The data in the bonus - * buffer is no longer relevant and this prevents - * a stale bonus buffer from being associated - * with this dnode_t should the dnode_t be reused - * prior to being destroyed. - */ - mutex_enter(&dn->dn_mtx); - if (dn->dn_type == DMU_OT_NONE || - dn->dn_free_txg != 0) { - /* - * Drop dn_mtx. It is a leaf lock and - * cannot be held when dnode_evict_bonus() - * acquires other locks in order to - * perform the eviction. - * - * Freed dnodes cannot be reused until the - * last hold is released. Since this bonus - * buffer has a hold, the dnode will remain - * in the free state, even without dn_mtx - * held, until the dnode_rele_and_unlock() - * below. - */ - mutex_exit(&dn->dn_mtx); + if (evict_dbuf) dnode_evict_bonus(dn); - mutex_enter(&dn->dn_mtx); - } - dnode_rele_and_unlock(dn, db); + + dnode_rele(dn, db); } else if (db->db_buf == NULL) { /* * This is a special case: we never associated this @@ -2532,7 +2509,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, } else { dbuf_clear(db); } - } else if (db->db_objset->os_evicting || + } else if (db->db_pending_evict || arc_buf_eviction_needed(db->db_buf)) { dbuf_clear(db); } else { @@ -2580,7 +2557,7 @@ dmu_buf_set_user_ie(dmu_buf_t *db_fake, { dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; - db->db_immediate_evict = TRUE; + db->db_user_immediate_evict = TRUE; return (dmu_buf_set_user(db_fake, user)); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Nov 13 09:23:48 2015 (r290754) @@ -686,7 +686,6 @@ dmu_objset_evict(objset_t *os) if (os->os_sa) sa_tear_down(os); - os->os_evicting = B_TRUE; dmu_objset_evict_dbufs(os); mutex_enter(&os->os_lock); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Nov 13 09:23:48 2015 (r290754) @@ -424,6 +424,7 @@ dnode_evict_dbufs(dnode_t *dn) db_next = AVL_NEXT(&dn->dn_dbufs, &db_marker); avl_remove(&dn->dn_dbufs, &db_marker); } else { + db->db_pending_evict = TRUE; mutex_exit(&db->db_mtx); db_next = AVL_NEXT(&dn->dn_dbufs, db); } @@ -437,10 +438,14 @@ void dnode_evict_bonus(dnode_t *dn) { rw_enter(&dn->dn_struct_rwlock, RW_WRITER); - if (dn->dn_bonus && refcount_is_zero(&dn->dn_bonus->db_holds)) { - mutex_enter(&dn->dn_bonus->db_mtx); - dbuf_evict(dn->dn_bonus); - dn->dn_bonus = NULL; + if (dn->dn_bonus != NULL) { + if (refcount_is_zero(&dn->dn_bonus->db_holds)) { + mutex_enter(&dn->dn_bonus->db_mtx); + dbuf_evict(dn->dn_bonus); + dn->dn_bonus = NULL; + } else { + dn->dn_bonus->db_pending_evict = TRUE; + } } rw_exit(&dn->dn_struct_rwlock); } @@ -492,7 +497,6 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *t dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]); dnode_evict_dbufs(dn); - ASSERT(avl_is_empty(&dn->dn_dbufs)); /* * XXX - It would be nice to assert this, but we may still Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Fri Nov 13 09:23:48 2015 (r290754) @@ -230,9 +230,25 @@ typedef struct dmu_buf_impl { /* User callback information. */ dmu_buf_user_t *db_user; - uint8_t db_immediate_evict; + /* + * Evict user data as soon as the dirty and reference + * counts are equal. + */ + uint8_t db_user_immediate_evict; + + /* + * This block was freed while a read or write was + * active. + */ uint8_t db_freed_in_flight; + /* + * dnode_evict_dbufs() or dnode_evict_bonus() tried to + * evict this dbuf, but couldn't due to outstanding + * references. Evict once the refcount drops to 0. + */ + uint8_t db_pending_evict; + uint8_t db_dirtycnt; } dmu_buf_impl_t; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Nov 13 09:22:53 2015 (r290753) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Nov 13 09:23:48 2015 (r290754) @@ -93,7 +93,6 @@ struct objset { uint8_t os_copies; enum zio_checksum os_dedup_checksum; boolean_t os_dedup_verify; - boolean_t os_evicting; zfs_logbias_op_t os_logbias; zfs_cache_type_t os_primary_cache; zfs_cache_type_t os_secondary_cache; From owner-svn-src-stable@freebsd.org Fri Nov 13 09:25:49 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4488AA2CAA3; Fri, 13 Nov 2015 09:25: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 F3F7B19D8; Fri, 13 Nov 2015 09:25: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 tAD9PlPj010414; Fri, 13 Nov 2015 09:25:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9Pl4U010412; Fri, 13 Nov 2015 09:25:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130925.tAD9Pl4U010412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290755 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:25:49 -0000 Author: mav Date: Fri Nov 13 09:25:47 2015 New Revision: 290755 URL: https://svnweb.freebsd.org/changeset/base/290755 Log: MFC r289313: 5764 "zfs send -nv" directs output to stderr Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Basil Crow Reviewed by: Steven Hartland Reviewed by: Bayard Bell Approved by: Dan McDonald Author: Manoj Joseph illumos/illumos-gate@dc5f28a3c341db7c241bba77ddc109c141072f27 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:23:48 2015 (r290754) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:25:47 2015 (r290755) @@ -2630,6 +2630,9 @@ useful in conjunction with the or .Fl P flags to determine what data will be sent. +In this case, the verbose output will be written to +standard output (contrast with a non-dry-run, where the stream is written +to standard output and the verbose output goes to standard error). .It Fl P Print machine-parsable verbose information about the stream package generated. .It Fl v Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:23:48 2015 (r290754) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:25:47 2015 (r290755) @@ -818,7 +818,8 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable, progress, embed_data, large_block; + boolean_t verbose, dryrun, parsable, progress, embed_data, std_out; + boolean_t large_block; int outfd; boolean_t err; nvlist_t *fss; @@ -1047,6 +1048,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; + FILE *fout = sdd->std_out ? stdout : stderr; err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; @@ -1121,30 +1123,30 @@ dump_snapshot(zfs_handle_t *zhp, void *a if (sdd->parsable) { if (sdd->prevsnap[0] != '\0') { - (void) fprintf(stderr, "incremental\t%s\t%s", + (void) fprintf(fout, "incremental\t%s\t%s", sdd->prevsnap, zhp->zfs_name); } else { - (void) fprintf(stderr, "full\t%s", + (void) fprintf(fout, "full\t%s", zhp->zfs_name); } } else { - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + (void) fprintf(fout, dgettext(TEXT_DOMAIN, "send from @%s to %s"), sdd->prevsnap, zhp->zfs_name); } if (err == 0) { if (sdd->parsable) { - (void) fprintf(stderr, "\t%llu\n", + (void) fprintf(fout, "\t%llu\n", (longlong_t)size); } else { char buf[16]; zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + (void) fprintf(fout, dgettext(TEXT_DOMAIN, " estimated size is %s\n"), buf); } sdd->size += size; } else { - (void) fprintf(stderr, "\n"); + (void) fprintf(fout, "\n"); } } @@ -1388,6 +1390,7 @@ zfs_send(zfs_handle_t *zhp, const char * int pipefd[2]; dedup_arg_t dda = { 0 }; int featureflags = 0; + FILE *fout; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot send '%s'"), zhp->zfs_name); @@ -1515,6 +1518,9 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.filter_cb_arg = cb_arg; if (debugnvp) sdd.debugnv = *debugnvp; + if (sdd.verbose && sdd.dryrun) + sdd.std_out = B_TRUE; + fout = sdd.std_out ? stdout : stderr; /* * Some flags require that we place user holds on the datasets that are @@ -1554,12 +1560,12 @@ zfs_send(zfs_handle_t *zhp, const char * if (flags->verbose) { if (flags->parsable) { - (void) fprintf(stderr, "size\t%llu\n", + (void) fprintf(fout, "size\t%llu\n", (longlong_t)sdd.size); } else { char buf[16]; zfs_nicenum(sdd.size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + (void) fprintf(fout, dgettext(TEXT_DOMAIN, "total estimated size is %s\n"), buf); } } From owner-svn-src-stable@freebsd.org Fri Nov 13 09:30:19 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F1CA2CB9E; Fri, 13 Nov 2015 09:30:19 +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 704211C6A; Fri, 13 Nov 2015 09:30:19 +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 tAD9UIUS010734; Fri, 13 Nov 2015 09:30:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9UHYY010724; Fri, 13 Nov 2015 09:30:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130930.tAD9UHYY010724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290756 - in stable/10: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/com... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:30:20 -0000 Author: mav Date: Fri Nov 13 09:30:17 2015 New Revision: 290756 URL: https://svnweb.freebsd.org/changeset/base/290756 Log: MFC r289362, r289445: 2605 want to resume interrupted zfs send Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Richard Elling Reviewed by: Xin Li Reviewed by: Arne Jansen Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8 For more info, see: - slides http://www.slideshare.net/MatthewAhrens/openzfs-send-and-receive - video https://www.youtube.com/watch?v=iY44jPMvxog - manpage changes (for zfs resume -s and zfs send -t) - upcoming talk at the OpenZFS Developer Summit The TL;DR is: Use "zfs receive -s" to save the partially received state on failure. On failure, get the receive token with "zfs get receive_resume_token " Resume the send with "zfs send -t " Relnotes: yes Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/10/cddl/lib/libzfs/Makefile stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:30:17 2015 (r290756) @@ -189,17 +189,25 @@ .Op Fl i Ar snapshot Ns | Ns bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm +.Cm send +.Op Fl Penv +.Fl t Ar receive_resume_token +.Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl d | e .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem .Nm +.Cm receive Ns | Ns Cm recv +.Fl A +.Ar filesystem Ns | Ns Ar volume +.Nm .Cm allow .Ar filesystem Ns | Ns Ar volume .Nm @@ -597,6 +605,13 @@ For cloned file systems or volumes, the created. See also the .Sy clones property. +.It Sy receive_resume_token +For filesystems or volumes which have saved partially-completed state from +.Sy zfs receive -s , +this opaque token can be provided to +.Sy zfs send -t +to resume and complete the +.Sy zfs receive . .It Sy referenced The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it @@ -2714,15 +2729,28 @@ feature. .El .It Xo .Nm +.Cm send +.Op Fl Penv +.Fl t +.Ar receive_resume_token +.Xc +Creates a send stream which resumes an interrupted receive. The +.Ar receive_resume_token +is the value of this property on the filesystem +or volume that was being received into. See the documentation for +.Sy zfs receive -s +for more details. +.It Xo +.Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .It Xo .Nm .Cm receive Ns | Ns Cm recv -.Op Fl vnFu +.Op Fl vnsFu .Op Fl d | e .Op Fl o Sy origin Ns = Ns Ar snapshot .Ar filesystem @@ -2819,9 +2847,42 @@ performing the receive operation. If rec stream (for example, one generated by .Qq Nm Cm send Fl R Bro Fl i | Fl I Brc ) , destroy snapshots and file systems that do not exist on the sending side. +.It Fl s +If the receive is interrupted, save the partially received state, rather +than deleting it. Interruption may be due to premature termination of +the stream +.Po e.g. due to network failure or failure of the remote system +if the stream is being read over a network connection +.Pc , +a checksum error in the stream, termination of the +.Nm zfs Cm receive +process, or unclean shutdown of the system. +.Pp +The receive can be resumed with a stream generated by +.Nm zfs Cm send Fl t Ar token , +where the +.Ar token +is the value of the +.Sy receive_resume_token +property of the filesystem or volume which is received into. +.Pp +To use this flag, the storage pool must have the +.Sy extensible_dataset +feature enabled. See +.Xr zpool-features 5 +for details on ZFS feature flags. .El .It Xo .Nm +.Cm receive Ns | Ns Cm recv +.Fl A +.Ar filesystem Ns | Ns Ar volume +.Xc +Abort an interrupted +.Nm zfs Cm receive Fl s , +deleting its saved partially received state. +.It Xo +.Nm .Cm allow .Ar filesystem Ns | Ns Ar volume .Xc Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:30:17 2015 (r290756) @@ -263,10 +263,11 @@ get_usage(zfs_help_t idx) case HELP_PROMOTE: return (gettext("\tpromote \n")); case HELP_RECEIVE: - return (gettext("\treceive|recv [-vnFu] \n" - "\treceive|recv [-vnFu] [-o origin=] [-d | -e] " - "\n")); + "\treceive|recv [-vnsFu] [-o origin=] [-d | -e] " + "\n" + "\treceive|recv -A \n")); case HELP_RENAME: return (gettext("\trename [-f] " "\n" @@ -279,7 +280,8 @@ get_usage(zfs_help_t idx) return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] " "\n" "\tsend [-Le] [-i snapshot|bookmark] " - "\n")); + "\n" + "\tsend [-nvPe] -t \n")); case HELP_SET: return (gettext("\tset " " ...\n")); @@ -3728,6 +3730,7 @@ zfs_do_send(int argc, char **argv) { char *fromname = NULL; char *toname = NULL; + char *resume_token = NULL; char *cp; zfs_handle_t *zhp; sendflags_t flags = { 0 }; @@ -3736,7 +3739,7 @@ zfs_do_send(int argc, char **argv) boolean_t extraverbose = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnPLe")) != -1) { + while ((c = getopt(argc, argv, ":i:I:RDpvnPLet:")) != -1) { switch (c) { case 'i': if (fromname) @@ -3777,6 +3780,9 @@ zfs_do_send(int argc, char **argv) case 'e': flags.embed_data = B_TRUE; break; + case 't': + resume_token = optarg; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -3792,14 +3798,28 @@ zfs_do_send(int argc, char **argv) argc -= optind; argv += optind; - /* check number of arguments */ - if (argc < 1) { - (void) fprintf(stderr, gettext("missing snapshot argument\n")); - usage(B_FALSE); - } - if (argc > 1) { - (void) fprintf(stderr, gettext("too many arguments\n")); - usage(B_FALSE); + if (resume_token != NULL) { + if (fromname != NULL || flags.replicate || flags.props || + flags.dedup) { + (void) fprintf(stderr, + gettext("invalid flags combined with -t\n")); + usage(B_FALSE); + } + if (argc != 0) { + (void) fprintf(stderr, gettext("no additional " + "arguments are permitted with -t\n")); + usage(B_FALSE); + } + } else { + if (argc < 1) { + (void) fprintf(stderr, + gettext("missing snapshot argument\n")); + usage(B_FALSE); + } + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } } if (!flags.dryrun && isatty(STDOUT_FILENO)) { @@ -3809,6 +3829,11 @@ zfs_do_send(int argc, char **argv) return (1); } + if (resume_token != NULL) { + return (zfs_send_resume(g_zfs, &flags, STDOUT_FILENO, + resume_token)); + } + /* * Special case sending a filesystem, or from a bookmark. */ @@ -3914,8 +3939,6 @@ zfs_do_send(int argc, char **argv) } /* - * zfs receive [-vnFu] [-d | -e] - * * Restore a backup stream from stdin. */ static int @@ -3923,6 +3946,8 @@ zfs_do_receive(int argc, char **argv) { int c, err; recvflags_t flags = { 0 }; + boolean_t abort_resumable = B_FALSE; + nvlist_t *props; nvpair_t *nvp = NULL; @@ -3930,7 +3955,7 @@ zfs_do_receive(int argc, char **argv) nomem(); /* check options */ - while ((c = getopt(argc, argv, ":o:denuvF")) != -1) { + while ((c = getopt(argc, argv, ":o:denuvFsA")) != -1) { switch (c) { case 'o': if (parseprop(props, optarg) != 0) @@ -3952,9 +3977,15 @@ zfs_do_receive(int argc, char **argv) case 'v': flags.verbose = B_TRUE; break; + case 's': + flags.resumable = B_TRUE; + break; case 'F': flags.force = B_TRUE; break; + case 'A': + abort_resumable = B_TRUE; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -3987,6 +4018,44 @@ zfs_do_receive(int argc, char **argv) } } + if (abort_resumable) { + if (flags.isprefix || flags.istail || flags.dryrun || + flags.resumable || flags.nomount) { + (void) fprintf(stderr, gettext("invalid option")); + usage(B_FALSE); + } + + char namebuf[ZFS_MAXNAMELEN]; + (void) snprintf(namebuf, sizeof (namebuf), + "%s/%%recv", argv[0]); + + if (zfs_dataset_exists(g_zfs, namebuf, + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME)) { + zfs_handle_t *zhp = zfs_open(g_zfs, + namebuf, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + return (1); + err = zfs_destroy(zhp, B_FALSE); + } else { + zfs_handle_t *zhp = zfs_open(g_zfs, + argv[0], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + usage(B_FALSE); + if (!zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) || + zfs_prop_get(zhp, ZFS_PROP_RECEIVE_RESUME_TOKEN, + NULL, 0, NULL, NULL, 0, B_TRUE) == -1) { + (void) fprintf(stderr, + gettext("'%s' does not have any " + "resumable receive state to abort\n"), + argv[0]); + return (1); + } + err = zfs_destroy(zhp, B_FALSE); + } + + return (err != 0); + } + if (isatty(STDIN_FILENO)) { (void) fprintf(stderr, gettext("Error: Backup stream can not be read " @@ -3994,7 +4063,6 @@ zfs_do_receive(int argc, char **argv) "You must redirect standard input.\n")); return (1); } - err = zfs_receive(g_zfs, argv[0], props, &flags, STDIN_FILENO, NULL); return (err != 0); @@ -5816,6 +5884,24 @@ share_mount_one(zfs_handle_t *zhp, int o } /* + * If this filesystem is inconsistent and has a receive resume + * token, we can not mount it. + */ + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) && + zfs_prop_get(zhp, ZFS_PROP_RECEIVE_RESUME_TOKEN, + NULL, 0, NULL, NULL, 0, B_TRUE) == 0) { + if (!explicit) + return (0); + + (void) fprintf(stderr, gettext("cannot %s '%s': " + "Contains partially-completed state from " + "\"zfs receive -r\", which can be resumed with " + "\"zfs send -t\"\n"), + cmdname, zfs_get_name(zhp)); + return (1); + } + + /* * At this point, we have verified that the mountpoint and/or * shareopts are appropriate for auto management. If the * filesystem is already mounted or shared, return (failing Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Fri Nov 13 09:30:17 2015 (r290756) @@ -125,7 +125,7 @@ read_hdr(dmu_replay_record_t *drr, zio_c saved_cksum.zc_word[1], saved_cksum.zc_word[2], saved_cksum.zc_word[3]); - exit(1); + return (0); } return (sizeof (*drr)); } @@ -346,8 +346,7 @@ main(int argc, char *argv[]) if (verbose) (void) printf("\n"); - if ((DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == - DMU_COMPOUNDSTREAM) && drr->drr_payloadlen != 0) { + if (drr->drr_payloadlen != 0) { nvlist_t *nv; int sz = drr->drr_payloadlen; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:30:17 2015 (r290756) @@ -621,6 +621,10 @@ typedef boolean_t (snapfilter_cb_t)(zfs_ extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags); +extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd, + const char *); +extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, + const char *token); extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, @@ -661,6 +665,12 @@ typedef struct recvflags { /* set "canmount=off" on all modified filesystems */ boolean_t canmountoff; + /* + * Mark the file systems as "resumable" and do not destroy them if the + * receive is interrupted + */ + boolean_t resumable; + /* byteswap flag is used internally; callers need not specify */ boolean_t byteswap; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Fri Nov 13 09:30:17 2015 (r290756) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_ if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_EDBP: + cflag = ZFS_CMD_COMPAT_EDBP; + break; case ZFS_IOCVER_ZCMD: cflag = ZFS_CMD_COMPAT_ZCMD; break; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:30:17 2015 (r290756) @@ -1772,22 +1772,21 @@ getprop_uint64(zfs_handle_t *zhp, zfs_pr return (value); } -static char * +static const char * getprop_string(zfs_handle_t *zhp, zfs_prop_t prop, char **source) { nvlist_t *nv; - char *value; + const char *value; *source = NULL; if (nvlist_lookup_nvlist(zhp->zfs_props, zfs_prop_to_name(prop), &nv) == 0) { - verify(nvlist_lookup_string(nv, ZPROP_VALUE, &value) == 0); + value = fnvlist_lookup_string(nv, ZPROP_VALUE); (void) nvlist_lookup_string(nv, ZPROP_SOURCE, source); } else { verify(!zhp->zfs_props_table || zhp->zfs_props_table[prop] == B_TRUE); - if ((value = (char *)zfs_prop_default_string(prop)) == NULL) - value = ""; + value = zfs_prop_default_string(prop); *source = ""; } @@ -2189,7 +2188,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop { char *source = NULL; uint64_t val; - char *str; + const char *str; const char *strval; boolean_t received = zfs_is_recvd_props_mode(zhp); @@ -2294,14 +2293,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop break; case ZFS_PROP_ORIGIN: - (void) strlcpy(propbuf, getprop_string(zhp, prop, &source), - proplen); - /* - * If there is no parent at all, return failure to indicate that - * it doesn't apply to this dataset. - */ - if (propbuf[0] == '\0') + str = getprop_string(zhp, prop, &source); + if (str == NULL) return (-1); + (void) strlcpy(propbuf, str, proplen); break; case ZFS_PROP_CLONES: @@ -2482,8 +2477,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop break; case PROP_TYPE_STRING: - (void) strlcpy(propbuf, - getprop_string(zhp, prop, &source), proplen); + str = getprop_string(zhp, prop, &source); + if (str == NULL) + return (-1); + (void) strlcpy(propbuf, str, proplen); break; case PROP_TYPE_INDEX: Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Nov 13 09:30:17 2015 (r290756) @@ -1072,6 +1072,17 @@ mount_cb(zfs_handle_t *zhp, void *data) return (0); } + /* + * If this filesystem is inconsistent and has a receive resume + * token, we can not mount it. + */ + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) && + zfs_prop_get(zhp, ZFS_PROP_RECEIVE_RESUME_TOKEN, + NULL, 0, NULL, NULL, 0, B_TRUE) == 0) { + zfs_close(zhp); + return (0); + } + libzfs_add_handle(cbp, zhp); if (zfs_iter_filesystems(zhp, mount_cb, cbp) != 0) { zfs_close(zhp); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:25:47 2015 (r290755) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:30:17 2015 (r290756) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. @@ -51,6 +51,7 @@ #include "zfs_prop.h" #include "zfs_fletcher.h" #include "libzfs_impl.h" +#include #include #include #include @@ -67,6 +68,8 @@ extern void zfs_setprop_error(libzfs_han static int zfs_receive_impl(libzfs_handle_t *, const char *, const char *, recvflags_t *, int, const char *, nvlist_t *, avl_tree_t *, char **, int, uint64_t *); +static int guid_to_name(libzfs_handle_t *, const char *, + uint64_t, boolean_t, char *); static const zio_cksum_t zero_cksum = { 0 }; @@ -284,8 +287,7 @@ cksummer(void *arg) DMU_BACKUP_FEATURE_DEDUPPROPS); DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags); - if (DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == - DMU_COMPOUNDSTREAM && drr->drr_payloadlen != 0) { + if (drr->drr_payloadlen != 0) { sz = drr->drr_payloadlen; if (sz > SPA_MAXBLOCKSIZE) { @@ -995,17 +997,14 @@ static void * send_progress_thread(void *arg) { progress_arg_t *pa = arg; - zfs_cmd_t zc = { 0 }; zfs_handle_t *zhp = pa->pa_zhp; libzfs_handle_t *hdl = zhp->zfs_hdl; unsigned long long bytes; char buf[16]; - time_t t; struct tm *tm; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); if (!pa->pa_parsable) @@ -1038,6 +1037,51 @@ send_progress_thread(void *arg) } } +static void +send_print_verbose(FILE *fout, const char *tosnap, const char *fromsnap, + uint64_t size, boolean_t parsable) +{ + if (parsable) { + if (fromsnap != NULL) { + (void) fprintf(fout, "incremental\t%s\t%s", + fromsnap, tosnap); + } else { + (void) fprintf(fout, "full\t%s", + tosnap); + } + } else { + if (fromsnap != NULL) { + if (strchr(fromsnap, '@') == NULL && + strchr(fromsnap, '#') == NULL) { + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "send from @%s to %s"), + fromsnap, tosnap); + } else { + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "send from %s to %s"), + fromsnap, tosnap); + } + } else { + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "full send of %s"), + tosnap); + } + } + + if (size != 0) { + if (parsable) { + (void) fprintf(fout, "\t%llu", + (longlong_t)size); + } else { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + " estimated size is %s"), buf); + } + } + (void) fprintf(fout, "\n"); +} + static int dump_snapshot(zfs_handle_t *zhp, void *arg) { @@ -1117,37 +1161,14 @@ dump_snapshot(zfs_handle_t *zhp, void *a (sdd->fromorigin || sdd->replicate); if (sdd->verbose) { - uint64_t size; - err = estimate_ioctl(zhp, sdd->prevsnap_obj, + uint64_t size = 0; + (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, &size); - if (sdd->parsable) { - if (sdd->prevsnap[0] != '\0') { - (void) fprintf(fout, "incremental\t%s\t%s", - sdd->prevsnap, zhp->zfs_name); - } else { - (void) fprintf(fout, "full\t%s", - zhp->zfs_name); - } - } else { - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - "send from @%s to %s"), - sdd->prevsnap, zhp->zfs_name); - } - if (err == 0) { - if (sdd->parsable) { - (void) fprintf(fout, "\t%llu\n", - (longlong_t)size); - } else { - char buf[16]; - zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - " estimated size is %s\n"), buf); - } - sdd->size += size; - } else { - (void) fprintf(fout, "\n"); - } + send_print_verbose(fout, zhp->zfs_name, + sdd->prevsnap[0] ? sdd->prevsnap : NULL, + size, sdd->parsable); + sdd->size += size; } if (!sdd->dryrun) { @@ -1358,6 +1379,233 @@ again: return (0); } +nvlist_t * +zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, const char *token) +{ + unsigned int version; + int nread; + unsigned long long checksum, packed_len; + + /* + * Decode token header, which is: + * -- + * Note that the only supported token version is 1. + */ + nread = sscanf(token, "%u-%llx-%llx-", + &version, &checksum, &packed_len); + if (nread != 3) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (invalid format)")); + return (NULL); + } + + if (version != ZFS_SEND_RESUME_TOKEN_VERSION) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (invalid version %u)"), + version); + return (NULL); + } + + /* convert hexadecimal representation to binary */ + token = strrchr(token, '-') + 1; + int len = strlen(token) / 2; + unsigned char *compressed = zfs_alloc(hdl, len); + for (int i = 0; i < len; i++) { + nread = sscanf(token + i * 2, "%2hhx", compressed + i); + if (nread != 1) { + free(compressed); + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt " + "(payload is not hex-encoded)")); + return (NULL); + } + } + + /* verify checksum */ + zio_cksum_t cksum; + fletcher_4_native(compressed, len, &cksum); + if (cksum.zc_word[0] != checksum) { + free(compressed); + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (incorrect checksum)")); + return (NULL); + } + + /* uncompress */ + void *packed = zfs_alloc(hdl, packed_len); + uLongf packed_len_long = packed_len; + if (uncompress(packed, &packed_len_long, compressed, len) != Z_OK || + packed_len_long != packed_len) { + free(packed); + free(compressed); + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (decompression failed)")); + return (NULL); + } + + /* unpack nvlist */ + nvlist_t *nv; + int error = nvlist_unpack(packed, packed_len, &nv, KM_SLEEP); + free(packed); + free(compressed); + if (error != 0) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt (nvlist_unpack failed)")); + return (NULL); + } + return (nv); +} + +int +zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *flags, int outfd, + const char *resume_token) +{ + char errbuf[1024]; + char *toname; + char *fromname = NULL; + uint64_t resumeobj, resumeoff, toguid, fromguid, bytes; + zfs_handle_t *zhp; + int error = 0; + char name[ZFS_MAXNAMELEN]; + enum lzc_send_flags lzc_flags = 0; + + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, + "cannot resume send")); + + nvlist_t *resume_nvl = + zfs_send_resume_token_to_nvlist(hdl, resume_token); + if (resume_nvl == NULL) { + /* + * zfs_error_aux has already been set by + * zfs_send_resume_token_to_nvlist + */ + return (zfs_error(hdl, EZFS_FAULT, errbuf)); + } + if (flags->verbose) { + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "resume token contents:\n")); + nvlist_print(stderr, resume_nvl); + } + + if (nvlist_lookup_string(resume_nvl, "toname", &toname) != 0 || + nvlist_lookup_uint64(resume_nvl, "object", &resumeobj) != 0 || + nvlist_lookup_uint64(resume_nvl, "offset", &resumeoff) != 0 || + nvlist_lookup_uint64(resume_nvl, "bytes", &bytes) != 0 || + nvlist_lookup_uint64(resume_nvl, "toguid", &toguid) != 0) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "resume token is corrupt")); + return (zfs_error(hdl, EZFS_FAULT, errbuf)); + } + fromguid = 0; + (void) nvlist_lookup_uint64(resume_nvl, "fromguid", &fromguid); + + if (flags->embed_data || nvlist_exists(resume_nvl, "embedok")) + lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + + if (guid_to_name(hdl, toname, toguid, B_FALSE, name) != 0) { + if (zfs_dataset_exists(hdl, toname, ZFS_TYPE_DATASET)) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "'%s' is no longer the same snapshot used in " + "the initial send"), toname); + } else { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "'%s' used in the initial send no longer exists"), + toname); + } + return (zfs_error(hdl, EZFS_BADPATH, errbuf)); + } + zhp = zfs_open(hdl, name, ZFS_TYPE_DATASET); + if (zhp == NULL) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "unable to access '%s'"), name); + return (zfs_error(hdl, EZFS_BADPATH, errbuf)); + } + + if (fromguid != 0) { + if (guid_to_name(hdl, toname, fromguid, B_TRUE, name) != 0) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "incremental source %#llx no longer exists"), + (longlong_t)fromguid); + return (zfs_error(hdl, EZFS_BADPATH, errbuf)); + } + fromname = name; + } + + if (flags->verbose) { + uint64_t size = 0; + error = lzc_send_space(zhp->zfs_name, fromname, &size); + if (error == 0) + size = MAX(0, (int64_t)(size - bytes)); + send_print_verbose(stderr, zhp->zfs_name, fromname, + size, flags->parsable); + } + + if (!flags->dryrun) { + progress_arg_t pa = { 0 }; + pthread_t tid; + /* + * If progress reporting is requested, spawn a new thread to + * poll ZFS_IOC_SEND_PROGRESS at a regular interval. + */ + if (flags->progress) { + pa.pa_zhp = zhp; + pa.pa_fd = outfd; + pa.pa_parsable = flags->parsable; + + error = pthread_create(&tid, NULL, + send_progress_thread, &pa); + if (error != 0) { + zfs_close(zhp); + return (error); + } + } + + error = lzc_send_resume(zhp->zfs_name, fromname, outfd, + lzc_flags, resumeobj, resumeoff); + + if (flags->progress) { + (void) pthread_cancel(tid); + (void) pthread_join(tid, NULL); + } + + char errbuf[1024]; + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, + "warning: cannot send '%s'"), zhp->zfs_name); + + zfs_close(zhp); + + switch (error) { + case 0: + return (0); + case EXDEV: + case ENOENT: + case EDQUOT: + case EFBIG: + case EIO: + case ENOLINK: + case ENOSPC: +#ifdef illumos + case ENOSTR: +#endif + case ENXIO: + case EPIPE: + case ERANGE: + case EFAULT: + case EROFS: + zfs_error_aux(hdl, strerror(errno)); + return (zfs_error(hdl, EZFS_BADBACKUP, errbuf)); + + default: + return (zfs_standard_error(hdl, errno, errbuf)); + } + } + + + zfs_close(zhp); + + return (error); +} + /* * Generate a send stream for the dataset identified by the argument zhp. * @@ -1897,6 +2145,7 @@ recv_destroy(libzfs_handle_t *hdl, const typedef struct guid_to_name_data { uint64_t guid; + boolean_t bookmark_ok; char *name; char *skip; } guid_to_name_data_t; @@ -1905,20 +2154,25 @@ static int guid_to_name_cb(zfs_handle_t *zhp, void *arg) { guid_to_name_data_t *gtnd = arg; + const char *slash; int err; if (gtnd->skip != NULL && - strcmp(zhp->zfs_name, gtnd->skip) == 0) { + (slash = strrchr(zhp->zfs_name, '/')) != NULL && + strcmp(slash + 1, gtnd->skip) == 0) { + zfs_close(zhp); return (0); } - if (zhp->zfs_dmustats.dds_guid == gtnd->guid) { + if (zfs_prop_get_int(zhp, ZFS_PROP_GUID) == gtnd->guid) { (void) strcpy(gtnd->name, zhp->zfs_name); zfs_close(zhp); return (EEXIST); } err = zfs_iter_children(zhp, guid_to_name_cb, gtnd); + if (err != EEXIST && gtnd->bookmark_ok) + err = zfs_iter_bookmarks(zhp, guid_to_name_cb, gtnd); zfs_close(zhp); return (err); } @@ -1932,45 +2186,48 @@ guid_to_name_cb(zfs_handle_t *zhp, void */ static int guid_to_name(libzfs_handle_t *hdl, const char *parent, uint64_t guid, - char *name) + boolean_t bookmark_ok, char *name) { - /* exhaustive search all local snapshots */ char pname[ZFS_MAXNAMELEN]; guid_to_name_data_t gtnd; - int err = 0; - zfs_handle_t *zhp; - char *cp; gtnd.guid = guid; + gtnd.bookmark_ok = bookmark_ok; gtnd.name = name; gtnd.skip = NULL; - (void) strlcpy(pname, parent, sizeof (pname)); - /* - * Search progressively larger portions of the hierarchy. This will + * Search progressively larger portions of the hierarchy, starting + * with the filesystem specified by 'parent'. This will * select the "most local" version of the origin snapshot in the case * that there are multiple matching snapshots in the system. */ - while ((cp = strrchr(pname, '/')) != NULL) { - + (void) strlcpy(pname, parent, sizeof (pname)); + char *cp = strrchr(pname, '@'); + if (cp == NULL) + cp = strchr(pname, '\0'); + for (; cp != NULL; cp = strrchr(pname, '/')) { /* Chop off the last component and open the parent */ *cp = '\0'; - zhp = make_dataset_handle(hdl, pname); + zfs_handle_t *zhp = make_dataset_handle(hdl, pname); if (zhp == NULL) continue; - - err = zfs_iter_children(zhp, guid_to_name_cb, >nd); + int err = guid_to_name_cb(zfs_handle_dup(zhp), >nd); + if (err != EEXIST) + err = zfs_iter_children(zhp, guid_to_name_cb, >nd); + if (err != EEXIST && bookmark_ok) + err = zfs_iter_bookmarks(zhp, guid_to_name_cb, >nd); zfs_close(zhp); if (err == EEXIST) return (0); /* - * Remember the dataset that we already searched, so we - * skip it next time through. + * Remember the last portion of the dataset so we skip it next + * time through (as we've already searched that portion of the + * hierarchy). */ - gtnd.skip = pname; + gtnd.skip = strrchr(pname, '/') + 1; } return (ENOENT); @@ -2568,11 +2825,9 @@ recv_skip(libzfs_handle_t *hdl, int fd, switch (drr->drr_type) { case DRR_BEGIN: - /* NB: not to be used on v2 stream packages */ if (drr->drr_payloadlen != 0) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "invalid substream header")); - return (zfs_error(hdl, EZFS_BADSTREAM, errbuf)); + (void) recv_read(hdl, fd, buf, + drr->drr_payloadlen, B_FALSE, NULL); } break; @@ -2633,6 +2888,40 @@ recv_skip(libzfs_handle_t *hdl, int fd, return (-1); } +static void +recv_ecksum_set_aux(libzfs_handle_t *hdl, const char *target_snap, + boolean_t resumable) +{ + char target_fs[ZFS_MAXNAMELEN]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Nov 13 09:32:08 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA40AA2CD1C; Fri, 13 Nov 2015 09:32:08 +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 5A4EC1EB2; Fri, 13 Nov 2015 09:32:08 +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 tAD9W7G0013417; Fri, 13 Nov 2015 09:32:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9W473013391; Fri, 13 Nov 2015 09:32:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130932.tAD9W473013391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290757 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/ut... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:32:08 -0000 Author: mav Date: Fri Nov 13 09:32:04 2015 New Revision: 290757 URL: https://svnweb.freebsd.org/changeset/base/290757 Log: MFC r289422: 4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Saso Kiselkov Reviewed by: Richard Lowe Approved by: Garrett D'Amore Author: Matthew Ahrens illumos/illumos-gate@45818ee124adeaaf947698996b4f4c722afc6d1f This is only a partial merge of respective ZFS infrastructure changes. At this moment FreeBSD kernel has no those crypto algorithms, so the parts of the code to enable them are commented out. When they are implemented, it will be trivial to plug them in. Added: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c - copied unchanged from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c - copied unchanged from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1487,6 +1487,12 @@ zfs_setprop_error(libzfs_handle_t *hdl, "property setting is not allowed on " "bootable datasets")); (void) zfs_error(hdl, EZFS_NOTSUP, errbuf); + } else if (prop == ZFS_PROP_CHECKSUM || + prop == ZFS_PROP_DEDUP) { + (void) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property setting is not allowed on " + "root pools")); + (void) zfs_error(hdl, EZFS_NOTSUP, errbuf); } else { (void) zfs_standard_error(hdl, err, errbuf); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1423,7 +1423,7 @@ zfs_send_resume_token_to_nvlist(libzfs_h /* verify checksum */ zio_cksum_t cksum; - fletcher_4_native(compressed, len, &cksum); + fletcher_4_native(compressed, len, NULL, &cksum); if (cksum.zc_word[0] != checksum) { free(compressed); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:32:04 2015 (r290757) @@ -230,4 +230,19 @@ zpool_feature_init(void) "org.open-zfs:large_blocks", "large_blocks", "Support for blocks larger than 128KB.", ZFEATURE_FLAG_PER_DATASET, large_blocks_deps); + +#ifdef illumos + zfeature_register(SPA_FEATURE_SHA512, + "org.illumos:sha512", "sha512", + "SHA-512/256 hash algorithm.", + ZFEATURE_FLAG_PER_DATASET, NULL); + zfeature_register(SPA_FEATURE_SKEIN, + "org.illumos:skein", "skein", + "Skein hash algorithm.", + ZFEATURE_FLAG_PER_DATASET, NULL); + zfeature_register(SPA_FEATURE_EDONR, + "org.illumos:edonr", "edonr", + "Edon-R hash algorithm.", + ZFEATURE_FLAG_PER_DATASET, NULL); +#endif } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Fri Nov 13 09:32:04 2015 (r290757) @@ -51,6 +51,11 @@ typedef enum spa_feature { SPA_FEATURE_BOOKMARKS, SPA_FEATURE_FS_SS_LIMIT, SPA_FEATURE_LARGE_BLOCKS, +#ifdef illumos + SPA_FEATURE_SHA512, + SPA_FEATURE_SKEIN, + SPA_FEATURE_EDONR, +#endif SPA_FEATURES } spa_feature_t; Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c Fri Nov 13 09:32:04 2015 (r290757) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ /* * Fletcher Checksums @@ -131,8 +134,10 @@ #include #include +/*ARGSUSED*/ void -fletcher_2_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -148,8 +153,10 @@ fletcher_2_native(const void *buf, uint6 ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1); } +/*ARGSUSED*/ void -fletcher_2_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -165,8 +172,10 @@ fletcher_2_byteswap(const void *buf, uin ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1); } +/*ARGSUSED*/ void -fletcher_4_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); @@ -182,8 +191,10 @@ fletcher_4_native(const void *buf, uint6 ZIO_SET_CHECKSUM(zcp, a, b, c, d); } +/*ARGSUSED*/ void -fletcher_4_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h Fri Nov 13 09:32:04 2015 (r290757) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ #ifndef _ZFS_FLETCHER_H #define _ZFS_FLETCHER_H @@ -37,14 +40,12 @@ extern "C" { * fletcher checksum functions */ -void fletcher_2_native(const void *, uint64_t, zio_cksum_t *); -void fletcher_2_byteswap(const void *, uint64_t, zio_cksum_t *); -void fletcher_4_native(const void *, uint64_t, zio_cksum_t *); -void fletcher_4_byteswap(const void *, uint64_t, zio_cksum_t *); -void fletcher_4_incremental_native(const void *, uint64_t, - zio_cksum_t *); -void fletcher_4_incremental_byteswap(const void *, uint64_t, - zio_cksum_t *); +void fletcher_2_native(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_2_byteswap(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_4_native(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_4_byteswap(const void *, uint64_t, const void *, zio_cksum_t *); +void fletcher_4_incremental_native(const void *, uint64_t, zio_cksum_t *); +void fletcher_4_incremental_byteswap(const void *, uint64_t, zio_cksum_t *); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Fri Nov 13 09:32:04 2015 (r290757) @@ -71,6 +71,11 @@ zfs_prop_init(void) { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 }, { "sha256", ZIO_CHECKSUM_SHA256 }, { "noparity", ZIO_CHECKSUM_NOPARITY }, +#ifdef illumos + { "sha512", ZIO_CHECKSUM_SHA512 }, + { "skein", ZIO_CHECKSUM_SKEIN }, + { "edonr", ZIO_CHECKSUM_EDONR }, +#endif { NULL } }; @@ -81,6 +86,16 @@ zfs_prop_init(void) { "sha256", ZIO_CHECKSUM_SHA256 }, { "sha256,verify", ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY }, +#ifdef illumos + { "sha512", ZIO_CHECKSUM_SHA512 }, + { "sha512,verify", + ZIO_CHECKSUM_SHA512 | ZIO_CHECKSUM_VERIFY }, + { "skein", ZIO_CHECKSUM_SKEIN }, + { "skein,verify", + ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY }, + { "edonr,verify", + ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY }, +#endif { NULL } }; @@ -225,12 +240,12 @@ zfs_prop_init(void) zprop_register_index(ZFS_PROP_CHECKSUM, "checksum", ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM", - checksum_table); + "on | off | fletcher2 | fletcher4 | sha256 | sha512 | " + "skein | edonr", "CHECKSUM", checksum_table); zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "on | off | verify | sha256[,verify]", "DEDUP", - dedup_table); + "on | off | verify | sha256[,verify], sha512[,verify], " + "skein[,verify], edonr,verify", "DEDUP", dedup_table); zprop_register_index(ZFS_PROP_COMPRESSION, "compression", ZIO_COMPRESS_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1555,7 +1555,7 @@ arc_cksum_verify(arc_buf_t *buf) mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); return; } - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, &zc); + fletcher_2_native(buf->b_data, buf->b_hdr->b_size, NULL, &zc); if (!ZIO_CHECKSUM_EQUAL(*buf->b_hdr->b_freeze_cksum, zc)) panic("buffer modified while frozen!"); mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); @@ -1568,7 +1568,7 @@ arc_cksum_equal(arc_buf_t *buf) int equal; mutex_enter(&buf->b_hdr->b_l1hdr.b_freeze_lock); - fletcher_2_native(buf->b_data, buf->b_hdr->b_size, &zc); + fletcher_2_native(buf->b_data, buf->b_hdr->b_size, NULL, &zc); equal = ZIO_CHECKSUM_EQUAL(*buf->b_hdr->b_freeze_cksum, zc); mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); @@ -1588,7 +1588,7 @@ arc_cksum_compute(arc_buf_t *buf, boolea } buf->b_hdr->b_freeze_cksum = kmem_alloc(sizeof (zio_cksum_t), KM_SLEEP); fletcher_2_native(buf->b_data, buf->b_hdr->b_size, - buf->b_hdr->b_freeze_cksum); + NULL, buf->b_hdr->b_freeze_cksum); mutex_exit(&buf->b_hdr->b_l1hdr.b_freeze_lock); #ifdef illumos arc_buf_watch(buf); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Nov 13 09:32:04 2015 (r290757) @@ -21,7 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #include @@ -65,7 +65,8 @@ ddt_object_create(ddt_t *ddt, enum ddt_t spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; - boolean_t prehash = zio_checksum_table[ddt->ddt_checksum].ci_dedup; + boolean_t prehash = zio_checksum_table[ddt->ddt_checksum].ci_flags & + ZCHECKSUM_FLAG_DEDUP; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:32:04 2015 (r290757) @@ -1494,7 +1494,8 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf ASSERT(BP_EQUAL(bp, bp_orig)); ASSERT(zio->io_prop.zp_compress != ZIO_COMPRESS_OFF); - ASSERT(zio_checksum_table[chksum].ci_dedup); + ASSERT(zio_checksum_table[chksum].ci_flags & + ZCHECKSUM_FLAG_NOPWRITE); } dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; @@ -1842,8 +1843,10 @@ dmu_write_policy(objset_t *os, dnode_t * * as well. Otherwise, the metadata checksum defaults * to fletcher4. */ - if (zio_checksum_table[checksum].ci_correctable < 1 || - zio_checksum_table[checksum].ci_eck) + if (!(zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_METADATA) || + (zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_EMBEDDED)) checksum = ZIO_CHECKSUM_FLETCHER_4; if (os->os_redundant_metadata == ZFS_REDUNDANT_METADATA_ALL || @@ -1882,17 +1885,20 @@ dmu_write_policy(objset_t *os, dnode_t * */ if (dedup_checksum != ZIO_CHECKSUM_OFF) { dedup = (wp & WP_DMU_SYNC) ? B_FALSE : B_TRUE; - if (!zio_checksum_table[checksum].ci_dedup) + if (!(zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_DEDUP)) dedup_verify = B_TRUE; } /* - * Enable nopwrite if we have a cryptographically secure - * checksum that has no known collisions (i.e. SHA-256) - * and compression is enabled. We don't enable nopwrite if - * dedup is enabled as the two features are mutually exclusive. + * Enable nopwrite if we have secure enough checksum + * algorithm (see comment in zio_nop_write) and + * compression is enabled. We don't enable nopwrite if + * dedup is enabled as the two features are mutually + * exclusive. */ - nopwrite = (!dedup && zio_checksum_table[checksum].ci_dedup && + nopwrite = (!dedup && (zio_checksum_table[checksum].ci_flags & + ZCHECKSUM_FLAG_NOPWRITE) && compress != ZIO_COMPRESS_OFF && zfs_nopwrite_enabled); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Nov 13 09:32:04 2015 (r290757) @@ -292,7 +292,8 @@ dump_write(dmu_sendarg_t *dsp, dmu_objec drrw->drr_checksumtype = ZIO_CHECKSUM_OFF; } else { drrw->drr_checksumtype = BP_GET_CHECKSUM(bp); - if (zio_checksum_table[drrw->drr_checksumtype].ci_dedup) + if (zio_checksum_table[drrw->drr_checksumtype].ci_flags & + ZCHECKSUM_FLAG_DEDUP) drrw->drr_checksumflags |= DRR_CHECKSUM_DEDUP; DDK_SET_LSIZE(&drrw->drr_key, BP_GET_LSIZE(bp)); DDK_SET_PSIZE(&drrw->drr_key, BP_GET_PSIZE(bp)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:32:04 2015 (r290757) @@ -52,6 +52,8 @@ #include #include #include +#include +#include #include #include @@ -133,10 +135,16 @@ dsl_dataset_block_born(dsl_dataset_t *ds dsl_dataset_phys(ds)->ds_compressed_bytes += compressed; dsl_dataset_phys(ds)->ds_uncompressed_bytes += uncompressed; dsl_dataset_phys(ds)->ds_unique_bytes += used; + if (BP_GET_LSIZE(bp) > SPA_OLD_MAXBLOCKSIZE) { ds->ds_feature_activation_needed[SPA_FEATURE_LARGE_BLOCKS] = B_TRUE; } + + spa_feature_t f = zio_checksum_to_feature(BP_GET_CHECKSUM(bp)); + if (f != SPA_FEATURE_NONE) + ds->ds_feature_activation_needed[f] = B_TRUE; + mutex_exit(&ds->ds_lock); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, compressed, uncompressed, tx); @@ -1791,7 +1799,7 @@ get_receive_resume_stats(dsl_dataset_t * packed_size, packed_size, 6); zio_cksum_t cksum; - fletcher_4_native(compressed, compressed_size, &cksum); + fletcher_4_native(compressed, compressed_size, NULL, &cksum); str = kmem_alloc(compressed_size * 2 + 1, KM_SLEEP); for (int i = 0; i < compressed_size; i++) { Copied: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c (from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c Fri Nov 13 09:32:04 2015 (r290757, copy of r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c) @@ -0,0 +1,102 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + * Use is subject to license terms. + */ +#include +#include +#include + +#define EDONR_MODE 512 +#define EDONR_BLOCK_SIZE EdonR512_BLOCK_SIZE + +/* + * Native zio_checksum interface for the Edon-R hash function. + */ +/*ARGSUSED*/ +void +zio_checksum_edonr_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + uint8_t digest[EDONR_MODE / 8]; + EdonRState ctx; + + ASSERT(ctx_template != NULL); + bcopy(ctx_template, &ctx, sizeof (ctx)); + EdonRUpdate(&ctx, buf, size * 8); + EdonRFinal(&ctx, digest); + bcopy(digest, zcp->zc_word, sizeof (zcp->zc_word)); +} + +/* + * Byteswapped zio_checksum interface for the Edon-R hash function. + */ +void +zio_checksum_edonr_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_edonr_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(zcp->zc_word[0]); + zcp->zc_word[1] = BSWAP_64(zcp->zc_word[1]); + zcp->zc_word[2] = BSWAP_64(zcp->zc_word[2]); + zcp->zc_word[3] = BSWAP_64(zcp->zc_word[3]); +} + +void * +zio_checksum_edonr_tmpl_init(const zio_cksum_salt_t *salt) +{ + EdonRState *ctx; + uint8_t salt_block[EDONR_BLOCK_SIZE]; + + /* + * Edon-R needs all but the last hash invocation to be on full-size + * blocks, but the salt is too small. Rather than simply padding it + * with zeros, we expand the salt into a new salt block of proper + * size by double-hashing it (the new salt block will be composed of + * H(salt) || H(H(salt))). + */ + CTASSERT(EDONR_BLOCK_SIZE == 2 * (EDONR_MODE / 8)); + EdonRHash(EDONR_MODE, salt->zcs_bytes, sizeof (salt->zcs_bytes) * 8, + salt_block); + EdonRHash(EDONR_MODE, salt_block, EDONR_MODE, salt_block + + EDONR_MODE / 8); + + /* + * Feed the new salt block into the hash function - this will serve + * as our MAC key. + */ + ctx = kmem_zalloc(sizeof (*ctx), KM_SLEEP); + EdonRInit(ctx, EDONR_MODE); + EdonRUpdate(ctx, salt_block, sizeof (salt_block) * 8); + return (ctx); +} + +void +zio_checksum_edonr_tmpl_free(void *ctx_template) +{ + EdonRState *ctx = ctx_template; + + bzero(ctx, sizeof (*ctx)); + kmem_free(ctx, sizeof (*ctx)); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c Fri Nov 13 09:32:04 2015 (r290757) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ #include #include #ifdef _KERNEL @@ -30,8 +33,10 @@ #include #endif +/*ARGSUSED*/ void -zio_checksum_SHA256(const void *buf, uint64_t size, zio_cksum_t *zcp) +zio_checksum_SHA256(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) { SHA256_CTX ctx; zio_cksum_t tmp; @@ -52,3 +57,31 @@ zio_checksum_SHA256(const void *buf, uin zcp->zc_word[2] = BE_64(tmp.zc_word[2]); zcp->zc_word[3] = BE_64(tmp.zc_word[3]); } + +#ifdef illumos +/*ARGSUSED*/ +void +zio_checksum_SHA512_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + SHA2_CTX ctx; + + SHA2Init(SHA512_256, &ctx); + SHA2Update(&ctx, buf, size); + SHA2Final(zcp, &ctx); +} + +/*ARGSUSED*/ +void +zio_checksum_SHA512_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_SHA512_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); +} +#endif Copied: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c (from r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c Fri Nov 13 09:32:04 2015 (r290757, copy of r289422, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/skein_zfs.c) @@ -0,0 +1,91 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ +#include +#include +#include + +/* + * Computes a native 256-bit skein MAC checksum. Please note that this + * function requires the presence of a ctx_template that should be allocated + * using zio_checksum_skein_tmpl_init. + */ +/*ARGSUSED*/ +void +zio_checksum_skein_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + Skein_512_Ctxt_t ctx; + + ASSERT(ctx_template != NULL); + bcopy(ctx_template, &ctx, sizeof (ctx)); + (void) Skein_512_Update(&ctx, buf, size); + (void) Skein_512_Final(&ctx, (uint8_t *)zcp); + bzero(&ctx, sizeof (ctx)); +} + +/* + * Byteswapped version of zio_checksum_skein_native. This just invokes + * the native checksum function and byteswaps the resulting checksum (since + * skein is internally endian-insensitive). + */ +void +zio_checksum_skein_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_skein_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); +} + +/* + * Allocates a skein MAC template suitable for using in skein MAC checksum + * computations and returns a pointer to it. + */ +void * +zio_checksum_skein_tmpl_init(const zio_cksum_salt_t *salt) +{ + Skein_512_Ctxt_t *ctx; + + ctx = kmem_zalloc(sizeof (*ctx), KM_SLEEP); + (void) Skein_512_InitExt(ctx, sizeof (zio_cksum_t) * 8, 0, + salt->zcs_bytes, sizeof (salt->zcs_bytes)); + return (ctx); +} + +/* + * Frees a skein context template previously allocated using + * zio_checksum_skein_tmpl_init. + */ +void +zio_checksum_skein_tmpl_free(void *ctx_template) +{ + Skein_512_Ctxt_t *ctx = ctx_template; + + bzero(ctx, sizeof (*ctx)); + kmem_free(ctx, sizeof (*ctx)); +} Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Nov 13 09:32:04 2015 (r290757) @@ -25,6 +25,7 @@ * Copyright (c) 2015, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ /* @@ -2579,6 +2580,19 @@ spa_load_impl(spa_t *spa, uint64_t pool_ return (spa_load(spa, state, SPA_IMPORT_EXISTING, B_TRUE)); } + /* Grab the secret checksum salt from the MOS. */ + error = zap_lookup(spa->spa_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes); + if (error == ENOENT) { + /* Generate a new salt for subsequent use */ + (void) random_get_pseudo_bytes(spa->spa_cksum_salt.zcs_bytes, + sizeof (spa->spa_cksum_salt.zcs_bytes)); + } else if (error != 0) { + return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); + } + if (spa_dir_prop(spa, DMU_POOL_SYNC_BPOBJ, &obj) != 0) return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); error = bpobj_open(&spa->spa_deferred_bpobj, spa->spa_meta_objset, obj); @@ -3747,6 +3761,12 @@ spa_create(const char *pool, nvlist_t *n spa_history_create_obj(spa, tx); /* + * Generate some random noise for salted checksums to operate on. + */ + (void) random_get_pseudo_bytes(spa->spa_cksum_salt.zcs_bytes, + sizeof (spa->spa_cksum_salt.zcs_bytes)); + + /* * Set pool properties. */ spa->spa_bootfs = zpool_prop_default_numeric(ZPOOL_PROP_BOOTFS); @@ -6551,6 +6571,20 @@ spa_sync_upgrades(spa_t *spa, dmu_tx_t * if (lz4_en && !lz4_ac) spa_feature_incr(spa, SPA_FEATURE_LZ4_COMPRESS, tx); } + + /* + * If we haven't written the salt, do so now. Note that the + * feature may not be activated yet, but that's fine since + * the presence of this ZAP entry is backwards compatible. + */ + if (zap_contains(spa->spa_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_CHECKSUM_SALT) == ENOENT) { + VERIFY0(zap_add(spa->spa_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes, tx)); + } + rrw_exit(&dp->dp_config_rwlock, FTAG); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Nov 13 09:32:04 2015 (r290757) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ #include @@ -51,7 +52,7 @@ #include #include #include "zfs_prop.h" -#include "zfeature_common.h" +#include /* * SPA locking @@ -608,6 +609,7 @@ spa_add(const char *name, nvlist_t *conf mutex_init(&spa->spa_history_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_proc_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_props_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_cksum_tmpls_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_scrub_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); @@ -770,6 +772,8 @@ spa_remove(spa_t *spa) for (int t = 0; t < TXG_SIZE; t++) bplist_destroy(&spa->spa_free_bplist[t]); + zio_checksum_templates_free(spa); + cv_destroy(&spa->spa_async_cv); cv_destroy(&spa->spa_evicting_os_cv); cv_destroy(&spa->spa_proc_cv); @@ -783,6 +787,7 @@ spa_remove(spa_t *spa) mutex_destroy(&spa->spa_history_lock); mutex_destroy(&spa->spa_proc_lock); mutex_destroy(&spa->spa_props_lock); + mutex_destroy(&spa->spa_cksum_tmpls_lock); mutex_destroy(&spa->spa_scrub_lock); mutex_destroy(&spa->spa_suspend_lock); mutex_destroy(&spa->spa_vdev_top_lock); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Nov 13 09:32:04 2015 (r290757) @@ -27,6 +27,7 @@ * Copyright 2013 DEY Storage Systems, Inc. * Copyright 2014 HybridCluster. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -320,6 +321,7 @@ typedef struct dmu_buf { #define DMU_POOL_FREE_BPOBJ "free_bpobj" #define DMU_POOL_BPTREE_OBJ "bptree_obj" #define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" +#define DMU_POOL_CHECKSUM_SALT "org.illumos:checksum_salt" /* * Allocate an object from this objset. The range of object numbers Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri Nov 13 09:32:04 2015 (r290757) @@ -23,6 +23,7 @@ * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ #ifndef _SYS_SPA_H @@ -163,6 +164,14 @@ typedef struct zio_cksum { } zio_cksum_t; /* + * Some checksums/hashes need a 256-bit initialization salt. This salt is kept + * secret and is suitable for use in MAC algorithms as the key. + */ +typedef struct zio_cksum_salt { + uint8_t zcs_bytes[32]; +} zio_cksum_salt_t; + +/* * Each block is described by its DVAs, time of birth, checksum, etc. * The word-by-word, bit-by-bit layout of the blkptr is as follows: * Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Nov 13 09:32:04 2015 (r290757) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2013 Saso Kiselkov. All rights reserved. */ #ifndef _SYS_SPA_IMPL_H @@ -166,6 +167,10 @@ struct spa { uint64_t spa_syncing_txg; /* txg currently syncing */ bpobj_t spa_deferred_bpobj; /* deferred-free bplist */ bplist_t spa_free_bplist[TXG_SIZE]; /* bplist of stuff to free */ + zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum */ + /* checksum context templates */ + kmutex_t spa_cksum_tmpls_lock; + void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; uberblock_t spa_ubsync; /* last synced uberblock */ uberblock_t spa_uberblock; /* current uberblock */ boolean_t spa_extreme_rewind; /* rewind past deferred frees */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Nov 13 09:32:04 2015 (r290757) @@ -82,6 +82,11 @@ enum zio_checksum { ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, ZIO_CHECKSUM_NOPARITY, +#ifdef illumos + ZIO_CHECKSUM_SHA512, + ZIO_CHECKSUM_SKEIN, + ZIO_CHECKSUM_EDONR, +#endif ZIO_CHECKSUM_FUNCTIONS }; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h Fri Nov 13 09:32:04 2015 (r290757) @@ -20,13 +20,15 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright (c) 2014, 2015 by Delphix. All rights reserved. + * Copyright Saso Kiselkov 2013, All rights reserved. */ #ifndef _SYS_ZIO_CHECKSUM_H #define _SYS_ZIO_CHECKSUM_H #include +#include #ifdef __cplusplus extern "C" { @@ -35,17 +37,34 @@ extern "C" { /* * Signature for checksum functions. */ -typedef void zio_checksum_func_t(const void *, uint64_t, zio_cksum_t *); +typedef void zio_checksum_t(const void *data, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp); +typedef void *zio_checksum_tmpl_init_t(const zio_cksum_salt_t *salt); +typedef void zio_checksum_tmpl_free_t(void *ctx_template); + +typedef enum zio_checksum_flags { + /* Strong enough for metadata? */ + ZCHECKSUM_FLAG_METADATA = (1 << 1), + /* ZIO embedded checksum */ + ZCHECKSUM_FLAG_EMBEDDED = (1 << 2), + /* Strong enough for dedup (without verification)? */ + ZCHECKSUM_FLAG_DEDUP = (1 << 3), + /* Uses salt value */ + ZCHECKSUM_FLAG_SALTED = (1 << 4), + /* Strong enough for nopwrite? */ + ZCHECKSUM_FLAG_NOPWRITE = (1 << 5) +} zio_checksum_flags_t; /* * Information about each checksum function. */ typedef struct zio_checksum_info { - zio_checksum_func_t *ci_func[2]; /* checksum function per byteorder */ - int ci_correctable; /* number of correctable bits */ - int ci_eck; /* uses zio embedded checksum? */ - boolean_t ci_dedup; /* strong enough for dedup? */ - char *ci_name; /* descriptive name */ + /* checksum function for each byteorder */ + zio_checksum_t *ci_func[2]; + zio_checksum_tmpl_init_t *ci_tmpl_init; + zio_checksum_tmpl_free_t *ci_tmpl_free; + zio_checksum_flags_t ci_flags; + char *ci_name; /* descriptive name */ } zio_checksum_info_t; typedef struct zio_bad_cksum { @@ -62,12 +81,30 @@ extern zio_checksum_info_t zio_checksum_ /* * Checksum routines. */ -extern zio_checksum_func_t zio_checksum_SHA256; +extern zio_checksum_t zio_checksum_SHA256; +#ifdef illumos +extern zio_checksum_t zio_checksum_SHA512_native; +extern zio_checksum_t zio_checksum_SHA512_byteswap; + +/* Skein */ +extern zio_checksum_t zio_checksum_skein_native; +extern zio_checksum_t zio_checksum_skein_byteswap; +extern zio_checksum_tmpl_init_t zio_checksum_skein_tmpl_init; +extern zio_checksum_tmpl_free_t zio_checksum_skein_tmpl_free; + +/* Edon-R */ +extern zio_checksum_t zio_checksum_edonr_native; +extern zio_checksum_t zio_checksum_edonr_byteswap; +extern zio_checksum_tmpl_init_t zio_checksum_edonr_tmpl_init; +extern zio_checksum_tmpl_free_t zio_checksum_edonr_tmpl_free; +#endif extern void zio_checksum_compute(zio_t *zio, enum zio_checksum checksum, void *data, uint64_t size); extern int zio_checksum_error(zio_t *zio, zio_bad_cksum_t *out); extern enum zio_checksum spa_dedup_checksum(spa_t *spa); +extern void zio_checksum_templates_free(spa_t *spa); +extern spa_feature_t zio_checksum_to_feature(enum zio_checksum cksum); #ifdef __cplusplus } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:32:04 2015 (r290757) @@ -185,6 +185,7 @@ #include #include #include +#include #include "zfs_namecheck.h" #include "zfs_prop.h" @@ -3902,11 +3903,6 @@ zfs_check_settable(const char *dsname, n return (SET_ERROR(ENOTSUP)); break; - case ZFS_PROP_DEDUP: - if (zfs_earlier_version(dsname, SPA_VERSION_DEDUP)) - return (SET_ERROR(ENOTSUP)); - break; - case ZFS_PROP_RECORDSIZE: /* Record sizes above 128k need the feature to be enabled */ if (nvpair_value_uint64(pair, &intval) == 0 && @@ -3957,6 +3953,45 @@ zfs_check_settable(const char *dsname, n return (SET_ERROR(ENOTSUP)); } break; + + case ZFS_PROP_CHECKSUM: + case ZFS_PROP_DEDUP: + { + spa_feature_t feature; + spa_t *spa; + + /* dedup feature version checks */ + if (prop == ZFS_PROP_DEDUP && + zfs_earlier_version(dsname, SPA_VERSION_DEDUP)) + return (SET_ERROR(ENOTSUP)); + + if (nvpair_value_uint64(pair, &intval) != 0) + return (SET_ERROR(EINVAL)); + + /* check prop value is enabled in features */ + feature = zio_checksum_to_feature(intval); + if (feature == SPA_FEATURE_NONE) + break; + + if ((err = spa_open(dsname, &spa, FTAG)) != 0) + return (err); + /* + * Salted checksums are not supported on root pools. + */ + if (spa_bootfs(spa) != 0 && + intval < ZIO_CHECKSUM_FUNCTIONS && + (zio_checksum_table[intval].ci_flags & + ZCHECKSUM_FLAG_SALTED)) { + spa_close(spa, FTAG); + return (SET_ERROR(ERANGE)); + } + if (!spa_feature_is_enabled(spa, feature)) { + spa_close(spa, FTAG); + return (SET_ERROR(ENOTSUP)); + } + spa_close(spa, FTAG); + break; + } } return (zfs_secpolicy_setprop(dsname, prop, pair, CRED())); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:30:17 2015 (r290756) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:32:04 2015 (r290757) @@ -999,7 +999,7 @@ zio_write_phys(zio_t *pio, vdev_t *vd, u zio->io_prop.zp_checksum = checksum; - if (zio_checksum_table[checksum].ci_eck) { + if (zio_checksum_table[checksum].ci_flags & ZCHECKSUM_FLAG_EMBEDDED) { /* * zec checksums are necessarily destructive -- they modify * the end of the write buffer to hold the verifier/checksum. @@ -1211,8 +1211,8 @@ zio_write_bp_init(zio_t *zio) if (BP_IS_HOLE(bp) || !zp->zp_dedup) return (ZIO_PIPELINE_CONTINUE); - ASSERT(zio_checksum_table[zp->zp_checksum].ci_dedup || - zp->zp_dedup_verify); + ASSERT((zio_checksum_table[zp->zp_checksum].ci_flags & + ZCHECKSUM_FLAG_DEDUP) || zp->zp_dedup_verify); if (BP_GET_CHECKSUM(bp) == zp->zp_checksum) { BP_SET_DEDUP(bp, 1); @@ -2074,12 +2074,22 @@ zio_write_gang_block(zio_t *pio) } /* - * The zio_nop_write stage in the pipeline determines if allocating - * a new bp is necessary. By leveraging a cryptographically secure checksum, - * such as SHA256, we can compare the checksums of the new data and the old - * to determine if allocating a new block is required. The nopwrite - * feature can handle writes in either syncing or open context (i.e. zil - * writes) and as a result is mutually exclusive with dedup. + * The zio_nop_write stage in the pipeline determines if allocating a + * new bp is necessary. The nopwrite feature can handle writes in + * either syncing or open context (i.e. zil writes) and as a result is + * mutually exclusive with dedup. + * + * By leveraging a cryptographically secure checksum, such as SHA256, we + * can compare the checksums of the new data and the old to determine if + * allocating a new block is required. Note that our requirements for + * cryptographic strength are fairly weak: there can't be any accidental + * hash collisions, but we don't need to be secure against intentional + * (malicious) collisions. To trigger a nopwrite, you have to be able + * to write the file to begin with, and triggering an incorrect (hash + * collision) nopwrite is no worse than simply writing to the file. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Nov 13 09:39:57 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D91DA2CF36; Fri, 13 Nov 2015 09:39: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 CDABB1377; Fri, 13 Nov 2015 09:39:56 +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 tAD9duXi013814; Fri, 13 Nov 2015 09:39:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9dt0S013809; Fri, 13 Nov 2015 09:39:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130939.tAD9dt0S013809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290758 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:39:57 -0000 Author: mav Date: Fri Nov 13 09:39:55 2015 New Revision: 290758 URL: https://svnweb.freebsd.org/changeset/base/290758 Log: MFC r289497: 5745 zfs set allows only one dataset property to be set at a time Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Bayard Bell Reviewed by: Richard PALO Reviewed by: Steven Hartland Approved by: Rich Lowe Author: Chris Williamson illumos/illumos-gate@30925561c223021e91d15899cbe75f80e54d8889 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 13 09:39:55 2015 (r290758) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2014 by Delphix. All rights reserved. +.\" Copyright (c) 2011, 2014 by Delphix. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery @@ -117,7 +117,7 @@ .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm set -.Ar property Ns = Ns Ar value +.Ar property Ns = Ns Ar value Oc ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... .Nm .Cm get @@ -2121,14 +2121,14 @@ option, but sorts by property in descend .It Xo .Nm .Cm set -.Ar property Ns = Ns Ar value +.Ar property Ns = Ns Ar value Oc ... .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc .Pp -Sets the property to the given value for each dataset. Only some properties can -be edited. See the "Properties" section for more information on what properties -can be set and acceptable values. Numeric values can be specified as exact -values, or in a human-readable form with a suffix of +Sets the property or list of properties to the given value(s) for each dataset. +Only some properties can be edited. See the "Properties" section for more +information on what properties can be set and acceptable values. Numeric values +can be specified as exact values, or in a human-readable form with a suffix of .Sy B , K , M , G , T , P , E , Z (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). User properties can be set on snapshots. For more Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:39:55 2015 (r290758) @@ -283,7 +283,7 @@ get_usage(zfs_help_t idx) "\n" "\tsend [-nvPe] -t \n")); case HELP_SET: - return (gettext("\tset " + return (gettext("\tset ... " " ...\n")); case HELP_SHARE: return (gettext("\tshare <-a | filesystem>\n")); @@ -498,6 +498,10 @@ usage(boolean_t requested) exit(requested ? 0 : 2); } +/* + * Take a property=value argument string and add it to the given nvlist. + * Modifies the argument inplace. + */ static int parseprop(nvlist_t *props, char *propname) { @@ -505,7 +509,7 @@ parseprop(nvlist_t *props, char *propnam if ((propval = strchr(propname, '=')) == NULL) { (void) fprintf(stderr, gettext("missing " - "'=' for -o option\n")); + "'=' for property=value argument\n")); return (-1); } *propval = '\0'; @@ -632,7 +636,7 @@ zfs_do_clone(int argc, char **argv) while ((c = getopt(argc, argv, "o:p")) != -1) { switch (c) { case 'o': - if (parseprop(props, optarg)) + if (parseprop(props, optarg) != 0) return (1); break; case 'p': @@ -3532,21 +3536,17 @@ out: } /* - * zfs set property=value { fs | snap | vol } ... + * zfs set property=value ... { fs | snap | vol } ... * - * Sets the given property for all datasets specified on the command line. + * Sets the given properties for all datasets specified on the command line. */ -typedef struct set_cbdata { - char *cb_propname; - char *cb_value; -} set_cbdata_t; static int set_callback(zfs_handle_t *zhp, void *data) { - set_cbdata_t *cbp = data; + nvlist_t *props = data; - if (zfs_prop_set(zhp, cbp->cb_propname, cbp->cb_value) != 0) { + if (zfs_prop_set_list(zhp, props) != 0) { switch (libzfs_errno(g_zfs)) { case EZFS_MOUNTFAILED: (void) fprintf(stderr, gettext("property may be set " @@ -3565,7 +3565,8 @@ set_callback(zfs_handle_t *zhp, void *da static int zfs_do_set(int argc, char **argv) { - set_cbdata_t cb; + nvlist_t *props = NULL; + int ds_start = -1; /* argv idx of first dataset arg */ int ret = 0; /* check for options */ @@ -3577,36 +3578,51 @@ zfs_do_set(int argc, char **argv) /* check number of arguments */ if (argc < 2) { - (void) fprintf(stderr, gettext("missing property=value " - "argument\n")); + (void) fprintf(stderr, gettext("missing arguments\n")); usage(B_FALSE); } if (argc < 3) { - (void) fprintf(stderr, gettext("missing dataset name\n")); + if (strchr(argv[1], '=') == NULL) { + (void) fprintf(stderr, gettext("missing property=value " + "argument(s)\n")); + } else { + (void) fprintf(stderr, gettext("missing dataset " + "name(s)\n")); + } usage(B_FALSE); } - /* validate property=value argument */ - cb.cb_propname = argv[1]; - if (((cb.cb_value = strchr(cb.cb_propname, '=')) == NULL) || - (cb.cb_value[1] == '\0')) { - (void) fprintf(stderr, gettext("missing value in " - "property=value argument\n")); + /* validate argument order: prop=val args followed by dataset args */ + for (int i = 1; i < argc; i++) { + if (strchr(argv[i], '=') != NULL) { + if (ds_start > 0) { + /* out-of-order prop=val argument */ + (void) fprintf(stderr, gettext("invalid " + "argument order\n"), i); + usage(B_FALSE); + } + } else if (ds_start < 0) { + ds_start = i; + } + } + if (ds_start < 0) { + (void) fprintf(stderr, gettext("missing dataset name(s)\n")); usage(B_FALSE); } - *cb.cb_value = '\0'; - cb.cb_value++; - - if (*cb.cb_propname == '\0') { - (void) fprintf(stderr, - gettext("missing property in property=value argument\n")); - usage(B_FALSE); + /* Populate a list of property settings */ + if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) + nomem(); + for (int i = 1; i < ds_start; i++) { + if ((ret = parseprop(props, argv[i])) != 0) + goto error; } - ret = zfs_for_each(argc - 2, argv + 2, 0, - ZFS_TYPE_DATASET, NULL, NULL, 0, set_callback, &cb); + ret = zfs_for_each(argc - ds_start, argv + ds_start, 0, + ZFS_TYPE_DATASET, NULL, NULL, 0, set_callback, props); +error: + nvlist_free(props); return (ret); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:39:55 2015 (r290758) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -430,6 +430,7 @@ extern nvlist_t *zfs_valid_proplist(libz extern const char *zfs_prop_to_name(zfs_prop_t); extern int zfs_prop_set(zfs_handle_t *, const char *, const char *); +extern int zfs_prop_set_list(zfs_handle_t *, nvlist_t *); extern int zfs_prop_get(zfs_handle_t *, zfs_prop_t, char *, size_t, zprop_source_t *, char *, size_t, boolean_t); extern int zfs_prop_get_recvd(zfs_handle_t *, const char *, char *, size_t, Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:39:55 2015 (r290758) @@ -1528,15 +1528,10 @@ zfs_setprop_error(libzfs_handle_t *hdl, int zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval) { - zfs_cmd_t zc = { 0 }; int ret = -1; - prop_changelist_t *cl = NULL; char errbuf[1024]; libzfs_handle_t *hdl = zhp->zfs_hdl; - nvlist_t *nvl = NULL, *realprops; - zfs_prop_t prop; - boolean_t do_prefix = B_TRUE; - int added_resv; + nvlist_t *nvl = NULL; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot set property for '%s'"), @@ -1548,79 +1543,148 @@ zfs_prop_set(zfs_handle_t *zhp, const ch goto error; } - if ((realprops = zfs_valid_proplist(hdl, zhp->zfs_type, nvl, - zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL) - goto error; + ret = zfs_prop_set_list(zhp, nvl); +error: nvlist_free(nvl); - nvl = realprops; + return (ret); +} - prop = zfs_name_to_prop(propname); - /* We don't support those properties on FreeBSD. */ - switch (prop) { - case ZFS_PROP_DEVICES: - case ZFS_PROP_ISCSIOPTIONS: - case ZFS_PROP_XATTR: - case ZFS_PROP_VSCAN: - case ZFS_PROP_NBMAND: - case ZFS_PROP_MLSLABEL: - (void) snprintf(errbuf, sizeof (errbuf), - "property '%s' not supported on FreeBSD", propname); - ret = zfs_error(hdl, EZFS_PERM, errbuf); - goto error; - } - if (prop == ZFS_PROP_VOLSIZE) { - if ((added_resv = zfs_add_synthetic_resv(zhp, nvl)) == -1) - goto error; - } +/* + * Given an nvlist of property names and values, set the properties for the + * given dataset. + */ +int +zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props) +{ + zfs_cmd_t zc = { 0 }; + int ret = -1; + prop_changelist_t **cls = NULL; + int cl_idx; + char errbuf[1024]; + libzfs_handle_t *hdl = zhp->zfs_hdl; + nvlist_t *nvl; + int nvl_len; + int added_resv; - if ((cl = changelist_gather(zhp, prop, 0, 0)) == NULL) - goto error; + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, "cannot set property for '%s'"), + zhp->zfs_name); - if (prop == ZFS_PROP_MOUNTPOINT && changelist_haszonedchild(cl)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "child dataset with inherited mountpoint is used " - "in a non-global zone")); - ret = zfs_error(hdl, EZFS_ZONED, errbuf); + if ((nvl = zfs_valid_proplist(hdl, zhp->zfs_type, props, + zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL) goto error; - } /* - * We don't want to unmount & remount the dataset when changing - * its canmount property to 'on' or 'noauto'. We only use - * the changelist logic to unmount when setting canmount=off. - */ - if (prop == ZFS_PROP_CANMOUNT) { - uint64_t idx; - int err = zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET); - if (err == 0 && idx != ZFS_CANMOUNT_OFF) - do_prefix = B_FALSE; + * We have to check for any extra properties which need to be added + * before computing the length of the nvlist. + */ + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) { + if (zfs_name_to_prop(nvpair_name(elem)) == ZFS_PROP_VOLSIZE && + (added_resv = zfs_add_synthetic_resv(zhp, nvl)) == -1) { + goto error; + } } - - if (do_prefix && (ret = changelist_prefix(cl)) != 0) + /* + * Check how many properties we're setting and allocate an array to + * store changelist pointers for postfix(). + */ + nvl_len = 0; + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) + nvl_len++; + if ((cls = calloc(nvl_len, sizeof (prop_changelist_t *))) == NULL) goto error; + cl_idx = 0; + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) { + + zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem)); + + assert(cl_idx < nvl_len); + /* + * We don't want to unmount & remount the dataset when changing + * its canmount property to 'on' or 'noauto'. We only use + * the changelist logic to unmount when setting canmount=off. + */ + if (!(prop == ZFS_PROP_CANMOUNT && + fnvpair_value_uint64(elem) != ZFS_CANMOUNT_OFF)) { + cls[cl_idx] = changelist_gather(zhp, prop, 0, 0); + if (cls[cl_idx] == NULL) + goto error; + } + + if (prop == ZFS_PROP_MOUNTPOINT && + changelist_haszonedchild(cls[cl_idx])) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "child dataset with inherited mountpoint is used " + "in a non-global zone")); + ret = zfs_error(hdl, EZFS_ZONED, errbuf); + goto error; + } + + /* We don't support those properties on FreeBSD. */ + switch (prop) { + case ZFS_PROP_DEVICES: + case ZFS_PROP_ISCSIOPTIONS: + case ZFS_PROP_XATTR: + case ZFS_PROP_VSCAN: + case ZFS_PROP_NBMAND: + case ZFS_PROP_MLSLABEL: + (void) snprintf(errbuf, sizeof (errbuf), + "property '%s' not supported on FreeBSD", + nvpair_name(elem)); + ret = zfs_error(hdl, EZFS_PERM, errbuf); + goto error; + } + + if (cls[cl_idx] != NULL && + (ret = changelist_prefix(cls[cl_idx])) != 0) + goto error; + + cl_idx++; + } + assert(cl_idx == nvl_len); + /* - * Execute the corresponding ioctl() to set this property. + * Execute the corresponding ioctl() to set this list of properties. */ (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - if (zcmd_write_src_nvlist(hdl, &zc, nvl) != 0) + if ((ret = zcmd_write_src_nvlist(hdl, &zc, nvl)) != 0 || + (ret = zcmd_alloc_dst_nvlist(hdl, &zc, 0)) != 0) goto error; ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc); if (ret != 0) { - zfs_setprop_error(hdl, prop, errno, errbuf); + /* Get the list of unset properties back and report them. */ + nvlist_t *errorprops = NULL; + if (zcmd_read_dst_nvlist(hdl, &zc, &errorprops) != 0) + goto error; + for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL); + elem != NULL; + elem = nvlist_next_nvpair(nvl, elem)) { + zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem)); + zfs_setprop_error(hdl, prop, errno, errbuf); + } + nvlist_free(errorprops); + if (added_resv && errno == ENOSPC) { /* clean up the volsize property we tried to set */ uint64_t old_volsize = zfs_prop_get_int(zhp, ZFS_PROP_VOLSIZE); nvlist_free(nvl); + nvl = NULL; zcmd_free_nvlists(&zc); + if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0) goto error; if (nvlist_add_uint64(nvl, @@ -1632,8 +1696,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch (void) zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc); } } else { - if (do_prefix) - ret = changelist_postfix(cl); + for (cl_idx = 0; cl_idx < nvl_len; cl_idx++) { + if (cls[cl_idx] != NULL) { + int clp_err = changelist_postfix(cls[cl_idx]); + if (clp_err != 0) + ret = clp_err; + } + } /* * Refresh the statistics so the new property value @@ -1646,8 +1715,13 @@ zfs_prop_set(zfs_handle_t *zhp, const ch error: nvlist_free(nvl); zcmd_free_nvlists(&zc); - if (cl) - changelist_free(cl); + if (cls != NULL) { + for (cl_idx = 0; cl_idx < nvl_len; cl_idx++) { + if (cls[cl_idx] != NULL) + changelist_free(cls[cl_idx]); + } + free(cls); + } return (ret); } @@ -4197,7 +4271,7 @@ zfs_smb_acl_mgmt(libzfs_handle_t *hdl, c if (cmd == ZFS_SMB_ACL_RENAME) { if (nvlist_alloc(&nvlist, NV_UNIQUE_NAME, 0) != 0) { (void) no_memory(hdl); - return (NULL); + return (0); } } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:32:04 2015 (r290757) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:39:55 2015 (r290758) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ /* @@ -782,8 +782,9 @@ zcmd_alloc_dst_nvlist(libzfs_handle_t *h if (len == 0) len = 16 * 1024; zc->zc_nvlist_dst_size = len; - if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t) - zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == 0) + zc->zc_nvlist_dst = + (uint64_t)(uintptr_t)zfs_alloc(hdl, zc->zc_nvlist_dst_size); + if (zc->zc_nvlist_dst == 0) return (-1); return (0); @@ -798,9 +799,9 @@ int zcmd_expand_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc) { free((void *)(uintptr_t)zc->zc_nvlist_dst); - if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t) - zfs_alloc(hdl, zc->zc_nvlist_dst_size)) - == 0) + zc->zc_nvlist_dst = + (uint64_t)(uintptr_t)zfs_alloc(hdl, zc->zc_nvlist_dst_size); + if (zc->zc_nvlist_dst == 0) return (-1); return (0); @@ -815,6 +816,9 @@ zcmd_free_nvlists(zfs_cmd_t *zc) free((void *)(uintptr_t)zc->zc_nvlist_conf); free((void *)(uintptr_t)zc->zc_nvlist_src); free((void *)(uintptr_t)zc->zc_nvlist_dst); + zc->zc_nvlist_conf = NULL; + zc->zc_nvlist_src = NULL; + zc->zc_nvlist_dst = NULL; } static int From owner-svn-src-stable@freebsd.org Fri Nov 13 09:41:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05691A2D1B9; Fri, 13 Nov 2015 09:41:36 +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 D1AD4182F; Fri, 13 Nov 2015 09:41:35 +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 tAD9fY8I015876; Fri, 13 Nov 2015 09:41:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9fYWT015874; Fri, 13 Nov 2015 09:41:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130941.tAD9fYWT015874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290759 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:41:36 -0000 Author: mav Date: Fri Nov 13 09:41:34 2015 New Revision: 290759 URL: https://svnweb.freebsd.org/changeset/base/290759 Log: MFC r289499: Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13967:92bec6d87f59 Illumos ZFS issues: 3557 dumpvp_size is not updated correctly when a dump zvol's size is changed 3558 setting the volsize on a dump device does not return back ENOSPC 3559 setting a volsize larger than the space available sometimes succeeds Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:39:55 2015 (r290758) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:41:34 2015 (r290759) @@ -845,10 +845,12 @@ zfs_do_create(int argc, char **argv) if (type == ZFS_TYPE_VOLUME && !noreserve) { zpool_handle_t *zpool_handle; + nvlist_t *real_props; uint64_t spa_version; char *p; zfs_prop_t resv_prop; char *strval; + char msg[1024]; if (p = strchr(argv[0], '/')) *p = '\0'; @@ -864,7 +866,15 @@ zfs_do_create(int argc, char **argv) resv_prop = ZFS_PROP_REFRESERVATION; else resv_prop = ZFS_PROP_RESERVATION; - volsize = zvol_volsize_to_reservation(volsize, props); + + (void) snprintf(msg, sizeof (msg), + gettext("cannot create '%s'"), argv[0]); + if (props && (real_props = zfs_valid_proplist(g_zfs, type, + props, 0, NULL, msg)) == NULL) + goto error; + + volsize = zvol_volsize_to_reservation(volsize, real_props); + nvlist_free(real_props); if (nvlist_lookup_string(props, zfs_prop_to_name(resv_prop), &strval) != 0) { Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:39:55 2015 (r290758) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:41:34 2015 (r290759) @@ -1403,6 +1403,7 @@ zfs_add_synthetic_resv(zfs_handle_t *zhp uint64_t old_reservation; uint64_t new_reservation; zfs_prop_t resv_prop; + nvlist_t *props; /* * If this is an existing volume, and someone is setting the volsize, @@ -1412,16 +1413,25 @@ zfs_add_synthetic_resv(zfs_handle_t *zhp if (zfs_which_resv_prop(zhp, &resv_prop) < 0) return (-1); old_reservation = zfs_prop_get_int(zhp, resv_prop); - if ((zvol_volsize_to_reservation(old_volsize, zhp->zfs_props) != - old_reservation) || nvlist_lookup_uint64(nvl, - zfs_prop_to_name(resv_prop), &new_reservation) != ENOENT) { + + props = fnvlist_alloc(); + fnvlist_add_uint64(props, zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), + zfs_prop_get_int(zhp, ZFS_PROP_VOLBLOCKSIZE)); + + if ((zvol_volsize_to_reservation(old_volsize, props) != + old_reservation) || nvlist_exists(nvl, + zfs_prop_to_name(resv_prop))) { + fnvlist_free(props); return (0); } if (nvlist_lookup_uint64(nvl, zfs_prop_to_name(ZFS_PROP_VOLSIZE), - &new_volsize) != 0) + &new_volsize) != 0) { + fnvlist_free(props); return (-1); - new_reservation = zvol_volsize_to_reservation(new_volsize, - zhp->zfs_props); + } + new_reservation = zvol_volsize_to_reservation(new_volsize, props); + fnvlist_free(props); + if (nvlist_add_uint64(nvl, zfs_prop_to_name(resv_prop), new_reservation) != 0) { (void) no_memory(zhp->zfs_hdl); From owner-svn-src-stable@freebsd.org Fri Nov 13 09:43:01 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B910A2D301; Fri, 13 Nov 2015 09:43: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 137D11A36; Fri, 13 Nov 2015 09:43:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9h0G4016595; Fri, 13 Nov 2015 09:43:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9gxfY016587; Fri, 13 Nov 2015 09:42:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130942.tAD9gxfY016587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290760 - in stable/10/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:43:01 -0000 Author: mav Date: Fri Nov 13 09:42:59 2015 New Revision: 290760 URL: https://svnweb.freebsd.org/changeset/base/290760 Log: MFC r289500: 6298 zfs_create_008_neg and zpool_create_023_neg need to be updated for large block support. Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Approved by: Robert Mustacchi Author: Joe Stein illumos/illumos-gate@e9316f7696401f3e5e263a5939031cb8d5641a88 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:42:59 2015 (r290760) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . @@ -861,7 +861,6 @@ zfs_do_create(int argc, char **argv) goto error; spa_version = zpool_get_prop_int(zpool_handle, ZPOOL_PROP_VERSION, NULL); - zpool_close(zpool_handle); if (spa_version >= SPA_VERSION_REFRESERVATION) resv_prop = ZFS_PROP_REFRESERVATION; else @@ -870,8 +869,11 @@ zfs_do_create(int argc, char **argv) (void) snprintf(msg, sizeof (msg), gettext("cannot create '%s'"), argv[0]); if (props && (real_props = zfs_valid_proplist(g_zfs, type, - props, 0, NULL, msg)) == NULL) + props, 0, NULL, zpool_handle, msg)) == NULL) { + zpool_close(zpool_handle); goto error; + } + zpool_close(zpool_handle); volsize = zvol_volsize_to_reservation(volsize, real_props); nvlist_free(real_props); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Nov 13 09:42:59 2015 (r290760) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -426,7 +426,7 @@ extern const char *zfs_prop_column_name( extern boolean_t zfs_prop_align_right(zfs_prop_t); extern nvlist_t *zfs_valid_proplist(libzfs_handle_t *, zfs_type_t, - nvlist_t *, uint64_t, zfs_handle_t *, const char *); + nvlist_t *, uint64_t, zfs_handle_t *, zpool_handle_t *, const char *); extern const char *zfs_prop_to_name(zfs_prop_t); extern int zfs_prop_set(zfs_handle_t *, const char *, const char *); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Nov 13 09:42:59 2015 (r290760) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. @@ -890,7 +890,8 @@ zfs_which_resv_prop(zfs_handle_t *zhp, z */ nvlist_t * zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, - uint64_t zoned, zfs_handle_t *zhp, const char *errbuf) + uint64_t zoned, zfs_handle_t *zhp, zpool_handle_t *zpool_hdl, + const char *errbuf) { nvpair_t *elem; uint64_t intval; @@ -1084,8 +1085,8 @@ zfs_valid_proplist(libzfs_handle_t *hdl, case ZFS_PROP_RECORDSIZE: { int maxbs = SPA_MAXBLOCKSIZE; - if (zhp != NULL) { - maxbs = zpool_get_prop_int(zhp->zpool_hdl, + if (zpool_hdl != NULL) { + maxbs = zpool_get_prop_int(zpool_hdl, ZPOOL_PROP_MAXBLOCKSIZE, NULL); } /* @@ -1584,7 +1585,8 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl zhp->zfs_name); if ((nvl = zfs_valid_proplist(hdl, zhp->zfs_type, props, - zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL) + zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, zhp->zpool_hdl, + errbuf)) == NULL) goto error; /* @@ -3248,9 +3250,23 @@ zfs_create(libzfs_handle_t *hdl, const c else ost = DMU_OST_ZFS; + /* open zpool handle for prop validation */ + char pool_path[MAXNAMELEN]; + (void) strlcpy(pool_path, path, sizeof (pool_path)); + + /* truncate pool_path at first slash */ + char *p = strchr(pool_path, '/'); + if (p != NULL) + *p = '\0'; + + zpool_handle_t *zpool_handle = zpool_open(hdl, pool_path); + if (props && (props = zfs_valid_proplist(hdl, type, props, - zoned, NULL, errbuf)) == 0) + zoned, NULL, zpool_handle, errbuf)) == 0) { + zpool_close(zpool_handle); return (-1); + } + zpool_close(zpool_handle); if (type == ZFS_TYPE_VOLUME) { /* @@ -3318,13 +3334,6 @@ zfs_create(libzfs_handle_t *hdl, const c "parent '%s' is not a filesystem"), parent); return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); - case EDOM: - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "volume block size must be power of 2 from " - "512B to 128KB")); - - return (zfs_error(hdl, EZFS_BADPROP, errbuf)); - case ENOTSUP: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "pool must be upgraded to set this " @@ -3519,7 +3528,7 @@ zfs_clone(zfs_handle_t *zhp, const char type = ZFS_TYPE_FILESYSTEM; } if ((props = zfs_valid_proplist(hdl, type, props, zoned, - zhp, errbuf)) == NULL) + zhp, zhp->zpool_hdl, errbuf)) == NULL) return (-1); } @@ -3663,11 +3672,23 @@ zfs_snapshot_nvl(libzfs_handle_t *hdl, n } } + /* + * get pool handle for prop validation. assumes all snaps are in the + * same pool, as does lzc_snapshot (below). + */ + char pool[MAXNAMELEN]; + elem = nvlist_next_nvpair(snaps, NULL); + (void) strlcpy(pool, nvpair_name(elem), sizeof (pool)); + pool[strcspn(pool, "/@")] = '\0'; + zpool_handle_t *zpool_hdl = zpool_open(hdl, pool); + if (props != NULL && (props = zfs_valid_proplist(hdl, ZFS_TYPE_SNAPSHOT, - props, B_FALSE, NULL, errbuf)) == NULL) { + props, B_FALSE, NULL, zpool_hdl, errbuf)) == NULL) { + zpool_close(zpool_hdl); return (-1); } + zpool_close(zpool_hdl); ret = lzc_snapshot(snaps, props, &errors); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:41:34 2015 (r290759) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:42:59 2015 (r290760) @@ -1164,8 +1164,8 @@ zpool_create(libzfs_handle_t *hdl, const zfs_prop_to_name(ZFS_PROP_ZONED), &zonestr) == 0) && strcmp(zonestr, "on") == 0); - if ((zc_fsprops = zfs_valid_proplist(hdl, - ZFS_TYPE_FILESYSTEM, fsprops, zoned, NULL, msg)) == NULL) { + if ((zc_fsprops = zfs_valid_proplist(hdl, ZFS_TYPE_FILESYSTEM, + fsprops, zoned, NULL, NULL, msg)) == NULL) { goto create_failed; } if (!zc_props && @@ -1201,6 +1201,21 @@ zpool_create(libzfs_handle_t *hdl, const "one or more vdevs refer to the same device")); return (zfs_error(hdl, EZFS_BADDEV, msg)); + case ERANGE: + /* + * This happens if the record size is smaller or larger + * than the allowed size range, or not a power of 2. + * + * NOTE: although zfs_valid_proplist is called earlier, + * this case may have slipped through since the + * pool does not exist yet and it is therefore + * impossible to read properties e.g. max blocksize + * from the pool. + */ + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "record size invalid")); + return (zfs_error(hdl, EZFS_BADPROP, msg)); + case EOVERFLOW: /* * This occurs when one of the devices is below From owner-svn-src-stable@freebsd.org Fri Nov 13 09:45:34 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDE6FA2D38F; Fri, 13 Nov 2015 09:45:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E34E1BF2; Fri, 13 Nov 2015 09:45:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9jXi2016744; Fri, 13 Nov 2015 09:45:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9jXKn016742; Fri, 13 Nov 2015 09:45:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130945.tAD9jXKn016742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290761 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:45:34 -0000 Author: mav Date: Fri Nov 13 09:45:33 2015 New Revision: 290761 URL: https://svnweb.freebsd.org/changeset/base/290761 Log: MFC r289527: 5561 support root pools on EFI/GPT partitioned disks 5125 update zpool/libzfs to manage bootable whole disk pools (EFI/GPT labeled disks) Reviewed by: Jean McCormack Reviewed by: Josef 'Jeff' Sipek Approved by: Dan McDonald Author: Hans Rosenfeld illumos/illumos-gate@1a902ef8628b0dffd6df5442354ab59bb8530962 This is NOP changes for FreeBSD. Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:42:59 2015 (r290760) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:45:33 2015 (r290761) @@ -402,29 +402,6 @@ bootfs_name_valid(const char *pool, char return (B_FALSE); } -/* - * Inspect the configuration to determine if any of the devices contain - * an EFI label. - */ -static boolean_t -pool_uses_efi(nvlist_t *config) -{ -#ifdef sun - nvlist_t **child; - uint_t c, children; - - if (nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN, - &child, &children) != 0) - return (read_efi_label(config, NULL) >= 0); - - for (c = 0; c < children; c++) { - if (pool_uses_efi(child[c])) - return (B_TRUE); - } -#endif /* sun */ - return (B_FALSE); -} - boolean_t zpool_is_bootable(zpool_handle_t *zhp) { @@ -453,7 +430,6 @@ zpool_valid_proplist(libzfs_handle_t *hd char *slash, *check; struct stat64 statbuf; zpool_handle_t *zhp; - nvlist_t *nvroot; if (nvlist_alloc(&retprops, NV_UNIQUE_NAME, 0) != 0) { (void) no_memory(hdl); @@ -572,23 +548,6 @@ zpool_valid_proplist(libzfs_handle_t *hd (void) zfs_error(hdl, EZFS_OPENFAILED, errbuf); goto error; } - verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL), - ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); - -#ifdef sun - /* - * bootfs property cannot be set on a disk which has - * been EFI labeled. - */ - if (pool_uses_efi(nvroot)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "property '%s' not supported on " - "EFI labeled devices"), propname); - (void) zfs_error(hdl, EZFS_POOL_NOTSUP, errbuf); - zpool_close(zhp); - goto error; - } -#endif /* sun */ zpool_close(zhp); break; @@ -1326,25 +1285,6 @@ zpool_add(zpool_handle_t *zhp, nvlist_t return (zfs_error(hdl, EZFS_BADVERSION, msg)); } - if (zpool_is_bootable(zhp) && nvlist_lookup_nvlist_array(nvroot, - ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0) { - uint64_t s; - - for (s = 0; s < nspares; s++) { - char *path; - - if (nvlist_lookup_string(spares[s], ZPOOL_CONFIG_PATH, - &path) == 0 && pool_uses_efi(spares[s])) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "device '%s' contains an EFI label and " - "cannot be used on root pools."), - zpool_vdev_name(hdl, NULL, spares[s], - B_FALSE)); - return (zfs_error(hdl, EZFS_POOL_NOTSUP, msg)); - } - } - } - if (zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL) < SPA_VERSION_L2CACHE && nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE, @@ -2365,11 +2305,9 @@ zpool_get_config_physpath(nvlist_t *conf return (EZFS_INVALCONFIG); /* - * root pool can not have EFI labeled disks and can only have - * a single top-level vdev. + * root pool can only have a single top-level vdev. */ - if (strcmp(type, VDEV_TYPE_ROOT) != 0 || count != 1 || - pool_uses_efi(vdev_root)) + if (strcmp(type, VDEV_TYPE_ROOT) != 0 || count != 1) return (EZFS_POOL_INVALARG); (void) vdev_get_physpaths(child[0], physpath, phypath_size, &rsz, @@ -2673,16 +2611,6 @@ zpool_vdev_attach(zpool_handle_t *zhp, (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, "cannot attach %s to %s"), new_disk, old_disk); - /* - * If this is a root pool, make sure that we're not attaching an - * EFI labeled device. - */ - if (rootpool && pool_uses_efi(nvroot)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "EFI labeled devices are not supported on root pools.")); - return (zfs_error(hdl, EZFS_POOL_NOTSUP, msg)); - } - (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); if ((tgt = zpool_find_vdev(zhp, old_disk, &avail_spare, &l2cache, &islog)) == 0) @@ -3996,13 +3924,6 @@ zpool_label_disk(libzfs_handle_t *hdl, z if (zhp) { nvlist_t *nvroot; - if (zpool_is_bootable(zhp)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "EFI labeled devices are not supported on root " - "pools.")); - return (zfs_error(hdl, EZFS_POOL_NOTSUP, errbuf)); - } - verify(nvlist_lookup_nvlist(zhp->zpool_config, ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:42:59 2015 (r290760) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Nov 13 09:45:33 2015 (r290761) @@ -3412,8 +3412,6 @@ vdev_is_bootable(vdev_t *vd) strcmp(vdev_type, VDEV_TYPE_MISSING) == 0) { return (B_FALSE); } - } else if (vd->vdev_wholedisk == 1) { - return (B_FALSE); } for (int c = 0; c < vd->vdev_children; c++) { From owner-svn-src-stable@freebsd.org Fri Nov 13 09:46:30 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1570AA2D455; Fri, 13 Nov 2015 09:46:30 +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 B7AE31D53; Fri, 13 Nov 2015 09:46:29 +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 tAD9kS2e016828; Fri, 13 Nov 2015 09:46:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9kSR8016827; Fri, 13 Nov 2015 09:46:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130946.tAD9kSR8016827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290762 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:46:30 -0000 Author: mav Date: Fri Nov 13 09:46:28 2015 New Revision: 290762 URL: https://svnweb.freebsd.org/changeset/base/290762 Log: MFC r289528: Reduce diff from upstream. Should be no functional change. Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:45:33 2015 (r290761) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:46:28 2015 (r290762) @@ -3729,17 +3729,18 @@ zpool_history_unpack(char *buf, uint64_t int zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) { - char *buf = NULL; - uint64_t bufsize = HIS_BUF_LEN_DEF; + char *buf; + uint64_t buflen = HIS_BUF_LEN_DEF; uint64_t off = 0; nvlist_t **records = NULL; uint_t numrecords = 0; int err, i; - if ((buf = malloc(bufsize)) == NULL) + buf = malloc(buflen); + if (buf == NULL) return (ENOMEM); do { - uint64_t bytes_read = bufsize; + uint64_t bytes_read = buflen; uint64_t leftover; if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0) @@ -3753,18 +3754,16 @@ zpool_get_history(zpool_handle_t *zhp, n &leftover, &records, &numrecords)) != 0) break; off -= leftover; - - /* - * If the history block is too big, double the buffer - * size and try again. - */ if (leftover == bytes_read) { + /* + * no progress made, because buffer is not big enough + * to hold this record; resize and retry. + */ + buflen *= 2; free(buf); buf = NULL; - - bufsize <<= 1; - if ((bufsize >= HIS_BUF_LEN_MAX) || - ((buf = malloc(bufsize)) == NULL)) { + if ((buflen >= HIS_BUF_LEN_MAX) || + ((buf = malloc(buflen)) == NULL)) { err = ENOMEM; break; } @@ -3772,6 +3771,7 @@ zpool_get_history(zpool_handle_t *zhp, n /* CONSTCOND */ } while (1); + free(buf); if (!err) { From owner-svn-src-stable@freebsd.org Fri Nov 13 09:47:39 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4501EA2D51F; Fri, 13 Nov 2015 09:47: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 0C01A1EB0; Fri, 13 Nov 2015 09:47: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 tAD9lcEA016920; Fri, 13 Nov 2015 09:47:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9lcXT016919; Fri, 13 Nov 2015 09:47:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130947.tAD9lcXT016919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290763 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:47:39 -0000 Author: mav Date: Fri Nov 13 09:47:37 2015 New Revision: 290763 URL: https://svnweb.freebsd.org/changeset/base/290763 Log: MFC r289531: 5847 libzfs_diff should check zfs_prop_get() return Reviewed by: Matthew Ahrens Reviewed by: Albert Lee Approved by: Dan McDonald Author: Alexander Eremin illumos/illumos-gate@8430278980a48338e04c7dd52b495b7f1551367a Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Fri Nov 13 09:46:28 2015 (r290762) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Fri Nov 13 09:47:37 2015 (r290763) @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ /* @@ -624,9 +625,12 @@ get_snapshot_names(differ_info_t *di, co zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM); while (zhp != NULL) { - (void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN, - origin, sizeof (origin), &src, NULL, 0, B_FALSE); - + if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, + sizeof (origin), &src, NULL, 0, B_FALSE) != 0) { + (void) zfs_close(zhp); + zhp = NULL; + break; + } if (strncmp(origin, fromsnap, fsnlen) == 0) break; From owner-svn-src-stable@freebsd.org Fri Nov 13 09:48:44 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D128CA2D59A; Fri, 13 Nov 2015 09:48:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A66641015; Fri, 13 Nov 2015 09:48:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9mhE9017008; Fri, 13 Nov 2015 09:48:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9mhiJ017007; Fri, 13 Nov 2015 09:48:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130948.tAD9mhiJ017007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290764 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:48:45 -0000 Author: mav Date: Fri Nov 13 09:48:43 2015 New Revision: 290764 URL: https://svnweb.freebsd.org/changeset/base/290764 Log: MFC r289536: 5767 fix several problems with zfs test suite Reviewed by: Matthew Ahrens Reviewed by: Christopher Siden Approved by: Gordon Ross Author: John Wren Kennedy illumos/illumos-gate@52244c0958bdf281ca42932b449f644b4decfdc2 In fact, only unrelated part of that commit is applicable: 8. zpool list -v doesn't print spares It also doesn't correctly identify log devices. Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:47:37 2015 (r290763) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:48:43 2015 (r290764) @@ -2940,6 +2940,9 @@ print_list_stats(zpool_handle_t *zhp, co uint_t c, children; char *vname; boolean_t scripted = cb->cb_scripted; + uint64_t islog = B_FALSE; + boolean_t haslog = B_FALSE; + char *dashes = "%-*s - - - - - -\n"; verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&vs, &c) == 0); @@ -2990,24 +2993,47 @@ print_list_stats(zpool_handle_t *zhp, co ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole) continue; + if (nvlist_lookup_uint64(child[c], + ZPOOL_CONFIG_IS_LOG, &islog) == 0 && islog) { + haslog = B_TRUE; + continue; + } + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); print_list_stats(zhp, vname, child[c], cb, depth + 2); free(vname); } - /* - * Include level 2 ARC devices in iostat output - */ + if (haslog == B_TRUE) { + /* LINTED E_SEC_PRINTF_VAR_FMT */ + (void) printf(dashes, cb->cb_namewidth, "log"); + for (c = 0; c < children; c++) { + if (nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG, + &islog) != 0 || !islog) + continue; + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); + print_list_stats(zhp, vname, child[c], cb, depth + 2); + free(vname); + } + } + if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE, - &child, &children) != 0) - return; + &child, &children) == 0 && children > 0) { + /* LINTED E_SEC_PRINTF_VAR_FMT */ + (void) printf(dashes, cb->cb_namewidth, "cache"); + for (c = 0; c < children; c++) { + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); + print_list_stats(zhp, vname, child[c], cb, depth + 2); + free(vname); + } + } - if (children > 0) { - (void) printf("%-*s - - - - - " - "-\n", cb->cb_namewidth, "cache"); + if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES, &child, + &children) == 0 && children > 0) { + /* LINTED E_SEC_PRINTF_VAR_FMT */ + (void) printf(dashes, cb->cb_namewidth, "spare"); for (c = 0; c < children; c++) { - vname = zpool_vdev_name(g_zfs, zhp, child[c], - B_FALSE); + vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); print_list_stats(zhp, vname, child[c], cb, depth + 2); free(vname); } From owner-svn-src-stable@freebsd.org Fri Nov 13 09:50:11 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3184A2D65F; Fri, 13 Nov 2015 09:50:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9405C1200; Fri, 13 Nov 2015 09:50:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAD9oAB1017144; Fri, 13 Nov 2015 09:50:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9o8AU017123; Fri, 13 Nov 2015 09:50:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130950.tAD9o8AU017123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290765 - in stable/10: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/contrib/opensolaris/common/zf... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:50:12 -0000 Author: mav Date: Fri Nov 13 09:50:08 2015 New Revision: 290765 URL: https://svnweb.freebsd.org/changeset/base/290765 Log: MFC r289562: 6328 Fix cstyle errors in zfs codebase Reviewed by: Matthew Ahrens Reviewed by: Alex Reece Reviewed by: Richard Elling Reviewed by: Jorgen Lundman Approved by: Robert Mustacchi Author: Paul Dagnelie illumos/illumos-gate@9a686fbc186e8e2a64e9a5094d44c7d6fa0ea167 Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Nov 13 09:50:08 2015 (r290765) @@ -199,7 +199,8 @@ static boolean_t log_history = B_TRUE; static uint_t timestamp_fmt = NODATE; static const char * -get_usage(zpool_help_t idx) { +get_usage(zpool_help_t idx) +{ switch (idx) { case HELP_ADD: return (gettext("\tadd [-fn] ...\n")); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Nov 13 09:50:08 2015 (r290765) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. @@ -315,7 +315,8 @@ typedef struct { } snapspec_arg_t; static int -snapspec_cb(zfs_handle_t *zhp, void *arg) { +snapspec_cb(zfs_handle_t *zhp, void *arg) +{ snapspec_arg_t *ssa = arg; char *shortsnapname; int err = 0; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Nov 13 09:50:08 2015 (r290765) @@ -22,7 +22,7 @@ /* * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1885,7 +1885,8 @@ zpool_scan(zpool_handle_t *zhp, pool_sca * and the like. */ static int -ctd_check_path(char *str) { +ctd_check_path(char *str) +{ /* * If it starts with a slash, check the last component. */ Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Nov 13 09:50:08 2015 (r290765) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ /* Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -523,7 +523,7 @@ vn_openat(char *path, int x1, int flags, /*ARGSUSED*/ int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset, - int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp) + int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp) { ssize_t iolen, split; Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Fri Nov 13 09:50:08 2015 (r290765) @@ -117,7 +117,8 @@ zfeature_lookup_name(const char *name, s } boolean_t -zfeature_depends_on(spa_feature_t fid, spa_feature_t check) { +zfeature_depends_on(spa_feature_t fid, spa_feature_t check) +{ zfeature_info_t *feature = &spa_feature_table[fid]; for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Nov 13 09:50:08 2015 (r290765) @@ -1740,7 +1740,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s int dmu_object_set_blocksize(objset_t *os, uint64_t object, uint64_t size, int ibs, - dmu_tx_t *tx) + dmu_tx_t *tx) { dnode_t *dn; int err; @@ -1755,7 +1755,7 @@ dmu_object_set_blocksize(objset_t *os, u void dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum, - dmu_tx_t *tx) + dmu_tx_t *tx) { dnode_t *dn; @@ -1775,7 +1775,7 @@ dmu_object_set_checksum(objset_t *os, ui void dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress, - dmu_tx_t *tx) + dmu_tx_t *tx) { dnode_t *dn; @@ -1946,7 +1946,8 @@ dmu_offset_next(objset_t *os, uint64_t o * ID and wait for that to be synced. */ int -dmu_object_wait_synced(objset_t *os, uint64_t object) { +dmu_object_wait_synced(objset_t *os, uint64_t object) +{ dnode_t *dn; int error, i; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Nov 13 09:50:08 2015 (r290765) @@ -3558,7 +3558,7 @@ dsl_dataset_space_wouldfree(dsl_dataset_ */ boolean_t dsl_dataset_is_before(dsl_dataset_t *later, dsl_dataset_t *earlier, - uint64_t earlier_txg) + uint64_t earlier_txg) { dsl_pool_t *dp = later->ds_dir->dd_pool; int error; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Nov 13 09:50:08 2015 (r290765) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -103,7 +103,7 @@ space_reftree_add_node(avl_tree_t *t, ui void space_reftree_add_seg(avl_tree_t *t, uint64_t start, uint64_t end, - int64_t refcnt) + int64_t refcnt) { space_reftree_add_node(t, start, refcnt); space_reftree_add_node(t, end, -refcnt); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h Fri Nov 13 09:50:08 2015 (r290765) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 by Delphix. All rights reserved. */ #ifndef _SYS_ZRLOCK_H @@ -44,12 +45,8 @@ typedef struct zrlock { extern void zrl_init(zrlock_t *); extern void zrl_destroy(zrlock_t *); -#ifdef ZFS_DEBUG -#define zrl_add(_z) zrl_add_debug((_z), __func__) -extern void zrl_add_debug(zrlock_t *, const char *); -#else -extern void zrl_add(zrlock_t *); -#endif +#define zrl_add(_z) zrl_add_impl((_z), __func__) +extern void zrl_add_impl(zrlock_t *, const char *); extern void zrl_remove(zrlock_t *); extern int zrl_tryenter(zrlock_t *); extern void zrl_exit(zrlock_t *); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Nov 13 09:50:08 2015 (r290765) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ /* @@ -185,7 +185,7 @@ vdev_label_number(uint64_t psize, uint64 static void vdev_label_read(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset, - uint64_t size, zio_done_func_t *done, void *private, int flags) + uint64_t size, zio_done_func_t *done, void *private, int flags) { ASSERT(spa_config_held(zio->io_spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); @@ -199,7 +199,7 @@ vdev_label_read(zio_t *zio, vdev_t *vd, static void vdev_label_write(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset, - uint64_t size, zio_done_func_t *done, void *private, int flags) + uint64_t size, zio_done_func_t *done, void *private, int flags) { ASSERT(spa_config_held(zio->io_spa, SCL_ALL, RW_WRITER) == SCL_ALL || (spa_config_held(zio->io_spa, SCL_CONFIG | SCL_STATE, RW_READER) == Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ /* @@ -535,7 +535,7 @@ zap_entry_read_name(zap_t *zap, const za int zap_entry_update(zap_entry_handle_t *zeh, - uint8_t integer_size, uint64_t num_integers, const void *buf) + uint8_t integer_size, uint64_t num_integers, const void *buf) { int delta_chunks; zap_leaf_t *l = zeh->zeh_leaf; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Nov 13 09:50:08 2015 (r290765) @@ -269,7 +269,8 @@ feature_get_refcount_from_disk(spa_t *sp static int -feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res) { +feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res) +{ uint64_t enabled_txg_obj = spa->spa_feat_enabled_txg_obj; ASSERT(zfeature_depends_on(feature->fi_feature, @@ -493,7 +494,8 @@ spa_feature_is_active(spa_t *spa, spa_fe * Returns B_FALSE otherwise (i.e. if the feature is not enabled). */ boolean_t -spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) { +spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) +{ int err; ASSERT(VALID_FEATURE_FID(fid)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -806,7 +806,7 @@ zfs_dropname(zfs_dirlock_t *dl, znode_t */ int zfs_link_destroy(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag, - boolean_t *unlinkedp) + boolean_t *unlinkedp) { znode_t *dzp = dl->dl_dzp; zfsvfs_t *zfsvfs = dzp->z_zfsvfs; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 13 09:50:08 2015 (r290765) @@ -5707,7 +5707,7 @@ zfs_ioctl_register_dataset_read(zfs_ioc_ static void zfs_ioctl_register_dataset_modify(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func, - zfs_secpolicy_func_t *secpolicy) + zfs_secpolicy_func_t *secpolicy) { zfs_ioctl_register_legacy(ioc, func, secpolicy, DATASET_NAME, B_TRUE, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 by Delphix. All rights reserved. */ #include @@ -348,7 +349,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, char *name, uint64_t foid) + znode_t *dzp, char *name, uint64_t foid) { itx_t *itx; lr_remove_t *lr; @@ -372,7 +373,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, znode_t *zp, char *name) + znode_t *dzp, znode_t *zp, char *name) { itx_t *itx; lr_link_t *lr; @@ -427,7 +428,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t */ void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) + znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) { itx_t *itx; lr_rename_t *lr; @@ -455,7 +456,7 @@ ssize_t zfs_immediate_write_sz = 32768; void zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype, - znode_t *zp, offset_t off, ssize_t resid, int ioflag) + znode_t *zp, offset_t off, ssize_t resid, int ioflag) { itx_wr_state_t write_state; boolean_t slogging; @@ -532,7 +533,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * */ void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, - znode_t *zp, uint64_t off, uint64_t len) + znode_t *zp, uint64_t off, uint64_t len) { itx_t *itx; lr_truncate_t *lr; @@ -555,7 +556,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_ */ void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, - znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp) + znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp) { itx_t *itx; lr_setattr_t *lr; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #include @@ -54,7 +54,7 @@ static void zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode, - uint64_t uid, uint64_t gid, uint64_t rdev, uint64_t nodeid) + uint64_t uid, uint64_t gid, uint64_t rdev, uint64_t nodeid) { VATTR_NULL(vap); vap->va_mask = (uint_t)mask; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4505,7 +4505,7 @@ top: /* ARGSUSED */ static int zfs_null_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp, - size_t *lenp, int flags, cred_t *cr) + size_t *lenp, int flags, cred_t *cr) { pvn_write_done(pp, B_INVAL|B_FORCE|B_ERROR); return (0); @@ -4531,7 +4531,7 @@ zfs_null_putapage(vnode_t *vp, page_t *p /* ARGSUSED */ static int zfs_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp, - size_t *lenp, int flags, cred_t *cr) + size_t *lenp, int flags, cred_t *cr) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Nov 13 09:50:08 2015 (r290765) @@ -330,7 +330,7 @@ zio_data_buf_free(void *buf, size_t size */ static void zio_push_transform(zio_t *zio, void *data, uint64_t size, uint64_t bufsize, - zio_transform_func_t *transform) + zio_transform_func_t *transform) { zio_transform_t *zt = kmem_alloc(sizeof (zio_transform_t), KM_SLEEP); @@ -1068,8 +1068,8 @@ zio_vdev_child_io(zio_t *pio, blkptr_t * zio_t * zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, void *data, uint64_t size, - int type, zio_priority_t priority, enum zio_flag flags, - zio_done_func_t *done, void *private) + int type, zio_priority_t priority, enum zio_flag flags, + zio_done_func_t *done, void *private) { zio_t *zio; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. */ @@ -249,7 +249,7 @@ zio_checksum_template_init(enum zio_chec */ void zio_checksum_compute(zio_t *zio, enum zio_checksum checksum, - void *data, uint64_t size) + void *data, uint64_t size) { blkptr_t *bp = zio->io_bp; uint64_t offset = zio->io_offset; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c Fri Nov 13 09:48:43 2015 (r290764) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c Fri Nov 13 09:50:08 2015 (r290765) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014 by Delphix. All rights reserved. + * Copyright (c) 2014, 2015 by Delphix. All rights reserved. */ /* @@ -69,11 +69,7 @@ zrl_destroy(zrlock_t *zrl) } void -#ifdef ZFS_DEBUG -zrl_add_debug(zrlock_t *zrl, const char *zc) -#else -zrl_add(zrlock_t *zrl) -#endif +zrl_add_impl(zrlock_t *zrl, const char *zc) { uint32_t n = (uint32_t)zrl->zr_refcount; From owner-svn-src-stable@freebsd.org Fri Nov 13 09:52:37 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A98D5A2D82F; Fri, 13 Nov 2015 09:52:37 +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 6626315C8; Fri, 13 Nov 2015 09:52:37 +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 tAD9qaPG019813; Fri, 13 Nov 2015 09:52:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAD9qaMa019812; Fri, 13 Nov 2015 09:52:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511130952.tAD9qaMa019812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 09:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290766 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 09:52:37 -0000 Author: mav Date: Fri Nov 13 09:52:36 2015 New Revision: 290766 URL: https://svnweb.freebsd.org/changeset/base/290766 Log: MFC r290191 (by avg): 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 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:50:08 2015 (r290765) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Nov 13 09:52:36 2015 (r290766) @@ -1134,6 +1134,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) { @@ -2406,10 +2424,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); } @@ -4779,10 +4794,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); } @@ -5969,8 +5981,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-stable@freebsd.org Fri Nov 13 10:32:35 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A2A1A2E39F; Fri, 13 Nov 2015 10:32:35 +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 533DC1F3A; Fri, 13 Nov 2015 10:32:35 +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 tADAWYVK031221; Fri, 13 Nov 2015 10:32:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADAWYXq031220; Fri, 13 Nov 2015 10:32:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131032.tADAWYXq031220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 10:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290767 - stable/10/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 10:32:35 -0000 Author: mav Date: Fri Nov 13 10:32:34 2015 New Revision: 290767 URL: https://svnweb.freebsd.org/changeset/base/290767 Log: Fix build on stable/10. Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 09:52:36 2015 (r290766) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Nov 13 10:32:34 2015 (r290767) @@ -3579,7 +3579,7 @@ zfs_do_set(int argc, char **argv) { nvlist_t *props = NULL; int ds_start = -1; /* argv idx of first dataset arg */ - int ret = 0; + int i, ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3605,7 +3605,7 @@ zfs_do_set(int argc, char **argv) } /* validate argument order: prop=val args followed by dataset args */ - for (int i = 1; i < argc; i++) { + for (i = 1; i < argc; i++) { if (strchr(argv[i], '=') != NULL) { if (ds_start > 0) { /* out-of-order prop=val argument */ @@ -3625,7 +3625,7 @@ zfs_do_set(int argc, char **argv) /* Populate a list of property settings */ if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) nomem(); - for (int i = 1; i < ds_start; i++) { + for (i = 1; i < ds_start; i++) { if ((ret = parseprop(props, argv[i])) != 0) goto error; } From owner-svn-src-stable@freebsd.org Fri Nov 13 10:34:16 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39D2CA2E435; Fri, 13 Nov 2015 10:34:16 +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 037121162; Fri, 13 Nov 2015 10:34:15 +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 tADAYFOU031343; Fri, 13 Nov 2015 10:34:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADAYEj2031341; Fri, 13 Nov 2015 10:34:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131034.tADAYEj2031341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 10:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290768 - stable/10/sys/cam/ata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 10:34:16 -0000 Author: mav Date: Fri Nov 13 10:34:14 2015 New Revision: 290768 URL: https://svnweb.freebsd.org/changeset/base/290768 Log: MFC r290462: Removed unused malloc types. Submitted by: Dmitry Luhtionov Modified: stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/ata/ata_pmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Fri Nov 13 10:32:34 2015 (r290767) +++ stable/10/sys/cam/ata/ata_da.c Fri Nov 13 10:34:14 2015 (r290768) @@ -642,8 +642,6 @@ static struct periph_driver adadriver = PERIPHDRIVER_DECLARE(ada, adadriver); -static MALLOC_DEFINE(M_ATADA, "ata_da", "ata_da buffers"); - static int adaopen(struct disk *dp) { Modified: stable/10/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/10/sys/cam/ata/ata_pmp.c Fri Nov 13 10:32:34 2015 (r290767) +++ stable/10/sys/cam/ata/ata_pmp.c Fri Nov 13 10:34:14 2015 (r290768) @@ -158,8 +158,6 @@ static struct periph_driver pmpdriver = PERIPHDRIVER_DECLARE(pmp, pmpdriver); -static MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers"); - static void pmpinit(void) { From owner-svn-src-stable@freebsd.org Fri Nov 13 17:25:15 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 841BBA2E3CF; Fri, 13 Nov 2015 17:25:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 417BF1F95; Fri, 13 Nov 2015 17:25:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADHPEv7051508; Fri, 13 Nov 2015 17:25:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADHPEah051507; Fri, 13 Nov 2015 17:25:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201511131725.tADHPEah051507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 13 Nov 2015 17:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290771 - stable/10/release/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 17:25:15 -0000 Author: gjb Date: Fri Nov 13 17:25:14 2015 New Revision: 290771 URL: https://svnweb.freebsd.org/changeset/base/290771 Log: MFC r290550, r290573: r290550: Use tmpfs(5) instead of md(4) for '/tmp' mount. r290573: Remove noatime from tmpfs(5) fstab(5) entry. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/tools/arm.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/release/tools/arm.subr ============================================================================== --- stable/10/release/tools/arm.subr Fri Nov 13 16:35:22 2015 (r290770) +++ stable/10/release/tools/arm.subr Fri Nov 13 17:25:14 2015 (r290771) @@ -110,7 +110,7 @@ arm_install_base() { >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "md /tmp mfs rw,noatime,-s30m 0 0" \ + echo "tmpfs /tmp tmpfs rw,mode=1777,size=30m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab local hostname From owner-svn-src-stable@freebsd.org Fri Nov 13 19:21:47 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AC0A2EF68; Fri, 13 Nov 2015 19:21:47 +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 B8DD01542; Fri, 13 Nov 2015 19:21:46 +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 tADJLjOt086964; Fri, 13 Nov 2015 19:21:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJLjIf086962; Fri, 13 Nov 2015 19:21:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131921.tADJLjIf086962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290774 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:21:47 -0000 Author: mav Date: Fri Nov 13 19:21:45 2015 New Revision: 290774 URL: https://svnweb.freebsd.org/changeset/base/290774 Log: MFC r289702: Make some panic strings mode informative. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Nov 13 17:27:23 2015 (r290773) +++ stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:21:45 2015 (r290774) @@ -3817,7 +3817,7 @@ ctl_expand_number(const char *buf, uint6 static int ctl_init_page_index(struct ctl_lun *lun) { - int i; + int i, page_code; struct ctl_page_index *page_index; const char *value; uint64_t ival; @@ -3838,10 +3838,12 @@ ctl_init_page_index(struct ctl_lun *lun) (page_index->page_flags & CTL_PAGE_FLAG_CDROM) == 0) continue; - switch (page_index->page_code & SMPH_PC_MASK) { + page_code = page_index->page_code & SMPH_PC_MASK; + switch (page_code) { case SMS_RW_ERROR_RECOVERY_PAGE: { - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("subpage is incorrect!"); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT], &rw_er_page_default, sizeof(rw_er_page_default)); @@ -3861,8 +3863,9 @@ ctl_init_page_index(struct ctl_lun *lun) case SMS_FORMAT_DEVICE_PAGE: { struct scsi_format_page *format_page; - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("subpage is incorrect!"); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); /* * Sectors per track are set above. Bytes per @@ -3908,9 +3911,9 @@ ctl_init_page_index(struct ctl_lun *lun) int shift; #endif /* !__XSCALE__ */ - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("invalid subpage value %d", - page_index->subpage); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); /* * Rotation rate and sectors per track are set @@ -3988,9 +3991,9 @@ ctl_init_page_index(struct ctl_lun *lun) case SMS_CACHING_PAGE: { struct scsi_caching_page *caching_page; - if (page_index->subpage != SMS_SUBPAGE_PAGE_0) - panic("invalid subpage value %d", - page_index->subpage); + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); memcpy(&lun->mode_pages.caching_page[CTL_PAGE_DEFAULT], &caching_page_default, sizeof(caching_page_default)); @@ -4073,6 +4076,9 @@ ctl_init_page_index(struct ctl_lun *lun) page_index->page_data = (uint8_t *)lun->mode_pages.control_ext_page; break; + default: + panic("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code); } break; } @@ -4164,10 +4170,18 @@ ctl_init_page_index(struct ctl_lun *lun) sizeof(lbp_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.lbp_page; - }} + break; + } + default: + panic("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code); + } break; } case SMS_CDDVD_CAPS_PAGE:{ + KASSERT(page_index->subpage == SMS_SUBPAGE_PAGE_0, + ("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code)); memcpy(&lun->mode_pages.cddvd_page[CTL_PAGE_DEFAULT], &cddvd_page_default, sizeof(cddvd_page_default)); @@ -4208,17 +4222,14 @@ ctl_init_page_index(struct ctl_lun *lun) break; } default: - panic("invalid subpage value %d", - page_index->subpage); - break; + panic("subpage %#x for page %#x is incorrect!", + page_index->subpage, page_code); } - break; + break; } default: - panic("invalid page value %d", - page_index->page_code & SMPH_PC_MASK); - break; - } + panic("invalid page code value %#x", page_code); + } } return (CTL_RETVAL_COMPLETE); @@ -6230,8 +6241,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio break; } default: - panic("Invalid CDB type %#x", ctsio->cdb[0]); - break; + panic("%s: Invalid CDB type %#x", __func__, ctsio->cdb[0]); } if (param_len < (header_size + bd_len)) { @@ -6494,8 +6504,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) break; } default: - panic("invalid CDB type %#x", ctsio->cdb[0]); - break; /* NOTREACHED */ + panic("%s: Invalid CDB type %#x", __func__, ctsio->cdb[0]); } /* @@ -7509,7 +7518,7 @@ retry: lun->pr_key_count; break; default: - panic("Invalid PR type %x", cdb->action); + panic("%s: Invalid PR type %#x", __func__, cdb->action); } mtx_unlock(&lun->lun_lock); @@ -7705,12 +7714,7 @@ retry: break; } default: - /* - * This is a bug, because we just checked for this above, - * and should have returned an error. - */ - panic("Invalid PR type %x", cdb->action); - break; /* NOTREACHED */ + panic("%s: Invalid PR type %#x", __func__, cdb->action); } mtx_unlock(&lun->lun_lock); @@ -8428,7 +8432,7 @@ ctl_persistent_reserve_out(struct ctl_sc break; } default: - panic("Invalid PR type %x", cdb->action); + panic("%s: Invalid PR type %#x", __func__, cdb->action); } done: @@ -11037,8 +11041,9 @@ ctl_check_for_blockage(struct ctl_lun *l case CTL_SER_SKIP: return (CTL_ACTION_SKIP); default: - panic("invalid serialization value %d", - serialize_row[pending_entry->seridx]); + panic("%s: Invalid serialization value %d for %d => %d", + __func__, serialize_row[pending_entry->seridx], + pending_entry->seridx, ooa_entry->seridx); } return (CTL_ACTION_ERROR); @@ -11087,8 +11092,7 @@ ctl_check_ooa(struct ctl_lun *lun, union case CTL_ACTION_PASS: break; default: - panic("invalid action %d", action); - break; /* NOTREACHED */ + panic("%s: Invalid action %d\n", __func__, action); } } @@ -12565,9 +12569,8 @@ ctl_datamove(union ctl_io *io) io->taskio.tag_num, io->taskio.tag_type); break; default: - printf("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - panic("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - break; + panic("%s: Invalid CTL I/O type %d\n", + __func__, io->io_hdr.io_type); } sbuf_cat(&sb, path_str); sbuf_printf(&sb, "ctl_datamove: %jd seconds\n", @@ -13100,9 +13103,8 @@ ctl_process_done(union ctl_io *io) io->taskio.tag_num, io->taskio.tag_type); break; default: - printf("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - panic("Invalid CTL I/O type %d\n", io->io_hdr.io_type); - break; + panic("%s: Invalid CTL I/O type %d\n", + __func__, io->io_hdr.io_type); } sbuf_cat(&sb, path_str); sbuf_printf(&sb, "ctl_process_done: %jd seconds\n", @@ -13121,9 +13123,8 @@ ctl_process_done(union ctl_io *io) fe_done(io); return; default: - panic("ctl_process_done: invalid io type %d\n", - io->io_hdr.io_type); - break; /* NOTREACHED */ + panic("%s: Invalid CTL I/O type %d\n", + __func__, io->io_hdr.io_type); } lun = (struct ctl_lun *)io->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Fri Nov 13 17:27:23 2015 (r290773) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Fri Nov 13 19:21:45 2015 (r290774) @@ -2113,7 +2113,7 @@ ctl_be_block_close(struct ctl_be_block_l case CTL_BE_BLOCK_NONE: break; default: - panic("Unexpected backend type."); + panic("Unexpected backend type %d", be_lun->dev_type); break; } be_lun->dev_type = CTL_BE_BLOCK_NONE; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:23:24 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB26BA2E0D0; Fri, 13 Nov 2015 19:23:24 +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 A21D41852; Fri, 13 Nov 2015 19:23:24 +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 tADJNNF9089024; Fri, 13 Nov 2015 19:23:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJNNst089018; Fri, 13 Nov 2015 19:23:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131923.tADJNNst089018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290775 - in stable/10/sys: cam/ctl cam/scsi dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:23:25 -0000 Author: mav Date: Fri Nov 13 19:23:22 2015 New Revision: 290775 URL: https://svnweb.freebsd.org/changeset/base/290775 Log: MFC r289843: Add partial support for QUERY TMF to CAM and isp(4). This change allows to decode respective functions in isp(4) in target mode and pass them through CAM to CTL. Unfortunately neither CAM nor isp(4) support returning response info for those task management functions now. On the other side I just have no initiator to test this functionality. Modified: stable/10/sys/cam/ctl/scsi_ctl.c stable/10/sys/cam/scsi/scsi_message.h stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_stds.h stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/isp_target.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:23:22 2015 (r290775) @@ -1459,24 +1459,31 @@ ctlfedone(struct cam_periph *periph, uni CTL_TASK_ABORT_TASK_SET; break; case MSG_TARGET_RESET: - io->taskio.task_action = - CTL_TASK_TARGET_RESET; + io->taskio.task_action = CTL_TASK_TARGET_RESET; break; case MSG_ABORT_TASK: - io->taskio.task_action = - CTL_TASK_ABORT_TASK; + io->taskio.task_action = CTL_TASK_ABORT_TASK; break; case MSG_LOGICAL_UNIT_RESET: - io->taskio.task_action = - CTL_TASK_LUN_RESET; + io->taskio.task_action = CTL_TASK_LUN_RESET; break; case MSG_CLEAR_TASK_SET: io->taskio.task_action = - CTL_TASK_CLEAR_TASK_SET; + CTL_TASK_CLEAR_TASK_SET; break; case MSG_CLEAR_ACA: + io->taskio.task_action = CTL_TASK_CLEAR_ACA; + break; + case MSG_QUERY_TASK: + io->taskio.task_action = CTL_TASK_QUERY_TASK; + break; + case MSG_QUERY_TASK_SET: + io->taskio.task_action = + CTL_TASK_QUERY_TASK_SET; + break; + case MSG_QUERY_ASYNC_EVENT: io->taskio.task_action = - CTL_TASK_CLEAR_ACA; + CTL_TASK_QUERY_ASYNC_EVENT; break; case MSG_NOOP: send_ctl_io = 0; Modified: stable/10/sys/cam/scsi/scsi_message.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_message.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/cam/scsi/scsi_message.h Fri Nov 13 19:23:22 2015 (r290775) @@ -68,3 +68,9 @@ #define MSG_EXT_PPR_QAS_REQ 0x04 #define MSG_EXT_PPR_DT_REQ 0x02 #define MSG_EXT_PPR_IU_REQ 0x01 + +/* Fake messages not defined for SPI, but needed for other transports */ +#define MSG_QUERY_TASK 0x100 +#define MSG_QUERY_TASK_SET 0x101 +#define MSG_QUERY_ASYNC_EVENT 0x102 + Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:23:22 2015 (r290775) @@ -3479,6 +3479,12 @@ isp_handle_platform_target_tmf(ispsoftc_ case NT_TARGET_RESET: inot->arg = MSG_TARGET_RESET; break; + case NT_QUERY_TASK_SET: + inot->arg = MSG_QUERY_TASK_SET; + break; + case NT_QUERY_ASYNC_EVENT: + inot->arg = MSG_QUERY_ASYNC_EVENT; + break; default: isp_prt(isp, ISP_LOGWARN, "%s: unknown TMF code 0x%x for chan %d lun 0x%x", __func__, notify->nt_ncode, notify->nt_channel, lun); goto bad; @@ -5883,6 +5889,8 @@ changed: case NT_CLEAR_TASK_SET: case NT_LUN_RESET: case NT_TARGET_RESET: + case NT_QUERY_TASK_SET: + case NT_QUERY_ASYNC_EVENT: /* * These are task management functions. */ Modified: stable/10/sys/dev/isp/isp_stds.h ============================================================================== --- stable/10/sys/dev/isp/isp_stds.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_stds.h Fri Nov 13 19:23:22 2015 (r290775) @@ -97,8 +97,10 @@ typedef struct { #define FCP_CMND_TMF_CLEAR_ACA 0x40 #define FCP_CMND_TMF_TGT_RESET 0x20 #define FCP_CMND_TMF_LUN_RESET 0x10 +#define FCP_CMND_TMF_QUERY_ASYNC_EVENT 0x08 #define FCP_CMND_TMF_CLEAR_TASK_SET 0x04 #define FCP_CMND_TMF_ABORT_TASK_SET 0x02 +#define FCP_CMND_TMF_QUERY_TASK_SET 0x01 /* * Basic CT IU Header Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:23:22 2015 (r290775) @@ -1024,12 +1024,18 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en notify.nt_sid = sid; notify.nt_did = did; notify.nt_channel = chan; - if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) { + if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_QUERY_TASK_SET) { + isp_prt(isp, ISP_LOGINFO, f1, "QUERY TASK SET", sid, notify.nt_lun, aep->at_rxid); + notify.nt_ncode = NT_QUERY_TASK_SET; + } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_ABORT_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_ABORT_TASK_SET; } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_CLEAR_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_CLEAR_TASK_SET; + } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_QUERY_ASYNC_EVENT) { + isp_prt(isp, ISP_LOGINFO, f1, "QUERY ASYNC EVENT", sid, notify.nt_lun, aep->at_rxid); + notify.nt_ncode = NT_QUERY_ASYNC_EVENT; } else if (aep->at_cmnd.fcp_cmnd_task_management & FCP_CMND_TMF_LUN_RESET) { isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", sid, notify.nt_lun, aep->at_rxid); notify.nt_ncode = NT_LUN_RESET; Modified: stable/10/sys/dev/isp/isp_target.h ============================================================================== --- stable/10/sys/dev/isp/isp_target.h Fri Nov 13 19:21:45 2015 (r290774) +++ stable/10/sys/dev/isp/isp_target.h Fri Nov 13 19:23:22 2015 (r290775) @@ -51,7 +51,9 @@ typedef enum { NT_LOGOUT, NT_GLOBAL_LOGOUT, NT_CHANGED, - NT_HBA_RESET + NT_HBA_RESET, + NT_QUERY_TASK_SET, + NT_QUERY_ASYNC_EVENT } isp_ncode_t; typedef struct isp_notify { From owner-svn-src-stable@freebsd.org Fri Nov 13 19:24:45 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF92A2E12B; Fri, 13 Nov 2015 19:24: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 C1A5019B9; Fri, 13 Nov 2015 19:24: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 tADJOiuR089127; Fri, 13 Nov 2015 19:24:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJOilp089122; Fri, 13 Nov 2015 19:24:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131924.tADJOilp089122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290776 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:24:46 -0000 Author: mav Date: Fri Nov 13 19:24:44 2015 New Revision: 290776 URL: https://svnweb.freebsd.org/changeset/base/290776 Log: MFC r289881: Give CTL support for PIM_EXTLUNS when talking to CAM. CTL itself still lives in flat LUN space, but it can generate extended numbers if CAM SIM reports such capability. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:24:44 2015 (r290776) @@ -3540,6 +3540,67 @@ ctl_lun_map_to_port(struct ctl_port *por return (UINT32_MAX); } +uint32_t +ctl_decode_lun(uint64_t encoded) +{ + uint8_t lun[8]; + uint32_t result = 0xffffffff; + + be64enc(lun, encoded); + switch (lun[0] & RPL_LUNDATA_ATYP_MASK) { + case RPL_LUNDATA_ATYP_PERIPH: + if ((lun[0] & 0x3f) == 0 && lun[2] == 0 && lun[3] == 0 && + lun[4] == 0 && lun[5] == 0 && lun[6] == 0 && lun[7] == 0) + result = lun[1]; + break; + case RPL_LUNDATA_ATYP_FLAT: + if (lun[2] == 0 && lun[3] == 0 && lun[4] == 0 && lun[5] == 0 && + lun[6] == 0 && lun[7] == 0) + result = ((lun[0] & 0x3f) << 8) + lun[1]; + break; + case RPL_LUNDATA_ATYP_EXTLUN: + switch (lun[0] & RPL_LUNDATA_EXT_EAM_MASK) { + case 0x02: + switch (lun[0] & RPL_LUNDATA_EXT_LEN_MASK) { + case 0x00: + result = lun[1]; + break; + case 0x10: + result = (lun[1] << 16) + (lun[2] << 8) + + lun[3]; + break; + case 0x20: + if (lun[1] == 0 && lun[6] == 0 && lun[7] == 0) + result = (lun[2] << 24) + + (lun[3] << 16) + (lun[4] << 8) + + lun[5]; + break; + } + break; + case RPL_LUNDATA_EXT_EAM_NOT_SPEC: + result = 0xffffffff; + break; + } + break; + } + return (result); +} + +uint64_t +ctl_encode_lun(uint32_t decoded) +{ + uint64_t l = decoded; + + if (l <= 0xff) + return (((uint64_t)RPL_LUNDATA_ATYP_PERIPH << 56) | (l << 48)); + if (l <= 0x3fff) + return (((uint64_t)RPL_LUNDATA_ATYP_FLAT << 56) | (l << 48)); + if (l <= 0xffffff) + return (((uint64_t)(RPL_LUNDATA_ATYP_EXTLUN | 0x12) << 56) | + (l << 32)); + return ((((uint64_t)RPL_LUNDATA_ATYP_EXTLUN | 0x22) << 56) | (l << 16)); +} + static struct ctl_port * ctl_io_port(struct ctl_io_hdr *io_hdr) { @@ -9063,36 +9124,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio if (lun == NULL) continue; - if (targ_lun_id <= 0xff) { - /* - * Peripheral addressing method, bus number 0. - */ - lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_PERIPH; - lun_data->luns[num_filled].lundata[1] = targ_lun_id; - num_filled++; - } else if (targ_lun_id <= 0x3fff) { - /* - * Flat addressing method. - */ - lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8); - lun_data->luns[num_filled].lundata[1] = - (targ_lun_id & 0xff); - num_filled++; - } else if (targ_lun_id <= 0xffffff) { - /* - * Extended flat addressing method. - */ - lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_EXTLUN | 0x12; - scsi_ulto3b(targ_lun_id, - &lun_data->luns[num_filled].lundata[1]); - num_filled++; - } else { - printf("ctl_report_luns: bogus LUN number %jd, " - "skipping\n", (intmax_t)targ_lun_id); - } + be64enc(lun_data->luns[num_filled++].lundata, + ctl_encode_lun(targ_lun_id)); + /* * According to SPC-3, rev 14 section 6.21: * Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl.h Fri Nov 13 19:24:44 2015 (r290776) @@ -191,6 +191,9 @@ void ctl_clr_ua_all(struct ctl_lun *lun, void ctl_clr_ua_allluns(struct ctl_softc *ctl_softc, uint32_t initidx, ctl_ua_type ua_type); +uint32_t ctl_decode_lun(uint64_t encoded); +uint64_t ctl_encode_lun(uint32_t decoded); + void ctl_isc_announce_lun(struct ctl_lun *lun); void ctl_isc_announce_port(struct ctl_port *port); void ctl_isc_announce_iid(struct ctl_port *port, int iid); Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Nov 13 19:24:44 2015 (r290776) @@ -549,7 +549,8 @@ cfcs_action(struct cam_sim *sim, union c io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = 1; io->io_hdr.nexus.targ_port = softc->port.targ_port; - io->io_hdr.nexus.targ_lun = ccb->ccb_h.target_lun; + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); /* * This tag scheme isn't the best, since we could in theory * have a very long-lived I/O and tag collision, especially @@ -638,7 +639,8 @@ cfcs_action(struct cam_sim *sim, union c io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = 1; io->io_hdr.nexus.targ_port = softc->port.targ_port; - io->io_hdr.nexus.targ_lun = ccb->ccb_h.target_lun; + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); io->taskio.task_action = CTL_TASK_ABORT_TASK; io->taskio.tag_num = abort_ccb->csio.tag_id; switch (abort_ccb->csio.tag_action) { @@ -733,7 +735,8 @@ cfcs_action(struct cam_sim *sim, union c io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = 1; io->io_hdr.nexus.targ_port = softc->port.targ_port; - io->io_hdr.nexus.targ_lun = ccb->ccb_h.target_lun; + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); if (ccb->ccb_h.func_code == XPT_RESET_BUS) io->taskio.task_action = CTL_TASK_BUS_RESET; else @@ -760,7 +763,7 @@ cfcs_action(struct cam_sim *sim, union c cpi->version_num = 0; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = 0; + cpi->hba_misc = PIM_EXTLUNS; cpi->hba_eng_cnt = 0; cpi->max_target = 1; cpi->max_lun = 1024; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Nov 13 19:24:44 2015 (r290776) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -413,62 +414,6 @@ cfiscsi_pdu_queue(struct icl_pdu *respon CFISCSI_SESSION_UNLOCK(cs); } -static uint32_t -cfiscsi_decode_lun(uint64_t encoded) -{ - uint8_t lun[8]; - uint32_t result; - - /* - * The LUN field in iSCSI PDUs may look like an ordinary 64 bit number, - * but is in fact an evil, multidimensional structure defined - * in SCSI Architecture Model 5 (SAM-5), section 4.6. - */ - memcpy(lun, &encoded, sizeof(lun)); - switch (lun[0] & 0xC0) { - case 0x00: - if ((lun[0] & 0x3f) != 0 || lun[2] != 0 || lun[3] != 0 || - lun[4] != 0 || lun[5] != 0 || lun[6] != 0 || lun[7] != 0) { - CFISCSI_WARN("malformed LUN " - "(peripheral device addressing method): 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - result = lun[1]; - break; - case 0x40: - if (lun[2] != 0 || lun[3] != 0 || lun[4] != 0 || lun[5] != 0 || - lun[6] != 0 || lun[7] != 0) { - CFISCSI_WARN("malformed LUN " - "(flat address space addressing method): 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - result = ((lun[0] & 0x3f) << 8) + lun[1]; - break; - case 0xC0: - if (lun[0] != 0xD2 || lun[4] != 0 || lun[5] != 0 || - lun[6] != 0 || lun[7] != 0) { - CFISCSI_WARN("malformed LUN (extended flat " - "address space addressing method): 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - result = (lun[1] << 16) + (lun[2] << 8) + lun[3]; - break; - default: - CFISCSI_WARN("unsupported LUN format 0x%jx", - (uintmax_t)encoded); - result = 0xffffffff; - break; - } - - return (result); -} - static void cfiscsi_pdu_handle_nop_out(struct icl_pdu *request) { @@ -563,7 +508,7 @@ cfiscsi_pdu_handle_scsi_command(struct i io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; - io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun); + io->io_hdr.nexus.targ_lun = ctl_decode_lun(be64toh(bhssc->bhssc_lun)); io->scsiio.tag_num = bhssc->bhssc_initiator_task_tag; switch ((bhssc->bhssc_flags & BHSSC_FLAGS_ATTR)) { case BHSSC_FLAGS_ATTR_UNTAGGED: @@ -619,7 +564,7 @@ cfiscsi_pdu_handle_task_request(struct i io->io_hdr.io_type = CTL_IO_TASK; io->io_hdr.nexus.initid = cs->cs_ctl_initid; io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port; - io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun); + io->io_hdr.nexus.targ_lun = ctl_decode_lun(be64toh(bhstmr->bhstmr_lun)); io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */ switch (bhstmr->bhstmr_function & ~0x80) { Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:23:22 2015 (r290775) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Nov 13 19:24:44 2015 (r290776) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008, 2009 Silicon Graphics International Corp. + * Copyright (c) 2014-2015 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,13 +74,14 @@ __FBSDID("$FreeBSD$"); #include struct ctlfe_softc { - struct ctl_port port; - path_id_t path_id; - target_id_t target_id; - u_int maxio; + struct ctl_port port; + path_id_t path_id; + target_id_t target_id; + uint32_t hba_misc; + u_int maxio; struct cam_sim *sim; - char port_name[DEV_IDLEN]; - struct mtx lun_softc_mtx; + char port_name[DEV_IDLEN]; + struct mtx lun_softc_mtx; STAILQ_HEAD(, ctlfe_lun_softc) lun_softc_list; STAILQ_ENTRY(ctlfe_softc) links; }; @@ -355,6 +357,7 @@ ctlfeasync(void *callback_arg, uint32_t softc->path_id = cpi->ccb_h.path_id; softc->target_id = cpi->initiator_id; softc->sim = xpt_path_sim(path); + softc->hba_misc = cpi->hba_misc; if (cpi->maxio != 0) softc->maxio = cpi->maxio; else @@ -1166,7 +1169,12 @@ ctlfedone(struct cam_periph *periph, uni io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.nexus.initid = atio->init_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; - io->io_hdr.nexus.targ_lun = atio->ccb_h.target_lun; + if (bus_softc->hba_misc & PIM_EXTLUNS) { + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(atio->ccb_h.target_lun)); + } else { + io->io_hdr.nexus.targ_lun = atio->ccb_h.target_lun; + } io->scsiio.tag_num = atio->tag_id; switch (atio->tag_action) { case CAM_TAG_ACTION_NONE: @@ -1440,7 +1448,12 @@ ctlfedone(struct cam_periph *periph, uni inot->ccb_h.io_ptr = io; io->io_hdr.nexus.initid = inot->initiator_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; - io->io_hdr.nexus.targ_lun = inot->ccb_h.target_lun; + if (bus_softc->hba_misc & PIM_EXTLUNS) { + io->io_hdr.nexus.targ_lun = ctl_decode_lun( + CAM_EXTLUN_BYTE_SWIZZLE(inot->ccb_h.target_lun)); + } else { + io->io_hdr.nexus.targ_lun = inot->ccb_h.target_lun; + } /* XXX KDM should this be the tag_id? */ io->taskio.tag_num = inot->seq_id; @@ -1820,9 +1833,11 @@ ctlfe_lun_enable(void *arg, int lun_id) cam_status status; bus_softc = (struct ctlfe_softc *)arg; + if (bus_softc->hba_misc & PIM_EXTLUNS) + lun_id = CAM_EXTLUN_BYTE_SWIZZLE(ctl_encode_lun(lun_id)); status = xpt_create_path(&path, /*periph*/ NULL, - bus_softc->path_id, bus_softc->target_id, lun_id); + bus_softc->path_id, bus_softc->target_id, lun_id); /* XXX KDM need some way to return status to CTL here? */ if (status != CAM_REQ_CMP) { printf("%s: could not create path, status %#x\n", __func__, @@ -1879,6 +1894,8 @@ ctlfe_lun_disable(void *arg, int lun_id) struct ctlfe_lun_softc *lun_softc; softc = (struct ctlfe_softc *)arg; + if (softc->hba_misc & PIM_EXTLUNS) + lun_id = CAM_EXTLUN_BYTE_SWIZZLE(ctl_encode_lun(lun_id)); mtx_lock(&softc->lun_softc_mtx); STAILQ_FOREACH(lun_softc, &softc->lun_softc_list, links) { From owner-svn-src-stable@freebsd.org Fri Nov 13 19:26:51 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD754A2E1B2; Fri, 13 Nov 2015 19:26:51 +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 94D541B22; Fri, 13 Nov 2015 19:26:51 +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 tADJQoFZ089258; Fri, 13 Nov 2015 19:26:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJQoYO089257; Fri, 13 Nov 2015 19:26:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131926.tADJQoYO089257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290777 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:26:51 -0000 Author: mav Date: Fri Nov 13 19:26:50 2015 New Revision: 290777 URL: https://svnweb.freebsd.org/changeset/base/290777 Log: MFC r290387: Extend mask of VMware virtual disks. Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Fri Nov 13 19:24:44 2015 (r290776) +++ stable/10/sys/cam/scsi/scsi_da.c Fri Nov 13 19:26:50 2015 (r290777) @@ -368,7 +368,7 @@ static struct da_quirk_entry da_quirk_ta * VMware returns BUSY status when storage has transient * connectivity problems, so better wait. */ - {T_DIRECT, SIP_MEDIA_FIXED, "VMware", "Virtual disk", "*"}, + {T_DIRECT, SIP_MEDIA_FIXED, "VMware*", "*", "*"}, /*quirks*/ DA_Q_RETRY_BUSY }, /* USB mass storage devices supported by umass(4) */ From owner-svn-src-stable@freebsd.org Fri Nov 13 19:27:40 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53047A2E220; Fri, 13 Nov 2015 19:27:40 +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 193D71C94; Fri, 13 Nov 2015 19:27:40 +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 tADJRdLo089341; Fri, 13 Nov 2015 19:27:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJRdja089340; Fri, 13 Nov 2015 19:27:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131927.tADJRdja089340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290778 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:27:40 -0000 Author: mav Date: Fri Nov 13 19:27:38 2015 New Revision: 290778 URL: https://svnweb.freebsd.org/changeset/base/290778 Log: MFC r290458: Add two more KASSERTs. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:26:50 2015 (r290777) +++ stable/10/sys/cam/ctl/ctl.c Fri Nov 13 19:27:38 2015 (r290778) @@ -11044,7 +11044,15 @@ ctl_check_for_blockage(struct ctl_lun *l return (CTL_ACTION_BLOCK); pending_entry = ctl_get_cmd_entry(&pending_io->scsiio, NULL); + KASSERT(pending_entry->seridx < CTL_SERIDX_COUNT, + ("%s: Invalid seridx %d for pending CDB %02x %02x @ %p", + __func__, pending_entry->seridx, pending_io->scsiio.cdb[0], + pending_io->scsiio.cdb[1], pending_io)); ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio, NULL); + KASSERT(ooa_entry->seridx < CTL_SERIDX_COUNT, + ("%s: Invalid seridx %d for ooa CDB %02x %02x @ %p", + __func__, ooa_entry->seridx, ooa_io->scsiio.cdb[0], + ooa_io->scsiio.cdb[1], ooa_io)); serialize_row = ctl_serialize_table[ooa_entry->seridx]; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:32:19 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68156A2E3A6; Fri, 13 Nov 2015 19:32:19 +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 278A31FFF; Fri, 13 Nov 2015 19:32:19 +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 tADJWIN0091623; Fri, 13 Nov 2015 19:32:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJWIwV091621; Fri, 13 Nov 2015 19:32:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131932.tADJWIwV091621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290779 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:32:19 -0000 Author: mav Date: Fri Nov 13 19:32:17 2015 New Revision: 290779 URL: https://svnweb.freebsd.org/changeset/base/290779 Log: MFC r289219: Export bunch of state variables as sysctls. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:27:38 2015 (r290778) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:32:17 2015 (r290779) @@ -205,30 +205,55 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_sim_free(fc->sim, FALSE); return (ENOMEM); } - ISP_FC_PC(isp, chan)->num_threads += 1; + fc->num_threads += 1; #ifdef ISP_INTERNAL_TARGET ISP_SET_PC(isp, chan, proc_active, 1); if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { ISP_SET_PC(isp, chan, proc_active, 0); isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); } - ISP_FC_PC(isp, chan)->num_threads += 1; + fc->num_threads += 1; #endif if (chan > 0) { snprintf(name, sizeof(name), "chan%d", chan); tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, name, CTLFLAG_RW, 0, "Virtual channel"); } - SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwnn", CTLFLAG_RD, &FCPARAM(isp, chan)->isp_wwnn, "World Wide Node Name"); - SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwpn", CTLFLAG_RD, &FCPARAM(isp, chan)->isp_wwpn, "World Wide Port Name"); - SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "loop_down_limit", CTLFLAG_RW, &ISP_FC_PC(isp, chan)->loop_down_limit, 0, "Loop Down Limit"); - SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "gone_device_time", CTLFLAG_RW, &ISP_FC_PC(isp, chan)->gone_device_time, 0, "Gone Device Time"); + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, &fcp->isp_wwnn, + "World Wide Node Name"); + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, &fcp->isp_wwpn, + "World Wide Port Name"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "loop_down_limit", CTLFLAG_RW, &fc->loop_down_limit, 0, + "Loop Down Limit"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "gone_device_time", CTLFLAG_RW, &fc->gone_device_time, 0, + "Gone Device Time"); #if defined(ISP_TARGET_MODE) && defined(DEBUG) - SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "inject_lost_data_frame", CTLFLAG_RW, &ISP_FC_PC(isp, chan)->inject_lost_data_frame, 0, "Cause a Lost Frame on a Read"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "inject_lost_data_frame", CTLFLAG_RW, &fc->inject_lost_data_frame, 0, + "Cause a Lost Frame on a Read"); #endif SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "role", CTLTYPE_INT | CTLFLAG_RW, isp, chan, isp_role_sysctl, "I", "Current role"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "speed", CTLFLAG_RD, &fcp->isp_gbspeed, 0, + "Connection speed in gigabits"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "linkstate", CTLFLAG_RD, &fcp->isp_linkstate, 0, + "Link state"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "fwstate", CTLFLAG_RD, &fcp->isp_fwstate, 0, + "Firmware state"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "loopstate", CTLFLAG_RD, &fcp->isp_loopstate, 0, + "Loop state"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "topo", CTLFLAG_RD, &fcp->isp_topo, 0, + "Connection topology"); } return (0); } @@ -5700,7 +5725,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); va_end(ap); - FCPARAM(isp, bus)->link_active = 0; + FCPARAM(isp, bus)->isp_linkstate = 0; fc = ISP_FC_PC(isp, bus); if (cmd == ISPASYNC_LOOP_DOWN && fc->ready) { @@ -5733,7 +5758,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm * Change Notify before activating the FC cleanup * thread to look at the state of the loop again. */ - FCPARAM(isp, bus)->link_active = 1; + FCPARAM(isp, bus)->isp_linkstate = 1; fc->loop_dead = 0; fc->loop_down_time = 0; isp_prt(isp, ISP_LOGINFO, "Chan %d Loop UP", bus); Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:27:38 2015 (r290778) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:32:17 2015 (r290779) @@ -436,21 +436,19 @@ typedef struct { */ typedef struct { - uint32_t + int isp_gbspeed; /* Connection speed */ + int isp_linkstate; /* Link state */ + int isp_fwstate; /* ISP F/W state */ + int isp_loopstate; /* Loop State */ + int isp_topo; /* Connection Type */ + + uint32_t : 3, fctape_enabled : 1, - link_active : 1, sendmarker : 1, + loop_seen_once : 1, role : 2, - isp_gbspeed : 4, - isp_loopstate : 4, /* Current Loop State */ - isp_fwstate : 4, /* ISP F/W state */ - isp_topo : 3, /* Connection Type */ - loop_seen_once : 1; - - uint32_t : 8, isp_portid : 24; /* S_ID */ - uint16_t isp_fwoptions; uint16_t isp_xfwoptions; uint16_t isp_zfwoptions; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:33:14 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84EB6A2E469; Fri, 13 Nov 2015 19:33: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 4641612C7; Fri, 13 Nov 2015 19:33: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 tADJXDdF092330; Fri, 13 Nov 2015 19:33:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJXDpt092328; Fri, 13 Nov 2015 19:33:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131933.tADJXDpt092328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290780 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:33:14 -0000 Author: mav Date: Fri Nov 13 19:33:13 2015 New Revision: 290780 URL: https://svnweb.freebsd.org/changeset/base/290780 Log: MFC r289620: Decode more firmware attributes. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:32:17 2015 (r290779) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:33:13 2015 (r290780) @@ -1090,8 +1090,13 @@ isp_reset(ispsoftc_t *isp, int do_load_d } else { isp->isp_fwattr = mbs.param[6]; } - if (IS_24XX(isp) && (isp->isp_fwattr & ISP2400_FW_ATTR_EXTNDED)) { - isp->isp_fwattr |= (((uint64_t) mbs.param[15]) << 16) | (((uint64_t) mbs.param[16]) << 32) | (((uint64_t) mbs.param[17]) << 48); + if (IS_24XX(isp)) { + isp->isp_fwattr |= ((uint64_t) mbs.param[15]) << 16; + if (isp->isp_fwattr & ISP2400_FW_ATTR_EXTNDED) { + isp->isp_fwattr |= + (((uint64_t) mbs.param[16]) << 32) | + (((uint64_t) mbs.param[17]) << 48); + } } } else if (IS_SCSI(isp)) { #ifndef ISP_TARGET_MODE @@ -1132,6 +1137,18 @@ isp_reset(ispsoftc_t *isp, int do_load_d fwt ^=ISP2400_FW_ATTR_VI; ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s VI", buf); } + if (fwt & ISP2400_FW_ATTR_MQ) { + fwt ^=ISP2400_FW_ATTR_MQ; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s MQ", buf); + } + if (fwt & ISP2400_FW_ATTR_MSIX) { + fwt ^=ISP2400_FW_ATTR_MSIX; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s MSIX", buf); + } + if (fwt & ISP2400_FW_ATTR_FCOE) { + fwt ^=ISP2400_FW_ATTR_FCOE; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s FCOE", buf); + } if (fwt & ISP2400_FW_ATTR_VP0) { fwt ^= ISP2400_FW_ATTR_VP0; ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s VP0_Decoupling", buf); @@ -1140,7 +1157,43 @@ isp_reset(ispsoftc_t *isp, int do_load_d fwt ^= ISP2400_FW_ATTR_EXPFW; ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (Experimental)", buf); } + if (fwt & ISP2400_FW_ATTR_HOTFW) { + fwt ^= ISP2400_FW_ATTR_HOTFW; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s HotFW", buf); + } fwt &= ~ISP2400_FW_ATTR_EXTNDED; + if (fwt & ISP2400_FW_ATTR_EXTVP) { + fwt ^= ISP2400_FW_ATTR_EXTVP; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s ExtVP", buf); + } + if (fwt & ISP2400_FW_ATTR_VN2VN) { + fwt ^= ISP2400_FW_ATTR_VN2VN; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s VN2VN", buf); + } + if (fwt & ISP2400_FW_ATTR_EXMOFF) { + fwt ^= ISP2400_FW_ATTR_EXMOFF; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s EXMOFF", buf); + } + if (fwt & ISP2400_FW_ATTR_NPMOFF) { + fwt ^= ISP2400_FW_ATTR_NPMOFF; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s NPMOFF", buf); + } + if (fwt & ISP2400_FW_ATTR_DIFCHOP) { + fwt ^= ISP2400_FW_ATTR_DIFCHOP; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s DIFCHOP", buf); + } + if (fwt & ISP2400_FW_ATTR_SRIOV) { + fwt ^= ISP2400_FW_ATTR_SRIOV; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s SRIOV", buf); + } + if (fwt & ISP2400_FW_ATTR_ASICTMP) { + fwt ^= ISP2400_FW_ATTR_ASICTMP; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s ASICTMP", buf); + } + if (fwt & ISP2400_FW_ATTR_ATIOMQ) { + fwt ^= ISP2400_FW_ATTR_ATIOMQ; + ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s ATIOMQ", buf); + } if (fwt) { ISP_SNPRINTF(buf, ISP_FC_SCRLEN - strlen(buf), "%s (unknown 0x%08x%08x)", buf, (uint32_t) (fwt >> 32), (uint32_t) fwt); Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:32:17 2015 (r290779) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:33:13 2015 (r290780) @@ -820,9 +820,21 @@ typedef struct { #define ISP2400_FW_ATTR_SB2 0x0008 #define ISP2400_FW_ATTR_T10CRC 0x0010 #define ISP2400_FW_ATTR_VI 0x0020 +#define ISP2400_FW_ATTR_MQ 0x0040 +#define ISP2400_FW_ATTR_MSIX 0x0080 +#define ISP2400_FW_ATTR_FCOE 0x0800 #define ISP2400_FW_ATTR_VP0 0x1000 #define ISP2400_FW_ATTR_EXPFW 0x2000 +#define ISP2400_FW_ATTR_HOTFW 0x4000 #define ISP2400_FW_ATTR_EXTNDED 0x8000 +#define ISP2400_FW_ATTR_EXTVP 0x00010000 +#define ISP2400_FW_ATTR_VN2VN 0x00040000 +#define ISP2400_FW_ATTR_EXMOFF 0x00080000 +#define ISP2400_FW_ATTR_NPMOFF 0x00100000 +#define ISP2400_FW_ATTR_DIFCHOP 0x00400000 +#define ISP2400_FW_ATTR_SRIOV 0x02000000 +#define ISP2400_FW_ATTR_ASICTMP 0x0200000000 +#define ISP2400_FW_ATTR_ATIOMQ 0x0400000000 /* * These are either manifestly true or are dependent on f/w attributes From owner-svn-src-stable@freebsd.org Fri Nov 13 19:34:43 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90FDBA2E4E7; Fri, 13 Nov 2015 19:34:43 +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 4E58D1472; Fri, 13 Nov 2015 19:34:43 +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 tADJYgmu092432; Fri, 13 Nov 2015 19:34:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJYgov092429; Fri, 13 Nov 2015 19:34:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131934.tADJYgov092429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290781 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:34:43 -0000 Author: mav Date: Fri Nov 13 19:34:42 2015 New Revision: 290781 URL: https://svnweb.freebsd.org/changeset/base/290781 Log: MFC r289622: Zero mbox[1] for INIT_FIRMWARE to fix version 7.3 firmware. While there, add new fields to isp_icb_2400_t structure. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:33:13 2015 (r290780) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:34:42 2015 (r290781) @@ -1954,6 +1954,7 @@ isp_fibre_init(ispsoftc_t *isp) * Init the firmware */ MBSINIT(&mbs, MBOX_INIT_FIRMWARE, MBLOGALL, 30000000); + mbs.param[1] = 0; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); @@ -2253,6 +2254,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) } else { mbs.param[0] = MBOX_INIT_FIRMWARE; } + mbs.param[1] = 0; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); @@ -7108,7 +7110,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x00, 0x00), /* 0x45: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x46: */ ISP_FC_OPMAP(0xcf, 0x03), /* 0x47: GET PORT_DATABASE ENHANCED */ - ISP_FC_OPMAP(0xcd, 0x01), /* 0x48: MBOX_INIT_FIRMWARE_MULTI_ID */ + ISP_FC_OPMAP(0xcf, 0x0f), /* 0x48: MBOX_INIT_FIRMWARE_MULTI_ID */ ISP_FC_OPMAP(0xcd, 0x01), /* 0x49: MBOX_GET_VP_DATABASE */ ISP_FC_OPMAP_HALF(0x2, 0xcd, 0x0, 0x01), /* 0x4a: MBOX_GET_VP_DATABASE_ENTRY */ ISP_FC_OPMAP(0x00, 0x00), /* 0x4b: */ @@ -7132,7 +7134,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x07, 0x03), /* 0x5d: MBOX_GET_SET_DATA_RATE */ ISP_FC_OPMAP(0x00, 0x00), /* 0x5e: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x5f: */ - ISP_FC_OPMAP(0xcd, 0x01), /* 0x60: MBOX_INIT_FIRMWARE */ + ISP_FC_OPMAP(0xcf, 0x0f), /* 0x60: MBOX_INIT_FIRMWARE */ ISP_FC_OPMAP(0x00, 0x00), /* 0x61: */ ISP_FC_OPMAP(0x01, 0x01), /* 0x62: MBOX_INIT_LIP */ ISP_FC_OPMAP(0xcd, 0x03), /* 0x63: MBOX_GET_FC_AL_POSITION_MAP */ Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:33:13 2015 (r290780) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:34:42 2015 (r290781) @@ -1055,8 +1055,10 @@ typedef struct { uint16_t icb_prqstqlen; uint16_t icb_rqstaddr[4]; uint16_t icb_respaddr[4]; - uint16_t icb_priaddr[4]; - uint16_t icb_reserved1[4]; + uint16_t icb_priaddr[4]; + uint16_t icb_msixresp; + uint16_t icb_msixatio; + uint16_t icb_reserved1[2]; uint16_t icb_atio_in; uint16_t icb_atioqlen; uint16_t icb_atioqaddr[4]; @@ -1065,7 +1067,11 @@ typedef struct { uint32_t icb_fwoptions1; uint32_t icb_fwoptions2; uint32_t icb_fwoptions3; - uint16_t icb_reserved2[12]; + uint16_t icb_qos; + uint16_t icb_reserved2[3]; + uint16_t icb_enodemac[3]; + uint16_t icb_disctime; + uint16_t icb_reserved3[4]; } isp_icb_2400_t; #define RQRSP_ADDR0015 0 From owner-svn-src-stable@freebsd.org Fri Nov 13 19:36:45 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD18A2E563; Fri, 13 Nov 2015 19:36:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9649D1623; Fri, 13 Nov 2015 19:36:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJahZB092559; Fri, 13 Nov 2015 19:36:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJahtO092556; Fri, 13 Nov 2015 19:36:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131936.tADJahtO092556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290782 - in stable/10/sys: dev/isp dev/ispfw modules/ispfw modules/ispfw/isp_2400_multi modules/ispfw/isp_2500_multi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:36:45 -0000 Author: mav Date: Fri Nov 13 19:36:43 2015 New Revision: 290782 URL: https://svnweb.freebsd.org/changeset/base/290782 Log: MFC r289626: Update firmware images for Qlogic 24xx/25xx from 5.5.0 to 7.3.0. This also removes separate "_multi" images, since this funcationality is now in base, and there is simply no new images without it for years. Deleted: stable/10/sys/modules/ispfw/isp_2400_multi/ stable/10/sys/modules/ispfw/isp_2500_multi/ Modified: stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/ispfw/asm_2400.h stable/10/sys/dev/ispfw/asm_2500.h stable/10/sys/dev/ispfw/ispfw.c stable/10/sys/modules/ispfw/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:34:42 2015 (r290781) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:36:43 2015 (r290782) @@ -899,9 +899,6 @@ isp_pci_attach(device_t dev) if (IS_SCSI(isp) && (ISP_SPI_PC(isp, 0)->def_role & ISP_ROLE_TARGET)) { snprintf(fwname, sizeof (fwname), "isp_%04x_it", did); isp->isp_osinfo.fw = firmware_get(fwname); - } else if (IS_24XX(isp)) { - snprintf(fwname, sizeof (fwname), "isp_%04x_multi", did); - isp->isp_osinfo.fw = firmware_get(fwname); } if (isp->isp_osinfo.fw == NULL) { snprintf(fwname, sizeof (fwname), "isp_%04x", did); Modified: stable/10/sys/dev/ispfw/asm_2400.h ============================================================================== --- stable/10/sys/dev/ispfw/asm_2400.h Fri Nov 13 19:34:42 2015 (r290781) +++ stable/10/sys/dev/ispfw/asm_2400.h Fri Nov 13 19:36:43 2015 (r290782) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (C) 2005-2010 by Qlogic, Inc. + * Copyright (C) 2005-2014 by Qlogic, Inc. * All rights reserved. * * Redistribution and use in source and binary forms are permitted provided @@ -25,23 +25,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Firmware Version 5.05.00 (15:31 Dec 14, 2010) + * Firmware Version 7.03.00 (Apr 14, 2014) */ #ifdef ISP_2400 static const uint32_t isp_2400_risc_code[] = { - 0x0401f195, 0x00110000, 0x00100000, 0x0000afb1, - 0x00000005, 0x00000005, 0x00000000, 0x00008482, + 0x0401f195, 0x00112000, 0x00100000, 0x0000c798, + 0x00000007, 0x00000003, 0x00000000, 0x00009496, 0x00000003, 0x00000000, 0x20434f50, 0x59524947, 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32347878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020352e, 0x30352e30, + 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x42001800, 0x0010014c, 0x42002000, 0x0010bdc7, + 0x42001800, 0x0010014c, 0x42002000, 0x0010e36f, 0x500c0800, 0x800c1800, 0x500c1000, 0x800c1800, 0x54042000, 0x80102000, 0x80040800, 0x80081040, 0x040207fc, 0x500c0800, 0x800409c0, 0x040207f6, @@ -124,23 +124,23 @@ static const uint32_t isp_2400_risc_code 0x00006150, 0x00000010, 0x00006170, 0x00000010, 0x00006190, 0x00000010, 0x000061b0, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00100000, 0x00100000, 0x0000afb1, - 0xffffffff, 0x00110004, 0x00020000, 0x00000b53, - 0xffffffff, 0x00110b57, 0x0010d700, 0x00001ac0, - 0xffffffff, 0x00112617, 0x0000c000, 0x000007e8, - 0x00ffffff, 0x00112dff, 0x00008000, 0x000005e5, + 0x00000000, 0x00100000, 0x00100000, 0x0000c798, + 0xffffffff, 0x00112004, 0x00020000, 0x00000c50, + 0xffffffff, 0x00112c54, 0x0010fd00, 0x00001b58, + 0xffffffff, 0x001147ac, 0x0000c000, 0x000008b1, + 0x00ffffff, 0x0011505d, 0x00008000, 0x00000696, 0x00ffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, 0x40000000, 0x4203e000, 0x90000100, 0x40000000, 0x42000800, - 0x00020b54, 0x4202f000, 0x00000000, 0x42000000, + 0x00020c51, 0x4202f000, 0x00000000, 0x42000000, 0x00007023, 0x50000000, 0x8c000500, 0x04020003, 0x42000800, 0x00020000, 0x45780800, 0x80040800, 0x82040580, 0x00022000, 0x040207fc, 0x4178a000, - 0x4200a800, 0x0010afb1, 0x42000800, 0x0010d700, - 0x40540000, 0x8004b480, 0x0201f800, 0x0010aeeb, - 0x0401fac9, 0x0401fa00, 0x4803c856, 0x42000000, + 0x4200a800, 0x0010c798, 0x42000800, 0x0010fd00, + 0x40540000, 0x8004b480, 0x0201f800, 0x0010c5e6, + 0x0401fade, 0x0401fa0a, 0x4803c856, 0x42000000, 0x00001000, 0x50000000, 0x82000480, 0x24320002, - 0x0402000d, 0x0201f800, 0x0010af26, 0x04000008, + 0x0402000d, 0x0201f800, 0x0010c62d, 0x04000008, 0x42000800, 0x00007a17, 0x50040000, 0x8c00050e, 0x04020003, 0x8400054e, 0x44000800, 0x4a030000, 0x00000000, 0x4a03c020, 0x00000004, 0x4203e000, @@ -148,14743 +148,177 @@ static const uint32_t isp_2400_risc_code 0x00000003, 0x59e00023, 0x8c000500, 0x04020027, 0x42002800, 0x0010017d, 0x58140800, 0x4817c857, 0x4807c857, 0x800409c0, 0x0400000b, 0x58142002, - 0x4813c857, 0x58141003, 0x4c140000, 0x0401fa95, + 0x4813c857, 0x58141003, 0x4c140000, 0x0401faaa, 0x5c002800, 0x0402002a, 0x82142c00, 0x00000004, 0x0401f7f2, 0x42002800, 0x0010017d, 0x5814a000, 0x4817c857, 0x4853c857, 0x8050a1c0, 0x0400000f, 0x4c140000, 0x5814a801, 0x4857c857, 0x40500000, 0x80540480, 0x04000005, 0x5814b002, 0x485bc857, - 0x0201f800, 0x0010aee2, 0x5c002800, 0x82142c00, + 0x0201f800, 0x0010c5dd, 0x5c002800, 0x82142c00, 0x00000004, 0x0401f7ee, 0x42002800, 0x0010017d, 0x58140801, 0x4817c857, 0x4807c857, 0x800409c0, 0x04000018, 0x58142002, 0x4813c857, 0x58141003, - 0x4c140000, 0x0401fa6f, 0x04020005, 0x5c002800, + 0x4c140000, 0x0401fa84, 0x04020005, 0x5c002800, 0x82142c00, 0x00000004, 0x0401f7f2, 0x4803c856, 0x4a03c020, 0x00004010, 0x4a03c011, 0x40100011, 0x04006000, 0x4203e000, 0x40000000, 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, 0x0401f000, - 0x4803c856, 0x0201f800, 0x0010d704, 0x0401faf6, - 0x4a03c014, 0x001c001c, 0x42002000, 0x0010f1c0, - 0x0201f800, 0x0010aef3, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04000906, + 0x4803c856, 0x0201f800, 0x0010fd04, 0x0401fb0b, + 0x4a03c014, 0x001c001c, 0x42002000, 0x00111858, + 0x0201f800, 0x0010c5ee, 0x42000000, 0x00001000, + 0x50000000, 0x82000480, 0x24220001, 0x04000908, 0x42000000, 0x00001000, 0x50000000, 0x82000480, - 0x24320001, 0x04000900, 0x59c40000, 0x82000500, + 0x24320001, 0x04000902, 0x59c40000, 0x82000500, 0xffff0000, 0x80000120, 0x82000580, 0x00002422, - 0x04020005, 0x59a8006d, 0x84000540, 0x4803506d, + 0x04020005, 0x59a8007e, 0x84000540, 0x4803507e, 0x0401f00a, 0x59e00003, 0x82000500, 0x00030000, - 0x82000580, 0x00010000, 0x04020004, 0x59a8006d, - 0x84000542, 0x4803506d, 0x4c140000, 0x0201f800, - 0x0010a6a0, 0x5c002800, 0x42000800, 0x00001100, + 0x82000580, 0x00010000, 0x04020004, 0x59a8007e, + 0x84000542, 0x4803507e, 0x4c140000, 0x0201f800, + 0x0010bd98, 0x5c002800, 0x42000800, 0x00001100, 0x42001800, 0x00000100, 0x82141480, 0x0017ffff, 0x0402100d, 0x42000800, 0x00000900, 0x82141480, - 0x0013ffff, 0x04021008, 0x42000800, 0x00000480, - 0x42001800, 0x00000080, 0x82141480, 0x0011ffff, - 0x040018d5, 0x4807500d, 0x480f5251, 0x42001000, - 0x00000024, 0x0201f800, 0x00105fef, 0x82040c00, - 0x0010f694, 0x4807500b, 0x4a03c810, 0x00100000, - 0x4a03c811, 0x0010afb1, 0x4a03c812, 0x0010d700, - 0x4a03c813, 0x0010f1bf, 0x4a03c829, 0x00000004, + 0x0013ffff, 0x04021008, 0x42000800, 0x00000240, + 0x42001800, 0x00000040, 0x82141480, 0x0011ffff, + 0x040018d7, 0x48075013, 0x480f5257, 0x42001000, + 0x0000002c, 0x0201f800, 0x00106fe1, 0x82040c00, + 0x00111d44, 0x4807500b, 0x4a03c810, 0x00100000, + 0x4a03c811, 0x0010c798, 0x4a03c812, 0x0010fd00, + 0x4a03c813, 0x00111857, 0x4a03c829, 0x00000004, 0x59e40001, 0x82000540, 0x0003403f, 0x4803c801, - 0x42001000, 0x0000001c, 0x0401f9f0, 0x4202c000, - 0x0010f694, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, - 0x59aac80d, 0x49675050, 0x59a8000b, 0x4803500c, - 0x0201f800, 0x00107133, 0x0401fac4, 0x0401fb14, - 0x0201f800, 0x001017f9, 0x0201f800, 0x001010ea, - 0x0401fbdb, 0x0201f800, 0x00100ca5, 0x0201f800, - 0x0010602f, 0x0401f85c, 0x0201f800, 0x00101c0f, - 0x0201f800, 0x00104bce, 0x0201f800, 0x001044e5, - 0x0201f800, 0x00105acd, 0x0201f800, 0x001057ce, - 0x0201f800, 0x0010118f, 0x0201f800, 0x00100ff2, - 0x4203e000, 0xf0000001, 0x0201f800, 0x0010af45, - 0x4a03c018, 0x00000000, 0x4203e000, 0x20000511, - 0x4203e000, 0x50010000, 0x4a03c020, 0x00000000, - 0x04027010, 0x59e00020, 0x82000580, 0x00000002, - 0x0402000c, 0x4a03c020, 0x00004000, 0x4a03c011, - 0x40000010, 0x04006000, 0x4203e000, 0x40000000, - 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, - 0x4202d800, 0x00000000, 0x4203e000, 0xb0600000, - 0x59a80071, 0x4003f800, 0x0201f000, 0x00020004, - 0x4df00000, 0x4203e000, 0x50000000, 0x416c0000, - 0x82000c80, 0x00000008, 0x0402186b, 0x0c01f804, - 0x5c03e000, 0x0201f000, 0x00020008, 0x001002d0, - 0x0010f007, 0x0010ef4c, 0x001002cf, 0x0010ef18, - 0x001002cf, 0x001002cf, 0x001002e2, 0x0401f85e, - 0x42000800, 0x0010b8fa, 0x5804001e, 0x8c000500, - 0x0400000d, 0x84000500, 0x4800081e, 0x4202d800, - 0x00000004, 0x0401f97b, 0x49f3c857, 0x5c000800, - 0x5c000000, 0x82000540, 0x00003e00, 0x4c000000, - 0x4c040000, 0x1c01f000, 0x4a038805, 0x000000f0, - 0x1c01f000, 0x4a035048, 0x00000005, 0x4a035049, - 0x00000005, 0x4a03504a, 0x00000000, 0x4a03504b, - 0x00008482, 0x0201f800, 0x00104b98, 0x4a03541b, - 0x0000ffff, 0x4a03500f, 0x00ffffff, 0x0201f800, - 0x00108c7d, 0x4a03501f, 0x20200000, 0x4a035020, - 0x88000200, 0x4a035021, 0x00ff001f, 0x4a035022, - 0x000007d0, 0x4a035023, 0x80000000, 0x4a035024, - 0x00000200, 0x4a035025, 0x00ff0000, 0x4a035026, - 0x00010000, 0x4a03502d, 0x514c4f47, 0x4a03502e, - 0x49432020, 0x1c01f000, 0x4d440000, 0x417a8800, - 0x4c5c0000, 0x4178b800, 0x0201f800, 0x00020319, - 0x04020005, 0x0201f800, 0x00104181, 0x04020002, - 0x805cb800, 0x81468800, 0x83440580, 0x000007f0, - 0x040207f6, 0x405c0800, 0x5c00b800, 0x5c028800, - 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, - 0x4803c857, 0x0401f80c, 0x485fc857, 0x4203e000, - 0x50000000, 0x5c000000, 0x4d780000, 0x4200b800, - 0x00008002, 0x0401f009, 0x486bc857, 0x486fc857, - 0x4873c857, 0x485fc857, 0x4203e000, 0x50000000, - 0x4200b800, 0x00008002, 0x04006000, 0x4c000000, - 0x4c040000, 0x59bc00ea, 0x4803c857, 0x82000500, - 0x00000007, 0x82000580, 0x00000001, 0x04020005, - 0x42000800, 0x00000000, 0x0201f800, 0x001061cb, - 0x59b800ea, 0x4803c857, 0x4a0370e8, 0x00000004, - 0x5c000800, 0x4807c025, 0x80040920, 0x4807c026, - 0x5c000000, 0x4803c023, 0x80000120, 0x4803c024, - 0x5c000000, 0x4803c857, 0x4803c021, 0x80000120, - 0x4803c022, 0x41f80000, 0x4803c029, 0x80000120, - 0x4803c02a, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x4803c857, 0x0400104b, - 0x0201f800, 0x0010af26, 0x04000046, 0x42000800, - 0x0010c626, 0x46000800, 0xfaceface, 0x80040800, - 0x4c080000, 0x4c0c0000, 0x42001000, 0x00007a00, - 0x58080013, 0x44000800, 0x80040800, 0x58080019, - 0x44000800, 0x80040800, 0x5808001a, 0x44000800, - 0x80040800, 0x5808001b, 0x44000800, 0x80040800, - 0x5808001c, 0x44000800, 0x80040800, 0x5808001f, - 0x44000800, 0x80040800, 0x42001000, 0x00007a40, - 0x42001800, 0x0000000b, 0x50080000, 0x44000800, - 0x80081000, 0x80040800, 0x800c1840, 0x040207fb, - 0x42001800, 0x00000003, 0x42001000, 0x00007b00, - 0x480c1003, 0x58080005, 0x44000800, 0x80040800, - 0x800c1840, 0x040217fb, 0x42001000, 0x00007c00, - 0x58080002, 0x44000800, 0x80040800, 0x58080003, - 0x44000800, 0x80040800, 0x58080020, 0x44000800, - 0x80040800, 0x58080021, 0x44000800, 0x80040800, - 0x58080022, 0x44000800, 0x80040800, 0x58080023, - 0x44000800, 0x80040800, 0x5c001800, 0x5c001000, - 0x4a030000, 0x00000000, 0x485fc020, 0x905cb9c0, - 0x825cbd40, 0x00000012, 0x485fc011, 0x4203e000, - 0x40000000, 0x4202d800, 0x00000005, 0x4a03c017, - 0x00000000, 0x4203e000, 0x30000001, 0x0401f847, - 0x0401f7ff, 0x42000000, 0x00000004, 0x0401f80c, - 0x4a03c855, 0x0001eb5a, 0x59e40001, 0x82000540, - 0x00000700, 0x4803c801, 0x42000000, 0x0010bdb1, - 0x49780003, 0x49780004, 0x1c01f000, 0x42000800, - 0x0010bdb3, 0x44000800, 0x59e40801, 0x82041500, - 0xfff3c0ff, 0x480bc801, 0x8c040d24, 0x0400000c, - 0x4c000000, 0x59e41052, 0x59e40054, 0x800000d4, - 0x82000400, 0x0010c642, 0x80081480, 0x480bc853, - 0x4a03c800, 0x00000040, 0x5c000000, 0x4a03c850, - 0x0010c642, 0x800000d4, 0x82002400, 0x0010c641, - 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, - 0x0010c642, 0x82001400, 0x00001000, 0x45780000, - 0x80000000, 0x80081d80, 0x040207fd, 0x4807c801, - 0x1c01f000, 0x42002000, 0x0010bdb1, 0x59e41801, - 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, - 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, - 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, - 0x1c01f000, 0x1c01f000, 0x59a80059, 0x8c000530, - 0x040207fe, 0x4c080000, 0x42001000, 0x00000004, - 0x0401f862, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0201f800, 0x001059d2, 0x4c080000, 0x42001000, - 0x00000008, 0x0401f859, 0x5c001000, 0x4201d000, - 0x00028b0a, 0x0201f800, 0x001059d2, 0x4c080000, - 0x42001000, 0x00000010, 0x0401f850, 0x5c001000, - 0x4201d000, 0x00028b0a, 0x0201f800, 0x001059d2, - 0x0401f7e2, 0x8c00050c, 0x59a80859, 0x04020003, - 0x84040d30, 0x0401f006, 0x84040d70, 0x48075059, - 0x42001000, 0x00000000, 0x0401f040, 0x48075059, - 0x836c0500, 0x00000007, 0x0c01f001, 0x00100461, - 0x00100447, 0x00100447, 0x0010042f, 0x00100454, - 0x00100447, 0x00100447, 0x00100454, 0x59a8006d, - 0x8c000502, 0x04020013, 0x59c40801, 0x82040d00, - 0x00018000, 0x82040580, 0x00010000, 0x0400000a, - 0x82040580, 0x00008000, 0x04000004, 0x42001000, - 0x42004000, 0x0401f006, 0x42001000, 0x22002000, - 0x0401f003, 0x42001000, 0x12001000, 0x0401f025, - 0x42001000, 0x00001004, 0x0401f022, 0x59a8006d, - 0x8c000502, 0x04020008, 0x59a80059, 0x8c000534, - 0x04020004, 0x42001000, 0x74057005, 0x0401f819, - 0x1c01f000, 0x42001000, 0x00002008, 0x0401f7fc, - 0x59a80059, 0x8c000534, 0x0402000a, 0x59a8006d, - 0x8c000502, 0x04000004, 0x42001000, 0x24052005, - 0x0401f00c, 0x42001000, 0x74057005, 0x0401f009, - 0x1c01f000, 0x1c01f000, 0x82081500, 0x0000001c, - 0x82081540, 0x001c0000, 0x480bc013, 0x1c01f000, - 0x59a80059, 0x8c000530, 0x04000002, 0x84081570, - 0x480b5059, 0x8c000530, 0x04020005, 0x82081500, - 0x00007000, 0x80081114, 0x0401fff0, 0x1c01f000, - 0x41780000, 0x50041800, 0x800c0400, 0x80040800, - 0x80102040, 0x040207fc, 0x80080500, 0x80000540, - 0x1c01f000, 0x4202f000, 0x00000000, 0x41780000, - 0x41780800, 0x41781000, 0x41781800, 0x41782000, - 0x41782800, 0x41783000, 0x41783800, 0x41784000, - 0x41784800, 0x41785000, 0x41785800, 0x41786000, - 0x41786800, 0x41787000, 0x41787800, 0x41788000, - 0x41788800, 0x41789000, 0x41789800, 0x4178a000, - 0x4178a800, 0x4178b000, 0x4178b800, 0x4178c000, - 0x4178c800, 0x4178d000, 0x4178d800, 0x4178e000, - 0x4178e800, 0x4178f000, 0x4178f800, 0x41790000, - 0x41790800, 0x41791000, 0x41791800, 0x41792000, - 0x41792800, 0x41793000, 0x41793800, 0x41794000, - 0x41794800, 0x41795000, 0x41795800, 0x41796000, - 0x41796800, 0x41797000, 0x41797800, 0x41798000, - 0x41798800, 0x42019000, 0x0010b989, 0x42019800, - 0x0010b960, 0x4179a000, 0x4179a800, 0x4179b000, - 0x4179b800, 0x4179c800, 0x4179c000, 0x4179d000, - 0x4179d800, 0x4179e000, 0x4179e800, 0x4179f000, - 0x4179f800, 0x417a0000, 0x417a0800, 0x417a1000, - 0x417a1800, 0x417a2000, 0x42022800, 0x00006100, - 0x417a3000, 0x417a3800, 0x417a4000, 0x417a4800, - 0x417a5000, 0x417a5800, 0x417a6000, 0x417a6800, - 0x417a7000, 0x417a7800, 0x417a8000, 0x417a8800, - 0x417a9000, 0x417a9800, 0x417ae800, 0x417af800, - 0x42030000, 0x00007c00, 0x42031000, 0x0010bc5a, - 0x42031800, 0x0000bf1d, 0x42032000, 0x0000bf32, - 0x42032800, 0x0010bc22, 0x42033000, 0x00020b5d, - 0x42034000, 0x0010b8fa, 0x42033800, 0x0010b919, - 0x42034800, 0x0010b998, 0x42035000, 0x0010b880, - 0x42035800, 0x0010b080, 0x42030800, 0x0010b95b, - 0x417b6000, 0x42036800, 0x00006f00, 0x4203c800, - 0x00003000, 0x42037000, 0x0000ff00, 0x42037800, - 0x0000bf00, 0x42038000, 0x00007700, 0x42038800, - 0x00004000, 0x42039000, 0x00006000, 0x42039800, - 0x0010c35e, 0x4203a000, 0x00007600, 0x4203a800, - 0x00007400, 0x4203b000, 0x00007200, 0x4203b800, - 0x00007100, 0x4203c000, 0x00007000, 0x4203d000, - 0x00000000, 0x4203e800, 0x0002018e, 0x417bd800, - 0x1c01f000, 0x42000800, 0x00100000, 0x50040000, - 0x4c000000, 0x42000000, 0x0000aaaa, 0x44000800, - 0x42001800, 0x00005555, 0x42002000, 0x00010000, - 0x82102400, 0x00010000, 0x40100000, 0x80042c00, - 0x440c2800, 0x42003000, 0x0000000a, 0x80183040, - 0x040207ff, 0x50140000, 0x800c0580, 0x04020004, - 0x50040000, 0x800c0580, 0x040207f2, 0x5c000000, - 0x44000800, 0x80142840, 0x4817c861, 0x4817500a, - 0x1c01f000, 0x40681800, 0x59a80819, 0x800409c0, - 0x04020008, 0x49781c0c, 0x4a001a0c, 0x00000002, - 0x4a001804, 0x00000007, 0x59a8000f, 0x48001805, - 0x0401fdce, 0x800409c0, 0x04020002, 0x80040800, - 0x48041806, 0x1c01f000, 0x59a8080c, 0x4006d000, - 0x4202b800, 0x00000001, 0x59a8180a, 0x480fc857, - 0x82041400, 0x00000015, 0x82082400, 0x00000015, - 0x40100000, 0x800c0480, 0x04001006, 0x44080800, - 0x40080800, 0x40101000, 0x815eb800, 0x0401f7f7, - 0x45780800, 0x495f501a, 0x1c01f000, 0x0401f803, - 0x412d8800, 0x1c01f000, 0x835c0480, 0x00000020, - 0x0400100a, 0x496bc857, 0x815eb840, 0x416a5800, - 0x592ed000, 0x497a5800, 0x497a5801, 0x497a5805, - 0x812e59c0, 0x1c01f000, 0x42000000, 0x0010bd0f, - 0x0201f800, 0x0010ae10, 0x417a5800, 0x0401f7f9, - 0x0401f803, 0x412d8800, 0x1c01f000, 0x815eb840, - 0x04001009, 0x416a5800, 0x492fc857, 0x592ed000, - 0x497a5800, 0x497a5801, 0x497a5805, 0x812e59c0, - 0x1c01f000, 0x42000000, 0x0010bd0f, 0x0201f800, - 0x0010ae10, 0x417ab800, 0x417a5800, 0x0401f7f8, - 0x492fc857, 0x496a5800, 0x412ed000, 0x815eb800, - 0x59c80000, 0x82000540, 0x00001200, 0x48039000, - 0x1c01f000, 0x492fc857, 0x812e59c0, 0x04000007, - 0x592c0001, 0x497a5801, 0x4c000000, 0x0401fff1, - 0x5c025800, 0x0401f7f9, 0x1c01f000, 0x4807c856, - 0x42007000, 0x00020b54, 0x4a007000, 0x00000000, - 0x59e00003, 0x82000540, 0x00008080, 0x4803c003, - 0x4a03b805, 0x90000001, 0x59dc0006, 0x4a03b805, - 0x70000000, 0x59dc0006, 0x4a03b805, 0x30000000, - 0x59dc0006, 0x4a03b805, 0x80000000, 0x4200b000, - 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, - 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, - 0x60000001, 0x59dc0006, 0x4a03b805, 0x70000001, - 0x59dc0006, 0x4a03b805, 0x30000002, 0x4200b000, - 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, - 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, - 0x60000001, 0x4803c856, 0x0401ff98, 0x04000d6a, - 0x42001000, 0x0010bc55, 0x452c1000, 0x4a025801, - 0x00000001, 0x4a025802, 0x00000100, 0x4a025808, - 0x00106826, 0x497a5809, 0x497a580a, 0x497a580b, - 0x0401ff8a, 0x04000d5c, 0x42001000, 0x0010bc56, - 0x452c1000, 0x4a025801, 0x00000000, 0x4a025802, - 0x00000100, 0x4a025808, 0x00100f2f, 0x497a5803, - 0x497a5806, 0x497a5807, 0x497a5809, 0x59a8006d, - 0x8c000500, 0x04000006, 0x4a03b805, 0xe0000001, - 0x59dc0006, 0x8c000522, 0x040007fc, 0x1c01f000, - 0x40681000, 0x0201f800, 0x00020016, 0x1c01f000, - 0x42001000, 0x00020026, 0x0201f800, 0x0010587d, - 0x0201f800, 0x00108d64, 0x0201f800, 0x0010a32a, - 0x04000014, 0x4a03b805, 0x30000002, 0x59dc0006, - 0x4807b800, 0x480bb801, 0x42007000, 0x00020b54, - 0x4a007002, 0x00000040, 0x480c7008, 0x58380007, - 0x82000400, 0x00000005, 0x48007003, 0x4a007000, - 0x00000003, 0x4803b803, 0x0201f000, 0x00020050, - 0x42000000, 0x0010bc77, 0x0201f800, 0x0010ae10, - 0x0201f800, 0x00108d7c, 0x42000800, 0x00000001, - 0x42001000, 0x00020026, 0x0201f800, 0x00105856, - 0x42007000, 0x00020b54, 0x0201f000, 0x00020030, - 0x58380802, 0x42001000, 0x0000ff00, 0x82040480, - 0x0000ff00, 0x04021003, 0x40041000, 0x80000580, - 0x48007002, 0x480bb802, 0x59dc0006, 0x4a03b805, - 0x10000000, 0x1c01f000, 0x4a03b805, 0x30000001, - 0x58386001, 0x58301008, 0x4807c857, 0x4803c857, - 0x4833c857, 0x4a006002, 0x00000200, 0x4a007000, - 0x00000000, 0x800811c0, 0x02000000, 0x0002002c, - 0x0201f000, 0x00020092, 0x59dc0006, 0x8c000520, - 0x0400000a, 0x02004800, 0x0002090c, 0x59dc0006, - 0x82000500, 0x00006000, 0x04000004, 0x82000580, - 0x00006000, 0x040207f8, 0x1c01f000, 0x41781800, - 0x58382005, 0x40300000, 0x80100580, 0x04000007, - 0x40101800, 0x58102000, 0x801021c0, 0x040207fa, - 0x4803c856, 0x0401f011, 0x4833c857, 0x58302000, - 0x49786000, 0x800c19c0, 0x04020008, 0x801021c0, - 0x04000003, 0x48107005, 0x0401f008, 0x49787005, - 0x49787004, 0x0401f005, 0x48101800, 0x801021c0, - 0x04020002, 0x480c7004, 0x1c01f000, 0x4803c856, - 0x4dc00000, 0x42007000, 0x0010bc58, 0x4a007400, - 0x00000000, 0x49787001, 0x42038000, 0x00007720, - 0x4a038006, 0x60000001, 0x4a038009, 0xf4f60000, - 0x42038000, 0x00007700, 0x4a038006, 0x60000001, - 0x4a038009, 0xf4f60000, 0x4a03c822, 0x00000010, - 0x4a0370e8, 0x00000000, 0x0401f809, 0x4a0370e9, - 0x00003a0f, 0x4a0370e8, 0x00000000, 0x4a0370e8, - 0x00000001, 0x5c038000, 0x1c01f000, 0x4c5c0000, - 0x4178b800, 0x0401f80a, 0x5c00b800, 0x1c01f000, - 0x4803c856, 0x4c5c0000, 0x825cbd40, 0x00000001, - 0x0401f803, 0x5c00b800, 0x1c01f000, 0x4803c856, - 0x4dc00000, 0x4c500000, 0x4c580000, 0x4c540000, - 0x4a0370e8, 0x00000000, 0x805cb9c0, 0x0400000b, - 0x4a038807, 0x00000004, 0x4a0370e5, 0x00080000, - 0x59b800ea, 0x8c000510, 0x04000004, 0x59b800e0, - 0x0401f879, 0x0401f7fb, 0x42038000, 0x00007720, - 0x0201f800, 0x00100c07, 0x59c00007, 0x4a038006, - 0x20000000, 0x59c00007, 0x4a038006, 0x8000000a, - 0x59c00007, 0x4a038006, 0x8000000b, 0x59c00007, - 0x4a038006, 0x40000001, 0x83c00580, 0x00007700, - 0x04000004, 0x42038000, 0x00007700, 0x0401f7ed, - 0x42038000, 0x00007720, 0x42000800, 0x00000800, - 0x59c00007, 0x8c00051e, 0x04000006, 0x4a038006, - 0x90000001, 0x80040840, 0x040207fa, 0x0401fc6e, - 0x83c00580, 0x00007700, 0x04000004, 0x42038000, - 0x00007700, 0x0401f7f1, 0x4178a000, 0x805cb9c0, - 0x0402001d, 0x4200b000, 0x00000020, 0x83b8ac00, - 0x00000020, 0x0201f800, 0x0010aeeb, 0x4a0370fb, - 0x00000001, 0x4a037020, 0x00100e3a, 0x59a8002c, - 0x82000500, 0x0000ffff, 0x48037021, 0x4a037035, - 0x0010c2a4, 0x4a037030, 0x0010b88f, 0x4a037031, - 0x0010b080, 0x4a037032, 0x0010b96b, 0x4a037036, - 0x0010b976, 0x59840002, 0x48037034, 0x4a037038, - 0x00100e31, 0x4a0370fb, 0x00000001, 0x4200b000, - 0x00000020, 0x83b8ac00, 0x00000000, 0x0201f800, - 0x0010aeeb, 0x4200b000, 0x00000040, 0x83b8ac00, - 0x00000040, 0x0201f800, 0x0010aeeb, 0x805cb9c0, - 0x04020004, 0x4a0370e4, 0xaaaaaaaa, 0x0401f003, - 0x4a0370e4, 0xa2aa2a82, 0x4a0370e5, 0xaaaaaaaa, - 0x4a0370e6, 0xaaaaaaaa, 0x4a0370fb, 0x00000000, - 0x4a0370e6, 0xaaaaaaaa, 0x42038000, 0x00007720, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x04020c25, 0x42038000, 0x00007700, 0x4a038006, - 0x90000000, 0x59c00007, 0x8c00051e, 0x04020c1e, - 0x5c00a800, 0x5c00b000, 0x5c00a000, 0x5c038000, - 0x1c01f000, 0x4d300000, 0x4d380000, 0x40026000, - 0x82000500, 0x7f000000, 0x82000580, 0x60000000, - 0x04020012, 0x83326500, 0x00ffffff, 0x0201f800, - 0x00109291, 0x0402000d, 0x59300203, 0x82000580, - 0x00000004, 0x04020009, 0x59300c07, 0x82040580, - 0x00000009, 0x04020005, 0x42027000, 0x00000047, - 0x0201f800, 0x00020a34, 0x5c027000, 0x5c026000, - 0x1c01f000, 0x4d300000, 0x4d2c0000, 0x4d340000, - 0x4d400000, 0x4cfc0000, 0x4d380000, 0x4d3c0000, - 0x4d440000, 0x4d4c0000, 0x4d480000, 0x4c5c0000, - 0x4c600000, 0x4c640000, 0x4d040000, 0x4cc80000, - 0x4ccc0000, 0x4cf40000, 0x4cf80000, 0x0201f800, - 0x00020095, 0x5c01f000, 0x5c01e800, 0x5c019800, - 0x5c019000, 0x5c020800, 0x5c00c800, 0x5c00c000, - 0x5c00b800, 0x5c029000, 0x5c029800, 0x5c028800, - 0x5c027800, 0x5c027000, 0x5c01f800, 0x5c028000, - 0x5c026800, 0x5c025800, 0x5c026000, 0x1c01f000, - 0x493bc857, 0x0201f000, 0x000200bc, 0x83300500, - 0x000000ff, 0x82000c80, 0x00000007, 0x02021800, - 0x0010032d, 0x0c01f025, 0x1c01f000, 0x82000d00, - 0xc0000038, 0x02020800, 0x00100322, 0x0201f800, - 0x0010032d, 0x00000000, 0x00000048, 0x00000054, - 0x00000053, 0x00100784, 0x001007a8, 0x001007a3, - 0x001007c7, 0x0010078f, 0x0010079b, 0x00100784, - 0x001007c2, 0x0010080e, 0x00100784, 0x00100811, - 0x00100784, 0x00100784, 0x00100814, 0x0010081a, - 0x00100837, 0x0010084c, 0x00100784, 0x00100855, - 0x00100861, 0x00100784, 0x00100784, 0x00100784, - 0x0201f800, 0x0010032d, 0x0010078d, 0x001008f8, - 0x001007d4, 0x001007fd, 0x0010078d, 0x0010078d, - 0x0010078d, 0x0201f800, 0x0010032d, 0x4803c856, - 0x59300004, 0x8c00053e, 0x04020005, 0x42027000, - 0x00000055, 0x0201f000, 0x00020a34, 0x0201f800, - 0x001064f2, 0x040007fa, 0x1c01f000, 0x4803c856, - 0x0401f8c7, 0x40002800, 0x41782000, 0x42027000, - 0x00000056, 0x0201f000, 0x00020a34, 0x4803c856, - 0x42027000, 0x00000057, 0x0201f000, 0x00020a34, - 0x4803c856, 0x59325809, 0x812e59c0, 0x04000016, - 0x59300008, 0x8c00051a, 0x0402000d, 0x592c0409, - 0x8c00051c, 0x04020003, 0x4a026012, 0xffffffff, - 0x59300004, 0x8c00053e, 0x04020008, 0x42027000, - 0x00000048, 0x0201f000, 0x00020a34, 0x4a025a07, - 0x00000007, 0x0401f7f5, 0x0201f800, 0x001064f2, - 0x040007f7, 0x1c01f000, 0x4803c856, 0x83300500, - 0x00ffffff, 0x0201f000, 0x00105e17, 0x1c01f000, - 0x4c040000, 0x59b808ea, 0x82040d00, 0x00000007, - 0x82040580, 0x00000003, 0x04000004, 0x42000000, - 0x60000000, 0x0401f8c6, 0x5c000800, 0x1c01f000, - 0x0401f914, 0x0400001b, 0x59325809, 0x812e59c0, - 0x04000018, 0x592c0205, 0x82000500, 0x000000ff, - 0x82000d80, 0x00000029, 0x04020012, 0x59300203, - 0x82000580, 0x00000003, 0x0400000b, 0x59300808, - 0x84040d26, 0x48066008, 0x0201f800, 0x00020111, - 0x4a03900d, 0x00000040, 0x4a0370e5, 0x00000008, - 0x1c01f000, 0x0201f800, 0x001064f2, 0x040007f4, - 0x42000000, 0x0010bd15, 0x0201f800, 0x0010ae10, - 0x5988014a, 0x80000000, 0x4803114a, 0x4a03900d, - 0x00000040, 0x42000000, 0xc0000000, 0x0201f000, - 0x00020105, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x4200c800, 0x0010c2ab, 0x4200b800, 0x00003000, - 0x4200c000, 0x00000105, 0x0201f800, 0x00105655, - 0x4a0370e4, 0x02000000, 0x5c00c800, 0x5c00c000, - 0x5c00b800, 0x1c01f000, 0x4933c857, 0x0201f000, - 0x00020a10, 0x4933c857, 0x0401fbfd, 0x1c01f000, - 0x41300800, 0x800409c0, 0x02020800, 0x0010032d, - 0x0201f800, 0x00100322, 0x42000000, 0x0010bd15, - 0x0201f800, 0x0010ae10, 0x4933c857, 0x813261c0, - 0x02000800, 0x0010032d, 0x0401f841, 0x40002800, - 0x0201f800, 0x0010ad79, 0x4c140000, 0x59a8006a, - 0x80000540, 0x04000004, 0x8c142d2a, 0x04000002, - 0x0401fbe3, 0x5c002800, 0x0401f8ae, 0x04000007, - 0x5932680a, 0x59340200, 0x8c00050e, 0x59300415, - 0x02020800, 0x00108c33, 0x1c01f000, 0x42000000, - 0x0010bd15, 0x0201f800, 0x0010ae10, 0x4933c857, - 0x813261c0, 0x02000800, 0x0010032d, 0x0401f89d, - 0x0400000b, 0x0201f800, 0x00108953, 0x04000008, - 0x59325809, 0x592c0209, 0x8400054e, 0x48025a09, - 0x417a7800, 0x0201f800, 0x0010853c, 0x1c01f000, - 0x485fc857, 0x5c000000, 0x4d780000, 0x4203e000, - 0x50000000, 0x4200b800, 0x00008005, 0x0201f000, - 0x00100332, 0x4933c857, 0x83300480, 0x00000020, - 0x02021800, 0x0010032d, 0x83300c00, 0x0010bd88, - 0x50040000, 0x80000000, 0x04001002, 0x44000800, - 0x1c01f000, 0x4933c857, 0x0401f7f4, 0x4807c856, - 0x59b800ea, 0x8c000510, 0x040007fd, 0x59b800e0, - 0x4803c857, 0x1c01f000, 0x4803c856, 0x42000000, - 0x10000000, 0x41300800, 0x0401f029, 0x8c000510, - 0x02000000, 0x0002010b, 0x4c040000, 0x0401f80b, - 0x5c000800, 0x82100480, 0x00000008, 0x02001000, - 0x0002010b, 0x4c040000, 0x0401feb7, 0x5c000800, - 0x0201f000, 0x0002010b, 0x59b800e2, 0x59b820e2, - 0x80100580, 0x040207fd, 0x80102114, 0x0401f001, - 0x40101800, 0x800c190a, 0x82100500, 0x0000001f, - 0x820c1d00, 0x0000001f, 0x800c2480, 0x82102500, - 0x0000001f, 0x1c01f000, 0x40680000, 0x406c0800, - 0x0401f807, 0x42018800, 0x00000001, 0x04020003, - 0x42018800, 0x00000000, 0x1c01f000, 0x82000500, - 0xf0000000, 0x82040d00, 0x0fffffff, 0x80040d40, - 0x4807c857, 0x42001000, 0x0010bc59, 0x50080000, - 0x80000540, 0x04020005, 0x4a0370e5, 0x00000003, - 0x4a0370e4, 0x00000300, 0x80000000, 0x44001000, - 0x42001000, 0x00000400, 0x59b800ea, 0x8c000510, - 0x0400000c, 0x0401ffd1, 0x82100480, 0x00000008, - 0x04001007, 0x4c040000, 0x4c080000, 0x0401fe7e, - 0x5c001000, 0x5c000800, 0x0401f020, 0x59b800ea, - 0x8c000516, 0x0402001d, 0x4a0370e4, 0x00300000, - 0x480770e1, 0x42001000, 0x0000ff00, 0x80081040, - 0x04000012, 0x59b808e4, 0x8c040d28, 0x040207fc, - 0x42001000, 0x0010bc59, 0x50080000, 0x80000040, - 0x04020005, 0x4a0370e5, 0x00000002, 0x4a0370e4, - 0x00000200, 0x02001800, 0x0010032d, 0x44001000, - 0x8c040d2c, 0x1c01f000, 0x41f80000, 0x50000000, - 0x0201f800, 0x0010032d, 0x80081040, 0x040207d3, - 0x41f80000, 0x50000000, 0x0201f800, 0x0010032d, - 0x4d380000, 0x59300c07, 0x82040580, 0x00000009, - 0x04020006, 0x42027000, 0x00000047, 0x0201f800, - 0x00020a34, 0x80000580, 0x5c027000, 0x1c01f000, - 0x4c500000, 0x4a03900d, 0x00000001, 0x59c8a020, - 0x4a03900d, 0x00000002, 0x59c80820, 0x8c50a52e, - 0x04000002, 0x900409c0, 0x82040d00, 0x0000ffff, - 0x0201f800, 0x00105617, 0x5c00a000, 0x1c01f000, - 0x42000000, 0x0010bd0c, 0x0201f800, 0x0010ae10, - 0x0401ffec, 0x0400004e, 0x4933c857, 0x59300407, - 0x82000580, 0x00000000, 0x04000049, 0x59c82021, - 0x4a03900d, 0x00000001, 0x59c82821, 0x82142d00, - 0x0000ffff, 0x59325809, 0x812e59c0, 0x04000040, - 0x5932680a, 0x0201f800, 0x001040c4, 0x02020800, - 0x00108c1b, 0x599c0019, 0x8c00050c, 0x04020018, - 0x0201f800, 0x001040c4, 0x04020015, 0x59300812, - 0x4807c857, 0x592c0409, 0x8c00051c, 0x0402000e, - 0x8400055c, 0x48025c09, 0x592c0a05, 0x82040d00, - 0x000000ff, 0x82040580, 0x00000048, 0x04000004, - 0x82040580, 0x00000018, 0x04020003, 0x59300812, - 0x48065803, 0x4a026012, 0x7fffffff, 0x48166014, - 0x0201f800, 0x001040c4, 0x04000004, 0x59300415, - 0x8c00051c, 0x04000004, 0x599c0019, 0x8c00050c, - 0x04000017, 0x0201f800, 0x00100e5a, 0x04020014, - 0x0401fa2f, 0x40280000, 0x4802600e, 0x04000005, - 0x4832600c, 0x50200000, 0x4802600b, 0x4822600d, - 0x59300415, 0x8c00051c, 0x04020004, 0x599c0019, - 0x8c00050c, 0x04020885, 0x4a03900d, 0x00000040, - 0x4a0370e5, 0x00000008, 0x1c01f000, 0x42000000, - 0x0010bd15, 0x0201f800, 0x0010ae10, 0x5988014c, - 0x80000000, 0x4803114c, 0x4a03900d, 0x00000040, - 0x42000000, 0xc0000000, 0x0201f000, 0x00020105, - 0x4cf80000, 0x58f40000, 0x8001f540, 0x0401f820, - 0x41781800, 0x0401f8f9, 0x04020014, 0x44140800, - 0x0401f82a, 0x04000011, 0x40043800, 0x42001800, - 0x00000001, 0x40142000, 0x0401f8f0, 0x0402000b, - 0x801c3800, 0x501c0000, 0x44000800, 0x0401f810, - 0x801c0580, 0x04000004, 0x44103800, 0x801c3840, - 0x44143800, 0x0401f819, 0x5c01f000, 0x1c01f000, - 0x80f9f1c0, 0x04020003, 0x58f41202, 0x0401f003, - 0x42001000, 0x00000007, 0x1c01f000, 0x80f9f1c0, - 0x04020006, 0x58f40401, 0x82000480, 0x00000002, - 0x80f40400, 0x0401f005, 0x58f80401, 0x82000480, - 0x00000002, 0x80f80400, 0x50002800, 0x80000000, - 0x50002000, 0x1c01f000, 0x80f9f1c0, 0x04020008, - 0x58f40401, 0x82000480, 0x00000002, 0x02001800, - 0x0010032d, 0x4801ec01, 0x0401f00b, 0x58f80401, - 0x82000480, 0x00000002, 0x02001800, 0x0010032d, - 0x4801f401, 0x82000580, 0x00000002, 0x04020002, - 0x0401f81b, 0x58f40202, 0x80000040, 0x4801ea02, - 0x02000800, 0x0010032d, 0x82000580, 0x00000001, - 0x1c01f000, 0x82f40580, 0xffffffff, 0x0400000f, - 0x58f40201, 0x82000580, 0x0000dcb3, 0x02020800, - 0x0010032d, 0x58f40000, 0x8001f540, 0x04000006, - 0x58f80201, 0x82000580, 0x0000ddb9, 0x02020800, - 0x0010032d, 0x0401f80a, 0x1c01f000, 0x4d2c0000, - 0x40fa5800, 0x0201f800, 0x00100580, 0x4979e800, - 0x4179f000, 0x5c025800, 0x1c01f000, 0x80f5e9c0, - 0x04000009, 0x80f9f1c0, 0x04020ff5, 0x4d2c0000, - 0x40f65800, 0x0201f800, 0x00100580, 0x4179e800, - 0x5c025800, 0x1c01f000, 0x4cf40000, 0x0201f800, - 0x001040c4, 0x04020036, 0x59300808, 0x82040500, - 0x00013100, 0x04020032, 0x8c040d22, 0x04000032, - 0x59300020, 0x8001ed40, 0x02000800, 0x0010032d, - 0x82000580, 0xffffffff, 0x04000029, 0x58f40201, - 0x82000580, 0x0000dcb3, 0x02020800, 0x0010032d, - 0x58f40a02, 0x82040500, 0x0000fffe, 0x04000003, - 0x0401ff74, 0x58f40a02, 0x82040480, 0x0000000f, - 0x04021059, 0x80040800, 0x4805ea02, 0x82040580, - 0x00000008, 0x0400005d, 0x82040480, 0x00000008, - 0x0400100a, 0x58f40000, 0x8001ed40, 0x02000800, - 0x0010032d, 0x58f40201, 0x82000580, 0x0000ddb9, - 0x02020800, 0x0010032d, 0x58f40401, 0x82000c00, - 0x00000002, 0x4805ec01, 0x80f40400, 0x59300813, - 0x44040000, 0x80000000, 0x45780000, 0x5c01e800, - 0x1c01f000, 0x42001000, 0x00000400, 0x59b800e4, - 0x8c000524, 0x04020023, 0x4a0370e4, 0x00030000, - 0x40000000, 0x59b800e4, 0x8c000524, 0x0402001b, - 0x59300808, 0x84040d62, 0x48066008, 0x4a0370e4, - 0x00020000, 0x4d2c0000, 0x0201f800, 0x0010055a, - 0x04000025, 0x492e6020, 0x4a025a01, 0x0000dcb3, - 0x59300009, 0x80001d40, 0x02000800, 0x0010032d, - 0x580c0810, 0x48065803, 0x59301812, 0x40040000, - 0x800c0580, 0x0402000d, 0x497a5a02, 0x4a025c01, - 0x00000004, 0x0401f011, 0x4a0370e4, 0x00020000, - 0x40000000, 0x40000000, 0x80081040, 0x02000800, - 0x0010032d, 0x0401f7d6, 0x4a025a02, 0x00000001, - 0x4a025c01, 0x00000006, 0x497a5804, 0x400c0000, - 0x80040480, 0x48025805, 0x412de800, 0x5c025800, - 0x0401f7a9, 0x5c025800, 0x4a026020, 0xffffffff, - 0x0401f7c3, 0x4d2c0000, 0x58f65800, 0x0201f800, - 0x00100580, 0x40f65800, 0x0201f800, 0x00100580, - 0x5c025800, 0x0401f7f5, 0x4d2c0000, 0x0201f800, - 0x0010055a, 0x040007f8, 0x4a025a01, 0x0000ddb9, - 0x4a025c01, 0x00000002, 0x492de800, 0x412de800, - 0x5c025800, 0x0401f7a5, 0x0401ff1e, 0x82f40400, - 0x00000004, 0x800c0400, 0x40000800, 0x50040000, - 0x80100580, 0x04000016, 0x82040c00, 0x00000002, - 0x80081040, 0x040207fa, 0x80f9f1c0, 0x04000011, - 0x58f41202, 0x82081480, 0x00000007, 0x82f80400, - 0x00000002, 0x800c0400, 0x40000800, 0x50040000, - 0x80100580, 0x04000006, 0x82040c00, 0x00000002, - 0x80081040, 0x040207fa, 0x0401f002, 0x1c01f000, - 0x82000540, 0x00000001, 0x0401f7fd, 0x4cf40000, - 0x4cf80000, 0x4001e800, 0x812e59c0, 0x04000024, - 0x592c0a07, 0x800409c0, 0x04020021, 0x82f40580, - 0xffffffff, 0x0400001b, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x0010032d, 0x58f40000, - 0x8001f540, 0x04000006, 0x58f80201, 0x82000580, - 0x0000ddb9, 0x02020800, 0x0010032d, 0x41783800, - 0x58f44003, 0x0401f839, 0x04020009, 0x0401ff2c, - 0x497a6020, 0x59300808, 0x84040d22, 0x48066008, - 0x5c01f000, 0x5c01e800, 0x1c01f000, 0x0401ff24, - 0x4a025a07, 0x00000011, 0x0401f7f6, 0x0401ff06, - 0x0401f7f4, 0x4cf40000, 0x4cf80000, 0x4001e800, - 0x82040580, 0x00000001, 0x04020020, 0x82f40580, - 0xffffffff, 0x0400001a, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x0010032d, 0x58f40000, - 0x8001f540, 0x04000006, 0x58f80201, 0x82000580, - 0x0000ddb9, 0x02020800, 0x0010032d, 0x41783800, - 0x58f44003, 0x0401f811, 0x04020008, 0x0401ff04, - 0x42000800, 0x00000001, 0x497a6020, 0x5c01f000, - 0x5c01e800, 0x1c01f000, 0x0401fefd, 0x42000800, - 0x00000011, 0x0401f7f9, 0x4c040000, 0x0401fede, - 0x5c000800, 0x0401f7f5, 0x4803c856, 0x401c2000, - 0x41781800, 0x4c200000, 0x0401ff88, 0x5c004000, - 0x0402002a, 0x40202000, 0x42001800, 0x00000001, - 0x0401ff82, 0x04020025, 0x0401fe9e, 0x40082800, - 0x82f43400, 0x00000004, 0x50182000, 0x40100000, - 0x801c0580, 0x04000005, 0x42001800, 0x00000001, - 0x0401ff76, 0x04020019, 0x82183400, 0x00000002, - 0x80142840, 0x040207f5, 0x80f9f1c0, 0x04000012, - 0x58f42a02, 0x82142c80, 0x00000007, 0x82f83400, - 0x00000002, 0x50182000, 0x40100000, 0x801c0580, - 0x04000005, 0x42001800, 0x00000001, 0x0401ff63, - 0x04020006, 0x82183400, 0x00000002, 0x80142840, - 0x040207f5, 0x1c01f000, 0x82000540, 0x00000001, - 0x0401f7fd, 0x0201f800, 0x0010032d, 0x58380a05, - 0x82040d00, 0x000000ff, 0x82040580, 0x0000001b, - 0x04000004, 0x82040580, 0x0000002b, 0x040207f6, - 0x50200000, 0x80387c00, 0x583c2800, 0x583c2001, - 0x583c1002, 0x592c0a08, 0x58383010, 0x59303808, - 0x497a6013, 0x497a6014, 0x0201f000, 0x00020149, - 0x58380208, 0x8c000502, 0x040007e7, 0x50200000, - 0x80387c00, 0x583c2800, 0x583c2001, 0x58380405, - 0x80001540, 0x04020002, 0x58381408, 0x58c83401, - 0x58380c09, 0x59303808, 0x497a6013, 0x497a6014, - 0x0201f000, 0x00020149, 0x592c0409, 0x8c000502, - 0x040007d5, 0x592c040a, 0x80000540, 0x040007d2, - 0x82000c80, 0x00000002, 0x04001011, 0x58380001, - 0x80007540, 0x02000800, 0x0010032d, 0x58380205, - 0x82000500, 0x0000000f, 0x82000400, 0x00100e3a, - 0x50004000, 0x40040000, 0x800409c0, 0x04000005, - 0x82040c80, 0x00000005, 0x040217f1, 0x80204400, - 0x50200000, 0x80387c00, 0x583c2800, 0x583c2001, - 0x583c1002, 0x592c0a08, 0x592c4c09, 0x592c300e, - 0x59303808, 0x497a6013, 0x497a6014, 0x4816600f, - 0x48126010, 0x480a6011, 0x481a6012, 0x80040840, - 0x4806600e, 0x02000000, 0x00020151, 0x80204000, - 0x50201800, 0x800c19c0, 0x0402000c, 0x58380001, - 0x80007540, 0x02000800, 0x0010032d, 0x58380205, - 0x82000500, 0x0000000f, 0x82000400, 0x00100e3a, - 0x50004000, 0x50201800, 0x483a600c, 0x480e600b, - 0x4822600d, 0x0201f000, 0x00020151, 0x4803c856, - 0x592c0209, 0x8c00051e, 0x04020017, 0x50200000, - 0x80306c00, 0x40240000, 0x0c01f001, 0x00100b7f, - 0x00100b7f, 0x00100b88, 0x00100b7f, 0x00100b7f, - 0x00100b7f, 0x00100b7f, 0x00100b7f, 0x00100b88, - 0x00100b7f, 0x00100b88, 0x00100b7f, 0x00100b7f, - 0x00100b88, 0x00100b7f, 0x00100b7f, 0x0201f800, - 0x0010032d, 0x8400051e, 0x48025a09, 0x50200000, - 0x80306c00, 0x58343801, 0x481e6010, 0x0401f007, - 0x58341802, 0x58342800, 0x58343801, 0x480e6011, - 0x4816600f, 0x481e6010, 0x0401f28a, 0x4933c857, - 0x5931f809, 0x59301006, 0x800811c0, 0x0400000b, - 0x41780800, 0x42000000, 0x0000000a, 0x0201f800, - 0x0010600e, 0x80080102, 0x04020002, 0x84001542, - 0x80081040, 0x4809fc07, 0x4a026006, 0x00000002, - 0x592c040a, 0x82000500, 0x00000008, 0x0400000b, - 0x0401f831, 0x59300203, 0x82000580, 0x00000004, - 0x04020005, 0x42027000, 0x00000048, 0x0201f800, - 0x00020a34, 0x1c01f000, 0x4cfc0000, 0x58fc0205, - 0x82000500, 0x000000ff, 0x82000580, 0x00000048, - 0x04020009, 0x58fc0409, 0x8c000500, 0x04000006, - 0x58fc080c, 0x8c040d16, 0x04000017, 0x58fc0008, - 0x0401f00a, 0x58fc0409, 0x8c000512, 0x04020014, - 0x58fc0c0a, 0x8c040d16, 0x04020003, 0x5c01f800, - 0x1c01f000, 0x58fc000b, 0x59300812, 0x80040580, - 0x04020009, 0x59300008, 0x84000500, 0x48026008, - 0x42027000, 0x00000048, 0x5c01f800, 0x0201f000, - 0x00020a34, 0x5c01f800, 0x1c01f000, 0x58fdf80a, - 0x0401f7ec, 0x5c000000, 0x4c000000, 0x4803c857, - 0x4933c857, 0x59b808ea, 0x82040d00, 0x00000007, - 0x82040580, 0x00000000, 0x04000025, 0x82040580, - 0x00000003, 0x04000022, 0x59300407, 0x4c000000, - 0x4a026407, 0x00000000, 0x42003000, 0x00000041, - 0x4a0370e5, 0x00003000, 0x42000000, 0x50000000, - 0x41300800, 0x4c180000, 0x0401fca9, 0x5c003000, - 0x0400000e, 0x42000000, 0x0000001e, 0x80000040, - 0x040207ff, 0x80183040, 0x040207f4, 0x42000000, - 0x40000000, 0x41300800, 0x0401fc9d, 0x59880146, - 0x80000000, 0x48031146, 0x4a0370e5, 0x00002000, - 0x5c000000, 0x48026407, 0x1c01f000, 0x59300008, - 0x84000500, 0x48026008, 0x0401f7fc, 0x59c00007, - 0x4a038006, 0x30000000, 0x40000000, 0x59c00007, - 0x8c00050a, 0x040207fe, 0x1c01f000, 0x5c000000, - 0x4c000000, 0x4803c857, 0x42000800, 0x00000001, - 0x0201f800, 0x00101994, 0x4dc00000, 0x4a0370e8, - 0x00000000, 0x42038000, 0x00007720, 0x0401ffec, - 0x42038000, 0x00007700, 0x0401ffe9, 0x0201f800, - 0x00104755, 0x04020017, 0x4a038891, 0x0000ffff, - 0x497b8880, 0x4ce80000, 0x4201d000, 0x00000016, - 0x0201f800, 0x001059d2, 0x497b8892, 0x4201d000, - 0x00000016, 0x0201f800, 0x001059d2, 0x5c01d000, - 0x42000000, 0x0010bd60, 0x0201f800, 0x0010ae10, - 0x0401f812, 0x5c038000, 0x0201f000, 0x00104879, - 0x0401f830, 0x4c080000, 0x4c140000, 0x42000000, - 0x0010bd61, 0x0201f800, 0x0010ae10, 0x0401f807, - 0x5c002800, 0x5c001000, 0x48178892, 0x480b8880, - 0x5c038000, 0x1c01f000, 0x496fc857, 0x836c0580, - 0x00000003, 0x0402000b, 0x4c080000, 0x4c0c0000, - 0x42001000, 0x00008048, 0x42001800, 0x0000ffff, - 0x0201f800, 0x001031f5, 0x5c001800, 0x5c001000, - 0x42000800, 0x0000003c, 0x0201f800, 0x001010db, - 0x59a8006a, 0x80000540, 0x04000005, 0x59a8106b, - 0x800811c0, 0x02020800, 0x001018ff, 0x4a038891, - 0x0000ffff, 0x4a03900d, 0x00000040, 0x0201f800, - 0x00100684, 0x4a0370e8, 0x00000001, 0x1c01f000, - 0x5c000000, 0x4c000000, 0x4803c857, 0x59c41080, - 0x497b8880, 0x4ce80000, 0x4201d000, 0x00000016, - 0x4c080000, 0x0201f800, 0x001059d2, 0x5c001000, - 0x5c01d000, 0x59c42892, 0x497b8892, 0x0201f800, - 0x00104755, 0x04020002, 0x1c01f000, 0x42002000, - 0x00000260, 0x59c418a4, 0x820c1d00, 0x0000000f, - 0x820c0580, 0x00000000, 0x04000010, 0x59c41805, - 0x820c1d00, 0x00000001, 0x0402000e, 0x59c418a4, - 0x820c1d00, 0x0000000f, 0x820c0480, 0x00000007, - 0x04001004, 0x820c0480, 0x0000000c, 0x04001003, - 0x80102040, 0x040207ec, 0x497b8891, 0x1c01f000, - 0x4c100000, 0x42002000, 0x00000019, 0x4a038805, - 0x00000001, 0x0201f800, 0x00101731, 0x59c41805, - 0x820c1d00, 0x00000001, 0x04000005, 0x80102040, - 0x040207f7, 0x5c002000, 0x0401f7f0, 0x5c002000, - 0x0401f7ec, 0x4803c856, 0x1c01f000, 0x00100cb7, - 0x00100cb7, 0x00100cb7, 0x00100cdb, 0x00100cb7, - 0x00100cb7, 0x00100cb7, 0x00100cb7, 0x00100cb7, - 0x00100cdb, 0x00100cb7, 0x00100cb9, 0x00100cb7, - 0x00100cb7, 0x00100cb7, 0x00100cb7, 0x0201f800, - 0x0010032d, 0x82040580, 0x0000001b, 0x0400001a, - 0x82040580, 0x0000002b, 0x04000017, 0x82040580, - 0x0000003b, 0x02020800, 0x0010032d, 0x592c020b, - 0x8c000500, 0x04000073, 0x592c1a08, 0x82040500, - 0x0000000f, 0x82000400, 0x00100e3a, 0x50001000, - 0x50080000, 0x59302014, 0x4802600b, 0x492e600c, - 0x480a600d, 0x480e600e, 0x48126013, 0x5c025800, - 0x1c01f000, 0x592c0010, 0x48026012, 0x592c0011, - 0x48026014, 0x592c1a08, 0x0401f7ed, 0x82040500, - 0x0000000f, 0x82000400, 0x00100e3a, 0x50001000, - 0x50080000, 0x592c1a08, 0x4802600b, 0x492e600c, - 0x480a600d, 0x480e600e, 0x497a6013, 0x0401f7ec, - 0x8c040d00, 0x0402004f, 0x82040d00, 0x00000080, - 0x0400004c, 0x0201f000, 0x00020164, 0x59300014, - 0x59301013, 0x80080580, 0x0402000c, 0x42007800, - 0x80000005, 0x592c1209, 0x82080500, 0xffff7fff, - 0x48025a09, 0x8c08151e, 0x0402003b, 0x823c7d40, - 0x00000020, 0x0401f038, 0x480bc857, 0x42000000, - 0x0010bd0d, 0x0201f800, 0x0010ae10, 0x59302014, - 0x59300415, 0x4803c857, 0x8c000514, 0x04020011, - 0x599c1819, 0x8c0c1d12, 0x0400000b, 0x592c0810, - 0x59300016, 0x80040c80, 0x04000005, 0x04001004, - 0x80040000, 0x80140480, 0x0400100a, 0x0201f800, - 0x001071c7, 0x820c1d40, 0x00000001, 0x0401f020, - 0x84000514, 0x48026415, 0x48126016, 0x4813c857, - 0x0401f93e, 0x0402001a, 0x42007800, 0x80000005, - 0x5930500e, 0x592c0209, 0x4803c857, 0x8c00051e, - 0x04020005, 0x823c7d40, 0x00000020, 0x5930400d, - 0x0401f004, 0x8400051e, 0x48025a09, 0x0401f8ed, - 0x50201800, 0x480e600b, 0x4832600c, 0x4822600d, - 0x482a600e, 0x480fc857, 0x4833c857, 0x4823c857, - 0x482bc857, 0x80000580, 0x483e6004, 0x1c01f000, - 0x0201f800, 0x0010032d, 0x4933c857, 0x4d2c0000, - 0x59900004, 0x81300580, 0x02020800, 0x0010032d, - 0x0201f800, 0x00108953, 0x02000800, 0x0010032d, - 0x59325809, 0x4d3c0000, 0x4d400000, 0x59300004, - 0x4803c857, 0x4c000000, 0x0201f800, 0x00106346, - 0x0201f800, 0x001060e2, 0x5c000000, 0x8c000516, - 0x04000011, 0x592c0010, 0x4803c857, 0x48025808, - 0x41780800, 0x42028000, 0x00000002, 0x0201f800, - 0x00104543, 0x4a025c07, 0x0000ffff, 0x492fc857, - 0x0201f800, 0x000203ab, 0x0201f800, 0x00107144, - 0x0401f015, 0x4a026203, 0x00000002, 0x592c0209, - 0x8400054e, 0x48025a09, 0x59300407, 0x82000580, - 0x00000006, 0x04020009, 0x811800ca, 0x81c80c00, - 0x58040939, 0x592c000e, 0x80040480, 0x592c0810, - 0x80040480, 0x4802580c, 0x417a7800, 0x0201f800, - 0x0010853c, 0x5c028000, 0x5c027800, 0x5c025800, - 0x1c01f000, 0x4933c857, 0x4d2c0000, 0x59900004, - 0x81300580, 0x02020800, 0x0010032d, 0x0201f800, - 0x00108953, 0x02000800, 0x0010032d, 0x59325809, - 0x592c0209, 0x84000540, 0x48025a09, 0x0401f7be, - 0x491bc857, 0x4dd00000, 0x4c580000, 0x41780800, - 0x8007a0ca, 0x83d3a400, 0x00007600, 0x4200b000, - 0x000007d0, 0x599c0019, 0x8c000506, 0x04020003, - 0x4200b000, 0x000003e8, 0x4a03a005, 0x80000002, - 0x0402400d, 0x4c040000, 0x02004800, 0x0002090c, - 0x5c000800, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x04001003, 0x8058b040, - 0x04000016, 0x59d01006, 0x82080500, 0x00006000, - 0x82000580, 0x00006000, 0x04000007, 0x8c08151e, - 0x040007ec, 0x59d01006, 0x82080500, 0x00006000, - 0x040207e8, 0x83d3a400, 0x00000020, 0x80040800, - 0x82040480, 0x00000005, 0x040017d9, 0x5c00b000, - 0x5c03a000, 0x1c01f000, 0x41180000, 0x80040580, - 0x04000008, 0x42003000, 0x0010b995, 0x58180401, - 0x8c000504, 0x040007f0, 0x850e1d6e, 0x0401f7ee, - 0x4a03a005, 0x30000000, 0x59d00006, 0x4a03a005, - 0x30000000, 0x59d00006, 0x497ba003, 0x497ba007, - 0x4a03a005, 0xf0000001, 0x42001800, 0x00008000, - 0x59d00006, 0x8c00050a, 0x04000005, 0x800c1840, - 0x040207fc, 0x0201f800, 0x0010032d, 0x4a03a005, - 0xf0000000, 0x59d00006, 0x850e1d2e, 0x800410c8, - 0x82081400, 0x0000bf32, 0x58081804, 0x800c19c0, - 0x040007d1, 0x580c0004, 0x84000576, 0x48001804, - 0x4933c857, 0x0401f7cc, 0x4803c856, 0x4dd00000, - 0x41780800, 0x8007a0ca, 0x83d3a400, 0x00007600, - 0x4a03a005, 0x80000001, 0x59d00006, 0x83d3a400, - 0x00000020, 0x80040800, 0x82040480, 0x00000005, - 0x040017f8, 0x5c03a000, 0x1c01f000, 0x59d00006, - 0x8c00053e, 0x0400001e, 0x59902804, 0x4817c857, - 0x801429c0, 0x04000013, 0x5990000a, 0x5990080b, - 0x5990100c, 0x5990180d, 0x4800280b, 0x4804280c, - 0x4808280d, 0x480c280e, 0x59d00000, 0x59d00801, - 0x59d01002, 0x59d01803, 0x59d02004, 0x4800280f, - 0x48042810, 0x48082811, 0x480c2812, 0x48102813, - 0x59900006, 0x82000500, 0xffff0000, 0x48032006, - 0x4a03a005, 0x30000000, 0x59d00006, 0x1c01f000, - 0x4803c856, 0x80204000, 0x50200000, 0x80000540, - 0x04000003, 0x80285040, 0x1c01f000, 0x58300001, - 0x80000540, 0x0400000e, 0x4802600c, 0x40006000, - 0x58300205, 0x82000500, 0x0000000f, 0x82000400, - 0x00100e3a, 0x50004000, 0x802041c0, 0x02000800, - 0x0010032d, 0x80285040, 0x1c01f000, 0x40005000, - 0x1c01f000, 0x00000006, 0x00000009, 0x0000000c, - 0x0000000f, 0x00000012, 0x00000000, 0x00000000, - 0x0000000c, 0x00000000, 0x00000000, 0x00000000, - 0x00100e35, 0x00100e34, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00100e35, 0x00100e34, - 0x00100e31, 0x00100e35, 0x00100e34, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00100e35, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00100e35, 0x00100e35, - 0x00100e35, 0x00000000, 0x00100e35, 0x00000000, - 0x00000000, 0x00000000, 0x4813c857, 0x492fc857, - 0x4933c857, 0x48126013, 0x592c5208, 0x802851c0, - 0x0400004a, 0x412c6000, 0x0401f84b, 0x04000009, - 0x82240580, 0x00000002, 0x04020003, 0x5830000e, - 0x80102480, 0x50200000, 0x80004540, 0x0400003f, - 0x50200000, 0x80000540, 0x0400000b, 0x80301400, - 0x58080002, 0x80102480, 0x0400101e, 0x801021c0, - 0x04000009, 0x80285040, 0x04000034, 0x80204000, - 0x0401f7f4, 0x58300001, 0x80006540, 0x0400002f, - 0x0401f7e6, 0x80285040, 0x0400002c, 0x80204000, - 0x50200000, 0x80000540, 0x0402000a, 0x58300001, - 0x80006540, 0x04000025, 0x58300205, 0x82004d00, - 0x0000000f, 0x82244400, 0x00100e3a, 0x50204000, - 0x592c0209, 0x8400051e, 0x48025a09, 0x0401f013, - 0x80102080, 0x80102000, 0x48126011, 0x4813c857, - 0x58080802, 0x40100000, 0x80042480, 0x02001800, - 0x0010032d, 0x58080000, 0x58081801, 0x80102400, - 0x4812600f, 0x480e6010, 0x4813c857, 0x592c0209, - 0x8400055e, 0x48025a09, 0x4833c857, 0x4823c857, - 0x482bc857, 0x4832600c, 0x4822600d, 0x482a600e, - 0x80000580, 0x0401f003, 0x82000540, 0x00000001, - 0x1c01f000, 0x58300205, 0x82004d00, 0x0000000f, - 0x82244400, 0x00100e3a, 0x82000500, 0x000000ff, - 0x82000580, 0x00000029, 0x0402001b, 0x50204000, - 0x592c040a, 0x80000540, 0x02000800, 0x0010032d, - 0x82000c80, 0x00000002, 0x04001011, 0x58300001, - 0x80006540, 0x02000800, 0x0010032d, 0x58300205, - 0x82000500, 0x0000000f, 0x82000400, 0x00100e3a, - 0x50004000, 0x40040000, 0x800409c0, 0x04000006, - 0x82040c80, 0x00000005, 0x040217f1, 0x80204400, - 0x80000580, 0x1c01f000, 0x4c5c0000, 0x59e4b800, - 0x485fc857, 0x825c0500, 0x0000001f, 0x04000004, - 0x59e40862, 0x0201f800, 0x0010032d, 0x825c0500, - 0x000000e0, 0x02000800, 0x0010032d, 0x8c5cbd0e, - 0x04020807, 0x8c5cbd0c, 0x04020809, 0x8c5cbd0a, - 0x04020873, 0x5c00b800, 0x1c01f000, 0x4803c856, - 0x4a03c800, 0x00000080, 0x1c01f000, 0x4d2c0000, - 0x42007800, 0x0010bdb1, 0x583c0003, 0x583c0804, - 0x80040540, 0x0400003a, 0x42000800, 0x0010bc56, - 0x50065800, 0x592c0002, 0x82000580, 0x00000000, - 0x04000033, 0x59e40050, 0x59e40852, 0x80040480, - 0x82000500, 0xfffffc00, 0x04020005, 0x59e40050, - 0x59e40851, 0x80040800, 0x80040480, 0x82000c80, - 0x00000400, 0x59e40050, 0x80041400, 0x480bc857, - 0x50080000, 0x58080801, 0x80040540, 0x04000020, - 0x480bc857, 0x480a5803, 0x583c1009, 0x583c000a, - 0x80080580, 0x04020005, 0x583c0000, 0x84000550, - 0x48007800, 0x41781000, 0x82080400, 0x00001000, - 0x4803c857, 0x48007809, 0x583c0003, 0x80081400, - 0x480bc857, 0x583c0804, 0x4a025801, 0x00000000, - 0x4a025808, 0x00100f2f, 0x480a5806, 0x48065807, - 0x59e40053, 0x800000c4, 0x48025805, 0x412c1000, - 0x492fc857, 0x0201f800, 0x00020016, 0x5c025800, - 0x4a03c800, 0x00000040, 0x1c01f000, 0x42007800, - 0x0010bc56, 0x503c7800, 0x4a007802, 0x00000100, - 0x42007800, 0x0010bdb1, 0x583c0000, 0x84000552, - 0x48007800, 0x583c100c, 0x480bc857, 0x80081000, - 0x4808780c, 0x583c180b, 0x800c19c0, 0x04000017, - 0x82080500, 0x00000003, 0x04020014, 0x583c0007, - 0x4803c857, 0x583c2008, 0x4813c857, 0x80102000, - 0x80100580, 0x04020002, 0x41782000, 0x48107808, - 0x400c0000, 0x80080580, 0x04020008, 0x4978780c, - 0x42001800, 0x00000001, 0x42001000, 0x00008028, - 0x0201f800, 0x001031f5, 0x1c01f000, 0x4a03c800, - 0x00000020, 0x0201f800, 0x0010ae08, 0x59e40000, - 0x1c01f000, 0x42000000, 0x00001000, 0x50000000, - 0x82000480, 0x24320001, 0x0400100d, 0x0201f800, - 0x0010af26, 0x04000008, 0x42000000, 0x00007a42, - 0x50007000, 0x8c387520, 0x04020003, 0x84387560, - 0x44380000, 0x4a030000, 0x00000000, 0x1c01f000, - 0x4d2c0000, 0x4a007000, 0x00000000, 0x82040d00, - 0x43000f80, 0x02020800, 0x0010032d, 0x58380008, - 0x4803c00f, 0x4a0370e4, 0x00003000, 0x0201f800, - 0x00108d7c, 0x583a5807, 0x592c0000, 0x48007007, - 0x800001c0, 0x04020002, 0x49787006, 0x0201f800, - 0x00100580, 0x5c025800, 0x42007000, 0x00020b54, - 0x0201f000, 0x0002002c, 0x4803c856, 0x4c3c0000, - 0x4d2c0000, 0x4d300000, 0x58300009, 0x80025d40, - 0x02000800, 0x0010032d, 0x592e6009, 0x4c300000, - 0x0201f800, 0x00108d9b, 0x5c006000, 0x02000800, - 0x0010032d, 0x58300002, 0x82000580, 0x00000100, - 0x0402000f, 0x5930780c, 0x583c0001, 0x80007d40, - 0x0400000e, 0x4802600c, 0x82000400, 0x00000002, - 0x48006003, 0x583c0000, 0x48006005, 0x40301000, - 0x0201f800, 0x00020016, 0x0401f00c, 0x4a025a07, - 0x00000002, 0x492fc857, 0x4c300000, 0x0201f800, - 0x000203ab, 0x5c025800, 0x0201f800, 0x00100580, - 0x0201f800, 0x00020a10, 0x5c026000, 0x5c025800, - 0x5c007800, 0x1c01f000, 0x4803c856, 0x4d2c0000, - 0x4d300000, 0x42007000, 0x00020b54, 0x58380800, - 0x82040580, 0x00000002, 0x04020011, 0x58386001, - 0x58300009, 0x812c0580, 0x0402000d, 0x59e00004, - 0x8c00050e, 0x040007fe, 0x59dc0006, 0x4803c857, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Nov 13 19:39:37 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF07A2E62E; Fri, 13 Nov 2015 19:39:37 +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 A7E2D195A; Fri, 13 Nov 2015 19:39:37 +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 tADJdaTk092708; Fri, 13 Nov 2015 19:39:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJdaob092707; Fri, 13 Nov 2015 19:39:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131939.tADJdaob092707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290783 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:39:38 -0000 Author: mav Date: Fri Nov 13 19:39:36 2015 New Revision: 290783 URL: https://svnweb.freebsd.org/changeset/base/290783 Log: MFC r289643: Document isp_*_multi firmware kernel modules removal. Modified: stable/10/UPDATING Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Fri Nov 13 19:36:43 2015 (r290782) +++ stable/10/UPDATING Fri Nov 13 19:39:36 2015 (r290783) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20151113: + 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 + should be replaced with isp_2400 and isp_2500 modules respectively. + 20151026: NTP has been upgraded to 4.2.8p4. From owner-svn-src-stable@freebsd.org Fri Nov 13 19:41:06 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B05BA2E779; Fri, 13 Nov 2015 19:41:06 +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 C8C1D1BCE; Fri, 13 Nov 2015 19:41:05 +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 tADJf4oC094756; Fri, 13 Nov 2015 19:41:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJf4QK094754; Fri, 13 Nov 2015 19:41:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131941.tADJf4QK094754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290784 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:41:06 -0000 Author: mav Date: Fri Nov 13 19:41:04 2015 New Revision: 290784 URL: https://svnweb.freebsd.org/changeset/base/290784 Log: MFC r289681: Some more defines and polishing for INIT_FIRMWARE. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:39:36 2015 (r290783) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:41:04 2015 (r290784) @@ -2075,10 +2075,11 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions2 |= ICB2400_OPT2_FCTAPE; } - if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) { - FCPARAM(isp, chan)->fctape_enabled = 1; - } else { - FCPARAM(isp, chan)->fctape_enabled = 0; + for (chan = 0; chan < isp->isp_nchan; chan++) { + if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) + FCPARAM(isp, chan)->fctape_enabled = 1; + else + FCPARAM(isp, chan)->fctape_enabled = 0; } switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { @@ -2209,31 +2210,39 @@ isp_fibre_init_2400(ispsoftc_t *isp) size_t amt = 0; uint8_t *off; - vpinfo.vp_count = isp->isp_nchan - 1; vpinfo.vp_global_options = 0; + if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) { + vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE; + vpinfo.vp_count = isp->isp_nchan; + chan = 0; + } else { + vpinfo.vp_count = isp->isp_nchan - 1; + chan = 1; + } off = fcp->isp_scratch; off += ICB2400_VPINFO_OFF; vdst = (isp_icb_2400_vpinfo_t *) off; isp_put_icb_2400_vpinfo(isp, &vpinfo, vdst); amt = ICB2400_VPINFO_OFF + sizeof (isp_icb_2400_vpinfo_t); - for (chan = 1; chan < isp->isp_nchan; chan++) { + for (; chan < isp->isp_nchan; chan++) { fcparam *fcp2; ISP_MEMZERO(&pi, sizeof (pi)); fcp2 = FCPARAM(isp, chan); if (fcp2->role != ISP_ROLE_NONE) { pi.vp_port_options = ICB2400_VPOPT_ENABLED; - if (fcp2->role & ISP_ROLE_INITIATOR) { + if (fcp2->role & ISP_ROLE_INITIATOR) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((fcp2->role & ISP_ROLE_TARGET) == 0) { + if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; - } - MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); } + 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; - off += ICB2400_VPINFO_PORT_OFF(chan); + if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) + off += ICB2400_VPINFO_PORT_OFF(chan); + else + off += ICB2400_VPINFO_PORT_OFF(chan - 1); pdst = (vp_port_info_t *) off; isp_put_vp_port_info(isp, &pi, pdst); amt += ICB2400_VPOPT_WRITE_SIZE; Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:39:36 2015 (r290783) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:41:04 2015 (r290784) @@ -989,6 +989,13 @@ typedef struct { #define ICB2400_OPT1_FAIRNESS 0x00000002 #define ICB2400_OPT1_HARD_ADDRESS 0x00000001 +#define ICB2400_OPT2_ENA_ATIOMQ 0x08000000 +#define ICB2400_OPT2_ENA_IHA 0x04000000 +#define ICB2400_OPT2_QOS 0x02000000 +#define ICB2400_OPT2_IOCBS 0x01000000 +#define ICB2400_OPT2_ENA_IHR 0x00400000 +#define ICB2400_OPT2_ENA_VMS 0x00200000 +#define ICB2400_OPT2_ENA_TA 0x00100000 #define ICB2400_OPT2_TPRLIC 0x00004000 #define ICB2400_OPT2_FCTAPE 0x00001000 #define ICB2400_OPT2_FCSP 0x00000800 @@ -1003,14 +1010,20 @@ typedef struct { #define ICB2400_OPT2_ZIO 0x00000005 #define ICB2400_OPT2_ZIO1 0x00000006 -#define ICB2400_OPT3_75_OHM 0x00010000 +#define ICB2400_OPT3_NO_CTXDIS 0x40000000 +#define ICB2400_OPT3_ENA_ETH_RESP 0x08000000 +#define ICB2400_OPT3_ENA_ETH_ATIO 0x04000000 +#define ICB2400_OPT3_ENA_MFCF 0x00020000 +#define ICB2400_OPT3_SKIP_FOURGB 0x00010000 #define ICB2400_OPT3_RATE_MASK 0x0000E000 #define ICB2400_OPT3_RATE_ONEGB 0x00000000 #define ICB2400_OPT3_RATE_TWOGB 0x00002000 -#define ICB2400_OPT3_RATE_AUTO 0x00004000 +#define ICB2400_OPT3_RATE_AUTO 0x00004000 #define ICB2400_OPT3_RATE_FOURGB 0x00006000 #define ICB2400_OPT3_RATE_EIGHTGB 0x00008000 +#define ICB2400_OPT3_RATE_SIXTEENGB 0x0000A000 #define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200 +#define ICB2400_OPT3_NO_N2N_LOGI 0x00000100 #define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080 #define ICB2400_OPT3_ENA_OOF 0x00000040 /* note that a response size flag of zero is reserved! */ @@ -1124,12 +1137,13 @@ typedef struct { uint16_t vp_port_portid_hi; /* not present when trailing icb */ } vp_port_info_t; -#define ICB2400_VPOPT_TGT_DISABLE 0x00000020 /* disable target mode */ -#define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* enable initiator mode */ -#define ICB2400_VPOPT_ENABLED 0x00000008 -#define ICB2400_VPOPT_NOPLAY 0x00000004 -#define ICB2400_VPOPT_PREVLOOP 0x00000002 -#define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 +#define ICB2400_VPOPT_ENA_SNSLOGIN 0x00000040 /* Enable SNS Login and SCR for Virtual Ports */ +#define ICB2400_VPOPT_TGT_DISABLE 0x00000020 /* Target Mode Disabled */ +#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_HARD_ADDRESS 0x00000001 /* Hard Assigned ID */ #define ICB2400_VPOPT_WRITE_SIZE 20 @@ -1145,12 +1159,14 @@ typedef struct { #define ICB2400_VPINFO_OFF 0x80 /* offset from start of ICB */ #define ICB2400_VPINFO_PORT_OFF(chan) \ - ICB2400_VPINFO_OFF + \ - sizeof (isp_icb_2400_vpinfo_t) + ((chan - 1) * ICB2400_VPOPT_WRITE_SIZE) + (ICB2400_VPINFO_OFF + \ + sizeof (isp_icb_2400_vpinfo_t) + (chan * ICB2400_VPOPT_WRITE_SIZE)) #define ICB2400_VPGOPT_FCA 0x01 /* Assume Clean Address bit in FLOGI ACC set (works only in static configurations) */ #define ICB2400_VPGOPT_MID_DISABLE 0x02 /* when set, connection mode2 will work with NPIV-capable switched */ #define ICB2400_VPGOPT_VP0_DECOUPLE 0x04 /* Allow VP0 decoupling if firmware supports it */ +#define ICB2400_VPGOPT_SUSP_FDISK 0x10 /* Suspend FDISC for Enabled VPs */ +#define ICB2400_VPGOPT_GEN_RIDA 0x20 /* Generate RIDA if FLOGI Fails */ typedef struct { isphdr_t vp_ctrl_hdr; @@ -1197,8 +1213,10 @@ typedef struct { #define VP_IDX_ERR 0x04 #define VP_STS_BSY 0x05 -#define VP_MODIFY_VP 0x00 +#define VP_MODIFY 0x00 #define VP_MODIFY_ENA 0x01 +#define VP_MODIFY_OPT 0x02 +#define VP_RESUME 0x03 /* * Port Data Base Element From owner-svn-src-stable@freebsd.org Fri Nov 13 19:42:57 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EEBA2E7DF; Fri, 13 Nov 2015 19:42: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 D12DC1DE1; Fri, 13 Nov 2015 19:42:56 +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 tADJguN2095483; Fri, 13 Nov 2015 19:42:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJgtqe095477; Fri, 13 Nov 2015 19:42:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131942.tADJgtqe095477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290785 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:42:57 -0000 Author: mav Date: Fri Nov 13 19:42:55 2015 New Revision: 290785 URL: https://svnweb.freebsd.org/changeset/base/290785 Log: MFC r289812, r289852: Some polishing and unification in ISR code. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c stable/10/sys/dev/isp/ispreg.h stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:42:55 2015 (r290785) @@ -5037,7 +5037,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct #endif void -isp_intr(ispsoftc_t *isp, uint32_t isr, uint16_t sema, uint16_t mbox) +isp_intr(ispsoftc_t *isp, uint16_t isr, uint16_t sema, uint16_t info) { XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs; uint32_t iptr, optr, junk; @@ -5051,11 +5051,11 @@ again: */ if (sema) { fmbox: - if (mbox & MBOX_COMMAND_COMPLETE) { + if (info & MBOX_COMMAND_COMPLETE) { isp->isp_intmboxc++; if (isp->isp_mboxbsy) { int obits = isp->isp_obits; - isp->isp_mboxtmp[0] = mbox; + isp->isp_mboxtmp[0] = info; for (i = 1; i < ISP_NMBOX(isp); i++) { if ((obits & (1 << i)) == 0) { continue; @@ -5069,15 +5069,15 @@ again: } MBOX_NOTIFY_COMPLETE(isp); } else { - isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", mbox); + isp_prt(isp, ISP_LOGWARN, "mailbox cmd (0x%x) with no waiters", info); } } else { - i = IS_FC(isp)? isp_parse_async_fc(isp, mbox) : isp_parse_async(isp, mbox); + i = IS_FC(isp)? isp_parse_async_fc(isp, info) : isp_parse_async(isp, info); if (i < 0) { return; } } - if ((IS_FC(isp) && mbox != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { + if ((IS_FC(isp) && info != ASYNC_RIOZIO_STALL) || isp->isp_state != ISP_RUNSTATE) { goto out; } } @@ -5092,7 +5092,8 @@ again: if (isp->isp_mboxbsy && isp->isp_lastmbxcmd == MBOX_ABOUT_FIRMWARE) { goto fmbox; } - isp_prt(isp, ISP_LOGINFO, "interrupt (ISR=%x SEMA=%x) when not ready", isr, sema); + isp_prt(isp, ISP_LOGINFO, "interrupt (ISR=%x SEMA=%x INFO=%x) " + "when not ready", isr, sema, info); /* * Thank you very much! *Burrrp*! */ @@ -5110,8 +5111,8 @@ again: * Check for ATIO Queue entries. */ if (IS_24XX(isp) && - ((isr & BIU2400_R2HST_ISTAT_MASK) == ISP2400R2HST_ATIO_RSPQ_UPDATE || - (isr & BIU2400_R2HST_ISTAT_MASK) == ISP2400R2HST_ATIO_RQST_UPDATE)) { + (isr == ISPR2HST_ATIO_UPDATE || isr == ISPR2HST_ATIO_RSPQ_UPDATE || + isr == ISPR2HST_ATIO_UPDATE2)) { iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); optr = isp->isp_atioodx; @@ -5145,25 +5146,6 @@ again: #endif /* - * Get the current Response Queue Out Pointer. - * - * If we're a 2300 or 2400, we can ask what hardware what it thinks. - */ -#if 0 - if (IS_23XX(isp) || IS_24XX(isp)) { - optr = ISP_READ(isp, isp->isp_respoutrp); - /* - * Debug: to be taken out eventually - */ - if (isp->isp_resodx != optr) { - isp_prt(isp, ISP_LOGINFO, "isp_intr: hard optr=%x, soft optr %x", optr, isp->isp_resodx); - isp->isp_resodx = optr; - } - } else -#endif - optr = isp->isp_resodx; - - /* * You *must* read the Response Queue In Pointer * prior to clearing the RISC interrupt. * @@ -5184,6 +5166,7 @@ again: iptr = ISP_READ(isp, isp->isp_respinrp); } + optr = isp->isp_resodx; if (optr == iptr && sema == 0) { /* * There are a lot of these- reasons unknown- mostly on @@ -5207,8 +5190,8 @@ again: ; } else { sema = ISP_READ(isp, BIU_SEMA); - mbox = ISP_READ(isp, OUTMAILBOX0); - if ((sema & 0x3) && (mbox & 0x8000)) { + info = ISP_READ(isp, OUTMAILBOX0); + if ((sema & 0x3) && (info & 0x8000)) { goto again; } } Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:42:55 2015 (r290785) @@ -4520,12 +4520,10 @@ static void isp_poll(struct cam_sim *sim) { ispsoftc_t *isp = cam_sim_softc(sim); - uint32_t isr; - uint16_t sema, mbox; + uint16_t isr, sema, info; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) { - isp_intr(isp, isr, sema, mbox); - } + if (ISP_READ_ISR(isp, &isr, &sema, &info)) + isp_intr(isp, isr, sema, info); } @@ -4544,11 +4542,9 @@ isp_watchdog(void *arg) * Hand crank the interrupt code just to be sure the command isn't stuck somewhere. */ if (handle != ISP_HANDLE_FREE) { - uint32_t isr; - uint16_t sema, mbox; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox) != 0) { - isp_intr(isp, isr, sema, mbox); - } + uint16_t isr, sema, info; + if (ISP_READ_ISR(isp, &isr, &sema, &info) != 0) + isp_intr(isp, isr, sema, info); ohandle = handle; handle = isp_find_handle(isp, xs); } @@ -6277,13 +6273,12 @@ isp_mbox_wait_complete(ispsoftc_t *isp, } else { for (olim = 0; olim < max; olim++) { for (ilim = 0; ilim < usecs; ilim += 100) { - uint32_t isr; - uint16_t sema, mbox; + uint16_t isr, sema, info; if (isp->isp_osinfo.mboxcmd_done) { break; } - if (ISP_READ_ISR(isp, &isr, &sema, &mbox)) { - isp_intr(isp, isr, sema, mbox); + if (ISP_READ_ISR(isp, &isr, &sema, &info)) { + isp_intr(isp, isr, sema, info); if (isp->isp_osinfo.mboxcmd_done) { break; } @@ -6351,16 +6346,14 @@ void isp_platform_intr(void *arg) { ispsoftc_t *isp = arg; - uint32_t isr; - uint16_t sema, mbox; + uint16_t isr, sema, info; ISP_LOCK(isp); isp->isp_intcnt++; - if (ISP_READ_ISR(isp, &isr, &sema, &mbox) == 0) { + if (ISP_READ_ISR(isp, &isr, &sema, &info)) + isp_intr(isp, isr, sema, info); + else isp->isp_intbogus++; - } else { - isp_intr(isp, isr, sema, mbox); - } ISP_UNLOCK(isp); } Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:42:55 2015 (r290785) @@ -59,9 +59,9 @@ static uint32_t isp_pci_rd_reg_1080(isps static void isp_pci_wr_reg_1080(ispsoftc_t *, int, uint32_t); static uint32_t isp_pci_rd_reg_2400(ispsoftc_t *, int); static void isp_pci_wr_reg_2400(ispsoftc_t *, int, uint32_t); -static int isp_pci_rd_isr(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2300(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); -static int isp_pci_rd_isr_2400(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); +static int isp_pci_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); +static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_mbxdma(ispsoftc_t *); static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, void *); @@ -1112,7 +1112,7 @@ isp_pci_rd_debounced(ispsoftc_t *isp, in } static int -isp_pci_rd_isr(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbp) +isp_pci_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint16_t isr, sema; @@ -1136,21 +1136,20 @@ isp_pci_rd_isr(ispsoftc_t *isp, uint32_t *isrp = isr; if ((*semap = sema) != 0) { if (IS_2100(isp)) { - if (isp_pci_rd_debounced(isp, OUTMAILBOX0, mbp)) { + if (isp_pci_rd_debounced(isp, OUTMAILBOX0, info)) { return (0); } } else { - *mbp = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); + *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); } } return (1); } static int -isp_pci_rd_isr_2300(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2300(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { - uint32_t hccr; - uint32_t r2hisr; + uint32_t hccr, r2hisr; if (!(BXR2(isp, IspVirt2Off(isp, BIU_ISR) & BIU2100_ISR_RISC_INT))) { *isrp = 0; @@ -1162,36 +1161,29 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin *isrp = 0; return (0); } - switch (r2hisr & BIU_R2HST_ISTAT_MASK) { + switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { case ISPR2HST_ROM_MBX_OK: case ISPR2HST_ROM_MBX_FAIL: case ISPR2HST_MBX_OK: case ISPR2HST_MBX_FAIL: case ISPR2HST_ASYNC_EVENT: - *isrp = r2hisr & 0xffff; - *mbox0p = (r2hisr >> 16); *semap = 1; - return (1); + break; case ISPR2HST_RIO_16: - *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_RIO16_1; + *info = ASYNC_RIO16_1; *semap = 1; return (1); case ISPR2HST_FPOST: - *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_CMD_CMPLT; + *info = ASYNC_CMD_CMPLT; *semap = 1; return (1); case ISPR2HST_FPOST_CTIO: - *isrp = r2hisr & 0xffff; - *mbox0p = ASYNC_CTIO_DONE; + *info = ASYNC_CTIO_DONE; *semap = 1; return (1); case ISPR2HST_RSPQ_UPDATE: - *isrp = r2hisr & 0xffff; - *mbox0p = 0; *semap = 0; - return (1); + break; default: hccr = ISP_READ(isp, HCCR); if (hccr & HCCR_PAUSE) { @@ -1203,41 +1195,43 @@ isp_pci_rd_isr_2300(ispsoftc_t *isp, uin } return (0); } + *info = (r2hisr >> 16); + return (1); } static int -isp_pci_rd_isr_2400(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbox0p) +isp_pci_rd_isr_2400(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint32_t r2hisr; r2hisr = BXR4(isp, IspVirt2Off(isp, BIU2400_R2HSTSLO)); isp_prt(isp, ISP_LOGDEBUG3, "RISC2HOST ISR 0x%x", r2hisr); - if ((r2hisr & BIU2400_R2HST_INTR) == 0) { + if ((r2hisr & BIU_R2HST_INTR) == 0) { *isrp = 0; return (0); } - switch (r2hisr & BIU2400_R2HST_ISTAT_MASK) { - case ISP2400R2HST_ROM_MBX_OK: - case ISP2400R2HST_ROM_MBX_FAIL: - case ISP2400R2HST_MBX_OK: - case ISP2400R2HST_MBX_FAIL: - case ISP2400R2HST_ASYNC_EVENT: - *isrp = r2hisr & 0xffff; - *mbox0p = (r2hisr >> 16); + switch ((*isrp = r2hisr & BIU_R2HST_ISTAT_MASK)) { + case ISPR2HST_ROM_MBX_OK: + case ISPR2HST_ROM_MBX_FAIL: + case ISPR2HST_MBX_OK: + case ISPR2HST_MBX_FAIL: + case ISPR2HST_ASYNC_EVENT: *semap = 1; - return (1); - case ISP2400R2HST_RSPQ_UPDATE: - case ISP2400R2HST_ATIO_RSPQ_UPDATE: - case ISP2400R2HST_ATIO_RQST_UPDATE: - *isrp = r2hisr & 0xffff; - *mbox0p = 0; + break; + case ISPR2HST_RSPQ_UPDATE: + case ISPR2HST_RSPQ_UPDATE2: + case ISPR2HST_ATIO_UPDATE: + case ISPR2HST_ATIO_RSPQ_UPDATE: + case ISPR2HST_ATIO_UPDATE2: *semap = 0; - return (1); + break; default: ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RISC_INT); isp_prt(isp, ISP_LOGERR, "unknown interrupt 0x%x\n", r2hisr); return (0); } + *info = (r2hisr >> 16); + return (1); } static uint32_t Modified: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:42:55 2015 (r290785) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); -static int isp_sbus_rd_isr(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); +static int isp_sbus_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_sbus_mbxdma(ispsoftc_t *); static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); @@ -388,7 +388,7 @@ isp_sbus_detach(device_t dev) bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off) static int -isp_sbus_rd_isr(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbp) +isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint16_t isr, sema; @@ -401,9 +401,8 @@ isp_sbus_rd_isr(ispsoftc_t *isp, uint32_ return (0); } *isrp = isr; - if ((*semap = sema) != 0) { - *mbp = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); - } + if ((*semap = sema) != 0) + *info = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); return (1); } Modified: stable/10/sys/dev/isp/ispreg.h ============================================================================== --- stable/10/sys/dev/isp/ispreg.h Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/ispreg.h Fri Nov 13 19:42:55 2015 (r290785) @@ -125,17 +125,20 @@ #define BIU_R2HST_INTR (1 << 15) /* RISC to Host Interrupt */ #define BIU_R2HST_PAUSED (1 << 8) /* RISC paused */ -#define BIU_R2HST_ISTAT_MASK 0x3f /* intr information && status */ +#define BIU_R2HST_ISTAT_MASK 0xff /* intr information && status */ #define ISPR2HST_ROM_MBX_OK 0x1 /* ROM mailbox cmd done ok */ #define ISPR2HST_ROM_MBX_FAIL 0x2 /* ROM mailbox cmd done fail */ #define ISPR2HST_MBX_OK 0x10 /* mailbox cmd done ok */ #define ISPR2HST_MBX_FAIL 0x11 /* mailbox cmd done fail */ #define ISPR2HST_ASYNC_EVENT 0x12 /* Async Event */ #define ISPR2HST_RSPQ_UPDATE 0x13 /* Response Queue Update */ -#define ISPR2HST_RQST_UPDATE 0x14 /* Resquest Queue Update */ +#define ISPR2HST_RSPQ_UPDATE2 0x14 /* Response Queue Update */ #define ISPR2HST_RIO_16 0x15 /* RIO 1-16 */ #define ISPR2HST_FPOST 0x16 /* Low 16 bits fast post */ #define ISPR2HST_FPOST_CTIO 0x17 /* Low 16 bits fast post ctio */ +#define ISPR2HST_ATIO_UPDATE 0x1C /* ATIO Queue Update */ +#define ISPR2HST_ATIO_RSPQ_UPDATE 0x1D /* ATIO & Request Update */ +#define ISPR2HST_ATIO_UPDATE2 0x1E /* ATIO Queue Update */ /* fifo command stuff- mostly for SPI */ #define DFIFO_COMMAND (BIU_BLOCK+0x60) /* RW : Command FIFO Port */ @@ -246,11 +249,6 @@ #define BIU2100_ISR_RXDMA_INT_PENDING 0x0002 /* Global interrupt pending */ #define BIU2100_ISR_TXDMA_INT_PENDING 0x0001 /* Global interrupt pending */ -#define INT_PENDING(isp, isr) \ - IS_FC(isp)? \ - (IS_24XX(isp)? (isr & BIU2400_ISR_RISC_INT) : (isr & BIU2100_ISR_RISC_INT)) :\ - (isr & BIU_ISR_RISC_INT) - #define INT_PENDING_MASK(isp) \ (IS_FC(isp)? (IS_24XX(isp)? BIU2400_ISR_RISC_INT : BIU2100_ISR_RISC_INT) : \ (BIU_ISR_RISC_INT)) @@ -398,19 +396,6 @@ /* BIU2400_ISR definitions */ #define BIU2400_ISR_RISC_INT 0x8 -#define BIU2400_R2HST_INTR BIU_R2HST_INTR -#define BIU2400_R2HST_PAUSED BIU_R2HST_PAUSED -#define BIU2400_R2HST_ISTAT_MASK 0x1f -/* interrupt status meanings */ -#define ISP2400R2HST_ROM_MBX_OK 0x1 /* ROM mailbox cmd done ok */ -#define ISP2400R2HST_ROM_MBX_FAIL 0x2 /* ROM mailbox cmd done fail */ -#define ISP2400R2HST_MBX_OK 0x10 /* mailbox cmd done ok */ -#define ISP2400R2HST_MBX_FAIL 0x11 /* mailbox cmd done fail */ -#define ISP2400R2HST_ASYNC_EVENT 0x12 /* Async Event */ -#define ISP2400R2HST_RSPQ_UPDATE 0x13 /* Response Queue Update */ -#define ISP2400R2HST_ATIO_RSPQ_UPDATE 0x1C /* ATIO Response Queue Update */ -#define ISP2400R2HST_ATIO_RQST_UPDATE 0x1D /* ATIO Request Queue Update */ - /* BIU2400_HCCR definitions */ #define HCCR_2400_CMD_NOP 0x00000000 Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:41:04 2015 (r290784) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:42:55 2015 (r290785) @@ -58,7 +58,7 @@ */ typedef struct ispsoftc ispsoftc_t; struct ispmdvec { - int (*dv_rd_isr) (ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); + int (*dv_rd_isr) (ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); uint32_t (*dv_rd_reg) (ispsoftc_t *, int); void (*dv_wr_reg) (ispsoftc_t *, int, uint32_t); int (*dv_mbxdma) (ispsoftc_t *); @@ -86,8 +86,8 @@ struct ispmdvec { * Macros to access ISP registers through bus specific layers- * mostly wrappers to vector through the mdvec structure. */ -#define ISP_READ_ISR(isp, isrp, semap, mbox0p) \ - (*(isp)->isp_mdvec->dv_rd_isr)(isp, isrp, semap, mbox0p) +#define ISP_READ_ISR(isp, isrp, semap, info) \ + (*(isp)->isp_mdvec->dv_rd_isr)(isp, isrp, semap, info) #define ISP_READ(isp, reg) \ (*(isp)->isp_mdvec->dv_rd_reg)((isp), (reg)) @@ -829,7 +829,7 @@ int isp_reinit(ispsoftc_t *, int); * semaphore register and first mailbox register (if appropriate). This also * means that most spurious/bogus interrupts not for us can be filtered first. */ -void isp_intr(ispsoftc_t *, uint32_t, uint16_t, uint16_t); +void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t); /* From owner-svn-src-stable@freebsd.org Fri Nov 13 19:44:00 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93545A2E835; Fri, 13 Nov 2015 19:44:00 +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 678311F2B; Fri, 13 Nov 2015 19:44: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 tADJhxeg095574; Fri, 13 Nov 2015 19:43:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJhx87095571; Fri, 13 Nov 2015 19:43:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131943.tADJhx87095571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290786 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:44:00 -0000 Author: mav Date: Fri Nov 13 19:43:58 2015 New Revision: 290786 URL: https://svnweb.freebsd.org/changeset/base/290786 Log: MFC r289817: Disable full bus scan by CAM for FC adapters. FC port database code already notifies CAM about all devices. Additional full scan is just a waste of time, that by definition won't find anything that is not present in port database. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:42:55 2015 (r290785) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:43:58 2015 (r290786) @@ -54,7 +54,6 @@ int isp_fabric_hysteresis = 5; int isp_loop_down_limit = 60; /* default loop down limit */ int isp_quickboot_time = 7; /* don't wait more than N secs for loop up */ int isp_gone_device_time = 30; /* grace time before reporting device lost */ -int isp_autoconfig = 1; /* automatically attach/detach devices */ static const char prom3[] = "Chan %d [%u] PortID 0x%06x Departed because of %s"; static void isp_freeze_loopdown(ispsoftc_t *, int, char *); @@ -418,6 +417,9 @@ isp_freeze_loopdown(ispsoftc_t *isp, int if (fc->simqfrozen == 0) { isp_prt(isp, ISP_LOGDEBUG0, "%s: freeze simq (loopdown) chan %d", msg, chan); 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); @@ -436,6 +438,9 @@ isp_unfreeze_loopdown(ispsoftc_t *isp, i if (wasfrozen && fc->simqfrozen == 0) { isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d releasing simq", __func__, chan); xpt_release_simq(fc->sim, 1); +#if __FreeBSD_version >= 1000039 + xpt_release_boot(); +#endif } } } @@ -4602,10 +4607,6 @@ isp_make_here(ispsoftc_t *isp, fcportdb_ union ccb *ccb; struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (isp_autoconfig == 0) { - return; - } - /* * Allocate a CCB, create a wildcard path for this target and schedule a rescan. */ @@ -4629,9 +4630,6 @@ isp_make_gone(ispsoftc_t *isp, fcportdb_ struct cam_path *tp; struct isp_fc *fc = ISP_FC_PC(isp, chan); - if (isp_autoconfig == 0) { - return; - } if (xpt_create_path(&tp, NULL, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) == CAM_REQ_CMP) { xpt_async(AC_LOST_DEVICE, tp, NULL); xpt_free_path(tp); @@ -5516,6 +5514,9 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#if __FreeBSD_version >= 1000039 + cpi->hba_misc |= PIM_NOSCAN; +#endif /* * Because our loop ID can shift from time to time, Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:42:55 2015 (r290785) +++ stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:43:58 2015 (r290786) @@ -734,7 +734,6 @@ extern int isp_fabric_hysteresis; extern int isp_loop_down_limit; extern int isp_gone_device_time; extern int isp_quickboot_time; -extern int isp_autoconfig; /* * Platform private flags Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:42:55 2015 (r290785) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:43:58 2015 (r290786) @@ -489,9 +489,6 @@ isp_get_generic_options(device_t dev, is if (tval > 0 && tval < 127) { isp_nvports = tval; } - tval = 1; - (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "autoconfig", &tval); - isp_autoconfig = tval; tval = 7; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "quickboot_time", &tval); isp_quickboot_time = tval; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:45:17 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AB17A2E8B2; Fri, 13 Nov 2015 19:45: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 E4D0F1129; Fri, 13 Nov 2015 19:45: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 tADJjGYw095694; Fri, 13 Nov 2015 19:45:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJjF4R095689; Fri, 13 Nov 2015 19:45:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131945.tADJjF4R095689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290787 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:45:17 -0000 Author: mav Date: Fri Nov 13 19:45:15 2015 New Revision: 290787 URL: https://svnweb.freebsd.org/changeset/base/290787 Log: MFC r289838: Improve INOTs handling for 24xx and above chips. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/isp_library.h stable/10/sys/dev/isp/isp_target.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:45:15 2015 (r290787) @@ -2480,12 +2480,13 @@ isp_handle_platform_atio2(ispsoftc_t *is else { if ((isp_find_pdb_by_handle(isp, 0, nphdl, &lp) == 0 || lp->state == FC_PORTDB_STATE_ZOMBIE)) { - uint64_t iid = + uint64_t wwpn = (((uint64_t) aep->at_wwpn[0]) << 48) | (((uint64_t) aep->at_wwpn[1]) << 32) | (((uint64_t) aep->at_wwpn[2]) << 16) | (((uint64_t) aep->at_wwpn[3]) << 0); - isp_add_wwn_entry(isp, 0, iid, nphdl, PORT_ANY, 0); + isp_add_wwn_entry(isp, 0, wwpn, INI_NONE, + nphdl, PORT_ANY, 0); isp_find_pdb_by_handle(isp, 0, nphdl, &lp); } atiop->init_id = FC_PORTDB_TGT(isp, 0, lp); @@ -3195,8 +3196,9 @@ isp_handle_platform_notify_24xx(ispsoftc uint16_t prli_options = 0; uint32_t portid; fcportdb_t *lp; - uint8_t *ptr = NULL; - uint64_t wwn; + char *msg = NULL; + uint8_t *ptr = (uint8_t *)inot; + uint64_t wwpn = INI_NONE, wwnn = INI_NONE; nphdl = inot->in_nphdl; if (nphdl != NIL_HANDLE) { @@ -3208,7 +3210,7 @@ isp_handle_platform_notify_24xx(ispsoftc switch (inot->in_status) { case IN24XX_ELS_RCVD: { - char buf[16], *msg; + char buf[16]; int chan = ISP_GET_VPIDX(isp, inot->in_vpidx); /* @@ -3219,49 +3221,27 @@ isp_handle_platform_notify_24xx(ispsoftc switch (inot->in_status_subcode) { case LOGO: msg = "LOGO"; - if (ISP_FW_NEWER_THAN(isp, 4, 0, 25)) { - ptr = (uint8_t *)inot; /* point to unswizzled entry! */ - wwn = (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF]) << 56) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+1]) << 48) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+2]) << 40) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+3]) << 32) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+4]) << 24) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+5]) << 16) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+6]) << 8) | - (((uint64_t) ptr[IN24XX_LOGO_WWPN_OFF+7])); - } else { - wwn = INI_ANY; - } - isp_del_wwn_entry(isp, chan, wwn, nphdl, portid); + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_del_wwn_entry(isp, chan, wwpn, nphdl, portid); break; case PRLO: msg = "PRLO"; break; case PLOGI: + msg = "PLOGI"; + wwnn = be64dec(&ptr[IN24XX_PLOGI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PLOGI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); + break; case PRLI: - /* - * Treat PRLI the same as PLOGI and make a database entry for it. - */ - if (inot->in_status_subcode == PLOGI) { - msg = "PLOGI"; - } else { - prli_options = inot->in_prli_options; - msg = "PRLI"; - } - if (ISP_FW_NEWER_THAN(isp, 4, 0, 25)) { - ptr = (uint8_t *)inot; /* point to unswizzled entry! */ - wwn = (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF]) << 56) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+1]) << 48) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+2]) << 40) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+3]) << 32) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+4]) << 24) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+5]) << 16) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+6]) << 8) | - (((uint64_t) ptr[IN24XX_PLOGI_WWPN_OFF+7])); - } else { - wwn = INI_NONE; - } - isp_add_wwn_entry(isp, chan, wwn, nphdl, portid, prli_options); + msg = "PRLI"; + prli_options = inot->in_prli_options; + if (inot->in_flags & IN24XX_FLAG_PN_NN_VALID) + wwnn = be64dec(&ptr[IN24XX_PRLI_WWNN_OFF]); + wwpn = be64dec(&ptr[IN24XX_PRLI_WWPN_OFF]); + isp_add_wwn_entry(isp, chan, wwpn, wwnn, + nphdl, portid, prli_options); break; case PDISC: msg = "PDISC"; @@ -3285,21 +3265,19 @@ isp_handle_platform_notify_24xx(ispsoftc } case IN24XX_PORT_LOGOUT: - ptr = "PORT LOGOUT"; + msg = "PORT LOGOUT"; if (isp_find_pdb_by_handle(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), nphdl, &lp)) { isp_del_wwn_entry(isp, ISP_GET_VPIDX(isp, inot->in_vpidx), lp->port_wwn, nphdl, lp->portid); } /* FALLTHROUGH */ case IN24XX_PORT_CHANGED: - if (ptr == NULL) { - ptr = "PORT CHANGED"; - } + if (msg == NULL) + msg = "PORT CHANGED"; /* FALLTHROUGH */ - case IN24XX_LIP_RESET: - if (ptr == NULL) { - ptr = "LIP RESET"; - } - isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for N-port handle 0x%x", ISP_GET_VPIDX(isp, inot->in_vpidx), ptr, inot->in_status_subcode, nphdl); + case IN24XX_LIP_RESET: + if (msg == NULL) + msg = "LIP RESET"; + isp_prt(isp, ISP_LOGINFO, "Chan %d %s (sub-status 0x%x) for N-port handle 0x%x", ISP_GET_VPIDX(isp, inot->in_vpidx), msg, inot->in_status_subcode, nphdl); /* * All subcodes here are irrelevant. What is relevant @@ -3315,21 +3293,18 @@ isp_handle_platform_notify_24xx(ispsoftc isp_handle_srr_notify(isp, inot); break; #else - if (ptr == NULL) { - ptr = "SRR RCVD"; - } + if (msg == NULL) + msg = "SRR RCVD"; /* FALLTHROUGH */ #endif case IN24XX_LINK_RESET: - if (ptr == NULL) { - ptr = "LINK RESET"; - } + if (msg == NULL) + msg = "LINK RESET"; case IN24XX_LINK_FAILED: - if (ptr == NULL) { - ptr = "LINK FAILED"; - } + if (msg == NULL) + msg = "LINK FAILED"; default: - isp_prt(isp, ISP_LOGWARN, "Chan %d %s", ISP_GET_VPIDX(isp, inot->in_vpidx), ptr); + isp_prt(isp, ISP_LOGWARN, "Chan %d %s", ISP_GET_VPIDX(isp, inot->in_vpidx), msg); isp_async(isp, ISPASYNC_TARGET_NOTIFY_ACK, inot); break; } @@ -5704,20 +5679,17 @@ isp_async(ispsoftc_t *isp, ispasync_t cm break; } case ISPASYNC_LIP: - if (msg == NULL) { + if (msg == NULL) msg = "LIP Received"; - } /* FALLTHROUGH */ case ISPASYNC_LOOP_RESET: - if (msg == NULL) { + if (msg == NULL) msg = "LOOP Reset"; - } /* FALLTHROUGH */ case ISPASYNC_LOOP_DOWN: { - if (msg == NULL) { + if (msg == NULL) msg = "LOOP Down"; - } va_start(ap, cmd); bus = va_arg(ap, int); va_end(ap); Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:45:15 2015 (r290787) @@ -2421,7 +2421,8 @@ isp_find_chan_by_did(ispsoftc_t *isp, ui * Add an initiator device to the port database */ void -isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t ini, uint16_t nphdl, uint32_t s_id, uint16_t prli_params) +isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t wwpn, uint64_t wwnn, + uint16_t nphdl, uint32_t s_id, uint16_t prli_params) { char buf[64]; fcparam *fcp; @@ -2432,7 +2433,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c if (nphdl >= MAX_NPORT_HANDLE) { isp_prt(isp, ISP_LOGTINFO|ISP_LOGWARN, "Chan %d WWPN 0x%016llx " "PortID 0x%06x handle 0x%x -- bad handle", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); return; } @@ -2441,7 +2442,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c * with new parameters. Some cases of update can be suspicious, * so log them verbosely and dump the whole port database. */ - if ((VALID_INI(ini) && isp_find_pdb_by_wwn(isp, chan, ini, &lp)) || + if ((VALID_INI(wwpn) && isp_find_pdb_by_wwn(isp, chan, wwpn, &lp)) || (s_id != PORT_NONE && isp_find_pdb_by_sid(isp, chan, s_id, &lp))) { change = 0; lp->new_portid = lp->portid; @@ -2465,24 +2466,42 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c lp->new_portid = s_id; change++; } - if (VALID_INI(ini) && lp->port_wwn != ini) { + if (VALID_INI(wwpn) && lp->port_wwn != wwpn) { if (!VALID_INI(lp->port_wwn)) { isp_prt(isp, ISP_LOGTINFO, "Chan %d PortID 0x%06x handle 0x%x " - "gets WWN 0x%016llxx", + "gets WWPN 0x%016llxx", chan, lp->portid, nphdl, - (unsigned long long) ini); - } else if (lp->port_wwn != ini) { + (unsigned long long) wwpn); + } else if (lp->port_wwn != wwpn) { isp_prt(isp, ISP_LOGTINFO|ISP_LOGWARN, "Chan %d PortID 0x%06x handle 0x%x " - "changes WWN 0x%016llx to 0x%016llx", + "changes WWPN 0x%016llx to 0x%016llx", chan, lp->portid, nphdl, (unsigned long long) lp->port_wwn, - (unsigned long long) ini); + (unsigned long long) wwpn); if (isp->isp_dblev & (ISP_LOGTINFO|ISP_LOGWARN)) isp_dump_portdb(isp, chan); } - lp->port_wwn = ini; + lp->port_wwn = wwpn; + change++; + } + if (VALID_INI(wwnn) && lp->node_wwn != wwnn) { + if (!VALID_INI(lp->node_wwn)) { + isp_prt(isp, ISP_LOGTINFO, + "Chan %d PortID 0x%06x handle 0x%x " + "gets WWNN 0x%016llxx", + chan, lp->portid, nphdl, + (unsigned long long) wwnn); + } else if (lp->port_wwn != wwnn) { + isp_prt(isp, ISP_LOGTINFO, + "Chan %d PortID 0x%06x handle 0x%x " + "changes WWNN 0x%016llx to 0x%016llx", + chan, lp->portid, nphdl, + (unsigned long long) lp->node_wwn, + (unsigned long long) wwnn); + } + lp->node_wwn = wwnn; change++; } if (prli_params != 0 && lp->prli_word3 != prli_params) { @@ -2531,7 +2550,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c isp_prt(isp, ISP_LOGTINFO|ISP_LOGWARN, "Chan %d WWPN 0x%016llx PortID 0x%06x handle 0x%x " "-- no room in port database", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); if (isp->isp_dblev & (ISP_LOGTINFO|ISP_LOGWARN)) isp_dump_portdb(isp, chan); return; @@ -2542,14 +2561,15 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c ISP_MEMZERO(lp, sizeof (fcportdb_t)); lp->handle = nphdl; lp->portid = s_id; - lp->port_wwn = ini; + lp->port_wwn = wwpn; + lp->node_wwn = wwnn; lp->prli_word3 = (prli_params != 0) ? prli_params : PRLI_WD3_INITIATOR_FUNCTION; lp->state = FC_PORTDB_STATE_VALID; isp_gen_role_str(buf, sizeof (buf), lp->prli_word3); isp_prt(isp, ISP_LOGTINFO, "Chan %d WWPN 0x%016llx " "PortID 0x%06x handle 0x%x vtgt %d %s added", chan, - (unsigned long long) ini, s_id, nphdl, i, buf); + (unsigned long long) wwpn, s_id, nphdl, i, buf); /* Notify above levels about new port arrival. */ isp_async(isp, ISPASYNC_DEV_ARRIVED, chan, lp); @@ -2559,21 +2579,21 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c * Remove a target device to the port database */ void -isp_del_wwn_entry(ispsoftc_t *isp, int chan, uint64_t ini, uint16_t nphdl, uint32_t s_id) +isp_del_wwn_entry(ispsoftc_t *isp, int chan, uint64_t wwpn, uint16_t nphdl, uint32_t s_id) { fcparam *fcp; fcportdb_t *lp; if (nphdl >= MAX_NPORT_HANDLE) { isp_prt(isp, ISP_LOGWARN, "Chan %d WWPN 0x%016llx PortID 0x%06x bad handle 0x%x", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); return; } fcp = FCPARAM(isp, chan); if (isp_find_pdb_by_handle(isp, chan, nphdl, &lp) == 0) { isp_prt(isp, ISP_LOGWARN, "Chan %d WWPN 0x%016llx PortID 0x%06x handle 0x%x cannot be found to be deleted", - chan, (unsigned long long) ini, s_id, nphdl); + chan, (unsigned long long) wwpn, s_id, nphdl); isp_dump_portdb(isp, chan); return; } @@ -3468,7 +3488,7 @@ isp_put_notify_24xx(ispsoftc_t *isp, in_ ISP_IOXPUT_16(isp, src->in_srr_rxid, &dst->in_srr_rxid); ISP_IOXPUT_16(isp, src->in_status, &dst->in_status); ISP_IOXPUT_8(isp, src->in_status_subcode, &dst->in_status_subcode); - ISP_IOXPUT_16(isp, src->in_reserved2, &dst->in_reserved2); + ISP_IOXPUT_8(isp, src->in_fwhandle, &dst->in_fwhandle); ISP_IOXPUT_32(isp, src->in_rxid, &dst->in_rxid); ISP_IOXPUT_16(isp, src->in_srr_reloff_hi, &dst->in_srr_reloff_hi); ISP_IOXPUT_16(isp, src->in_srr_reloff_lo, &dst->in_srr_reloff_lo); @@ -3531,7 +3551,7 @@ isp_get_notify_24xx(ispsoftc_t *isp, in_ ISP_IOXGET_16(isp, &src->in_srr_rxid, dst->in_srr_rxid); ISP_IOXGET_16(isp, &src->in_status, dst->in_status); ISP_IOXGET_8(isp, &src->in_status_subcode, dst->in_status_subcode); - ISP_IOXGET_16(isp, &src->in_reserved2, dst->in_reserved2); + ISP_IOXGET_8(isp, &src->in_fwhandle, dst->in_fwhandle); ISP_IOXGET_32(isp, &src->in_rxid, dst->in_rxid); ISP_IOXGET_16(isp, &src->in_srr_reloff_hi, dst->in_srr_reloff_hi); ISP_IOXGET_16(isp, &src->in_srr_reloff_lo, dst->in_srr_reloff_lo); @@ -3650,7 +3670,7 @@ isp_put_notify_24xx_ack(ispsoftc_t *isp, ISP_IOXPUT_16(isp, src->na_srr_rxid, &dst->na_srr_rxid); ISP_IOXPUT_16(isp, src->na_status, &dst->na_status); ISP_IOXPUT_8(isp, src->na_status_subcode, &dst->na_status_subcode); - ISP_IOXPUT_16(isp, src->na_reserved2, &dst->na_reserved2); + ISP_IOXPUT_8(isp, src->na_fwhandle, &dst->na_fwhandle); ISP_IOXPUT_32(isp, src->na_rxid, &dst->na_rxid); ISP_IOXPUT_16(isp, src->na_srr_reloff_hi, &dst->na_srr_reloff_hi); ISP_IOXPUT_16(isp, src->na_srr_reloff_lo, &dst->na_srr_reloff_lo); @@ -3721,7 +3741,7 @@ isp_get_notify_ack_24xx(ispsoftc_t *isp, ISP_IOXGET_16(isp, &src->na_srr_rxid, dst->na_srr_rxid); ISP_IOXGET_16(isp, &src->na_status, dst->na_status); ISP_IOXGET_8(isp, &src->na_status_subcode, dst->na_status_subcode); - ISP_IOXGET_16(isp, &src->na_reserved2, dst->na_reserved2); + ISP_IOXGET_8(isp, &src->na_fwhandle, dst->na_fwhandle); ISP_IOXGET_32(isp, &src->na_rxid, dst->na_rxid); ISP_IOXGET_16(isp, &src->na_srr_reloff_hi, dst->na_srr_reloff_hi); ISP_IOXGET_16(isp, &src->na_srr_reloff_lo, dst->na_srr_reloff_lo); Modified: stable/10/sys/dev/isp/isp_library.h ============================================================================== --- stable/10/sys/dev/isp/isp_library.h Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_library.h Fri Nov 13 19:45:15 2015 (r290787) @@ -171,7 +171,7 @@ int isp_find_pdb_by_wwn(ispsoftc_t *, in int isp_find_pdb_by_handle(ispsoftc_t *, int, uint32_t, fcportdb_t **); int isp_find_pdb_by_sid(ispsoftc_t *, int, uint32_t, fcportdb_t **); void isp_find_chan_by_did(ispsoftc_t *, uint32_t, uint16_t *); -void isp_add_wwn_entry(ispsoftc_t *, int, uint64_t, uint16_t, uint32_t, uint16_t); +void isp_add_wwn_entry(ispsoftc_t *, int, uint64_t, uint64_t, uint16_t, uint32_t, uint16_t); void isp_del_wwn_entry(ispsoftc_t *, int, uint64_t, uint16_t, uint32_t); void isp_del_all_wwn_entries(ispsoftc_t *, int); void isp_del_wwn_entries(ispsoftc_t *, isp_notify_t *); Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:45:15 2015 (r290787) @@ -1085,6 +1085,7 @@ isp_notify_ack(ispsoftc_t *isp, void *ar na->na_flags = in->in_flags; na->na_status = in->in_status; na->na_status_subcode = in->in_status_subcode; + na->na_fwhandle = in->in_fwhandle; na->na_rxid = in->in_rxid; na->na_oxid = in->in_oxid; na->na_vpidx = in->in_vpidx; Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:43:58 2015 (r290786) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:45:15 2015 (r290787) @@ -1812,7 +1812,7 @@ typedef struct { uint16_t in_srr_rxid; uint16_t in_status; uint8_t in_status_subcode; - uint8_t in_reserved2; + uint8_t in_fwhandle; uint32_t in_rxid; uint16_t in_srr_reloff_lo; uint16_t in_srr_reloff_hi; @@ -1845,6 +1845,8 @@ typedef struct { #define IN24XX_FLAG_PUREX_IOCB 0x1 #define IN24XX_FLAG_GLOBAL_LOGOUT 0x2 #define IN24XX_FLAG_NPHDL_VALID 0x4 +#define IN24XX_FLAG_N2N_PRLI 0x8 +#define IN24XX_FLAG_PN_NN_VALID 0x10 #define IN24XX_LIP_RESET 0x0E #define IN24XX_LINK_RESET 0x0F @@ -1862,6 +1864,8 @@ typedef struct { * the WWNN/WWPN if the ELS is PLOGI, PDISC or ADISC. The WWN is in * Big Endian format. */ +#define IN24XX_PRLI_WWNN_OFF 0x18 +#define IN24XX_PRLI_WWPN_OFF 0x28 #define IN24XX_PLOGI_WWNN_OFF 0x20 #define IN24XX_PLOGI_WWPN_OFF 0x28 @@ -1965,7 +1969,7 @@ typedef struct { uint16_t na_srr_rxid; uint16_t na_status; uint8_t na_status_subcode; - uint8_t na_reserved2; + uint8_t na_fwhandle; uint32_t na_rxid; uint16_t na_srr_reloff_lo; uint16_t na_srr_reloff_hi; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:46:26 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEB20A2E95E; Fri, 13 Nov 2015 19:46:26 +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 5F6F912E1; Fri, 13 Nov 2015 19:46:26 +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 tADJkPDK095786; Fri, 13 Nov 2015 19:46:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJkP50095784; Fri, 13 Nov 2015 19:46:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131946.tADJkP50095784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290788 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:46:26 -0000 Author: mav Date: Fri Nov 13 19:46:25 2015 New Revision: 290788 URL: https://svnweb.freebsd.org/changeset/base/290788 Log: MFC r289855: Minor additions to Status Type 0 IOCB. Modified: stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:45:15 2015 (r290787) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:46:25 2015 (r290788) @@ -1158,7 +1158,7 @@ isp_get_24xx_response(ispsoftc_t *isp, i ISP_IOXGET_32(isp, &src->req_resid, dst->req_resid); ISP_IOXGET_16(isp, &src->req_reserved0, dst->req_reserved0); ISP_IOXGET_16(isp, &src->req_state_flags, dst->req_state_flags); - ISP_IOXGET_16(isp, &src->req_reserved1, dst->req_reserved1); + ISP_IOXGET_16(isp, &src->req_retry_delay, dst->req_retry_delay); ISP_IOXGET_16(isp, &src->req_scsi_status, dst->req_scsi_status); ISP_IOXGET_32(isp, &src->req_fcp_residual, dst->req_fcp_residual); ISP_IOXGET_32(isp, &src->req_sense_len, dst->req_sense_len); Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:45:15 2015 (r290787) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:46:25 2015 (r290788) @@ -632,7 +632,7 @@ typedef struct { uint32_t req_resid; uint16_t req_reserved0; uint16_t req_state_flags; - uint16_t req_reserved1; + uint16_t req_retry_delay; /* aka Status Qualifier */ uint16_t req_scsi_status; uint32_t req_fcp_residual; uint32_t req_sense_len; @@ -644,11 +644,12 @@ typedef struct { * For Qlogic 2X00, the high order byte of SCSI status has * additional meaning. */ -#define RQCS_RU 0x800 /* Residual Under */ -#define RQCS_RO 0x400 /* Residual Over */ +#define RQCS_CR 0x1000 /* Confirmation Request */ +#define RQCS_RU 0x0800 /* Residual Under */ +#define RQCS_RO 0x0400 /* Residual Over */ #define RQCS_RESID (RQCS_RU|RQCS_RO) -#define RQCS_SV 0x200 /* Sense Length Valid */ -#define RQCS_RV 0x100 /* FCP Response Length Valid */ +#define RQCS_SV 0x0200 /* Sense Length Valid */ +#define RQCS_RV 0x0100 /* FCP Response Length Valid */ /* * CT Passthru IOCB From owner-svn-src-stable@freebsd.org Fri Nov 13 19:47:21 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 111ACA2E9AE; Fri, 13 Nov 2015 19:47:21 +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 B539F147F; Fri, 13 Nov 2015 19:47:20 +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 tADJlJ0K095869; Fri, 13 Nov 2015 19:47:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJlJev095868; Fri, 13 Nov 2015 19:47:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131947.tADJlJev095868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290789 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:47:21 -0000 Author: mav Date: Fri Nov 13 19:47:19 2015 New Revision: 290789 URL: https://svnweb.freebsd.org/changeset/base/290789 Log: MFC r289875: Decode few more response info codes. Though CAM still does not send any requests that would require those. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:46:25 2015 (r290788) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:47:19 2015 (r290789) @@ -5443,24 +5443,32 @@ again: if (resp && rlen >= 4 && resp[FCP_RSPNS_CODE_OFFSET] != 0) { const char *ptr; char lb[64]; - const char *rnames[6] = { - "Task Management Function Done", - "Data Length Differs From Burst Length", - "Invalid FCP Cmnd", - "FCP DATA RO mismatch with FCP DATA_XFR_RDY RO", - "Task Management Function Rejected", - "Task Management Function Failed", + const char *rnames[10] = { + "Task Management function complete", + "FCP_DATA length different than FCP_BURST_LEN", + "FCP_CMND fields invalid", + "FCP_DATA parameter mismatch with FCP_DATA_RO", + "Task Management function rejected", + "Task Management function failed", + NULL, + NULL, + "Task Management function succeeded", + "Task Management function incorrect logical unit number", }; - if (resp[FCP_RSPNS_CODE_OFFSET] > 5) { - ISP_SNPRINTF(lb, sizeof lb, "Unknown FCP Response Code 0x%x", resp[FCP_RSPNS_CODE_OFFSET]); + uint8_t code = resp[FCP_RSPNS_CODE_OFFSET]; + if (code >= 10 || rnames[code] == NULL) { + ISP_SNPRINTF(lb, sizeof(lb), + "Unknown FCP Response Code 0x%x", + code); ptr = lb; } else { - ptr = rnames[resp[FCP_RSPNS_CODE_OFFSET]]; + ptr = rnames[code]; } - isp_xs_prt(isp, xs, ISP_LOGWARN, "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", rlen, ptr, XS_CDBP(xs)[0] & 0xff); - if (resp[FCP_RSPNS_CODE_OFFSET] != 0) { + isp_xs_prt(isp, xs, ISP_LOGWARN, + "FCP RESPONSE, LENGTH %u: %s CDB0=0x%02x", + rlen, ptr, XS_CDBP(xs)[0] & 0xff); + if (code != 0 && code != 8) XS_SETERR(xs, HBA_BOTCH); - } } if (IS_24XX(isp)) { isp_parse_status_24xx(isp, (isp24xx_statusreq_t *)sp, xs, &resid); From owner-svn-src-stable@freebsd.org Fri Nov 13 19:48:43 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 129DEA2EA2B; Fri, 13 Nov 2015 19:48:43 +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 C671B1630; Fri, 13 Nov 2015 19:48:42 +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 tADJmfe0095967; Fri, 13 Nov 2015 19:48:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJmfx5095965; Fri, 13 Nov 2015 19:48:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131948.tADJmfx5095965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290790 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:48:43 -0000 Author: mav Date: Fri Nov 13 19:48:41 2015 New Revision: 290790 URL: https://svnweb.freebsd.org/changeset/base/290790 Log: MFC r289877: Remove ISP_INTERNAL_TARGET code. We have CTL now, which is real and much more functional then this joke. Modified: stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:47:19 2015 (r290789) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:48:41 2015 (r290790) @@ -68,10 +68,6 @@ static timeout_t isp_ldt; static task_fn_t isp_ldt_task; static void isp_kthread(void *); static void isp_action(struct cam_sim *, union ccb *); -#ifdef ISP_INTERNAL_TARGET -static void isp_target_thread_pi(void *); -static void isp_target_thread_fc(void *); -#endif static int isp_timer_count; static void isp_timer(void *); @@ -159,14 +155,6 @@ isp_attach_chan(ispsoftc_t *isp, struct struct isp_spi *spi = ISP_SPI_PC(isp, chan); spi->sim = sim; spi->path = path; -#ifdef ISP_INTERNAL_TARGET - ISP_SET_PC(isp, chan, proc_active, 1); - if (THREAD_CREATE(isp_target_thread_pi, spi, &spi->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - ISP_SET_PC(isp, chan, proc_active, 0); - isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); - } - ISP_SPI_PC(isp, chan)->num_threads += 1; -#endif } else { fcparam *fcp = FCPARAM(isp, chan); struct isp_fc *fc = ISP_FC_PC(isp, chan); @@ -205,14 +193,6 @@ isp_attach_chan(ispsoftc_t *isp, struct return (ENOMEM); } fc->num_threads += 1; -#ifdef ISP_INTERNAL_TARGET - ISP_SET_PC(isp, chan, proc_active, 1); - if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - ISP_SET_PC(isp, chan, proc_active, 0); - isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); - } - fc->num_threads += 1; -#endif if (chan > 0) { snprintf(name, sizeof(name), "chan%d", chan); tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), @@ -258,18 +238,6 @@ isp_attach_chan(ispsoftc_t *isp, struct } static void -isp_detach_internal_target(ispsoftc_t *isp, int chan) -{ -#ifdef ISP_INTERNAL_TARGET - void *wchan; - - ISP_GET_PC(isp, chan, target_proc, wchan); - ISP_SET_PC(isp, chan, proc_active, 0); - wakeup(wchan); -#endif -} - -static void isp_detach_chan(ispsoftc_t *isp, int chan) { struct cam_sim *sim; @@ -293,7 +261,6 @@ isp_detach_chan(ispsoftc_t *isp, int cha /* Wait for the channel's spawned threads to exit. */ wakeup(isp->isp_osinfo.pc.ptr); - isp_detach_internal_target(isp, chan); while (*num_threads != 0) mtx_sleep(isp, &isp->isp_osinfo.lock, PRIBIO, "isp_reap", 100); } @@ -3598,859 +3565,6 @@ isp_target_mark_aborted_early(ispsoftc_t } } } - - -#ifdef ISP_INTERNAL_TARGET -//#define ISP_SEPARATE_STATUS 1 -#define ISP_MULTI_CCBS 1 -#if defined(ISP_MULTI_CCBS) && !defined(ISP_SEPARATE_STATUS) -#define ISP_SEPARATE_STATUS 1 -#endif - -typedef struct periph_private_data_t { - union ccb *ccb; /* original ATIO or Immediate Notify */ - unsigned long offset; /* current offset */ - int sequence; /* current CTIO sequence */ - int ctio_cnt; /* current # of ctio's outstanding */ - int - status_sent : 1, - on_queue : 1; /* on restart queue */ -} ppd_t; -/* - * Each ATIO we allocate will have periph private data associated with it - * that maintains per-command state. This private to each ATIO. - */ -#define ATIO_PPD(ccb) ((ppd_t *)(((struct ccb_hdr *)ccb)->ppriv_ptr0)) -/* - * Each CTIO we send downstream will get a pointer to the ATIO itself - * so that on completion we can retrieve that pointer. - */ -#define ccb_atio ppriv_ptr1 -#define ccb_inot ppriv_ptr1 - -/* - * Each CTIO we send downstream will contain a sequence number - */ -#define CTIO_SEQ(ccb) ccb->ccb_h.ppriv_field0 - -#define MAX_ISP_TARG_TRANSFER (2 << 20) -#define NISP_TARG_CMDS 64 -#define NISP_TARG_NOTIFIES 64 -#define DISK_SHIFT 9 -#define JUNK_SIZE 256 -#define MULTI_CCB_DATA_LIM 8192 -//#define MULTI_CCB_DATA_CNT 64 -#define MULTI_CCB_DATA_CNT 8 - -extern u_int vm_kmem_size; -static int ca; -static uint32_t disk_size; -static uint8_t *disk_data = NULL; -static uint8_t *junk_data; -static MALLOC_DEFINE(M_ISPTARG, "ISPTARG", "ISP TARGET data"); -struct isptarg_softc { - /* CCBs (CTIOs, ATIOs, INOTs) pending on the controller */ - struct isp_ccbq work_queue; - struct isp_ccbq rework_queue; - struct isp_ccbq running_queue; - struct isp_ccbq inot_queue; - struct cam_periph *periph; - struct cam_path *path; - ispsoftc_t *isp; -}; -static periph_ctor_t isptargctor; -static periph_dtor_t isptargdtor; -static periph_start_t isptargstart; -static periph_init_t isptarginit; -static void isptarg_done(struct cam_periph *, union ccb *); -static void isptargasync(void *, u_int32_t, struct cam_path *, void *); - - -static int isptarg_rwparm(uint8_t *, uint8_t *, uint64_t, uint32_t, uint8_t **, uint32_t *, int *); - -static struct periph_driver isptargdriver = -{ - isptarginit, "isptarg", TAILQ_HEAD_INITIALIZER(isptargdriver.units), 0 -}; - -static void -isptarginit(void) -{ -} - -static void -isptargnotify(ispsoftc_t *isp, union ccb *iccb, struct ccb_immediate_notify *inot) -{ - struct ccb_notify_acknowledge *ack = &iccb->cna2; - - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, inot->ccb_h.path, "%s: [0x%x] immediate notify for 0x%x from 0x%x status 0x%x arg 0x%x\n", __func__, - inot->tag_id, inot->initiator_id, inot->seq_id, inot->ccb_h.status, inot->arg); - ack->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; - ack->ccb_h.flags = 0; - ack->ccb_h.retry_count = 0; - ack->ccb_h.cbfcnp = isptarg_done; - ack->ccb_h.timeout = 0; - ack->ccb_h.ccb_inot = inot; - ack->tag_id = inot->tag_id; - ack->seq_id = inot->seq_id; - ack->initiator_id = inot->initiator_id; - xpt_action(iccb); -} - -static void -isptargstart(struct cam_periph *periph, union ccb *iccb) -{ - const uint8_t niliqd[SHORT_INQUIRY_LENGTH] = { - 0x7f, 0x0, 0x5, 0x2, 32, 0, 0, 0x32, - 'F', 'R', 'E', 'E', 'B', 'S', 'D', ' ', - 'S', 'C', 'S', 'I', ' ', 'N', 'U', 'L', - 'L', ' ', 'D', 'E', 'V', 'I', 'C', 'E', - '0', '0', '0', '1' - }; - const uint8_t iqd[SHORT_INQUIRY_LENGTH] = { - 0, 0x0, 0x5, 0x2, 32, 0, 0, 0x32, - 'F', 'R', 'E', 'E', 'B', 'S', 'D', ' ', - 'S', 'C', 'S', 'I', ' ', 'M', 'E', 'M', - 'O', 'R', 'Y', ' ', 'D', 'I', 'S', 'K', - '0', '0', '0', '1' - }; - int r, i, more = 0, last, is_data_cmd = 0, is_write; - char *queue; - struct isptarg_softc *softc = periph->softc; - struct ccb_scsiio *csio; - lun_id_t return_lun; - struct ccb_accept_tio *atio; - uint8_t *cdb, *ptr, status; - uint8_t *data_ptr; - uint32_t data_len, flags; - struct ccb_hdr *ccbh; - - mtx_assert(periph->sim->mtx, MA_OWNED); - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG1, iccb->ccb_h.path, "%s: function code 0x%x INOTQ=%c WORKQ=%c REWORKQ=%c\n", __func__, iccb->ccb_h.func_code, - TAILQ_FIRST(&softc->inot_queue)? 'y' : 'n', TAILQ_FIRST(&softc->work_queue)? 'y' : 'n', TAILQ_FIRST(&softc->rework_queue)? 'y' : 'n'); - /* - * Check for immediate notifies first - */ - ccbh = TAILQ_FIRST(&softc->inot_queue); - if (ccbh) { - TAILQ_REMOVE(&softc->inot_queue, ccbh, periph_links.tqe); - if (TAILQ_FIRST(&softc->inot_queue) || TAILQ_FIRST(&softc->work_queue) || TAILQ_FIRST(&softc->rework_queue)) { - xpt_schedule(periph, 1); - } - isptargnotify(softc->isp, iccb, (struct ccb_immediate_notify *)ccbh); - return; - } - - /* - * Check the rework (continuation) work queue first. - */ - ccbh = TAILQ_FIRST(&softc->rework_queue); - if (ccbh) { - atio = (struct ccb_accept_tio *)ccbh; - TAILQ_REMOVE(&softc->rework_queue, ccbh, periph_links.tqe); - more = TAILQ_FIRST(&softc->work_queue) || TAILQ_FIRST(&softc->rework_queue); - queue = "rework"; - } else { - ccbh = TAILQ_FIRST(&softc->work_queue); - if (ccbh == NULL) { - xpt_release_ccb(iccb); - return; - } - atio = (struct ccb_accept_tio *)ccbh; - TAILQ_REMOVE(&softc->work_queue, ccbh, periph_links.tqe); - more = TAILQ_FIRST(&softc->work_queue) != NULL; - queue = "work"; - } - ATIO_PPD(atio)->on_queue = 0; - - if (atio->tag_id == 0xffffffff || atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) { - panic("BAD ATIO"); - } - - data_len = is_write = 0; - data_ptr = NULL; - csio = &iccb->csio; - status = SCSI_STATUS_OK; - flags = CAM_SEND_STATUS; - memset(&atio->sense_data, 0, sizeof (atio->sense_data)); - cdb = atio->cdb_io.cdb_bytes; - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG0, ccbh->path, "%s: [0x%x] processing ATIO from %s queue initiator 0x%x CDB=0x%x data_offset=%u\n", __func__, atio->tag_id, - queue, atio->init_id, cdb[0], ATIO_PPD(atio)->offset); - - return_lun = XS_LUN(atio); - if (return_lun != 0) { - xpt_print(atio->ccb_h.path, "[0x%x] Non-Zero Lun %d: cdb0=0x%x\n", atio->tag_id, return_lun, cdb[0]); - if (cdb[0] != INQUIRY && cdb[0] != REPORT_LUNS && cdb[0] != REQUEST_SENSE) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - SDFIXED(atio->sense_data)->add_sense_code = 0x25; /* LOGICAL UNIT NOT SUPPORTED */ - atio->sense_len = SSD_MIN_SIZE; - } - return_lun = CAM_LUN_WILDCARD; - } - - switch (cdb[0]) { - case REQUEST_SENSE: - flags |= CAM_DIR_IN; - data_len = sizeof (atio->sense_data); - junk_data[0] = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR|SSD_KEY_NO_SENSE; - memset(junk_data+1, 0, data_len-1); - if (data_len > cdb[4]) { - data_len = cdb[4]; - } - if (data_len) { - data_ptr = junk_data; - } - break; - case WRITE_6: - case WRITE_10: - case WRITE_12: - case WRITE_16: - is_write = 1; - /* FALLTHROUGH */ - case READ_6: - case READ_10: - case READ_12: - case READ_16: - is_data_cmd = 1; - r = isptarg_rwparm(cdb, disk_data, disk_size, ATIO_PPD(atio)->offset, &data_ptr, &data_len, &last); - if (r != 0) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - if (r == -1) { - SDFIXED(atio->sense_data)->add_sense_code = 0x21; /* LOGICAL BLOCK ADDRESS OUT OF RANGE */ - } else { - SDFIXED(atio->sense_data)->add_sense_code = 0x20; /* INVALID COMMAND OPERATION CODE */ - } - atio->sense_len = SSD_MIN_SIZE; - } else { -#ifdef ISP_SEPARATE_STATUS - if (last && data_len) { - last = 0; - } -#endif - if (last == 0) { - flags &= ~CAM_SEND_STATUS; - } - if (data_len) { - ATIO_PPD(atio)->offset += data_len; - if (is_write) - flags |= CAM_DIR_OUT; - else - flags |= CAM_DIR_IN; - } else { - flags |= CAM_DIR_NONE; - } - } - break; - case INQUIRY: - flags |= CAM_DIR_IN; - if (cdb[1] || cdb[2] || cdb[3]) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_UNIT_ATTENTION; - SDFIXED(atio->sense_data)->add_sense_code = 0x24; /* INVALID FIELD IN CDB */ - atio->sense_len = SSD_MIN_SIZE; - break; - } - data_len = sizeof (iqd); - if (data_len > cdb[4]) { - data_len = cdb[4]; - } - if (data_len) { - if (XS_LUN(iccb) != 0) { - memcpy(junk_data, niliqd, sizeof (iqd)); - } else { - memcpy(junk_data, iqd, sizeof (iqd)); - } - data_ptr = junk_data; - } - break; - case TEST_UNIT_READY: - flags |= CAM_DIR_NONE; - if (ca) { - ca = 0; - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_UNIT_ATTENTION; - SDFIXED(atio->sense_data)->add_sense_code = 0x29; /* POWER ON, RESET, OR BUS DEVICE RESET OCCURRED */ - atio->sense_len = SSD_MIN_SIZE; - } - break; - case SYNCHRONIZE_CACHE: - case START_STOP: - case RESERVE: - case RELEASE: - case VERIFY_10: - flags |= CAM_DIR_NONE; - break; - - case READ_CAPACITY: - flags |= CAM_DIR_IN; - if (cdb[2] || cdb[3] || cdb[4] || cdb[5]) { - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - SDFIXED(atio->sense_data)->add_sense_code = 0x24; /* INVALID FIELD IN CDB */ - atio->sense_len = SSD_MIN_SIZE; - break; - } - if (cdb[8] & 0x1) { /* PMI */ - junk_data[0] = 0xff; - junk_data[1] = 0xff; - junk_data[2] = 0xff; - junk_data[3] = 0xff; - } else { - uint64_t last_blk = (disk_size >> DISK_SHIFT) - 1; - if (last_blk < 0xffffffffULL) { - junk_data[0] = (last_blk >> 24) & 0xff; - junk_data[1] = (last_blk >> 16) & 0xff; - junk_data[2] = (last_blk >> 8) & 0xff; - junk_data[3] = (last_blk) & 0xff; - } else { - junk_data[0] = 0xff; - junk_data[1] = 0xff; - junk_data[2] = 0xff; - junk_data[3] = 0xff; - } - } - junk_data[4] = ((1 << DISK_SHIFT) >> 24) & 0xff; - junk_data[5] = ((1 << DISK_SHIFT) >> 16) & 0xff; - junk_data[6] = ((1 << DISK_SHIFT) >> 8) & 0xff; - junk_data[7] = ((1 << DISK_SHIFT)) & 0xff; - data_ptr = junk_data; - data_len = 8; - break; - case REPORT_LUNS: - flags |= CAM_DIR_IN; - memset(junk_data, 0, JUNK_SIZE); - junk_data[0] = (1 << 3) >> 24; - junk_data[1] = (1 << 3) >> 16; - junk_data[2] = (1 << 3) >> 8; - junk_data[3] = (1 << 3); - ptr = NULL; - for (i = 0; i < 1; i++) { - ptr = &junk_data[8 + (i << 3)]; - if (i >= 256) { - ptr[0] = 0x40 | ((i >> 8) & 0x3f); - } - ptr[1] = i; - } - data_ptr = junk_data; - data_len = (ptr + 8) - junk_data; - break; - - default: - flags |= CAM_DIR_NONE; - status = SCSI_STATUS_CHECK_COND; - SDFIXED(atio->sense_data)->error_code = SSD_ERRCODE_VALID|SSD_CURRENT_ERROR; - SDFIXED(atio->sense_data)->flags = SSD_KEY_ILLEGAL_REQUEST; - SDFIXED(atio->sense_data)->add_sense_code = 0x20; /* INVALID COMMAND OPERATION CODE */ - atio->sense_len = SSD_MIN_SIZE; - break; - } - - /* - * If we are done with the transaction, tell the - * controller to send status and perform a CMD_CMPLT. - * If we have associated sense data, see if we can - * send that too. - */ - if (status == SCSI_STATUS_CHECK_COND) { - flags |= CAM_SEND_SENSE; - csio->sense_len = atio->sense_len; - csio->sense_data = atio->sense_data; - flags &= ~CAM_DIR_MASK; - data_len = 0; - data_ptr = NULL; - } - cam_fill_ctio(csio, 0, isptarg_done, flags, MSG_SIMPLE_Q_TAG, atio->tag_id, atio->init_id, status, data_ptr, data_len, 30 * hz); - iccb->ccb_h.target_id = atio->ccb_h.target_id; - iccb->ccb_h.target_lun = return_lun; - iccb->ccb_h.ccb_atio = atio; - CTIO_SEQ(iccb) = ATIO_PPD(atio)->sequence++; - ATIO_PPD(atio)->ctio_cnt++; - if (flags & CAM_SEND_STATUS) { - KASSERT((ATIO_PPD(atio)->status_sent == 0), ("we have already sent status for 0x%x in %s", atio->tag_id, __func__)); - ATIO_PPD(atio)->status_sent = 1; - } - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG0, atio->ccb_h.path, "%s: sending downstream for 0x%x sequence %u len %u flags %x\n", __func__, atio->tag_id, CTIO_SEQ(iccb), data_len, flags); - xpt_action(iccb); - - if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(periph->path, 0, 0, 0, 0); - atio->ccb_h.status &= ~CAM_DEV_QFRZN; - } -#ifdef ISP_MULTI_CCBS - if (is_data_cmd && ATIO_PPD(atio)->status_sent == 0 && ATIO_PPD(atio)->ctio_cnt < MULTI_CCB_DATA_CNT && ATIO_PPD(atio)->on_queue == 0) { - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG0, atio->ccb_h.path, "%s: more still to do for 0x%x\n", __func__, atio->tag_id); - TAILQ_INSERT_TAIL(&softc->rework_queue, &atio->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - more = 1; - } -#endif - if (more) { - xpt_schedule(periph, 1); - } -} - -static cam_status -isptargctor(struct cam_periph *periph, void *arg) -{ - struct isptarg_softc *softc; - - softc = (struct isptarg_softc *)arg; - periph->softc = softc; - softc->periph = periph; - softc->path = periph->path; - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG1, periph->path, "%s called\n", __func__); - return (CAM_REQ_CMP); -} - -static void -isptargdtor(struct cam_periph *periph) -{ - struct isptarg_softc *softc; - softc = (struct isptarg_softc *)periph->softc; - ISP_PATH_PRT(softc->isp, ISP_LOGTDEBUG1, periph->path, "%s called\n", __func__); - softc->periph = NULL; - softc->path = NULL; - periph->softc = NULL; -} - -static void -isptarg_done(struct cam_periph *periph, union ccb *ccb) -{ - struct isptarg_softc *softc; - ispsoftc_t *isp; - uint32_t newoff; - struct ccb_accept_tio *atio; - struct ccb_immediate_notify *inot; - cam_status status; - - softc = (struct isptarg_softc *)periph->softc; - isp = softc->isp; - status = ccb->ccb_h.status & CAM_STATUS_MASK; - - switch (ccb->ccb_h.func_code) { - case XPT_ACCEPT_TARGET_IO: - atio = (struct ccb_accept_tio *) ccb; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] ATIO seen in %s\n", atio->tag_id, __func__); - memset(ATIO_PPD(atio), 0, sizeof (ppd_t)); - TAILQ_INSERT_TAIL(&softc->work_queue, &ccb->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - xpt_schedule(periph, 1); - break; - case XPT_IMMEDIATE_NOTIFY: - inot = (struct ccb_immediate_notify *) ccb; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] INOT for 0x%x seen in %s\n", inot->tag_id, inot->seq_id, __func__); - TAILQ_INSERT_TAIL(&softc->inot_queue, &ccb->ccb_h, periph_links.tqe); - xpt_schedule(periph, 1); - break; - case XPT_CONT_TARGET_IO: - atio = ccb->ccb_h.ccb_atio; - KASSERT((ATIO_PPD(atio)->ctio_cnt != 0), ("ctio zero when finishing a CTIO")); - ATIO_PPD(atio)->ctio_cnt--; - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - switch (ccb->ccb_h.status & CAM_STATUS_MASK) { - case CAM_MESSAGE_RECV: - newoff = (ccb->csio.msg_ptr[3] << 24) | (ccb->csio.msg_ptr[4] << 16) | (ccb->csio.msg_ptr[5] << 8) | (ccb->csio.msg_ptr[6]); - ISP_PATH_PRT(isp, ISP_LOGWARN, ccb->ccb_h.path, "[0x%x] got message to return to reset offset to 0x%x at sequence %u\n", atio->tag_id, newoff, CTIO_SEQ(ccb)); - ATIO_PPD(atio)->offset = newoff; - ATIO_PPD(atio)->status_sent = 0; - if (ATIO_PPD(atio)->on_queue == 0) { - TAILQ_INSERT_TAIL(&softc->rework_queue, &atio->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - } - xpt_schedule(periph, 1); - break; - default: - cam_error_print(ccb, CAM_ESF_ALL, CAM_EPF_ALL); - xpt_action((union ccb *)atio); - break; - } - } else if ((ccb->ccb_h.flags & CAM_SEND_STATUS) == 0) { - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] MID CTIO sequence %u seen in %s\n", atio->tag_id, CTIO_SEQ(ccb), __func__); - if (ATIO_PPD(atio)->status_sent == 0 && ATIO_PPD(atio)->on_queue == 0) { - TAILQ_INSERT_TAIL(&softc->rework_queue, &atio->ccb_h, periph_links.tqe); - ATIO_PPD(atio)->on_queue = 1; - } - xpt_schedule(periph, 1); - } else { - KASSERT((ATIO_PPD(atio)->ctio_cnt == 0), ("ctio count still %d when we think we've sent the STATUS ctio", ATIO_PPD(atio)->ctio_cnt)); - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, ccb->ccb_h.path, "[0x%x] FINAL CTIO sequence %u seen in %s\n", atio->tag_id, CTIO_SEQ(ccb), __func__); - xpt_action((union ccb *)atio); - } - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); - ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - xpt_release_ccb(ccb); - break; - case XPT_NOTIFY_ACKNOWLEDGE: - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0); - ccb->ccb_h.status &= ~CAM_DEV_QFRZN; - } - inot = ccb->ccb_h.ccb_inot; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG1, inot->ccb_h.path, "[0x%x] recycle notify for tag 0x%x\n", inot->tag_id, inot->seq_id); - xpt_release_ccb(ccb); - xpt_action((union ccb *)inot); - break; - default: - xpt_print(ccb->ccb_h.path, "unexpected code 0x%x\n", ccb->ccb_h.func_code); - break; - } -} - -static void -isptargasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) -{ - struct ac_contract *acp = arg; - struct ac_device_changed *fc = (struct ac_device_changed *) acp->contract_data; - - if (code != AC_CONTRACT) { - return; - } - xpt_print(path, "0x%016llx Port ID 0x%06x %s\n", (unsigned long long) fc->wwpn, fc->port, fc->arrived? "arrived" : "departed"); -} - -static void -isp_target_thread(ispsoftc_t *isp, int chan) -{ - union ccb *ccb = NULL; - int i; - void *wchan; - cam_status status; - struct isptarg_softc *softc = NULL; - struct cam_periph *periph = NULL, *wperiph = NULL; - struct cam_path *path, *wpath; - struct cam_sim *sim; - - if (disk_data == NULL) { - disk_size = roundup2(vm_kmem_size >> 1, (1ULL << 20)); - if (disk_size < (50 << 20)) { - disk_size = 50 << 20; - } - disk_data = malloc(disk_size, M_ISPTARG, M_WAITOK | M_ZERO); - if (disk_data == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate disk data", __func__); - goto out; - } - isp_prt(isp, ISP_LOGINFO, "allocated a %ju MiB disk", (uintmax_t) (disk_size >> 20)); - } - junk_data = malloc(JUNK_SIZE, M_ISPTARG, M_WAITOK | M_ZERO); - if (junk_data == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate junk", __func__); - goto out; - } - - - softc = malloc(sizeof (*softc), M_ISPTARG, M_WAITOK | M_ZERO); - if (softc == NULL) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate softc", __func__); - goto out; - } - TAILQ_INIT(&softc->work_queue); - TAILQ_INIT(&softc->rework_queue); - TAILQ_INIT(&softc->running_queue); - TAILQ_INIT(&softc->inot_queue); - softc->isp = isp; - - periphdriver_register(&isptargdriver); - ISP_GET_PC(isp, chan, sim, sim); - ISP_GET_PC(isp, chan, path, path); - status = xpt_create_path(&wpath, NULL, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); - if (status != CAM_REQ_CMP) { - isp_prt(isp, ISP_LOGERR, "%s: could not allocate wildcard path", __func__); - return; - } - status = xpt_create_path(&path, NULL, cam_sim_path(sim), 0, 0); - if (status != CAM_REQ_CMP) { - xpt_free_path(wpath); - isp_prt(isp, ISP_LOGERR, "%s: could not allocate path", __func__); - return; - } - - ISP_LOCK(isp); - status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, wpath, NULL, 0, softc); - if (status != CAM_REQ_CMP) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: cam_periph_alloc for wildcard failed", __func__); - goto out; - } - wperiph = cam_periph_find(wpath, "isptarg"); - if (wperiph == NULL) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: wildcard periph already allocated but doesn't exist", __func__); - goto out; - } - - status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, path, NULL, 0, softc); - if (status != CAM_REQ_CMP) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: cam_periph_alloc failed", __func__); - goto out; - } - - periph = cam_periph_find(path, "isptarg"); - if (periph == NULL) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: periph already allocated but doesn't exist", __func__); - goto out; - } - - status = xpt_register_async(AC_CONTRACT, isptargasync, isp, wpath); - if (status != CAM_REQ_CMP) { - ISP_UNLOCK(isp); - isp_prt(isp, ISP_LOGERR, "%s: xpt_register_async failed", __func__); - goto out; - } - - ISP_UNLOCK(isp); - - ccb = xpt_alloc_ccb(); - - /* - * Make sure role is none. - */ - xpt_setup_ccb(&ccb->ccb_h, periph->path, 10); - ccb->ccb_h.func_code = XPT_SET_SIM_KNOB; - ccb->knob.xport_specific.fc.role = KNOB_ROLE_NONE; - ccb->knob.xport_specific.fc.valid = KNOB_VALID_ROLE; - - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - - /* - * Now enable luns - */ - xpt_setup_ccb(&ccb->ccb_h, periph->path, 10); - ccb->ccb_h.func_code = XPT_EN_LUN; - ccb->cel.enable = 1; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - if (ccb->ccb_h.status != CAM_REQ_CMP) { - xpt_free_ccb(ccb); - xpt_print(periph->path, "failed to enable lun (0x%x)\n", ccb->ccb_h.status); - goto out; - } - - xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 10); - ccb->ccb_h.func_code = XPT_EN_LUN; - ccb->cel.enable = 1; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - if (ccb->ccb_h.status != CAM_REQ_CMP) { - xpt_free_ccb(ccb); - xpt_print(wperiph->path, "failed to enable lun (0x%x)\n", ccb->ccb_h.status); - goto out; - } - xpt_free_ccb(ccb); - - /* - * Add resources - */ - ISP_GET_PC(isp, chan, target_proc, wchan); - for (i = 0; i < 4; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 1); - ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; - ccb->ccb_h.cbfcnp = isptarg_done; - ccb->ccb_h.ppriv_ptr0 = malloc(sizeof (ppd_t), M_ISPTARG, M_WAITOK | M_ZERO); - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - for (i = 0; i < NISP_TARG_CMDS; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, periph->path, 1); - ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; - ccb->ccb_h.cbfcnp = isptarg_done; - ccb->ccb_h.ppriv_ptr0 = malloc(sizeof (ppd_t), M_ISPTARG, M_WAITOK | M_ZERO); - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - for (i = 0; i < 4; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, wperiph->path, 1); - ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; - ccb->ccb_h.cbfcnp = isptarg_done; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - for (i = 0; i < NISP_TARG_NOTIFIES; i++) { - ccb = malloc(sizeof (*ccb), M_ISPTARG, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, periph->path, 1); - ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; - ccb->ccb_h.cbfcnp = isptarg_done; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - } - - /* - * Now turn it all back on - */ - xpt_setup_ccb(&ccb->ccb_h, periph->path, 10); - ccb->ccb_h.func_code = XPT_SET_SIM_KNOB; - ccb->knob.xport_specific.fc.valid = KNOB_VALID_ROLE; - ccb->knob.xport_specific.fc.role = KNOB_ROLE_TARGET; - ISP_LOCK(isp); - xpt_action(ccb); - ISP_UNLOCK(isp); - - /* - * Okay, while things are still active, sleep... - */ - ISP_LOCK(isp); - for (;;) { - ISP_GET_PC(isp, chan, proc_active, i); - if (i == 0) { - break; - } - msleep(wchan, &isp->isp_lock, PUSER, "tsnooze", 0); - } - ISP_UNLOCK(isp); - -out: - if (wperiph) { - cam_periph_invalidate(wperiph); - } - if (periph) { - cam_periph_invalidate(periph); - } - if (junk_data) { - free(junk_data, M_ISPTARG); - } - if (disk_data) { - free(disk_data, M_ISPTARG); - } - if (softc) { - free(softc, M_ISPTARG); - } - xpt_free_path(path); - xpt_free_path(wpath); -} - -static void -isp_target_thread_pi(void *arg) -{ - struct isp_spi *pi = arg; - ispsoftc_t *isp = cam_sim_softc(pi->sim); - int chan = cam_sim_bus(pi->sim); - - isp_target_thread(isp, chan); - ISP_SPI_PC(isp, chan)->num_threads -= 1; - kthread_exit(); -} - -static void -isp_target_thread_fc(void *arg) -{ - struct isp_fc *fc = arg; - ispsoftc_t *isp = cam_sim_softc(pi->sim); - int chan = cam_sim_bus(pi->sim); - - isp_target_thread(isp, chan); - ISP_FC_PC(isp, chan)->num_threads -= 1; - kthread_exit(); -} - -static int -isptarg_rwparm(uint8_t *cdb, uint8_t *dp, uint64_t dl, uint32_t offset, uint8_t **kp, uint32_t *tl, int *lp) -{ - uint32_t cnt, curcnt; - uint64_t lba; - - switch (cdb[0]) { - case WRITE_16: - case READ_16: - cnt = (((uint32_t)cdb[10]) << 24) | - (((uint32_t)cdb[11]) << 16) | - (((uint32_t)cdb[12]) << 8) | - ((uint32_t)cdb[13]); - - lba = (((uint64_t)cdb[2]) << 56) | - (((uint64_t)cdb[3]) << 48) | - (((uint64_t)cdb[4]) << 40) | - (((uint64_t)cdb[5]) << 32) | - (((uint64_t)cdb[6]) << 24) | - (((uint64_t)cdb[7]) << 16) | - (((uint64_t)cdb[8]) << 8) | - ((uint64_t)cdb[9]); - break; - case WRITE_12: - case READ_12: - cnt = (((uint32_t)cdb[6]) << 16) | - (((uint32_t)cdb[7]) << 8) | - ((u_int32_t)cdb[8]); - - lba = (((uint32_t)cdb[2]) << 24) | - (((uint32_t)cdb[3]) << 16) | - (((uint32_t)cdb[4]) << 8) | - ((uint32_t)cdb[5]); - break; - case WRITE_10: - case READ_10: - cnt = (((uint32_t)cdb[7]) << 8) | - ((u_int32_t)cdb[8]); - - lba = (((uint32_t)cdb[2]) << 24) | - (((uint32_t)cdb[3]) << 16) | - (((uint32_t)cdb[4]) << 8) | - ((uint32_t)cdb[5]); - break; - case WRITE_6: - case READ_6: - cnt = cdb[4]; - if (cnt == 0) { - cnt = 256; - } - lba = (((uint32_t)cdb[1] & 0x1f) << 16) | - (((uint32_t)cdb[2]) << 8) | - ((uint32_t)cdb[3]); - break; - default: - return (-1); - } - - cnt <<= DISK_SHIFT; - lba <<= DISK_SHIFT; - - if (offset == cnt) { - *lp = 1; - return (0); - } - - if (lba + cnt > dl) { - return (-2); - } - - curcnt = MAX_ISP_TARG_TRANSFER; - if (offset + curcnt >= cnt) { - curcnt = cnt - offset; - *lp = 1; - } else { - *lp = 0; - } -#ifdef ISP_MULTI_CCBS - if (curcnt > MULTI_CCB_DATA_LIM) - curcnt = MULTI_CCB_DATA_LIM; -#endif - *tl = curcnt; - *kp = &dp[lba + offset]; - return (0); -} - -#endif #endif static void Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:47:19 2015 (r290789) +++ stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:48:41 2015 (r290790) @@ -242,9 +242,6 @@ struct isp_fc { struct isp_nexus *nexus_free_list; uint32_t #ifdef ISP_TARGET_MODE -#ifdef ISP_INTERNAL_TARGET - proc_active : 1, -#endif tm_luns_enabled : 1, tm_enable_defer : 1, tm_enabled : 1, @@ -263,9 +260,6 @@ struct isp_fc { struct task gtask; #ifdef ISP_TARGET_MODE struct tslist lun_hash[LUN_HASH_SIZE]; -#ifdef ISP_INTERNAL_TARGET - struct proc * target_proc; -#endif #if defined(DEBUG) unsigned int inject_lost_data_frame; #endif @@ -278,9 +272,6 @@ struct isp_spi { struct cam_path *path; uint32_t #ifdef ISP_TARGET_MODE -#ifdef ISP_INTERNAL_TARGET - proc_active : 1, -#endif tm_luns_enabled : 1, tm_enable_defer : 1, tm_enabled : 1, @@ -290,9 +281,6 @@ struct isp_spi { iid : 4; #ifdef ISP_TARGET_MODE struct tslist lun_hash[LUN_HASH_SIZE]; -#ifdef ISP_INTERNAL_TARGET - struct proc * target_proc; -#endif #endif int num_threads; }; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:50:09 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5351A2EA89; Fri, 13 Nov 2015 19:50: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 AE5B218A6; Fri, 13 Nov 2015 19:50: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 tADJo8mt096084; Fri, 13 Nov 2015 19:50:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJo8YC096080; Fri, 13 Nov 2015 19:50:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131950.tADJo8YC096080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290791 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:50:10 -0000 Author: mav Date: Fri Nov 13 19:50:08 2015 New Revision: 290791 URL: https://svnweb.freebsd.org/changeset/base/290791 Log: MFC r289882: Add PIM_EXTLUNS support to isp(4) driver. Now 24xx and above chips support full 8-byte LUN address space. Older FC chips may support up to 16K LUNs when firmware allows. Tested in both initiator and target modes for 23xx, 24xx and 25xx. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:50:08 2015 (r290791) @@ -1319,7 +1319,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d } } else { if (ISP_CAP_SCCFW(isp)) { - isp->isp_maxluns = 16384; + isp->isp_maxluns = 0; /* No limit -- 2/8 bytes */ } else { isp->isp_maxluns = 16; } @@ -4380,7 +4380,9 @@ isp_start(XS_T *xs) fcparam *fcp = FCPARAM(isp, XS_CHANNEL(xs)); if ((fcp->role & ISP_ROLE_INITIATOR) == 0) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d I am not an initiator", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx I am not an initiator", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4400,18 +4402,24 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } if (lp->state == FC_PORTDB_STATE_ZOMBIE) { - isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d target zombie", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx target zombie", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); return (CMD_RQLATER); } if (lp->state != FC_PORTDB_STATE_VALID) { - isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d bad db port state 0x%x", XS_CHANNEL(xs), target, XS_LUN(xs), lp->state); + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx bad db port state 0x%x", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs), lp->state); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } } else { sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs)); if ((sdp->role & ISP_ROLE_INITIATOR) == 0) { - isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d I am not an initiator", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOGDEBUG1, + "%d.%d.%jx I am not an initiator", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4561,14 +4569,20 @@ isp_start(XS_T *xs) t7->req_tidlo = lp->portid; t7->req_tidhi = lp->portid >> 16; t7->req_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(xs)); - if (XS_LUN(xs) > 256) { +#if __FreeBSD_version >= 1000700 + be64enc(t7->req_lun, CAM_EXTLUN_BYTE_SWIZZLE(XS_LUN(xs))); +#else + if (XS_LUN(xs) >= 256) { t7->req_lun[0] = XS_LUN(xs) >> 8; t7->req_lun[0] |= 0x40; } t7->req_lun[1] = XS_LUN(xs); +#endif if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { if (FCP_NEXT_CRN(isp, &t7->req_crn, xs)) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d cannot generate next CRN", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx cannot generate next CRN", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } @@ -4585,7 +4599,9 @@ isp_start(XS_T *xs) } if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { if (FCP_NEXT_CRN(isp, &t2->req_crn, xs)) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d cannot generate next CRN", XS_CHANNEL(xs), target, XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx cannot generate next CRN", + XS_CHANNEL(xs), target, (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } @@ -4594,11 +4610,19 @@ isp_start(XS_T *xs) ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = lp->handle; t2e->req_scclun = XS_LUN(xs); +#if __FreeBSD_version < 1000700 + if (XS_LUN(xs) >= 256) + t2e->req_scclun |= 0x4000; +#endif cdbp = t2e->req_cdb; } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = lp->handle; t2->req_scclun = XS_LUN(xs); +#if __FreeBSD_version < 1000700 + if (XS_LUN(xs) >= 256) + t2->req_scclun |= 0x4000; +#endif cdbp = t2->req_cdb; } else { t2->req_target = lp->handle; @@ -5386,12 +5410,14 @@ again: continue; } if (req_status_flags & RQSTF_BUS_RESET) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d bus was reset", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%jx bus was reset", + XS_CHANNEL(xs), XS_TGT(xs), (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BUSRESET); ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); } if (buddaboom) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d buddaboom", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%jx buddaboom", + XS_CHANNEL(xs), XS_TGT(xs), (uintmax_t)XS_LUN(xs)); XS_SETERR(xs, HBA_BOTCH); } @@ -5535,7 +5561,11 @@ again: *XS_STSP(xs) = SCSI_QFULL; XS_SETERR(xs, HBA_NOERROR); } else if (XS_NOERR(xs)) { - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d badness at %s:%u", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), __func__, __LINE__); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx badness at %s:%u", + XS_CHANNEL(xs), XS_TGT(xs), + (uintmax_t)XS_LUN(xs), + __func__, __LINE__); XS_SETERR(xs, HBA_BOTCH); } XS_SET_RESID(xs, XS_XFRLEN(xs)); @@ -5947,7 +5977,11 @@ isp_parse_async_fc(ispsoftc_t *isp, uint continue; } j++; - isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d bus reset set at %s:%u", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), __func__, __LINE__); + isp_prt(isp, ISP_LOG_WARN1, + "%d.%d.%jx bus reset set at %s:%u", + XS_CHANNEL(xs), XS_TGT(xs), + (uintmax_t)XS_LUN(xs), + __func__, __LINE__); XS_SETERR(xs, HBA_BUSRESET); } if (j) { @@ -6426,7 +6460,9 @@ isp_parse_status(ispsoftc_t *isp, ispsta break; case RQCS_XACT_ERR2: - isp_xs_prt(isp, xs, ISP_LOGERR, "HBA attempted queued transaction to target routine %d", XS_LUN(xs)); + isp_xs_prt(isp, xs, ISP_LOGERR, + "HBA attempted queued transaction to target routine %jx", + (uintmax_t)XS_LUN(xs)); break; case RQCS_XACT_ERR3: Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:50:08 2015 (r290791) @@ -1153,7 +1153,7 @@ create_lun_state(ispsoftc_t *isp, int bu lun = xpt_path_lun_id(path); if (lun != CAM_LUN_WILDCARD) { - if (lun >= ISP_MAX_LUNS(isp)) { + if (ISP_MAX_LUNS(isp) > 0 && lun >= ISP_MAX_LUNS(isp)) { return (CAM_LUN_INVALID); } } @@ -1238,7 +1238,8 @@ isp_enable_lun(ispsoftc_t *isp, union cc bus = XS_CHANNEL(ccb); target = ccb->ccb_h.target_id; lun = ccb->ccb_h.target_lun; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "enabling lun %u\n", lun); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, + "enabling lun %jx\n", (uintmax_t)lun); if (target == CAM_TARGET_WILDCARD && lun != CAM_LUN_WILDCARD) { ccb->ccb_h.status = CAM_LUN_INVALID; xpt_done(ccb); @@ -1251,7 +1252,8 @@ isp_enable_lun(ispsoftc_t *isp, union cc return; } if (isp->isp_dblev & ISP_LOGTDEBUG0) { - xpt_print(ccb->ccb_h.path, "enabling lun 0x%x on channel %d\n", lun, bus); + xpt_print(ccb->ccb_h.path, + "enabling lun 0x%jx on channel %d\n", (uintmax_t)lun, bus); } /* @@ -1450,7 +1452,8 @@ isp_disable_lun(ispsoftc_t *isp, union c bus = XS_CHANNEL(ccb); target = ccb->ccb_h.target_id; lun = ccb->ccb_h.target_lun; - ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, "disabling lun %u\n", lun); + ISP_PATH_PRT(isp, ISP_LOGTDEBUG0|ISP_LOGCONFIG, ccb->ccb_h.path, + "disabling lun %jx\n", (uintmax_t)lun); if (target == CAM_TARGET_WILDCARD && lun != CAM_LUN_WILDCARD) { ccb->ccb_h.status = CAM_LUN_INVALID; xpt_done(ccb); @@ -2181,6 +2184,10 @@ isp_target_putback_atio(union ccb *ccb) at->at_header.rqs_entry_count = 1; if (ISP_CAP_SCCFW(isp)) { at->at_scclun = (uint16_t) ccb->ccb_h.target_lun; +#if __FreeBSD_version < 1000700 + if (at->at_scclun >= 256) + at->at_scclun |= 0x4000; +#endif } else { at->at_lun = (uint8_t) ccb->ccb_h.target_lun; } @@ -2366,6 +2373,9 @@ isp_handle_platform_atio2(ispsoftc_t *is if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; +#if __FreeBSD_version < 1000700 + lun &= 0x3fff; +#endif } else { lun = aep->at_lun; } @@ -2512,7 +2522,8 @@ static void isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t *aep) { int cdbxlen; - uint16_t lun, chan, nphdl = NIL_HANDLE; + lun_id_t lun; + uint16_t chan, nphdl = NIL_HANDLE; uint32_t did, sid; fcportdb_t *lp; tstate_t *tptr; @@ -2523,7 +2534,12 @@ isp_handle_platform_atio7(ispsoftc_t *is did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; - lun = (aep->at_cmnd.fcp_cmnd_lun[0] << 8) | aep->at_cmnd.fcp_cmnd_lun[1]; +#if __FreeBSD_version >= 1000700 + lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); +#else + lun = (aep->at_cmnd.fcp_cmnd_lun[0] & 0x3f << 8) | + aep->at_cmnd.fcp_cmnd_lun[1]; +#endif /* * Find the N-port handle, and Virtual Port Index for this command. @@ -2589,7 +2605,9 @@ isp_handle_platform_atio7(ispsoftc_t *is if (tptr == NULL) { tptr = get_lun_statep(isp, chan, CAM_LUN_WILDCARD); if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [0x%x] no state pointer for lun %d or wildcard", __func__, aep->at_rxid, lun); + isp_prt(isp, ISP_LOGWARN, + "%s: [0x%x] no state pointer for lun %jx or wildcard", + __func__, aep->at_rxid, (uintmax_t)lun); if (lun == 0) { isp_endcmd(isp, aep, nphdl, SCSI_STATUS_BUSY, 0); } else { @@ -2711,7 +2729,8 @@ isp_handle_platform_atio7(ispsoftc_t *is atp->cdb0 = atiop->cdb_io.cdb_bytes[0]; atp->tattr = aep->at_cmnd.fcp_cmnd_task_attribute & FCP_CMND_TASK_ATTR_MASK; atp->state = ATPD_STATE_CAM; - isp_prt(isp, ISP_LOGTDEBUG0, "ATIO7[0x%x] CDB=0x%x lun %d datalen %u", aep->at_rxid, atp->cdb0, lun, atp->orig_datalen); + isp_prt(isp, ISP_LOGTDEBUG0, "ATIO7[0x%x] CDB=0x%x lun %jx datalen %u", + aep->at_rxid, atp->cdb0, (uintmax_t)lun, atp->orig_datalen); xpt_done((union ccb *)atiop); rls_lun_statep(isp, tptr); return; @@ -2999,7 +3018,7 @@ isp_handle_platform_ctio(ispsoftc_t *isp resid = ct->ct_resid; moved_data = data_requested - resid; } - isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO[%x] seq %u nc %d tag %x S_ID 0x%x lun %d sts %x flg %x resid %d %s", __func__, ct->ct_fwhandle, ATPD_GET_SEQNO(ct), + isp_prt(isp, ISP_LOGTDEBUG0, "%s: CTIO[%x] seq %u nc %d tag %x S_ID 0x%x lun %x sts %x flg %x resid %d %s", __func__, ct->ct_fwhandle, ATPD_GET_SEQNO(ct), notify_cam, ct->ct_tag_val, ct->ct_iid, ct->ct_lun, ct->ct_status, ct->ct_flags, resid, sentstatus? "FIN" : "MID"); } if (ok) { @@ -3090,6 +3109,9 @@ isp_handle_platform_notify_fc(ispsoftc_t if (ISP_CAP_SCCFW(isp)) { lun = inp->in_scclun; +#if __FreeBSD_version < 1000700 + lun &= 0x3fff; +#endif } else { lun = inp->in_lun; } @@ -3849,8 +3871,9 @@ isp_ldt_task(void *arg, int pending) if (dbidx != XS_TGT(xs)) { continue; } - isp_prt(isp, ISP_LOGWARN, "command handle 0x%x for %d.%d.%d orphaned by loop down timeout", - isp->isp_xflist[i].handle, chan, XS_TGT(xs), XS_LUN(xs)); + isp_prt(isp, ISP_LOGWARN, "command handle 0x%x for %d.%d.%jx orphaned by loop down timeout", + isp->isp_xflist[i].handle, chan, XS_TGT(xs), + (uintmax_t)XS_LUN(xs)); } isp_prt(isp, ISP_LOGCONFIG, prom3, chan, dbidx, lp->portid, "Loop Down Timeout"); @@ -4034,10 +4057,11 @@ isp_action(struct cam_sim *sim, union cc } ccb->csio.req_map = NULL; #ifdef DIAGNOSTIC - if (ccb->ccb_h.target_id > (ISP_MAX_TARGETS(isp) - 1)) { + if (ccb->ccb_h.target_id >= ISP_MAX_TARGETS(isp)) { xpt_print(ccb->ccb_h.path, "invalid target\n"); ccb->ccb_h.status = CAM_PATH_INVALID; - } else if (ccb->ccb_h.target_lun > (ISP_MAX_LUNS(isp) - 1)) { + } else if (ISP_MAX_LUNS(isp) > 0 && + ccb->ccb_h.target_lun >= ISP_MAX_LUNS(isp)) { xpt_print(ccb->ccb_h.path, "invalid lun\n"); ccb->ccb_h.status = CAM_PATH_INVALID; } @@ -4080,15 +4104,23 @@ isp_action(struct cam_sim *sim, union cc lim = ISP_FC_PC(isp, bus)->loop_down_limit; if (FCPARAM(isp, bus)->loop_seen_once == 0 || ISP_FC_PC(isp, bus)->loop_down_time >= lim) { if (FCPARAM(isp, bus)->loop_seen_once == 0) { - isp_prt(isp, ISP_LOGDEBUG0, "%d.%d loop not seen yet @ %lu", XS_TGT(ccb), XS_LUN(ccb), (unsigned long) time_uptime); + isp_prt(isp, ISP_LOGDEBUG0, + "%d.%jx loop not seen yet @ %lu", + XS_TGT(ccb), (uintmax_t)XS_LUN(ccb), + (unsigned long) time_uptime); } else { - isp_prt(isp, ISP_LOGDEBUG0, "%d.%d downtime (%d) > lim (%d)", XS_TGT(ccb), XS_LUN(ccb), ISP_FC_PC(isp, bus)->loop_down_time, lim); + isp_prt(isp, ISP_LOGDEBUG0, + "%d.%jx downtime (%d) > lim (%d)", + XS_TGT(ccb), (uintmax_t)XS_LUN(ccb), + ISP_FC_PC(isp, bus)->loop_down_time, + lim); } ccb->ccb_h.status = CAM_SEL_TIMEOUT; isp_done((struct ccb_scsiio *) ccb); break; } - isp_prt(isp, ISP_LOGDEBUG0, "%d.%d retry later", XS_TGT(ccb), XS_LUN(ccb)); + isp_prt(isp, ISP_LOGDEBUG0, "%d.%jx retry later", + XS_TGT(ccb), (uintmax_t)XS_LUN(ccb)); cam_freeze_devq(ccb->ccb_h.path); cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 1000, 0); ccb->ccb_h.status = CAM_REQUEUE_REQ; @@ -4591,7 +4623,8 @@ isp_action(struct cam_sim *sim, union cc #endif cpi->hba_eng_cnt = 0; cpi->max_target = ISP_MAX_TARGETS(isp) - 1; - cpi->max_lun = ISP_MAX_LUNS(isp) - 1; + cpi->max_lun = ISP_MAX_LUNS(isp) == 0 ? + 255 : ISP_MAX_LUNS(isp) - 1; cpi->bus_id = cam_sim_bus(sim); if (isp->isp_osinfo.sixtyfourbit) cpi->maxio = (ISP_NSEG64_MAX - 1) * PAGE_SIZE; @@ -4603,6 +4636,9 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; +#if __FreeBSD_version >= 1000700 + cpi->hba_misc |= PIM_EXTLUNS; +#endif #if __FreeBSD_version >= 1000039 cpi->hba_misc |= PIM_NOSCAN; #endif @@ -4682,7 +4718,10 @@ isp_done(XS_T *sccb) status = sccb->ccb_h.status & CAM_STATUS_MASK; if (status != CAM_REQ_CMP) { if (status != CAM_SEL_TIMEOUT) - isp_prt(isp, ISP_LOGDEBUG0, "target %d lun %d CAM status 0x%x SCSI status 0x%x", XS_TGT(sccb), XS_LUN(sccb), sccb->ccb_h.status, sccb->scsi_status); + isp_prt(isp, ISP_LOGDEBUG0, + "target %d lun %jx CAM status 0x%x SCSI status 0x%x", + XS_TGT(sccb), (uintmax_t)XS_LUN(sccb), + sccb->ccb_h.status, sccb->scsi_status); else if ((IS_FC(isp)) && (XS_TGT(sccb) < MAX_FC_TARG)) { fcparam *fcp; @@ -5485,7 +5524,8 @@ isp_fcp_reset_crn(struct isp_fc *fc, uin int isp_fcp_next_crn(ispsoftc_t *isp, uint8_t *crnp, XS_T *cmd) { - uint32_t chan, tgt, lun; + lun_id_t lun; + uint32_t chan, tgt; struct isp_fc *fc; struct isp_nexus *nxp; int idx; Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp_freebsd.h Fri Nov 13 19:50:08 2015 (r290791) @@ -207,12 +207,10 @@ struct isp_pcmd { * Per nexus info. */ struct isp_nexus { - struct isp_nexus * next; - uint32_t - crnseed : 8; /* next command reference number */ - uint32_t - tgt : 16, /* TGT for target */ - lun : 16; /* LUN for target */ + uint64_t lun; /* LUN for target */ + uint32_t tgt; /* TGT for target */ + uint8_t crnseed; /* next command reference number */ + struct isp_nexus *next; }; #define NEXUS_HASH_WIDTH 32 #define INITIAL_NEXUS_COUNT MAX_FC_TARG Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:48:41 2015 (r290790) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:50:08 2015 (r290791) @@ -953,6 +953,9 @@ isp_got_msg_fc(ispsoftc_t *isp, in_fcent /* nt_tgt set in outer layers */ if (ISP_CAP_SCCFW(isp)) { notify.nt_lun = inp->in_scclun; +#if __FreeBSD_version < 1000700 + notify.nt_lun &= 0x3fff; +#endif } else { notify.nt_lun = inp->in_lun; } @@ -1330,6 +1333,9 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en if (ISP_CAP_SCCFW(isp)) { lun = aep->at_scclun; +#if __FreeBSD_version < 1000700 + lun &= 0x3fff; +#endif } else { lun = aep->at_lun; } @@ -1357,7 +1363,7 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en /* * ATIO rejected by the firmware due to disabled lun. */ - isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for disabled lun %d", lun); + isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for disabled lun %x", lun); break; case AT_NOCAP: /* @@ -1365,7 +1371,7 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en * We sent an ATIO that overflowed the firmware's * command resource count. */ - isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for lun %d- command count overflow", lun); + isp_prt(isp, ISP_LOGERR, "rejected ATIO2 for lun %x- command count overflow", lun); break; case AT_BDR_MSG: @@ -1402,7 +1408,7 @@ isp_handle_atio2(ispsoftc_t *isp, at2_en default: - isp_prt(isp, ISP_LOGERR, "Unknown ATIO2 status 0x%x from loopid %d for lun %d", aep->at_status, iid, lun); + isp_prt(isp, ISP_LOGERR, "Unknown ATIO2 status 0x%x from loopid %d for lun %x", aep->at_status, iid, lun); (void) isp_target_put_atio(isp, aep); break; } From owner-svn-src-stable@freebsd.org Fri Nov 13 19:50:56 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F084FA2EADF; Fri, 13 Nov 2015 19:50:56 +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 9E3B21A2D; Fri, 13 Nov 2015 19:50:56 +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 tADJotXr096657; Fri, 13 Nov 2015 19:50:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJotU8096655; Fri, 13 Nov 2015 19:50:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131950.tADJotU8096655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290792 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:50:57 -0000 Author: mav Date: Fri Nov 13 19:50:55 2015 New Revision: 290792 URL: https://svnweb.freebsd.org/changeset/base/290792 Log: MFC r289886: Add new field to Abort IOCB. Modified: stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:50:08 2015 (r290791) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:50:55 2015 (r290792) @@ -1071,6 +1071,7 @@ isp_put_24xx_abrt(ispsoftc_t *isp, isp24 ISP_IOXPUT_16(isp, src->abrt_nphdl, &dst->abrt_nphdl); ISP_IOXPUT_16(isp, src->abrt_options, &dst->abrt_options); ISP_IOXPUT_32(isp, src->abrt_cmd_handle, &dst->abrt_cmd_handle); + ISP_IOXPUT_16(isp, src->abrt_queue_number, &dst->abrt_queue_number); for (i = 0; i < ASIZE(src->abrt_reserved); i++) { ISP_IOXPUT_8(isp, src->abrt_reserved[i], &dst->abrt_reserved[i]); } @@ -1179,6 +1180,7 @@ isp_get_24xx_abrt(ispsoftc_t *isp, isp24 ISP_IOXGET_16(isp, &src->abrt_nphdl, dst->abrt_nphdl); ISP_IOXGET_16(isp, &src->abrt_options, dst->abrt_options); ISP_IOXGET_32(isp, &src->abrt_cmd_handle, dst->abrt_cmd_handle); + ISP_IOXGET_16(isp, &src->abrt_queue_number, dst->abrt_queue_number); for (i = 0; i < ASIZE(src->abrt_reserved); i++) { ISP_IOXGET_8(isp, &src->abrt_reserved[i], dst->abrt_reserved[i]); } Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:50:08 2015 (r290791) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:50:55 2015 (r290792) @@ -574,7 +574,8 @@ typedef struct { uint16_t abrt_nphdl; uint16_t abrt_options; uint32_t abrt_cmd_handle; - uint8_t abrt_reserved[32]; + uint16_t abrt_queue_number; + uint8_t abrt_reserved[30]; uint16_t abrt_tidlo; uint8_t abrt_tidhi; uint8_t abrt_vpidx; From owner-svn-src-stable@freebsd.org Fri Nov 13 19:51:56 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D3CDA2EB4B; Fri, 13 Nov 2015 19:51:56 +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 676211CE2; Fri, 13 Nov 2015 19:51:56 +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 tADJptJS098678; Fri, 13 Nov 2015 19:51:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJptEa098676; Fri, 13 Nov 2015 19:51:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131951.tADJptEa098676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290793 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:51:56 -0000 Author: mav Date: Fri Nov 13 19:51:55 2015 New Revision: 290793 URL: https://svnweb.freebsd.org/changeset/base/290793 Log: MFC r289890: Skip reserved IP Broadcast handle from using. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:50:55 2015 (r290792) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:51:55 2015 (r290793) @@ -3164,7 +3164,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) continue; } if (ISP_CAP_2KLOGIN(isp)) { - if (handle >= NPH_RESERVED && handle <= NPH_FL_ID) { + if (handle >= NPH_RESERVED && handle <= NPH_IP_BCST) { continue; } } @@ -4301,8 +4301,8 @@ isp_nxt_handle(ispsoftc_t *isp, int chan if (handle >= FL_ID && handle <= SNS_ID) { handle = SNS_ID+1; } - if (handle >= NPH_RESERVED && handle <= NPH_FL_ID) { - handle = NPH_FL_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) { Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:50:55 2015 (r290792) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:51:55 2015 (r290793) @@ -253,7 +253,7 @@ typedef struct { #define NPH_SNS_ID 0x7FC /* SNS Server Special ID */ #define NPH_FABRIC_CTLR 0x7FD /* Fabric Controller (0xFFFFFD) */ #define NPH_FL_ID 0x7FE /* F Port Special ID (0xFFFFFE) */ -#define NPH_IP_BCST 0x7ff /* IP Broadcast Special ID (0xFFFFFF) */ +#define NPH_IP_BCST 0x7FF /* IP Broadcast Special ID (0xFFFFFF) */ #define NPH_MAX_2K 0x800 /* From owner-svn-src-stable@freebsd.org Fri Nov 13 19:53:32 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A2CA2EC75; Fri, 13 Nov 2015 19:53: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 87DEF1E95; Fri, 13 Nov 2015 19:53: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 tADJrVbl098790; Fri, 13 Nov 2015 19:53:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJrVpY098786; Fri, 13 Nov 2015 19:53:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131953.tADJrVpY098786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290794 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:53:32 -0000 Author: mav Date: Fri Nov 13 19:53:31 2015 New Revision: 290794 URL: https://svnweb.freebsd.org/changeset/base/290794 Log: MFC r289930: Formalize/unify chip (re-)inits. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:53:31 2015 (r290794) @@ -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: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:53:31 2015 (r290794) @@ -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: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp_pci.c Fri Nov 13 19:53:31 2015 (r290794) @@ -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: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:51:55 2015 (r290793) +++ stable/10/sys/dev/isp/isp_sbus.c Fri Nov 13 19:53:31 2015 (r290794) @@ -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-stable@freebsd.org Fri Nov 13 19:54:59 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A142A2ECE1; Fri, 13 Nov 2015 19:54:59 +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 5B8E01023; Fri, 13 Nov 2015 19:54:59 +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 tADJswTa098889; Fri, 13 Nov 2015 19:54:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJsw6u098887; Fri, 13 Nov 2015 19:54:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131954.tADJsw6u098887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290795 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:54:59 -0000 Author: mav Date: Fri Nov 13 19:54:58 2015 New Revision: 290795 URL: https://svnweb.freebsd.org/changeset/base/290795 Log: MFC r289933, r289939: Improve Port Database Changed handling and reporting. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:53:31 2015 (r290794) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:54:58 2015 (r290795) @@ -6074,21 +6074,21 @@ 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; + GET_24XX_BUS(isp, chan, "ASYNC_CHANGE_NOTIFY"); + echan = (nphdl == NIL_HANDLE) ? + isp->isp_nchan - 1 : chan; } 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: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:53:31 2015 (r290794) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Nov 13 19:54:58 2015 (r290795) @@ -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-stable@freebsd.org Fri Nov 13 19:56:00 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BD6A2ED4C; Fri, 13 Nov 2015 19:56:00 +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 5DAE311DB; Fri, 13 Nov 2015 19:56: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 tADJtxik098996; Fri, 13 Nov 2015 19:55:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJtxot098994; Fri, 13 Nov 2015 19:55:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131955.tADJtxot098994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290796 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:56:00 -0000 Author: mav Date: Fri Nov 13 19:55:59 2015 New Revision: 290796 URL: https://svnweb.freebsd.org/changeset/base/290796 Log: MFC r289937: Try to keep Loop IDs persistent across chip reinits. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:54:58 2015 (r290795) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:55:59 2015 (r290796) @@ -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: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:54:58 2015 (r290795) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:55:59 2015 (r290796) @@ -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-stable@freebsd.org Fri Nov 13 19:57:14 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0132AA2EDAD; Fri, 13 Nov 2015 19:57: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 BFB231324; Fri, 13 Nov 2015 19:57: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 tADJvCFp099092; Fri, 13 Nov 2015 19:57:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJvCfU099091; Fri, 13 Nov 2015 19:57:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131957.tADJvCfU099091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290797 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:57:14 -0000 Author: mav Date: Fri Nov 13 19:57:12 2015 New Revision: 290797 URL: https://svnweb.freebsd.org/changeset/base/290797 Log: MFC r289942: Deliver INOTs only to enabled virtual ports. Modified: stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:55:59 2015 (r290796) +++ stable/10/sys/dev/isp/isp_target.c Fri Nov 13 19:57:12 2015 (r290797) @@ -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-stable@freebsd.org Fri Nov 13 19:58:00 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86B61A2EDFE; Fri, 13 Nov 2015 19:58:00 +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 5F6E114CC; Fri, 13 Nov 2015 19:58: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 tADJvxXr099170; Fri, 13 Nov 2015 19:57:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJvxZQ099167; Fri, 13 Nov 2015 19:57:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131957.tADJvxZQ099167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290798 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:58:00 -0000 Author: mav Date: Fri Nov 13 19:57:59 2015 New Revision: 290798 URL: https://svnweb.freebsd.org/changeset/base/290798 Log: MFC r290018: 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: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_library.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:57:12 2015 (r290797) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:57:59 2015 (r290798) @@ -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: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:57:12 2015 (r290797) +++ stable/10/sys/dev/isp/isp_library.c Fri Nov 13 19:57:59 2015 (r290798) @@ -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: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:57:12 2015 (r290797) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:57:59 2015 (r290798) @@ -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-stable@freebsd.org Fri Nov 13 19:58:44 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B689A2EE82; Fri, 13 Nov 2015 19:58:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5D771796; Fri, 13 Nov 2015 19:58:43 +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 tADJwgfh099252; Fri, 13 Nov 2015 19:58:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJwg1S099251; Fri, 13 Nov 2015 19:58:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131958.tADJwg1S099251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290799 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:58:44 -0000 Author: mav Date: Fri Nov 13 19:58:42 2015 New Revision: 290799 URL: https://svnweb.freebsd.org/changeset/base/290799 Log: MFC r290042: Fix error code that looks like wrong. Modified: stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:57:59 2015 (r290798) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:58:42 2015 (r290799) @@ -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-stable@freebsd.org Fri Nov 13 19:59:24 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43512A2EED7; Fri, 13 Nov 2015 19:59:24 +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 014491902; Fri, 13 Nov 2015 19:59:23 +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 tADJxNk2099331; Fri, 13 Nov 2015 19:59:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJxMLJ099329; Fri, 13 Nov 2015 19:59:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131959.tADJxMLJ099329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290800 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:59:24 -0000 Author: mav Date: Fri Nov 13 19:59:22 2015 New Revision: 290800 URL: https://svnweb.freebsd.org/changeset/base/290800 Log: MFC r290054: 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: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:58:42 2015 (r290799) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:59:22 2015 (r290800) @@ -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: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:58:42 2015 (r290799) +++ stable/10/sys/dev/isp/ispvar.h Fri Nov 13 19:59:22 2015 (r290800) @@ -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-stable@freebsd.org Fri Nov 13 22:33:53 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44729A2EEF2; Fri, 13 Nov 2015 22:33:53 +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 0B8141157; Fri, 13 Nov 2015 22:33:52 +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 tADMXpT4049376; Fri, 13 Nov 2015 22:33:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMXp4M049375; Fri, 13 Nov 2015 22:33:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511132233.tADMXp4M049375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 22:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290804 - in stable: 10/usr.sbin/pciconf 9/usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:33:53 -0000 Author: jhb Date: Fri Nov 13 22:33:51 2015 New Revision: 290804 URL: https://svnweb.freebsd.org/changeset/base/290804 Log: MFC 290412: Note if relaxed ordering or no snoop is enabled for each PCI-express device. Modified: stable/10/usr.sbin/pciconf/cap.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/10/usr.sbin/pciconf/cap.c ============================================================================== --- stable/10/usr.sbin/pciconf/cap.c Fri Nov 13 22:27:24 2015 (r290803) +++ stable/10/usr.sbin/pciconf/cap.c Fri Nov 13 22:33:51 2015 (r290804) @@ -459,6 +459,10 @@ cap_express(int fd, struct pci_conf *p, MAX_PAYLOAD(cap & PCIEM_CAP_MAX_PAYLOAD)); if ((cap & PCIEM_CAP_FLR) != 0) printf(" FLR"); + if (ctl & PCIEM_CTL_RELAXED_ORD_ENABLE) + printf(" RO"); + if (ctl & PCIEM_CTL_NOSNOOP_ENABLE) + printf(" NS"); cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4, From owner-svn-src-stable@freebsd.org Fri Nov 13 22:33:53 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B75CA2EEF3; Fri, 13 Nov 2015 22:33:53 +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 27A011158; Fri, 13 Nov 2015 22:33:53 +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 tADMXqL6049382; Fri, 13 Nov 2015 22:33:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADMXqSL049381; Fri, 13 Nov 2015 22:33:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511132233.tADMXqSL049381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Nov 2015 22:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290804 - in stable: 10/usr.sbin/pciconf 9/usr.sbin/pciconf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 22:33:53 -0000 Author: jhb Date: Fri Nov 13 22:33:51 2015 New Revision: 290804 URL: https://svnweb.freebsd.org/changeset/base/290804 Log: MFC 290412: Note if relaxed ordering or no snoop is enabled for each PCI-express device. Modified: stable/9/usr.sbin/pciconf/cap.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/pciconf/cap.c Directory Properties: stable/10/ (props changed) Modified: stable/9/usr.sbin/pciconf/cap.c ============================================================================== --- stable/9/usr.sbin/pciconf/cap.c Fri Nov 13 22:27:24 2015 (r290803) +++ stable/9/usr.sbin/pciconf/cap.c Fri Nov 13 22:33:51 2015 (r290804) @@ -458,6 +458,10 @@ cap_express(int fd, struct pci_conf *p, MAX_PAYLOAD(cap & PCIEM_CAP_MAX_PAYLOAD)); if ((cap & PCIEM_CAP_FLR) != 0) printf(" FLR"); + if (ctl & PCIEM_CTL_RELAXED_ORD_ENABLE) + printf(" RO"); + if (ctl & PCIEM_CTL_NOSNOOP_ENABLE) + printf(" NS"); cap = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); sta = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_STA, 2); printf(" link x%d(x%d)", (sta & PCIEM_LINK_STA_WIDTH) >> 4, From owner-svn-src-stable@freebsd.org Sat Nov 14 00:04:43 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB8AA2E7EB; Sat, 14 Nov 2015 00:04:43 +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 3CE37123F; Sat, 14 Nov 2015 00:04:43 +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 tAE04gBT078653; Sat, 14 Nov 2015 00:04:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE04gJu078651; Sat, 14 Nov 2015 00:04:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140004.tAE04gJu078651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 00:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290808 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 00:04:43 -0000 Author: jhb Date: Sat Nov 14 00:04:42 2015 New Revision: 290808 URL: https://svnweb.freebsd.org/changeset/base/290808 Log: MFC 232472 (partial): Cache the starting location of the PCI-express capability for PCI-express devices in PCI device ivars. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Fri Nov 13 23:47:41 2015 (r290807) +++ stable/9/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) @@ -798,6 +798,9 @@ pci_read_cap(device_t pcib, pcicfgregs * * at least one PCI-express device. */ pcie_chipset = 1; + cfg->pcie.pcie_location = ptr; + val = REG(ptr + PCIR_EXPRESS_FLAGS, 2); + cfg->pcie.pcie_type = val & PCIM_EXP_FLAGS_TYPE; break; default: break; @@ -1776,10 +1779,12 @@ pci_ht_map_msi(device_t dev, uint64_t ad int pci_get_max_read_req(device_t dev) { + struct pci_devinfo *dinfo = device_get_ivars(dev); int cap; uint16_t val; - if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) return (0); val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); val &= PCIEM_CTL_MAX_READ_REQUEST; @@ -1790,10 +1795,12 @@ pci_get_max_read_req(device_t dev) int pci_set_max_read_req(device_t dev, int size) { + struct pci_devinfo *dinfo = device_get_ivars(dev); int cap; uint16_t val; - if (pci_find_cap(dev, PCIY_EXPRESS, &cap) != 0) + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) return (0); if (size < 128) size = 128; Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Fri Nov 13 23:47:41 2015 (r290807) +++ stable/9/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) @@ -124,6 +124,12 @@ struct pcicfg_ht { uint64_t ht_msiaddr; /* MSI mapping base address */ }; +/* Interesting values for PCI-express */ +struct pcicfg_pcie { + uint8_t pcie_location; /* Offset of PCI-e capability registers. */ + uint8_t pcie_type; /* Device type. */ +}; + /* config header information common to all header types */ typedef struct pcicfg { struct device *dev; /* device which owns this */ @@ -165,6 +171,7 @@ typedef struct pcicfg { struct pcicfg_msi msi; /* PCI MSI */ struct pcicfg_msix msix; /* PCI MSI-X */ struct pcicfg_ht ht; /* HyperTransport */ + struct pcicfg_pcie pcie; /* PCI Express */ } pcicfgregs; /* additional type 1 device config header information (PCI to PCI bridge) */ From owner-svn-src-stable@freebsd.org Sat Nov 14 01:06:47 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B79A2F2C8; Sat, 14 Nov 2015 01:06:47 +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 0C8721B6F; Sat, 14 Nov 2015 01:06:46 +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 tAE16kil097972; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE16j5Q097967; Sat, 14 Nov 2015 01:06:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140106.tAE16j5Q097967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 01:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:06:47 -0000 Author: jhb Date: Sat Nov 14 01:06:45 2015 New Revision: 290809 URL: https://svnweb.freebsd.org/changeset/base/290809 Log: MFC 290414,290415: Additional PCI helper functions. 290414: Add helper routines for PCI device drivers to read, write, and modify PCI-Express capability registers (that is, PCI config registers in the standard PCI config space belonging to the PCI-Express capability register set). Note that all of the current PCI-e registers are either 16 or 32-bits, so only widths of 2 or 4 bytes are supported. 290415: Add a new helper function for PCI devices to locate the upstream PCI-express root port of a given PCI device. Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) @@ -1014,6 +1014,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_device.9 \ pci.9 pci_find_extcap.9 \ pci.9 pci_find_htcap.9 \ + pci.9 pci_find_pcie_root_port.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ @@ -1028,7 +1029,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_set_max_read_req.9 \ - pci.9 pci_write_config.9 + pci.9 pci_write_config.9 \ + pci.9 pcie_adjust_config.9 \ + pci.9 pcie_read_config.9 \ + pci.9 pcie_write_config.9 \ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 5, 2015 .Dt PCI 9 .Os .Sh NAME @@ -42,6 +42,7 @@ .Nm pci_find_device , .Nm pci_find_extcap , .Nm pci_find_htcap , +.Nm pci_find_pcie_root_port , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -56,7 +57,10 @@ .Nm pci_save_state , .Nm pci_set_max_read_req , .Nm pci_set_powerstate , -.Nm pci_write_config +.Nm pci_write_config , +.Nm pcie_adjust_config , +.Nm pcie_read_config , +.Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h @@ -86,6 +90,8 @@ .Fn pci_find_extcap "device_t dev" "int capability" "int *capreg" .Ft int .Fn pci_find_htcap "device_t dev" "int capability" "int *capreg" +.Ft device_t +.Fn pci_find_pcie_root_port "device_t dev" .Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int @@ -116,6 +122,18 @@ .Fn pci_set_powerstate "device_t dev" "int state" .Ft void .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.Ft uint32_t +.Fo pcie_adjust_config +.Fa "device_t dev" +.Fa "int reg" +.Fa "uint32_t mask" +.Fa "uint32_t val" +.Fa "int width" +.Fc +.Ft uint32_t +.Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm @@ -152,6 +170,48 @@ with .Fa width specifying the size of the access. .Pp +The +.Fn pcie_adjust_config +function is used to modify the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +The new value of the register is computed by modifying bits set in +.Fa mask +to the value in +.Fa val . +Any bits not specified in +.Fa mask +are preserved. +The previous value of the register is returned. +.Pp +The +.Fn pcie_read_config +function is used to read the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp +The +.Fn pcie_write_config +function is used to write the value +.Fa val +to a register in the PCI-express capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp .Em NOTE : Device drivers should only use these functions for functionality that is not available via another @@ -274,6 +334,16 @@ If the capability is not found or the de returns an error. .Pp The +.Fn pci_find_pcie_root_port +function walks up the PCI device hierarchy to locate the PCI-express root +port upstream of +.Fa dev . +If a root port is not found, +.Fn pci_find_pcie_root_port +returns +.Dv NULL . +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) @@ -1895,6 +1895,63 @@ pci_set_max_read_req(device_t dev, int s return (size); } +uint32_t +pcie_read_config(device_t dev, int reg, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + return (pci_read_config(dev, cap + reg, width)); +} + +void +pcie_write_config(device_t dev, int reg, uint32_t value, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return; + pci_write_config(dev, cap + reg, value, width); +} + +/* + * Adjusts a PCI-e capability register by clearing the bits in mask + * and setting the bits in (value & mask). Bits not set in mask are + * not adjusted. + * + * Returns the old value on success or all ones on failure. + */ +uint32_t +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, + int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint32_t old, new; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + old = pci_read_config(dev, cap + reg, width); + new = old & ~mask; + new |= (value & mask); + pci_write_config(dev, cap + reg, new, width); + return (old); +} + /* * Support for MSI message signalled interrupts. */ @@ -5139,3 +5196,44 @@ pci_get_rid_method(device_t dev, device_ return (PCIB_GET_RID(device_get_parent(dev), child)); } + +/* Find the upstream port of a given PCI device in a root complex. */ +device_t +pci_find_pcie_root_port(device_t dev) +{ + struct pci_devinfo *dinfo; + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* + * Walk the bridge hierarchy until we find a PCI-e root + * port or a non-PCI device. + */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* + * pcib's parent must be a PCI bus for this to be a + * PCI-PCI bridge. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (NULL); + + dinfo = device_get_ivars(pcib); + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) + return (pcib); + + dev = pcib; + } +} Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) +++ stable/10/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) @@ -501,10 +501,15 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); +device_t pci_find_pcie_root_port(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); +uint32_t pcie_read_config(device_t dev, int reg, int width); +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, + uint32_t value, int width); #ifdef BUS_SPACE_MAXADDR From owner-svn-src-stable@freebsd.org Sat Nov 14 01:06:47 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9161A2F2CC; Sat, 14 Nov 2015 01:06:47 +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 82F641B71; Sat, 14 Nov 2015 01:06: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 tAE16k3r097983; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAE16koW097979; Sat, 14 Nov 2015 01:06:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511140106.tAE16koW097979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 Nov 2015 01:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 01:06:47 -0000 Author: jhb Date: Sat Nov 14 01:06:45 2015 New Revision: 290809 URL: https://svnweb.freebsd.org/changeset/base/290809 Log: MFC 290414,290415: Additional PCI helper functions. 290414: Add helper routines for PCI device drivers to read, write, and modify PCI-Express capability registers (that is, PCI config registers in the standard PCI config space belonging to the PCI-Express capability register set). Note that all of the current PCI-e registers are either 16 or 32-bits, so only widths of 2 or 4 bytes are supported. 290415: Add a new helper function for PCI devices to locate the upstream PCI-express root port of a given PCI device. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) @@ -978,6 +978,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_cap.9 \ pci.9 pci_find_dbsf.9 \ pci.9 pci_find_device.9 \ + pci.9 pci_find_pcie_root_port.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ @@ -992,7 +993,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_save_state.9 \ pci.9 pci_set_powerstate.9 \ pci.9 pci_set_max_read_req.9 \ - pci.9 pci_write_config.9 + pci.9 pci_write_config.9 \ + pci.9 pcie_adjust_config.9 \ + pci.9 pcie_read_config.9 \ + pci.9 pcie_write_config.9 \ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 5, 2015 .Dt PCI 9 .Os .Sh NAME @@ -40,6 +40,7 @@ .Nm pci_find_cap , .Nm pci_find_dbsf , .Nm pci_find_device , +.Nm pci_find_pcie_root_port , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -54,7 +55,10 @@ .Nm pci_save_state , .Nm pci_set_max_read_req , .Nm pci_set_powerstate , -.Nm pci_write_config +.Nm pci_write_config , +.Nm pcie_adjust_config , +.Nm pcie_read_config , +.Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS .In sys/bus.h @@ -80,6 +84,8 @@ .Fn pci_find_dbsf "uint32_t domain" "uint8_t bus" "uint8_t slot" "uint8_t func" .Ft device_t .Fn pci_find_device "uint16_t vendor" "uint16_t device" +.Ft device_t +.Fn pci_find_pcie_root_port "device_t dev" .Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int @@ -110,6 +116,18 @@ .Fn pci_set_powerstate "device_t dev" "int state" .Ft void .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.Ft uint32_t +.Fo pcie_adjust_config +.Fa "device_t dev" +.Fa "int reg" +.Fa "uint32_t mask" +.Fa "uint32_t val" +.Fa "int width" +.Fc +.Ft uint32_t +.Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft void +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION The .Nm @@ -146,6 +164,48 @@ with .Fa width specifying the size of the access. .Pp +The +.Fn pcie_adjust_config +function is used to modify the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +The new value of the register is computed by modifying bits set in +.Fa mask +to the value in +.Fa val . +Any bits not specified in +.Fa mask +are preserved. +The previous value of the register is returned. +.Pp +The +.Fn pcie_read_config +function is used to read the value of a register in the PCI-express +capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp +The +.Fn pcie_write_config +function is used to write the value +.Fa val +to a register in the PCI-express capability register set of device +.Fa dev . +The offset +.Fa reg +specifies a relative offset in the register set with +.Fa width +specifying the size of the access. +.Pp .Em NOTE : Device drivers should only use these functions for functionality that is not available via another @@ -225,6 +285,16 @@ If the capability is not found or the de returns an error. .Pp The +.Fn pci_find_pcie_root_port +function walks up the PCI device hierarchy to locate the PCI-express root +port upstream of +.Fa dev . +If a root port is not found, +.Fn pci_find_pcie_root_port +returns +.Dv NULL . +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) @@ -1814,6 +1814,63 @@ pci_set_max_read_req(device_t dev, int s return (size); } +uint32_t +pcie_read_config(device_t dev, int reg, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + return (pci_read_config(dev, cap + reg, width)); +} + +void +pcie_write_config(device_t dev, int reg, uint32_t value, int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return; + pci_write_config(dev, cap + reg, value, width); +} + +/* + * Adjusts a PCI-e capability register by clearing the bits in mask + * and setting the bits in (value & mask). Bits not set in mask are + * not adjusted. + * + * Returns the old value on success or all ones on failure. + */ +uint32_t +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, + int width) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint32_t old, new; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) { + if (width == 2) + return (0xffff); + return (0xffffffff); + } + + old = pci_read_config(dev, cap + reg, width); + new = old & ~mask; + new |= (value & mask); + pci_write_config(dev, cap + reg, new, width); + return (old); +} + /* * Support for MSI message signalled interrupts. */ @@ -4686,3 +4743,44 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } + +/* Find the upstream port of a given PCI device in a root complex. */ +device_t +pci_find_pcie_root_port(device_t dev) +{ + struct pci_devinfo *dinfo; + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* + * Walk the bridge hierarchy until we find a PCI-e root + * port or a non-PCI device. + */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* + * pcib's parent must be a PCI bus for this to be a + * PCI-PCI bridge. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (NULL); + + dinfo = device_get_ivars(pcib); + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) + return (pcib); + + dev = pcib; + } +} Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) +++ stable/9/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) @@ -475,10 +475,15 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); +device_t pci_find_pcie_root_port(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); +uint32_t pcie_read_config(device_t dev, int reg, int width); +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, + uint32_t value, int width); #endif /* _SYS_BUS_H_ */ From owner-svn-src-stable@freebsd.org Sat Nov 14 08:31:42 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32475A2F4E6; Sat, 14 Nov 2015 08:31:42 +0000 (UTC) (envelope-from mmel@freebsd.org) Received: from mail.miracle.cz (mail.miracle.cz [193.84.128.19]) by mx1.freebsd.org (Postfix) with ESMTP id DFD561AC3; Sat, 14 Nov 2015 08:31:41 +0000 (UTC) (envelope-from mmel@freebsd.org) Received: from [193.84.128.50] (meloun.ad.miracle.cz [193.84.128.50]) by mail.miracle.cz (Postfix) with ESMTPSA id 7938BACAD34; Sat, 14 Nov 2015 09:25:28 +0100 (CET) Subject: Re: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201511140106.tAE16j5Q097967@repo.freebsd.org> From: Michal Meloun Organization: freebsd.org Message-ID: <5646EFF8.1080207@freebsd.org> Date: Sat, 14 Nov 2015 09:25:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <201511140106.tAE16j5Q097967@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.miracle.cz); Sat, 14 Nov 2015 09:25:28 +0100 (CET) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 08:31:42 -0000 This commit breaks installworld. Index: share/man/man9/Makefile =================================================================== --- share/man/man9/Makefile (revision 290818) +++ share/man/man9/Makefile (working copy) @@ -1032,7 +1032,7 @@ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 Dne 14.11.2015 v 2:06 John Baldwin napsal(a): > Author: jhb > Date: Sat Nov 14 01:06:45 2015 > New Revision: 290809 > URL: https://svnweb.freebsd.org/changeset/base/290809 > > Log: > MFC 290414,290415: > Additional PCI helper functions. > > 290414: > Add helper routines for PCI device drivers to read, write, and modify > PCI-Express capability registers (that is, PCI config registers in the > standard PCI config space belonging to the PCI-Express capability > register set). > > Note that all of the current PCI-e registers are either 16 or 32-bits, > so only widths of 2 or 4 bytes are supported. > > 290415: > Add a new helper function for PCI devices to locate the upstream > PCI-express root port of a given PCI device. > > Modified: > stable/10/share/man/man9/Makefile > stable/10/share/man/man9/pci.9 > stable/10/sys/dev/pci/pci.c > stable/10/sys/dev/pci/pcivar.h > Directory Properties: > stable/10/ (props changed) > > Changes in other areas also in this revision: > Modified: > stable/9/share/man/man9/Makefile > stable/9/share/man/man9/pci.9 > stable/9/sys/dev/pci/pci.c > stable/9/sys/dev/pci/pcivar.h > Directory Properties: > stable/9/share/man/man9/ (props changed) > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) > > Modified: stable/10/share/man/man9/Makefile > ============================================================================== > --- stable/10/share/man/man9/Makefile Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/share/man/man9/Makefile Sat Nov 14 01:06:45 2015 (r290809) > @@ -1014,6 +1014,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ > pci.9 pci_find_device.9 \ > pci.9 pci_find_extcap.9 \ > pci.9 pci_find_htcap.9 \ > + pci.9 pci_find_pcie_root_port.9 \ > pci.9 pci_get_max_read_req.9 \ > pci.9 pci_get_powerstate.9 \ > pci.9 pci_get_vpd_ident.9 \ > @@ -1028,7 +1029,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ > pci.9 pci_save_state.9 \ > pci.9 pci_set_powerstate.9 \ > pci.9 pci_set_max_read_req.9 \ > - pci.9 pci_write_config.9 > + pci.9 pci_write_config.9 \ > + pci.9 pcie_adjust_config.9 \ > + pci.9 pcie_read_config.9 \ > + pci.9 pcie_write_config.9 \ > MLINKS+=pfil.9 pfil_add_hook.9 \ > pfil.9 pfil_hook_get.9 \ > pfil.9 pfil_remove_hook.9 > > Modified: stable/10/share/man/man9/pci.9 > ============================================================================== > --- stable/10/share/man/man9/pci.9 Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/share/man/man9/pci.9 Sat Nov 14 01:06:45 2015 (r290809) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 5, 2012 > +.Dd November 5, 2015 > .Dt PCI 9 > .Os > .Sh NAME > @@ -42,6 +42,7 @@ > .Nm pci_find_device , > .Nm pci_find_extcap , > .Nm pci_find_htcap , > +.Nm pci_find_pcie_root_port , > .Nm pci_get_max_read_req , > .Nm pci_get_powerstate , > .Nm pci_get_vpd_ident , > @@ -56,7 +57,10 @@ > .Nm pci_save_state , > .Nm pci_set_max_read_req , > .Nm pci_set_powerstate , > -.Nm pci_write_config > +.Nm pci_write_config , > +.Nm pcie_adjust_config , > +.Nm pcie_read_config , > +.Nm pcie_write_config > .Nd PCI bus interface > .Sh SYNOPSIS > .In sys/bus.h > @@ -86,6 +90,8 @@ > .Fn pci_find_extcap "device_t dev" "int capability" "int *capreg" > .Ft int > .Fn pci_find_htcap "device_t dev" "int capability" "int *capreg" > +.Ft device_t > +.Fn pci_find_pcie_root_port "device_t dev" > .Ft int > .Fn pci_get_max_read_req "device_t dev" > .Ft int > @@ -116,6 +122,18 @@ > .Fn pci_set_powerstate "device_t dev" "int state" > .Ft void > .Fn pci_write_config "device_t dev" "int reg" "uint32_t val" "int width" > +.Ft uint32_t > +.Fo pcie_adjust_config > +.Fa "device_t dev" > +.Fa "int reg" > +.Fa "uint32_t mask" > +.Fa "uint32_t val" > +.Fa "int width" > +.Fc > +.Ft uint32_t > +.Fn pcie_read_config "device_t dev" "int reg" "int width" > +.Ft void > +.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" > .Sh DESCRIPTION > The > .Nm > @@ -152,6 +170,48 @@ with > .Fa width > specifying the size of the access. > .Pp > +The > +.Fn pcie_adjust_config > +function is used to modify the value of a register in the PCI-express > +capability register set of device > +.Fa dev . > +The offset > +.Fa reg > +specifies a relative offset in the register set with > +.Fa width > +specifying the size of the access. > +The new value of the register is computed by modifying bits set in > +.Fa mask > +to the value in > +.Fa val . > +Any bits not specified in > +.Fa mask > +are preserved. > +The previous value of the register is returned. > +.Pp > +The > +.Fn pcie_read_config > +function is used to read the value of a register in the PCI-express > +capability register set of device > +.Fa dev . > +The offset > +.Fa reg > +specifies a relative offset in the register set with > +.Fa width > +specifying the size of the access. > +.Pp > +The > +.Fn pcie_write_config > +function is used to write the value > +.Fa val > +to a register in the PCI-express capability register set of device > +.Fa dev . > +The offset > +.Fa reg > +specifies a relative offset in the register set with > +.Fa width > +specifying the size of the access. > +.Pp > .Em NOTE : > Device drivers should only use these functions for functionality that > is not available via another > @@ -274,6 +334,16 @@ If the capability is not found or the de > returns an error. > .Pp > The > +.Fn pci_find_pcie_root_port > +function walks up the PCI device hierarchy to locate the PCI-express root > +port upstream of > +.Fa dev . > +If a root port is not found, > +.Fn pci_find_pcie_root_port > +returns > +.Dv NULL . > +.Pp > +The > .Fn pci_get_vpd_ident > function is used to fetch a device's Vital Product Data > .Pq VPD > > Modified: stable/10/sys/dev/pci/pci.c > ============================================================================== > --- stable/10/sys/dev/pci/pci.c Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/sys/dev/pci/pci.c Sat Nov 14 01:06:45 2015 (r290809) > @@ -1895,6 +1895,63 @@ pci_set_max_read_req(device_t dev, int s > return (size); > } > > +uint32_t > +pcie_read_config(device_t dev, int reg, int width) > +{ > + struct pci_devinfo *dinfo = device_get_ivars(dev); > + int cap; > + > + cap = dinfo->cfg.pcie.pcie_location; > + if (cap == 0) { > + if (width == 2) > + return (0xffff); > + return (0xffffffff); > + } > + > + return (pci_read_config(dev, cap + reg, width)); > +} > + > +void > +pcie_write_config(device_t dev, int reg, uint32_t value, int width) > +{ > + struct pci_devinfo *dinfo = device_get_ivars(dev); > + int cap; > + > + cap = dinfo->cfg.pcie.pcie_location; > + if (cap == 0) > + return; > + pci_write_config(dev, cap + reg, value, width); > +} > + > +/* > + * Adjusts a PCI-e capability register by clearing the bits in mask > + * and setting the bits in (value & mask). Bits not set in mask are > + * not adjusted. > + * > + * Returns the old value on success or all ones on failure. > + */ > +uint32_t > +pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, > + int width) > +{ > + struct pci_devinfo *dinfo = device_get_ivars(dev); > + uint32_t old, new; > + int cap; > + > + cap = dinfo->cfg.pcie.pcie_location; > + if (cap == 0) { > + if (width == 2) > + return (0xffff); > + return (0xffffffff); > + } > + > + old = pci_read_config(dev, cap + reg, width); > + new = old & ~mask; > + new |= (value & mask); > + pci_write_config(dev, cap + reg, new, width); > + return (old); > +} > + > /* > * Support for MSI message signalled interrupts. > */ > @@ -5139,3 +5196,44 @@ pci_get_rid_method(device_t dev, device_ > > return (PCIB_GET_RID(device_get_parent(dev), child)); > } > + > +/* Find the upstream port of a given PCI device in a root complex. */ > +device_t > +pci_find_pcie_root_port(device_t dev) > +{ > + struct pci_devinfo *dinfo; > + devclass_t pci_class; > + device_t pcib, bus; > + > + pci_class = devclass_find("pci"); > + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, > + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); > + > + /* > + * Walk the bridge hierarchy until we find a PCI-e root > + * port or a non-PCI device. > + */ > + for (;;) { > + bus = device_get_parent(dev); > + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, > + device_get_nameunit(dev))); > + > + pcib = device_get_parent(bus); > + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, > + device_get_nameunit(bus))); > + > + /* > + * pcib's parent must be a PCI bus for this to be a > + * PCI-PCI bridge. > + */ > + if (device_get_devclass(device_get_parent(pcib)) != pci_class) > + return (NULL); > + > + dinfo = device_get_ivars(pcib); > + if (dinfo->cfg.pcie.pcie_location != 0 && > + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) > + return (pcib); > + > + dev = pcib; > + } > +} > > Modified: stable/10/sys/dev/pci/pcivar.h > ============================================================================== > --- stable/10/sys/dev/pci/pcivar.h Sat Nov 14 00:04:42 2015 (r290808) > +++ stable/10/sys/dev/pci/pcivar.h Sat Nov 14 01:06:45 2015 (r290809) > @@ -501,10 +501,15 @@ int pci_msix_device_blacklisted(device_t > > void pci_ht_map_msi(device_t dev, uint64_t addr); > > +device_t pci_find_pcie_root_port(device_t dev); > int pci_get_max_read_req(device_t dev); > void pci_restore_state(device_t dev); > void pci_save_state(device_t dev); > int pci_set_max_read_req(device_t dev, int size); > +uint32_t pcie_read_config(device_t dev, int reg, int width); > +void pcie_write_config(device_t dev, int reg, uint32_t value, int width); > +uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, > + uint32_t value, int width); > > > #ifdef BUS_SPACE_MAXADDR > From owner-svn-src-stable@freebsd.org Sat Nov 14 17:30:53 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2B9CA2FDA5; Sat, 14 Nov 2015 17:30:53 +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 AB08E1AAA; Sat, 14 Nov 2015 17:30:53 +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 tAEHUqrw087705; Sat, 14 Nov 2015 17:30:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEHUqkU087704; Sat, 14 Nov 2015 17:30:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511141730.tAEHUqkU087704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 14 Nov 2015 17:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290826 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:30:54 -0000 Author: bdrewery Date: Sat Nov 14 17:30:52 2015 New Revision: 290826 URL: https://svnweb.freebsd.org/changeset/base/290826 Log: MFC r290428: remove \, it confuses things. Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sat Nov 14 17:21:17 2015 (r290825) +++ stable/10/share/man/man9/Makefile Sat Nov 14 17:30:52 2015 (r290826) @@ -1032,7 +1032,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 From owner-svn-src-stable@freebsd.org Sat Nov 14 17:31:20 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C3B3A2FE16; Sat, 14 Nov 2015 17:31:20 +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 E38A61C8A; Sat, 14 Nov 2015 17:31:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DCF8D14D3; Sat, 14 Nov 2015 17:31:19 +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 95E6CF1E1; Sat, 14 Nov 2015 17:31:19 +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 CF2epns0_tw6; Sat, 14 Nov 2015 17:31:17 +0000 (UTC) Subject: Re: svn commit: r290809 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CCD59F1DB To: Michal Meloun , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201511140106.tAE16j5Q097967@repo.freebsd.org> <5646EFF8.1080207@freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56476FEC.8070701@FreeBSD.org> Date: Sat, 14 Nov 2015 09:31:24 -0800 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: <5646EFF8.1080207@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:31:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/14/2015 12:25 AM, Michal Meloun wrote: > This commit breaks installworld. Fixed. >=20 > Index: share/man/man9/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 > --- share/man/man9/Makefile (revision 290818) > +++ share/man/man9/Makefile (working copy) > @@ -1032,7 +1032,7 @@ > pci.9 pci_write_config.9 \ > pci.9 pcie_adjust_config.9 \ > pci.9 pcie_read_config.9 \ > - pci.9 pcie_write_config.9 \ > + pci.9 pcie_write_config.9 > MLINKS+=3Dpfil.9 pfil_add_hook.9 \ > pfil.9 pfil_hook_get.9 \ > pfil.9 pfil_remove_hook.9 >=20 >=20 > Dne 14.11.2015 v 2:06 John Baldwin napsal(a): >> Author: jhb >> Date: Sat Nov 14 01:06:45 2015 >> New Revision: 290809 >> URL: https://svnweb.freebsd.org/changeset/base/290809 >> >> Log: >> MFC 290414,290415: >> Additional PCI helper functions. >> =20 --=20 Regards, Bryan Drewery --E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT 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 iQEcBAEBAgAGBQJWR2/tAAoJEDXXcbtuRpfPfhcH/2BbZI+prm1LlMWxASf6pN8i torO2xHoQd+KnnvVrKaqc1NLRG//Kk7QxFEN2jriLI7z46lNcqBO0TnbkZ1aWRew ruKGf+DnX/fu8ig1qjAcaMAYt43B/5wvPP/3xc06WuxFs/NpbPwbdY8VE7vaBPQj YXdLoM/ApYSsSaeHLIiFBdDHP4ZKDxVUne2T7yT935T0Ph5lqyEO76jLh0VbZr0+ +9oB6fO4zvxd26fS3eRFmb9fbUC85axH1+BO2+05fNocSkvfn+/NcEeuovuTFdvF RKmovBiPs0ooVms4eYqL8feTUljn6Q/mJ9RQwhUYd+Npr+g3xYWEod7b9b/TxGw= =LAXW -----END PGP SIGNATURE----- --E3nAE6CVU0UCWR0o2lgwf7abvHs24IppT-- From owner-svn-src-stable@freebsd.org Sat Nov 14 17:32:39 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A46A2FF51; Sat, 14 Nov 2015 17:32: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 8C8E41F7B; Sat, 14 Nov 2015 17:32: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 tAEHWcnj088421; Sat, 14 Nov 2015 17:32:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAEHWcdj088420; Sat, 14 Nov 2015 17:32:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511141732.tAEHWcdj088420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 14 Nov 2015 17:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r290827 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 17:32:39 -0000 Author: bdrewery Date: Sat Nov 14 17:32:38 2015 New Revision: 290827 URL: https://svnweb.freebsd.org/changeset/base/290827 Log: MFC r290428: remove \, it confuses things. Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 14 17:30:52 2015 (r290826) +++ stable/9/share/man/man9/Makefile Sat Nov 14 17:32:38 2015 (r290827) @@ -996,7 +996,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ pci.9 pcie_read_config.9 \ - pci.9 pcie_write_config.9 \ + pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 From owner-svn-src-stable@freebsd.org Sat Nov 14 18:30:29 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80303A2FBE3; Sat, 14 Nov 2015 18:30:29 +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 505261DB1; Sat, 14 Nov 2015 18:30:28 +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 tAEIUKAI086032 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Nov 2015 18:30:22 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: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk From: David Chisnall In-Reply-To: <201510261621.t9QGLuL2028872@repo.freebsd.org> Date: Sat, 14 Nov 2015 18:30:13 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <71109998-711D-4ECA-9B44-5A7B1F8705F3@FreeBSD.org> References: <201510261621.t9QGLuL2028872@repo.freebsd.org> To: Eric van Gyzen X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2015 18:30:29 -0000 On 26 Oct 2015, at 16:21, Eric van Gyzen wrote: >=20 > One counter-argument to this change is that most applications already > use SIMD, and the number of applications and amount of SIMD usage > are only increasing. Note that SSE and SIMD are not the same thing. The x86-64 ABI uses SSE = registers for floating point arguments, so even a purely scalar = application that uses floating point will end up faulting in the SSE = state. This is not the case on IA32, where x87 registers are used = (though when compiling for i686, SSE is used by default because register = allocation for x87 is a huge pain). I believe that the no-sse option for clang is ABI-preserving, so will = not actually disable all SSE unless you also specify -msoft-float. I = don=E2=80=99t think that libthr uses floating point anywhere, but libc = does and you only need to call one function that takes a floating point = argument in between context switches to lose this gain on x86-64. With = this change, we=E2=80=99re making the compiler emit less efficient code, = on the assumption that nothing will touch the fpu in the quantum before = the next context switch. I=E2=80=99d really like to see the set of = applications that you benchmarked the change with on x86-64 to reach the = conclusion that this is a net win overall.=20 Or, to put it another way: How many applications are multithreaded but = don=E2=80=99t use any floating point code? David