Re: svn commit: r286715 - head/lib/libc/string
Hi Bruce, I sent it already in private to you, as we were talking about the implementation of bcopy(3) on BSD and the POSIX one. So, I will send the patch again here, to let other developer give their opinion about it. Thanks to explain over and over again. Now it is clear to me. All the best. 2015-08-13 12:46 GMT+08:00 Bruce Evans : > On Thu, 13 Aug 2015, Marcelo Araujo wrote: > > Author: araujo >> Date: Thu Aug 13 02:31:23 2015 >> New Revision: 286715 >> URL: https://svnweb.freebsd.org/changeset/base/286715 >> >> Log: >> Remove the mention of memcpy(3) that is build on top of bcopy(3). >> Fix some phrases to make it more clear. >> >> Differential Revision: D3378 >> Reported by: bde@ >> Reviewed by: wblock >> Approved by: bapt, rodrigc (mentor) >> Sponsored by: gandi.net >> > > I don't like this version either :-). > > Modified: head/lib/libc/string/bcopy.3 >> >> == >> --- head/lib/libc/string/bcopy.3Thu Aug 13 01:04:26 2015 >> (r286714) >> +++ head/lib/libc/string/bcopy.3Thu Aug 13 02:31:23 2015 >> (r286715) >> @@ -31,7 +31,7 @@ >> .\" @(#)bcopy.3 8.1 (Berkeley) 6/4/93 >> .\" $FreeBSD$ >> .\" >> -.Dd August 11, 2015 >> +.Dd August 13, 2015 >> .Dt BCOPY 3 >> .Os >> .Sh NAME >> @@ -58,16 +58,14 @@ If >> .Fa len >> is zero, no bytes are copied. >> .Pp >> -This function is deprecated (marked as LEGACY in >> -POSIX.1-2001): use >> -.Xr memcpy 3 >> -or >> +This function is obsolete (marked as LEGACY in >> +POSIX.1-2001): please use >> > > This function is not obsolete, but is fully supported in FreeBSD. > > Its obsoletely doesn't follow at all from the clause in parentheses. > LEGACY doesn't even mean obsolencent. In computerspeak it means > "old stuff that we don't like". > > I think you got the "obsolete" wording from NetBSD. But I think > NetBSD started deprecating it in 1995. It might really be obsolete > for them after 20 years of deprecation. > > Please don't use pleasant nonsenses like "please" in man pages or > comments. > > .Xr memmove 3 >> in new programs. >> > > Still not quite right. New programs should use the best function and > that is usually memcpy(). Only old programs that are being roto-tilled > should convert bcopy() to memmove() (so as to avoid having to understand > them well enough to know if they do overlapped copies). > > -Note that the first two arguments are >> -interchanged for >> -.Xr memcpy 3 >> -and >> +Note that >> +.Fn bcopy >> +takes its src and dst arguments in the opposite >> +order from >> .Xr memmove 3 . >> > > OK, except Xr should be Fn. ".Xr memmove 3" is a man page, not a function. > Man pages don't take src and dst arguments :-). This normally shows up > in the rendering -- in text mode, Fn gives highlighting but Xr doesn't. > > Now I notice more markup problems: the src and dst arguments are not marked > up. In text mode, Fa gives highlighting for args. > > POSIX.1-2008 removes the specification of >> .Fn bcopy . >> > > Better put this before the LEGACY statement and maybe merge the LEGACY > statement into the HISTORY section. Since I don't want to deprecate > bcopy(), I would put this in the history section too. > > Technically, this function is not deprecated since it is still a standard > BSD function in . The ifdef for this is already quite > complicated and broken, thoough it only attempts to keep up with some > of the POSIX churn: from strings.h: > > #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 > int bcmp(const void *, const void *, size_t) __pure; /* LEGACY > */ > void bcopy(const void *, void *, size_t); /* LEGACY > */ > void bzero(void *, size_t); /* LEGACY > */ > #endif > > It is POSIX LEGACY, but standard BSD. > > The POSIX ifdef is quite broken: > - before 1996, POSIX didn't have this function, but it also didn't have > strings.h so there is no problem (the ifdef is vacuously correct) > - between 1996 and 2001, there was an XSI version there may have been > a POSIX version that had this function and too. The ifdef > is wrong for any such version since it doesn't mention XSI. Such > versions > are just unsupported. > - between 2001 and 2008, POSIX apparently required bcopy() (and the other > functions) but didn't declare them anywhere, except in the XSI case it > requires them to be declared in . The above supports the > non-XSI case of this. The XSI case is broken as in any 1996-2001 > versions. > - the ifdef is not up to date with changing LEGACY to OBSOLETE, but since > LEGACY already resulted in omission of the prototypes in the non-XSI > case, > nothing needed to be changed in this case, and since the XSI case is > unsupported nothing need to be changed to turn off the prototypes for XSI > either. > > Correct code here wouldn't have the POSIX ifdef or LEGACY comments, but > might having a comment
svn commit: r286718 - head/sys/conf
Author: peter Date: Thu Aug 13 05:42:56 2015 New Revision: 286718 URL: https://svnweb.freebsd.org/changeset/base/286718 Log: Add missing cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c that was left out of r286705. Forgotten by: mav Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Thu Aug 13 05:02:04 2015(r286717) +++ head/sys/conf/files Thu Aug 13 05:42:56 2015(r286718) @@ -145,6 +145,7 @@ cddl/contrib/opensolaris/uts/common/fs/z cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c optional zfs compile-with "${ZFS_C}" ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286717 - release/10.2.0
Author: gjb Date: Thu Aug 13 05:02:04 2015 New Revision: 286717 URL: https://svnweb.freebsd.org/changeset/base/286717 Log: Tag releng/10.2@28 as release/10.2.0 (10.2-RELEASE). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Added: release/10.2.0/ - copied from r28, releng/10.2/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286687 - head
On Aug 12, 2015, at 21:59, Julian Elischer wrote: > On 8/13/15 12:53 PM, Warner Losh wrote: >>> On Aug 12, 2015, at 10:46 PM, Julian Elischer wrote: >>> >>> On 8/13/15 3:00 AM, Warner Losh wrote: Author: imp Date: Wed Aug 12 19:00:47 2015 New Revision: 286687 URL: https://svnweb.freebsd.org/changeset/base/286687 Log: Document build-tools better. Add rescue back because it builds /bin/sh which has a build-tools target (see commit for how build-tools and cross-tools differ). >>> really? do we build ALL of rescue? that contains most of /bin and lots of >>> /usr/bin. >>> that's a lot.. Can we not just build/bin/sh itself? > I was confused because you put the entry for the entire rescue. not the > subdirectory. >> No, we don’t. Check the logs before complaining. It builds the build-tools >> target >> which is empty for the vast majority of rescue. It wasn’t obvious why it was >> there, >> until I deleted it. Then it became obvious, but I thought I’d document why. > > do we build sh through rescue just to get a static binary? > It seems a rather non-obvious way to get one. but if we are building it that > way anyhow, > maybe we should throw a whole bunch of other build time utils in there as > well? > might speed up the compile.. No. It’s only building bits and pieces needed to bootstrap /bin/sh and /bin/tcsh for /rescue/rescue . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286687 - head
On 8/13/15 12:53 PM, Warner Losh wrote: On Aug 12, 2015, at 10:46 PM, Julian Elischer wrote: On 8/13/15 3:00 AM, Warner Losh wrote: Author: imp Date: Wed Aug 12 19:00:47 2015 New Revision: 286687 URL: https://svnweb.freebsd.org/changeset/base/286687 Log: Document build-tools better. Add rescue back because it builds /bin/sh which has a build-tools target (see commit for how build-tools and cross-tools differ). really? do we build ALL of rescue? that contains most of /bin and lots of /usr/bin. that's a lot.. Can we not just build/bin/sh itself? I was confused because you put the entry for the entire rescue. not the subdirectory. No, we don’t. Check the logs before complaining. It builds the build-tools target which is empty for the vast majority of rescue. It wasn’t obvious why it was there, until I deleted it. Then it became obvious, but I thought I’d document why. do we build sh through rescue just to get a static binary? It seems a rather non-obvious way to get one. but if we are building it that way anyhow, maybe we should throw a whole bunch of other build time utils in there as well? might speed up the compile.. Warner ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286687 - head
> On Aug 12, 2015, at 10:52 PM, Garrett Cooper wrote: > > On Aug 12, 2015, at 21:46, Julian Elischer wrote: > >> On 8/13/15 3:00 AM, Warner Losh wrote: >>> Author: imp >>> Date: Wed Aug 12 19:00:47 2015 >>> New Revision: 286687 >>> URL: https://svnweb.freebsd.org/changeset/base/286687 >>> >>> Log: >>> Document build-tools better. Add rescue back because it builds /bin/sh >>> which has a build-tools target (see commit for how build-tools and >>> cross-tools differ). >> really? do we build ALL of rescue? that contains most of /bin and lots of >> /usr/bin. > > build-tools only builds /bin/sh and bin/tcsh : > > $ grep BUILDTOOLS rescue/rescue/Makefile > CRUNCH_BUILDTOOLS+= bin/sh > CRUNCH_BUILDTOOLS+= bin/csh > >> that's a lot.. Can we not just build/bin/sh itself? > > That would.. probably make more sense (especially in a post-projects/bmake > world)… but it needs better comments in Makefile.inc1 . Actually, what we have is totally fine. There’s nothing to see here. This is now commented adequately in Makefile.inc1, and listing things in Makefile.inc1 is totally wrong other than rescue/rescue because rescue builds things with a different MAKEOBJDIRPREFIX. Rather than have a plethora of ‘reach overs’ to get the built build-tools, and create the crazy build dependencies, we waste < 2s of your time. If somebody wants to convert rescue.mk and bsd.crunchgen.mk to something more meta-mode friendly, that might be interesting, but it’s independent of Makefile.inc1 (mostly because that’s unused in Meta mode). Warner signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r286687 - head
> On Aug 12, 2015, at 10:46 PM, Julian Elischer wrote: > > On 8/13/15 3:00 AM, Warner Losh wrote: >> Author: imp >> Date: Wed Aug 12 19:00:47 2015 >> New Revision: 286687 >> URL: https://svnweb.freebsd.org/changeset/base/286687 >> >> Log: >> Document build-tools better. Add rescue back because it builds /bin/sh >> which has a build-tools target (see commit for how build-tools and >> cross-tools differ). > really? do we build ALL of rescue? that contains most of /bin and lots of > /usr/bin. > that's a lot.. Can we not just build/bin/sh itself? No, we don’t. Check the logs before complaining. It builds the build-tools target which is empty for the vast majority of rescue. It wasn’t obvious why it was there, until I deleted it. Then it became obvious, but I thought I’d document why. Warner signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r286687 - head
On Aug 12, 2015, at 21:46, Julian Elischer wrote: > On 8/13/15 3:00 AM, Warner Losh wrote: >> Author: imp >> Date: Wed Aug 12 19:00:47 2015 >> New Revision: 286687 >> URL: https://svnweb.freebsd.org/changeset/base/286687 >> >> Log: >> Document build-tools better. Add rescue back because it builds /bin/sh >> which has a build-tools target (see commit for how build-tools and >> cross-tools differ). > really? do we build ALL of rescue? that contains most of /bin and lots of > /usr/bin. build-tools only builds /bin/sh and bin/tcsh : $ grep BUILDTOOLS rescue/rescue/Makefile CRUNCH_BUILDTOOLS+= bin/sh CRUNCH_BUILDTOOLS+= bin/csh > that's a lot.. Can we not just build/bin/sh itself? That would.. probably make more sense (especially in a post-projects/bmake world)… but it needs better comments in Makefile.inc1 . Thanks! -NGie ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286715 - head/lib/libc/string
On Thu, 13 Aug 2015, Marcelo Araujo wrote: Author: araujo Date: Thu Aug 13 02:31:23 2015 New Revision: 286715 URL: https://svnweb.freebsd.org/changeset/base/286715 Log: Remove the mention of memcpy(3) that is build on top of bcopy(3). Fix some phrases to make it more clear. Differential Revision: D3378 Reported by: bde@ Reviewed by: wblock Approved by: bapt, rodrigc (mentor) Sponsored by: gandi.net I don't like this version either :-). Modified: head/lib/libc/string/bcopy.3 == --- head/lib/libc/string/bcopy.3Thu Aug 13 01:04:26 2015 (r286714) +++ head/lib/libc/string/bcopy.3Thu Aug 13 02:31:23 2015 (r286715) @@ -31,7 +31,7 @@ .\" @(#)bcopy.38.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 11, 2015 +.Dd August 13, 2015 .Dt BCOPY 3 .Os .Sh NAME @@ -58,16 +58,14 @@ If .Fa len is zero, no bytes are copied. .Pp -This function is deprecated (marked as LEGACY in -POSIX.1-2001): use -.Xr memcpy 3 -or +This function is obsolete (marked as LEGACY in +POSIX.1-2001): please use This function is not obsolete, but is fully supported in FreeBSD. Its obsoletely doesn't follow at all from the clause in parentheses. LEGACY doesn't even mean obsolencent. In computerspeak it means "old stuff that we don't like". I think you got the "obsolete" wording from NetBSD. But I think NetBSD started deprecating it in 1995. It might really be obsolete for them after 20 years of deprecation. Please don't use pleasant nonsenses like "please" in man pages or comments. .Xr memmove 3 in new programs. Still not quite right. New programs should use the best function and that is usually memcpy(). Only old programs that are being roto-tilled should convert bcopy() to memmove() (so as to avoid having to understand them well enough to know if they do overlapped copies). -Note that the first two arguments are -interchanged for -.Xr memcpy 3 -and +Note that +.Fn bcopy +takes its src and dst arguments in the opposite +order from .Xr memmove 3 . OK, except Xr should be Fn. ".Xr memmove 3" is a man page, not a function. Man pages don't take src and dst arguments :-). This normally shows up in the rendering -- in text mode, Fn gives highlighting but Xr doesn't. Now I notice more markup problems: the src and dst arguments are not marked up. In text mode, Fa gives highlighting for args. POSIX.1-2008 removes the specification of .Fn bcopy . Better put this before the LEGACY statement and maybe merge the LEGACY statement into the HISTORY section. Since I don't want to deprecate bcopy(), I would put this in the history section too. Technically, this function is not deprecated since it is still a standard BSD function in . The ifdef for this is already quite complicated and broken, thoough it only attempts to keep up with some of the POSIX churn: from strings.h: #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 int bcmp(const void *, const void *, size_t) __pure; /* LEGACY */ void bcopy(const void *, void *, size_t); /* LEGACY */ void bzero(void *, size_t); /* LEGACY */ #endif It is POSIX LEGACY, but standard BSD. The POSIX ifdef is quite broken: - before 1996, POSIX didn't have this function, but it also didn't have strings.h so there is no problem (the ifdef is vacuously correct) - between 1996 and 2001, there was an XSI version there may have been a POSIX version that had this function and too. The ifdef is wrong for any such version since it doesn't mention XSI. Such versions are just unsupported. - between 2001 and 2008, POSIX apparently required bcopy() (and the other functions) but didn't declare them anywhere, except in the XSI case it requires them to be declared in . The above supports the non-XSI case of this. The XSI case is broken as in any 1996-2001 versions. - the ifdef is not up to date with changing LEGACY to OBSOLETE, but since LEGACY already resulted in omission of the prototypes in the non-XSI case, nothing needed to be changed in this case, and since the XSI case is unsupported nothing need to be changed to turn off the prototypes for XSI either. Correct code here wouldn't have the POSIX ifdef or LEGACY comments, but might having a comment saying that XSI is intentionally unsupported. XSI messes elswhere are supported, and I am suprised that not supporting it here doesn't cause problems. Ifdefs for historical mistakes would cause much larger messes if they were complete. Just near here, there is the mess of the and . 1980's source code had messy ifdefs in applications for this. C90 didn't exactly help by standardizing the SYSVish . POSIX.1-2001 actively harmed by restoring the BSDish . FreeBSD handles this problem by including in if __BSD_VISIBLE and not documenting the details in man pages. contains mostly BSD functions, and man
Re: svn commit: r286687 - head
On 8/13/15 3:00 AM, Warner Losh wrote: Author: imp Date: Wed Aug 12 19:00:47 2015 New Revision: 286687 URL: https://svnweb.freebsd.org/changeset/base/286687 Log: Document build-tools better. Add rescue back because it builds /bin/sh which has a build-tools target (see commit for how build-tools and cross-tools differ). really? do we build ALL of rescue? that contains most of /bin and lots of /usr/bin. that's a lot.. Can we not just build/bin/sh itself? Modified: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286716 - in head/usr.bin: ypcat ypwhich
Author: araujo Date: Thu Aug 13 02:36:37 2015 New Revision: 286716 URL: https://svnweb.freebsd.org/changeset/base/286716 Log: Use nitems instead of "sizeof ypaliases/sizeof ypaliases[0]". Make the if statement more expressive. Differential Revision:D3366 Reviewed by: ed Approved by: bapt, rodrigc (mentor) Modified: head/usr.bin/ypcat/ypcat.c head/usr.bin/ypwhich/ypwhich.c Modified: head/usr.bin/ypcat/ypcat.c == --- head/usr.bin/ypcat/ypcat.c Thu Aug 13 02:31:23 2015(r286715) +++ head/usr.bin/ypcat/ypcat.c Thu Aug 13 02:36:37 2015(r286716) @@ -96,7 +96,7 @@ main(int argc, char *argv[]) while ((c = getopt(argc, argv, "xd:kt")) != -1) switch (c) { case 'x': - for (i=0; ihttp://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286715 - head/lib/libc/string
Author: araujo Date: Thu Aug 13 02:31:23 2015 New Revision: 286715 URL: https://svnweb.freebsd.org/changeset/base/286715 Log: Remove the mention of memcpy(3) that is build on top of bcopy(3). Fix some phrases to make it more clear. Differential Revision:D3378 Reported by: bde@ Reviewed by: wblock Approved by: bapt, rodrigc (mentor) Sponsored by: gandi.net Modified: head/lib/libc/string/bcopy.3 Modified: head/lib/libc/string/bcopy.3 == --- head/lib/libc/string/bcopy.3Thu Aug 13 01:04:26 2015 (r286714) +++ head/lib/libc/string/bcopy.3Thu Aug 13 02:31:23 2015 (r286715) @@ -31,7 +31,7 @@ .\" @(#)bcopy.38.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 11, 2015 +.Dd August 13, 2015 .Dt BCOPY 3 .Os .Sh NAME @@ -58,16 +58,14 @@ If .Fa len is zero, no bytes are copied. .Pp -This function is deprecated (marked as LEGACY in -POSIX.1-2001): use -.Xr memcpy 3 -or +This function is obsolete (marked as LEGACY in +POSIX.1-2001): please use .Xr memmove 3 in new programs. -Note that the first two arguments are -interchanged for -.Xr memcpy 3 -and +Note that +.Fn bcopy +takes its src and dst arguments in the opposite +order from .Xr memmove 3 . POSIX.1-2008 removes the specification of .Fn bcopy . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286714 - in stable/9/contrib/gcc: . doc
Author: pfg Date: Thu Aug 13 01:04:26 2015 New Revision: 286714 URL: https://svnweb.freebsd.org/changeset/base/286714 Log: MFC r286074: GCC: Add a new option "-fstack-protector-strong" This includes additional functions to be protected: those that have local array definitions, or have references to local frame addresses. This is a new option in GCC-4.9 that was relicensed by Han Shen from Google under GPLv2. Obtained from:OpenBSD (2014-01-14) Modified: stable/9/contrib/gcc/c-cppbuiltin.c stable/9/contrib/gcc/cfgexpand.c stable/9/contrib/gcc/common.opt stable/9/contrib/gcc/doc/cpp.texi stable/9/contrib/gcc/doc/gcc.1 stable/9/contrib/gcc/doc/invoke.texi stable/9/contrib/gcc/gcc.c Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/c-cppbuiltin.c == --- stable/9/contrib/gcc/c-cppbuiltin.c Thu Aug 13 01:02:57 2015 (r286713) +++ stable/9/contrib/gcc/c-cppbuiltin.c Thu Aug 13 01:04:26 2015 (r286714) @@ -545,7 +545,9 @@ c_cpp_builtins (cpp_reader *pfile) /* Make the choice of the stack protector runtime visible to source code. The macro names and values here were chosen for compatibility with an earlier implementation, i.e. ProPolice. */ - if (flag_stack_protect == 2) + if (flag_stack_protect == 3) +cpp_define (pfile, "__SSP_STRONG__=3"); + else if (flag_stack_protect == 2) cpp_define (pfile, "__SSP_ALL__=2"); else if (flag_stack_protect == 1) cpp_define (pfile, "__SSP__=1"); Modified: stable/9/contrib/gcc/cfgexpand.c == --- stable/9/contrib/gcc/cfgexpand.cThu Aug 13 01:02:57 2015 (r286713) +++ stable/9/contrib/gcc/cfgexpand.cThu Aug 13 01:04:26 2015 (r286714) @@ -810,6 +810,12 @@ clear_tree_used (tree block) clear_tree_used (t); } +enum { + SPCT_FLAG_DEFAULT = 1, + SPCT_FLAG_ALL = 2, + SPCT_FLAG_STRONG = 3 +}; + /* Examine TYPE and determine a bit mask of the following features. */ #define SPCT_HAS_LARGE_CHAR_ARRAY 1 @@ -879,7 +885,8 @@ stack_protect_decl_phase (tree decl) if (bits & SPCT_HAS_SMALL_CHAR_ARRAY) has_short_buffer = true; - if (flag_stack_protect == 2) + if (flag_stack_protect == SPCT_FLAG_ALL + || flag_stack_protect == SPCT_FLAG_STRONG) { if ((bits & (SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_LARGE_CHAR_ARRAY)) && !(bits & SPCT_HAS_AGGREGATE)) @@ -947,12 +954,36 @@ create_stack_guard (void) cfun->stack_protect_guard = guard; } +/* Helper routine to check if a record or union contains an array field. */ + +static int +record_or_union_type_has_array_p (tree tree_type) +{ + tree fields = TYPE_FIELDS (tree_type); + tree f; + + for (f = fields; f; f = TREE_CHAIN (f)) +if (TREE_CODE (f) == FIELD_DECL) + { + tree field_type = TREE_TYPE (f); + if ((TREE_CODE (field_type) == RECORD_TYPE +|| TREE_CODE (field_type) == UNION_TYPE +|| TREE_CODE (field_type) == QUAL_UNION_TYPE) + && record_or_union_type_has_array_p (field_type)) + return 1; + if (TREE_CODE (field_type) == ARRAY_TYPE) + return 1; + } + return 0; +} + /* Expand all variables used in the function. */ static void expand_used_vars (void) { tree t, outer_block = DECL_INITIAL (current_function_decl); + bool gen_stack_protect_signal = false; /* Compute the phase of the stack frame for this function. */ { @@ -972,6 +1003,29 @@ expand_used_vars (void) has_protected_decls = false; has_short_buffer = false; + if (flag_stack_protect == SPCT_FLAG_STRONG) +for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t)) + { + tree var = TREE_VALUE (t); + if (!is_global_var (var)) + { + tree var_type = TREE_TYPE (var); + /* Examine local referenced variables that have their addresses +* taken, contain an array, or are arrays. */ + if (TREE_CODE (var) == VAR_DECL + && (TREE_CODE (var_type) == ARRAY_TYPE + || TREE_ADDRESSABLE (var) + || ((TREE_CODE (var_type) == RECORD_TYPE +|| TREE_CODE (var_type) == UNION_TYPE +|| TREE_CODE (var_type) == QUAL_UNION_TYPE) + && record_or_union_type_has_array_p (var_type + { + gen_stack_protect_signal = true; + break; + } + } + } + /* At this point all variables on the unexpanded_var_list with TREE_USED set are not associated with any block scope. Lay them out. */ for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t)) @@ -1032,12 +1086,26 @@ expand_used_vars (void) dump_stack_var_partition (); } - /* There are several conditions under which we should create a -
svn commit: r286713 - in stable/10/contrib/gcc: . doc
Author: pfg Date: Thu Aug 13 01:02:57 2015 New Revision: 286713 URL: https://svnweb.freebsd.org/changeset/base/286713 Log: MFC r286074: GCC: Add a new option "-fstack-protector-strong" This includes additional functions to be protected: those that have local array definitions, or have references to local frame addresses. This is a new option in GCC-4.9 that was relicensed by Han Shen from Google under GPLv2. Obtained from:OpenBSD (2014-01-14) Modified: stable/10/contrib/gcc/c-cppbuiltin.c stable/10/contrib/gcc/cfgexpand.c stable/10/contrib/gcc/common.opt stable/10/contrib/gcc/doc/cpp.texi stable/10/contrib/gcc/doc/gcc.1 stable/10/contrib/gcc/doc/invoke.texi stable/10/contrib/gcc/gcc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/c-cppbuiltin.c == --- stable/10/contrib/gcc/c-cppbuiltin.cThu Aug 13 00:13:55 2015 (r286712) +++ stable/10/contrib/gcc/c-cppbuiltin.cThu Aug 13 01:02:57 2015 (r286713) @@ -553,7 +553,9 @@ c_cpp_builtins (cpp_reader *pfile) /* Make the choice of the stack protector runtime visible to source code. The macro names and values here were chosen for compatibility with an earlier implementation, i.e. ProPolice. */ - if (flag_stack_protect == 2) + if (flag_stack_protect == 3) +cpp_define (pfile, "__SSP_STRONG__=3"); + else if (flag_stack_protect == 2) cpp_define (pfile, "__SSP_ALL__=2"); else if (flag_stack_protect == 1) cpp_define (pfile, "__SSP__=1"); Modified: stable/10/contrib/gcc/cfgexpand.c == --- stable/10/contrib/gcc/cfgexpand.c Thu Aug 13 00:13:55 2015 (r286712) +++ stable/10/contrib/gcc/cfgexpand.c Thu Aug 13 01:02:57 2015 (r286713) @@ -810,6 +810,12 @@ clear_tree_used (tree block) clear_tree_used (t); } +enum { + SPCT_FLAG_DEFAULT = 1, + SPCT_FLAG_ALL = 2, + SPCT_FLAG_STRONG = 3 +}; + /* Examine TYPE and determine a bit mask of the following features. */ #define SPCT_HAS_LARGE_CHAR_ARRAY 1 @@ -879,7 +885,8 @@ stack_protect_decl_phase (tree decl) if (bits & SPCT_HAS_SMALL_CHAR_ARRAY) has_short_buffer = true; - if (flag_stack_protect == 2) + if (flag_stack_protect == SPCT_FLAG_ALL + || flag_stack_protect == SPCT_FLAG_STRONG) { if ((bits & (SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_LARGE_CHAR_ARRAY)) && !(bits & SPCT_HAS_AGGREGATE)) @@ -947,12 +954,36 @@ create_stack_guard (void) cfun->stack_protect_guard = guard; } +/* Helper routine to check if a record or union contains an array field. */ + +static int +record_or_union_type_has_array_p (tree tree_type) +{ + tree fields = TYPE_FIELDS (tree_type); + tree f; + + for (f = fields; f; f = TREE_CHAIN (f)) +if (TREE_CODE (f) == FIELD_DECL) + { + tree field_type = TREE_TYPE (f); + if ((TREE_CODE (field_type) == RECORD_TYPE +|| TREE_CODE (field_type) == UNION_TYPE +|| TREE_CODE (field_type) == QUAL_UNION_TYPE) + && record_or_union_type_has_array_p (field_type)) + return 1; + if (TREE_CODE (field_type) == ARRAY_TYPE) + return 1; + } + return 0; +} + /* Expand all variables used in the function. */ static void expand_used_vars (void) { tree t, outer_block = DECL_INITIAL (current_function_decl); + bool gen_stack_protect_signal = false; /* Compute the phase of the stack frame for this function. */ { @@ -972,6 +1003,29 @@ expand_used_vars (void) has_protected_decls = false; has_short_buffer = false; + if (flag_stack_protect == SPCT_FLAG_STRONG) +for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t)) + { + tree var = TREE_VALUE (t); + if (!is_global_var (var)) + { + tree var_type = TREE_TYPE (var); + /* Examine local referenced variables that have their addresses +* taken, contain an array, or are arrays. */ + if (TREE_CODE (var) == VAR_DECL + && (TREE_CODE (var_type) == ARRAY_TYPE + || TREE_ADDRESSABLE (var) + || ((TREE_CODE (var_type) == RECORD_TYPE +|| TREE_CODE (var_type) == UNION_TYPE +|| TREE_CODE (var_type) == QUAL_UNION_TYPE) + && record_or_union_type_has_array_p (var_type + { + gen_stack_protect_signal = true; + break; + } + } + } + /* At this point all variables on the unexpanded_var_list with TREE_USED set are not associated with any block scope. Lay them out. */ for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t)) @@ -1032,12 +1086,26 @@ expand_used_vars (void) dump_stack_var_partition (); } - /* There are several conditions under which we shoul
svn commit: r286712 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Thu Aug 13 00:13:55 2015 New Revision: 286712 URL: https://svnweb.freebsd.org/changeset/base/286712 Log: MFV 286711: 6096 ZFS_SMB_ACL_RENAME needs to cleanup better Reviewed by: Matthew Ahrens Reviewed by: Gordon Ross Reviewed by: George Wilson Approved by: Robert Mustacchi illumos/illumos-gate@8f5190a540d64d2debee6664bbc740e4c38f5b7f Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 13 00:12:52 2015(r286711) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 13 00:13:55 2015(r286712) @@ -5190,6 +5190,7 @@ zfs_ioc_smb_acl(zfs_cmd_t *zc) if ((error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size, zc->zc_iflags, &nvlist)) != 0) { VN_RELE(vp); + VN_RELE(ZTOV(sharedir)); ZFS_EXIT(zfsvfs); return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286711 - vendor-sys/illumos/dist/uts/common/fs/zfs
Author: mav Date: Thu Aug 13 00:12:52 2015 New Revision: 286711 URL: https://svnweb.freebsd.org/changeset/base/286711 Log: 6096 ZFS_SMB_ACL_RENAME needs to cleanup better Reviewed by: Matthew Ahrens Reviewed by: Gordon Ross Reviewed by: George Wilson Approved by: Robert Mustacchi illumos/illumos-gate@8f5190a540d64d2debee6664bbc740e4c38f5b7f Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 13 00:10:36 2015(r286710) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 13 00:12:52 2015(r286711) @@ -5060,6 +5060,7 @@ zfs_ioc_smb_acl(zfs_cmd_t *zc) if ((error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size, zc->zc_iflags, &nvlist)) != 0) { VN_RELE(vp); + VN_RELE(ZTOV(sharedir)); ZFS_EXIT(zfsvfs); return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286710 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Thu Aug 13 00:10:36 2015 New Revision: 286710 URL: https://svnweb.freebsd.org/changeset/base/286710 Log: MFV 286709: 6093 zfsctl_shares_lookup should only VN_RELE() on zfs_zget() success Reviewed by: Gordon Ross Reviewed by: Matthew Ahrens Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Dan McDonald illumos/illumos-gate@0f92170f1ec2737ee5a0e51b5f74093904811452 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cThu Aug 13 00:07:23 2015(r286709) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cThu Aug 13 00:10:36 2015(r286710) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. */ /* @@ -1149,10 +1150,11 @@ zfsctl_shares_lookup(ap) ZFS_EXIT(zfsvfs); return (SET_ERROR(ENOTSUP)); } - if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) + if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { error = VOP_LOOKUP(ZTOV(dzp), vpp, cnp); + VN_RELE(ZTOV(dzp)); + } - VN_RELE(ZTOV(dzp)); ZFS_EXIT(zfsvfs); return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286709 - vendor-sys/illumos/dist/uts/common/fs/zfs
Author: mav Date: Thu Aug 13 00:07:23 2015 New Revision: 286709 URL: https://svnweb.freebsd.org/changeset/base/286709 Log: 6093 zfsctl_shares_lookup should only VN_RELE() on zfs_zget() success Reviewed by: Gordon Ross Reviewed by: Matthew Ahrens Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Dan McDonald illumos/illumos-gate@0f92170f1ec2737ee5a0e51b5f74093904811452 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c Wed Aug 12 23:59:17 2015(r286708) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c Thu Aug 13 00:07:23 2015(r286709) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. */ /* @@ -966,11 +967,12 @@ zfsctl_shares_lookup(vnode_t *dvp, char ZFS_EXIT(zfsvfs); return (SET_ERROR(ENOTSUP)); } - if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) + if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { error = VOP_LOOKUP(ZTOV(dzp), nm, vpp, pnp, flags, rdir, cr, ct, direntflags, realpnp); + VN_RELE(ZTOV(dzp)); + } - VN_RELE(ZTOV(dzp)); ZFS_EXIT(zfsvfs); return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286708 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/openso...
Author: mav Date: Wed Aug 12 23:59:17 2015 New Revision: 286708 URL: https://svnweb.freebsd.org/changeset/base/286708 Log: MFV 286707: 5959 clean up per-dataset feature count code Reviewed by: Toomas Soome Reviewed by: George Wilson Reviewed by: Alex Reece Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@ca0cc3918a1789fa839194af2a9245f801a06b1a A ZFS feature flags (large blocks) tracks its refcounts as the number of datasets that have ever used the feature. Several features of this type are planned to be added (new checksum functions). This code should be made common infrastructure rather than duplicating the code for each feature. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zhack/zhack.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c == --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Aug 12 23:38:58 2015 (r286707) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Aug 12 23:59:17 2015 (r286708) @@ -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. */ #include @@ -2221,7 +2221,7 @@ dump_label(const char *dev) (void) close(fd); } -static uint64_t num_large_blocks; +static uint64_t dataset_feature_count[SPA_FEATURES]; /*ARGSUSED*/ static int @@ -2235,8 +2235,15 @@ dump_one_dir(const char *dsname, void *a (void) printf("Could not open %s, error %d\n", dsname, error); return (0); } - if (dmu_objset_ds(os)->ds_large_blocks) - num_large_blocks++; + + for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { + if (!dmu_objset_ds(os)->ds_feature_inuse[f]) + continue; + ASSERT(spa_feature_table[f].fi_flags & + ZFEATURE_FLAG_PER_DATASET); + dataset_feature_count[f]++; + } + dump_dir(os); dmu_objset_disown(os, FTAG); fuid_table_destroy(); @@ -3035,7 +3042,6 @@ dump_zpool(spa_t *spa) dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { - uint64_t refcount; dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { dump_full_bpobj(&spa->spa_deferred_bpobj, @@ -3057,17 +3063,29 @@ dump_zpool(spa_t *spa) (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); - (void) feature_get_refcount(spa, - &spa_feature_table[SPA_FEATURE_LARGE_BLOCKS], &refcount); - if (num_large_blocks != refcount) { - (void) printf("large_blocks feature refcount mismatch: " - "expected %lld != actual %lld\n", - (longlong_t)num_large_blocks, - (longlong_t)refcount); - rc = 2; - } else { - (void) printf("Verified large_blocks feature refcount " - "is correct (%llu)\n", (longlong_t)refcount); + for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { + uint64_t refcount; + + if (!(spa_feature_table[f].fi_flags & + ZFEATURE_FLAG_PER_DATASET)) { + ASSERT0(dataset_feature_count[f]); + continue; + } + (void) feature_get_refcount(spa, + &spa_feature_table[f], &refcount); + if (dataset_feature_count[f] != refcount) { + (void) printf("%s feature refcount mismatch: " + "%lld datasets != %lld refcount\n", + spa_feature_table[f].fi_uname, + (longlong_t)dataset_feature_count[f], + (longlong_t)refcount
svn commit: r286707 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/...
Author: mav Date: Wed Aug 12 23:38:58 2015 New Revision: 286707 URL: https://svnweb.freebsd.org/changeset/base/286707 Log: 5959 clean up per-dataset feature count code Reviewed by: Toomas Soome Reviewed by: George Wilson Reviewed by: Alex Reece Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@ca0cc3918a1789fa839194af2a9245f801a06b1a A ZFS feature flags (large blocks) tracks its refcounts as the number of datasets that have ever used the feature. Several features of this type are planned to be added (new checksum functions). This code should be made common infrastructure rather than duplicating the code for each feature. Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/cmd/zpool/zpool_main.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c == --- vendor/illumos/dist/cmd/zdb/zdb.c Wed Aug 12 22:51:08 2015 (r286706) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Aug 12 23:38:58 2015 (r286707) @@ -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. */ #include @@ -2198,7 +2198,7 @@ dump_label(const char *dev) (void) close(fd); } -static uint64_t num_large_blocks; +static uint64_t dataset_feature_count[SPA_FEATURES]; /*ARGSUSED*/ static int @@ -2212,8 +2212,15 @@ dump_one_dir(const char *dsname, void *a (void) printf("Could not open %s, error %d\n", dsname, error); return (0); } - if (dmu_objset_ds(os)->ds_large_blocks) - num_large_blocks++; + + for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { + if (!dmu_objset_ds(os)->ds_feature_inuse[f]) + continue; + ASSERT(spa_feature_table[f].fi_flags & + ZFEATURE_FLAG_PER_DATASET); + dataset_feature_count[f]++; + } + dump_dir(os); dmu_objset_disown(os, FTAG); fuid_table_destroy(); @@ -3010,7 +3017,6 @@ dump_zpool(spa_t *spa) dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { - uint64_t refcount; dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { dump_full_bpobj(&spa->spa_deferred_bpobj, @@ -3032,17 +3038,29 @@ dump_zpool(spa_t *spa) (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); - (void) feature_get_refcount(spa, - &spa_feature_table[SPA_FEATURE_LARGE_BLOCKS], &refcount); - if (num_large_blocks != refcount) { - (void) printf("large_blocks feature refcount mismatch: " - "expected %lld != actual %lld\n", - (longlong_t)num_large_blocks, - (longlong_t)refcount); - rc = 2; - } else { - (void) printf("Verified large_blocks feature refcount " - "is correct (%llu)\n", (longlong_t)refcount); + for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { + uint64_t refcount; + + if (!(spa_feature_table[f].fi_flags & + ZFEATURE_FLAG_PER_DATASET)) { + ASSERT0(dataset_feature_count[f]); + continue; + } + (void) feature_get_refcount(spa, + &spa_feature_table[f], &refcount); + if (dataset_feature_count[f] != refcount) { + (void) printf("%s feature refcount mismatch: " + "%lld datasets != %lld refcount\n", + spa_feature_table[f].fi_uname, + (longlong_t)dataset_feature_count[f], + (longlong_t)refcount); + rc = 2; + } else { + (void) printf("Verified %s feature refcount " + "of %llu is correct\n", +
svn commit: r286707 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/...
Author: mav Date: Wed Aug 12 23:38:58 2015 New Revision: 286707 URL: https://svnweb.freebsd.org/changeset/base/286707 Log: 5959 clean up per-dataset feature count code Reviewed by: Toomas Soome Reviewed by: George Wilson Reviewed by: Alex Reece Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@ca0cc3918a1789fa839194af2a9245f801a06b1a A ZFS feature flags (large blocks) tracks its refcounts as the number of datasets that have ever used the feature. Several features of this type are planned to be added (new checksum functions). This code should be made common infrastructure rather than duplicating the code for each feature. Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/cmd/zpool/zpool_main.c Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c == --- vendor-sys/illumos/dist/common/zfs/zfeature_common.cWed Aug 12 22:51:08 2015(r286706) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.cWed Aug 12 23:38:58 2015(r286707) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2013 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, Joyent, Inc. All rights reserved. * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved. @@ -130,15 +130,15 @@ zfeature_depends_on(spa_feature_t fid, s static void zfeature_register(spa_feature_t fid, const char *guid, const char *name, -const char *desc, boolean_t readonly, boolean_t mos, -boolean_t activate_on_enable, const spa_feature_t *deps) +const char *desc, zfeature_flags_t flags, const spa_feature_t *deps) { zfeature_info_t *feature = &spa_feature_table[fid]; static spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; ASSERT(name != NULL); ASSERT(desc != NULL); - ASSERT(!readonly || !mos); + ASSERT((flags & ZFEATURE_FLAG_READONLY_COMPAT) == 0 || + (flags & ZFEATURE_FLAG_MOS) == 0); ASSERT3U(fid, <, SPA_FEATURES); ASSERT(zfeature_is_valid_guid(guid)); @@ -149,9 +149,7 @@ zfeature_register(spa_feature_t fid, con feature->fi_guid = guid; feature->fi_uname = name; feature->fi_desc = desc; - feature->fi_can_readonly = readonly; - feature->fi_mos = mos; - feature->fi_activate_on_enable = activate_on_enable; + feature->fi_flags = flags; feature->fi_depends = deps; } @@ -160,45 +158,46 @@ zpool_feature_init(void) { zfeature_register(SPA_FEATURE_ASYNC_DESTROY, "com.delphix:async_destroy", "async_destroy", - "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, - B_FALSE, NULL); + "Destroy filesystems asynchronously.", + ZFEATURE_FLAG_READONLY_COMPAT, NULL); zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, "com.delphix:empty_bpobj", "empty_bpobj", - "Snapshots use less space.", B_TRUE, B_FALSE, - B_FALSE, NULL); + "Snapshots use less space.", + ZFEATURE_FLAG_READONLY_COMPAT, NULL); zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", - "LZ4 compression algorithm support.", B_FALSE, B_FALSE, - B_TRUE, NULL); + "LZ4 compression algorithm support.", + ZFEATURE_FLAG_ACTIVATE_ON_ENABLE, NULL); zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", - "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, - B_FALSE, NULL); + "Crash dumps to multiple vdev pools.", + 0, NULL); zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, "com.delphix:spacemap_histogram", "spacemap_histogram", - "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, - B_FALSE, NULL); + "Spacemaps maintain space histograms.", + ZFEATURE_FLAG_READONLY_COMPAT, NULL); zfeature_register(SPA_FEATURE_ENABLED_TXG, "com.delphix:enabled_txg", "enabled_txg", - "Record txg at which a feature is enabled", B_TRUE, B_FALSE, - B_FALSE, NULL); + "Record txg at which a feature is enabled
svn commit: r286706 - stable/10/share/man/man4
Author: sbruno Date: Wed Aug 12 22:51:08 2015 New Revision: 286706 URL: https://svnweb.freebsd.org/changeset/base/286706 Log: MFC r273081 brueffer: New sentence -> new line; use macros where appropriate. MFC r276345 Mikhail http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286705 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolar...
Author: mav Date: Wed Aug 12 22:41:06 2015 New Revision: 286705 URL: https://svnweb.freebsd.org/changeset/base/286705 Log: MFV r286704: 5960 zfs recv should prefetch indirect blocks 5925 zfs receive -o origin= Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Author: Paul Dagnelie While running 'zfs recv' we noticed that every 128th 8K block required a read. We were seeing that restore_write() was calling dmu_tx_hold_write() and the indirect block was not cached. We should prefetch upcoming indirect blocks to avoid having to go to disk and blocking the restore_write(). Allow an incremental send stream to be received as a clone, even if the stream does not mark it as a clone. Added: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bqueue.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_priority.h (contents, props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c == --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Aug 12 22:36:02 2015 (r286704) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Aug 12 22:41:06 2015 (r286705) @@ -2428,6 +2428,9 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog dmu_object_type_t type; boolean_t is_metadata; + if (bp == NULL) + return (0); + if (dump_opt['b'] >= 5 && bp->blk_birth > 0) { char blkbuf[BP_SPRINTF_LEN]; snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); @@ -2917,7 +2920,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo avl_index_t where; zdb_ddt_entry_t *zdde, zdde_search; - if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp)) + if (bp == NULL || BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp)) return (0); if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) { Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 == --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Aug 12 22:36:02 2015 (r286704) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Aug 12 22:41:06 2015 (r286705) @@ -191,11 +191,13 @@ .Nm .Cm receive Ns | Ns Cm recv .Op Fl vnFu +.Op Fl o Sy origin Ns = Ns Ar snapsho
svn commit: r286704 - vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/...
Author: mav Date: Wed Aug 12 22:36:02 2015 New Revision: 286704 URL: https://svnweb.freebsd.org/changeset/base/286704 Log: 5960 zfs recv should prefetch indirect blocks 5925 zfs receive -o origin= Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Author: Paul Dagnelie While running 'zfs recv' we noticed that every 128th 8K block required a read. We were seeing that restore_write() was calling dmu_tx_hold_write() and the indirect block was not cached. We should prefetch upcoming indirect blocks to avoid having to go to disk and blocking the restore_write(). Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Changes in other areas also in this revision: Added: vendor-sys/illumos/dist/uts/common/fs/zfs/bqueue.c (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bqueue.h (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_priority.h (contents, props changed) Modified: vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_zfetch.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_checksum.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c == --- vendor/illumos/dist/cmd/zdb/zdb.c Wed Aug 12 22:09:58 2015 (r286703) +++ vendor/illumos/dist/cmd/zdb/zdb.c Wed Aug 12 22:36:02 2015 (r286704) @@ -2403,6 +2403,9 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog dmu_object_type_t type; boolean_t is_metadata; + if (bp == NULL) + return (0); + if (dump_opt['b'] >= 5 && bp->blk_birth > 0) { char blkbuf[BP_SPRINTF_LEN]; snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); @@ -2892,7 +2895,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo avl_index_t where; zdb_ddt_entry_t *zdde, zdde_search; - if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp)) + if (bp == NULL || BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp)) return (0); if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) { Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c == --- vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Aug 12 22:09:58 2015 (r286703) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Wed Aug 12 22:36:02 2015 (r286704) @@ -247,8 +247,9 @@ get_usage(zfs_help_t idx) return (gettext("\tpromote \n")); case HELP_RECEIVE: return (gettext("\treceive [-vnFu] \n" - "\treceive [-vnFu] [-d | -e] \n")); + "snapshot>\n" + "\treceive [-vnFu] [-o origin=] [-d | -e] " + "\n")); case HELP_RENAME: return (gettext("\trename [-f] " "\n" @@ -3834,10 +3835,19 @@ zfs_do_receive(int argc, char **argv) { int c, err; recvflags_t flags = { 0 }; + nvlist_t *props; + nvpair_t *nvp = NULL; + + if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) + nomem(); /* check options */ - while ((c = getopt(argc, argv, ":denuvF")) != -1) { + while ((c = getopt(argc, argv, ":o:denuvF")) != -1) { switch (c) { + case 'o': + if (parsepro
svn commit: r286704 - vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/...
Author: mav Date: Wed Aug 12 22:36:02 2015 New Revision: 286704 URL: https://svnweb.freebsd.org/changeset/base/286704 Log: 5960 zfs recv should prefetch indirect blocks 5925 zfs receive -o origin= Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Author: Paul Dagnelie While running 'zfs recv' we noticed that every 128th 8K block required a read. We were seeing that restore_write() was calling dmu_tx_hold_write() and the indirect block was not cached. We should prefetch upcoming indirect blocks to avoid having to go to disk and blocking the restore_write(). Added: vendor-sys/illumos/dist/uts/common/fs/zfs/bqueue.c (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bqueue.h (contents, props changed) vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_priority.h (contents, props changed) Modified: vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_object.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_zfetch.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_checksum.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Modified: vendor-sys/illumos/dist/uts/common/Makefile.files == --- vendor-sys/illumos/dist/uts/common/Makefile.files Wed Aug 12 22:09:58 2015(r286703) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Wed Aug 12 22:36:02 2015(r286704) @@ -21,7 +21,9 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2012 Joyent, Inc. All rights reserved. +# Copyright (c) 2011, 2014 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # Copyright 2014 Nexenta Systems, Inc. All rights reserved. # @@ -1332,6 +1334,7 @@ ZFS_COMMON_OBJS +=\ bplist.o\ bpobj.o \ bptree.o\ + bqueue.o\ dbuf.o \ ddt.o \ ddt_zap.o \ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Wed Aug 12 22:09:58 2015(r286703) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Wed Aug 12 22:36:02 2015(r286704) @@ -154,7 +154,7 @@ bptree_visit_cb(spa_t *spa, zilog_t *zil int err; struct bptree_args *ba = arg; - if (BP_IS_HOLE(bp)) + if (bp == NULL || BP_IS_HOLE(bp)) return (0); err = ba->ba_func(ba->ba_arg, bp, ba->ba_tx); Added: vendor-sys/illumos/dist/uts/common/fs/zfs/bqueue.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bqueue.c Wed Aug 12 22:36:02 2015(r286704) @@ -0,0 +1,111 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance wi
svn commit: r286703 - head/sys/ofed/drivers/infiniband/core
Author: np Date: Wed Aug 12 22:09:58 2015 New Revision: 286703 URL: https://svnweb.freebsd.org/changeset/base/286703 Log: Reinstate unify_tcp_port_space and associated code that was lost during the last OFED update (r278886). iWARP on FreeBSD is properly integrated with the network stack and the iWARP drivers _never_ operate out of any private TCP port-space that is invisible to the kernel. Instead, an iWARP connection shows up as a TCP socket (which is what it is) fully visible to the kernel and standard tools like netstat, sockstat, etc. Modified: head/sys/ofed/drivers/infiniband/core/cma.c Modified: head/sys/ofed/drivers/infiniband/core/cma.c == --- head/sys/ofed/drivers/infiniband/core/cma.c Wed Aug 12 21:07:57 2015 (r286702) +++ head/sys/ofed/drivers/infiniband/core/cma.c Wed Aug 12 22:09:58 2015 (r286703) @@ -72,6 +72,11 @@ static int def_prec2sl = 3; module_param_named(def_prec2sl, def_prec2sl, int, 0644); MODULE_PARM_DESC(def_prec2sl, "Default value for SL priority with RoCE. Valid values 0 - 7"); +static int unify_tcp_port_space = 1; +module_param(unify_tcp_port_space, int, 0644); +MODULE_PARM_DESC(unify_tcp_port_space, "Unify the host TCP and RDMA port " +"space allocation (default=1)"); + static int debug_level = 0; #define cma_pr(level, priv, format, arg...)\ printk(level "CMA: %p: %s: " format, ((struct rdma_id_priv *) priv) , __func__, ## arg) @@ -957,6 +962,8 @@ static void cma_release_port(struct rdma kfree(bind_list); } mutex_unlock(&lock); + if (id_priv->sock) + sock_release(id_priv->sock); } static void cma_leave_mc_groups(struct rdma_id_private *id_priv) @@ -2449,6 +2456,42 @@ static int cma_bind_listen(struct rdma_i return ret; } +static int cma_get_tcp_port(struct rdma_id_private *id_priv) +{ + int ret; + int size; + struct socket *sock; + + ret = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); + if (ret) + return ret; +#ifdef __linux__ + ret = sock->ops->bind(sock, + (struct sockaddr *) &id_priv->id.route.addr.src_addr, + ip_addr_size((struct sockaddr *) &id_priv->id.route.addr.src_addr)); +#else + ret = -sobind(sock, + (struct sockaddr *)&id_priv->id.route.addr.src_addr, + curthread); +#endif + if (ret) { + sock_release(sock); + return ret; + } + + size = ip_addr_size((struct sockaddr *) &id_priv->id.route.addr.src_addr); + ret = sock_getname(sock, + (struct sockaddr *) &id_priv->id.route.addr.src_addr, + &size, 0); + if (ret) { + sock_release(sock); + return ret; + } + + id_priv->sock = sock; + return 0; +} + static int cma_get_port(struct rdma_id_private *id_priv) { struct idr *ps; @@ -2460,6 +2503,11 @@ static int cma_get_port(struct rdma_id_p break; case RDMA_PS_TCP: ps = &tcp_ps; + if (unify_tcp_port_space) { + ret = cma_get_tcp_port(id_priv); + if (ret) + goto out; + } break; case RDMA_PS_UDP: ps = &udp_ps; @@ -2480,7 +2528,7 @@ static int cma_get_port(struct rdma_id_p else ret = cma_use_port(ps, id_priv); mutex_unlock(&lock); - +out: return ret; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286702 - head/sbin/ipfw
Author: dim Date: Wed Aug 12 21:07:57 2015 New Revision: 286702 URL: https://svnweb.freebsd.org/changeset/base/286702 Log: In ipfw2, avoid left-shifting negative integers, which is undefined. While here, make some other arguments to htonl(3) unsigned too. MFC after:3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c == --- head/sbin/ipfw/ipfw2.c Wed Aug 12 20:50:20 2015(r286701) +++ head/sbin/ipfw/ipfw2.c Wed Aug 12 21:07:57 2015(r286702) @@ -2869,14 +2869,14 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int case '/': masklen = atoi(p); if (masklen == 0) - d[1] = htonl(0);/* mask */ + d[1] = htonl(0U); /* mask */ else if (masklen > 32) errx(EX_DATAERR, "bad width ``%s''", p); else - d[1] = htonl(~0 << (32 - masklen)); + d[1] = htonl(~0U << (32 - masklen)); break; case '{': /* no mask, assume /24 and put back the '{' */ - d[1] = htonl(~0 << (32 - 24)); + d[1] = htonl(~0U << (32 - 24)); *(--p) = md; break; @@ -2885,7 +2885,7 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int /* FALLTHROUGH */ case 0: /* initialization value */ default: - d[1] = htonl(~0); /* force /32 */ + d[1] = htonl(~0U); /* force /32 */ break; } d[0] &= d[1]; /* mask base address with mask */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286701 - in head: share/man/man4 sys/kern
Author: ian Date: Wed Aug 12 20:50:20 2015 New Revision: 286701 URL: https://svnweb.freebsd.org/changeset/base/286701 Log: If a specific timecounter has been chosen via sysctl, and a new timecounter with higher quality registers (presumably in a module that has just been loaded), do not undo the user's choice by switching to the new timecounter. Document that behavior, and also the fact that there is no way to unregister a timecounter (and thus no way to unload a module containing one). Modified: head/share/man/man4/timecounters.4 head/sys/kern/kern_tc.c Modified: head/share/man/man4/timecounters.4 == --- head/share/man/man4/timecounters.4 Wed Aug 12 20:21:04 2015 (r286700) +++ head/share/man/man4/timecounters.4 Wed Aug 12 20:50:20 2015 (r286701) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 12, 2014 +.Dd August 12, 2015 .Dt TIMECOUNTERS 4 .Os .Sh NAME @@ -96,10 +96,16 @@ compared to others. A negative value means this time counter is broken and should not be used. .El .Pp -The time management code of the kernel chooses one time counter from that list. -The current choice can be read and affected via the +The time management code of the kernel automatically switches to a +higher-quality time counter when it registers, unless the .Va kern.timecounter.hardware -tunable/sysctl. +sysctl has been used to choose a specific device. +.Pp +There is no way to unregister a time counter once it has registered +with the kernel. +If a dynamically loaded module contains a time counter you will not +be able to unload that module, even if the time counter it contains +is not the one currently in use. .Sh SEE ALSO .Xr attimer 4 , .Xr eventtimers 4 , Modified: head/sys/kern/kern_tc.c == --- head/sys/kern/kern_tc.c Wed Aug 12 20:21:04 2015(r286700) +++ head/sys/kern/kern_tc.c Wed Aug 12 20:50:20 2015(r286701) @@ -133,6 +133,8 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, sysctl_kern_timecounter_adjprecision, "I", "Allowed time interval deviation in percents"); +static int tc_chosen; /* Non-zero if a specific tc was chosen via sysctl. */ + static void tc_windup(void); static void cpu_tick_calibrate(int); @@ -1197,10 +1199,13 @@ tc_init(struct timecounter *tc) "quality", CTLFLAG_RD, &(tc->tc_quality), 0, "goodness of time counter"); /* -* Never automatically use a timecounter with negative quality. +* Do not automatically switch if the current tc was specifically +* chosen. Never automatically use a timecounter with negative quality. * Even though we run on the dummy counter, switching here may be -* worse since this timecounter may not be monotonous. +* worse since this timecounter may not be monotonic. */ + if (tc_chosen) + return; if (tc->tc_quality < 0) return; if (tc->tc_quality < timecounter->tc_quality) @@ -1433,9 +1438,12 @@ sysctl_kern_timecounter_hardware(SYSCTL_ strlcpy(newname, tc->tc_name, sizeof(newname)); error = sysctl_handle_string(oidp, &newname[0], sizeof(newname), req); - if (error != 0 || req->newptr == NULL || - strcmp(newname, tc->tc_name) == 0) + if (error != 0 || req->newptr == NULL) return (error); + /* Record that the tc in use now was specifically chosen. */ + tc_chosen = 1; + if (strcmp(newname, tc->tc_name) == 0) + return (0); for (newtc = timecounters; newtc != NULL; newtc = newtc->tc_next) { if (strcmp(newname, newtc->tc_name) != 0) continue; @@ -1464,7 +1472,7 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, "Timecounter hardware selected"); -/* Report or change the active timecounter hardware. */ +/* Report the available timecounter hardware. */ static int sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286700 - in head: sbin/ifconfig sys/net
Author: hiren Date: Wed Aug 12 20:21:04 2015 New Revision: 286700 URL: https://svnweb.freebsd.org/changeset/base/286700 Log: Make LAG LACP fast timeout tunable through IOCTL. Differential Revision:D3300 Submitted by: LN Sundararajan Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas MFC after:2 weeks Sponsored by: Panasas Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/iflagg.c head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/ifconfig.8 == --- head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:16:13 2015 (r286699) +++ head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:21:04 2015 (r286700) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 15, 2015 +.Dd Aug 12, 2015 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2396,6 +2396,10 @@ Disable local hash computation for RSS h Set a shift parameter for RSS local hash computation. Hash is calculated by using flowid bits in a packet header mbuf which are shifted by the number of this parameter. +.It Cm lacp_fast_timeout +Enable lacp fast-timeout on the interface. +.It Cm -lacp_fast_timeout +Disable lacp fast-timeout on the interface. .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: head/sbin/ifconfig/iflagg.c == --- head/sbin/ifconfig/iflagg.c Wed Aug 12 20:16:13 2015(r286699) +++ head/sbin/ifconfig/iflagg.c Wed Aug 12 20:21:04 2015(r286700) @@ -115,6 +115,8 @@ setlaggsetopt(const char *val, int d, in case -LAGG_OPT_LACP_TXTEST: case LAGG_OPT_LACP_RXTEST: case -LAGG_OPT_LACP_RXTEST: + case LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_TIMEOUT: break; default: err(1, "Invalid lagg option"); @@ -293,6 +295,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), + DEF_CMD("lacp_fast_timeout",LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), DEF_CMD_ARG("flowid_shift", setlaggflowidshift), }; static struct afswtch af_lagg = { Modified: head/sys/net/ieee8023ad_lacp.c == --- head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:16:13 2015 (r286699) +++ head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:21:04 2015 (r286700) @@ -522,7 +522,7 @@ lacp_port_create(struct lagg_port *lgp) int error; boolean_t active = TRUE; /* XXX should be configurable */ - boolean_t fast = FALSE; /* XXX should be configurable */ + boolean_t fast = FALSE; /* Configurable via ioctl */ link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER); sdl.sdl_alen = ETHER_ADDR_LEN; Modified: head/sys/net/ieee8023ad_lacp.h == --- head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:16:13 2015 (r286699) +++ head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:21:04 2015 (r286700) @@ -251,6 +251,7 @@ struct lacp_softc { u_int32_t lsc_tx_test; } lsc_debug; u_int32_t lsc_strict_mode; + boolean_t lsc_fast_timeout; /* if set, fast timeout */ }; #defineLACP_TYPE_ACTORINFO 1 Modified: head/sys/net/if_lagg.c == --- head/sys/net/if_lagg.c Wed Aug 12 20:16:13 2015(r286699) +++ head/sys/net/if_lagg.c Wed Aug 12 20:21:04 2015(r286700) @@ -1257,6 +1257,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd ro->ro_opts |= LAGG_OPT_LACP_RXTEST; if (lsc->lsc_strict_mode != 0) ro->ro_opts |= LAGG_OPT_LACP_STRICT; + if (lsc->lsc_fast_timeout != 0) + ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; ro->ro_active = sc->sc_active; } else { @@ -1292,6 +1294,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd case -LAGG_OPT_LACP_RXTEST: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: + case LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_TIMEOUT: valid = lacp = 1; break; default: @@ -1320,6 +1324,7 @@ lagg_ioctl(struct ifnet *ifp, u_long
Re: svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
> On Aug 12, 2015, at 1:17 PM, Ed Schouten wrote: > > 2015-08-12 22:02 GMT+02:00 Marcel Moolenaar : >> Maybe upgrading to 4.3.30 resolves the issue? > > I just upgraded to 4.3.30 and 5.0.0. Both fail the same way. I've just > attached a screenshot. Will open a bug. Thanks! -- Marcel Moolenaar mar...@xcllnt.net signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
2015-08-12 22:02 GMT+02:00 Marcel Moolenaar : > Maybe upgrading to 4.3.30 resolves the issue? I just upgraded to 4.3.30 and 5.0.0. Both fail the same way. I've just attached a screenshot. Will open a bug. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286699 - head/contrib/gcclibs/libcpp
Author: dim Date: Wed Aug 12 20:16:13 2015 New Revision: 286699 URL: https://svnweb.freebsd.org/changeset/base/286699 Log: In gcc's libcpp, stop using the INTTYPE_MAXIMUM() macro, which relies on undefined behavior. The code used this macro to avoid problems on some broken systems which define SSIZE_MAX incorrectly, but this is not needed on FreeBSD, obviously. MFC after: 3 days Modified: head/contrib/gcclibs/libcpp/files.c Modified: head/contrib/gcclibs/libcpp/files.c == --- head/contrib/gcclibs/libcpp/files.c Wed Aug 12 20:08:54 2015 (r286698) +++ head/contrib/gcclibs/libcpp/files.c Wed Aug 12 20:16:13 2015 (r286699) @@ -567,7 +567,7 @@ read_file_guts (cpp_reader *pfile, _cpp_ SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ - if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) + if (file->st.st_size > SSIZE_MAX) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path); return false; @@ -581,7 +581,7 @@ read_file_guts (cpp_reader *pfile, _cpp_ file->path); return false; } - else if (offset > INTTYPE_MAXIMUM (ssize_t) || (ssize_t)offset > size) + else if (offset > SSIZE_MAX || (ssize_t)offset > size) { cpp_error (pfile, CPP_DL_ERROR, "current position of %s is too large", file->path); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286698 - head/sys/kern
Author: oshogbo Date: Wed Aug 12 20:08:54 2015 New Revision: 286698 URL: https://svnweb.freebsd.org/changeset/base/286698 Log: When the wait*(2) syscalls wait for any process (P_ALL), they should ignore processes created with the pdfork(2) syscall. PR: 201054 Approved by: pjd (mentor) Discussed with: emaste, rwatson Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c == --- head/sys/kern/kern_exit.c Wed Aug 12 19:48:49 2015(r286697) +++ head/sys/kern/kern_exit.c Wed Aug 12 20:08:54 2015(r286698) @@ -981,6 +981,10 @@ proc_to_reap(struct thread *td, struct p switch (idtype) { case P_ALL: + if (p->p_procdesc != NULL) { + PROC_UNLOCK(p); + return (0); + } break; case P_PID: if (p->p_pid != (pid_t)id) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
> On Aug 12, 2015, at 10:37 AM, Ed Schouten wrote: > > Hi Marcel, > > 2015-08-12 17:26 GMT+02:00 Marcel Moolenaar : >> Better support memory mapped console devices, such as VGA and EFI >> frame buffers and memory mapped UARTs. > > This change causes my FreeBSD instance in Virtualbox 4.3.28 (OS X) to > crash. As soon as the kernel initializes the graphics on startup > (read: before printing any messages), I see random garbage appear on > screen, followed by a popup dialog from Virtualbox that a fatal > machine exception has occurred. No problems are seen with VB 5.0 on Mac OS X and having BIOS (don’t know if VB even supports UEFI) and with FreeBSD/amd64. Maybe upgrading to 4.3.30 resolves the issue? -- Marcel Moolenaar mar...@xcllnt.net signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r286696 - head/sys/arm/ti/am335x
Author: ian Date: Wed Aug 12 19:40:32 2015 New Revision: 286696 URL: https://svnweb.freebsd.org/changeset/base/286696 Log: Remove all dregs of the old PPS driver from this code, in preparation for redoing it as a separate driver. Now that each hardware timer is handled by a separate instance of the timer driver, it no longer makes sense to bundle the pps driver with the regular timecounter code. (When all 8 timers were handled by one driver there was no choice about this.) Split the hardware register definitions out to their own file, so that the new pps driver (coming in a separate commit later) can share them. With the PPS driver gone, the question of which hardware timer to use for what purpose becomes much easier (some instances can't do the PPS capture). Now we can just hardcore timer2 for eventtimer and timer3 for timecounter. This also now only instantiates devices for the 2 hardware timers actually used to implement eventtimer and timecounter. This is required so that other drivers can come along and attach to other hardware timers to provide other functionality. (In addition to PPS, this hardware can also do PWM stuff, general pulse width and frequency measurements, etc. Maybe some day we'll have drivers for those things.) Added: head/sys/arm/ti/am335x/am335x_dmtreg.h (contents, props changed) Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c == --- head/sys/arm/ti/am335x/am335x_dmtimer.c Wed Aug 12 19:39:11 2015 (r286695) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Wed Aug 12 19:40:32 2015 (r286696) @@ -30,79 +30,22 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include -#include #include -#include #include -#include #include -#include -#include -#include "opt_ntp.h" - -#include #include #include #include -#include - #include #include -#include -#defineAM335X_NUM_TIMERS 8 - -#defineDMT_TIDR0x00/* Identification Register */ -#defineDMT_TIOCP_CFG 0x10/* OCP Configuration Reg */ -#define DMT_TIOCP_RESET (1 << 0) /* TIOCP perform soft reset */ -#defineDMT_IQR_EOI 0x20/* IRQ End-Of-Interrupt Reg */ -#defineDMT_IRQSTATUS_RAW 0x24/* IRQSTATUS Raw Reg */ -#defineDMT_IRQSTATUS 0x28/* IRQSTATUS Reg */ -#defineDMT_IRQENABLE_SET 0x2c/* IRQSTATUS Set Reg */ -#defineDMT_IRQENABLE_CLR 0x30/* IRQSTATUS Clear Reg */ -#defineDMT_IRQWAKEEN 0x34/* IRQ Wakeup Enable Reg */ -#define DMT_IRQ_MAT (1 << 0) /* IRQ: Match */ -#define DMT_IRQ_OVF (1 << 1) /* IRQ: Overflow */ -#define DMT_IRQ_TCAR(1 << 2) /* IRQ: Capture */ -#define DMT_IRQ_MASK(DMT_IRQ_TCAR | DMT_IRQ_OVF | DMT_IRQ_MAT) -#defineDMT_TCLR0x38/* Control Register */ -#define DMT_TCLR_START (1 << 0) /* Start timer */ -#define DMT_TCLR_AUTOLOAD (1 << 1) /* Auto-reload on overflow */ -#define DMT_TCLR_PRES_MASK (7 << 2) /* Prescaler mask */ -#define DMT_TCLR_PRES_ENABLE(1 << 5) /* Prescaler enable */ -#define DMT_TCLR_COMP_ENABLE(1 << 6) /* Compare enable */ -#define DMT_TCLR_PWM_HIGH (1 << 7) /* PWM default output high */ -#define DMT_TCLR_CAPTRAN_MASK (3 << 8) /* Capture transition mask */ -#define DMT_TCLR_CAPTRAN_NONE (0 << 8) /* Capture: none */ -#define DMT_TCLR_CAPTRAN_LOHI (1 << 8) /* Capture lo->hi transition */ -#define DMT_TCLR_CAPTRAN_HILO (2 << 8) /* Capture hi->lo transition */ -#define DMT_TCLR_CAPTRAN_BOTH (3 << 8) /* Capture both transitions */ -#define DMT_TCLR_TRGMODE_MASK (3 << 10) /* Trigger output mode mask */ -#define DMT_TCLR_TRGMODE_NONE (0 << 10) /* Trigger off */ -#define DMT_TCLR_TRGMODE_OVFL (1 << 10) /* Trigger on overflow */ -#define DMT_TCLR_TRGMODE_BOTH (2 << 10) /* Trigger on match + ovflow */ -#define DMT_TCLR_PWM_PTOGGLE(1 << 12) /* PWM toggles */ -#define DMT_TCLR_CAP_MODE_2ND (1 << 13) /* Capture second event mode */ -#define DMT_TCLR_GPO_CFG(1 << 14) /* (no descr in datasheet) */ -#defineDMT_TCRR0x3C/* Counter Register */ -#defineDMT_TLDR0x40/* Load Reg */ -#defineDMT_TTGR0x44/* Trigger Reg */ -#defineD
svn commit: r286695 - head
Author: imp Date: Wed Aug 12 19:39:11 2015 New Revision: 286695 URL: https://svnweb.freebsd.org/changeset/base/286695 Log: Fix the fixing of the build I broke. rescue/rescue has the right target, but rescue doesn't. Pointy hat: imp@ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed Aug 12 19:35:35 2015(r286694) +++ head/Makefile.inc1 Wed Aug 12 19:39:11 2015(r286695) @@ -1439,7 +1439,7 @@ _gcc_tools= gnu/usr.bin/cc/cc_tools .if ${MK_RESCUE} != "no" # rescue includes programs that have build-tools targets -_rescue=rescue +_rescue=rescue/rescue .endif build-tools: .MAKE ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286693 - head/sys/arm/ti
Author: ian Date: Wed Aug 12 19:26:36 2015 New Revision: 286693 URL: https://svnweb.freebsd.org/changeset/base/286693 Log: Remove a bogus printf that whines every time loading a driver module triggers a fresh round of probing. Modified: head/sys/arm/ti/ti_scm.c Modified: head/sys/arm/ti/ti_scm.c == --- head/sys/arm/ti/ti_scm.cWed Aug 12 19:25:22 2015(r286692) +++ head/sys/arm/ti/ti_scm.cWed Aug 12 19:26:36 2015(r286693) @@ -96,8 +96,6 @@ ti_scm_probe(device_t dev) return (ENXIO); if (ti_scm_sc) { - printf("%s: multiple SCM modules in device tree data, ignoring\n", - __func__); return (EEXIST); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286692 - head/sys/arm/ti/am335x
Author: ian Date: Wed Aug 12 19:25:22 2015 New Revision: 286692 URL: https://svnweb.freebsd.org/changeset/base/286692 Log: Add a MODULE_VERSION(), because other things MODULE_DEPEND() on this. Modified: head/sys/arm/ti/am335x/am335x_prcm.c Modified: head/sys/arm/ti/am335x/am335x_prcm.c == --- head/sys/arm/ti/am335x/am335x_prcm.cWed Aug 12 19:21:58 2015 (r286691) +++ head/sys/arm/ti/am335x/am335x_prcm.cWed Aug 12 19:25:22 2015 (r286692) @@ -456,6 +456,7 @@ static devclass_t am335x_prcm_devclass; DRIVER_MODULE(am335x_prcm, simplebus, am335x_prcm_driver, am335x_prcm_devclass, 0, 0); +MODULE_VERSION(am335x_prcm, 1); MODULE_DEPEND(am335x_prcm, ti_scm, 1, 1, 1); static struct am335x_clk_details* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286691 - head
Author: delphij Date: Wed Aug 12 19:21:58 2015 New Revision: 286691 URL: https://svnweb.freebsd.org/changeset/base/286691 Log: Fix build. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed Aug 12 19:18:54 2015(r286690) +++ head/Makefile.inc1 Wed Aug 12 19:21:58 2015(r286691) @@ -1449,7 +1449,7 @@ build-tools: .MAKE ${LOCAL_TOOL_DIRS} \ lib/ncurses/ncurses \ lib/ncurses/ncursesw \ -${_rescue} +${_rescue} \ ${_share} \ usr.bin/awk \ lib/libmagic \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286690 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config
Author: dim Date: Wed Aug 12 19:18:54 2015 New Revision: 286690 URL: https://svnweb.freebsd.org/changeset/base/286690 Log: MFC r286519: In GNU as, avoid left-shifting negative integers, which is undefined. Modified: stable/10/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/binutils/gas/config/tc-i386.c stable/8/contrib/binutils/gas/config/tc-i386.c stable/9/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/7/ (props changed) stable/7/contrib/binutils/ (props changed) stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-i386.c == --- stable/10/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:10:29 2015(r286689) +++ stable/10/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:18:54 2015(r286690) @@ -914,8 +914,8 @@ fits_in_signed_long (offsetT num ATTRIBU #ifndef BFD64 return 1; #else - return (!(((offsetT) -1 << 31) & num) - || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); + return (!(-((offsetT) 1 << 31) & num) + || (-((offsetT) 1 << 31) & num) == -((offsetT) 1 << 31)); #endif } /* fits_in_signed_long() */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286690 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config
Author: dim Date: Wed Aug 12 19:18:54 2015 New Revision: 286690 URL: https://svnweb.freebsd.org/changeset/base/286690 Log: MFC r286519: In GNU as, avoid left-shifting negative integers, which is undefined. Modified: stable/8/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-i386.c stable/7/contrib/binutils/gas/config/tc-i386.c stable/9/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/10/ (props changed) stable/7/ (props changed) stable/7/contrib/binutils/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/gas/config/tc-i386.c == --- stable/8/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:10:29 2015(r286689) +++ stable/8/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:18:54 2015(r286690) @@ -610,8 +610,8 @@ fits_in_signed_long (num) #ifndef BFD64 return 1; #else - return (!(((offsetT) -1 << 31) & num) - || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); + return (!(-((offsetT) 1 << 31) & num) + || (-((offsetT) 1 << 31) & num) == -((offsetT) 1 << 31)); #endif } /* fits_in_signed_long() */ static INLINE int ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286690 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config
Author: dim Date: Wed Aug 12 19:18:54 2015 New Revision: 286690 URL: https://svnweb.freebsd.org/changeset/base/286690 Log: MFC r286519: In GNU as, avoid left-shifting negative integers, which is undefined. Modified: stable/9/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-i386.c stable/7/contrib/binutils/gas/config/tc-i386.c stable/8/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/10/ (props changed) stable/7/ (props changed) stable/7/contrib/binutils/ (props changed) stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/gas/config/tc-i386.c == --- stable/9/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:10:29 2015(r286689) +++ stable/9/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:18:54 2015(r286690) @@ -914,8 +914,8 @@ fits_in_signed_long (offsetT num ATTRIBU #ifndef BFD64 return 1; #else - return (!(((offsetT) -1 << 31) & num) - || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); + return (!(-((offsetT) 1 << 31) & num) + || (-((offsetT) 1 << 31) & num) == -((offsetT) 1 << 31)); #endif } /* fits_in_signed_long() */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286690 - in stable: 10/contrib/binutils/gas/config 7/contrib/binutils/gas/config 8/contrib/binutils/gas/config 9/contrib/binutils/gas/config
Author: dim Date: Wed Aug 12 19:18:54 2015 New Revision: 286690 URL: https://svnweb.freebsd.org/changeset/base/286690 Log: MFC r286519: In GNU as, avoid left-shifting negative integers, which is undefined. Modified: stable/7/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/7/ (props changed) stable/7/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/gas/config/tc-i386.c stable/8/contrib/binutils/gas/config/tc-i386.c stable/9/contrib/binutils/gas/config/tc-i386.c Directory Properties: stable/10/ (props changed) stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/7/contrib/binutils/gas/config/tc-i386.c == --- stable/7/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:10:29 2015(r286689) +++ stable/7/contrib/binutils/gas/config/tc-i386.c Wed Aug 12 19:18:54 2015(r286690) @@ -610,8 +610,8 @@ fits_in_signed_long (num) #ifndef BFD64 return 1; #else - return (!(((offsetT) -1 << 31) & num) - || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31)); + return (!(-((offsetT) 1 << 31) & num) + || (-((offsetT) 1 << 31) & num) == -((offsetT) 1 << 31)); #endif } /* fits_in_signed_long() */ static INLINE int ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286689 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Author: mav Date: Wed Aug 12 19:10:29 2015 New Revision: 286689 URL: https://svnweb.freebsd.org/changeset/base/286689 Log: MFV r284763: 5981 Deadlock in dmu_objset_find_dp illumos/illumos-gate@1d3f896f5469c69c1339890ec3d68e9feddb0343 https://www.illumos.org/issues/5981 When dmu_objset_find_dp gets called with a read lock held, it fans out the work to the task queue. Each task in turn acquires its own read lock before calling the callback. If during this process anyone tries to a acquire a write lock, it will stall all read lock requests.Thus the tasks will never finish, the read lock of the caller will never get freed and the write lock never acquired. deadlock. Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Robert Mustacchi Author: Arne Jansen Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cWed Aug 12 19:06:35 2015(r286688) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cWed Aug 12 19:10:29 2015(r286689) @@ -1746,7 +1746,15 @@ dmu_objset_find_dp_cb(void *arg) dmu_objset_find_ctx_t *dcp = arg; dsl_pool_t *dp = dcp->dc_dp; - dsl_pool_config_enter(dp, FTAG); + /* +* We need to get a pool_config_lock here, as there are several +* asssert(pool_config_held) down the stack. Getting a lock via +* dsl_pool_config_enter is risky, as it might be stalled by a +* pending writer. This would deadlock, as the write lock can +* only be granted when our parent thread gives up the lock. +* The _prio interface gives us priority over a pending writer. +*/ + dsl_pool_config_enter_prio(dp, FTAG); dmu_objset_find_dp_impl(dcp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Aug 12 19:06:35 2015(r286688) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Aug 12 19:10:29 2015(r286689) @@ -1139,6 +1139,13 @@ dsl_pool_config_enter(dsl_pool_t *dp, vo } void +dsl_pool_config_enter_prio(dsl_pool_t *dp, void *tag) +{ + ASSERT(!rrw_held(&dp->dp_config_rwlock, RW_READER)); + rrw_enter_read_prio(&dp->dp_config_rwlock, tag); +} + +void dsl_pool_config_exit(dsl_pool_t *dp, void *tag) { rrw_exit(&dp->dp_config_rwlock, tag); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Wed Aug 12 19:06:35 2015(r286688) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Wed Aug 12 19:10:29 2015(r286689) @@ -159,8 +159,8 @@ rrw_destroy(rrwlock_t *rrl) refcount_destroy(&rrl->rr_linked_rcount); } -void -rrw_enter_read(rrwlock_t *rrl, void *tag) +static void +rrw_enter_read_impl(rrwlock_t *rrl, boolean_t prio, void *tag) { mutex_enter(&rrl->rr_lock); #if !defined(DEBUG) && defined(_KERNEL) @@ -176,7 +176,7 @@ rrw_enter_read(rrwlock_t *rrl, void *tag ASSERT(refcount_count(&rrl->rr_anon_rcount) >= 0); while (rrl->rr_writer != NULL || (rrl->rr_writer_wanted && - refcount_is_zero(&rrl->rr_anon_rcount) && + refcount_is_zero(&rrl->rr_anon_rcount) && !prio && rrn_find(rrl) == NULL)) cv_wait(&rrl->rr_cv, &rrl->rr_lock); @@ -192,6 +192,25 @@ rrw_enter_read(rrwlock_t *rrl, void *tag } void +rrw_enter_read(rrwlock_t *rrl, void *tag) +{ + rrw_enter_read_impl(rrl, B_FALSE, tag); +} + +/* + * take a read lock even if there are pending write lock requests. if we want + * to take a lock reentrantly, but from different threads (that have a + * relationship to each other), the normal detection mechanism to overrule + * the pending writer does not work, so we have to give an explicit hint here. + */ +void +rrw_enter_read_prio(rrwlock_t *rrl, void *tag) +{ + rrw_enter_read_impl(rrl, B_TRUE, tag); +} + + +void rrw_enter_write(rrwlock_t *rrl) { mutex_enter(&rrl->rr_lock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
svn commit: r286688 - in stable: 10/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Wed Aug 12 19:06:35 2015 New Revision: 286688 URL: https://svnweb.freebsd.org/changeset/base/286688 Log: MFC r286515: In libm's exp2(3), avoid left-shifting a negative integer, which is undefined. Replace it with the intended value, in a defined way. Reviewed by: bde Modified: stable/10/lib/msun/src/s_exp2.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/msun/src/s_exp2.c stable/9/lib/msun/src/s_exp2.c Directory Properties: stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/10/lib/msun/src/s_exp2.c == --- stable/10/lib/msun/src/s_exp2.c Wed Aug 12 19:00:47 2015 (r286687) +++ stable/10/lib/msun/src/s_exp2.c Wed Aug 12 19:06:35 2015 (r286688) @@ -376,14 +376,14 @@ exp2(double x) /* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */ t = tbl[i0];/* exp2t[i0] */ z -= tbl[i0 + 1]; /* eps[i0] */ - if (k >= -1021 << 20) + if (k >= -(1021 << 20)) INSERT_WORDS(twopk, 0x3ff0 + k, 0); else INSERT_WORDS(twopkp1000, 0x3ff0 + k + (1000 << 20), 0); r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5; /* Scale by 2**(k>>20). */ - if(k >= -1021 << 20) { + if(k >= -(1021 << 20)) { if (k == 1024 << 20) return (r * 2.0 * 0x1p1023); return (r * twopk); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286688 - in stable: 10/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Wed Aug 12 19:06:35 2015 New Revision: 286688 URL: https://svnweb.freebsd.org/changeset/base/286688 Log: MFC r286515: In libm's exp2(3), avoid left-shifting a negative integer, which is undefined. Replace it with the intended value, in a defined way. Reviewed by: bde Modified: stable/9/lib/msun/src/s_exp2.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/msun/src/s_exp2.c stable/8/lib/msun/src/s_exp2.c Directory Properties: stable/10/ (props changed) stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/s_exp2.c == --- stable/9/lib/msun/src/s_exp2.c Wed Aug 12 19:00:47 2015 (r286687) +++ stable/9/lib/msun/src/s_exp2.c Wed Aug 12 19:06:35 2015 (r286688) @@ -375,14 +375,14 @@ exp2(double x) /* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */ t = tbl[i0];/* exp2t[i0] */ z -= tbl[i0 + 1]; /* eps[i0] */ - if (k >= -1021 << 20) + if (k >= -(1021 << 20)) INSERT_WORDS(twopk, 0x3ff0 + k, 0); else INSERT_WORDS(twopkp1000, 0x3ff0 + k + (1000 << 20), 0); r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5; /* Scale by 2**(k>>20). */ - if(k >= -1021 << 20) { + if(k >= -(1021 << 20)) { if (k == 1024 << 20) return (r * 2.0 * 0x1p1023); return (r * twopk); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286688 - in stable: 10/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Wed Aug 12 19:06:35 2015 New Revision: 286688 URL: https://svnweb.freebsd.org/changeset/base/286688 Log: MFC r286515: In libm's exp2(3), avoid left-shifting a negative integer, which is undefined. Replace it with the intended value, in a defined way. Reviewed by: bde Modified: stable/8/lib/msun/src/s_exp2.c Directory Properties: stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/msun/src/s_exp2.c stable/9/lib/msun/src/s_exp2.c Directory Properties: stable/10/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/8/lib/msun/src/s_exp2.c == --- stable/8/lib/msun/src/s_exp2.c Wed Aug 12 19:00:47 2015 (r286687) +++ stable/8/lib/msun/src/s_exp2.c Wed Aug 12 19:06:35 2015 (r286688) @@ -375,14 +375,14 @@ exp2(double x) /* Compute r = exp2(y) = exp2t[i0] * p(z - eps[i]). */ t = tbl[i0];/* exp2t[i0] */ z -= tbl[i0 + 1]; /* eps[i0] */ - if (k >= -1021 << 20) + if (k >= -(1021 << 20)) INSERT_WORDS(twopk, 0x3ff0 + k, 0); else INSERT_WORDS(twopkp1000, 0x3ff0 + k + (1000 << 20), 0); r = t + t * z * (P1 + z * (P2 + z * (P3 + z * (P4 + z * P5; /* Scale by 2**(k>>20). */ - if(k >= -1021 << 20) { + if(k >= -(1021 << 20)) { if (k == 1024 << 20) return (r * 2.0 * 0x1p1023); return (r * twopk); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286687 - head
Author: imp Date: Wed Aug 12 19:00:47 2015 New Revision: 286687 URL: https://svnweb.freebsd.org/changeset/base/286687 Log: Document build-tools better. Add rescue back because it builds /bin/sh which has a build-tools target (see commit for how build-tools and cross-tools differ). Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed Aug 12 18:47:30 2015(r286686) +++ head/Makefile.inc1 Wed Aug 12 19:00:47 2015(r286687) @@ -219,11 +219,16 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t in # 2. build-tools stage [TMAKE] # This stage is responsible for creating the object # tree and building any tools that are needed during -# the build process. +# the build process. Some programs are listed during +# this phase because they build binaires to generate +# files needed to build these programs. This stage also +# builds the 'build-tools' target rather than 'all'. # 3. cross-tools stage [XMAKE] # This stage is responsible for creating any tools that # are needed for building the system. A cross-compiler is one -# of them. +# of them. This differs from build tools in two ways: +# 1. the 'all' target is built rather than 'build-tools' +# 2. these tools are installed into TMPPATH for stage 4. # 4. world stage [WMAKE] # This stage actually builds the world. # 5. install stage (optional) [IMAKE] @@ -1432,6 +1437,11 @@ _share= share/syscons/scrnmaps _gcc_tools= gnu/usr.bin/cc/cc_tools .endif +.if ${MK_RESCUE} != "no" +# rescue includes programs that have build-tools targets +_rescue=rescue +.endif + build-tools: .MAKE .for _tool in \ bin/csh \ @@ -1439,6 +1449,7 @@ build-tools: .MAKE ${LOCAL_TOOL_DIRS} \ lib/ncurses/ncurses \ lib/ncurses/ncursesw \ +${_rescue} ${_share} \ usr.bin/awk \ lib/libmagic \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286686 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Author: mav Date: Wed Aug 12 18:47:30 2015 New Revision: 286686 URL: https://svnweb.freebsd.org/changeset/base/286686 Log: MFV r284762: 5269 zpool import slow illumos/illumos-gate@12380e1e701fda28c9e9f32d01cafb54af279eb5 https://www.illumos.org/issues/5269 When importing a pool (at boot or with zpool import) with many filesystem, the process can take minutes. It doesn't matter whether the pool has been exported cleanly or uncleanly. The problem is that each dataset has its own log chain. On import, all datasets have to be checked if there are logs to replay. The idea is to speed up this process by paralellizing it. Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Dan McDonald Approved by: Dan McDonald Author: Arne Jansen Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cWed Aug 12 18:39:49 2015(r286685) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cWed Aug 12 18:47:30 2015(r286686) @@ -25,6 +25,7 @@ * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2015, STRATO AG, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -49,6 +50,7 @@ #include #include #include +#include /* * Needed to close a window in dnode_move() that allows the objset to be freed @@ -56,6 +58,16 @@ */ krwlock_t os_lock; +/* + * Tunable to overwrite the maximum number of threads for the parallization + * of dmu_objset_find_dp, needed to speed up the import of pools with many + * datasets. + * Default is 4 times the number of leaf vdevs. + */ +int dmu_find_threads = 0; + +static void dmu_objset_find_dp_cb(void *arg); + void dmu_objset_init(void) { @@ -504,6 +516,25 @@ dmu_objset_hold(const char *name, void * return (err); } +static int +dmu_objset_own_impl(dsl_dataset_t *ds, dmu_objset_type_t type, +boolean_t readonly, void *tag, objset_t **osp) +{ + int err; + + err = dmu_objset_from_ds(ds, osp); + if (err != 0) { + dsl_dataset_disown(ds, tag); + } else if (type != DMU_OST_ANY && type != (*osp)->os_phys->os_type) { + dsl_dataset_disown(ds, tag); + return (SET_ERROR(EINVAL)); + } else if (!readonly && dsl_dataset_is_snapshot(ds)) { + dsl_dataset_disown(ds, tag); + return (SET_ERROR(EROFS)); + } + return (err); +} + /* * dsl_pool must not be held when this is called. * Upon successful return, there will be a longhold on the dataset, @@ -525,21 +556,26 @@ dmu_objset_own(const char *name, dmu_obj dsl_pool_rele(dp, FTAG); return (err); } - - err = dmu_objset_from_ds(ds, osp); + err = dmu_objset_own_impl(ds, type, readonly, tag, osp); dsl_pool_rele(dp, FTAG); - if (err != 0) { - dsl_dataset_disown(ds, tag); - } else if (type != DMU_OST_ANY && type != (*osp)->os_phys->os_type) { - dsl_dataset_disown(ds, tag); - return (SET_ERROR(EINVAL)); - } else if (!readonly && ds->ds_is_snapshot) { - dsl_dataset_disown(ds, tag); - return (SET_ERROR(EROFS)); - } + return (err); } +int +dmu_objset_own_obj(dsl_pool_t *dp, uint64_t obj, dmu_objset_type_t type, +boolean_t readonly, void *tag, objset_t **osp) +{ + dsl_dataset_t *ds; + int err; + + err = dsl_dataset_own_obj(dp, obj, tag, &ds); + if (err != 0) + return (err); + + return (dmu_objset_own_impl(ds, type, readonly, tag, osp)); +} + void dmu_objset_rele(objset_t *os, void *tag) { @@ -1580,30 +1616,41 @@ dmu_dir_list_next(objset_t *os, int name return (0); } -/* - * Find objsets under and including ddobj, call func(ds) on each. - */ -int -dmu_objset_find_dp(dsl_pool_t *dp, uint64_t ddobj, -int func(dsl_pool_t *, dsl_dataset_t *, void
Re: svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
On Wed, Aug 12, 2015 at 03:26:32PM +, Marcel Moolenaar wrote: > Author: marcel > Date: Wed Aug 12 15:26:32 2015 > New Revision: 286667 > URL: https://svnweb.freebsd.org/changeset/base/286667 > > Log: > Better support memory mapped console devices, such as VGA and EFI > frame buffers and memory mapped UARTs. Thanks, that makes my laptop usable on FreeBSD: boot on EFI correctly then able to Use scfb Xorg driver instead of VESA (waiting for newer KMS this is a relief!) Thanks a lot. Bapt pgpN2buFSNZtq.pgp Description: PGP signature
svn commit: r286683 - in head: cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys
Author: mav Date: Wed Aug 12 18:23:08 2015 New Revision: 286683 URL: https://svnweb.freebsd.org/changeset/base/286683 Log: MFV r286682: 5765 add support for estimating send stream size with lzc_send_space when source is a bookmark Reviewed by: Matthew Ahrens Reviewed by: Christopher Siden Reviewed by: Steven Hartland Reviewed by: Bayard Bell Approved by: Albert Lee Author: Max Grossman illumos/illumos-gate@643da460c8ca583e39ce053081754e24087f84c8 Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c == --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 12 18:08:40 2015(r286682) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 12 18:23:08 2015(r286683) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -532,18 +532,30 @@ lzc_send(const char *snapname, const cha } /* - * If fromsnap is NULL, a full (non-incremental) stream will be estimated. + * "from" can be NULL, a snapshot, or a bookmark. + * + * If from is NULL, a full (non-incremental) stream will be estimated. This + * is calculated very efficiently. + * + * If from is a snapshot, lzc_send_space uses the deadlists attached to + * each snapshot to efficiently estimate the stream size. + * + * If from is a bookmark, the indirect blocks in the destination snapshot + * are traversed, looking for blocks with a birth time since the creation TXG of + * the snapshot this bookmark was created from. This will result in + * significantly more I/O and be less efficient than a send space estimation on + * an equivalent snapshot. */ int -lzc_send_space(const char *snapname, const char *fromsnap, uint64_t *spacep) +lzc_send_space(const char *snapname, const char *from, uint64_t *spacep) { nvlist_t *args; nvlist_t *result; int err; args = fnvlist_alloc(); - if (fromsnap != NULL) - fnvlist_add_string(args, "fromsnap", fromsnap); + if (from != NULL) + fnvlist_add_string(args, "from", from); err = lzc_ioctl(ZFS_IOC_SEND_SPACE, snapname, args, &result); nvlist_free(args); if (err == 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Aug 12 18:08:40 2015(r286682) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Aug 12 18:23:08 2015(r286683) @@ -856,6 +856,40 @@ dmu_send(const char *tosnap, const char return (err); } +static int +dmu_adjust_send_estimate_for_indirects(dsl_dataset_t *ds, uint64_t size, +uint64_t *sizep) +{ + int err; + /* +* Assume that space (both on-disk and in-stream) is dominated by +* data. We will adjust for indirect blocks and the copies property, +* but ignore per-object space used (eg, dnodes and DRR_OBJECT records). +*/ + + /* +* Subtract out approximate space used by indirect blocks. +* Assume most space is used by data blocks (non-indirect, non-dnode). +* Assume all blocks are recordsize. Assume ditto blocks and +* internal fragmentation counter out compression. +* +* Therefore, space used by indirect blocks is sizeof(blkptr_t) per +* block, which we observe in practice. +*/ + uint64_t recordsize; + err = dsl_prop_get_int_ds(ds, "recordsize", &recordsize); + if (err != 0) + return (err); + size -= size / recordsize * sizeof (blkptr_t); + + /* Add in the space for the record associated with each block. */ + size += size / recordsize * sizeof (dmu_replay_record_t); + + *sizep = size; + + return (0); +} + int dmu_send_estimate(dsl_dataset_t *ds, dsl_dataset_t *fromds, uint64_t *sizep) { @@ -891,33 +925,61 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl return (err); } - /* -* Assume that space (both on-disk and in-stream) is dominated by -* data. We will adjust for indirect blocks and the copies property, -* but ignore per-object space used (eg, dnodes and DRR_OBJECT records). -
svn commit: r286682 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys
Author: mav Date: Wed Aug 12 18:08:40 2015 New Revision: 286682 URL: https://svnweb.freebsd.org/changeset/base/286682 Log: 5765 add support for estimating send stream size with lzc_send_space when so urce is a bookmark Reviewed by: Matthew Ahrens Reviewed by: Christopher Siden Reviewed by: Steven Hartland Reviewed by: Bayard Bell Approved by: Albert Lee illumos/illumos-gate@643da460c8ca583e39ce053081754e24087f84c8 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c == --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.cWed Aug 12 17:46:26 2015(r286681) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.cWed Aug 12 18:08:40 2015(r286682) @@ -822,6 +822,40 @@ dmu_send(const char *tosnap, const char return (err); } +static int +dmu_adjust_send_estimate_for_indirects(dsl_dataset_t *ds, uint64_t size, +uint64_t *sizep) +{ + int err; + /* +* Assume that space (both on-disk and in-stream) is dominated by +* data. We will adjust for indirect blocks and the copies property, +* but ignore per-object space used (eg, dnodes and DRR_OBJECT records). +*/ + + /* +* Subtract out approximate space used by indirect blocks. +* Assume most space is used by data blocks (non-indirect, non-dnode). +* Assume all blocks are recordsize. Assume ditto blocks and +* internal fragmentation counter out compression. +* +* Therefore, space used by indirect blocks is sizeof(blkptr_t) per +* block, which we observe in practice. +*/ + uint64_t recordsize; + err = dsl_prop_get_int_ds(ds, "recordsize", &recordsize); + if (err != 0) + return (err); + size -= size / recordsize * sizeof (blkptr_t); + + /* Add in the space for the record associated with each block. */ + size += size / recordsize * sizeof (dmu_replay_record_t); + + *sizep = size; + + return (0); +} + int dmu_send_estimate(dsl_dataset_t *ds, dsl_dataset_t *fromds, uint64_t *sizep) { @@ -857,33 +891,61 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl return (err); } - /* -* Assume that space (both on-disk and in-stream) is dominated by -* data. We will adjust for indirect blocks and the copies property, -* but ignore per-object space used (eg, dnodes and DRR_OBJECT records). -*/ + err = dmu_adjust_send_estimate_for_indirects(ds, size, sizep); + return (err); +} + +/* + * Simple callback used to traverse the blocks of a snapshot and sum their + * uncompressed size + */ +/* ARGSUSED */ +static int +dmu_calculate_send_traversal(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, +const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) +{ + uint64_t *spaceptr = arg; + if (bp != NULL && !BP_IS_HOLE(bp)) { + *spaceptr += BP_GET_UCSIZE(bp); + } + return (0); +} + +/* + * Given a desination snapshot and a TXG, calculate the approximate size of a + * send stream sent from that TXG. from_txg may be zero, indicating that the + * whole snapshot will be sent. + */ +int +dmu_send_estimate_from_txg(dsl_dataset_t *ds, uint64_t from_txg, +uint64_t *sizep) +{ + dsl_pool_t *dp = ds->ds_dir->dd_pool; + int err; + uint64_t size = 0; + + ASSERT(dsl_pool_config_held(dp)); + + /* tosnap must be a snapshot */ + if (!dsl_dataset_is_snapshot(ds)) + return (SET_ERROR(EINVAL)); + + /* verify that from_txg is before the provided snapshot was taken */ + if (from_txg >= dsl_dataset_phys(ds)->ds_creation_txg) { + return (SET_ERROR(EXDEV)); + } /* -* Subtract out approximate space used by indirect blocks. -* Assume most space is used by data blocks (non-indirect, non-dnode). -* Assume all blocks are recordsize. Assume ditto blocks and -* internal fragmentation counter out compression. -* -* Therefore, space used by indirect blocks is sizeof(blkptr_t) per -* block, which we observe in practice. +* traverse the blocks of the snapshot with birth times after +* from_txg, summing their uncompressed size */ - uint64_t recordsize; - err = dsl_prop_get_int_ds(ds, "recordsize", &recordsize); - if (err != 0) + err = traverse_dataset(ds, from_txg, TRAVERSE_POST, + dmu_calculate_send_traversal, &size); + if (err) return (err); - size -= size / recordsize * sizeof (blkptr_t); - -
Re: svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
[CC ed] > On Aug 12, 2015, at 10:37 AM, Ed Schouten wrote: > > Hi Marcel, > > 2015-08-12 17:26 GMT+02:00 Marcel Moolenaar : >> Better support memory mapped console devices, such as VGA and EFI >> frame buffers and memory mapped UARTs. > > This change causes my FreeBSD instance in Virtualbox 4.3.28 (OS X) to > crash. As soon as the kernel initializes the graphics on startup > (read: before printing any messages), I see random garbage appear on > screen, followed by a popup dialog from Virtualbox that a fatal > machine exception has occurred. Would you mind creating a PR so that we can track the various console issues pre and post this change. Details as to how to reproduce would be much appreciated! Thanks, -- Marcel Moolenaar mar...@xcllnt.net signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r286681 - head/sys/kern
Author: ed Date: Wed Aug 12 17:46:26 2015 New Revision: 286681 URL: https://svnweb.freebsd.org/changeset/base/286681 Log: Perform cleanups in response to D3307. - Document the kern_kevent_anonymous() function. - Add assertions to ensure that we don't silently leave the kqueue linked from a file descriptor table. Reviewed by: jmg Differential Revision:https://reviews.freebsd.org/D3364 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Wed Aug 12 17:42:20 2015(r286680) +++ head/sys/kern/kern_event.c Wed Aug 12 17:46:26 2015(r286681) @@ -975,6 +975,10 @@ kern_kevent_fp(struct thread *td, struct return (error); } +/* + * Performs a kevent() call on a temporarily created kqueue. This can be + * used to perform one-shot polling, similar to poll() and select(). + */ int kern_kevent_anonymous(struct thread *td, int nevents, struct kevent_copyops *k_ops) @@ -1831,6 +1835,8 @@ static void kqueue_destroy(struct kqueue *kq) { + KASSERT(kq->kq_fdp == NULL, + ("kqueue still attached to a file descriptor")); seldrain(&kq->kq_sel); knlist_destroy(&kq->kq_sel.si_note); mtx_destroy(&kq->kq_lock); @@ -1863,6 +1869,7 @@ kqueue_close(struct file *fp, struct thr * take the sleepable lock after non-sleepable. */ fdp = kq->kq_fdp; + kq->kq_fdp = NULL; if (!sx_xlocked(FILEDESC_LOCK(fdp))) { FILEDESC_XLOCK(fdp); filedesc_unlock = 1; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286680 - head/sys/compat/cloudabi64
Author: ed Date: Wed Aug 12 17:42:20 2015 New Revision: 286680 URL: https://svnweb.freebsd.org/changeset/base/286680 Log: Add the last remaining system calls: send() and recv(). There is still one TODO item for these calls: add file descriptor passing. The data structures are already prepared for this. It's just the translation that's missing. Obtained from:http://github.com/NuxiNL/freebsd Modified: head/sys/compat/cloudabi64/cloudabi64_sock.c Modified: head/sys/compat/cloudabi64/cloudabi64_sock.c == --- head/sys/compat/cloudabi64/cloudabi64_sock.cWed Aug 12 17:32:58 2015(r286679) +++ head/sys/compat/cloudabi64/cloudabi64_sock.cWed Aug 12 17:42:20 2015(r286680) @@ -26,23 +26,119 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include #include +static MALLOC_DEFINE(M_SOCKET, "socket", "CloudABI socket"); + int cloudabi64_sys_sock_recv(struct thread *td, struct cloudabi64_sys_sock_recv_args *uap) { + struct sockaddr_storage ss; + cloudabi64_recv_in_t ri; + cloudabi64_recv_out_t ro = {}; + cloudabi64_iovec_t iovobj; + struct msghdr msghdr = {}; + size_t i; + int error; + + error = copyin(uap->in, &ri, sizeof(ri)); + if (error != 0) + return (error); + + /* Convert results in cloudabi_recv_in_t to struct msghdr. */ + if (ri.ri_datalen > UIO_MAXIOV) + return (EINVAL); + msghdr.msg_iovlen = ri.ri_datalen; + msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), + M_SOCKET, M_WAITOK); + for (i = 0; i < msghdr.msg_iovlen; i++) { + error = copyin(&((cloudabi64_iovec_t *)ri.ri_data)[i], &iovobj, + sizeof(iovobj)); + if (error != 0) { + free(msghdr.msg_iov, M_SOCKET); + return (error); + } + msghdr.msg_iov[i].iov_base = (void *)iovobj.iov_base; + msghdr.msg_iov[i].iov_len = iovobj.iov_len; + } + msghdr.msg_name = &ss; + msghdr.msg_namelen = sizeof(ss); + if (ri.ri_flags & CLOUDABI_MSG_PEEK) + msghdr.msg_flags |= MSG_PEEK; + if (ri.ri_flags & CLOUDABI_MSG_WAITALL) + msghdr.msg_flags |= MSG_WAITALL; - /* Not implemented. */ - return (ENOSYS); + /* TODO(ed): Add file descriptor passing. */ + error = kern_recvit(td, uap->s, &msghdr, UIO_SYSSPACE, NULL); + free(msghdr.msg_iov, M_SOCKET); + if (error != 0) + return (error); + + /* Convert results in msghdr to cloudabi_recv_out_t. */ + ro.ro_datalen = td->td_retval[0]; + cloudabi_convert_sockaddr((struct sockaddr *)&ss, + MIN(msghdr.msg_namelen, sizeof(ss)), &ro.ro_peername); + td->td_retval[0] = 0; + return (copyout(&ro, uap->out, sizeof(ro))); } int cloudabi64_sys_sock_send(struct thread *td, struct cloudabi64_sys_sock_send_args *uap) { + cloudabi64_send_in_t si; + cloudabi64_send_out_t so = {}; + cloudabi64_ciovec_t iovobj; + struct msghdr msghdr = {}; + size_t i; + int error, flags; + + error = copyin(uap->in, &si, sizeof(si)); + if (error != 0) + return (error); + + /* Convert results in cloudabi_send_in_t to struct msghdr. */ + if (si.si_datalen > UIO_MAXIOV) + return (EINVAL); + msghdr.msg_iovlen = si.si_datalen; + msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), + M_SOCKET, M_WAITOK); + for (i = 0; i < msghdr.msg_iovlen; i++) { + error = copyin(&((cloudabi64_ciovec_t *)si.si_data)[i], &iovobj, + sizeof(iovobj)); + if (error != 0) { + free(msghdr.msg_iov, M_SOCKET); + return (error); + } + msghdr.msg_iov[i].iov_base = (void *)iovobj.iov_base; + msghdr.msg_iov[i].iov_len = iovobj.iov_len; + } + + flags = MSG_NOSIGNAL; + if (si.si_flags & CLOUDABI_MSG_EOR) + flags |= MSG_EOR; + + /* TODO(ed): Add file descriptor passing. */ + error = kern_sendit(td, uap->s, &msghdr, flags, NULL, UIO_USERSPACE); + free(msghdr.msg_iov, M_SOCKET); + if (error != 0) + return (error); - /* Not implemented. */ - return (ENOSYS); + /* Convert results in msghdr to cloudabi_send_out_t. */ + so.so_datalen = td->td_retval[0]; + td->td_retval[0] = 0; + return (copyout(&so, uap->out, sizeof(so))); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "
Re: svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
Hi Marcel, 2015-08-12 17:26 GMT+02:00 Marcel Moolenaar : > Better support memory mapped console devices, such as VGA and EFI > frame buffers and memory mapped UARTs. This change causes my FreeBSD instance in Virtualbox 4.3.28 (OS X) to crash. As soon as the kernel initializes the graphics on startup (read: before printing any messages), I see random garbage appear on screen, followed by a popup dialog from Virtualbox that a fatal machine exception has occurred. HTH, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286679 - in head: cddl/contrib/opensolaris cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs sys/cddl/contr...
Author: mav Date: Wed Aug 12 17:32:58 2015 New Revision: 286679 URL: https://svnweb.freebsd.org/changeset/base/286679 Log: Record mergeinfo. Modified: Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286678 - head/sys/arm/ti
Author: ian Date: Wed Aug 12 17:23:15 2015 New Revision: 286678 URL: https://svnweb.freebsd.org/changeset/base/286678 Log: Add a routine to return the hardware instance/unit number from ti,hwmods, given the hardware name. The ti,hwmods property is used (among other things) to associate an fdt node with a specific instance of some hardware. For example given a device node that contains the property ti,hwmods = "timer3", if you call this passing "timer" as the hwmod string to look for it would return 3. Modified: head/sys/arm/ti/ti_hwmods.c head/sys/arm/ti/ti_hwmods.h Modified: head/sys/arm/ti/ti_hwmods.c == --- head/sys/arm/ti/ti_hwmods.c Wed Aug 12 17:21:41 2015(r286677) +++ head/sys/arm/ti/ti_hwmods.c Wed Aug 12 17:23:15 2015(r286678) @@ -168,3 +168,35 @@ int ti_hwmods_contains(device_t dev, con return (result); } + +int +ti_hwmods_get_unit(device_t dev, const char *hwmod) +{ + phandle_t node; + int l, len, hwmodlen, result; + char *name; + char *buf; + + if ((node = ofw_bus_get_node(dev)) == 0) + return (0); + + if ((len = OF_getprop_alloc(node, "ti,hwmods", 1, (void**)&name)) <= 0) + return (0); + + buf = name; + hwmodlen = strlen(hwmod); + result = 0; + while (len > 0) { + if (strncmp(name, hwmod, hwmodlen) == 0) { +result = (int)strtoul(name + hwmodlen, NULL, 10); + break; + } + /* Slide to the next sub-string. */ + l = strlen(name) + 1; + name += l; + len -= l; + } + + free(buf, M_OFWPROP); + return (result); +} Modified: head/sys/arm/ti/ti_hwmods.h == --- head/sys/arm/ti/ti_hwmods.h Wed Aug 12 17:21:41 2015(r286677) +++ head/sys/arm/ti/ti_hwmods.h Wed Aug 12 17:23:15 2015(r286678) @@ -31,4 +31,7 @@ clk_ident_t ti_hwmods_get_clock(device_t dev); int ti_hwmods_contains(device_t dev, const char *hwmod); +/* Returns the N from "hwmodN" in the ti,hwmods property; 0 on failure. */ +int ti_hwmods_get_unit(device_t dev, const char *hwmod); + #endif /* _TI_HWMODS_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286677 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Author: mav Date: Wed Aug 12 17:21:41 2015 New Revision: 286677 URL: https://svnweb.freebsd.org/changeset/base/286677 Log: MFV r286224: 5695 dmu_sync'ed holes do not retain birth time illumos/illumos-gate@70163ac57e58ace1c5c94dfbe85dca5a974eff36 https://www.illumos.org/issues/5695 In dmu_sync_ready(), a hole block pointer will have it's logical size explicitly set as it's necessary for replay purposes. To "undo" this, dmu_sync_done() will zero out any hole that it finds. This becomes a problem when using the "hole_birth" feature, as this will also wipe out any birth time that might have happened to be set on the hole. ... As a fix, the logic to zero out a hole is only applied to old style holes with a birth time of zero. Holes created with the "hole_birth" feature enabled will have a non-zero birth time, and will be skipped (thus preserving the ltime, type, and level information as well). In addition, zdb was updated to also print the ltime, type, and level information for these new style holes. Previously, only the logical birth time would be printed. Author: Prakash Surya Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Christopher Siden Reviewed by: Bayard Bell Approved by: Dan McDonald Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Aug 12 17:19:52 2015(r286676) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Aug 12 17:21:41 2015(r286677) @@ -1484,7 +1484,19 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; dr->dt.dl.dr_copies = zio->io_prop.zp_copies; - if (BP_IS_HOLE(&dr->dt.dl.dr_overridden_by)) + + /* +* Old style holes are filled with all zeros, whereas +* new-style holes maintain their lsize, type, level, +* and birth time (see zio_write_compress). While we +* need to reset the BP_SET_LSIZE() call that happened +* in dmu_sync_ready for old style holes, we do *not* +* want to wipe out the information contained in new +* style holes. Thus, only zero out the block pointer if +* it's an old style hole. +*/ + if (BP_IS_HOLE(&dr->dt.dl.dr_overridden_by) && + dr->dt.dl.dr_overridden_by.blk_birth == 0) BP_ZERO(&dr->dt.dl.dr_overridden_by); } else { dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Wed Aug 12 17:19:52 2015(r286676) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Wed Aug 12 17:21:41 2015(r286677) @@ -536,12 +536,13 @@ _NOTE(CONSTCOND) } while (0) if (bp == NULL) { \ len += func(buf + len, size - len, ""); \ } else if (BP_IS_HOLE(bp)) {\ - len += func(buf + len, size - len, ""); \ - if (bp->blk_birth > 0) {\ - len += func(buf + len, size - len, \ - " birth=%lluL", \ - (u_longlong_t)bp->blk_birth); \ - } \ + len += func(buf + len, size - len, \ + "HOLE [L%llu %s] " \ + "size=%llxL birth=%lluL", \ + (u_longlong_t)BP_GET_LEVEL(bp), \ + type, \ + (u_longlong_t)BP_GET_LSIZE(bp), \ + (u_longlong_t)bp->blk_birth); \ } else if (BP_IS_EMBEDDED(bp)) {\ len = func(buf + len, size - len, \ "EMBEDDED [L%llu %s] et=%u %s " \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-s
svn commit: r286676 - head
Author: imp Date: Wed Aug 12 17:19:52 2015 New Revision: 286676 URL: https://svnweb.freebsd.org/changeset/base/286676 Log: Why on earth have we been building rescue as a build tool for the past 12 years? Nothing downstream in the build uses it. Eliminate it as a build tool. Reviewed by: emaste@ ("just delete it") Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed Aug 12 17:09:57 2015(r286675) +++ head/Makefile.inc1 Wed Aug 12 17:19:52 2015(r286676) @@ -1432,15 +1432,10 @@ _share= share/syscons/scrnmaps _gcc_tools= gnu/usr.bin/cc/cc_tools .endif -.if ${MK_RESCUE} != "no" -_rescue= rescue/rescue -.endif - build-tools: .MAKE .for _tool in \ bin/csh \ bin/sh \ -${_rescue} \ ${LOCAL_TOOL_DIRS} \ lib/ncurses/ncurses \ lib/ncurses/ncursesw \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286672 - in head: . sys/sys
> On Aug 12, 2015, at 11:07 AM, Ed Maste wrote: > > On 12 August 2015 at 12:43, Warner Losh wrote: >> Only people that installed since r284356 >> really need to do this bootstrapping, but since crunchgen needs to >> bootstrap for other reasons, bumping the number was the simplest. > > Perhaps we should always leave the tests as BOOSTRAPPING < value, > rather than introducing ranges. It seems to me that building a few > small tools even when not necessary isn't a big price to pay for the > simplicity. I tend to agree, and that’s why I left it like this on -current. For stable, I could see both sides. If I made the test strictly <, then it would effectively always build on the most common scenario of building stable on stable. I opted to include a comment about the window on -stable. I also plan on removing it after a few months since this window was so short relatively to the release cycle. Several folks had comments about this issue, which is why I went ahead and put the seat belts in place, at least for now. Warner signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r286675 - head/sys/arm64/include
Author: andrew Date: Wed Aug 12 17:09:57 2015 New Revision: 286675 URL: https://svnweb.freebsd.org/changeset/base/286675 Log: Add the CNTHCTL_EL2 register bits missed in r286674 Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h == --- head/sys/arm64/include/armreg.h Wed Aug 12 17:06:22 2015 (r286674) +++ head/sys/arm64/include/armreg.h Wed Aug 12 17:09:57 2015 (r286675) @@ -41,6 +41,13 @@ #defineWRITE_SPECIALREG(reg, val) \ __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)val)) +/* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ +#defineCNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ +#defineCNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ +#defineCNTHCTL_EVNTEN (1 << 2) /* Enable event stream */ +#defineCNTHCTL_EL1PCEN (1 << 1) /* Allow EL0/1 physical timer access */ +#defineCNTHCTL_EL1PCTEN(1 << 0) /*Allow EL0/1 physical counter access*/ + /* CPACR_EL1 */ #defineCPACR_FPEN_MASK (0x3 << 20) #define CPACR_FPEN_TRAP_ALL1 (0x0 << 20) /* Traps from EL0 and EL1 */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286672 - in head: . sys/sys
On 12 August 2015 at 12:43, Warner Losh wrote: > Only people that installed since r284356 > really need to do this bootstrapping, but since crunchgen needs to > bootstrap for other reasons, bumping the number was the simplest. Perhaps we should always leave the tests as BOOSTRAPPING < value, rather than introducing ranges. It seems to me that building a few small tools even when not necessary isn't a big price to pay for the simplicity. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286674 - head/sys/arm64/arm64
Author: andrew Date: Wed Aug 12 17:06:22 2015 New Revision: 286674 URL: https://svnweb.freebsd.org/changeset/base/286674 Log: Set the counter-timer virtual offset to a know value, it may not have been set by the boot code and are reset to an implementation defined value that may be unknown. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S == --- head/sys/arm64/arm64/locore.S Wed Aug 12 16:53:37 2015 (r286673) +++ head/sys/arm64/arm64/locore.S Wed Aug 12 17:06:22 2015 (r286674) @@ -220,6 +220,14 @@ drop_to_el1: /* Don't trap to EL2 for CP15 traps */ msr hstr_el2, xzr + /* Enable access to the physical timers at EL1 */ + mrs x2, cnthctl_el2 + orr x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + msr cnthctl_el2, x2 + + /* Set the counter offset to a known value */ + msr cntvoff_el2, xzr + /* Hypervisor trap functions */ adr x2, hyp_vectors msr vbar_el2, x2 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r286662 - head/sys/kern
On Wed, Aug 12, 2015 at 7:30 AM, Ed Schouten wrote: > Author: ed > Date: Wed Aug 12 11:30:31 2015 > New Revision: 286662 > URL: https://svnweb.freebsd.org/changeset/base/286662 > > Log: > Unignore signals when starting CloudABI processes. > > As CloudABI processes cannot adjust their signal handlers, we need to > make sure that we start up CloudABI processes with consistent signal > masks. Though the POSIx standard signal behavior is all right, we do > > It ... is? I thought it caused all sorts of frustrating problems, some discussion of which is given at https://ldpreload.com/blog/signalfd-is-useless -Ben ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286673 - stable/10
Author: imp Date: Wed Aug 12 16:53:37 2015 New Revision: 286673 URL: https://svnweb.freebsd.org/changeset/base/286673 Log: Direct commit When compiling on -current from r284356 to r285986, the host's crunchgen can't be used because builds of rescue break when STRIP= was used to prevent stripping of binaries. Direct commit because -current code is different. Building 10 on current is common enough to warrnat a safety belt since this has been broken for two months. The offending change was never in stable/10. Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 == --- stable/10/Makefile.inc1 Wed Aug 12 16:43:15 2015(r286672) +++ stable/10/Makefile.inc1 Wed Aug 12 16:53:37 2015(r286673) @@ -1262,7 +1262,11 @@ _yacc= lib/liby \ ${_bt}-usr.bin/yacc: ${_bt}-lib/liby .endif -.if ${BOOTSTRAPPING} < 114 +# crunchgen broken on head with STRIP= for a while, even +# when building stable binaries, so bootstrap there too. +# r284356 to r285986 is the broken range. +.if ${BOOTSTRAPPING} < 114 || \ + (${BOOTSTRAPPING} > 1100076 && ${BOOTSTRAPPING} < 1100078) _crunch= usr.sbin/crunch .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286672 - in head: . sys/sys
Author: imp Date: Wed Aug 12 16:43:15 2015 New Revision: 286672 URL: https://svnweb.freebsd.org/changeset/base/286672 Log: Crunchgen needs to be bootstrapped to pick up the STRIP->STRIPBIN changes to prevent the 'rescue: not found' errors from happening. Bump FreeBSD_version to 1100078 since there's been no version bumps since this change was made. Only people that installed since r284356 really need to do this bootstrapping, but since crunchgen needs to bootstrap for other reasons, bumping the number was the simplest. Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed Aug 12 16:22:10 2015(r286671) +++ head/Makefile.inc1 Wed Aug 12 16:43:15 2015(r286672) @@ -1304,7 +1304,8 @@ _lex= usr.bin/lex # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support -.if ${BOOTSTRAPPING} < 1100071 +# r285986 crunchen: use STRIPBIN rather than STRIP +.if ${BOOTSTRAPPING} < 1100078 _crunch= usr.sbin/crunch .endif Modified: head/sys/sys/param.h == --- head/sys/sys/param.hWed Aug 12 16:22:10 2015(r286671) +++ head/sys/sys/param.hWed Aug 12 16:43:15 2015(r286672) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100077 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100078 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286671 - head/etc/rc.d
Author: feld (ports committer) Date: Wed Aug 12 16:22:10 2015 New Revision: 286671 URL: https://svnweb.freebsd.org/changeset/base/286671 Log: etc/rc.d/hostname: permit setting hostname if already set Approved by: dteske Differential Revision:https://reviews.freebsd.org/D2577 Modified: head/etc/rc.d/hostname Modified: head/etc/rc.d/hostname == --- head/etc/rc.d/hostname Wed Aug 12 16:17:00 2015(r286670) +++ head/etc/rc.d/hostname Wed Aug 12 16:22:10 2015(r286671) @@ -39,16 +39,13 @@ stop_cmd=":" hostname_start() { - # If we are not inside a jail, set the host name if it is not already set. - # If we are inside a jail, set the host name even if it is already set, - # but first check if it is permitted. + # If we are not inside a jail, set the host name. + # If we are inside a jail, set the host name if it is permitted. # if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then return fi - elif [ -n "`/bin/hostname -s`" ]; then - return else # If we're not in a jail and rc.conf doesn't specify a # hostname, see if we can get one from kenv. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286670 - head/sys/kern
Author: ed Date: Wed Aug 12 16:17:00 2015 New Revision: 286670 URL: https://svnweb.freebsd.org/changeset/base/286670 Log: Properly return ENOTDIR when calling *at() on a non-vnode. We already properly return ENOTDIR when calling *at() on a non-directory vnode, but it turns out that if you call it on a socket, we see EINVAL. Patch up namei to properly translate this to ENOTDIR. Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Wed Aug 12 16:08:37 2015(r286669) +++ head/sys/kern/vfs_lookup.c Wed Aug 12 16:17:00 2015(r286670) @@ -269,6 +269,8 @@ namei(struct nameidata *ndp) AUDIT_ARG_ATFD2(ndp->ni_dirfd); error = fgetvp_rights(td, ndp->ni_dirfd, &rights, &ndp->ni_filecaps, &dp); + if (error == EINVAL) + error = ENOTDIR; #ifdef CAPABILITIES /* * If file descriptor doesn't have all rights, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286669 - head/sys/netinet
Author: hiren Date: Wed Aug 12 16:08:37 2015 New Revision: 286669 URL: https://svnweb.freebsd.org/changeset/base/286669 Log: Remove unused TCPTV_SRTTDFLT. We initialize srtt with TCPTV_SRTTBASE when we don't have any rtt estimate. Differential Revision:D3334 Sponsored by: Limelight Networks Modified: head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.h == --- head/sys/netinet/tcp_timer.hWed Aug 12 15:48:14 2015 (r286668) +++ head/sys/netinet/tcp_timer.hWed Aug 12 16:08:37 2015 (r286669) @@ -76,7 +76,6 @@ #defineTCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ #defineTCPTV_RTOBASE ( 3*hz)/* assumed RTO if no info */ -#defineTCPTV_SRTTDFLT ( 3*hz)/* assumed RTT if no info */ #defineTCPTV_PERSMIN ( 5*hz)/* retransmit persistence */ #defineTCPTV_PERSMAX ( 60*hz)/* maximum persist interval */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286668 - head/sys/dev/uart
Author: marcel Date: Wed Aug 12 15:48:14 2015 New Revision: 286668 URL: https://svnweb.freebsd.org/changeset/base/286668 Log: Add support for the Broadcom TruManage integrated serial port. PR: 191266 Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c == --- head/sys/dev/uart/uart_bus_pci.cWed Aug 12 15:26:32 2015 (r286667) +++ head/sys/dev/uart/uart_bus_pci.cWed Aug 12 15:48:14 2015 (r286668) @@ -115,6 +115,8 @@ static const struct pci_id pci_ns8250_id 0x10, 16384000 }, { 0x1415, 0xc120, 0x, 0, "Oxford Semiconductor OXPCIe952 PCIe 16950 UART", 0x10 }, +{ 0x14e4, 0x160a, 0x, 0, "Broadcom TruManage UART", 0x10, + 128 * DEFAULT_RCLK, 2}, { 0x14e4, 0x4344, 0x, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x, 0x, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x1fd4, 0x1999, 0x1fd4, 0x0001, "Sunix SER5 Serial Port", 0x10, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286667 - in head/sys: amd64/amd64 conf dev/vt/hw/efifb dev/vt/hw/vga i386/i386 x86/include x86/x86
Author: marcel Date: Wed Aug 12 15:26:32 2015 New Revision: 286667 URL: https://svnweb.freebsd.org/changeset/base/286667 Log: Better support memory mapped console devices, such as VGA and EFI frame buffers and memory mapped UARTs. 1. Delay calling cninit() until after pmap_bootstrap(). This makes sure we have PMAP initialized enough to add translations. Keep kdb_init() after cninit() so that we have console when we need to break into the debugger on boot. 2. Unfortunately, the ATPIC code had be moved as well so as to avoid a spurious trap #30. The reason for which is not known at this time. 3. In pmap_mapdev_attr(), when we need to map a device prior to the VM system being initialized, use virtual_avail as the KVA to map the device at. In particular, avoid using the direct map on amd64 because we can't demote by virtue of not being able to allocate yet. Keep track of the translation. Re-use the translation after the VM has been initialized to not waste KVA and to satisfy the assumption in uart(4) that the handle returned for the low-level console is the same as later returned when the device is probed and attached. 4. In pmap_unmapdev() remove the mapping from the table when called pre-init. Otherwise keep the mapping. During bus probe and attach device resources are mapped and unmapped multiple times, which would have us destroy the mapping used by the low-level console. 5. In pmap_init(), set pmap_initialized to signal that we're not pre-init anymore. On amd64, bring the direct map in sync with the translations created at that time. 6. Implement bus_space_map() and bus_space_unmap() for real: when the tag corresponds to memory space, call the corresponding pmap_mapdev() and pmap_unmapdev() functions to construct and actual handle. 7. In efifb.c and vt_vga.c, remove the crutches and hacks and simply call pmap_mapdev_attr() or bus_space_map() as desired. Notes: 1. uart(4) already used bus_space_map() during low-level console setup but since serial ports have traditionally been I/O port based, the lack of a proper implementation for said function was not a problem. It has always supported memory mapped UARTs for low-level consoles by setting hw.uart.console accordingly. 2. The use of the direct map on amd64 without setting caching attributes has been a bigger problem than previously thought. This change has the fortunate (and unexpected) side-effect of fixing various EFI frame buffer problems (though not all). PR: 191564, 194952 Special thanks to: 1. XipLink, Inc -- generously donated an Intel Bay Trail E3800 based eval board (ADLE3800PC). 2. The FreeBSD Foundation, in particular emaste@ -- for UEFI support in general and testing. 3. Everyone who tested the proposed for PR 191564. 4. jhb@ and kib@ for being a soundboard and applying a clue bat if so needed. Added: head/sys/x86/x86/bus_machdep.c (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/pmap.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/vt/hw/efifb/efifb.c head/sys/dev/vt/hw/vga/vt_vga.c head/sys/i386/i386/machdep.c head/sys/i386/i386/pmap.c head/sys/x86/include/bus.h Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Wed Aug 12 14:17:41 2015 (r28) +++ head/sys/amd64/amd64/machdep.c Wed Aug 12 15:26:32 2015 (r286667) @@ -1625,38 +1625,6 @@ hammer_time(u_int64_t modulep, u_int64_t MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL) vty_set_preferred(VTY_VT); - /* -* Initialize the console before we print anything out. -*/ - cninit(); - -#ifdef DEV_ISA -#ifdef DEV_ATPIC - elcr_probe(); - atpic_startup(); -#else - /* Reset and mask the atpics and leave them shut down. */ - atpic_reset(); - - /* -* Point the ICU spurious interrupt vectors at the APIC spurious -* interrupt handler. -*/ - setidt(IDT_IO_INTS + 7, IDTVEC(spuriousint), SDT_SYSIGT, SEL_KPL, 0); - setidt(IDT_IO_INTS + 15, IDTVEC(spuriousint), SDT_SYSIGT, SEL_KPL, 0); -#endif -#else -#error "have you forgotten the isa device?"; -#endif - - kdb_init(); - -#ifdef KDB - if (boothowto & RB_KDB) - kdb_enter(KDB_WHY_BOOTFLAGS, - "Boot flags requested debugger"); -#endif - identify_cpu(); /* Final stage of CPU initialization */ initializecpu();/* Initialize CPU registers */ initializecpucache(); @@ -1693,6 +1661,35 @@ hammer_time(u_int64_t modulep, u_int64_t /* now running on new page tables, configured,and u/iom is accessible */
svn commit: r286666 - releng/10.2/sys/conf
Author: gjb Date: Wed Aug 12 14:17:41 2015 New Revision: 28 URL: https://svnweb.freebsd.org/changeset/base/28 Log: Update releng/10.2 to -RELEASE status, and prepare for final 10.2-RELEASE builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.2/sys/conf/newvers.sh Modified: releng/10.2/sys/conf/newvers.sh == --- releng/10.2/sys/conf/newvers.sh Wed Aug 12 14:08:06 2015 (r286665) +++ releng/10.2/sys/conf/newvers.sh Wed Aug 12 14:17:41 2015 (r28) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.2" -BRANCH="RC3" +BRANCH="RELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286665 - releng/10.2
Author: gjb Date: Wed Aug 12 14:08:06 2015 New Revision: 286665 URL: https://svnweb.freebsd.org/changeset/base/286665 Log: Anticipate the expected 10.2-RELEASE date. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.2/UPDATING Modified: releng/10.2/UPDATING == --- releng/10.2/UPDATINGWed Aug 12 14:02:56 2015(r286664) +++ releng/10.2/UPDATINGWed Aug 12 14:08:06 2015(r286665) @@ -16,6 +16,9 @@ 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. +20150817: + 10.2-RELEASE. + 20150703: The default Unbound configuration now enables remote control using a local socket. Users who have already enabled the ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286664 - releng/10.2/lib/csu/common
Author: gjb Date: Wed Aug 12 14:02:56 2015 New Revision: 286664 URL: https://svnweb.freebsd.org/changeset/base/286664 Log: Set static abitag to the current value of __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.2/lib/csu/common/crtbrand.c Modified: releng/10.2/lib/csu/common/crtbrand.c == --- releng/10.2/lib/csu/common/crtbrand.c Wed Aug 12 11:56:19 2015 (r286663) +++ releng/10.2/lib/csu/common/crtbrand.c Wed Aug 12 14:02:56 2015 (r286664) @@ -62,5 +62,5 @@ static const struct { .descsz = sizeof(int32_t), .type = ABI_NOTETYPE, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1002000 }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286663 - in head/share/man: man4 man4/man4.i386 man7 man8 man9
Author: brueffer Date: Wed Aug 12 11:56:19 2015 New Revision: 286663 URL: https://svnweb.freebsd.org/changeset/base/286663 Log: Fix mandoc warnings/errors. MFC after:1 week Modified: head/share/man/man4/cloudabi.4 head/share/man/man4/ctl.4 head/share/man/man4/em.4 head/share/man/man4/gre.4 head/share/man/man4/hptiop.4 head/share/man/man4/man4.i386/wl.4 head/share/man/man4/ng_btsocket.4 head/share/man/man4/siftr.4 head/share/man/man4/snp.4 head/share/man/man4/uftdi.4 head/share/man/man4/vt.4 head/share/man/man7/release.7 head/share/man/man8/nanobsd.8 head/share/man/man8/uefi.8 head/share/man/man8/yp.8 head/share/man/man9/PCI_IOV_ADD_VF.9 head/share/man/man9/PCI_IOV_INIT.9 head/share/man/man9/altq.9 head/share/man/man9/ifnet.9 Modified: head/share/man/man4/cloudabi.4 == --- head/share/man/man4/cloudabi.4 Wed Aug 12 11:30:31 2015 (r286662) +++ head/share/man/man4/cloudabi.4 Wed Aug 12 11:56:19 2015 (r286663) @@ -99,5 +99,4 @@ cloudlibc on GitHub: CloudABI support first appeared in .Fx 11.0 . .Sh AUTHORS -Nuxi: -.Pa https://nuxi.nl/ . +.An Nuxi : Pa https://nuxi.nl/ . Modified: head/share/man/man4/ctl.4 == --- head/share/man/man4/ctl.4 Wed Aug 12 11:30:31 2015(r286662) +++ head/share/man/man4/ctl.4 Wed Aug 12 11:56:19 2015(r286663) @@ -119,6 +119,7 @@ In the event that there is no response w forcibly terminated. Set to 0 to disable sending NOP-In PDUs. Defaults to 5. +.El .Sh SEE ALSO .Xr ctladm 8 , .Xr ctld 8 , Modified: head/share/man/man4/em.4 == --- head/share/man/man4/em.4Wed Aug 12 11:30:31 2015(r286662) +++ head/share/man/man4/em.4Wed Aug 12 11:56:19 2015(r286663) @@ -307,5 +307,4 @@ The driver was written by .An Intel Corporation Aq Mt free...@intel.com . .Sh BUGS -.Pp Activating EM_MULTIQUEUE support requires MSI-X features. Modified: head/share/man/man4/gre.4 == --- head/share/man/man4/gre.4 Wed Aug 12 11:30:31 2015(r286662) +++ head/share/man/man4/gre.4 Wed Aug 12 11:56:19 2015(r286663) @@ -154,7 +154,6 @@ ifconfig greN create ifconfig greN inet 198.51.100.1 203.0.113.1 ifconfig greN inet tunnel 198.51.100.1 203.0.113.1 tunnelfib 1 .Ed -.Pp .Sh NOTES The MTU of .Nm Modified: head/share/man/man4/hptiop.4 == --- head/share/man/man4/hptiop.4Wed Aug 12 11:30:31 2015 (r286662) +++ head/share/man/man4/hptiop.4Wed Aug 12 11:56:19 2015 (r286663) @@ -135,4 +135,5 @@ device driver first appeared in .Sh AUTHORS The .Nm -driver was written by HighPoint Technologies, Inc. +driver was written by +.An HighPoint Technologies, Inc. Modified: head/share/man/man4/man4.i386/wl.4 == --- head/share/man/man4/man4.i386/wl.4 Wed Aug 12 11:30:31 2015 (r286662) +++ head/share/man/man4/man4.i386/wl.4 Wed Aug 12 11:56:19 2015 (r286663) @@ -165,7 +165,9 @@ ported the Mach drivers to BSDI. ported them to .Fx 2.1 . .An Michael Smith -ported the wl driver only to 2.2.2. +ported the +.Nm +driver only to 2.2.2. Jim and Michael have been maintaining them. The current state of the driver is NOT ANYONE'S Modified: head/share/man/man4/ng_btsocket.4 == --- head/share/man/man4/ng_btsocket.4 Wed Aug 12 11:30:31 2015 (r286662) +++ head/share/man/man4/ng_btsocket.4 Wed Aug 12 11:56:19 2015 (r286663) @@ -45,8 +45,8 @@ module implements three Netgraph node ty Each type in its turn implements one protocol within .Dv PF_BLUETOOTH domain. -.Sh Dv BLUETOOTH_PROTO_HCI Sh protocol -.Ss Dv SOCK_RAW Ss HCI sockets +.Sh Dv BLUETOOTH_PROTO_HCI protocol +.Ss Dv SOCK_RAW HCI sockets Implemented by .Nm btsock_hci_raw Netgraph type. @@ -147,7 +147,7 @@ level can be used to obtain via or change via .Xr setsockopt 2 raw HCI socket's filter. -.Sh Dv BLUETOOTH_PROTO_L2CAP Sh protocol +.Sh Dv BLUETOOTH_PROTO_L2CAP protocol The Bluetooth L2CAP socket address is defined as follows: .Bd -literal -offset indent /* Bluetooth version of struct sockaddr for L2CAP sockets */ @@ -158,7 +158,7 @@ struct sockaddr_l2cap { bdaddr_t l2cap_bdaddr; /* address */ }; .Ed -.Ss Dv SOCK_RAW Ss L2CAP sockets +.Ss Dv SOCK_RAW L2CAP sockets Implemented by .Nm btsock_l2c_raw Netgraph type. @@ -204,7 +204,7 @@ The variable, that can be examined and set via .Xr sysctl 8 , controls the control request timeout (in seconds) for raw L2CAP sockets. -.Ss Dv SOCK_SEQPACKET Ss L2CAP sockets +.Ss Dv SOCK_S
svn commit: r286662 - head/sys/kern
Author: ed Date: Wed Aug 12 11:30:31 2015 New Revision: 286662 URL: https://svnweb.freebsd.org/changeset/base/286662 Log: Unignore signals when starting CloudABI processes. As CloudABI processes cannot adjust their signal handlers, we need to make sure that we start up CloudABI processes with consistent signal masks. Though the POSIx standard signal behavior is all right, we do need to make sure that we ignore SIGPIPE, as it would otherwise be hard to interact with pipes and sockets. Extend execsigs() to iterate over ps_sigignore and call sigdflt() for each of the ignored signals. Reviewed by: kib Obtained from:https://github.com/NuxiNL/freebsd Differential Revision:https://reviews.freebsd.org/D3365 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c == --- head/sys/kern/kern_sig.cWed Aug 12 11:07:03 2015(r286661) +++ head/sys/kern/kern_sig.cWed Aug 12 11:30:31 2015(r286662) @@ -952,6 +952,7 @@ sigdflt(struct sigacts *ps, int sig) void execsigs(struct proc *p) { + sigset_t osigignore; struct sigacts *ps; int sig; struct thread *td; @@ -971,6 +972,24 @@ execsigs(struct proc *p) if ((sigprop(sig) & SA_IGNORE) != 0) sigqueue_delete_proc(p, sig); } + + /* +* As CloudABI processes cannot modify signal handlers, fully +* reset all signals to their default behavior. Do ignore +* SIGPIPE, as it would otherwise be impossible to recover from +* writes to broken pipes and sockets. +*/ + if (SV_PROC_ABI(p) == SV_ABI_CLOUDABI) { + osigignore = ps->ps_sigignore; + while (SIGNOTEMPTY(osigignore)) { + sig = sig_ffs(&osigignore); + SIGDELSET(osigignore, sig); + if (sig != SIGPIPE) + sigdflt(ps, sig); + } + SIGADDSET(ps->ps_sigignore, SIGPIPE); + } + /* * Reset stack state to the user stack. * Clear set of signals caught on the signal stack. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286661 - head/sys/compat/cloudabi
Author: ed Date: Wed Aug 12 11:07:03 2015 New Revision: 286661 URL: https://svnweb.freebsd.org/changeset/base/286661 Log: Use CAP_EVENT instead of CAP_PDWAIT. The cloudlibc pdwait() function ends up using FreeBSD's kqueue() in combination with EVFILT_PROCDESC. This depends on CAP_EVENT -- not CAP_PDWAIT. Obtained from:https://github.com/NuxiNL/freebsd Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi/cloudabi_proc.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c == --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Aug 12 10:34:05 2015 (r286660) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Aug 12 11:07:03 2015 (r286661) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); MAPPING(CLOUDABI_RIGHT_MEM_MAP_EXEC, CAP_MMAP_X)\ MAPPING(CLOUDABI_RIGHT_POLL_FD_READWRITE, CAP_EVENT)\ MAPPING(CLOUDABI_RIGHT_POLL_MODIFY, CAP_KQUEUE_CHANGE) \ - MAPPING(CLOUDABI_RIGHT_POLL_PROC_TERMINATE, CAP_PDWAIT) \ + MAPPING(CLOUDABI_RIGHT_POLL_PROC_TERMINATE, CAP_EVENT) \ MAPPING(CLOUDABI_RIGHT_POLL_WAIT, CAP_KQUEUE_EVENT) \ MAPPING(CLOUDABI_RIGHT_PROC_EXEC, CAP_FEXECVE) \ MAPPING(CLOUDABI_RIGHT_SOCK_ACCEPT, CAP_ACCEPT) \ @@ -380,7 +380,8 @@ cloudabi_remove_conflicting_rights(cloud *inheriting = 0; break; case CLOUDABI_FILETYPE_PROCESS: - *base &= ~CLOUDABI_RIGHT_FILE_ADVISE; + *base &= ~(CLOUDABI_RIGHT_FILE_ADVISE | + CLOUDABI_RIGHT_POLL_FD_READWRITE); *inheriting = 0; break; case CLOUDABI_FILETYPE_REGULAR_FILE: Modified: head/sys/compat/cloudabi/cloudabi_proc.c == --- head/sys/compat/cloudabi/cloudabi_proc.cWed Aug 12 10:34:05 2015 (r286660) +++ head/sys/compat/cloudabi/cloudabi_proc.cWed Aug 12 11:07:03 2015 (r286661) @@ -74,7 +74,7 @@ cloudabi_sys_proc_fork(struct thread *td struct proc *p2; int error, fd; - cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_PDWAIT); + cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_EVENT); error = fork1(td, RFFDG | RFPROC | RFPROCDESC, 0, &p2, &fd, 0, &fcaps); if (error != 0) return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286660 - in head: sbin/camcontrol sbin/reboot usr.bin/mkimg usr.sbin/pwd_mkdb usr.sbin/sysrc usr.sbin/wake
Author: brueffer Date: Wed Aug 12 10:34:05 2015 New Revision: 286660 URL: https://svnweb.freebsd.org/changeset/base/286660 Log: Fix a few mandoc warnings. MFC after:1 week Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/reboot/nextboot.8 head/usr.bin/mkimg/mkimg.1 head/usr.sbin/pwd_mkdb/pwd_mkdb.8 head/usr.sbin/sysrc/sysrc.8 head/usr.sbin/wake/wake.8 Modified: head/sbin/camcontrol/camcontrol.8 == --- head/sbin/camcontrol/camcontrol.8 Wed Aug 12 09:55:52 2015 (r286659) +++ head/sbin/camcontrol/camcontrol.8 Wed Aug 12 10:34:05 2015 (r286660) @@ -2183,7 +2183,6 @@ current initiator will be unregistered f The reservation will be moved to relative target port 2 on the target device. The registration will persist across power losses. -.Pp .Bd -literal -offset indent camcontrol attrib sa0 -v -i attr_values -p 1 .Ed Modified: head/sbin/reboot/nextboot.8 == --- head/sbin/reboot/nextboot.8 Wed Aug 12 09:55:52 2015(r286659) +++ head/sbin/reboot/nextboot.8 Wed Aug 12 10:34:05 2015(r286660) @@ -135,4 +135,3 @@ If it scrambles your file system, do not is only able to read ZFS, not write to it. .Pa nextboot.conf will NOT be reset in case of a kernel boot failure. - Modified: head/usr.bin/mkimg/mkimg.1 == --- head/usr.bin/mkimg/mkimg.1 Wed Aug 12 09:55:52 2015(r286659) +++ head/usr.bin/mkimg/mkimg.1 Wed Aug 12 10:34:05 2015(r286660) @@ -327,4 +327,5 @@ utility first appeared in .Sh AUTHORS The .Nm -utility and manpage were written by Marcel Moolenaar +utility and manpage were written by +.An Marcel Moolenaar Aq Mt marc...@juniper.net . Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 == --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Wed Aug 12 09:55:52 2015 (r286659) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Wed Aug 12 10:34:05 2015 (r286660) @@ -132,7 +132,6 @@ The legacy format entries are endianness .Pp The following options may be specified and will affect the generation of legacy entries. -.Pp .Bl -tag -width flag .It Fl B Store data in big-endian format. Modified: head/usr.sbin/sysrc/sysrc.8 == --- head/usr.sbin/sysrc/sysrc.8 Wed Aug 12 09:55:52 2015(r286659) +++ head/usr.sbin/sysrc/sysrc.8 Wed Aug 12 10:34:05 2015(r286660) @@ -223,7 +223,6 @@ For example, the above and below stateme .Dq gif0 starts with an alpha-numeric character .Pq the letter Li g : -.Pp .Bl -tag -width indent+ .It \ .Nm @@ -278,7 +277,6 @@ For example, the above and below stateme .Dq gif0 starts with an alpha-numeric character .Pq the letter Li g : -.Pp .Bl -tag -width indent+ .It \ .Nm Modified: head/usr.sbin/wake/wake.8 == --- head/usr.sbin/wake/wake.8 Wed Aug 12 09:55:52 2015(r286659) +++ head/usr.sbin/wake/wake.8 Wed Aug 12 10:34:05 2015(r286660) @@ -65,4 +65,4 @@ Ethernet host name data base. .Sh AUTHORS .Nm was written by -.Ar Marc Balmer Aq Mt m...@msys.ch . +.An Marc Balmer Aq Mt m...@msys.ch . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286659 - head/sys/x86/x86
Author: kib Date: Wed Aug 12 09:55:52 2015 New Revision: 286659 URL: https://svnweb.freebsd.org/changeset/base/286659 Log: In x2APIC mode, IPI generation is atomic because it is performed by single ICR MSR write. This is in contrast with the xAPIC mode, where we must read current ICR value, do bit fiddling and perform two 32-bit register writes. As a consequence, there is no need to disable interrupts around ICR value calculation and write. Note that typical users of ipi_raw() and ipi_vectored() take spinlock, which already disables interrupts. For them, the change removes unneeded CLI and POPFL/Q instructions. Tested by:pho Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c == --- head/sys/x86/x86/local_apic.c Wed Aug 12 09:46:39 2015 (r286658) +++ head/sys/x86/x86/local_apic.c Wed Aug 12 09:55:52 2015 (r286659) @@ -1657,9 +1657,10 @@ native_lapic_ipi_raw(register_t icrlo, u ("%s: reserved bits set in ICR LO register", __func__)); /* Set destination in ICR HI register if it is being used. */ - saveintr = intr_disable(); - if (!x2apic_mode) + if (!x2apic_mode) { + saveintr = intr_disable(); icr = lapic_read_icr(); + } if ((icrlo & APIC_DEST_MASK) == APIC_DEST_DESTFLD) { if (x2apic_mode) { @@ -1682,7 +1683,8 @@ native_lapic_ipi_raw(register_t icrlo, u vlo |= icrlo; } lapic_write_icr(vhi, vlo); - intr_restore(saveintr); + if (!x2apic_mode) + intr_restore(saveintr); } #defineBEFORE_SPIN 5 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286658 - in head/sys: amd64/amd64 i386/i386
Author: kib Date: Wed Aug 12 09:46:39 2015 New Revision: 286658 URL: https://svnweb.freebsd.org/changeset/base/286658 Log: Initialization of smp_tlb_wait does not require release semantic, no data is synchronized by store/load to the variable. The lapic_write_icr() function ensures that store buffers are flushed before IPI command is issued. Discussed with: bde Tested by:pho Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Wed Aug 12 09:43:12 2015 (r286657) +++ head/sys/amd64/amd64/mp_machdep.c Wed Aug 12 09:46:39 2015 (r286658) @@ -440,7 +440,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; smp_tlb_pmap = pmap; - atomic_store_rel_int(&smp_tlb_wait, 0); + smp_tlb_wait = 0; if (CPU_ISFULLSET(&mask)) { ncpu = othercpus; ipi_all_but_self(vector); Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Wed Aug 12 09:43:12 2015 (r286657) +++ head/sys/i386/i386/mp_machdep.c Wed Aug 12 09:46:39 2015 (r286658) @@ -504,7 +504,7 @@ smp_tlb_shootdown(u_int vector, vm_offse mtx_lock_spin(&smp_ipi_mtx); smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; - atomic_store_rel_int(&smp_tlb_wait, 0); + smp_tlb_wait = 0; ipi_all_but_self(vector); while (smp_tlb_wait < ncpu) ia32_pause(); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286657 - in head/sys: amd64/amd64 i386/i386
Author: kib Date: Wed Aug 12 09:43:12 2015 New Revision: 286657 URL: https://svnweb.freebsd.org/changeset/base/286657 Log: AP should load aps_ready with acquire semantic to see BSP updates to the SMP structures, synchronized with the load by release store in release_aps(). The change is formal, x86 strong memory model implicitely provided the guarantees. Discussed with: bde Tested by:pho Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Wed Aug 12 08:41:48 2015 (r286656) +++ head/sys/amd64/amd64/mp_machdep.c Wed Aug 12 09:43:12 2015 (r286657) @@ -282,7 +282,7 @@ init_secondary(void) mp_naps++; /* Spin until the BSP releases the AP's. */ - while (!aps_ready) + while (atomic_load_acq_int(&aps_ready) == 0) ia32_pause(); init_secondary_tail(); Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Wed Aug 12 08:41:48 2015 (r286656) +++ head/sys/i386/i386/mp_machdep.c Wed Aug 12 09:43:12 2015 (r286657) @@ -291,7 +291,7 @@ init_secondary(void) CHECK_WRITE(0x39, 6); /* Spin until the BSP releases the AP's. */ - while (!aps_ready) + while (atomic_load_acq_int(&aps_ready) == 0) ia32_pause(); /* BSP may have changed PTD while we were waiting */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286656 - head/sys/compat/cloudabi64
Author: ed Date: Wed Aug 12 08:41:48 2015 New Revision: 286656 URL: https://svnweb.freebsd.org/changeset/base/286656 Log: Make blocking CloudABI futex operations work. Blocking on locks and condition variables can be accomplished by polling and using the special filters CONDVAR, LOCK_RDLOCK and LOCK_WRLOCK. For now it wouldn't make sense to implement this functionality into kqueue() itself, for the reason that they are CloudABI specific and would require us to resize 'struct kevent' to hold all of the parameters of interest. Add a bandaid to the CloudABI poll system call to call into the futex code directly if it detects specific combinations of events that are used by the C library. Obtained from:https://github.com/NuxiNL/freebsd Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c == --- head/sys/compat/cloudabi64/cloudabi64_poll.cWed Aug 12 08:36:58 2015(r286655) +++ head/sys/compat/cloudabi64/cloudabi64_poll.cWed Aug 12 08:41:48 2015(r286656) @@ -244,6 +244,127 @@ cloudabi64_sys_poll(struct thread *td, s .arg= &args, }; + /* +* Bandaid to support CloudABI futex constructs that are not +* implemented through FreeBSD's kqueue(). +*/ + if (uap->nevents == 1) { + cloudabi64_subscription_t sub; + cloudabi64_event_t ev = {}; + int error; + + error = copyin(uap->in, &sub, sizeof(sub)); + if (error != 0) + return (error); + ev.userdata = sub.userdata; + ev.type = sub.type; + if (sub.type == CLOUDABI_EVENTTYPE_CONDVAR) { + /* Wait on a condition variable. */ + ev.condvar.condvar = sub.condvar.condvar; + ev.error = cloudabi_convert_errno( + cloudabi_futex_condvar_wait( + td, (cloudabi_condvar_t *)sub.condvar.condvar, + sub.condvar.condvar_scope, + (cloudabi_lock_t *)sub.condvar.lock, + sub.condvar.lock_scope, + CLOUDABI_CLOCK_MONOTONIC, UINT64_MAX, 0)); + td->td_retval[0] = 1; + return (copyout(&ev, uap->out, sizeof(ev))); + } else if (sub.type == CLOUDABI_EVENTTYPE_LOCK_RDLOCK) { + /* Acquire a read lock. */ + ev.lock.lock = sub.lock.lock; + ev.error = cloudabi_convert_errno( + cloudabi_futex_lock_rdlock( + td, (cloudabi_lock_t *)sub.lock.lock, + sub.lock.lock_scope, CLOUDABI_CLOCK_MONOTONIC, + UINT64_MAX, 0)); + td->td_retval[0] = 1; + return (copyout(&ev, uap->out, sizeof(ev))); + } else if (sub.type == CLOUDABI_EVENTTYPE_LOCK_WRLOCK) { + /* Acquire a write lock. */ + ev.lock.lock = sub.lock.lock; + ev.error = cloudabi_convert_errno( + cloudabi_futex_lock_wrlock( + td, (cloudabi_lock_t *)sub.lock.lock, + sub.lock.lock_scope, CLOUDABI_CLOCK_MONOTONIC, + UINT64_MAX, 0)); + td->td_retval[0] = 1; + return (copyout(&ev, uap->out, sizeof(ev))); + } + } else if (uap->nevents == 2) { + cloudabi64_subscription_t sub[2]; + cloudabi64_event_t ev[2] = {}; + int error; + + error = copyin(uap->in, &sub, sizeof(sub)); + if (error != 0) + return (error); + ev[0].userdata = sub[0].userdata; + ev[0].type = sub[0].type; + ev[1].userdata = sub[1].userdata; + ev[1].type = sub[1].type; + if (sub[0].type == CLOUDABI_EVENTTYPE_CONDVAR && + sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && + sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { + /* Wait for a condition variable with timeout. */ + ev[0].condvar.condvar = sub[0].condvar.condvar; + ev[1].clock.identifier = sub[1].clock.identifier; + error = cloudabi_futex_condvar_wait( + td, (cloudabi_condvar_t *)sub[0].condvar.condvar, + sub[0].condvar.condvar_scope, + (cloudabi_lock_t *)sub[0].condvar.lock, + sub[0].
svn commit: r286655 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Wed Aug 12 08:36:58 2015 New Revision: 286655 URL: https://svnweb.freebsd.org/changeset/base/286655 Log: Fix set of sign extension bugs in r286625. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Aug 12 07:59:00 2015(r286654) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Aug 12 08:36:58 2015(r286655) @@ -3145,7 +3145,7 @@ arc_available_memory(void) * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. */ - n = PAGESIZE * (int64_t)(freemem - zfs_arc_free_target); + n = PAGESIZE * ((int64_t)freemem - zfs_arc_free_target); if (n < lowest) { lowest = n; r = FMR_LOTSFREE; @@ -3207,7 +3207,7 @@ arc_available_memory(void) * heap is allocated. (Or, in the calculation, if less than 1/4th is * free) */ - n = vmem_size(heap_arena, VMEM_FREE) - + n = (int64_t)vmem_size(heap_arena, VMEM_FREE) - (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) >> 2); if (n < lowest) { lowest = n; @@ -3228,7 +3228,7 @@ arc_available_memory(void) * memory fragmentation issues. */ if (zio_arena != NULL) { - n = vmem_size(zio_arena, VMEM_FREE) - + n = (int64_t)vmem_size(zio_arena, VMEM_FREE) - (vmem_size(zio_arena, VMEM_ALLOC) >> 4); if (n < lowest) { lowest = n; @@ -3242,7 +3242,8 @@ arc_available_memory(void) */ if (lowest > 0) { n = (vmem_size(heap_arena, VMEM_MAXFREE) < zfs_max_recordsize) ? - -(vmem_size(heap_arena, VMEM_ALLOC) >> 4) : INT64_MAX; + -((int64_t)vmem_size(heap_arena, VMEM_ALLOC) >> 4) : + INT64_MAX; if (n < lowest) { lowest = n; r = FMR_ZIO_FRAG; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286654 - head/sys/compat/cloudabi64
Author: ed Date: Wed Aug 12 07:59:00 2015 New Revision: 286654 URL: https://svnweb.freebsd.org/changeset/base/286654 Log: Make poll() and kqueue() on CloudABI work. This change implements two functions, cloudabi64_kevent_copyin() and cloudabi64_kevent_copyout(), that convert CloudABI structures to FreeBSD's struct kevent. CloudABI uses two structures: subscription_t and event_t. The former is used for input, whereas the latter is used for output. Unlike struct kevent, fields aren't overloaded for multiple purposes or for separate event types. For poll() we call into the newly introduced kern_kevent_anonymous() function that allows us to poll without a file descriptor. This function is not only used by poll(), but also by functions such as sleep() and clock_nanosleep(). Reviewed by: jmg Obtained from:https://github.com/NuxiNL/freebsd Differential Revision:https://reviews.freebsd.org/D3308 Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c == --- head/sys/compat/cloudabi64/cloudabi64_poll.cWed Aug 12 04:03:04 2015(r286653) +++ head/sys/compat/cloudabi64/cloudabi64_poll.cWed Aug 12 07:59:00 2015(r286654) @@ -26,22 +26,260 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include + +#include + #include #include +/* Converts a FreeBSD signal number to a CloudABI signal number. */ +static cloudabi_signal_t +convert_signal(int sig) +{ + static const cloudabi_signal_t signals[] = { + [SIGABRT] = CLOUDABI_SIGABRT, + [SIGALRM] = CLOUDABI_SIGALRM, + [SIGBUS]= CLOUDABI_SIGBUS, + [SIGCHLD] = CLOUDABI_SIGCHLD, + [SIGCONT] = CLOUDABI_SIGCONT, + [SIGFPE]= CLOUDABI_SIGFPE, + [SIGHUP]= CLOUDABI_SIGHUP, + [SIGILL]= CLOUDABI_SIGILL, + [SIGINT]= CLOUDABI_SIGINT, + [SIGKILL] = CLOUDABI_SIGKILL, + [SIGPIPE] = CLOUDABI_SIGPIPE, + [SIGQUIT] = CLOUDABI_SIGQUIT, + [SIGSEGV] = CLOUDABI_SIGSEGV, + [SIGSTOP] = CLOUDABI_SIGSTOP, + [SIGSYS]= CLOUDABI_SIGSYS, + [SIGTERM] = CLOUDABI_SIGTERM, + [SIGTRAP] = CLOUDABI_SIGTRAP, + [SIGTSTP] = CLOUDABI_SIGTSTP, + [SIGTTIN] = CLOUDABI_SIGTTIN, + [SIGTTOU] = CLOUDABI_SIGTTOU, + [SIGURG]= CLOUDABI_SIGURG, + [SIGUSR1] = CLOUDABI_SIGUSR1, + [SIGUSR2] = CLOUDABI_SIGUSR2, + [SIGVTALRM] = CLOUDABI_SIGVTALRM, + [SIGXCPU] = CLOUDABI_SIGXCPU, + [SIGXFSZ] = CLOUDABI_SIGXFSZ, + }; + + /* Convert unknown signals to SIGABRT. */ + if (sig < 0 || sig >= nitems(signals) || signals[sig] == 0) + return (SIGABRT); + return (signals[sig]); +} + +struct cloudabi64_kevent_args { + const cloudabi64_subscription_t *in; + cloudabi64_event_t *out; + bool once; +}; + +/* Converts CloudABI's subscription objects to FreeBSD's struct kevent. */ +static int +cloudabi64_kevent_copyin(void *arg, struct kevent *kevp, int count) +{ + cloudabi64_subscription_t sub; + struct cloudabi64_kevent_args *args; + cloudabi_timestamp_t ts; + int error; + + args = arg; + while (count-- > 0) { + /* TODO(ed): Copy in multiple entries at once. */ + error = copyin(args->in++, &sub, sizeof(sub)); + if (error != 0) + return (error); + + memset(kevp, 0, sizeof(*kevp)); + kevp->udata = (void *)sub.userdata; + switch (sub.type) { + case CLOUDABI_EVENTTYPE_CLOCK: + kevp->filter = EVFILT_TIMER; + kevp->ident = sub.clock.identifier; + kevp->fflags = NOTE_NSECONDS; + if ((sub.clock.flags & + CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) != 0 && + sub.clock.timeout > 0) { + /* Convert absolute timestamp to a relative. */ + error = cloudabi_clock_time_get(curthread, + sub.clock.clock_id, &ts); + if (error != 0) + return (error); + ts = ts > sub.clock.timeout ? 0 : + sub.clock.timeout - ts; + } else { + /* Relative timestamp. */ + ts = sub.clock.tim