From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 11:22:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F389106566B; Sun, 28 Mar 2010 11:22:39 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2B48FC18; Sun, 28 Mar 2010 11:22:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SBMdws006807; Sun, 28 Mar 2010 11:22:39 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SBMduE006805; Sun, 28 Mar 2010 11:22:39 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201003281122.o2SBMduE006805@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 28 Mar 2010 11:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205790 - stable/8/usr.bin/touch X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 11:22:39 -0000 Author: jh Date: Sun Mar 28 11:22:38 2010 New Revision: 205790 URL: http://svn.freebsd.org/changeset/base/205790 Log: MFC r198175: - If lstat()/stat() fails with an error other than ENOENT, don't ignore the error and assume that the file doesn't exist. Touch could return success with -c option even if the file existed and time was not set. - If the first utimes_f() call fails with -A option, give up and don't continue trying to set times to current time. [1] - Set exit status to 1 when setting of timestamps fails for a directory or symbolic link even though lstat()/stat() would succeed. - Don't print bogus error message when rw() succeeds. PR: bin/112213 Modified: stable/8/usr.bin/touch/touch.c Directory Properties: stable/8/usr.bin/touch/ (props changed) Modified: stable/8/usr.bin/touch/touch.c ============================================================================== --- stable/8/usr.bin/touch/touch.c Sun Mar 28 06:51:50 2010 (r205789) +++ stable/8/usr.bin/touch/touch.c Sun Mar 28 11:22:38 2010 (r205790) @@ -164,6 +164,11 @@ main(int argc, char *argv[]) for (rval = 0; *argv; ++argv) { /* See if the file exists. */ if (stat_f(*argv, &sb) != 0) { + if (errno != ENOENT) { + rval = 1; + warn("%s", *argv); + continue; + } if (!cflag) { /* Create the file. */ fd = open(*argv, @@ -206,7 +211,7 @@ main(int argc, char *argv[]) continue; /* If the user specified a time, nothing else we can do. */ - if (timeset) { + if (timeset || Aflag) { rval = 1; warn("%s", *argv); continue; @@ -222,11 +227,13 @@ main(int argc, char *argv[]) continue; /* Try reading/writing. */ - if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_mode) && - rw(*argv, &sb, fflag)) + if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_mode)) { + if (rw(*argv, &sb, fflag)) + rval = 1; + } else { rval = 1; - else warn("%s", *argv); + } } exit(rval); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 18:43:04 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54131065676; Sun, 28 Mar 2010 18:43:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3BFE8FC13; Sun, 28 Mar 2010 18:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SIh4sB007117; Sun, 28 Mar 2010 18:43:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SIh4oa007115; Sun, 28 Mar 2010 18:43:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201003281843.o2SIh4oa007115@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Mar 2010 18:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205797 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 18:43:05 -0000 Author: trasz Date: Sun Mar 28 18:43:04 2010 New Revision: 205797 URL: http://svn.freebsd.org/changeset/base/205797 Log: MFC r203549: Add missing coma. Modified: stable/8/share/man/man9/mtx_pool.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/mtx_pool.9 ============================================================================== --- stable/8/share/man/man9/mtx_pool.9 Sun Mar 28 17:29:15 2010 (r205796) +++ stable/8/share/man/man9/mtx_pool.9 Sun Mar 28 18:43:04 2010 (r205797) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2002 +.Dd February 6, 2010 .Dt MTX_POOL 9 .Os .Sh NAME @@ -177,7 +177,7 @@ on each mutex in the specified pool, deallocates the memory associated with the pool, and assigns NULL to the pool pointer. .Sh SEE ALSO -.Xr locking 9 +.Xr locking 9 , .Xr mutex 9 .Sh HISTORY These routines first appeared in From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 18:44:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC38106566B; Sun, 28 Mar 2010 18:44:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B33E8FC1A; Sun, 28 Mar 2010 18:44:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SIitnM007944; Sun, 28 Mar 2010 18:44:55 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SIis4N007942; Sun, 28 Mar 2010 18:44:54 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201003281844.o2SIis4N007942@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Mar 2010 18:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205798 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 18:44:55 -0000 Author: trasz Date: Sun Mar 28 18:44:54 2010 New Revision: 205798 URL: http://svn.freebsd.org/changeset/base/205798 Log: MFC r203721: Add references to VOP_* man pages to vnode(9). Modified: stable/8/share/man/man9/vnode.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/vnode.9 ============================================================================== --- stable/8/share/man/man9/vnode.9 Sun Mar 28 18:43:04 2010 (r205797) +++ stable/8/share/man/man9/vnode.9 Sun Mar 28 18:44:54 2010 (r205798) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2003 +.Dd February 9, 2010 .Os .Dt VNODE 9 .Sh NAME @@ -161,6 +161,38 @@ interlock, will cause a LOR (Lock Order intertwining of VM Objects and Vnodes. .Sh SEE ALSO .Xr malloc 9 , +.Xr VOP_ACCESS 9 , +.Xr VOP_ACLCHECK 9 , +.Xr VOP_ADVLOCK 9 , +.Xr VOP_ATTRIB 9 , +.Xr VOP_BWRITE 9 , +.Xr VOP_CREATE 9 , +.Xr VOP_FSYNC 9 , +.Xr VOP_GETACL 9 , +.Xr VOP_GETEXTATTR 9 , +.Xr VOP_GETPAGES 9 , +.Xr VOP_GETVOBJECT 9 , +.Xr VOP_INACTIVE 9 , +.Xr VOP_IOCTL 9 , +.Xr VOP_LINK 9 , +.Xr VOP_LISTEXTATTR 9 , +.Xr VOP_LOCK 9 , +.Xr VOP_LOOKUP 9 , +.Xr VOP_OPENCLOSE 9 , +.Xr VOP_PATHCONF 9 , +.Xr VOP_PRINT 9 , +.Xr VOP_RDWR 9 , +.Xr VOP_READDIR 9 , +.Xr VOP_READLINK 9 , +.Xr VOP_REALLOCBLKS 9 , +.Xr VOP_REMOVE 9 , +.Xr VOP_RENAME 9 , +.Xr VOP_REVOKE 9 , +.Xr VOP_SETACL 9 , +.Xr VOP_SETEXTATTR 9 , +.Xr VOP_STRATEGY 9 , +.Xr VOP_VPTOCNP 9 , +.Xr VOP_VPTOFH 9 , .Xr VFS 9 .Sh AUTHORS This manual page was written by From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 18:46:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 861FE106564A; Sun, 28 Mar 2010 18:46:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74E808FC0C; Sun, 28 Mar 2010 18:46:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SIk1sG008422; Sun, 28 Mar 2010 18:46:01 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SIk1uQ008420; Sun, 28 Mar 2010 18:46:01 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201003281846.o2SIk1uQ008420@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Mar 2010 18:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205799 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 18:46:01 -0000 Author: trasz Date: Sun Mar 28 18:46:01 2010 New Revision: 205799 URL: http://svn.freebsd.org/changeset/base/205799 Log: MFC r203824: Fix VBAD description. Modified: stable/8/share/man/man9/vnode.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/vnode.9 ============================================================================== --- stable/8/share/man/man9/vnode.9 Sun Mar 28 18:44:54 2010 (r205798) +++ stable/8/share/man/man9/vnode.9 Sun Mar 28 18:46:01 2010 (r205799) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2010 +.Dd February 13, 2010 .Os .Dt VNODE 9 .Sh NAME @@ -137,7 +137,7 @@ Advisory locking will not work on this. A FIFO (named pipe). Advisory locking will not work on this. .It Dv VBAD -An old style bad sector map +Indicates that the vnode has been reclaimed. .El .Sh IMPLEMENTATION NOTES VFIFO uses the "struct fileops" from From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 19:34:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7C3106566B; Sun, 28 Mar 2010 19:34:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5A68FC0A; Sun, 28 Mar 2010 19:34:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SJYvrs022900; Sun, 28 Mar 2010 19:34:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SJYvSq022890; Sun, 28 Mar 2010 19:34:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201003281934.o2SJYvSq022890@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 28 Mar 2010 19:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205800 - in stable/8/tools/regression/bin/sh: builtins errors expansion parser X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 19:34:58 -0000 Author: jilles Date: Sun Mar 28 19:34:57 2010 New Revision: 205800 URL: http://svn.freebsd.org/changeset/base/205800 Log: MFC r196607,r198453,r204016,r204017,r204836,r204842,r205105,r205153 Various testcases that work correctly with stable/8 sh. Note: this creates some gaps in the numbering due to lower-numbered tests for new functionality which is not or not yet MFC'ed. Added: stable/8/tools/regression/bin/sh/builtins/eval3.0 - copied unchanged from r196607, head/tools/regression/bin/sh/builtins/eval3.0 stable/8/tools/regression/bin/sh/errors/redirection-error5.0 - copied unchanged from r205153, head/tools/regression/bin/sh/errors/redirection-error5.0 stable/8/tools/regression/bin/sh/expansion/arith3.0 - copied unchanged from r204017, head/tools/regression/bin/sh/expansion/arith3.0 stable/8/tools/regression/bin/sh/expansion/assign1.0 - copied unchanged from r204842, head/tools/regression/bin/sh/expansion/assign1.0 stable/8/tools/regression/bin/sh/expansion/cmdsubst2.0 - copied unchanged from r205105, head/tools/regression/bin/sh/expansion/cmdsubst2.0 stable/8/tools/regression/bin/sh/expansion/plus-minus1.0 - copied unchanged from r204842, head/tools/regression/bin/sh/expansion/plus-minus1.0 stable/8/tools/regression/bin/sh/expansion/question1.0 - copied unchanged from r198453, head/tools/regression/bin/sh/expansion/question1.0 stable/8/tools/regression/bin/sh/expansion/set-u1.0 - copied unchanged from r198453, head/tools/regression/bin/sh/expansion/set-u1.0 stable/8/tools/regression/bin/sh/parser/heredoc1.0 - copied unchanged from r204836, head/tools/regression/bin/sh/parser/heredoc1.0 Modified: stable/8/tools/regression/bin/sh/expansion/arith2.0 Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/eval3.0 (from r196607, head/tools/regression/bin/sh/builtins/eval3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/eval3.0 Sun Mar 28 19:34:57 2010 (r205800, copy of r196607, head/tools/regression/bin/sh/builtins/eval3.0) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +eval 'false;' && exit 1 +eval 'true;' || exit 1 +eval 'false; +' && exit 1 +eval 'true; +' || exit 1 +exit 0 Copied: stable/8/tools/regression/bin/sh/errors/redirection-error5.0 (from r205153, head/tools/regression/bin/sh/errors/redirection-error5.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/errors/redirection-error5.0 Sun Mar 28 19:34:57 2010 (r205800, copy of r205153, head/tools/regression/bin/sh/errors/redirection-error5.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ +# A redirection error on a subshell should not abort the shell. +exec 2>/dev/null +( echo bad ) 0)) Copied: stable/8/tools/regression/bin/sh/expansion/plus-minus1.0 (from r204842, head/tools/regression/bin/sh/expansion/plus-minus1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/plus-minus1.0 Sun Mar 28 19:34:57 2010 (r205800, copy of r204842, head/tools/regression/bin/sh/expansion/plus-minus1.0) @@ -0,0 +1,81 @@ +# $FreeBSD$ + +e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' +h='##' +failures='' +ok='' + +testcase() { + code="$1" + expected="$2" + oIFS="$IFS" + eval "$code" + IFS='|' + result="$#|$*" + IFS="$oIFS" + if [ "x$result" = "x$expected" ]; then + ok=x$ok + else + failures=x$failures + echo "For $code, expected $expected actual $result" + fi +} + +testcase 'set -- a b' '2|a|b' +testcase 'set --' '0|' +testcase 'set -- ${e}' '0|' +testcase 'set -- "${e}"' '1|' + +testcase 'set -- $p' '1|/etc/' +testcase 'set -- "$p"' '1|/et[c]/' +testcase 'set -- ${s+$p}' '1|/etc/' +testcase 'set -- "${s+$p}"' '1|/et[c]/' +testcase 'set -- ${s+"$p"}' '1|/et[c]/' +# Dquotes in dquotes is undefined for Bourne shell operators +#testcase 'set -- "${s+"$p"}"' '1|/et[c]/' +testcase 'set -- ${e:-$p}' '1|/etc/' +testcase 'set -- "${e:-$p}"' '1|/et[c]/' +testcase 'set -- ${e:-"$p"}' '1|/et[c]/' +# Dquotes in dquotes is undefined for Bourne shell operators +#testcase 'set -- "${e:-"$p"}"' '1|/et[c]/' +testcase 'set -- ${e:+"$e"}' '0|' +testcase 'set -- ${e:+$w"$e"}' '0|' +testcase 'set -- ${w:+"$w"}' '1|a b c' +testcase 'set -- ${w:+$w"$w"}' '3|a|b|ca b c' + +# These two are known broken in FreeBSD /bin/sh +#testcase 'set -- ${s+a b}' '2|a|b' +#testcase 'set -- ${e:-a b}' '2|a|b' +testcase 'set -- "${s+a b}"' '1|a b' +testcase 'set -- "${e:-a b}"' '1|a b' +testcase 'set -- ${e:-\}}' '1|}' +# Currently broken in FreeBSD /bin/sh +#testcase 'set -- "${e:-\}}"' '1|}' +testcase 'set -- ${e:+{}}' '1|}' +testcase 'set -- "${e:+{}}"' '1|}' + +testcase 'set -- ${e+x}${e+x}' '1|xx' +testcase 'set -- "${e+x}"${e+x}' '1|xx' +testcase 'set -- ${e+x}"${e+x}"' '1|xx' +testcase 'set -- "${e+x}${e+x}"' '1|xx' +testcase 'set -- "${e+x}""${e+x}"' '1|xx' + +testcase 'set -- ${e:-${e:-$p}}' '1|/etc/' +testcase 'set -- "${e:-${e:-$p}}"' '1|/et[c]/' +testcase 'set -- ${e:-"${e:-$p}"}' '1|/et[c]/' +testcase 'set -- ${e:-${e:-"$p"}}' '1|/et[c]/' +testcase 'set -- ${e:-${e:-${e:-$w}}}' '3|a|b|c' +testcase 'set -- ${e:-${e:-${e:-"$w"}}}' '1|a b c' +testcase 'set -- ${e:-${e:-"${e:-$w}"}}' '1|a b c' +testcase 'set -- ${e:-"${e:-${e:-$w}}"}' '1|a b c' +testcase 'set -- "${e:-${e:-${e:-$w}}}"' '1|a b c' + +testcase 'shift $#; set -- ${1+"$@"}' '0|' +testcase 'set -- ""; set -- ${1+"$@"}' '1|' +testcase 'set -- "" a; set -- ${1+"$@"}' '2||a' +testcase 'set -- a ""; set -- ${1+"$@"}' '2|a|' +testcase 'set -- a b; set -- ${1+"$@"}' '2|a|b' +testcase 'set -- a\ b; set -- ${1+"$@"}' '1|a b' +testcase 'set -- " " ""; set -- ${1+"$@"}' '2| |' + +test "x$failures" = x Copied: stable/8/tools/regression/bin/sh/expansion/question1.0 (from r198453, head/tools/regression/bin/sh/expansion/question1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/question1.0 Sun Mar 28 19:34:57 2010 (r205800, copy of r198453, head/tools/regression/bin/sh/expansion/question1.0) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +x=a\ b +[ "$x" = "${x?}" ] || exit 1 +set -- ${x?} +{ [ "$#" = 2 ] && [ "$1" = a ] && [ "$2" = b ]; } || exit 1 +unset x +(echo ${x?abcdefg}) 2>&1 | grep -q abcdefg || exit 1 +sh -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 1 +sh -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 1 +sh -c 'foo=; echo ${foo?}' >/dev/null || exit 1 +sh -c 'foo=1; echo ${foo:?}' >/dev/null || exit 1 +sh -c 'echo ${!?}' 2>/dev/null && exit 1 +sh -c ':& echo ${!?}' >/dev/null || exit 1 +sh -c 'echo ${#?}' >/dev/null || exit 1 +sh -c 'echo ${*?}' 2>/dev/null && exit 1 +sh -c 'echo ${*?}' sh x >/dev/null || exit 1 +sh -c 'echo ${1?}' 2>/dev/null && exit 1 +sh -c 'echo ${1?}' sh x >/dev/null || exit 1 +sh -c 'echo ${2?}' sh x 2>/dev/null && exit 1 +sh -c 'echo ${2?}' sh x y >/dev/null || exit 1 +exit 0 Copied: stable/8/tools/regression/bin/sh/expansion/set-u1.0 (from r198453, head/tools/regression/bin/sh/expansion/set-u1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/set-u1.0 Sun Mar 28 19:34:57 2010 (r205800, copy of r198453, head/tools/regression/bin/sh/expansion/set-u1.0) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +sh -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 +sh -uc 'foo=; echo $foo' >/dev/null || exit 1 +sh -uc 'foo=1; echo $foo' >/dev/null || exit 1 +# -/+/= are unaffected by set -u +sh -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1 +sh -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1 +sh -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1 +# length/trimming are affected +sh -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1 +sh -uc 'foo=; echo ${#foo}' >/dev/null || exit 1 +sh -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1 +sh -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1 +sh -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1 +sh -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1 +sh -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1 +sh -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1 +sh -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1 +sh -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1 + +sh -uc 'echo $!' 2>/dev/null && exit 1 +sh -uc ':& echo $!' >/dev/null || exit 1 +sh -uc 'echo $#' >/dev/null || exit 1 +sh -uc 'echo $1' 2>/dev/null && exit 1 +sh -uc 'echo $1' sh x >/dev/null || exit 1 +sh -uc 'echo $2' sh x 2>/dev/null && exit 1 +sh -uc 'echo $2' sh x y >/dev/null || exit 1 +exit 0 Copied: stable/8/tools/regression/bin/sh/parser/heredoc1.0 (from r204836, head/tools/regression/bin/sh/parser/heredoc1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/parser/heredoc1.0 Sun Mar 28 19:34:57 2010 (r205800, copy of r204836, head/tools/regression/bin/sh/parser/heredoc1.0) @@ -0,0 +1,85 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check '"$(cat < Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FADB1065678; Sun, 28 Mar 2010 20:19:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F9F48FC23; Sun, 28 Mar 2010 20:19:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2SKJfdQ033859; Sun, 28 Mar 2010 20:19:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2SKJfPg033857; Sun, 28 Mar 2010 20:19:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201003282019.o2SKJfPg033857@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 28 Mar 2010 20:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 20:19:41 -0000 Author: jilles Date: Sun Mar 28 20:19:41 2010 New Revision: 205806 URL: http://svn.freebsd.org/changeset/base/205806 Log: MFC r200818: rc.subr: Use pwait in wait_for_pids. This waits for the requested process(es) to terminate, rather than polling with an interval of 2 seconds. If pwait is not available, the old method is used. PR: conf/132766 Modified: stable/8/etc/rc.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Sun Mar 28 20:09:04 2010 (r205805) +++ stable/8/etc/rc.subr Sun Mar 28 20:19:41 2010 (r205806) @@ -390,7 +390,7 @@ wait_for_pids() _list=$_nlist echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " - sleep 2 + pwait $_list 2>/dev/null || sleep 2 done if [ -n "$_prefix" ]; then echo "." From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 20:28:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0383106566B for ; Sun, 28 Mar 2010 20:28:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 618E38FC17 for ; Sun, 28 Mar 2010 20:28:44 +0000 (UTC) Received: (qmail 26274 invoked by uid 399); 28 Mar 2010 20:28:43 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 28 Mar 2010 20:28:43 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BAFBBFA.7020701@FreeBSD.org> Date: Sun, 28 Mar 2010 13:28:42 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100218 Thunderbird/3.0.1 MIME-Version: 1.0 To: Jilles Tjoelker References: <201003282019.o2SKJfPg033857@svn.freebsd.org> In-Reply-To: <201003282019.o2SKJfPg033857@svn.freebsd.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 20:28:45 -0000 Probably my fault for not saying something sooner, but there is a problem with the code in head that sometimes causes it to loop repeatedly even though pwait exits successfully. I am trying to track it down, but since it only happens about once every 10 shutdowns it's been difficult. Please don't mfc this to any of the other branches till we've had a chance to discuss it further. Thanks, Doug From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 21:06:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F4DC1065670; Sun, 28 Mar 2010 21:06:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 458988FC0A; Sun, 28 Mar 2010 21:06:31 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 4E2B035A855; Sun, 28 Mar 2010 23:06:30 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 3B8B61735E; Sun, 28 Mar 2010 23:06:30 +0200 (CEST) Date: Sun, 28 Mar 2010 23:06:30 +0200 From: Jilles Tjoelker To: Doug Barton Message-ID: <20100328210630.GA2086@stack.nl> References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BAFBBFA.7020701@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 21:06:31 -0000 On Sun, Mar 28, 2010 at 01:28:42PM -0700, Doug Barton wrote: > Probably my fault for not saying something sooner, but there is a > problem with the code in head that sometimes causes it to loop > repeatedly even though pwait exits successfully. I am trying to track it > down, but since it only happens about once every 10 shutdowns it's been > difficult. There is a difference between the two methods in what is waited for exactly. pwait(1) will wait for the process to terminate; if it is applied to a zombie it will return immediately (printing the exit status if -v was given). On the other hand, kill(1) will continue to return success until the process has been waited for by its parent. An obvious fix is to trust pwait if it returns successfully, e.g. like if pwait $_list 2>/dev/null; then break; else sleep 2; fi -- Jilles Tjoelker From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 22:52:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799FD106564A; Sun, 28 Mar 2010 22:52:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 543778FC1E; Sun, 28 Mar 2010 22:52:24 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 05D3C46B46; Sun, 28 Mar 2010 18:52:24 -0400 (EDT) Date: Sun, 28 Mar 2010 23:52:23 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jilles Tjoelker In-Reply-To: <20100328210630.GA2086@stack.nl> Message-ID: References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> <20100328210630.GA2086@stack.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 22:52:24 -0000 On Sun, 28 Mar 2010, Jilles Tjoelker wrote: > On Sun, Mar 28, 2010 at 01:28:42PM -0700, Doug Barton wrote: >> Probably my fault for not saying something sooner, but there is a problem >> with the code in head that sometimes causes it to loop repeatedly even >> though pwait exits successfully. I am trying to track it down, but since it >> only happens about once every 10 shutdowns it's been difficult. > > There is a difference between the two methods in what is waited for exactly. > pwait(1) will wait for the process to terminate; if it is applied to a > zombie it will return immediately (printing the exit status if -v was > given). On the other hand, kill(1) will continue to return success until the > process has been waited for by its parent. > > An obvious fix is to trust pwait if it returns successfully, e.g. like if > pwait $_list 2>/dev/null; then break; else sleep 2; fi I noticed last year that Apple has implemented a separate PROC_REAP event in kqueue -- it would be easy for us to implement that as well, and add a flag to pwait to allow the user to decide to use that semantic instead (if desired). Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 28 23:10:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D419D1065675 for ; Sun, 28 Mar 2010 23:10:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1B68FC20 for ; Sun, 28 Mar 2010 23:10:40 +0000 (UTC) Received: (qmail 19358 invoked by uid 399); 28 Mar 2010 23:10:40 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 28 Mar 2010 23:10:40 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BAFE1EE.9040908@FreeBSD.org> Date: Sun, 28 Mar 2010 16:10:38 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100218 Thunderbird/3.0.1 MIME-Version: 1.0 To: Jilles Tjoelker References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> <20100328210630.GA2086@stack.nl> In-Reply-To: <20100328210630.GA2086@stack.nl> X-Enigmail-Version: 1.0.1 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2010 23:10:41 -0000 On 03/28/10 14:06, Jilles Tjoelker wrote: > On Sun, Mar 28, 2010 at 01:28:42PM -0700, Doug Barton wrote: >> Probably my fault for not saying something sooner, but there is a >> problem with the code in head that sometimes causes it to loop >> repeatedly even though pwait exits successfully. I am trying to track it >> down, but since it only happens about once every 10 shutdowns it's been >> difficult. > > There is a difference between the two methods in what is waited for > exactly. pwait(1) will wait for the process to terminate; if it is > applied to a zombie it will return immediately (printing the exit status > if -v was given). On the other hand, kill(1) will continue to return > success until the process has been waited for by its parent. The process that I see this with most often is devd, does that fit the model you're describing? What are the implications of moving on after a successful pwait even though there is still a zombie process? > An obvious fix is to trust pwait if it returns successfully, e.g. like > if pwait $_list 2>/dev/null; then break; else sleep 2; fi It can't be break, the point of the loop is that wait_for_pids() takes a list. We may be able to use continue however. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 00:08:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8423106566B; Mon, 29 Mar 2010 00:08:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C74D68FC08; Mon, 29 Mar 2010 00:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T08wA1087340; Mon, 29 Mar 2010 00:08:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T08wOT087338; Mon, 29 Mar 2010 00:08:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003290008.o2T08wOT087338@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Mar 2010 00:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205810 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 00:08:59 -0000 Author: emaste Date: Mon Mar 29 00:08:58 2010 New Revision: 205810 URL: http://svn.freebsd.org/changeset/base/205810 Log: MFC r205411: Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA ioctl call, as it may sleep. Reviewed by: rwatson Modified: stable/8/sys/net/if_vlan.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if_vlan.c ============================================================================== --- stable/8/sys/net/if_vlan.c Sun Mar 28 22:46:56 2010 (r205809) +++ stable/8/sys/net/if_vlan.c Mon Mar 29 00:08:58 2010 (r205810) @@ -1335,9 +1335,9 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd case SIOCGIFMEDIA: VLAN_LOCK(); if (TRUNK(ifv) != NULL) { - error = (*PARENT(ifv)->if_ioctl)(PARENT(ifv), - SIOCGIFMEDIA, data); + p = PARENT(ifv); VLAN_UNLOCK(); + error = (*p->if_ioctl)(p, SIOCGIFMEDIA, data); /* Limit the result to the parent's current config. */ if (error == 0) { struct ifmediareq *ifmr; From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 00:14:52 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7F59106570F; Mon, 29 Mar 2010 00:14:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEFDC8FF43; Mon, 29 Mar 2010 00:14:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T0EYS5088729; Mon, 29 Mar 2010 00:14:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T0EYgg088726; Mon, 29 Mar 2010 00:14:34 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003290014.o2T0EYgg088726@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Mar 2010 00:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205813 - stable/8/sys/dev/aac X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 00:14:57 -0000 Author: emaste Date: Mon Mar 29 00:14:34 2010 New Revision: 205813 URL: http://svn.freebsd.org/changeset/base/205813 Log: MFC r204264: Minor diff reduction with Adaptec's driver: in aac_release_command() set cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default. In every place it was set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow. Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aac_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Mon Mar 29 00:13:16 2010 (r205812) +++ stable/8/sys/dev/aac/aac.c Mon Mar 29 00:14:34 2010 (r205813) @@ -1218,7 +1218,6 @@ aac_bio_command(struct aac_softc *sc, st cm->cm_complete = aac_bio_complete; cm->cm_private = bp; cm->cm_timestamp = time_uptime; - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; /* build the FIB */ fib = cm->cm_fib; @@ -1373,7 +1372,6 @@ aac_wait_command(struct aac_command *cm) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* Put the command on the ready queue and get things going */ - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; aac_enqueue_ready(cm); aac_startio(sc); error = msleep(cm, &sc->aac_io_lock, PRIBIO, "aacwait", 0); @@ -1423,6 +1421,7 @@ aac_release_command(struct aac_command * cm->cm_flags = 0; cm->cm_complete = NULL; cm->cm_private = NULL; + cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; cm->cm_fib->Header.XferState = AAC_FIBSTATE_EMPTY; cm->cm_fib->Header.StructType = AAC_FIBTYPE_TFIB; cm->cm_fib->Header.Flags = 0; Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Mon Mar 29 00:13:16 2010 (r205812) +++ stable/8/sys/dev/aac/aac_cam.c Mon Mar 29 00:14:34 2010 (r205813) @@ -453,7 +453,6 @@ aac_cam_action(struct cam_sim *sim, unio cm->cm_complete = aac_cam_complete; cm->cm_private = ccb; cm->cm_timestamp = time_uptime; - cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE; fib->Header.XferState = AAC_FIBSTATE_HOSTOWNED | From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 00:30:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C81A1065679; Mon, 29 Mar 2010 00:30:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19A788FC17; Mon, 29 Mar 2010 00:30:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T0UjHM092373; Mon, 29 Mar 2010 00:30:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T0Uiq9092367; Mon, 29 Mar 2010 00:30:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201003290030.o2T0Uiq9092367@svn.freebsd.org> From: Ed Maste Date: Mon, 29 Mar 2010 00:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205815 - stable/8/sys/dev/aac X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 00:30:45 -0000 Author: emaste Date: Mon Mar 29 00:30:44 2010 New Revision: 205815 URL: http://svn.freebsd.org/changeset/base/205815 Log: MFC aac(4) driver changes r204019: Include command type in COMMAND TIMEOUT messages to aid in debugging. r203885: Diff reduction with Adaptec's vendor driver. Driver version 2.1.9 chosen as that Adaptec version roughly corresponds with the current feature set merged to the in-tree driver. r203801: Garbage collect Falcon/PPC support that has not been used in released products, based on discussion with Adaptec. r198617: Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver. Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aac_cam.c stable/8/sys/dev/aac/aac_pci.c stable/8/sys/dev/aac/aacreg.h stable/8/sys/dev/aac/aacvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Mon Mar 29 00:23:46 2010 (r205814) +++ stable/8/sys/dev/aac/aac.c Mon Mar 29 00:30:44 2010 (r205815) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); /* * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters. */ -#define AAC_DRIVER_VERSION 0x02000000 #define AAC_DRIVERNAME "aac" #include "opt_aac.h" @@ -107,28 +106,6 @@ static int aac_dequeue_fib(struct aac_so static int aac_enqueue_response(struct aac_softc *sc, int queue, struct aac_fib *fib); -/* Falcon/PPC interface */ -static int aac_fa_get_fwstatus(struct aac_softc *sc); -static void aac_fa_qnotify(struct aac_softc *sc, int qbit); -static int aac_fa_get_istatus(struct aac_softc *sc); -static void aac_fa_clear_istatus(struct aac_softc *sc, int mask); -static void aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command, - u_int32_t arg0, u_int32_t arg1, - u_int32_t arg2, u_int32_t arg3); -static int aac_fa_get_mailbox(struct aac_softc *sc, int mb); -static void aac_fa_set_interrupts(struct aac_softc *sc, int enable); - -struct aac_interface aac_fa_interface = { - aac_fa_get_fwstatus, - aac_fa_qnotify, - aac_fa_get_istatus, - aac_fa_clear_istatus, - aac_fa_set_mailbox, - aac_fa_get_mailbox, - aac_fa_set_interrupts, - NULL, NULL, NULL -}; - /* StrongARM interface */ static int aac_sa_get_fwstatus(struct aac_softc *sc); static void aac_sa_qnotify(struct aac_softc *sc, int qbit); @@ -2374,8 +2351,9 @@ aac_timeout(struct aac_softc *sc) /* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) { cm->cm_flags |= AAC_CMD_TIMEDOUT; device_printf(sc->aac_dev, - "COMMAND %p TIMEOUT AFTER %d SECONDS\n", - cm, (int)(time_uptime-cm->cm_timestamp)); + "COMMAND %p (TYPE %d) TIMEOUT AFTER %d SECONDS\n", + cm, cm->cm_fib->Header.Command, + (int)(time_uptime-cm->cm_timestamp)); AAC_PRINT_FIB(sc, cm->cm_fib); timedout++; } @@ -2416,17 +2394,6 @@ aac_rx_get_fwstatus(struct aac_softc *sc } static int -aac_fa_get_fwstatus(struct aac_softc *sc) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM0_GETREG4(sc, AAC_FA_FWSTATUS); - return (val); -} - -static int aac_rkt_get_fwstatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2456,15 +2423,6 @@ aac_rx_qnotify(struct aac_softc *sc, int } static void -aac_fa_qnotify(struct aac_softc *sc, int qbit) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL1, qbit); - AAC_FA_HACK(sc); -} - -static void aac_rkt_qnotify(struct aac_softc *sc, int qbit) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2492,17 +2450,6 @@ aac_rx_get_istatus(struct aac_softc *sc) } static int -aac_fa_get_istatus(struct aac_softc *sc) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM0_GETREG2(sc, AAC_FA_DOORBELL0); - return (val); -} - -static int aac_rkt_get_istatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2530,15 +2477,6 @@ aac_rx_clear_istatus(struct aac_softc *s } static void -aac_fa_clear_istatus(struct aac_softc *sc, int mask) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL0_CLEAR, mask); - AAC_FA_HACK(sc); -} - -static void aac_rkt_clear_istatus(struct aac_softc *sc, int mask) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2576,24 +2514,6 @@ aac_rx_set_mailbox(struct aac_softc *sc, } static void -aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command, - u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX, command); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 4, arg0); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 8, arg1); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 12, arg2); - AAC_FA_HACK(sc); - AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 16, arg3); - AAC_FA_HACK(sc); -} - -static void aac_rkt_set_mailbox(struct aac_softc *sc, u_int32_t command, u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3) { @@ -2626,17 +2546,6 @@ aac_rx_get_mailbox(struct aac_softc *sc, } static int -aac_fa_get_mailbox(struct aac_softc *sc, int mb) -{ - int val; - - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - - val = AAC_MEM1_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4)); - return (val); -} - -static int aac_rkt_get_mailbox(struct aac_softc *sc, int mb) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -2675,20 +2584,6 @@ aac_rx_set_interrupts(struct aac_softc * } static void -aac_fa_set_interrupts(struct aac_softc *sc, int enable) -{ - fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); - - if (enable) { - AAC_MEM0_SETREG2((sc), AAC_FA_MASK0_CLEAR, AAC_DB_INTERRUPTS); - AAC_FA_HACK(sc); - } else { - AAC_MEM0_SETREG2((sc), AAC_FA_MASK0, ~0); - AAC_FA_HACK(sc); - } -} - -static void aac_rkt_set_interrupts(struct aac_softc *sc, int enable) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); @@ -2871,10 +2766,8 @@ aac_describe_controller(struct aac_softc } device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n", adapter_type, - AAC_DRIVER_VERSION >> 24, - (AAC_DRIVER_VERSION >> 16) & 0xFF, - AAC_DRIVER_VERSION & 0xFF, - AAC_DRIVER_BUILD); + AAC_DRIVER_MAJOR_VERSION, AAC_DRIVER_MINOR_VERSION, + AAC_DRIVER_BUGFIX_LEVEL, AAC_DRIVER_BUILD); aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); @@ -3359,10 +3252,16 @@ aac_rev_check(struct aac_softc *sc, cadd * Doctor up the response struct. */ rev_check_resp.possiblyCompatible = 1; - rev_check_resp.adapterSWRevision.external.ul = - sc->aac_revision.external.ul; + rev_check_resp.adapterSWRevision.external.comp.major = + AAC_DRIVER_MAJOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.minor = + AAC_DRIVER_MINOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.type = + AAC_DRIVER_TYPE; + rev_check_resp.adapterSWRevision.external.comp.dash = + AAC_DRIVER_BUGFIX_LEVEL; rev_check_resp.adapterSWRevision.buildNumber = - sc->aac_revision.buildNumber; + AAC_DRIVER_BUILD; return(copyout((caddr_t)&rev_check_resp, udata, sizeof(struct aac_rev_check_resp))); Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Mon Mar 29 00:23:46 2010 (r205814) +++ stable/8/sys/dev/aac/aac_cam.c Mon Mar 29 00:30:44 2010 (r205815) @@ -211,7 +211,7 @@ aac_cam_action(struct cam_sim *sim, unio { struct aac_cam *camsc; struct aac_softc *sc; - struct aac_srb32 *srb; + struct aac_srb *srb; struct aac_fib *fib; struct aac_command *cm; @@ -354,7 +354,7 @@ aac_cam_action(struct cam_sim *sim, unio } fib = cm->cm_fib; - srb = (struct aac_srb32 *)&fib->data[0]; + srb = (struct aac_srb *)&fib->data[0]; cm->cm_datalen = 0; switch (ccb->ccb_h.flags & CAM_DIR_MASK) { @@ -405,10 +405,10 @@ aac_cam_action(struct cam_sim *sim, unio if (ccb->ccb_h.flags & CAM_DATA_PHYS) { /* Send a 32bit command */ fib->Header.Command = ScsiPortCommand; - srb->sg_map32.SgCount = 1; - srb->sg_map32.SgEntry[0].SgAddress = + srb->sg_map.SgCount = 1; + srb->sg_map.SgEntry[0].SgAddress = (uint32_t)(uintptr_t)csio->data_ptr; - srb->sg_map32.SgEntry[0].SgByteCount = + srb->sg_map.SgEntry[0].SgByteCount = csio->dxfer_len; } else { /* @@ -417,15 +417,15 @@ aac_cam_action(struct cam_sim *sim, unio */ cm->cm_data = (void *)csio->data_ptr; cm->cm_datalen = csio->dxfer_len; - cm->cm_sgtable = &srb->sg_map32; + cm->cm_sgtable = &srb->sg_map; } } else { /* XXX Need to handle multiple s/g elements */ panic("aac_cam: multiple s/g elements"); } } else { - srb->sg_map32.SgCount = 0; - srb->sg_map32.SgEntry[0].SgByteCount = 0; + srb->sg_map.SgCount = 0; + srb->sg_map.SgEntry[0].SgByteCount = 0; srb->data_len = 0; } @@ -461,7 +461,7 @@ aac_cam_action(struct cam_sim *sim, unio AAC_FIBSTATE_REXPECTED | AAC_FIBSTATE_NORM; fib->Header.Size = sizeof(struct aac_fib_header) + - sizeof(struct aac_srb32); + sizeof(struct aac_srb); aac_enqueue_ready(cm); aac_startio(cm->cm_sc); Modified: stable/8/sys/dev/aac/aac_pci.c ============================================================================== --- stable/8/sys/dev/aac/aac_pci.c Mon Mar 29 00:23:46 2010 (r205814) +++ stable/8/sys/dev/aac/aac_pci.c Mon Mar 29 00:30:44 2010 (r205815) @@ -435,10 +435,6 @@ aac_pci_attach(device_t dev) fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); sc->aac_if = aac_sa_interface; break; - case AAC_HWIF_FALCON: - fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Falcon/PPC"); - sc->aac_if = aac_fa_interface; - break; case AAC_HWIF_RKT: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); sc->aac_if = aac_rkt_interface; Modified: stable/8/sys/dev/aac/aacreg.h ============================================================================== --- stable/8/sys/dev/aac/aacreg.h Mon Mar 29 00:23:46 2010 (r205814) +++ stable/8/sys/dev/aac/aacreg.h Mon Mar 29 00:30:44 2010 (r205815) @@ -1363,7 +1363,7 @@ struct aac_close_command { /* * SCSI Passthrough structures */ -struct aac_srb32 { +struct aac_srb { u_int32_t function; u_int32_t bus; u_int32_t target; @@ -1374,7 +1374,7 @@ struct aac_srb32 { u_int32_t retry_limit; u_int32_t cdb_len; u_int8_t cdb[16]; - struct aac_sg_table sg_map32; + struct aac_sg_table sg_map; }; enum { @@ -1453,24 +1453,6 @@ enum { }; /* - * Register set for adapters based on the Falcon bridge and PPC core - */ - -#define AAC_FA_DOORBELL0_CLEAR 0x00 -#define AAC_FA_DOORBELL1_CLEAR 0x02 -#define AAC_FA_DOORBELL0 0x04 -#define AAC_FA_DOORBELL1 0x06 -#define AAC_FA_MASK0_CLEAR 0x08 -#define AAC_FA_MASK1_CLEAR 0x0a -#define AAC_FA_MASK0 0x0c -#define AAC_FA_MASK1 0x0e -#define AAC_FA_MAILBOX 0x10 -#define AAC_FA_FWSTATUS 0x2c /* Mailbox 7 */ -#define AAC_FA_INTSRC 0x900 - -#define AAC_FA_HACK(sc) (void)AAC_MEM0_GETREG4(sc, AAC_FA_INTSRC) - -/* * Register definitions for the Adaptec AAC-364 'Jalapeno I/II' adapters, based * on the SA110 'StrongArm'. */ Modified: stable/8/sys/dev/aac/aacvar.h ============================================================================== --- stable/8/sys/dev/aac/aacvar.h Mon Mar 29 00:23:46 2010 (r205814) +++ stable/8/sys/dev/aac/aacvar.h Mon Mar 29 00:30:44 2010 (r205815) @@ -37,6 +37,16 @@ #include #include +#define AAC_TYPE_DEVO 1 +#define AAC_TYPE_ALPHA 2 +#define AAC_TYPE_BETA 3 +#define AAC_TYPE_RELEASE 4 + +#define AAC_DRIVER_MAJOR_VERSION 2 +#define AAC_DRIVER_MINOR_VERSION 1 +#define AAC_DRIVER_BUGFIX_LEVEL 9 +#define AAC_DRIVER_TYPE AAC_TYPE_RELEASE + #ifndef AAC_DRIVER_BUILD # define AAC_DRIVER_BUILD 1 #endif @@ -319,7 +329,6 @@ struct aac_softc int aac_hwif; #define AAC_HWIF_I960RX 0 #define AAC_HWIF_STRONGARM 1 -#define AAC_HWIF_FALCON 2 #define AAC_HWIF_RKT 3 #define AAC_HWIF_NARK 4 #define AAC_HWIF_UNKNOWN -1 From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 01:24:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675321065674; Mon, 29 Mar 2010 01:24:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 557638FC08; Mon, 29 Mar 2010 01:24:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T1OKP2004387; Mon, 29 Mar 2010 01:24:20 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T1OK0m004385; Mon, 29 Mar 2010 01:24:20 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201003290124.o2T1OK0m004385@svn.freebsd.org> From: Doug Barton Date: Mon, 29 Mar 2010 01:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205817 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 01:24:22 -0000 Author: dougb Date: Mon Mar 29 01:24:20 2010 New Revision: 205817 URL: http://svn.freebsd.org/changeset/base/205817 Log: MFC r205290: MAKE_JUST_WORLDS Modified: stable/8/Makefile (contents, props changed) Modified: stable/8/Makefile ============================================================================== --- stable/8/Makefile Mon Mar 29 00:39:09 2010 (r205816) +++ stable/8/Makefile Mon Mar 29 01:24:20 2010 (r205817) @@ -310,6 +310,7 @@ universe_${target}: "check _.${target}.buildworld for details" | ${MAKEFAIL})) @echo ">> ${target} buildworld completed on `LC_ALL=C date`" .endif +.if !defined(MAKE_JUST_WORLDS) .if exists(${.CURDIR}/sys/${target}/conf/NOTES) @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ @@ -318,6 +319,7 @@ universe_${target}: .endif @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels +.endif @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe_kernels: universe_kernconfs From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 06:31:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D28671065673; Mon, 29 Mar 2010 06:31:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC4A18FC13; Mon, 29 Mar 2010 06:31:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T6VwLX072099; Mon, 29 Mar 2010 06:31:58 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T6VwEB072088; Mon, 29 Mar 2010 06:31:58 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201003290631.o2T6VwEB072088@svn.freebsd.org> From: Doug Barton Date: Mon, 29 Mar 2010 06:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205820 - in stable/8: contrib/bind9 contrib/bind9/bin/check contrib/bind9/bin/dig contrib/bind9/bin/dnssec contrib/bind9/bin/named contrib/bind9/bin/named/include/named contrib/bind9/b... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 06:31:59 -0000 Author: dougb Date: Mon Mar 29 06:31:58 2010 New Revision: 205820 URL: http://svn.freebsd.org/changeset/base/205820 Log: Update to 9.6.2-P1, the latest patchfix release which deals with the problems related to the handling of broken DNSSEC trust chains. This fix is only relevant for those who have DNSSEC validation enabled and configure trust anchors from third parties, either manually, or through a system like DLV. Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/COPYRIGHT stable/8/contrib/bind9/FAQ stable/8/contrib/bind9/FAQ.xml stable/8/contrib/bind9/NSEC3-NOTES stable/8/contrib/bind9/README stable/8/contrib/bind9/bin/check/named-checkconf.8 stable/8/contrib/bind9/bin/check/named-checkconf.html stable/8/contrib/bind9/bin/check/named-checkzone.8 stable/8/contrib/bind9/bin/check/named-checkzone.c stable/8/contrib/bind9/bin/check/named-checkzone.docbook stable/8/contrib/bind9/bin/check/named-checkzone.html stable/8/contrib/bind9/bin/dig/dig.1 stable/8/contrib/bind9/bin/dig/dig.html stable/8/contrib/bind9/bin/dig/dighost.c stable/8/contrib/bind9/bin/dig/host.1 stable/8/contrib/bind9/bin/dig/host.c stable/8/contrib/bind9/bin/dig/host.html stable/8/contrib/bind9/bin/dig/nslookup.1 stable/8/contrib/bind9/bin/dig/nslookup.c stable/8/contrib/bind9/bin/dig/nslookup.html stable/8/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c stable/8/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8 stable/8/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c stable/8/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook stable/8/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html stable/8/contrib/bind9/bin/dnssec/dnssec-keygen.8 stable/8/contrib/bind9/bin/dnssec/dnssec-keygen.c stable/8/contrib/bind9/bin/dnssec/dnssec-keygen.docbook stable/8/contrib/bind9/bin/dnssec/dnssec-keygen.html stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.8 stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.c stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.docbook stable/8/contrib/bind9/bin/dnssec/dnssec-signzone.html stable/8/contrib/bind9/bin/dnssec/dnssectool.c stable/8/contrib/bind9/bin/dnssec/dnssectool.h stable/8/contrib/bind9/bin/named/control.c stable/8/contrib/bind9/bin/named/include/named/server.h stable/8/contrib/bind9/bin/named/lwresd.8 stable/8/contrib/bind9/bin/named/lwresd.html stable/8/contrib/bind9/bin/named/named.8 stable/8/contrib/bind9/bin/named/named.conf.5 stable/8/contrib/bind9/bin/named/named.conf.html stable/8/contrib/bind9/bin/named/named.docbook stable/8/contrib/bind9/bin/named/named.html stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/bin/named/server.c stable/8/contrib/bind9/bin/named/statschannel.c stable/8/contrib/bind9/bin/named/update.c stable/8/contrib/bind9/bin/nsupdate/nsupdate.1 stable/8/contrib/bind9/bin/nsupdate/nsupdate.html stable/8/contrib/bind9/bin/rndc/rndc-confgen.8 stable/8/contrib/bind9/bin/rndc/rndc-confgen.html stable/8/contrib/bind9/bin/rndc/rndc.8 stable/8/contrib/bind9/bin/rndc/rndc.conf.5 stable/8/contrib/bind9/bin/rndc/rndc.conf.html stable/8/contrib/bind9/bin/rndc/rndc.html stable/8/contrib/bind9/config.h.in stable/8/contrib/bind9/configure.in stable/8/contrib/bind9/doc/arm/Bv9ARM-book.xml stable/8/contrib/bind9/doc/arm/Bv9ARM.ch01.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch02.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch03.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch04.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch05.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch06.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch07.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch08.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch09.html stable/8/contrib/bind9/doc/arm/Bv9ARM.ch10.html stable/8/contrib/bind9/doc/arm/Bv9ARM.html stable/8/contrib/bind9/doc/arm/Bv9ARM.pdf stable/8/contrib/bind9/doc/arm/man.dig.html stable/8/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html stable/8/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html stable/8/contrib/bind9/doc/arm/man.dnssec-keygen.html stable/8/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/8/contrib/bind9/doc/arm/man.host.html stable/8/contrib/bind9/doc/arm/man.named-checkconf.html stable/8/contrib/bind9/doc/arm/man.named-checkzone.html stable/8/contrib/bind9/doc/arm/man.named.html stable/8/contrib/bind9/doc/arm/man.nsupdate.html stable/8/contrib/bind9/doc/arm/man.rndc-confgen.html stable/8/contrib/bind9/doc/arm/man.rndc.conf.html stable/8/contrib/bind9/doc/arm/man.rndc.html stable/8/contrib/bind9/doc/misc/Makefile.in stable/8/contrib/bind9/lib/dns/api stable/8/contrib/bind9/lib/dns/db.c stable/8/contrib/bind9/lib/dns/dispatch.c stable/8/contrib/bind9/lib/dns/dnssec.c stable/8/contrib/bind9/lib/dns/dst_api.c stable/8/contrib/bind9/lib/dns/dst_internal.h stable/8/contrib/bind9/lib/dns/dst_parse.c stable/8/contrib/bind9/lib/dns/include/dns/db.h stable/8/contrib/bind9/lib/dns/include/dns/dnssec.h stable/8/contrib/bind9/lib/dns/include/dns/journal.h stable/8/contrib/bind9/lib/dns/include/dns/keyvalues.h stable/8/contrib/bind9/lib/dns/include/dns/name.h stable/8/contrib/bind9/lib/dns/include/dns/ncache.h stable/8/contrib/bind9/lib/dns/include/dns/nsec3.h stable/8/contrib/bind9/lib/dns/include/dns/rbt.h stable/8/contrib/bind9/lib/dns/include/dns/rdataset.h stable/8/contrib/bind9/lib/dns/include/dns/resolver.h stable/8/contrib/bind9/lib/dns/include/dns/result.h stable/8/contrib/bind9/lib/dns/include/dns/types.h stable/8/contrib/bind9/lib/dns/include/dns/validator.h stable/8/contrib/bind9/lib/dns/include/dns/zone.h stable/8/contrib/bind9/lib/dns/include/dst/dst.h stable/8/contrib/bind9/lib/dns/journal.c stable/8/contrib/bind9/lib/dns/masterdump.c stable/8/contrib/bind9/lib/dns/message.c stable/8/contrib/bind9/lib/dns/ncache.c stable/8/contrib/bind9/lib/dns/nsec3.c stable/8/contrib/bind9/lib/dns/opensslrsa_link.c stable/8/contrib/bind9/lib/dns/rbt.c stable/8/contrib/bind9/lib/dns/rbtdb.c stable/8/contrib/bind9/lib/dns/rcode.c stable/8/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c stable/8/contrib/bind9/lib/dns/rdatalist.c stable/8/contrib/bind9/lib/dns/rdataset.c stable/8/contrib/bind9/lib/dns/rdataslab.c stable/8/contrib/bind9/lib/dns/resolver.c stable/8/contrib/bind9/lib/dns/result.c stable/8/contrib/bind9/lib/dns/sdb.c stable/8/contrib/bind9/lib/dns/sdlz.c stable/8/contrib/bind9/lib/dns/spnego.c stable/8/contrib/bind9/lib/dns/validator.c stable/8/contrib/bind9/lib/dns/view.c stable/8/contrib/bind9/lib/dns/zone.c stable/8/contrib/bind9/lib/isc/api stable/8/contrib/bind9/lib/isc/base32.c stable/8/contrib/bind9/lib/isc/base64.c stable/8/contrib/bind9/lib/isc/heap.c stable/8/contrib/bind9/lib/isc/httpd.c stable/8/contrib/bind9/lib/isc/ia64/include/isc/atomic.h stable/8/contrib/bind9/lib/isc/include/isc/entropy.h stable/8/contrib/bind9/lib/isc/include/isc/netscope.h stable/8/contrib/bind9/lib/isc/include/isc/portset.h stable/8/contrib/bind9/lib/isc/include/isc/sha2.h stable/8/contrib/bind9/lib/isc/include/isc/util.h stable/8/contrib/bind9/lib/isc/inet_ntop.c stable/8/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h stable/8/contrib/bind9/lib/isc/random.c stable/8/contrib/bind9/lib/isc/sha2.c stable/8/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c stable/8/contrib/bind9/lib/isc/unix/socket.c stable/8/contrib/bind9/lib/isccc/api stable/8/contrib/bind9/lib/isccfg/aclconf.c stable/8/contrib/bind9/lib/isccfg/api stable/8/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h stable/8/contrib/bind9/lib/lwres/api stable/8/contrib/bind9/lib/lwres/context.c stable/8/contrib/bind9/lib/lwres/getipnode.c stable/8/contrib/bind9/lib/lwres/man/lwres.3 stable/8/contrib/bind9/lib/lwres/man/lwres.html stable/8/contrib/bind9/lib/lwres/man/lwres_buffer.3 stable/8/contrib/bind9/lib/lwres/man/lwres_buffer.html stable/8/contrib/bind9/lib/lwres/man/lwres_config.3 stable/8/contrib/bind9/lib/lwres/man/lwres_config.html stable/8/contrib/bind9/lib/lwres/man/lwres_context.3 stable/8/contrib/bind9/lib/lwres/man/lwres_context.html stable/8/contrib/bind9/lib/lwres/man/lwres_gabn.3 stable/8/contrib/bind9/lib/lwres/man/lwres_gabn.html stable/8/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3 stable/8/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html stable/8/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3 stable/8/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html stable/8/contrib/bind9/lib/lwres/man/lwres_gethostent.3 stable/8/contrib/bind9/lib/lwres/man/lwres_gethostent.html stable/8/contrib/bind9/lib/lwres/man/lwres_getipnode.3 stable/8/contrib/bind9/lib/lwres/man/lwres_getipnode.html stable/8/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3 stable/8/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html stable/8/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3 stable/8/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html stable/8/contrib/bind9/lib/lwres/man/lwres_gnba.3 stable/8/contrib/bind9/lib/lwres/man/lwres_gnba.html stable/8/contrib/bind9/lib/lwres/man/lwres_hstrerror.3 stable/8/contrib/bind9/lib/lwres/man/lwres_hstrerror.html stable/8/contrib/bind9/lib/lwres/man/lwres_inetntop.3 stable/8/contrib/bind9/lib/lwres/man/lwres_inetntop.html stable/8/contrib/bind9/lib/lwres/man/lwres_noop.3 stable/8/contrib/bind9/lib/lwres/man/lwres_noop.html stable/8/contrib/bind9/lib/lwres/man/lwres_packet.3 stable/8/contrib/bind9/lib/lwres/man/lwres_packet.html stable/8/contrib/bind9/lib/lwres/man/lwres_resutil.3 stable/8/contrib/bind9/lib/lwres/man/lwres_resutil.html stable/8/contrib/bind9/version stable/8/lib/bind/config.h Directory Properties: stable/8/contrib/bind9/ (props changed) stable/8/lib/bind/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/CHANGES Mon Mar 29 06:31:58 2010 (r205820) @@ -1,4 +1,30 @@ - --- 9.6.1-P3 released --- + --- 9.6.2-P1 released --- + +2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619] + + --- 9.6.2 released --- + +2850. [bug] If isc_heap_insert() failed due to memory shortage + the heap would have corrupted entries. [RT #20951] + +2849. [bug] Don't treat errors from the xml2 library as fatal. + [RT #20945] + +2846. [bug] EOF on unix domain sockets was not being handled + correctly. [RT #20731] + +2844. [doc] notify-delay default in ARM was wrong. It should have + been five (5) seconds. + + --- 9.6.2rc1 released --- + +2838. [func] Backport support for SHA-2 DNSSEC algorithms, + RSASHA256 and RSASHA512, from BIND 9.7. (This + incorporates changes 2726 and 2738 from that + release branch.) [RT #20871] + +2837. [port] Prevent Linux spurious warnings about fwrite(). + [RT #20812] 2831. [security] Do not attempt to validate or cache out-of-bailiwick data returned with a secure @@ -10,21 +36,286 @@ 2827. [security] Bogus NXDOMAIN could be cached as if valid. [RT #20712] - --- 9.6.1-P2 released --- +2825. [bug] Changing the setting of OPTOUT in a NSEC3 chain that + was in the process of being created was not properly + recorded in the zone. [RT #20786] + +2823. [bug] rbtdb.c:getsigningtime() was missing locks. [RT #20781] + +2819. [cleanup] Removed unnecessary DNS_POINTER_MAXHOPS define + [RT #20771] + +2818. [cleanup] rndc could return an incorrect error code + when a zone was not found. [RT #20767] + +2815. [bug] Exclusively lock the task when freezing a zone. + [RT #19838] + +2814. [func] Provide a definitive error message when a master + zone is not loaded. [RT #20757] + + --- 9.6.2b1 released --- + +2797. [bug] Don't decrement the dispatch manager's maxbuffers. + [RT #20613] + +2790. [bug] Handle DS queries to stub zones. [RT #20440] + +2789. [bug] Fixed an INSIST in dispatch.c [RT #20576] + +2786. [bug] Additional could be promoted to answer. [RT #20663] + +2784. [bug] TC was not always being set when required glue was + dropped. [RT #20655] + +2783. [func] Return minimal responses to EDNS/UDP queries with a UDP + buffer size of 512 or less. [RT #20654] + +2782. [port] win32: use getaddrinfo() for hostname lookups. + [RT #20650] + +2777. [contrib] DLZ MYSQL auto reconnect support discovery was wrong. 2772. [security] When validating, track whether pending data was from the additional section or not and only return it if validates as secure. [RT #20438] - --- 9.6.1-P1 released --- +2765. [bug] Skip masters for which the TSIG key cannot be found. + [RT #20595] + +2760. [cleanup] Corrected named-compilezone usage summary. [RT #20533] + +2759. [doc] Add information about .jbk/.jnw files to + the ARM. [RT #20303] + +2758. [bug] win32: Added a workaround for a windows 2008 bug + that could cause the UDP client handler to shut + down. [RT #19176] + +2757. [bug] dig: assertion failure could occur in connect + timeout. [RT #20599] + +2755. [doc] Clarify documentation of keyset- files in + dnssec-signzone man page. [RT #19810] + +2754. [bug] Secure-to-insecure transitions failed when zone + was signed with NSEC3. [RT #20587] + +2750. [bug] dig: assertion failure could occur when a server + didn't have an address. [RT #20579] + +2749. [bug] ixfr-from-differences generated a non-minimal ixfr + for NSEC3 signed zones. [RT #20452] + +2747. [bug] Journal roll forwards failed to set the re-signing + time of RRSIGs correctly. [RT #20541] + +2743. [bug] RRSIG could be incorrectly set in the NSEC3 record + for a insecure delegation. + +2729. [func] When constructing a CNAME from a DNAME use the DNAME + TTL. [RT #20451] + +2723. [bug] isc_base32_totext(), isc_base32hex_totext(), and + isc_base64_totext(), didn't always mark regions of + memory as fully consumed after conversion. [RT #20445] + +2722. [bug] Ensure that the memory associated with the name of + a node in a rbt tree is not altered during the life + of the node. [RT #20431] + +2721. [port] Have dst__entropy_status() prime the random number + generator. [RT #20369] + +2718. [bug] The space calculations in opensslrsa_todns() were + incorrect. [RT #20394] + +2716. [bug] nslookup debug mode didn't return the ttl. [RT #20414] + +2715. [bug] Require OpenSSL support to be explicitly disabled. + [RT #20288] + +2714. [port] aix/powerpc: 'asm("ics");' needs non standard assembler + flags. + +2713. [bug] powerpc: atomic operations missing asm("ics") / + __isync() calls. + +2706. [bug] Loading a zone with a very large NSEC3 salt could + trigger an assert. [RT #20368] + +2705. [bug] Reconcile the XML stats version number with a later + BIND9 release, by adding a "name" attribute to + "cache" elements and increasing the version number + to 2.2. (This is a minor version change, but may + affect XML parsers if they assume the cache element + doesn't take an attribute.) + +2704. [bug] Serial of dynamic and stub zones could be inconsistent + with their SOA serial. [RT #19387] + +2701. [doc] Correction to ARM: hmac-md5 is no longer the only + supported TSIG key algorithm. [RT #18046] + +2700. [doc] The match-mapped-addresses option is discouraged. + [RT #12252] + +2699. [bug] Missing lock in rbtdb.c. [RT #20037] + +2697. [port] win32: ensure that S_IFMT, S_IFDIR, S_IFCHR and + S_IFREG are defined after including . + [RT #20309] + +2696. [bug] named failed to successfully process some valid + acl constructs. [RT #20308] + +2692. [port] win32: 32/64 bit cleanups. [RT #20335] + +2690. [bug] win32: fix isc_thread_key_getspecific() prototype. + [RT #20315] + +2689. [bug] Correctly handle snprintf result. [RT #20306] + +2688. [bug] Use INTERFACE_F_POINTTOPOINT, not IFF_POINTOPOINT, + to decide to fetch the destination address. [RT #20305] + +2686. [bug] dnssec-signzone should clean the old NSEC chain when + signing with NSEC3 and vice versa. [RT #20301] + +2683. [bug] dnssec-signzone should clean out old NSEC3 chains when + the NSEC3 parameters used to sign the zone change. + [RT #20246] + +2681. [bug] IPSECKEY RR of gateway type 3 was not correctly + decoded. [RT #20269] + +2678. [func] Treat DS queries as if "minimal-response yes;" + was set. [RT #20258] + +2672. [bug] Don't enable searching in 'host' when doing reverse + lookups. [RT #20218] + +2670. [bug] Unexpected connect failures failed to log enough + information to be useful. [RT #20205] + +2663. [func] win32: allow named to run as a service using + "NT AUTHORITY\LocalService" as the account. [RT #19977] + +2662. [bug] lwres_getipnodebyname() and lwres_getipnodebyaddr() + returned a misleading error code when lwresd was + down. [RT #20028] + +2661. [bug] Check whether socket fd exceeds FD_SETSIZE when + creating lwres context. [RT #20029] + +2659. [doc] Clarify dnssec-keygen doc: key name must match zone + name for DNSSEC keys. [RT #19938] + +2656. [func] win32: add a "tools only" check box to the installer + which causes it to only install dig, host, nslookup, + nsupdate and relevant DLLs. [RT #19998] + +2655. [doc] Document that key-directory does not affect + rndc.key. [RT #20155] + +2653. [bug] Treat ENGINE_load_private_key() failures as key + not found rather than out of memory. [RT #18033] + +2649. [bug] Set the domain for forward only zones. [RT #19944] + +2648. [port] win32: isc_time_seconds() was broken. [RT #19900] + +2647. [bug] Remove unnecessary SOA updates when a new KSK is + added. [RT #19913] + +2646. [bug] Incorrect cleanup on error in socket.c. [RT #19987] + +2645. [port] "gcc -m32" didn't work on amd64 and x86_64 platforms + which default to 64 bits. [RT #19927] + +2643. [bug] Stub zones interacted badly with NSEC3 support. + [RT #19777] + +2642. [bug] nsupdate could dump core on solaris when reading + improperly formatted key files. [RT #20015] 2640. [security] A specially crafted update packet will cause named to exit. [RT #20000] +2639. [bug] Silence compiler warnings in gssapi code. [RT #19954] + +2637. [func] Rationalize dnssec-signzone's signwithkey() calling. + [RT #19959] + +2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. + [RT #19716] + +2633. [bug] Handle 15 bit rand() functions. [RT #19783] + +2632. [func] util/kit.sh: warn if documentation appears to be out of + date. [RT #19922] + +2625. [bug] Missing UNLOCK in rbtdb.c. [RT #19865] + +2623. [bug] Named started seaches for DS non-optimally. [RT #19915] + +2621. [doc] Made copyright boilterplate consistent. [RT #19833] + +2920. [bug] Delay thawing the zone until the reload of it has + completed successfully. [RT #19750] + +2618. [bug] The sdb and sdlz db_interator_seek() methods could + loop infinitely. [RT #19847] + +2617. [bug] ifconfig.sh failed to emit an error message when + run from the wrong location. [RT #19375] + +2616. [bug] 'host' used the nameservers from resolv.conf even + when a explicit nameserver was specified. [RT #19852] + +2615. [bug] "__attribute__((unused))" was in the wrong place + for ia64 gcc builds. [RT #19854] + +2614. [port] win32: 'named -v' should automatically be executed + in the foreground. [RT #19844] + +2613. [bug] Option argument validation was missing for + dnssec-dsfromkey. [RT #19828] + +2610. [port] sunos: Change #2363 was not complete. [RT #19796] + +2608. [func] Perform post signing verification checks in + dnssec-signzone. These can be disabled with -P. + + The post sign verification test ensures that for each + algorithm in use there is at least one non revoked + self signed KSK key. That all revoked KSK keys are + self signed. That all records in the zone are signed + by the algorithm. [RT #19653] + +2601. [doc] Mention file creation mode mask in the + named manual page. + +2593. [bug] Improve a corner source of SERVFAILs [RT #19632] + +2589. [bug] dns_db_unregister() failed to clear '*dbimp'. + [RT #19626] + +2581. [contrib] dlz/mysql set MYSQL_OPT_RECONNECT option on connection. + Requires MySQL 5.0.19 or later. [RT #19084] + +2580. [bug] UpdateRej statistics counter could be incremented twice + for one rejection. [RT #19476] + +2533. [doc] ARM: document @ (at-sign). [RT #17144] + +2500. [contrib] contrib/sdb/pgsql/zonetodb.c called non-existent + function. [RT #18582] + --- 9.6.1 released --- 2607. [bug] named could incorrectly delete NSEC3 records for - empty nodes when processing a update request. + empty nodes when processing a update request. [RT #19749] 2606. [bug] "delegation-only" was not being accepted in @@ -78,7 +369,7 @@ date to the version string, -DNO_VERSION_DATE. 2582. [bug] Don't emit warning log message when we attempt to - remove non-existant journal. [RT #19516] + remove non-existent journal. [RT #19516] 2579. [bug] DNSSEC lookaside validation failed to handle unknown algorithms. [RT #19479] @@ -136,7 +427,7 @@ 2556. [port] Solaris: mkdir(2) on tmpfs filesystems does not do the error checks in the correct order resulting in the wrong error code sometimes being returned. [RT #19249] - + 2554. [bug] Validation of uppercase queries from NSEC3 zones could fail. [RT #19297] @@ -185,7 +476,7 @@ 2536. [cleanup] Silence some warnings when -Werror=format-security is specified. [RT #19083] -2535. [bug] dig +showsearh and +trace interacted badly. [RT #19091] +2535. [bug] dig +showsearch and +trace interacted badly. [RT #19091] 2532. [bug] dig: check the question section of the response to see if it matches the asked question. [RT #18495] @@ -198,8 +489,8 @@ 2529. [cleanup] Upgrade libtool to silence complaints from recent version of autoconf. [RT #18657] -2528. [cleanup] Silence spurious configure warning about - --datarootdir [RT #19096] +2528. [cleanup] Silence spurious configure warning about + --datarootdir [RT #19096] 2527. [bug] named could reuse cache on reload with enabling/disabling validation. [RT #19119] @@ -222,7 +513,7 @@ preceded in resolv.conf. [RT #19081] 2517. [bug] dig +trace with -4 or -6 failed when it chose a - nameserver address of the excluded address. + nameserver address of the excluded address type. [RT #18843] 2516. [bug] glue sort for responses was performed even when not @@ -235,7 +526,7 @@ 2511. [cleanup] dns_rdata_tofmttext() add const to linebreak. [RT #18885] -2506. [port] solaris: Check at configure time if +2506. [port] solaris: Check at configure time if hack_shutup_pthreadonceinit is needed. [RT #19037] 2505. [port] Treat amd64 similarly to x86_64 when determining @@ -258,7 +549,7 @@ 2515. [port] win32: build dnssec-dsfromkey and dnssec-keyfromlabel. [RT #19063] -2513 [bug] Fix windows cli build. [RT #19062] +2513. [bug] Fix windows cli build. [RT #19062] 2510. [bug] "dig +sigchase" could trigger REQUIRE failures. [RT #19033] @@ -343,7 +634,7 @@ 2478. [bug] 'addresses' could be used uninitialized in configure_forward(). [RT #18800] - + 2477. [bug] dig: the global option to print the command line is +cmd not print_cmd. Update the output to reflect this. [RT #17008] @@ -359,7 +650,7 @@ 2473. [port] linux: raise the limit on open files to the possible maximum value before spawning threads; 'files' - specified in named.conf doesn't seem to work with + specified in named.conf doesn't seem to work with threads as expected. [RT #18784] 2472. [port] linux: check the number of available cpu's before @@ -388,7 +679,7 @@ 2464. [port] linux: check that a capability is present before trying to set it. [RT #18135] -2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket +2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket API and glibc hides parts of the IPv6 Advanced Socket API as a result. This is stupid as it breaks how the two halves (Basic and Advanced) of the IPv6 Socket API @@ -418,7 +709,7 @@ 2456. [bug] In ACLs, ::/0 and 0.0.0.0/0 would both match any address, regardless of family. They now correctly distinguish IPv4 from IPv6. [RT #18559] - + 2455. [bug] Stop metadata being transferred via axfr/ixfr. [RT #18639] @@ -458,7 +749,7 @@ 2442. [bug] A lock could be destroyed twice. [RT# 18626] -2441. [bug] isc_radix_insert() could copy radix tree nodes +2441. [bug] isc_radix_insert() could copy radix tree nodes incompletely. [RT #18573] 2440. [bug] named-checkconf used an incorrect test to determine @@ -515,7 +806,7 @@ implementation. Allow the use of kqueue, epoll and /dev/poll to be selected at compile time. [RT #18277] - + 2423. [security] Randomize server selection on queries, so as to make forgery a little more difficult. Instead of always preferring the server with the lowest RTT, @@ -583,9 +874,9 @@ 2406. [placeholder] -2405. [cleanup] The default value for dnssec-validation was changed to - "yes" in 9.5.0-P1 and all subsequent releases; this - was inadvertently omitted from CHANGES at the time. +2405. [cleanup] The default value for dnssec-validation was changed to + "yes" in 9.5.0-P1 and all subsequent releases; this + was inadvertently omitted from CHANGES at the time. 2404. [port] hpux: files unlimited support. @@ -661,7 +952,7 @@ 2380. [bug] dns_view_find() was not returning NXDOMAIN/NXRRSET proofs which, in turn, caused validation failures for insecure zones immediately below a secure zone - the server was authoritative for. [RT #18112] + the server was authoritative for. [RT #18112] 2379. [contrib] queryperf/gen-data-queryperf.py: removed redundant TLDs and supported RRs with TTLs [RT #17972] @@ -709,7 +1000,7 @@ 2363. [port] sunos: pre-set "lt_cv_sys_max_cmd_len=4096;". [RT #17513] -2362. [cleanup] Make "rrset-order fixed" a compile-time option. +2362. [cleanup] Make "rrset-order fixed" a compile-time option. settable by "./configure --enable-fixed-rrset". Disabled by default. [RT #17977] @@ -792,12 +1083,12 @@ interfaces if there are not listen-on-v6 clauses in named.conf. [RT #17581] -2335. [port] sunos: libbind and *printf() support for long long. +2335. [port] sunos: libbind and *printf() support for long long. [RT #17513] 2334. [bug] Bad REQUIRES in fromstruct_in_naptr(), off by one bug in fromstruct_txt(). [RT #17609] - + 2333. [bug] Fix off by one error in isc_time_nowplusinterval(). [RT #17608] @@ -842,7 +1133,7 @@ 2320. [func] Make statistics counters thread-safe for platforms that support certain atomic operations. [RT #17466] -2319. [bug] Silence Coverity warnings in +2319. [bug] Silence Coverity warnings in lib/dns/rdata/in_1/apl_42.c. [RT #17469] 2318. [port] sunos fixes for libbind. [RT #17514] @@ -894,7 +1185,7 @@ 2301. [bug] Remove resource leak and fix error messages in bin/tests/system/lwresd/lwtest.c. [RT #17474] -2300. [bug] Fixed failure to close open file in +2300. [bug] Fixed failure to close open file in bin/tests/names/t_names.c. [RT #17473] 2299. [bug] Remove unnecessary NULL check in @@ -1017,7 +1308,7 @@ 2261. [bug] Fix memory leak with "any" and "none" ACLs [RT #17272] 2260. [bug] Reported wrong clients-per-query when increasing the - value. [RT #17236] + value. [RT #17236] 2259. [placeholder] @@ -1039,10 +1330,10 @@ intermediate values as timer->idle was reset by isc_timer_touch(). [RT #17243] -2253. [func] "max-cache-size" defaults to 32M. +2253. [func] "max-cache-size" defaults to 32M. "max-acache-size" defaults to 16M. -2252. [bug] Fixed errors in sortlist code [RT #17216] +2252. [bug] Fixed errors in sortlist code [RT #17216] 2251. [placeholder] @@ -1050,11 +1341,11 @@ memory statistics file should be written or not. Additionally named's -m option will cause the statistics file to be written. [RT #17113] - -2249. [bug] Only set Authentic Data bit if client requested - DNSSEC, per RFC 3655 [RT #17175] -2248. [cleanup] Fix several errors reported by Coverity. [RT #17160] +2249. [bug] Only set Authentic Data bit if client requested + DNSSEC, per RFC 3655 [RT #17175] + +2248. [cleanup] Fix several errors reported by Coverity. [RT #17160] 2247. [doc] Sort doc/misc/options. [RT #17067] @@ -1095,11 +1386,11 @@ 2235. [bug] was not being installed. [RT #17135] -2234. [port] Correct some compiler warnings on SCO OSr5 [RT #17134] - -2233. [func] Add support for O(1) ACL processing, based on - radix tree code originally written by Kevin - Brintnall. [RT #16288] +2234. [port] Correct some compiler warnings on SCO OSr5 [RT #17134] + +2233. [func] Add support for O(1) ACL processing, based on + radix tree code originally written by Kevin + Brintnall. [RT #16288] 2232. [bug] dns_adb_findaddrinfo() could fail and return ISC_R_SUCCESS. [RT #17137] @@ -1120,7 +1411,7 @@ 2226. [placeholder] 2225. [bug] More support for systems with no IPv4 addresses. - [RT #17111] + [RT #17111] 2224. [bug] Defer journal compaction if a xfrin is in progress. [RT #17119] @@ -1128,7 +1419,7 @@ 2223. [bug] Make a new journal when compacting. [RT #17119] 2222. [func] named-checkconf now checks server key references. - [RT #17097] + [RT #17097] 2221. [bug] Set the event result code to reflect the actual record turned to caller when a cache update is @@ -1137,7 +1428,7 @@ 2220. [bug] win32: Address a race condition in final shutdown of the Windows socket code. [RT #17028] - + 2219. [bug] Apply zone consistency checks to additions, not removals, when updating. [RT #17049] @@ -1147,7 +1438,7 @@ 2217. [func] Adjust update log levels. [RT #17092] 2216. [cleanup] Fix a number of errors reported by Coverity. - [RT #17094] + [RT #17094] 2215. [bug] Bad REQUIRE check isc_hmacsha1_verify(). [RT #17094] @@ -1193,7 +1484,7 @@ localhost;) is used. [RT #16987] - + 2205. [bug] libbind: change #2119 broke thread support. [RT #16982] 2204. [bug] "rndc flushanme name unknown-view" caused named @@ -1332,7 +1623,7 @@ allow-query-on, allow-recursion-on and allow-query-cache-on. [RT #16291] -2164. [bug] The code to determine how named-checkzone / +2164. [bug] The code to determine how named-checkzone / named-compilezone was called failed under windows. [RT #16764] @@ -1539,14 +1830,14 @@ 2095. [port] libbind: alway prototype inet_cidr_ntop_ipv6() and net_cidr_ntop_ipv6(). [RT #16388] - + 2094. [contrib] Update named-bootconf. [RT# 16404] 2093. [bug] named-checkzone -s was broken. 2092. [bug] win32: dig, host, nslookup. Use registry config if resolv.conf does not exist or no nameservers - listed. [RT #15877] + listed. [RT #15877] 2091. [port] dighost.c: race condition on cleanup. [RT #16417] @@ -1950,7 +2241,7 @@ 1964. [func] Separate out MX and SRV to CNAME checks. [RT #15723] -1963. [port] Tru64 4.0E doesn't support send() and recv(). +1963. [port] Tru64 4.0E doesn't support send() and recv(). [RT #15586] 1962. [bug] Named failed to clear old update-policy when it @@ -1993,7 +2284,7 @@ 1951. [security] Drop queries from particular well known ports. Don't return FORMERR to queries from particular well known ports. [RT #15636] - + 1950. [port] Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket. This prevents the source address being set for TCP connections. [RT #15628] @@ -2015,7 +2306,7 @@ 1945. [cleanup] dnssec-keygen: RSA (RSAMD5) is no longer recommended. To generate a RSAMD5 key you must explicitly request RSAMD5. [RT #13780] - + 1944. [cleanup] isc_hash_create() does not need a read/write lock. [RT #15522] @@ -2127,7 +2418,7 @@ [RT #15034] 1905. [bug] Strings returned from cfg_obj_asstring() should be - treated as read-only. The prototype for + treated as read-only. The prototype for cfg_obj_asstring() has been updated to reflect this. [RT #15256] @@ -2259,10 +2550,10 @@ 1863. [bug] rrset-order "fixed" error messages not complete. 1862. [func] Add additional zone data constancy checks. - named-checkzone has extended checking of NS, MX and + named-checkzone has extended checking of NS, MX and SRV record and the hosts they reference. named has extended post zone load checks. - New zone options: check-mx and integrity-check. + New zone options: check-mx and integrity-check. [RT #4940] 1861. [bug] dig could trigger a INSIST on certain malformed @@ -2305,9 +2596,9 @@ 1848. [bug] Improve SMF integration. [RT #13238] 1847. [bug] isc_ondestroy_init() is called too late in - dns_rbtdb_create()/dns_rbtdb64_create(). + dns_rbtdb_create()/dns_rbtdb64_create(). [RT #13661] - + 1846. [contrib] query-loc-0.3.0 from Stephane Bortzmeyer . @@ -2599,7 +2890,7 @@ [RT #12866] 1748. [func] dig now returns the byte count for axfr/ixfr. - + 1747. [bug] BIND 8 compatibility: named/named-checkconf failed to parse "host-statistics-max" in named.conf. @@ -2617,7 +2908,7 @@ requested number of worker threads then destruction of the manager would trigger an INSIST() failure. [RT #12790] - + 1742. [bug] Deleting all records at a node then adding a previously existing record, in a single UPDATE transaction, failed to leave / regenerate the @@ -2628,7 +2919,7 @@ 1740. [bug] Replace rbt's hash algorithm as it performed badly with certain zones. [RT #12729] - + NOTE: a hash context now needs to be established via isc_hash_create() if the application was not already doing this. @@ -2643,7 +2934,7 @@ 1736. [bug] dst_key_fromnamedfile() could fail to read a public key. [RT #12687] - + 1735. [bug] 'dig +sigtrace' could die with a REQUIRE failure. [RE #12688] @@ -2820,7 +3111,7 @@ 1675. [bug] named would sometimes add extra NSEC records to the authority section. - + 1674. [port] linux: increase buffer size used to scan /proc/net/if_inet6. @@ -2894,7 +3185,7 @@ 1648. [func] Update dnssec-lookaside named.conf syntax to support multiple dnssec-lookaside namespaces (not yet - implemented). + implemented). 1647. [bug] It was possible trigger a INSIST when chasing a DS record that required walking back over a empty node. @@ -2924,7 +3215,7 @@ 1638. [bug] "ixfr-from-differences" could generate a REQUIRE failure if the journal open failed. [RT #11347] - + 1637. [bug] Node reference leak on error in addnoqname(). 1636. [bug] The dump done callback could get ISC_R_SUCCESS even if @@ -3018,21 +3309,21 @@ 1607. [bug] dig, host and nslookup were still using random() to generate query ids. [RT# 11013] -1606. [bug] DLV insecurity proof was failing. +1606. [bug] DLV insecurity proof was failing. 1605. [func] New dns_db_find() option DNS_DBFIND_COVERINGNSEC. 1604. [bug] A xfrout_ctx_create() failure would result in xfrout_ctx_destroy() being called with a partially initialized structure. - + 1603. [bug] nsupdate: set interactive based on isatty(). [RT# 10929] 1602. [bug] Logging to a file failed unless a size was specified. [RT# 10925] -1601. [bug] Silence spurious warning 'both "recursion no;" and +1601. [bug] Silence spurious warning 'both "recursion no;" and "allow-recursion" active' warning from view "_bind". [RT# 10920] Modified: stable/8/contrib/bind9/COPYRIGHT ============================================================================== --- stable/8/contrib/bind9/COPYRIGHT Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/COPYRIGHT Mon Mar 29 06:31:58 2010 (r205820) @@ -1,4 +1,4 @@ -Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") +Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") Copyright (C) 1996-2003 Internet Software Consortium. Permission to use, copy, modify, and/or distribute this software for any @@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -$Id: COPYRIGHT,v 1.14.176.1 2009/01/05 23:47:22 tbox Exp $ +$Id: COPYRIGHT,v 1.14.176.2 2010/01/07 23:47:36 tbox Exp $ Portions Copyright (C) 1996-2001 Nominum, Inc. Modified: stable/8/contrib/bind9/FAQ ============================================================================== --- stable/8/contrib/bind9/FAQ Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/FAQ Mon Mar 29 06:31:58 2010 (r205820) @@ -1,6 +1,6 @@ Frequently Asked Questions about BIND 9 -Copyright © 2004-2009 Internet Systems Consortium, Inc. ("ISC") +Copyright © 2004-2010 Internet Systems Consortium, Inc. ("ISC") Copyright © 2000-2003 Internet Software Consortium. @@ -784,6 +784,22 @@ A: Red Hat Security Enhanced Linux (SELi See these man-pages for more information : selinux(8), named_selinux (8), chcon(1), setsebool(8) +Q: I'm running BIND on Ubuntu - + + Why can't named update slave zone database files? + + Why can't named create DDNS journal files or update the master zones + from journals? + + Why can't named create custom log files? + +A: Ubuntu uses AppArmor in + addition to normal file system permissions to protect the system. + + Adjust the paths to use those specified in /etc/apparmor.d/ + usr.sbin.named or adjust /etc/apparmor.d/usr.sbin.named to allow named + to write at the location specified in named.conf. + Q: Listening on individual IPv6 interfaces does not work. A: This is usually due to "/proc/net/if_inet6" not being available in the Modified: stable/8/contrib/bind9/FAQ.xml ============================================================================== --- stable/8/contrib/bind9/FAQ.xml Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/FAQ.xml Mon Mar 29 06:31:58 2010 (r205820) @@ -1,7 +1,7 @@ - +
Frequently Asked Questions about BIND 9 @@ -29,6 +29,7 @@ 2007 2008 2009 + 2010 Internet Systems Consortium, Inc. ("ISC") @@ -1385,6 +1386,36 @@ named_cache_t: for files modifiable by n + I'm running BIND on Ubuntu - + + + Why can't named update slave zone database files? + + + Why can't named create DDNS journal files or update + the master zones from journals? + + + Why can't named create custom log files? + + + + + Ubuntu uses AppArmor + <http://en.wikipedia.org/wiki/AppArmor> in + addition to normal file system permissions to protect the system. + + + Adjust the paths to use those specified in /etc/apparmor.d/usr.sbin.named + or adjust /etc/apparmor.d/usr.sbin.named to allow named to write at the + location specified in named.conf. + + + + + + + Listening on individual IPv6 interfaces does not work. Modified: stable/8/contrib/bind9/NSEC3-NOTES ============================================================================== --- stable/8/contrib/bind9/NSEC3-NOTES Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/NSEC3-NOTES Mon Mar 29 06:31:58 2010 (r205820) @@ -35,7 +35,7 @@ will not be completely signed until name zone and generate the NSEC and RRSIG records. Initially the NSEC record at the zone apex will have the OPT bit set. When the NSEC chain is complete the OPT bit will be cleared. Additionally when -the zone is fully signed the private type (default TYPE65535) records +the zone is fully signed the private type (default TYPE65534) records will have a non zero value for the final octet. The private type record has 5 octets. @@ -45,7 +45,7 @@ The private type record has 5 octets. complete flag (octet 5) If you wish to go straight to a secure zone using NSEC3 you should -also add a NSECPARAM record to the update request with the flags +also add a NSEC3PARAM record to the update request with the flags field set to indicate whether the NSEC3 chain will have the OPTOUT bit set or not. Modified: stable/8/contrib/bind9/README ============================================================================== --- stable/8/contrib/bind9/README Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/README Mon Mar 29 06:31:58 2010 (r205820) @@ -42,6 +42,29 @@ BIND 9 Stichting NLnet - NLnet Foundation Nominum, Inc. +BIND 9.6.2 + + BIND 9.6.2 is a maintenance release, fixing bugs in 9.6.1. + It also introduces support for the SHA-2 DNSSEC algorithms, + RSASHA256 and RSASHA512. + + Known issues in this release: + + - A validating resolver that has been incorrectly configured with + an invalid trust anchor will be unable to resolve names covered + by that trust anchor. In all current versions of BIND 9, such a + resolver will also generate significant unnecessary DNS traffic + while trying to validate. The latter problem will be addressed + in future BIND 9 releases. In the meantime, to avoid these + problems, exercise caution when configuring "trusted-keys": + make sure all keys are correct and current when you add them, + and update your configuration in a timely manner when keys + roll over. + +BIND 9.6.1 + + BIND 9.6.1 is a maintenance release, fixing bugs in 9.6.0. + BIND 9.6.0 BIND 9.6.0 includes a number of changes from BIND 9.5 and earlier Modified: stable/8/contrib/bind9/bin/check/named-checkconf.8 ============================================================================== --- stable/8/contrib/bind9/bin/check/named-checkconf.8 Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/bin/check/named-checkconf.8 Mon Mar 29 06:31:58 2010 (r205820) @@ -1,7 +1,7 @@ .\" Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") .\" Copyright (C) 2000-2002 Internet Software Consortium. .\" -.\" Permission to use, copy, modify, and distribute this software for any +.\" Permission to use, copy, modify, and/or distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" @@ -13,7 +13,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.\" $Id: named-checkconf.8,v 1.30 2007/06/20 02:27:32 marka Exp $ +.\" $Id: named-checkconf.8,v 1.30.334.1 2009/07/11 01:55:20 tbox Exp $ .\" .hy 0 .ad l Modified: stable/8/contrib/bind9/bin/check/named-checkconf.html ============================================================================== --- stable/8/contrib/bind9/bin/check/named-checkconf.html Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/bin/check/named-checkconf.html Mon Mar 29 06:31:58 2010 (r205820) @@ -2,7 +2,7 @@ - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") - Copyright (C) 2000-2002 Internet Software Consortium. - - - Permission to use, copy, modify, and distribute this software for any + - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - @@ -14,7 +14,7 @@ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. --> - + Modified: stable/8/contrib/bind9/bin/check/named-checkzone.8 ============================================================================== --- stable/8/contrib/bind9/bin/check/named-checkzone.8 Mon Mar 29 04:01:02 2010 (r205819) +++ stable/8/contrib/bind9/bin/check/named-checkzone.8 Mon Mar 29 06:31:58 2010 (r205820) @@ -1,7 +1,7 @@ .\" Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") .\" Copyright (C) 2000-2002 Internet Software Consortium. .\" -.\" Permission to use, copy, modify, and distribute this software for any +.\" Permission to use, copy, modify, and/or distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 06:55:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD828106564A; Mon, 29 Mar 2010 06:55:38 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC0F88FC08; Mon, 29 Mar 2010 06:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T6tcKE077450; Mon, 29 Mar 2010 06:55:38 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T6tcqA077448; Mon, 29 Mar 2010 06:55:38 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003290655.o2T6tcqA077448@svn.freebsd.org> From: Fabien Thomas Date: Mon, 29 Mar 2010 06:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205823 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 06:55:39 -0000 Author: fabient Date: Mon Mar 29 06:55:38 2010 New Revision: 205823 URL: http://svn.freebsd.org/changeset/base/205823 Log: MFC r205694: Handling SIGPIPE will cause deadlock/crash. Return an error immediatly in case of hard shutdown. Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_logging.c Mon Mar 29 06:54:30 2010 (r205822) +++ stable/8/sys/dev/hwpmc/hwpmc_logging.c Mon Mar 29 06:55:38 2010 (r205823) @@ -298,7 +298,6 @@ pmclog_loop(void *arg) mtx_unlock(&pmc_kthread_mtx); -sigpipe_retry: /* process the request */ PMCDBG(LOG,WRI,2, "po=%p base=%p ptr=%p", po, lb->plb_base, lb->plb_ptr); @@ -322,9 +321,6 @@ sigpipe_retry: if (error) { /* XXX some errors are recoverable */ - if (error == EPIPE) - goto sigpipe_retry; - /* send a SIGIO to the owner and exit */ PROC_LOCK(p); psignal(p, SIGIO); From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 06:57:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70ADF106564A; Mon, 29 Mar 2010 06:57:44 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44EFC8FC17; Mon, 29 Mar 2010 06:57:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2T6vie5077991; Mon, 29 Mar 2010 06:57:44 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2T6vi8s077989; Mon, 29 Mar 2010 06:57:44 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003290657.o2T6vi8s077989@svn.freebsd.org> From: Fabien Thomas Date: Mon, 29 Mar 2010 06:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205825 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 06:57:44 -0000 Author: fabient Date: Mon Mar 29 06:57:43 2010 New Revision: 205825 URL: http://svn.freebsd.org/changeset/base/205825 Log: MFC r205693: Do not overflow the term in the case of multi-line display. Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Mon Mar 29 06:56:17 2010 (r205824) +++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Mon Mar 29 06:57:43 2010 (r205825) @@ -366,7 +366,7 @@ pmcpl_ct_node_cleartag(void) static int pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct, - struct pmcpl_ct_sample *rsamples, int x, int *y) + struct pmcpl_ct_sample *rsamples, int x, int *y, int maxy) { int i; @@ -387,7 +387,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct if (ct->pct_narc == 0) { pmcpl_ct_topscreen[x+1][*y] = NULL; if (*y >= PMCPL_CT_MAXLINE || - *y >= pmcstat_displayheight) + *y >= maxy) return 1; *y = *y + 1; for (i=0; i < x; i++) @@ -407,7 +407,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) { if (pmcpl_ct_node_dumptop(pmcin, ct->pct_arc[i].pcta_child, - rsamples, x+1, y)) + rsamples, x+1, y, maxy)) return 1; } } @@ -472,6 +472,9 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s /* Check for line wrap. */ width += ns_len + is_len + vs_len + 1; if (width >= pmcstat_displaywidth) { + maxy--; + if (y >= maxy) + break; PMCSTAT_PRINTW("\n%*s", indentwidth, space); width = indentwidth + ns_len + is_len + vs_len; } @@ -515,7 +518,7 @@ pmcpl_ct_topdisplay(void) for (i = 0; i < pmcpl_ct_root->pct_narc; i++) { if (pmcpl_ct_node_dumptop(pmcin, pmcpl_ct_root->pct_arc[i].pcta_child, - &rsamples, x, &y)) { + &rsamples, x, &y, pmcstat_displayheight - 2)) { break; } } From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 12:29:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AEA5106566C; Mon, 29 Mar 2010 12:29:35 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4947A8FC19; Mon, 29 Mar 2010 12:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TCTZN4055057; Mon, 29 Mar 2010 12:29:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TCTZe6055055; Mon, 29 Mar 2010 12:29:35 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003291229.o2TCTZe6055055@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Mar 2010 12:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205832 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 12:29:35 -0000 Author: luigi Date: Mon Mar 29 12:29:34 2010 New Revision: 205832 URL: http://svn.freebsd.org/changeset/base/205832 Log: remove a leftover debugging message Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dn_io.c Mon Mar 29 12:27:49 2010 (r205831) +++ stable/8/sys/netinet/ipfw/ip_dn_io.c Mon Mar 29 12:29:34 2010 (r205832) @@ -731,7 +731,6 @@ dummynet_io(struct mbuf **m0, int dir, s goto dropit; } if (fs->sched->fp->enqueue(si, q, m)) { - printf("%s dropped by enqueue\n", __FUNCTION__); /* packet was dropped by enqueue() */ m = *m0 = NULL; goto dropit; From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 12:32:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691C1106564A; Mon, 29 Mar 2010 12:32:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573668FC0A; Mon, 29 Mar 2010 12:32:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TCWGFY055697; Mon, 29 Mar 2010 12:32:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TCWGvU055695; Mon, 29 Mar 2010 12:32:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003291232.o2TCWGvU055695@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Mar 2010 12:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205833 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 12:32:16 -0000 Author: luigi Date: Mon Mar 29 12:32:16 2010 New Revision: 205833 URL: http://svn.freebsd.org/changeset/base/205833 Log: mfc 205830: fixes to rule set handling (including potential kernel panics) Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Mon Mar 29 12:29:34 2010 (r205832) +++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Mon Mar 29 12:32:16 2010 (r205833) @@ -270,23 +270,24 @@ del_entry(struct ip_fw_chain *chain, u_i return EINVAL; } - IPFW_UH_WLOCK(chain); /* prevent conflicts among the writers */ + IPFW_UH_WLOCK(chain); /* arbitrate writers */ chain->reap = NULL; /* prepare for deletions */ switch (cmd) { - case 0: /* delete rules with given number (0 is special means all) */ - case 1: /* delete all rules with given set number, rule->set == rulenum */ - case 5: /* delete rules with given number and with given set number. - * rulenum - given rule number; - * new_set - given set number. - */ - /* locate first rule to delete (start), the one after the - * last one (end), and count how many rules to delete (n) + case 0: /* delete rules number N (N == 0 means all) */ + case 1: /* delete all rules in set N */ + case 5: /* delete rules with number N and set "new_set". */ + + /* + * Locate first rule to delete (start), the rule after + * the last one to delete (end), and count how many + * rules to delete (n) */ n = 0; if (cmd == 1) { /* look for a specific set, must scan all */ + new_set = rulenum; for (start = -1, i = 0; i < chain->n_rules; i++) { - if (chain->map[start]->set != rulenum) + if (chain->map[i]->set != rulenum) continue; if (start < 0) start = i; @@ -314,32 +315,42 @@ del_entry(struct ip_fw_chain *chain, u_i error = EINVAL; break; } - /* copy the initial part of the map */ + /* + * bcopy the initial part of the map, then individually + * copy all matching entries between start and end, + * and then bcopy the final part. + * Once we are done we can swap maps and clean up the + * deleted rules (unfortunately we need to repeat a + * convoluted test). + */ if (start > 0) bcopy(chain->map, map, start * sizeof(struct ip_fw *)); - /* copy active rules between start and end */ for (i = ofs = start; i < end; i++) { rule = chain->map[i]; - if (!(rule->set != RESVD_SET && - (cmd == 0 || rule->set == new_set) )) + if (rule->set == RESVD_SET || cmd == 0 || + (rule->set == new_set && + (cmd == 1 || rule->rulenum == rulenum))) map[ofs++] = chain->map[i]; } - /* finally the tail */ bcopy(chain->map + end, map + ofs, (chain->n_rules - end) * sizeof(struct ip_fw *)); + map = swap_map(chain, map, chain->n_rules - n); /* now remove the rules deleted */ for (i = start; i < end; i++) { + int l; rule = map[i]; - if (rule->set != RESVD_SET && - (cmd == 0 || rule->set == new_set) ) { - int l = RULESIZE(rule); - - chain->static_len -= l; - ipfw_remove_dyn_children(rule); - rule->x_next = chain->reap; - chain->reap = rule; - } + /* same test as above */ + if (rule->set == RESVD_SET || cmd == 0 || + (rule->set == new_set && + (cmd == 1 || rule->rulenum == rulenum))) + continue; + + l = RULESIZE(rule); + chain->static_len -= l; + ipfw_remove_dyn_children(rule); + rule->x_next = chain->reap; + chain->reap = rule; } break; @@ -446,7 +457,7 @@ zero_entry(struct ip_fw_chain *chain, u_ break; } if (!cleared) { /* we did not find any matching rules */ - IPFW_WUNLOCK(chain); + IPFW_UH_RUNLOCK(chain); return (EINVAL); } msg = log_only ? "logging count reset" : "cleared"; From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 15:39:18 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59475106564A; Mon, 29 Mar 2010 15:39:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44A1A8FC1B; Mon, 29 Mar 2010 15:39:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TFdI62097096; Mon, 29 Mar 2010 15:39:18 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TFdHV1097083; Mon, 29 Mar 2010 15:39:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201003291539.o2TFdHV1097083@svn.freebsd.org> From: Attilio Rao Date: Mon, 29 Mar 2010 15:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205836 - in stable/8/sys: amd64/amd64 amd64/include amd64/isa conf i386/i386 i386/include i386/isa i386/xen pc98/cbus pc98/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 15:39:18 -0000 Author: attilio Date: Mon Mar 29 15:39:17 2010 New Revision: 205836 URL: http://svn.freebsd.org/changeset/base/205836 Log: MFC r199852, r202387, r202441, r202534: Handling all the three clocks with the LAPIC may lead to aliasing for softclock and profclock. Revert the change when the LAPIC started taking charge of all three of them. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/amd64/amd64/local_apic.c stable/8/sys/amd64/include/apicvar.h stable/8/sys/amd64/isa/clock.c stable/8/sys/conf/files.pc98 stable/8/sys/conf/options.i386 stable/8/sys/conf/options.pc98 stable/8/sys/i386/i386/local_apic.c stable/8/sys/i386/include/apicvar.h stable/8/sys/i386/isa/clock.c stable/8/sys/i386/xen/exception.s stable/8/sys/pc98/cbus/clock.c stable/8/sys/pc98/conf/DEFAULTS Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/8/sys/amd64/amd64/local_apic.c Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/amd64/amd64/local_apic.c Mon Mar 29 15:39:17 2010 (r205836) @@ -160,6 +160,9 @@ static uint32_t lvt_mode(struct lapic *l struct pic lapic_pic = { .pic_resume = lapic_resume }; +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); + static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -415,10 +418,11 @@ lapic_disable_pmc(void) /* * Called by cpu_initclocks() on the BSP to setup the local APIC timer so * that it can drive hardclock, statclock, and profclock. This function - * returns true if it is able to use the local APIC timer to drive the - * clocks and false if it is not able. + * returns a positive integer if it is convenient to use the local APIC + * for all the clocks, a negative integer if it is convenient to use the + * local APIC only for the hardclock and 0 if none of them can be handled. */ -int +enum lapic_clock lapic_setup_clock(void) { u_long value; @@ -426,10 +430,10 @@ lapic_setup_clock(void) /* Can't drive the timer without a local APIC. */ if (lapic == NULL) - return (0); + return (LAPIC_CLOCK_NONE); if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) - return (0); + return (LAPIC_CLOCK_NONE); /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -461,19 +465,27 @@ lapic_setup_clock(void) * (and profhz) run at hz. If 'hz' is below 1500 but above * 750, then we let the lapic timer run at 2 * 'hz'. If 'hz' * is below 750 then we let the lapic timer run at 4 * 'hz'. + * + * Please note that stathz and profhz are set only if all the + * clocks are handled through the local APIC. */ - if (hz >= 1500) + if (lapic_allclocks != 0) { + if (hz >= 1500) + lapic_timer_hz = hz; + else if (hz >= 750) + lapic_timer_hz = hz * 2; + else + lapic_timer_hz = hz * 4; + } else lapic_timer_hz = hz; - else if (hz >= 750) - lapic_timer_hz = hz * 2; - else - lapic_timer_hz = hz * 4; - if (lapic_timer_hz < 128) - stathz = lapic_timer_hz; - else - stathz = lapic_timer_hz / (lapic_timer_hz / 128); - profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz; + if (lapic_allclocks != 0) { + if (lapic_timer_hz < 128) + stathz = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); + profhz = lapic_timer_hz; + } /* * Start up the timer on the BSP. The APs will kick off their @@ -481,7 +493,7 @@ lapic_setup_clock(void) */ lapic_timer_periodic(lapic_timer_period); lapic_timer_enable_intr(); - return (1); + return (lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL); } void @@ -784,20 +796,23 @@ lapic_handle_timer(struct trapframe *fra else hardclock_cpu(TRAPF_USERMODE(frame)); } + if (lapic_allclocks != 0) { - /* Fire statclock at stathz. */ - la->la_stat_ticks += stathz; - if (la->la_stat_ticks >= lapic_timer_hz) { - la->la_stat_ticks -= lapic_timer_hz; - statclock(TRAPF_USERMODE(frame)); - } + /* Fire statclock at stathz. */ + la->la_stat_ticks += stathz; + if (la->la_stat_ticks >= lapic_timer_hz) { + la->la_stat_ticks -= lapic_timer_hz; + statclock(TRAPF_USERMODE(frame)); + } - /* Fire profclock at profhz, but only when needed. */ - la->la_prof_ticks += profhz; - if (la->la_prof_ticks >= lapic_timer_hz) { - la->la_prof_ticks -= lapic_timer_hz; - if (profprocs != 0) - profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + /* Fire profclock at profhz, but only when needed. */ + la->la_prof_ticks += profhz; + if (la->la_prof_ticks >= lapic_timer_hz) { + la->la_prof_ticks -= lapic_timer_hz; + if (profprocs != 0) + profclock(TRAPF_USERMODE(frame), + TRAPF_PC(frame)); + } } critical_exit(); } Modified: stable/8/sys/amd64/include/apicvar.h ============================================================================== --- stable/8/sys/amd64/include/apicvar.h Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/amd64/include/apicvar.h Mon Mar 29 15:39:17 2010 (r205836) @@ -157,6 +157,12 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI +enum lapic_clock { + LAPIC_CLOCK_NONE, + LAPIC_CLOCK_HARDCLOCK, + LAPIC_CLOCK_ALL +}; + /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including * CPU's and I/O APIC's. @@ -224,7 +230,7 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -int lapic_setup_clock(void); +enum lapic_clock lapic_setup_clock(void); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: stable/8/sys/amd64/isa/clock.c ============================================================================== --- stable/8/sys/amd64/isa/clock.c Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/amd64/isa/clock.c Mon Mar 29 15:39:17 2010 (r205836) @@ -91,7 +91,7 @@ static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; static int using_atrtc_timer; -static int using_lapic_timer; +static enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -160,7 +160,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); if (using_atrtc_timer) { #ifdef SMP @@ -422,7 +423,7 @@ set_i8254_freq(u_int freq, int intr_freq i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -485,7 +486,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); @@ -508,7 +509,7 @@ cpu_initclocks() * kernel clocks, then setup the RTC to periodically interrupt to * drive statclock() and profclock(). */ - if (!using_lapic_timer) { + if (using_lapic_timer != LAPIC_CLOCK_ALL) { using_atrtc_timer = atrtc_setup_clock(); if (using_atrtc_timer) { /* Enable periodic interrupts from the RTC. */ @@ -532,7 +533,7 @@ void cpu_startprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_PROF); psdiv = pscnt = psratio; @@ -542,7 +543,7 @@ void cpu_stopprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_NOPROF); psdiv = pscnt = 1; Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/conf/files.pc98 Mon Mar 29 15:39:17 2010 (r205836) @@ -194,7 +194,7 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c standard +i386/isa/atpic.c optional atpic #i386/isa/atpic_vector.s standard i386/isa/elink.c optional ep | ie i386/isa/isa.c optional isa @@ -240,7 +240,7 @@ pc98/cbus/gdc.c optional gdc pc98/cbus/nmi.c standard pc98/cbus/olpt.c optional olpt pc98/cbus/pckbd.c optional pckbd -pc98/cbus/pcrtc.c standard +pc98/cbus/pcrtc.c optional atpic pc98/cbus/pmc.c optional pmc pc98/cbus/scgdcrndr.c optional sc gdc pc98/cbus/scterm-sck.c optional sc Modified: stable/8/sys/conf/options.i386 ============================================================================== --- stable/8/sys/conf/options.i386 Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/conf/options.i386 Mon Mar 29 15:39:17 2010 (r205836) @@ -106,6 +106,7 @@ NETGRAPH_CRONYX opt_ng_cronyx.h # Device options DEV_APIC opt_apic.h +DEV_ATPIC opt_atpic.h DEV_NPX opt_npx.h ASR_COMPAT opt_asr.h Modified: stable/8/sys/conf/options.pc98 ============================================================================== --- stable/8/sys/conf/options.pc98 Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/conf/options.pc98 Mon Mar 29 15:39:17 2010 (r205836) @@ -90,6 +90,7 @@ PC98 opt_global.h # Device options DEV_APIC opt_apic.h +DEV_ATPIC opt_atpic.h DEV_MECIA opt_mecia.h DEV_NPX opt_npx.h Modified: stable/8/sys/i386/i386/local_apic.c ============================================================================== --- stable/8/sys/i386/i386/local_apic.c Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/i386/i386/local_apic.c Mon Mar 29 15:39:17 2010 (r205836) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -160,6 +161,17 @@ static uint32_t lvt_mode(struct lapic *l struct pic lapic_pic = { .pic_resume = lapic_resume }; +/* + * The atrtc device is compiled in only if atpic is present. + * If it is not, force lapic to take care of all the clocks. + */ +#ifdef DEV_ATPIC +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); +#else +static int lapic_allclocks = 1; +#endif + static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -416,11 +428,9 @@ lapic_disable_pmc(void) /* * Called by cpu_initclocks() on the BSP to setup the local APIC timer so - * that it can drive hardclock, statclock, and profclock. This function - * returns true if it is able to use the local APIC timer to drive the - * clocks and false if it is not able. + * that it can drive hardclock, statclock, and profclock. */ -int +enum lapic_clock lapic_setup_clock(void) { u_long value; @@ -428,10 +438,10 @@ lapic_setup_clock(void) /* Can't drive the timer without a local APIC. */ if (lapic == NULL) - return (0); + return (LAPIC_CLOCK_NONE); if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) - return (0); + return (LAPIC_CLOCK_NONE); /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -463,19 +473,27 @@ lapic_setup_clock(void) * (and profhz) run at hz. If 'hz' is below 1500 but above * 750, then we let the lapic timer run at 2 * 'hz'. If 'hz' * is below 750 then we let the lapic timer run at 4 * 'hz'. + * + * Please note that stathz and profhz are set only if all the + * clocks are handled through the local APIC. */ - if (hz >= 1500) + if (lapic_allclocks != 0) { + if (hz >= 1500) + lapic_timer_hz = hz; + else if (hz >= 750) + lapic_timer_hz = hz * 2; + else + lapic_timer_hz = hz * 4; + } else lapic_timer_hz = hz; - else if (hz >= 750) - lapic_timer_hz = hz * 2; - else - lapic_timer_hz = hz * 4; - if (lapic_timer_hz < 128) - stathz = lapic_timer_hz; - else - stathz = lapic_timer_hz / (lapic_timer_hz / 128); - profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz; + if (lapic_allclocks != 0) { + if (lapic_timer_hz < 128) + stathz = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); + profhz = lapic_timer_hz; + } /* * Start up the timer on the BSP. The APs will kick off their @@ -483,7 +501,7 @@ lapic_setup_clock(void) */ lapic_timer_periodic(lapic_timer_period); lapic_timer_enable_intr(); - return (1); + return (lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL); } void @@ -786,20 +804,23 @@ lapic_handle_timer(struct trapframe *fra else hardclock_cpu(TRAPF_USERMODE(frame)); } + if (lapic_allclocks != 0) { - /* Fire statclock at stathz. */ - la->la_stat_ticks += stathz; - if (la->la_stat_ticks >= lapic_timer_hz) { - la->la_stat_ticks -= lapic_timer_hz; - statclock(TRAPF_USERMODE(frame)); - } + /* Fire statclock at stathz. */ + la->la_stat_ticks += stathz; + if (la->la_stat_ticks >= lapic_timer_hz) { + la->la_stat_ticks -= lapic_timer_hz; + statclock(TRAPF_USERMODE(frame)); + } - /* Fire profclock at profhz, but only when needed. */ - la->la_prof_ticks += profhz; - if (la->la_prof_ticks >= lapic_timer_hz) { - la->la_prof_ticks -= lapic_timer_hz; - if (profprocs != 0) - profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + /* Fire profclock at profhz, but only when needed. */ + la->la_prof_ticks += profhz; + if (la->la_prof_ticks >= lapic_timer_hz) { + la->la_prof_ticks -= lapic_timer_hz; + if (profprocs != 0) + profclock(TRAPF_USERMODE(frame), + TRAPF_PC(frame)); + } } critical_exit(); } Modified: stable/8/sys/i386/include/apicvar.h ============================================================================== --- stable/8/sys/i386/include/apicvar.h Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/i386/include/apicvar.h Mon Mar 29 15:39:17 2010 (r205836) @@ -186,6 +186,12 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI +enum lapic_clock { + LAPIC_CLOCK_NONE, + LAPIC_CLOCK_HARDCLOCK, + LAPIC_CLOCK_ALL +}; + /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including * CPU's and I/O APIC's. @@ -253,7 +259,7 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -int lapic_setup_clock(void); +enum lapic_clock lapic_setup_clock(void); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: stable/8/sys/i386/isa/clock.c ============================================================================== --- stable/8/sys/i386/isa/clock.c Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/i386/isa/clock.c Mon Mar 29 15:39:17 2010 (r205836) @@ -65,9 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef DEV_APIC #include -#endif #include #include #include @@ -106,7 +104,7 @@ static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; static int using_atrtc_timer; -static int using_lapic_timer; +static enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -175,7 +173,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); #ifdef KDTRACE_HOOKS /* @@ -453,7 +452,7 @@ set_i8254_freq(u_int freq, int intr_freq i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -533,7 +532,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); @@ -556,7 +555,7 @@ cpu_initclocks() * kernel clocks, then setup the RTC to periodically interrupt to * drive statclock() and profclock(). */ - if (!using_lapic_timer) { + if (using_lapic_timer != LAPIC_CLOCK_ALL) { using_atrtc_timer = atrtc_setup_clock(); if (using_atrtc_timer) { /* Enable periodic interrupts from the RTC. */ @@ -580,7 +579,7 @@ void cpu_startprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_PROF); psdiv = pscnt = psratio; @@ -590,7 +589,7 @@ void cpu_stopprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_NOPROF); psdiv = pscnt = 1; Modified: stable/8/sys/i386/xen/exception.s ============================================================================== --- stable/8/sys/i386/xen/exception.s Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/i386/xen/exception.s Mon Mar 29 15:39:17 2010 (r205836) @@ -295,10 +295,6 @@ ENTRY(fork_trampoline) SUPERALIGN_TEXT MCOUNT_LABEL(bintr) -#ifdef DEV_ATPIC -#include -#endif - #ifdef DEV_APIC .data .p2align 4 Modified: stable/8/sys/pc98/cbus/clock.c ============================================================================== --- stable/8/sys/pc98/cbus/clock.c Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/pc98/cbus/clock.c Mon Mar 29 15:39:17 2010 (r205836) @@ -67,9 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef DEV_APIC #include -#endif #include #include #include @@ -101,7 +99,7 @@ static u_int32_t i8254_lastcount; static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; -static int using_lapic_timer; +static enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -164,7 +162,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); #ifdef KDTRACE_HOOKS /* @@ -360,7 +359,7 @@ set_i8254_freq(u_int freq, int intr_freq i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -443,7 +442,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); Modified: stable/8/sys/pc98/conf/DEFAULTS ============================================================================== --- stable/8/sys/pc98/conf/DEFAULTS Mon Mar 29 15:29:06 2010 (r205835) +++ stable/8/sys/pc98/conf/DEFAULTS Mon Mar 29 15:39:17 2010 (r205836) @@ -24,3 +24,6 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_PC98 + +# enable support for native hardware +device atpic From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 15:59:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59AF1065675; Mon, 29 Mar 2010 15:59:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D39A28FC1A; Mon, 29 Mar 2010 15:59:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TFxbIt001876; Mon, 29 Mar 2010 15:59:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TFxbE4001874; Mon, 29 Mar 2010 15:59:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003291559.o2TFxbE4001874@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 29 Mar 2010 15:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205837 - stable/8/sys/compat/x86bios X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 15:59:38 -0000 Author: jkim Date: Mon Mar 29 15:59:37 2010 New Revision: 205837 URL: http://svn.freebsd.org/changeset/base/205837 Log: MFC: r205647 Fix stupid typos. Some VESA BIOSes directly call BIOS interrupt handlers within the VBE interrupt handler. Unfortunately it was causing real mode page faults because we were fetching instructions from bogus addresses. PR: kern/144654 Modified: stable/8/sys/compat/x86bios/x86bios.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/x86bios/x86bios.c ============================================================================== --- stable/8/sys/compat/x86bios/x86bios.c Mon Mar 29 15:39:17 2010 (r205836) +++ stable/8/sys/compat/x86bios/x86bios.c Mon Mar 29 15:59:37 2010 (r205837) @@ -267,8 +267,8 @@ x86bios_emu_get_intr(struct x86emu *emu, sp[2] = htole16(emu->x86.R_FLG); iv = x86bios_get_intr(intno); - emu->x86.R_IP = iv & 0x000f; - emu->x86.R_CS = (iv >> 12) & 0xffff; + emu->x86.R_IP = iv & 0xffff; + emu->x86.R_CS = (iv >> 16) & 0xffff; emu->x86.R_FLG &= ~(F_IF | F_TF); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 17:32:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19A5F1065679; Mon, 29 Mar 2010 17:32:17 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id D0BD38FC16; Mon, 29 Mar 2010 17:32:16 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id E2D871DD770; Mon, 29 Mar 2010 19:32:14 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id D944B17204; Mon, 29 Mar 2010 19:32:14 +0200 (CEST) Date: Mon, 29 Mar 2010 19:32:14 +0200 From: Jilles Tjoelker To: Doug Barton Message-ID: <20100329173214.GA17249@stack.nl> References: <201003282019.o2SKJfPg033857@svn.freebsd.org> <4BAFBBFA.7020701@FreeBSD.org> <20100328210630.GA2086@stack.nl> <4BAFE1EE.9040908@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BAFE1EE.9040908@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205806 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 17:32:17 -0000 On Sun, Mar 28, 2010 at 04:10:38PM -0700, Doug Barton wrote: > On 03/28/10 14:06, Jilles Tjoelker wrote: > > On Sun, Mar 28, 2010 at 01:28:42PM -0700, Doug Barton wrote: > >> Probably my fault for not saying something sooner, but there is a > >> problem with the code in head that sometimes causes it to loop > >> repeatedly even though pwait exits successfully. I am trying to track it > >> down, but since it only happens about once every 10 shutdowns it's been > >> difficult. > > There is a difference between the two methods in what is waited for > > exactly. pwait(1) will wait for the process to terminate; if it is > > applied to a zombie it will return immediately (printing the exit status > > if -v was given). On the other hand, kill(1) will continue to return > > success until the process has been waited for by its parent. > The process that I see this with most often is devd, does that fit the > model you're describing? Possibly. This would mainly happen because init has been busy, I think (or if the parent isn't init). > What are the implications of moving on after a > successful pwait even though there is still a zombie process? For shutdown/stop, nothing. For restart, there may be problems if a restarted daemon checks the validity of the pid in the pidfile using kill(). > > An obvious fix is to trust pwait if it returns successfully, e.g. like > > if pwait $_list 2>/dev/null; then break; else sleep 2; fi > It can't be break, the point of the loop is that wait_for_pids() takes a > list. We may be able to use continue however. pwait with a list waits until all of the processes have terminated. -- Jilles Tjoelker From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 18:24:08 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5F55106566B; Mon, 29 Mar 2010 18:24:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A25438FC15; Mon, 29 Mar 2010 18:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TIO8Ov035008; Mon, 29 Mar 2010 18:24:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TIO8fF035001; Mon, 29 Mar 2010 18:24:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003291824.o2TIO8fF035001@svn.freebsd.org> From: Xin LI Date: Mon, 29 Mar 2010 18:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205848 - in stable/8: . contrib/cpio gnu/usr.bin gnu/usr.bin/cpio share/man/man5 share/mk tools/build/mk tools/build/options usr.bin/cpio X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 18:24:08 -0000 Author: delphij Date: Mon Mar 29 18:24:08 2010 New Revision: 205848 URL: http://svn.freebsd.org/changeset/base/205848 Log: MFC r205702: Remove GNU cpio after fix of CVE-2010-0624. Note that this is actually a no-op for most users, as this GNU cpio was broken on -HEAD and 8-STABLE since last March until the recent fix. FreeBSD 8.0+ uses BSD cpio by default and the code is being actively maintained. Deleted: stable/8/contrib/cpio/ stable/8/gnu/usr.bin/cpio/ stable/8/tools/build/options/WITH_GNU_CPIO Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/gnu/usr.bin/Makefile (contents, props changed) stable/8/share/man/man5/src.conf.5 stable/8/share/mk/bsd.own.mk stable/8/tools/build/mk/OptionalObsoleteFiles.inc stable/8/usr.bin/cpio/Makefile Directory Properties: stable/8/contrib/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/mk/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/usr.bin/cpio/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Mon Mar 29 18:04:06 2010 (r205847) +++ stable/8/ObsoleteFiles.inc Mon Mar 29 18:24:08 2010 (r205848) @@ -14,6 +14,10 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100329: gcpio removal +OLD_FILES+=usr/bin/gcpio +OLD_FILES+=usr/share/info/cpio.info.gz +OLD_FILES+=usr/share/man/man1/gcpio.1.gz # 20100301: vesa and dpms promoted to be i386/amd64 common OLD_FILES+=usr/include/machine/pc/vesa.h OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz Modified: stable/8/gnu/usr.bin/Makefile ============================================================================== --- stable/8/gnu/usr.bin/Makefile Mon Mar 29 18:04:06 2010 (r205847) +++ stable/8/gnu/usr.bin/Makefile Mon Mar 29 18:24:08 2010 (r205848) @@ -5,7 +5,6 @@ SUBDIR= bc \ ${_binutils} \ ${_cc} \ - ${_cpio} \ ${_cvs} \ dc \ dialog \ @@ -34,10 +33,6 @@ _groff= groff .endif .endif -.if ${MK_GNU_CPIO} == "yes" -_cpio= cpio -.endif - .if ${MK_CVS} != "no" _cvs= cvs .endif Modified: stable/8/share/man/man5/src.conf.5 ============================================================================== --- stable/8/share/man/man5/src.conf.5 Mon Mar 29 18:04:06 2010 (r205847) +++ stable/8/share/man/man5/src.conf.5 Mon Mar 29 18:24:08 2010 (r205848) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/8/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd January 30, 2010 +.Dd March 29, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -339,13 +339,6 @@ When set, it also enforces the following .It .Va WITHOUT_GNU_SUPPORT .El -.It Va WITH_GNU_CPIO -.\" from FreeBSD: stable/8/tools/build/options/WITH_GNU_CPIO 179813 2008-06-16 05:48:15Z dougb -Set to build GNU cpio as a part of the base system, -and symlink -.Pa /usr/bin/cpio -to this version. -(This will override the symlink to the BSD version.) .It Va WITHOUT_GNU_GREP .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GNU_GREP 179813 2008-06-16 05:48:15Z dougb Set to not build GNU grep as a part of the base system. Modified: stable/8/share/mk/bsd.own.mk ============================================================================== --- stable/8/share/mk/bsd.own.mk Mon Mar 29 18:04:06 2010 (r205847) +++ stable/8/share/mk/bsd.own.mk Mon Mar 29 18:24:08 2010 (r205848) @@ -407,7 +407,6 @@ MK_${var}:= yes BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ - GNU_CPIO \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) Modified: stable/8/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/8/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 29 18:04:06 2010 (r205847) +++ stable/8/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 29 18:24:08 2010 (r205848) @@ -394,12 +394,6 @@ OLD_FILES+=usr/share/man/man1/gcov.1.gz # to be filled in #.endif -.if ${MK_GNU_CPIO} == no -OLD_FILES+=usr/bin/gcpio -OLD_FILES+=usr/share/info/cpio.info.gz -OLD_FILES+=usr/share/man/man1/gcpio.1.gz -.endif - #.if ${MK_GPIB} == no # none #.endif Modified: stable/8/usr.bin/cpio/Makefile ============================================================================== --- stable/8/usr.bin/cpio/Makefile Mon Mar 29 18:04:06 2010 (r205847) +++ stable/8/usr.bin/cpio/Makefile Mon Mar 29 18:24:08 2010 (r205848) @@ -19,10 +19,8 @@ LDADD+= -larchive -lz -lbz2 -lmd LDADD+= -lcrypto .endif -.if ${MK_GNU_CPIO} != "yes" SYMLINKS=bsdcpio ${BINDIR}/cpio MLINKS= bsdcpio.1 cpio.1 -.endif .PHONY: check test From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 29 22:52:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E338B1065674; Mon, 29 Mar 2010 22:52:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67158FC1A; Mon, 29 Mar 2010 22:52:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2TMqp9Z095215; Mon, 29 Mar 2010 22:52:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2TMqpXI095209; Mon, 29 Mar 2010 22:52:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003292252.o2TMqpXI095209@svn.freebsd.org> From: Xin LI Date: Mon, 29 Mar 2010 22:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205866 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 22:52:52 -0000 Author: delphij Date: Mon Mar 29 22:52:51 2010 New Revision: 205866 URL: http://svn.freebsd.org/changeset/base/205866 Log: MFC r204383: Add several necessary .El's Modified: stable/8/share/man/man9/BUF_ISLOCKED.9 stable/8/share/man/man9/BUF_RECURSED.9 stable/8/share/man/man9/DEVICE_PROBE.9 stable/8/share/man/man9/VOP_LOCK.9 stable/8/share/man/man9/devfs_set_cdevpriv.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/BUF_ISLOCKED.9 ============================================================================== --- stable/8/share/man/man9/BUF_ISLOCKED.9 Mon Mar 29 22:41:30 2010 (r205865) +++ stable/8/share/man/man9/BUF_ISLOCKED.9 Mon Mar 29 22:52:51 2010 (r205866) @@ -57,6 +57,7 @@ An exclusive lock is held by someone oth A shared lock is held. .It Li 0 The lock is not held by anyone. +.El .Sh SEE ALSO .Xr lockstatus 9 , .Xr buf 9 , Modified: stable/8/share/man/man9/BUF_RECURSED.9 ============================================================================== --- stable/8/share/man/man9/BUF_RECURSED.9 Mon Mar 29 22:41:30 2010 (r205865) +++ stable/8/share/man/man9/BUF_RECURSED.9 Mon Mar 29 22:52:51 2010 (r205866) @@ -54,6 +54,7 @@ The buffer linked to the lock. See .Xr lockmgr_recursed 9 for details. +.El .Sh SEE ALSO .Xr buf 9 , .Xr BUF_LOCK 9 , Modified: stable/8/share/man/man9/DEVICE_PROBE.9 ============================================================================== --- stable/8/share/man/man9/DEVICE_PROBE.9 Mon Mar 29 22:41:30 2010 (r205865) +++ stable/8/share/man/man9/DEVICE_PROBE.9 Mon Mar 29 22:52:51 2010 (r205866) @@ -127,6 +127,7 @@ The driver expects its parent to tell it and no probing is really done. The device only matches if its parent bus specifically said to use this driver. +.El .Sh SEE ALSO .Xr device 9 , .Xr DEVICE_ATTACH 9 , Modified: stable/8/share/man/man9/VOP_LOCK.9 ============================================================================== --- stable/8/share/man/man9/VOP_LOCK.9 Mon Mar 29 22:41:30 2010 (r205865) +++ stable/8/share/man/man9/VOP_LOCK.9 Mon Mar 29 22:52:51 2010 (r205866) @@ -114,6 +114,7 @@ directly. .Fn vn_lock also does not want a thread specified as argument but it assumes curthread to be used. +.El .Sh RETURN VALUES Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO Modified: stable/8/share/man/man9/devfs_set_cdevpriv.9 ============================================================================== --- stable/8/share/man/man9/devfs_set_cdevpriv.9 Mon Mar 29 22:41:30 2010 (r205865) +++ stable/8/share/man/man9/devfs_set_cdevpriv.9 Mon Mar 29 22:52:51 2010 (r205866) @@ -108,7 +108,7 @@ The private driver data was not associat filedescriptor, or .Fn devfs_clear_cdevpriv was called. -.Pp +.El .Sh SEE ALSO .Xr open 2 , .Xr close 2 , From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 11:19:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82AA8106566C; Tue, 30 Mar 2010 11:19:30 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EBC78FC12; Tue, 30 Mar 2010 11:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UBJU9L063189; Tue, 30 Mar 2010 11:19:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UBJUAr063181; Tue, 30 Mar 2010 11:19:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201003301119.o2UBJUAr063181@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Mar 2010 11:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205875 - in stable/8/sys: amd64/amd64 amd64/include amd64/isa i386/i386 i386/include i386/isa pc98/cbus X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 11:19:31 -0000 Author: attilio Date: Tue Mar 30 11:19:29 2010 New Revision: 205875 URL: http://svn.freebsd.org/changeset/base/205875 Log: MFC r204641, r204753: Improving the clocks auto-tunning by firstly checking if the atrtc may be correctly initialized and just then assign to softclock/profclock. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/amd64/amd64/local_apic.c stable/8/sys/amd64/include/apicvar.h stable/8/sys/amd64/isa/clock.c stable/8/sys/i386/i386/local_apic.c stable/8/sys/i386/include/apicvar.h stable/8/sys/i386/isa/clock.c stable/8/sys/pc98/cbus/clock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/8/sys/amd64/amd64/local_apic.c Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/amd64/amd64/local_apic.c Tue Mar 30 11:19:29 2010 (r205875) @@ -149,6 +149,7 @@ extern inthand_t IDTVEC(rsvd); volatile lapic_t *lapic; vm_paddr_t lapic_paddr; static u_long lapic_timer_divisor, lapic_timer_period, lapic_timer_hz; +static enum lapic_clock clockcoverage; static void lapic_enable(void); static void lapic_resume(struct pic *pic); @@ -160,9 +161,6 @@ static uint32_t lvt_mode(struct lapic *l struct pic lapic_pic = { .pic_resume = lapic_resume }; -static int lapic_allclocks; -TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); - static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -423,17 +421,20 @@ lapic_disable_pmc(void) * local APIC only for the hardclock and 0 if none of them can be handled. */ enum lapic_clock -lapic_setup_clock(void) +lapic_setup_clock(enum lapic_clock srcsdes) { u_long value; int i; - /* Can't drive the timer without a local APIC. */ - if (lapic == NULL) - return (LAPIC_CLOCK_NONE); + /* lapic_setup_clock() should not be called with LAPIC_CLOCK_NONE. */ + MPASS(srcsdes != LAPIC_CLOCK_NONE); - if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) - return (LAPIC_CLOCK_NONE); + /* Can't drive the timer without a local APIC. */ + if (lapic == NULL || + (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0)) { + clockcoverage = LAPIC_CLOCK_NONE; + return (clockcoverage); + } /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -469,7 +470,7 @@ lapic_setup_clock(void) * Please note that stathz and profhz are set only if all the * clocks are handled through the local APIC. */ - if (lapic_allclocks != 0) { + if (srcsdes == LAPIC_CLOCK_ALL) { if (hz >= 1500) lapic_timer_hz = hz; else if (hz >= 750) @@ -479,7 +480,7 @@ lapic_setup_clock(void) } else lapic_timer_hz = hz; lapic_timer_period = value / lapic_timer_hz; - if (lapic_allclocks != 0) { + if (srcsdes == LAPIC_CLOCK_ALL) { if (lapic_timer_hz < 128) stathz = lapic_timer_hz; else @@ -493,7 +494,8 @@ lapic_setup_clock(void) */ lapic_timer_periodic(lapic_timer_period); lapic_timer_enable_intr(); - return (lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL); + clockcoverage = srcsdes; + return (srcsdes); } void @@ -796,7 +798,7 @@ lapic_handle_timer(struct trapframe *fra else hardclock_cpu(TRAPF_USERMODE(frame)); } - if (lapic_allclocks != 0) { + if (clockcoverage == LAPIC_CLOCK_ALL) { /* Fire statclock at stathz. */ la->la_stat_ticks += stathz; Modified: stable/8/sys/amd64/include/apicvar.h ============================================================================== --- stable/8/sys/amd64/include/apicvar.h Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/amd64/include/apicvar.h Tue Mar 30 11:19:29 2010 (r205875) @@ -230,7 +230,7 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -enum lapic_clock lapic_setup_clock(void); +enum lapic_clock lapic_setup_clock(enum lapic_clock srcsdes); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: stable/8/sys/amd64/isa/clock.c ============================================================================== --- stable/8/sys/amd64/isa/clock.c Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/amd64/isa/clock.c Tue Mar 30 11:19:29 2010 (r205875) @@ -84,6 +84,9 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq int i8254_max_count; static int i8254_real_max_count; +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); + struct mtx clock_lock; static struct intsrc *i8254_intsrc; static u_int32_t i8254_lastcount; @@ -478,8 +481,22 @@ startrtclock() void cpu_initclocks() { + enum lapic_clock tlsca; + int tasc; + + /* Initialize RTC. */ + atrtc_start(); + tasc = atrtc_setup_clock(); + + /* + * If the atrtc successfully initialized and the users didn't force + * otherwise use the LAPIC in order to cater hardclock only, otherwise + * take in charge all the clock sources. + */ + tlsca = (lapic_allclocks == 0 && tasc != 0) ? LAPIC_CLOCK_HARDCLOCK : + LAPIC_CLOCK_ALL; + using_lapic_timer = lapic_setup_clock(tlsca); - using_lapic_timer = lapic_setup_clock(); /* * If we aren't using the local APIC timer to drive the kernel * clocks, setup the interrupt handler for the 8254 timer 0 so @@ -500,9 +517,6 @@ cpu_initclocks() set_i8254_freq(i8254_freq, hz); } - /* Initialize RTC. */ - atrtc_start(); - /* * If the separate statistics clock hasn't been explicility disabled * and we aren't already using the local APIC timer to drive the @@ -510,7 +524,7 @@ cpu_initclocks() * drive statclock() and profclock(). */ if (using_lapic_timer != LAPIC_CLOCK_ALL) { - using_atrtc_timer = atrtc_setup_clock(); + using_atrtc_timer = tasc; if (using_atrtc_timer) { /* Enable periodic interrupts from the RTC. */ intr_add_handler("rtc", 8, Modified: stable/8/sys/i386/i386/local_apic.c ============================================================================== --- stable/8/sys/i386/i386/local_apic.c Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/i386/i386/local_apic.c Tue Mar 30 11:19:29 2010 (r205875) @@ -150,6 +150,7 @@ extern inthand_t IDTVEC(rsvd); volatile lapic_t *lapic; vm_paddr_t lapic_paddr; static u_long lapic_timer_divisor, lapic_timer_period, lapic_timer_hz; +static enum lapic_clock clockcoverage; static void lapic_enable(void); static void lapic_resume(struct pic *pic); @@ -161,17 +162,6 @@ static uint32_t lvt_mode(struct lapic *l struct pic lapic_pic = { .pic_resume = lapic_resume }; -/* - * The atrtc device is compiled in only if atpic is present. - * If it is not, force lapic to take care of all the clocks. - */ -#ifdef DEV_ATPIC -static int lapic_allclocks; -TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); -#else -static int lapic_allclocks = 1; -#endif - static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -431,17 +421,20 @@ lapic_disable_pmc(void) * that it can drive hardclock, statclock, and profclock. */ enum lapic_clock -lapic_setup_clock(void) +lapic_setup_clock(enum lapic_clock srcsdes) { u_long value; int i; - /* Can't drive the timer without a local APIC. */ - if (lapic == NULL) - return (LAPIC_CLOCK_NONE); + /* lapic_setup_clock() should not be called with LAPIC_CLOCK_NONE. */ + MPASS(srcsdes != LAPIC_CLOCK_NONE); - if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) - return (LAPIC_CLOCK_NONE); + /* Can't drive the timer without a local APIC. */ + if (lapic == NULL || + (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0)) { + clockcoverage = LAPIC_CLOCK_NONE; + return (clockcoverage); + } /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -477,7 +470,7 @@ lapic_setup_clock(void) * Please note that stathz and profhz are set only if all the * clocks are handled through the local APIC. */ - if (lapic_allclocks != 0) { + if (srcsdes == LAPIC_CLOCK_ALL) { if (hz >= 1500) lapic_timer_hz = hz; else if (hz >= 750) @@ -487,7 +480,7 @@ lapic_setup_clock(void) } else lapic_timer_hz = hz; lapic_timer_period = value / lapic_timer_hz; - if (lapic_allclocks != 0) { + if (srcsdes == LAPIC_CLOCK_ALL) { if (lapic_timer_hz < 128) stathz = lapic_timer_hz; else @@ -501,7 +494,8 @@ lapic_setup_clock(void) */ lapic_timer_periodic(lapic_timer_period); lapic_timer_enable_intr(); - return (lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL); + clockcoverage = srcsdes; + return (srcsdes); } void @@ -804,7 +798,7 @@ lapic_handle_timer(struct trapframe *fra else hardclock_cpu(TRAPF_USERMODE(frame)); } - if (lapic_allclocks != 0) { + if (clockcoverage == LAPIC_CLOCK_ALL) { /* Fire statclock at stathz. */ la->la_stat_ticks += stathz; Modified: stable/8/sys/i386/include/apicvar.h ============================================================================== --- stable/8/sys/i386/include/apicvar.h Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/i386/include/apicvar.h Tue Mar 30 11:19:29 2010 (r205875) @@ -259,7 +259,7 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -enum lapic_clock lapic_setup_clock(void); +enum lapic_clock lapic_setup_clock(enum lapic_clock srcsdes); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: stable/8/sys/i386/isa/clock.c ============================================================================== --- stable/8/sys/i386/isa/clock.c Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/i386/isa/clock.c Tue Mar 30 11:19:29 2010 (r205875) @@ -97,6 +97,9 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq int i8254_max_count; static int i8254_real_max_count; +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); + struct mtx clock_lock; static struct intsrc *i8254_intsrc; static u_int32_t i8254_lastcount; @@ -522,9 +525,24 @@ startrtclock() void cpu_initclocks() { +#ifdef DEV_APIC + enum lapic_clock tlsca; +#endif + int tasc; + + /* Initialize RTC. */ + atrtc_start(); + tasc = atrtc_setup_clock(); + /* + * If the atrtc successfully initialized and the users didn't force + * otherwise use the LAPIC in order to cater hardclock only, otherwise + * take in charge all the clock sources. + */ #ifdef DEV_APIC - using_lapic_timer = lapic_setup_clock(); + tlsca = (lapic_allclocks == 0 && tasc != 0) ? LAPIC_CLOCK_HARDCLOCK : + LAPIC_CLOCK_ALL; + using_lapic_timer = lapic_setup_clock(tlsca); #endif /* * If we aren't using the local APIC timer to drive the kernel @@ -546,9 +564,6 @@ cpu_initclocks() set_i8254_freq(i8254_freq, hz); } - /* Initialize RTC. */ - atrtc_start(); - /* * If the separate statistics clock hasn't been explicility disabled * and we aren't already using the local APIC timer to drive the @@ -556,7 +571,7 @@ cpu_initclocks() * drive statclock() and profclock(). */ if (using_lapic_timer != LAPIC_CLOCK_ALL) { - using_atrtc_timer = atrtc_setup_clock(); + using_atrtc_timer = tasc; if (using_atrtc_timer) { /* Enable periodic interrupts from the RTC. */ intr_add_handler("rtc", 8, Modified: stable/8/sys/pc98/cbus/clock.c ============================================================================== --- stable/8/sys/pc98/cbus/clock.c Tue Mar 30 09:58:21 2010 (r205874) +++ stable/8/sys/pc98/cbus/clock.c Tue Mar 30 11:19:29 2010 (r205875) @@ -93,6 +93,9 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq int i8254_max_count; static int i8254_real_max_count; +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); + static struct mtx clock_lock; static struct intsrc *i8254_intsrc; static u_int32_t i8254_lastcount; @@ -432,9 +435,11 @@ startrtclock() void cpu_initclocks() { +#if defined(DEV_APIC) + enum lapic_clock tlsca; -#ifdef DEV_APIC - using_lapic_timer = lapic_setup_clock(); + tlsca = lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL; + using_lapic_timer = lapic_setup_clock(tlsca); #endif /* * If we aren't using the local APIC timer to drive the kernel From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 11:46:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD5D106566C; Tue, 30 Mar 2010 11:46:44 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28B188FC13; Tue, 30 Mar 2010 11:46:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UBkiTK069162; Tue, 30 Mar 2010 11:46:44 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UBkiqH069160; Tue, 30 Mar 2010 11:46:44 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201003301146.o2UBkiqH069160@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Mar 2010 11:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205876 - stable/8/sys/dev/aac X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 11:46:44 -0000 Author: attilio Date: Tue Mar 30 11:46:43 2010 New Revision: 205876 URL: http://svn.freebsd.org/changeset/base/205876 Log: MFC r205160: Checkin a facility for specifying a passthrough FIB from userland. arcconf tool by Adaptec already seems to use for identifying the Serial Number of the devices. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Mar 30 11:19:29 2010 (r205875) +++ stable/8/sys/dev/aac/aac.c Tue Mar 30 11:46:43 2010 (r205876) @@ -3063,7 +3063,147 @@ out: static int aac_ioctl_send_raw_srb(struct aac_softc *sc, caddr_t arg) { - return (EINVAL); + struct aac_command *cm; + struct aac_event *event; + struct aac_fib *fib; + struct aac_srb *srbcmd, *user_srb; + struct aac_sg_entry *sge; + struct aac_sg_entry64 *sge64; + void *srb_sg_address, *ureply; + uint32_t fibsize, srb_sg_bytecount; + int error, transfer_data; + + fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + + cm = NULL; + transfer_data = 0; + fibsize = 0; + user_srb = (struct aac_srb *)arg; + + mtx_lock(&sc->aac_io_lock); + if (aac_alloc_command(sc, &cm)) { + event = malloc(sizeof(struct aac_event), M_AACBUF, + M_NOWAIT | M_ZERO); + if (event == NULL) { + error = EBUSY; + mtx_unlock(&sc->aac_io_lock); + goto out; + } + event->ev_type = AAC_EVENT_CMFREE; + event->ev_callback = aac_ioctl_event; + event->ev_arg = &cm; + aac_add_event(sc, event); + msleep(cm, &sc->aac_io_lock, 0, "aacraw", 0); + } + mtx_unlock(&sc->aac_io_lock); + + cm->cm_data = NULL; + fib = cm->cm_fib; + srbcmd = (struct aac_srb *)fib->data; + error = copyin(&user_srb->data_len, &fibsize, sizeof(uint32_t)); + if (error != 0) + goto out; + if (fibsize > (sc->aac_max_fib_size - sizeof(struct aac_fib_header))) { + error = EINVAL; + goto out; + } + error = copyin(user_srb, srbcmd, fibsize); + if (error != 0) + goto out; + srbcmd->function = 0; + srbcmd->retry_limit = 0; + if (srbcmd->sg_map.SgCount > 1) { + error = EINVAL; + goto out; + } + + /* Retrieve correct SG entries. */ + if (fibsize == (sizeof(struct aac_srb) + + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry))) { + sge = srbcmd->sg_map.SgEntry; + sge64 = NULL; + srb_sg_bytecount = sge->SgByteCount; +#ifdef __amd64__ + srb_sg_address = (void *)(uint64_t)sge->SgAddress; +#else + srb_sg_address = (void *)sge->SgAddress; +#endif + } +#ifdef __amd64__ + else if (fibsize == (sizeof(struct aac_srb) + + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { + sge = NULL; + sge64 = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; + srb_sg_bytecount = sge64->SgByteCount; + srb_sg_address = (void *)sge64->SgAddress; + if (sge64->SgAddress > 0xffffffffull && + (sc->flags & AAC_FLAGS_SG_64BIT) == 0) { + error = EINVAL; + goto out; + } + } +#endif + else { + error = EINVAL; + goto out; + } + ureply = (char *)arg + fibsize; + srbcmd->data_len = srb_sg_bytecount; + if (srbcmd->sg_map.SgCount == 1) + transfer_data = 1; + + cm->cm_sgtable = (struct aac_sg_table *)&srbcmd->sg_map; + if (transfer_data) { + cm->cm_datalen = srb_sg_bytecount; + cm->cm_data = malloc(cm->cm_datalen, M_AACBUF, M_NOWAIT); + if (cm->cm_data == NULL) { + error = ENOMEM; + goto out; + } + if (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN) + cm->cm_flags |= AAC_CMD_DATAIN; + if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) { + cm->cm_flags |= AAC_CMD_DATAOUT; + error = copyin(srb_sg_address, cm->cm_data, + cm->cm_datalen); + if (error != 0) + goto out; + } + } + + fib->Header.Size = sizeof(struct aac_fib_header) + + sizeof(struct aac_srb); + fib->Header.XferState = + AAC_FIBSTATE_HOSTOWNED | + AAC_FIBSTATE_INITIALISED | + AAC_FIBSTATE_EMPTY | + AAC_FIBSTATE_FROMHOST | + AAC_FIBSTATE_REXPECTED | + AAC_FIBSTATE_NORM | + AAC_FIBSTATE_ASYNC | + AAC_FIBSTATE_FAST_RESPONSE; + fib->Header.Command = (sc->flags & AAC_FLAGS_SG_64BIT) != 0 ? + ScsiPortCommandU64 : ScsiPortCommand; + + mtx_lock(&sc->aac_io_lock); + aac_wait_command(cm); + mtx_unlock(&sc->aac_io_lock); + + if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN) != 0) { + error = copyout(cm->cm_data, srb_sg_address, cm->cm_datalen); + if (error != 0) + goto out; + } + error = copyout(fib->data, ureply, sizeof(struct aac_srb_response)); +out: + if (cm != NULL) { + if (cm->cm_data != NULL) + free(cm->cm_data, M_AACBUF); + mtx_lock(&sc->aac_io_lock); + aac_release_command(cm); + mtx_unlock(&sc->aac_io_lock); + } + return(error); } /* From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 12:06:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6675A106566B; Tue, 30 Mar 2010 12:06:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B7B8FC16; Tue, 30 Mar 2010 12:06:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UC6JRT073605; Tue, 30 Mar 2010 12:06:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UC6JTM073603; Tue, 30 Mar 2010 12:06:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201003301206.o2UC6JTM073603@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Mar 2010 12:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205878 - stable/8/sys/dev/aac X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 12:06:19 -0000 Author: attilio Date: Tue Mar 30 12:06:18 2010 New Revision: 205878 URL: http://svn.freebsd.org/changeset/base/205878 Log: MFC r205167: Make the code more readable and compiling on 64-bits arch different than amd64. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/aac/aac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Tue Mar 30 12:01:35 2010 (r205877) +++ stable/8/sys/dev/aac/aac.c Tue Mar 30 12:06:18 2010 (r205878) @@ -3123,11 +3123,7 @@ aac_ioctl_send_raw_srb(struct aac_softc sge = srbcmd->sg_map.SgEntry; sge64 = NULL; srb_sg_bytecount = sge->SgByteCount; -#ifdef __amd64__ - srb_sg_address = (void *)(uint64_t)sge->SgAddress; -#else - srb_sg_address = (void *)sge->SgAddress; -#endif + srb_sg_address = (void *)(uintptr_t)sge->SgAddress; } #ifdef __amd64__ else if (fibsize == (sizeof(struct aac_srb) + From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 18:58:08 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF40A106564A; Tue, 30 Mar 2010 18:58:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2B348FC18; Tue, 30 Mar 2010 18:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UIw8Kp064537; Tue, 30 Mar 2010 18:58:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UIw7Hs064524; Tue, 30 Mar 2010 18:58:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301858.o2UIw7Hs064524@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 18:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205887 - stable/8/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 18:58:08 -0000 Author: marius Date: Tue Mar 30 18:58:07 2010 New Revision: 205887 URL: http://svn.freebsd.org/changeset/base/205887 Log: MFC: r205393 - Remove a bogus forward declaration. - Fix whitespace. Modified: stable/8/lib/libc/sparc64/fpu/fpu_extern.h stable/8/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sparc64/fpu/fpu_extern.h ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_extern.h Tue Mar 30 18:31:55 2010 (r205886) +++ stable/8/lib/libc/sparc64/fpu/fpu_extern.h Tue Mar 30 18:58:07 2010 (r205887) @@ -41,7 +41,6 @@ #define _SPARC64_FPU_FPU_EXTERN_H_ struct utrapframe; -union instr; struct fpemu; struct fpn; @@ -61,9 +60,9 @@ struct fpn *__fpu_div(struct fpemu *); int __fpu_itof(struct fpn *, u_int); int __fpu_xtof(struct fpn *, u_int64_t); int __fpu_stof(struct fpn *, u_int); -int __fpu_dtof(struct fpn *, u_int, u_int ); -int __fpu_qtof(struct fpn *, u_int, u_int , u_int , u_int ); -void __fpu_explode(struct fpemu *, struct fpn *, int, int ); +int __fpu_dtof(struct fpn *, u_int, u_int); +int __fpu_qtof(struct fpn *, u_int, u_int, u_int, u_int); +void __fpu_explode(struct fpemu *, struct fpn *, int, int); /* fpu_implode.c */ u_int __fpu_ftoi(struct fpemu *, struct fpn *); Modified: stable/8/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 18:31:55 2010 (r205886) +++ stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 18:58:07 2010 (r205887) @@ -198,7 +198,6 @@ __fpu_ftoi(fe, fp) sign = fp->fp_sign; switch (fp->fp_class) { - case FPC_ZERO: return (0); @@ -248,7 +247,6 @@ __fpu_ftox(fe, fp, res) sign = fp->fp_sign; switch (fp->fp_class) { - case FPC_ZERO: res[1] = 0; return (0); @@ -504,7 +502,6 @@ __fpu_implode(fe, fp, type, space) { switch (type) { - case FTYPE_LNG: space[0] = __fpu_ftox(fe, fp, space); break; From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:03:26 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF626106564A; Tue, 30 Mar 2010 19:03:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5B68FC13; Tue, 30 Mar 2010 19:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ3Q5A065864; Tue, 30 Mar 2010 19:03:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ3QIS065863; Tue, 30 Mar 2010 19:03:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301903.o2UJ3QIS065863@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205890 - stable/8/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:03:26 -0000 Author: marius Date: Tue Mar 30 19:03:26 2010 New Revision: 205890 URL: http://svn.freebsd.org/changeset/base/205890 Log: MFC: r205394 Ensure that __fpu_ftox() both returns the high bits and res[1] contains the low bits also in the default case. PR: 144900 Obtained from: OpenBSD Modified: stable/8/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 18:58:10 2010 (r205889) +++ stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:03:26 2010 (r205890) @@ -248,8 +248,8 @@ __fpu_ftox(fe, fp, res) sign = fp->fp_sign; switch (fp->fp_class) { case FPC_ZERO: - res[1] = 0; - return (0); + i = 0; + goto done; case FPC_NUM: /* @@ -273,15 +273,17 @@ __fpu_ftox(fe, fp, res) break; if (sign) i = -i; - res[1] = (int)i; - return (i >> 32); + goto done; default: /* Inf, qNaN, sNaN */ break; } /* overflow: replace any inexact exception with invalid */ fe->fe_cx = (fe->fe_cx & ~FSR_NX) | FSR_NV; - return (0x7fffffffffffffffLL + sign); + i = 0x7fffffffffffffffLL + sign; +done: + res[1] = i & 0xffffffff; + return (i >> 32); } /* From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:05:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F637106564A; Tue, 30 Mar 2010 19:05:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7F738FC18; Tue, 30 Mar 2010 19:05:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ588d066373; Tue, 30 Mar 2010 19:05:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ58J0066369; Tue, 30 Mar 2010 19:05:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301905.o2UJ58J0066369@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205893 - stable/8/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:05:09 -0000 Author: marius Date: Tue Mar 30 19:05:08 2010 New Revision: 205893 URL: http://svn.freebsd.org/changeset/base/205893 Log: MFC: r205395 FPU_DEBUG requires . PR: 144900 Submitted by: Peter Jeremy Modified: stable/8/lib/libc/sparc64/fpu/fpu.c stable/8/lib/libc/sparc64/fpu/fpu_explode.c stable/8/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sparc64/fpu/fpu.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu.c Tue Mar 30 19:03:29 2010 (r205892) +++ stable/8/lib/libc/sparc64/fpu/fpu.c Tue Mar 30 19:05:08 2010 (r205893) @@ -69,9 +69,12 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include -#include #include +#ifdef FPU_DEBUG +#include +#endif #include +#include #include "un-namespace.h" #include "libc_private.h" Modified: stable/8/lib/libc/sparc64/fpu/fpu_explode.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:03:29 2010 (r205892) +++ stable/8/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:05:08 2010 (r205893) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FPU_DEBUG +#include +#endif + #include #include #include Modified: stable/8/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:03:29 2010 (r205892) +++ stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:05:08 2010 (r205893) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FPU_DEBUG +#include +#endif + #include #include #include From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:06:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9108E106566C; Tue, 30 Mar 2010 19:06:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 801888FC25; Tue, 30 Mar 2010 19:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ6VGt066836; Tue, 30 Mar 2010 19:06:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ6VZf066834; Tue, 30 Mar 2010 19:06:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301906.o2UJ6VZf066834@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205896 - stable/8/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:06:31 -0000 Author: marius Date: Tue Mar 30 19:06:31 2010 New Revision: 205896 URL: http://svn.freebsd.org/changeset/base/205896 Log: MFC: r205396 Division should take both arguments' signs into account when the the dividend is infinity or zero and the divisor is not the same. PR: 144900 Submitted by: Peter Jeremy Modified: stable/8/lib/libc/sparc64/fpu/fpu_div.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sparc64/fpu/fpu_div.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_div.c Tue Mar 30 19:05:20 2010 (r205895) +++ stable/8/lib/libc/sparc64/fpu/fpu_div.c Tue Mar 30 19:06:31 2010 (r205896) @@ -167,14 +167,16 @@ __fpu_div(fe) * return it. Otherwise we have the following cases: * * Inf / Inf = NaN, plus NV exception - * Inf / num = Inf [i.e., return x] - * Inf / 0 = Inf [i.e., return x] - * 0 / Inf = 0 [i.e., return x] - * 0 / num = 0 [i.e., return x] + * Inf / num = Inf [i.e., return x #] + * Inf / 0 = Inf [i.e., return x #] + * 0 / Inf = 0 [i.e., return x #] + * 0 / num = 0 [i.e., return x #] * 0 / 0 = NaN, plus NV exception - * num / Inf = 0 + * num / Inf = 0 # * num / num = num (do the divide) - * num / 0 = Inf, plus DZ exception + * num / 0 = Inf #, plus DZ exception + * + * # Sign of result is XOR of operand signs. */ if (ISNAN(x) || ISNAN(y)) { ORDER(x, y); @@ -183,10 +185,10 @@ __fpu_div(fe) if (ISINF(x) || ISZERO(x)) { if (x->fp_class == y->fp_class) return (__fpu_newnan(fe)); + x->fp_sign ^= y->fp_sign; return (x); } - /* all results at this point use XOR of operand signs */ x->fp_sign ^= y->fp_sign; if (ISINF(y)) { x->fp_class = FPC_ZERO; From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:08:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 477841065674; Tue, 30 Mar 2010 19:08:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26C8C8FC16; Tue, 30 Mar 2010 19:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJ83Xf067466; Tue, 30 Mar 2010 19:08:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJ83qF067464; Tue, 30 Mar 2010 19:08:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301908.o2UJ83qF067464@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205902 - stable/8/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:08:03 -0000 Author: marius Date: Tue Mar 30 19:08:02 2010 New Revision: 205902 URL: http://svn.freebsd.org/changeset/base/205902 Log: MFC: r205397 - While SPARC V9 allows tininess to be detected either before or after rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and UltraSPARC processors defines that in all cases tinyness is detected before rounding, therefore rounding up to the smallest normalised number should set the underflow flag. - If an infinite result is rounded down, the result should have an exponent 1 less than the value for infinity. PR: 144900 Submitted by: Peter Jeremy Modified: stable/8/lib/libc/sparc64/fpu/fpu_implode.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sparc64/fpu/fpu_implode.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:08:01 2010 (r205901) +++ stable/8/lib/libc/sparc64/fpu/fpu_implode.c Tue Mar 30 19:08:02 2010 (r205902) @@ -329,8 +329,9 @@ __fpu_ftos(fe, fp) * right to introduce leading zeroes. Rounding then acts * differently for normals and subnormals: the largest subnormal * may round to the smallest normal (1.0 x 2^minexp), or may - * remain subnormal. In the latter case, signal an underflow - * if the result was inexact or if underflow traps are enabled. + * remain subnormal. A number that is subnormal before rounding + * will signal an underflow if the result is inexact or if underflow + * traps are enabled. * * Rounding a normal, on the other hand, always produces another * normal (although either way the result might be too big for @@ -345,8 +346,10 @@ __fpu_ftos(fe, fp) if ((exp = fp->fp_exp + SNG_EXP_BIAS) <= 0) { /* subnormal */ /* -NG for g,r; -SNG_FRACBITS-exp for fraction */ (void) __fpu_shr(fp, FP_NMANT - FP_NG - SNG_FRACBITS - exp); - if (fpround(fe, fp) && fp->fp_mant[3] == SNG_EXP(1)) + if (fpround(fe, fp) && fp->fp_mant[3] == SNG_EXP(1)) { + fe->fe_cx |= FSR_UF; return (sign | SNG_EXP(1) | 0); + } if ((fe->fe_cx & FSR_NX) || (fe->fe_fsr & (FSR_UF << FSR_TEM_SHIFT))) fe->fe_cx |= FSR_UF; @@ -407,6 +410,7 @@ zero: res[1] = 0; if ((exp = fp->fp_exp + DBL_EXP_BIAS) <= 0) { (void) __fpu_shr(fp, FP_NMANT - FP_NG - DBL_FRACBITS - exp); if (fpround(fe, fp) && fp->fp_mant[2] == DBL_EXP(1)) { + fe->fe_cx |= FSR_UF; res[1] = 0; return (sign | DBL_EXP(1) | 0); } @@ -426,7 +430,7 @@ zero: res[1] = 0; return (sign | DBL_EXP(DBL_EXP_INFNAN) | 0); } res[1] = ~0; - return (sign | DBL_EXP(DBL_EXP_INFNAN) | DBL_MASK); + return (sign | DBL_EXP(DBL_EXP_INFNAN - 1) | DBL_MASK); } done: res[1] = fp->fp_mant[3]; @@ -468,6 +472,7 @@ zero: res[1] = res[2] = res[3] = 0; if ((exp = fp->fp_exp + EXT_EXP_BIAS) <= 0) { (void) __fpu_shr(fp, FP_NMANT - FP_NG - EXT_FRACBITS - exp); if (fpround(fe, fp) && fp->fp_mant[0] == EXT_EXP(1)) { + fe->fe_cx |= FSR_UF; res[1] = res[2] = res[3] = 0; return (sign | EXT_EXP(1) | 0); } @@ -487,7 +492,7 @@ zero: res[1] = res[2] = res[3] = 0; return (sign | EXT_EXP(EXT_EXP_INFNAN) | 0); } res[1] = res[2] = res[3] = ~0; - return (sign | EXT_EXP(EXT_EXP_INFNAN) | EXT_MASK); + return (sign | EXT_EXP(EXT_EXP_INFNAN - 1) | EXT_MASK); } done: res[1] = fp->fp_mant[1]; From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:13:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E034106564A; Tue, 30 Mar 2010 19:13:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D72118FC13; Tue, 30 Mar 2010 19:13:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJDbEd068862; Tue, 30 Mar 2010 19:13:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJDbI5068860; Tue, 30 Mar 2010 19:13:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301913.o2UJDbI5068860@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205905 - stable/8/lib/libc/sparc64/fpu X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:13:38 -0000 Author: marius Date: Tue Mar 30 19:13:37 2010 New Revision: 205905 URL: http://svn.freebsd.org/changeset/base/205905 Log: MFC: r205410 Avoid aliasing which leads to incorrect results when compiling with the default strict aliasing rules. PR: 144900 Submitted by: Peter Jeremy Modified: stable/8/lib/libc/sparc64/fpu/fpu_explode.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sparc64/fpu/fpu_explode.c ============================================================================== --- stable/8/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:09:18 2010 (r205904) +++ stable/8/lib/libc/sparc64/fpu/fpu_explode.c Tue Mar 30 19:13:37 2010 (r205905) @@ -139,9 +139,9 @@ __fpu_xtof(fp, i) * a signed or unsigned entity. */ if (fp->fp_sign && (int64_t)i < 0) - *((int64_t*)fp->fp_mant) = -i; + *((int64_t *)fp->fp_mant) = -i; else - *((int64_t*)fp->fp_mant) = i; + *((int64_t *)fp->fp_mant) = i; fp->fp_mant[2] = 0; fp->fp_mant[3] = 0; __fpu_norm(fp); @@ -262,14 +262,12 @@ __fpu_explode(fe, fp, type, reg) struct fpn *fp; int type, reg; { - u_int32_t s, *sp; - u_int64_t l[2]; - void *vl = l; + u_int64_t l0, l1; + u_int32_t s; if (type == FTYPE_LNG || type == FTYPE_DBL || type == FTYPE_EXT) { - l[0] = __fpu_getreg64(reg & ~1); - sp = vl; - fp->fp_sign = sp[0] >> 31; + l0 = __fpu_getreg64(reg & ~1); + fp->fp_sign = l0 >> 63; } else { s = __fpu_getreg(reg); fp->fp_sign = s >> 31; @@ -277,7 +275,7 @@ __fpu_explode(fe, fp, type, reg) fp->fp_sticky = 0; switch (type) { case FTYPE_LNG: - s = __fpu_xtof(fp, l[0]); + s = __fpu_xtof(fp, l0); break; case FTYPE_INT: @@ -289,12 +287,13 @@ __fpu_explode(fe, fp, type, reg) break; case FTYPE_DBL: - s = __fpu_dtof(fp, sp[0], sp[1]); + s = __fpu_dtof(fp, l0 >> 32, l0 & 0xffffffff); break; case FTYPE_EXT: - l[1] = __fpu_getreg64((reg & ~1) + 2); - s = __fpu_qtof(fp, sp[0], sp[1], sp[2], sp[3]); + l1 = __fpu_getreg64((reg & ~1) + 2); + s = __fpu_qtof(fp, l0 >> 32, l0 & 0xffffffff, l1 >> 32, + l1 & 0xffffffff); break; default: From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:33:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B06F1065689; Tue, 30 Mar 2010 19:33:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C848FC27; Tue, 30 Mar 2010 19:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJX9FP073356; Tue, 30 Mar 2010 19:33:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJX96l073353; Tue, 30 Mar 2010 19:33:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301933.o2UJX96l073353@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205910 - stable/8/sys/sun4v/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:33:10 -0000 Author: marius Date: Tue Mar 30 19:33:09 2010 New Revision: 205910 URL: http://svn.freebsd.org/changeset/base/205910 Log: MFC: r203334 Sync with the other archs and declare the memory location referenced by the address argument of the bus_space_write_multi_*() familiy as const. Modified: stable/8/sys/sun4v/include/bus.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sun4v/include/bus.h ============================================================================== --- stable/8/sys/sun4v/include/bus.h Tue Mar 30 19:33:09 2010 (r205909) +++ stable/8/sys/sun4v/include/bus.h Tue Mar 30 19:33:09 2010 (r205910) @@ -316,7 +316,7 @@ bus_space_write_8(bus_space_tag_t t, bus static __inline void bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint8_t *a, size_t c) + const uint8_t *a, size_t c) { while (c-- > 0) @@ -325,7 +325,7 @@ bus_space_write_multi_1(bus_space_tag_t static __inline void bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint16_t *a, size_t c) + const uint16_t *a, size_t c) { while (c-- > 0) @@ -334,7 +334,7 @@ bus_space_write_multi_2(bus_space_tag_t static __inline void bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint32_t *a, size_t c) + const uint32_t *a, size_t c) { while (c-- > 0) @@ -343,7 +343,7 @@ bus_space_write_multi_4(bus_space_tag_t static __inline void bus_space_write_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint64_t *a, size_t c) + const uint64_t *a, size_t c) { while (c-- > 0) From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:36:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 524491065670; Tue, 30 Mar 2010 19:36:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F0D8FC1C; Tue, 30 Mar 2010 19:36:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJa18H074048; Tue, 30 Mar 2010 19:36:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJa1ER074045; Tue, 30 Mar 2010 19:36:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301936.o2UJa1ER074045@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205911 - in stable/8/sys/sun4v: include sun4v X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:36:01 -0000 Author: marius Date: Tue Mar 30 19:36:00 2010 New Revision: 205911 URL: http://svn.freebsd.org/changeset/base/205911 Log: MFC: r203335 - Const'ify the bus_stream_asi and bus_type_asi arrays. - Replace hard-coded functions names missed in bus_machdep.c with __func__. - Break some long lines. Modified: stable/8/sys/sun4v/include/bus.h stable/8/sys/sun4v/sun4v/bus_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sun4v/include/bus.h ============================================================================== --- stable/8/sys/sun4v/include/bus.h Tue Mar 30 19:33:09 2010 (r205910) +++ stable/8/sys/sun4v/include/bus.h Tue Mar 30 19:36:00 2010 (r205911) @@ -96,8 +96,8 @@ #define PCI_MEMORY_BUS_SPACE 4 #define LAST_BUS_SPACE 5 -extern int bus_type_asi[]; -extern int bus_stream_asi[]; +extern const int bus_type_asi[]; +extern const int bus_stream_asi[]; #define __BUS_SPACE_HAS_STREAM_METHODS 1 Modified: stable/8/sys/sun4v/sun4v/bus_machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/bus_machdep.c Tue Mar 30 19:33:09 2010 (r205910) +++ stable/8/sys/sun4v/sun4v/bus_machdep.c Tue Mar 30 19:36:00 2010 (r205911) @@ -95,7 +95,7 @@ * from: @(#)machdep.c 8.6 (Berkeley) 1/14/94 * from: NetBSD: machdep.c,v 1.111 2001/09/15 07:13:40 eeh Exp * and - * from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15 + * from: FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.24 2001/08/15 */ #include @@ -129,8 +129,8 @@ __FBSDID("$FreeBSD$"); static void nexus_bus_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t, bus_size_t, int); -/* ASI's for bus access. */ -int bus_type_asi[] = { +/* ASIs for bus access */ +const int bus_type_asi[] = { ASI_REAL_IO, /* nexus */ ASI_REAL_IO, /* SBus */ ASI_REAL_IO_L, /* PCI configuration space */ @@ -139,7 +139,7 @@ int bus_type_asi[] = { 0 }; -int bus_stream_asi[] = { +const int bus_stream_asi[] = { ASI_REAL_IO, /* nexus */ ASI_REAL_IO, /* SBus */ ASI_REAL_IO, /* PCI configuration space */ @@ -249,7 +249,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->dt_segments = NULL; - /* Take into account any restrictions imposed by our parent tag */ + /* Take into account any restrictions imposed by our parent tag. */ if (parent != NULL) { newtag->dt_lowaddr = ulmin(parent->dt_lowaddr, newtag->dt_lowaddr); @@ -551,8 +551,7 @@ nexus_dmamap_load_uio(bus_dma_tag_t dmat if (uio->uio_segflg == UIO_USERSPACE) { td = uio->uio_td; - KASSERT(td != NULL, - ("nexus_dmamap_load_uio: USERSPACE but no proc")); + KASSERT(td != NULL, ("%s: USERSPACE but no proc", __func__)); } nsegs = 0; @@ -652,9 +651,9 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v *vaddr = malloc(dmat->dt_maxsize, M_DEVBUF, mflags); } else { /* - * XXX: Use contigmalloc until it is merged into this facility - * and handles multi-seg allocations. Nobody is doing multi-seg - * allocations yet though. + * XXX use contigmalloc until it is merged into this + * facility and handles multi-seg allocations. Nobody + * is doing multi-seg allocations yet though. */ *vaddr = contigmalloc(dmat->dt_maxsize, M_DEVBUF, mflags, 0ul, dmat->dt_lowaddr, @@ -795,8 +794,8 @@ sparc64_bus_mem_unmap(void *bh, bus_size } /* - * Fake up a bus tag, for use by console drivers in early boot when the regular - * means to allocate resources are not yet available. + * Fake up a bus tag, for use by console drivers in early boot when the + * regular means to allocate resources are not yet available. * Addr is the physical address of the desired start of the handle. */ bus_space_handle_t From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:37:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D514106567C; Tue, 30 Mar 2010 19:37:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0848FC1C; Tue, 30 Mar 2010 19:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJblnB074540; Tue, 30 Mar 2010 19:37:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJblmt074538; Tue, 30 Mar 2010 19:37:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301937.o2UJblmt074538@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205913 - stable/8/sys/sun4v/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:37:47 -0000 Author: marius Date: Tue Mar 30 19:37:47 2010 New Revision: 205913 URL: http://svn.freebsd.org/changeset/base/205913 Log: MFC: r203341 - Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro; for UPA it should have fulfilled its purpose by now and Fireplane- and JBus-based machines are way to messy in organization to implement something equivalent. - Fix a bunch of style(9) bugs. Modified: stable/8/sys/sun4v/include/bus.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sun4v/include/bus.h ============================================================================== --- stable/8/sys/sun4v/include/bus.h Tue Mar 30 19:36:03 2010 (r205912) +++ stable/8/sys/sun4v/include/bus.h Tue Mar 30 19:37:47 2010 (r205913) @@ -81,7 +81,6 @@ #include #include -#include /* * Nexus and SBus spaces are non-cached and big endian @@ -99,27 +98,24 @@ extern const int bus_type_asi[]; extern const int bus_stream_asi[]; -#define __BUS_SPACE_HAS_STREAM_METHODS 1 +#define __BUS_SPACE_HAS_STREAM_METHODS 1 -#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF -#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF -#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF -#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXADDR 0xFFFFFFFF +#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF +#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFF +#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF +#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF +#define BUS_SPACE_MAXADDR 0xFFFFFFFF -#define BUS_SPACE_UNRESTRICTED (~0) +#define BUS_SPACE_UNRESTRICTED (~0) -/* - * Access methods for bus resources and address space. - */ struct bus_space_tag { void *bst_cookie; bus_space_tag_t bst_parent; int bst_type; void (*bst_bus_barrier)(bus_space_tag_t, bus_space_handle_t, - bus_size_t, bus_size_t, int); + bus_size_t, bus_size_t, int); }; /* @@ -135,13 +131,11 @@ static int bus_space_subregion(bus_space */ static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, - bus_space_handle_t *bshp); + bus_size_t size, int flags, bus_space_handle_t *bshp); static __inline int bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t *bshp) + bus_size_t size __unused, int flags __unused, bus_space_handle_t *bshp) { *bshp = addr; @@ -152,24 +146,26 @@ bus_space_map(bus_space_tag_t t __unused * Unmap a region of device bus space. */ static __inline void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, - bus_size_t size); + bus_size_t size); static __inline void bus_space_unmap(bus_space_tag_t t __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) + bus_size_t size __unused) { + } /* This macro finds the first "upstream" implementation of method `f' */ -#define _BS_CALL(t,f) \ +#define _BS_CALL(t,f) \ while (t->f == NULL) \ - t = t->bst_parent; \ + t = t->bst_parent; \ return (*(t)->f) static __inline void bus_space_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_size_t s, int f) { + _BS_CALL(t, bst_bus_barrier)(t, h, o, s, f); } @@ -177,20 +173,21 @@ static __inline int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_size_t s, bus_space_handle_t *hp) { + *hp = h + o; return (0); } /* flags for bus space map functions */ -#define BUS_SPACE_MAP_CACHEABLE 0x0001 -#define BUS_SPACE_MAP_LINEAR 0x0002 -#define BUS_SPACE_MAP_READONLY 0x0004 -#define BUS_SPACE_MAP_PREFETCHABLE 0x0008 +#define BUS_SPACE_MAP_CACHEABLE 0x0001 +#define BUS_SPACE_MAP_LINEAR 0x0002 +#define BUS_SPACE_MAP_READONLY 0x0004 +#define BUS_SPACE_MAP_PREFETCHABLE 0x0008 /* placeholders for bus functions... */ -#define BUS_SPACE_MAP_BUS1 0x0100 -#define BUS_SPACE_MAP_BUS2 0x0200 -#define BUS_SPACE_MAP_BUS3 0x0400 -#define BUS_SPACE_MAP_BUS4 0x0800 +#define BUS_SPACE_MAP_BUS1 0x0100 +#define BUS_SPACE_MAP_BUS2 0x0200 +#define BUS_SPACE_MAP_BUS3 0x0400 +#define BUS_SPACE_MAP_BUS4 0x0800 /* flags for bus_space_barrier() */ #define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ @@ -198,13 +195,9 @@ bus_space_subregion(bus_space_tag_t t, b #ifdef BUS_SPACE_DEBUG #define KTR_BUS KTR_CT2 -#define BUS_HANDLE_MIN UPA_MEMSTART #define __BUS_DEBUG_ACCESS(h, o, desc, sz) do { \ CTR4(KTR_BUS, "bus space: %s %d: handle %#lx, offset %#lx", \ (desc), (sz), (h), (o)); \ - if ((h) + (o) < BUS_HANDLE_MIN) \ - panic("bus space access at %#lx out of range", \ - (h) + (o)); \ } while (0) #else #define __BUS_DEBUG_ACCESS(h, o, desc, sz) @@ -388,97 +381,109 @@ bus_space_set_multi_8(bus_space_tag_t t, static __inline void bus_space_read_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int8_t *a, bus_size_t c) + uint8_t *a, bus_size_t c) { + for (; c; a++, c--, o++) *a = bus_space_read_1(t, h, o); } static __inline void bus_space_read_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int16_t *a, bus_size_t c) + uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + + for (; c; a++, c--, o += 2) *a = bus_space_read_2(t, h, o); } static __inline void bus_space_read_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int32_t *a, bus_size_t c) + uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + + for (; c; a++, c--, o += 4) *a = bus_space_read_4(t, h, o); } static __inline void bus_space_read_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - u_int64_t *a, bus_size_t c) + uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + + for (; c; a++, c--, o += 8) *a = bus_space_read_8(t, h, o); } static __inline void bus_space_write_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int8_t *a, bus_size_t c) + const uint8_t *a, bus_size_t c) { + for (; c; a++, c--, o++) bus_space_write_1(t, h, o, *a); } static __inline void bus_space_write_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int16_t *a, bus_size_t c) + const uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + + for (; c; a++, c--, o += 2) bus_space_write_2(t, h, o, *a); } static __inline void bus_space_write_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int32_t *a, bus_size_t c) + const uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + + for (; c; a++, c--, o += 4) bus_space_write_4(t, h, o, *a); } static __inline void bus_space_write_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int64_t *a, bus_size_t c) + const uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + + for (; c; a++, c--, o += 8) bus_space_write_8(t, h, o, *a); } static __inline void bus_space_set_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int8_t v, bus_size_t c) + const uint8_t v, bus_size_t c) { + for (; c; c--, o++) bus_space_write_1(t, h, o, v); } static __inline void bus_space_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int16_t v, bus_size_t c) + const uint16_t v, bus_size_t c) { - for (; c; c--, o+=2) + + for (; c; c--, o += 2) bus_space_write_2(t, h, o, v); } static __inline void bus_space_set_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int32_t v, bus_size_t c) + const uint32_t v, bus_size_t c) { - for (; c; c--, o+=4) + + for (; c; c--, o += 4) bus_space_write_4(t, h, o, v); } static __inline void bus_space_set_region_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - const u_int64_t v, bus_size_t c) + const uint64_t v, bus_size_t c) { - for (; c; c--, o+=8) + + for (; c; c--, o += 8) bus_space_write_8(t, h, o, v); } @@ -486,6 +491,7 @@ static __inline void bus_space_copy_region_1(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { + for (; c; c--, o1++, o2++) bus_space_write_1(t, h1, o1, bus_space_read_1(t, h2, o2)); } @@ -494,7 +500,8 @@ static __inline void bus_space_copy_region_2(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=2, o2+=2) + + for (; c; c--, o1 += 2, o2 += 2) bus_space_write_2(t, h1, o1, bus_space_read_2(t, h2, o2)); } @@ -502,7 +509,8 @@ static __inline void bus_space_copy_region_4(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=4, o2+=4) + + for (; c; c--, o1 += 4, o2 += 4) bus_space_write_4(t, h1, o1, bus_space_read_4(t, h2, o2)); } @@ -510,7 +518,8 @@ static __inline void bus_space_copy_region_8(bus_space_tag_t t, bus_space_handle_t h1, bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=8, o2+=8) + + for (; c; c--, o1 += 8, o2 += 8) bus_space_write_8(t, h1, o1, bus_space_read_8(t, h2, o2)); } @@ -692,7 +701,7 @@ bus_space_set_multi_stream_8(bus_space_t static __inline void bus_space_read_region_stream_1(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int8_t *a, bus_size_t c) + bus_size_t o, uint8_t *a, bus_size_t c) { for (; c; a++, c--, o++) @@ -701,34 +710,34 @@ bus_space_read_region_stream_1(bus_space static __inline void bus_space_read_region_stream_2(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int16_t *a, bus_size_t c) + bus_size_t o, uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + for (; c; a++, c--, o += 2) *a = bus_space_read_stream_2(t, h, o); } static __inline void bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int32_t *a, bus_size_t c) + bus_size_t o, uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + for (; c; a++, c--, o += 4) *a = bus_space_read_stream_4(t, h, o); } static __inline void bus_space_read_region_stream_8(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, u_int64_t *a, bus_size_t c) + bus_size_t o, uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + for (; c; a++, c--, o += 8) *a = bus_space_read_stream_8(t, h, o); } static __inline void bus_space_write_region_stream_1(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int8_t *a, bus_size_t c) + bus_size_t o, const uint8_t *a, bus_size_t c) { for (; c; a++, c--, o++) @@ -737,34 +746,34 @@ bus_space_write_region_stream_1(bus_spac static __inline void bus_space_write_region_stream_2(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int16_t *a, bus_size_t c) + bus_size_t o, const uint16_t *a, bus_size_t c) { - for (; c; a++, c--, o+=2) + for (; c; a++, c--, o += 2) bus_space_write_stream_2(t, h, o, *a); } static __inline void bus_space_write_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int32_t *a, bus_size_t c) + bus_size_t o, const uint32_t *a, bus_size_t c) { - for (; c; a++, c--, o+=4) + for (; c; a++, c--, o += 4) bus_space_write_stream_4(t, h, o, *a); } static __inline void bus_space_write_region_stream_8(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int64_t *a, bus_size_t c) + bus_size_t o, const uint64_t *a, bus_size_t c) { - for (; c; a++, c--, o+=8) + for (; c; a++, c--, o += 8) bus_space_write_stream_8(t, h, o, *a); } static __inline void bus_space_set_region_stream_1(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int8_t v, bus_size_t c) + bus_size_t o, const uint8_t v, bus_size_t c) { for (; c; c--, o++) @@ -773,28 +782,28 @@ bus_space_set_region_stream_1(bus_space_ static __inline void bus_space_set_region_stream_2(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int16_t v, bus_size_t c) + bus_size_t o, const uint16_t v, bus_size_t c) { - for (; c; c--, o+=2) + for (; c; c--, o += 2) bus_space_write_stream_2(t, h, o, v); } static __inline void bus_space_set_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int32_t v, bus_size_t c) + bus_size_t o, const uint32_t v, bus_size_t c) { - for (; c; c--, o+=4) + for (; c; c--, o += 4) bus_space_write_stream_4(t, h, o, v); } static __inline void bus_space_set_region_stream_8(bus_space_tag_t t, bus_space_handle_t h, - bus_size_t o, const u_int64_t v, bus_size_t c) + bus_size_t o, const uint64_t v, bus_size_t c) { - for (; c; c--, o+=8) + for (; c; c--, o += 8) bus_space_write_stream_8(t, h, o, v); } @@ -813,7 +822,7 @@ bus_space_copy_region_stream_2(bus_space bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=2, o2+=2) + for (; c; c--, o1 += 2, o2 += 2) bus_space_write_stream_2(t, h1, o1, bus_space_read_stream_2(t, h2, o2)); } @@ -823,7 +832,7 @@ bus_space_copy_region_stream_4(bus_space bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=4, o2+=4) + for (; c; c--, o1 += 4, o2 += 4) bus_space_write_stream_4(t, h1, o1, bus_space_read_stream_4(t, h2, o2)); } @@ -833,7 +842,7 @@ bus_space_copy_region_stream_8(bus_space bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c) { - for (; c; c--, o1+=8, o2+=8) + for (; c; c--, o1 += 8, o2 += 8) bus_space_write_stream_8(t, h1, o1, bus_space_read_8(t, h2, o2)); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 19:52:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 480C91065670; Tue, 30 Mar 2010 19:52:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35CFD8FC0A; Tue, 30 Mar 2010 19:52:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UJqkhG078088; Tue, 30 Mar 2010 19:52:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UJqkWL078084; Tue, 30 Mar 2010 19:52:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003301952.o2UJqkWL078084@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 19:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205918 - in stable/8/sys: nfs nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 19:52:46 -0000 Author: marius Date: Tue Mar 30 19:52:45 2010 New Revision: 205918 URL: http://svn.freebsd.org/changeset/base/205918 Log: MFC: r203731 Some style(9) fixes Modified: stable/8/sys/nfs/nfs_common.c stable/8/sys/nfs/nfs_common.h stable/8/sys/nfsclient/nfs_krpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfs/nfs_common.c ============================================================================== --- stable/8/sys/nfs/nfs_common.c Tue Mar 30 19:52:45 2010 (r205917) +++ stable/8/sys/nfs/nfs_common.c Tue Mar 30 19:52:45 2010 (r205918) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); /* * These functions support the macros and help fiddle mbuf chains for - * the nfs op functions. They do things like create the rpc header and + * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ @@ -77,7 +77,8 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON }; -static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); +static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, + int how); SYSCTL_NODE(_vfs, OID_AUTO, nfs_common, CTLFLAG_RD, 0, "NFS common support"); @@ -90,7 +91,7 @@ SYSCTL_INT(_vfs_nfs_common, OID_AUTO, re &nfs_realign_count, 0, "Number of mbuf realignments done"); u_quad_t -nfs_curusec(void) +nfs_curusec(void) { struct timeval tv; @@ -188,7 +189,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d while (left == 0) { *mdp = mp = mp->m_next; if (mp == NULL) - return NULL; + return (NULL); left = mp->m_len; *dposp = mtod(mp, caddr_t); } @@ -196,13 +197,13 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d ret = *dposp; *dposp += siz; } else if (mp->m_next == NULL) { - return NULL; + return (NULL); } else if (siz > MHLEN) { panic("nfs S too big"); } else { MGET(mp2, how, MT_DATA); if (mp2 == NULL) - return NULL; + return (NULL); mp2->m_len = siz; mp2->m_next = mp->m_next; mp->m_next = mp2; @@ -218,7 +219,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d /* Loop around copying up the siz2 bytes */ while (siz2 > 0) { if (mp2 == NULL) - return NULL; + return (NULL); xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2; if (xfer > 0) { bcopy(mtod(mp2, caddr_t), ptr, xfer); @@ -241,7 +242,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *d *dposp = npos; } } - return ret; + return (ret); } /* @@ -285,19 +286,21 @@ nfsm_build_xx(int s, struct mbuf **mb, c ret = *bpos; (*mb)->m_len += s; *bpos += s; - return ret; + return (ret); } void * nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_WAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_WAIT)); } void * nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos) { - return nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT); + + return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT)); } static void * @@ -311,10 +314,10 @@ nfsm_dissect_xx_sub(int s, struct mbuf * if (t1 >= s) { ret = *dpos; *dpos += s; - return ret; + return (ret); } - cp2 = nfsm_disct(md, dpos, s, t1, how); - return cp2; + cp2 = nfsm_disct(md, dpos, s, t1, how); + return (cp2); } int @@ -324,11 +327,11 @@ nfsm_strsiz_xx(int *s, int m, struct mbu tl = nfsm_dissect_xx(NFSX_UNSIGNED, mb, bpos); if (tl == NULL) - return EBADRPC; + return (EBADRPC); *s = fxdr_unsigned(int32_t, *tl); if (*s > m) - return EBADRPC; - return 0; + return (EBADRPC); + return (0); } int @@ -339,12 +342,12 @@ nfsm_adv_xx(int s, struct mbuf **md, cad t1 = mtod(*md, caddr_t) + (*md)->m_len - *dpos; if (t1 >= s) { *dpos += s; - return 0; + return (0); } t1 = nfs_adv(md, dpos, s, t1); if (t1) - return t1; - return 0; + return (t1); + return (0); } /* Modified: stable/8/sys/nfs/nfs_common.h ============================================================================== --- stable/8/sys/nfs/nfs_common.h Tue Mar 30 19:52:45 2010 (r205917) +++ stable/8/sys/nfs/nfs_common.h Tue Mar 30 19:52:45 2010 (r205918) @@ -33,7 +33,6 @@ * $FreeBSD$ */ - #ifndef _NFS_NFS_COMMON_H_ #define _NFS_NFS_COMMON_H_ @@ -87,7 +86,7 @@ do { \ goto nfsmout; \ } \ } while (0) - + #define nfsm_dissect(c, s) \ ({ \ void *ret; \ Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Tue Mar 30 19:52:45 2010 (r205917) +++ stable/8/sys/nfsclient/nfs_krpc.c Tue Mar 30 19:52:45 2010 (r205918) @@ -99,9 +99,11 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpacket "Buffer reservation size 2 < x < 64"); SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, "Number of times the nfs client has had to reconnect"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, + &nfs3_jukebox_delay, 0, "Number of seconds to delay a retry after receiving EJUKEBOX"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, +SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, + &nfs_skip_wcc_data_onerr, 0, "Disable weak cache consistency checking when server returns an error"); static void nfs_down(struct nfsmount *, struct thread *, const char *, @@ -154,7 +156,8 @@ static enum nfs_rto_timer_t nfs_proct[NF static inline enum nfs_rto_timer_t nfs_rto_timer(u_int32_t procnum) { - return nfs_proct[procnum]; + + return (nfs_proct[procnum]); } /* @@ -219,7 +222,7 @@ nfs_connect(struct nfsmount *nmp) nconf = getnetconfigent("udp6"); else nconf = getnetconfigent("tcp6"); - + /* * Get buffer reservation size from sysctl, but impose reasonable * limits. @@ -267,9 +270,8 @@ nfs_connect(struct nfsmount *nmp) * Someone else already connected. */ CLNT_RELEASE(client); - } else { + } else nmp->nm_client = client; - } /* * Protocols that do not require connections may be optionally left @@ -278,22 +280,21 @@ nfs_connect(struct nfsmount *nmp) if (!(nmp->nm_flag & NFSMNT_NOCONN)) { mtx_unlock(&nmp->nm_mtx); CLNT_CONTROL(client, CLSET_CONNECT, &one); - } else { + } else mtx_unlock(&nmp->nm_mtx); - } /* Restore current thread's credentials. */ td->td_ucred = origcred; mtx_lock(&nmp->nm_mtx); - /* Initialize other non-zero congestion variables */ + /* Initialize other non-zero congestion variables. */ nfs_init_rtt(nmp); mtx_unlock(&nmp->nm_mtx); return (0); } /* - * NFS disconnect. Clean up and unlink. + * NFS disconnect. Clean up and unlink. */ void nfs_disconnect(struct nfsmount *nmp) @@ -310,9 +311,8 @@ nfs_disconnect(struct nfsmount *nmp) #endif CLNT_CLOSE(client); CLNT_RELEASE(client); - } else { + } else mtx_unlock(&nmp->nm_mtx); - } } void @@ -335,11 +335,10 @@ nfs_getauth(struct nfsmount *nmp, struct case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: - if (!nmp->nm_mech_oid) { + if (!nmp->nm_mech_oid) if (!rpc_gss_mech_to_oid("kerberosv5", - &nmp->nm_mech_oid)) + &nmp->nm_mech_oid)) return (NULL); - } if (nmp->nm_secflavor == RPCSEC_GSS_KRB5) svc = rpc_gss_svc_none; else if (nmp->nm_secflavor == RPCSEC_GSS_KRB5I) @@ -438,10 +437,10 @@ nfs_request(struct vnode *vp, struct mbu nf.nf_td = td; getmicrouptime(&now); nf.nf_lastmsg = now.tv_sec - - ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay)); + ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay)); /* - * XXX if not already connected call nfs_connect now. Longer + * XXX if not already connected call nfs_connect now. Longer * term, change nfs_mount to call nfs_connect unconditionally * and let clnt_reconnect_create handle reconnects. */ @@ -461,18 +460,17 @@ nfs_request(struct vnode *vp, struct mbu /* * Use a conservative timeout for RPCs other than getattr, - * lookup, read or write. The justification for doing "other" + * lookup, read or write. The justification for doing "other" * this way is that these RPCs happen so infrequently that * timer est. would probably be stale. Also, since many of * these RPCs are non-idempotent, a conservative timeout is * desired. */ timer = nfs_rto_timer(procnum); - if (timer != NFS_DEFAULT_TIMER) { + if (timer != NFS_DEFAULT_TIMER) ext.rc_timers = &nmp->nm_timers[timer - 1]; - } else { + else ext.rc_timers = NULL; - } #ifdef KDTRACE_HOOKS if (dtrace_nfsclient_nfs23_start_probe != NULL) { @@ -505,17 +503,16 @@ tryagain: * If there was a successful reply and a tprintf msg. * tprintf a response. */ - if (stat == RPC_SUCCESS) { + if (stat == RPC_SUCCESS) error = 0; - } else if (stat == RPC_TIMEDOUT) { + else if (stat == RPC_TIMEDOUT) error = ETIMEDOUT; - } else if (stat == RPC_VERSMISMATCH) { + else if (stat == RPC_VERSMISMATCH) error = EOPNOTSUPP; - } else if (stat == RPC_PROGVERSMISMATCH) { + else if (stat == RPC_PROGVERSMISMATCH) error = EPROTONOSUPPORT; - } else { + else error = EACCES; - } if (error) goto nfsmout; @@ -544,9 +541,9 @@ tryagain: m_freem(mrep); error = 0; waituntil = time_second + nfs3_jukebox_delay; - while (time_second < waituntil) { - (void) tsleep(&fake_wchan, PSOCK, "nqnfstry", hz); - } + while (time_second < waituntil) + (void)tsleep(&fake_wchan, PSOCK, "nqnfstry", + hz); goto tryagain; } @@ -557,12 +554,13 @@ tryagain: if (error == ESTALE) nfs_purgecache(vp); /* - * Skip wcc data on NFS errors for now. NetApp filers + * Skip wcc data on NFS errors for now. NetApp filers * return corrupt postop attrs in the wcc data for NFS - * err EROFS. Not sure if they could return corrupt + * err EROFS. Not sure if they could return corrupt * postop attrs for others errors. */ - if ((nmp->nm_flag & NFSMNT_NFSV3) && !nfs_skip_wcc_data_onerr) { + if ((nmp->nm_flag & NFSMNT_NFSV3) && + !nfs_skip_wcc_data_onerr) { *mrp = mrep; *mdp = md; *dposp = dpos; @@ -624,7 +622,7 @@ nfsmout: /* * Mark all of an nfs mount's outstanding requests with R_SOFTTERM and - * wait for all requests to complete. This is used by forced unmounts + * wait for all requests to complete. This is used by forced unmounts * to terminate any outstanding RPCs. */ int @@ -638,7 +636,7 @@ nfs_nmcancelreqs(struct nfsmount *nmp) /* * Any signal that can interrupt an NFS operation in an intr mount - * should be added to this set. SIGSTOP and SIGKILL cannot be masked. + * should be added to this set. SIGSTOP and SIGKILL cannot be masked. */ int nfs_sig_set[] = { SIGINT, @@ -657,16 +655,16 @@ static int nfs_sig_pending(sigset_t set) { int i; - + for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) if (SIGISMEMBER(set, nfs_sig_set[i])) return (1); return (0); } - + /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the process p_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -675,18 +673,18 @@ nfs_set_sigmask(struct thread *td, sigse sigset_t newset; int i; struct proc *p; - + SIGFILLSET(newset); if (td == NULL) td = curthread; /* XXX */ p = td->td_proc; - /* Remove the NFS set of signals from newset */ + /* Remove the NFS set of signals from newset. */ PROC_LOCK(p); mtx_lock(&p->p_sigacts->ps_mtx); for (i = 0 ; i < sizeof(nfs_sig_set)/sizeof(int) ; i++) { /* * But make sure we leave the ones already masked - * by the process, ie. remove the signal from the + * by the process, i.e. remove the signal from the * temporary signalmask only if it wasn't already * in p_sigmask. */ @@ -712,12 +710,13 @@ nfs_restore_sigmask(struct thread *td, s * old one after msleep() returns. */ int -nfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo) +nfs_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, + char *wmesg, int timo) { sigset_t oldset; int error; struct proc *p; - + if ((priority & PCATCH) == 0) return msleep(ident, mtx, priority, wmesg, timo); if (td == NULL) @@ -738,7 +737,7 @@ nfs_sigintr(struct nfsmount *nmp, struct { struct proc *p; sigset_t tmpset; - + /* Terminate all requests while attempting a forced unmount. */ if (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) return (EIO); @@ -769,12 +768,11 @@ nfs_msg(struct thread *td, const char *s struct proc *p; p = td ? td->td_proc : NULL; - if (error) { + if (error) tprintf(p, LOG_INFO, "nfs server %s: %s, error %d\n", server, msg, error); - } else { + else tprintf(p, LOG_INFO, "nfs server %s: %s\n", server, msg); - } return (0); } @@ -793,7 +791,8 @@ nfs_down(struct nfsmount *nmp, struct th } else mtx_unlock(&nmp->nm_mtx); mtx_lock(&nmp->nm_mtx); - if ((flags & NFSSTA_LOCKTIMEO) && !(nmp->nm_state & NFSSTA_LOCKTIMEO)) { + if ((flags & NFSSTA_LOCKTIMEO) && + !(nmp->nm_state & NFSSTA_LOCKTIMEO)) { nmp->nm_state |= NFSSTA_LOCKTIMEO; mtx_unlock(&nmp->nm_mtx); vfs_event_signal(&nmp->nm_mountp->mnt_stat.f_fsid, @@ -809,9 +808,8 @@ nfs_up(struct nfsmount *nmp, struct thre { if (nmp == NULL) return; - if (tprintfmsg) { + if (tprintfmsg) nfs_msg(td, nmp->nm_mountp->mnt_stat.f_mntfromname, msg, 0); - } mtx_lock(&nmp->nm_mtx); if ((flags & NFSSTA_TIMEO) && (nmp->nm_state & NFSSTA_TIMEO)) { @@ -821,9 +819,10 @@ nfs_up(struct nfsmount *nmp, struct thre VQ_NOTRESP, 1); } else mtx_unlock(&nmp->nm_mtx); - + mtx_lock(&nmp->nm_mtx); - if ((flags & NFSSTA_LOCKTIMEO) && (nmp->nm_state & NFSSTA_LOCKTIMEO)) { + if ((flags & NFSSTA_LOCKTIMEO) && + (nmp->nm_state & NFSSTA_LOCKTIMEO)) { nmp->nm_state &= ~NFSSTA_LOCKTIMEO; mtx_unlock(&nmp->nm_mtx); vfs_event_signal(&nmp->nm_mountp->mnt_stat.f_fsid, From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:02:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 579CC1065670; Tue, 30 Mar 2010 20:02:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447CE8FC1B; Tue, 30 Mar 2010 20:02:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UK2R0v080362; Tue, 30 Mar 2010 20:02:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UK2R8e080352; Tue, 30 Mar 2010 20:02:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302002.o2UK2R8e080352@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205920 - in stable/8/sys: boot/sparc64/loader sparc64/include sun4v/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:02:27 -0000 Author: marius Date: Tue Mar 30 20:02:26 2010 New Revision: 205920 URL: http://svn.freebsd.org/changeset/base/205920 Log: MFC: r203829 - Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware of Sun Fire V1280 doesn't round up the size itself but instead lets claiming of non page-sized amounts of memory fail. - Change parameters and variables related to the TLB slots to unsigned which is more appropriate. - Search the whole OFW device tree instead of only the children of the root nexus device for the BSP as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. - Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Check the return value of init_heap(). This requires moving it after cons_probe() so we can panic when appropriate. This should be fine as the PowerPC OFW loader uses that order for quite some time now. Added: stable/8/sys/sparc64/include/cmt.h - copied unchanged from r203829, head/sys/sparc64/include/cmt.h stable/8/sys/sparc64/include/fireplane.h - copied unchanged from r203829, head/sys/sparc64/include/fireplane.h stable/8/sys/sparc64/include/jbus.h - copied unchanged from r203829, head/sys/sparc64/include/jbus.h stable/8/sys/sun4v/include/cmt.h - copied unchanged from r203829, head/sys/sun4v/include/cmt.h stable/8/sys/sun4v/include/fireplane.h - copied unchanged from r203829, head/sys/sun4v/include/fireplane.h stable/8/sys/sun4v/include/jbus.h - copied unchanged from r203829, head/sys/sun4v/include/jbus.h Modified: stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/sparc64/include/asi.h stable/8/sys/sun4v/include/asi.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Tue Mar 30 19:54:29 2010 (r205919) +++ stable/8/sys/boot/sparc64/loader/main.c Tue Mar 30 20:02:26 2010 (r205920) @@ -46,16 +46,19 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include -#include +#include #include +#include #include #include #include +#include #include #include +#include +#include #include #include #include @@ -68,6 +71,12 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" +#ifndef CTASSERT +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif + extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { @@ -76,6 +85,9 @@ enum { LOADSZ = 0x1000000 /* for kernel and modules */ }; +/* At least Sun Fire V1280 require page sized allocations to be claimed. */ +CTASSERT(HEAPSZ % PAGE_SIZE == 0); + static struct mmu_ops { void (*tlb_init)(void); int (*mmu_mapin)(vm_offset_t va, vm_size_t len); @@ -84,11 +96,11 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(int slot); -static void dtlb_enter_sun4u(u_long vpn, u_long data); +static inline u_long dtlb_get_data_sun4u(u_int); +static void dtlb_enter_sun4u(u_long, u_long); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(int slot); -static void itlb_enter_sun4u(u_long vpn, u_long data); +static inline u_long itlb_get_data_sun4u(u_int); +static void itlb_enter_sun4u(u_long, u_long); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -104,6 +116,9 @@ static int __elfN(exec)(struct preloaded static int mmu_mapin_sun4u(vm_offset_t, vm_size_t); static int mmu_mapin_sun4v(vm_offset_t, vm_size_t); static vm_offset_t init_heap(void); +static phandle_t find_bsp_sun4u(phandle_t, uint32_t); +const char *cpu_cpuid_prop_sun4u(void); +uint32_t cpu_get_mid_sun4u(void); static void tlb_init_sun4u(void); static void tlb_init_sun4v(void); @@ -120,11 +135,11 @@ static struct mmu_ops mmu_ops_sun4v = { /* sun4u */ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; -int dtlb_slot; -int itlb_slot; +u_int dtlb_slot; +u_int itlb_slot; int cpu_impl; -static int dtlb_slot_max; -static int itlb_slot_max; +static u_int dtlb_slot_max; +static u_int itlb_slot_max; /* sun4v */ static struct tlb_entry *tlb_store; @@ -398,7 +413,7 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(int slot) +dtlb_get_data_sun4u(u_int slot) { /* @@ -410,7 +425,7 @@ dtlb_get_data_sun4u(int slot) } static inline u_long -itlb_get_data_sun4u(int slot) +itlb_get_data_sun4u(u_int slot) { /* @@ -668,33 +683,98 @@ init_heap(void) return (heapva); } +static phandle_t +find_bsp_sun4u(phandle_t node, uint32_t bspid) +{ + char type[sizeof("cpu")]; + phandle_t child; + uint32_t cpuid; + + for (; node > 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) { + child = find_bsp_sun4u(child, bspid); + if (child > 0) + return (child); + } else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop_sun4u(), &cpuid, + sizeof(cpuid)) <= 0) + continue; + if (cpuid == bspid) + return (node); + } + } + return (0); +} + +const char * +cpu_cpuid_prop_sun4u(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return ("upa-portid"); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return ("portid"); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return ("cpuid"); + default: + return (""); + } +} + +uint32_t +cpu_get_mid_sun4u(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, + ASI_FIREPLANE_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); + default: + return (0); + } +} + static void tlb_init_sun4u(void) { - phandle_t child; - char buf[128]; - u_int bootcpu; - u_int cpu; + phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); - bootcpu = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0) - continue; - if (strcmp(buf, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &cpu, sizeof(cpu)) <= 0) - continue; - if (cpu == bootcpu) - break; - } - if (cpu != bootcpu) + bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); + if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); - if (OF_getprop(child, "#dtlb-entries", &dtlb_slot_max, + if (OF_getprop(bsp, "#dtlb-entries", &dtlb_slot_max, sizeof(dtlb_slot_max)) == -1 || - OF_getprop(child, "#itlb-entries", &itlb_slot_max, + OF_getprop(bsp, "#itlb-entries", &itlb_slot_max, sizeof(itlb_slot_max)) == -1) panic("%s: can't get TLB slot max.", __func__); @@ -749,14 +829,15 @@ main(int (*openfirm)(void *)) archsw.arch_autoload = sparc64_autoload; archsw.arch_maphint = sparc64_maphint; - init_heap(); - setheap((void *)heapva, (void *)(heapva + HEAPSZ)); - /* * Probe for a console. */ cons_probe(); + if (init_heap() == (vm_offset_t)-1) + panic("%s: can't claim heap", __func__); + setheap((void *)heapva, (void *)(heapva + HEAPSZ)); + if ((root = OF_peer(0)) == -1) panic("%s: can't get root phandle", __func__); OF_getprop(root, "compatible", compatible, sizeof(compatible)); Modified: stable/8/sys/sparc64/include/asi.h ============================================================================== --- stable/8/sys/sparc64/include/asi.h Tue Mar 30 19:54:29 2010 (r205919) +++ stable/8/sys/sparc64/include/asi.h Tue Mar 30 20:02:26 2010 (r205920) @@ -33,7 +33,7 @@ #define _MACHINE_ASI_H_ /* - * Standard v9 asis + * Standard v9 ASIs */ #define ASI_N 0x4 #define ASI_NL 0xc @@ -51,7 +51,7 @@ #define ASI_SNFL 0x8b /* - * UltraSPARC extensions. ASIs limited to a certain family are annotated. + * UltraSPARC extensions - ASIs limited to a certain family are annotated. */ #define ASI_PHYS_USE_EC 0x14 #define ASI_PHYS_BYPASS_EC_WITH_EBIT 0x15 @@ -91,9 +91,12 @@ #define ASI_INTR_RECEIVE 0x49 #define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */ -#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III Cu */ -#define AA_FIREPLANE_CONFIG 0x0 /* US-III Cu */ -#define AA_FIREPLANE_ADDRESS 0x8 /* US-III Cu */ +#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */ + +#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */ #define ASI_ESTATE_ERROR_EN_REG 0x4b #define AA_ESTATE_CEEN 0x1 @@ -153,6 +156,11 @@ #define ASI_IIU_INST_TRAP 0x60 /* US-III family */ +#define ASI_INTR_ID 0x63 /* US-IV{,+} */ +#define AA_INTR_ID 0x0 /* US-IV{,+} */ +#define AA_CORE_ID 0x10 /* US-IV{,+} */ +#define AA_CESR_ID 0x40 /* US-IV{,+} */ + #define ASI_ICACHE_INSTR 0x66 #define ASI_ICACHE_TAG 0x67 #define ASI_ICACHE_SNOOP_TAG 0x68 /* US-III family */ @@ -179,7 +187,7 @@ /* * With the advent of the US-III, the numbering has changed, as additional - * registers were inserted in between. We retain the original ordering for + * registers were inserted in between. We retain the original ordering for * now, and append an A to the inserted registers. * Exceptions are AA_SDB_INTR_D6 and AA_SDB_INTR_D7, which were appended * at the end. Copied: stable/8/sys/sparc64/include/cmt.h (from r203829, head/sys/sparc64/include/cmt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/include/cmt.h Tue Mar 30 20:02:26 2010 (r205920, copy of r203829, head/sys/sparc64/include/cmt.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_CMT_H_ +#define _MACHINE_CMT_H_ + +#define INTR_ID_ID_SHIFT (0) +#define INTR_ID_ID_SIZE (10) +#define INTR_ID_ID_MASK \ + (((1 << INTR_ID_ID_SIZE) - 1) << INTR_ID_ID_SHIFT) + +#define INTR_ID_GET_ID(cr) ((cr & INTR_ID_ID_MASK) >> INTR_ID_ID_SHIFT) + +#endif /* _MACHINE_CMT_H_ */ Copied: stable/8/sys/sparc64/include/fireplane.h (from r203829, head/sys/sparc64/include/fireplane.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/include/fireplane.h Tue Mar 30 20:02:26 2010 (r205920, copy of r203829, head/sys/sparc64/include/fireplane.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_FIREPLANE_H_ +#define _MACHINE_FIREPLANE_H_ + +#define FIREPLANE_CR_AID_SHIFT (17) +#define FIREPLANE_CR_AID_SIZE (10) +#define FIREPLANE_CR_AID_MASK \ + (((1 << FIREPLANE_CR_AID_SIZE) - 1) << FIREPLANE_CR_AID_SHIFT) + +#define FIREPLANE_CR_GET_AID(cr) \ + ((cr & FIREPLANE_CR_AID_MASK) >> FIREPLANE_CR_AID_SHIFT) + +#endif /* _MACHINE_FIREPLANE_H_ */ Copied: stable/8/sys/sparc64/include/jbus.h (from r203829, head/sys/sparc64/include/jbus.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/include/jbus.h Tue Mar 30 20:02:26 2010 (r205920, copy of r203829, head/sys/sparc64/include/jbus.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_JBUS_H_ +#define _MACHINE_JBUS_H_ + +#define JBUS_CR_JID_SHIFT (17) +#define JBUS_CR_JID_SIZE (3) +#define JBUS_CR_JID_MASK \ + (((1 << JBUS_CR_JID_SIZE) - 1) << JBUS_CR_JID_SHIFT) + +#define JBUS_CR_GET_JID(cr) ((cr & JBUS_CR_JID_MASK) >> JBUS_CR_JID_SHIFT) + +#endif /* _MACHINE_JBUS_H_ */ Modified: stable/8/sys/sun4v/include/asi.h ============================================================================== --- stable/8/sys/sun4v/include/asi.h Tue Mar 30 19:54:29 2010 (r205919) +++ stable/8/sys/sun4v/include/asi.h Tue Mar 30 20:02:26 2010 (r205920) @@ -158,6 +158,11 @@ #define AA_DMMU_TAR 0x30 #define ASI_UPA_CONFIG_REG 0x4a /* US-I, II */ +#define ASI_FIREPLANE_CONFIG_REG 0x4a /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG 0x0 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_ADDRESS 0x8 /* US-III{,+}, IV{,+} */ +#define AA_FIREPLANE_CONFIG_2 0x10 /* US-IV{,+} */ +#define ASI_JBUS_CONFIG_REG 0x4a /* US-IIIi{,+} */ #define ASI_IMMU 0x50 #define ASI_ITLB_DATA_IN_REG 0x54 #define ASI_ITLB_DATA_ACCESS_REG 0x55 @@ -167,5 +172,7 @@ #define ASI_DTLB_DATA_IN_REG 0x5c #define ASI_DTLB_DATA_ACCESS_REG 0x5d #define ASI_DTLB_TAG_READ_REG 0x5e +#define ASI_INTR_ID 0x63 /* US-IV{,+} */ +#define AA_INTR_ID 0x0 /* US-IV{,+} */ #endif /* !_MACHINE_ASI_H_ */ Copied: stable/8/sys/sun4v/include/cmt.h (from r203829, head/sys/sun4v/include/cmt.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sun4v/include/cmt.h Tue Mar 30 20:02:26 2010 (r205920, copy of r203829, head/sys/sun4v/include/cmt.h) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include Copied: stable/8/sys/sun4v/include/fireplane.h (from r203829, head/sys/sun4v/include/fireplane.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sun4v/include/fireplane.h Tue Mar 30 20:02:26 2010 (r205920, copy of r203829, head/sys/sun4v/include/fireplane.h) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include Copied: stable/8/sys/sun4v/include/jbus.h (from r203829, head/sys/sun4v/include/jbus.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sun4v/include/jbus.h Tue Mar 30 20:02:26 2010 (r205920, copy of r203829, head/sys/sun4v/include/jbus.h) @@ -0,0 +1,7 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ + +#include From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:05:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8F9F1065673; Tue, 30 Mar 2010 20:05:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7A328FC16; Tue, 30 Mar 2010 20:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UK5Khv081112; Tue, 30 Mar 2010 20:05:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UK5KAm081110; Tue, 30 Mar 2010 20:05:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302005.o2UK5KAm081110@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205922 - stable/8/sys/boot/sparc64/loader X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:05:20 -0000 Author: marius Date: Tue Mar 30 20:05:20 2010 New Revision: 205922 URL: http://svn.freebsd.org/changeset/base/205922 Log: MFC: r203830, r203831 Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves. Unlike direct access the firmware methods don't automatically use the next free (?) TLB slot, instead the slot to be used has to be specified. We allocate the TLB slots for the kernel top-down as OpenSolaris suggests that the firmware will always allocate the ones for its own use bottom-up. Besides being simpler, according to OpenBSD using the firmware methods is required to allow booting on Sun Fire E10K with multi-systemboard domains. Modified: stable/8/sys/boot/sparc64/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Tue Mar 30 20:02:28 2010 (r205921) +++ stable/8/sys/boot/sparc64/loader/main.c Tue Mar 30 20:05:20 2010 (r205922) @@ -97,10 +97,10 @@ typedef void kernel_entry_t(vm_offset_t void *openfirmware); static inline u_long dtlb_get_data_sun4u(u_int); -static void dtlb_enter_sun4u(u_long, u_long); +static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); static inline u_long itlb_get_data_sun4u(u_int); -static void itlb_enter_sun4u(u_long, u_long); +static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); extern vm_offset_t md_load(char *, vm_offset_t *); @@ -482,55 +482,24 @@ itlb_va_to_pa_sun4u(vm_offset_t va) return (-1); } -static void -dtlb_enter_sun4u(u_long vpn, u_long data) +static int +dtlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) { - u_long reg; - reg = rdpr(pstate); - wrpr(pstate, reg & ~PSTATE_IE, 0); - stxa(AA_DMMU_TAR, ASI_DMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(0, ASI_DTLB_DATA_IN_REG, data); - membar(Sync); - wrpr(pstate, reg, 0); + return (OF_call_method("SUNW,dtlb-load", mmu, 3, 0, index, data, + virt)); } -static void -itlb_enter_sun4u(u_long vpn, u_long data) +static int +itlb_enter_sun4u(u_int index, u_long data, vm_offset_t virt) { - u_long reg; - int i; - reg = rdpr(pstate); - wrpr(pstate, reg & ~PSTATE_IE, 0); - - if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp) { - /* - * Search an unused slot != 0 and explicitly enter the data - * and tag there in order to avoid Cheetah+ erratum 34. - */ - for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) - continue; - - stxa(AA_IMMU_TAR, ASI_IMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); - flush(PROMBASE); - break; - } - wrpr(pstate, reg, 0); - if (i == itlb_slot_max) - panic("%s: could not find an unused slot", __func__); - return; - } - - stxa(AA_IMMU_TAR, ASI_IMMU, - TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); - stxa(0, ASI_ITLB_DATA_IN_REG, data); - flush(PROMBASE); - wrpr(pstate, reg, 0); + if (cpu_impl == CPU_IMPL_ULTRASPARCIIIp && index == 0 && + (data & TD_L) != 0) + panic("%s: won't enter locked TLB entry at index 0 on USIII+", + __func__); + return (OF_call_method("SUNW,itlb-load", mmu, 3, 0, index, data, + virt)); } static void @@ -580,6 +549,7 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ { vm_offset_t pa, mva; u_long data; + u_int index; if (va + len > curkva) curkva = va + len; @@ -617,12 +587,20 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ TD_CV | TD_P | TD_W; dtlb_store[dtlb_slot].te_pa = pa; dtlb_store[dtlb_slot].te_va = va; + index = dtlb_slot_max - dtlb_slot - 1; + if (dtlb_enter_sun4u(index, data, va) < 0) + panic("%s: can't enter dTLB slot %d data " + "%#lx va %#lx", __func__, index, data, + va); + dtlb_slot++; itlb_store[itlb_slot].te_pa = pa; itlb_store[itlb_slot].te_va = va; - dtlb_slot++; + index = itlb_slot_max - itlb_slot - 1; + if (itlb_enter_sun4u(index, data, va) < 0) + panic("%s: can't enter iTLB slot %d data " + "%#lx va %#lxd", __func__, index, data, + va); itlb_slot++; - dtlb_enter_sun4u(va, data); - itlb_enter_sun4u(va, data); pa = (vm_offset_t)-1; } len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len; From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:12:43 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46A37106566B; Tue, 30 Mar 2010 20:12:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34DEC8FC18; Tue, 30 Mar 2010 20:12:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKChgw082881; Tue, 30 Mar 2010 20:12:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKChox082878; Tue, 30 Mar 2010 20:12:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302012.o2UKChox082878@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205924 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:12:43 -0000 Author: marius Date: Tue Mar 30 20:12:42 2010 New Revision: 205924 URL: http://svn.freebsd.org/changeset/base/205924 Log: MFC: r203833 - At least the trap table of the Sun Fire V1280 firmware apparently has no cleanwindows handler so just remove trying to trigger it from _start and the AP trampoline code as that leads to a crash there. This should be okay as leaking data from the OFW via the CPU registers on start of the kernel should be no real concern. - Make the comments of _start and the AP trampoline code regarding the initializations they perform match each other and reality. - Make the comments of the AP trampoline code regarding iTLB accesses refer to the right macro. Modified: stable/8/sys/sparc64/sparc64/locore.S stable/8/sys/sparc64/sparc64/mp_locore.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/locore.S Tue Mar 30 20:05:22 2010 (r205923) +++ stable/8/sys/sparc64/sparc64/locore.S Tue Mar 30 20:12:42 2010 (r205924) @@ -46,12 +46,14 @@ ENTRY(btext) ENTRY(_start) /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), no clean - * windows, pil 0, and floating point disabled. + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * floating point disabled. + * Note that some firmware versions don't implement a clean window + * trap handler so we unfortunately can't clear the windows by setting + * %cleanwin to zero here. */ wrpr %g0, PSTATE_NORMAL, %pstate flushw - wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:05:22 2010 (r205923) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:12:42 2010 (r205924) @@ -44,12 +44,14 @@ __FBSDID("$FreeBSD$"); .text _ALIGN_TEXT /* - * Initialize misc. state to known values: interrupts disabled, - * normal globals, no clean windows, PIL 0, and floating point - * disabled. + * Initialize misc. state to known values: interrupts disabled, normal + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * floating point disabled. + * Note that some firmware versions don't implement a clean window + * trap handler so we unfortunately can't clear the windows by setting + * %cleanwin to zero here. */ 1: wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil wr %g0, 0, %fprs @@ -68,7 +70,7 @@ __FBSDID("$FreeBSD$"); setx TD_V | TD_L, %l1, %l0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ ldxa [%g0] ASI_ITLB_DATA_ACCESS_REG, %g0 @@ -94,7 +96,7 @@ __FBSDID("$FreeBSD$"); mov (1 << TLB_DAR_SLOT_SHIFT), %l4 setx TD_V, %l1, %l0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ 2: ldxa [%l4] ASI_ITLB_DATA_ACCESS_REG, %g0 @@ -136,7 +138,7 @@ __FBSDID("$FreeBSD$"); mov (1 << TLB_DAR_SLOT_SHIFT), %l0 setx TD_V, %o1, %o0 /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work * around errata of USIII and beyond. */ 5: ldxa [%l0] ASI_ITLB_DATA_ACCESS_REG, %g0 From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:29:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5025D106564A; Tue, 30 Mar 2010 20:29:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DD298FC16; Tue, 30 Mar 2010 20:29:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKTkjj086774; Tue, 30 Mar 2010 20:29:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKTkOh086767; Tue, 30 Mar 2010 20:29:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302029.o2UKTkOh086767@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205927 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:29:46 -0000 Author: marius Date: Tue Mar 30 20:29:45 2010 New Revision: 205927 URL: http://svn.freebsd.org/changeset/base/205927 Log: MFC: r203838 - Search the whole OFW device tree instead of only the children of the root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu' nodes hang off of from 'cmp' (chip multi-threading processor) or 'core' or combinations thereof. Also in large UltraSPARC III based machines the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which group snooping-coherency domains together instead of directly from the nexus. It would be great if we could use newbus to deal with the different ways the 'cpu' devices can hang off of pseudo ones but unfortunately both cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device probing. - Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these are multi-core each CPU has two Fireplane config registers and thus the module/target ID has to be determined differently so the one specific to a certain core is used. Similarly, starting with UltraSPARC IV the individual cores use a different property in the OFW device tree to indicate the CPU/core ID as it no longer is in coincidence with the shared slot/socket ID. This involves changing the MD KTR code to not directly read the UPA module ID either. We use the MID stored in the per-CPU data instead of calling cpu_get_mid() as a replacement in order prevent clobbering any registers as side-effect in the assembler version. This requires CATR() invocations from mp_startup() prior to mapping the per-CPU pages to be removed though. While at it additionally distinguish between CPUs with Fireplane and JBus interconnects as these also use slightly different sizes for the JBus/agent/module/target IDs. - Make sparc64_shutdown_final() static as it's not used outside of machdep.c. Modified: stable/8/sys/sparc64/include/ktr.h stable/8/sys/sparc64/include/md_var.h stable/8/sys/sparc64/include/upa.h stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/mp_locore.S stable/8/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/ktr.h ============================================================================== --- stable/8/sys/sparc64/include/ktr.h Tue Mar 30 20:29:45 2010 (r205926) +++ stable/8/sys/sparc64/include/ktr.h Tue Mar 30 20:29:45 2010 (r205927) @@ -34,11 +34,9 @@ #include -#include - #ifndef LOCORE -#define KTR_CPU UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)) +#define KTR_CPU PCPU_GET(mid) #else @@ -74,7 +72,7 @@ l2: add r2, 1, r3 ; \ add r1, r2, r1 ; \ rd %tick, r2 ; \ stx r2, [r1 + KTR_TIMESTAMP] ; \ - UPA_GET_MID(r2) ; \ + lduw [PCPU(MID)], r2 ; \ stw r2, [r1 + KTR_CPU] ; \ stw %g0, [r1 + KTR_LINE] ; \ stx %g0, [r1 + KTR_FILE] ; \ @@ -84,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - UPA_GET_MID(r1) ; \ + lduw [PCPU(MID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/8/sys/sparc64/include/md_var.h ============================================================================== --- stable/8/sys/sparc64/include/md_var.h Tue Mar 30 20:29:45 2010 (r205926) +++ stable/8/sys/sparc64/include/md_var.h Tue Mar 30 20:29:45 2010 (r205927) @@ -47,6 +47,8 @@ extern vm_paddr_t kstack0_phys; struct pcpu; struct md_utrap; +const char *cpu_cpuid_prop(void); +uint32_t cpu_get_mid(void); void cpu_identify(u_long vers, u_int clock, u_int id); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); Modified: stable/8/sys/sparc64/include/upa.h ============================================================================== --- stable/8/sys/sparc64/include/upa.h Tue Mar 30 20:29:45 2010 (r205926) +++ stable/8/sys/sparc64/include/upa.h Tue Mar 30 20:29:45 2010 (r205927) @@ -26,25 +26,16 @@ */ #ifndef _MACHINE_UPA_H_ -#define _MACHINE_UPA_H_ +#define _MACHINE_UPA_H_ #define UPA_MEMSTART 0x1c000000000UL #define UPA_MEMEND 0x1ffffffffffUL #define UPA_CR_MID_SHIFT (17) #define UPA_CR_MID_SIZE (5) -#define UPA_CR_MID_MASK \ +#define UPA_CR_MID_MASK \ (((1 << UPA_CR_MID_SIZE) - 1) << UPA_CR_MID_SHIFT) #define UPA_CR_GET_MID(cr) ((cr & UPA_CR_MID_MASK) >> UPA_CR_MID_SHIFT) -#ifdef LOCORE - -#define UPA_GET_MID(r1) \ - ldxa [%g0] ASI_UPA_CONFIG_REG, r1 ; \ - srlx r1, UPA_CR_MID_SHIFT, r1 ; \ - and r1, (1 << UPA_CR_MID_SIZE) - 1, r1 - -#endif - #endif /* _MACHINE_UPA_H_ */ Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Tue Mar 30 20:29:45 2010 (r205926) +++ stable/8/sys/sparc64/sparc64/machdep.c Tue Mar 30 20:29:45 2010 (r205927) @@ -89,10 +89,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include +#include #include #include #include @@ -143,11 +146,12 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; +static phandle_t find_bsp(phandle_t node, uint32_t bspid); void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); -void sparc64_shutdown_final(void *dummy, int howto); +static void sparc64_shutdown_final(void *dummy, int howto); -static void cpu_startup(void *); +static void cpu_startup(void *arg); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); CTASSERT((1 << INT_SHIFT) == sizeof(int)); @@ -236,18 +240,94 @@ spinlock_exit(void) wrpr(pil, td->td_md.md_saved_pil, 0); } +static phandle_t +find_bsp(phandle_t node, uint32_t bspid) +{ + char type[sizeof("cpu")]; + phandle_t child; + uint32_t cpuid; + + for (; node != 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) { + child = find_bsp(child, bspid); + if (child > 0) + return (child); + } else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + sizeof(cpuid)) <= 0) + continue; + if (cpuid == bspid) + return (node); + } + } + return (0); +} + +const char * +cpu_cpuid_prop(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return ("upa-portid"); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return ("portid"); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return ("cpuid"); + default: + return (""); + } +} + +uint32_t +cpu_get_mid(void) +{ + + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + return (UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + return (FIREPLANE_CR_GET_AID(ldxa(AA_FIREPLANE_CONFIG, + ASI_FIREPLANE_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + return (JBUS_CR_GET_JID(ldxa(0, ASI_JBUS_CONFIG_REG))); + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (INTR_ID_GET_ID(ldxa(AA_INTR_ID, ASI_INTR_ID))); + default: + return (0); + } +} + void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) { - char type[8]; char *env; struct pcpu *pc; vm_offset_t end; vm_offset_t va; caddr_t kmdp; - phandle_t child; phandle_t root; - uint32_t portid; end = 0; kmdp = NULL; @@ -319,7 +399,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_mid = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG)); + pc->pc_mid = cpu_get_mid(); pc->pc_tlb_ctx = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; @@ -328,24 +408,11 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Determine the OFW node and frequency of the BSP (and ensure the * BSP is in the device tree in the first place). */ - pc->pc_node = 0; root = OF_peer(0); - for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (OF_getprop(child, "device_type", type, sizeof(type)) <= 0) - continue; - if (strcmp(type, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &portid, sizeof(portid)) <= 0) - continue; - if (portid == pc->pc_mid) { - pc->pc_node = child; - break; - } - } + pc->pc_node = find_bsp(root, pc->pc_mid); if (pc->pc_node == 0) OF_exit(); - if (OF_getprop(child, "clock-frequency", &pc->pc_clock, + if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, sizeof(pc->pc_clock)) <= 0) OF_exit(); @@ -838,7 +905,7 @@ cpu_halt(void) cpu_shutdown(&args); } -void +static void sparc64_shutdown_final(void *dummy, int howto) { static struct { Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:29:45 2010 (r205926) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Tue Mar 30 20:29:45 2010 (r205927) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "assym.s" @@ -212,14 +211,8 @@ ENTRY(mp_startup) nop wr %l1, 0, %asr24 -3: UPA_GET_MID(%o0) - -#if KTR_COMPILE & KTR_SMP - CATR(KTR_SMP, "mp_start: CPU %d entered kernel" - , %g1, %g2, %g3, 7, 8, 9) - stx %o0, [%g1 + KTR_PARM1] -9: -#endif +3: call cpu_get_mid + nop /* * Inform the boot processor we have inited. @@ -236,13 +229,6 @@ ENTRY(mp_startup) bne %xcc, 4b nop -#if KTR_COMPILE & KTR_SMP - CATR(KTR_SMP, "_mp_start: CPU %d got start signal" - , %g1, %g2, %g3, 7, 8, 9) - stx %o0, [%g1 + KTR_PARM1] -9: -#endif - add %l0, CSA_TTES, %l1 clr %l2 @@ -283,7 +269,7 @@ ENTRY(mp_startup) #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, - "_mp_start: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" + "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) lduw [%l1 + PC_CPUID], %g2 stx %g2, [%g1 + KTR_PARM1] Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Tue Mar 30 20:29:45 2010 (r205926) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Tue Mar 30 20:29:45 2010 (r205927) @@ -119,7 +119,11 @@ static u_int cpuid_to_mid[MAXCPU]; static int isjbus; static volatile u_int shutdown_cpus; +static void ap_count(phandle_t node, u_int mid); +static void ap_start(phandle_t node, u_int mid); static void cpu_mp_unleash(void *v); +static void foreach_ap(phandle_t node, void (*func)(phandle_t node, + u_int mid)); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); @@ -166,25 +170,56 @@ mp_init(void) cpu_ipi_selected = spitfire_ipi_selected; } +static void +foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid)) +{ + char type[sizeof("cpu")]; + phandle_t child; + u_int cpuid; + + /* There's no need to traverse the whole OFW tree twice. */ + if (mp_maxid > 0 && mp_ncpus >= mp_maxid + 1) + return; + + for (; node != 0; node = OF_peer(node)) { + child = OF_child(node); + if (child > 0) + foreach_ap(child, func); + else { + if (OF_getprop(node, "device_type", type, + sizeof(type)) <= 0) + continue; + if (strcmp(type, "cpu") != 0) + continue; + if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + sizeof(cpuid)) <= 0) + panic("%s: can't get module ID", __func__); + if (cpuid == PCPU_GET(mid)) + continue; + (*func)(node, cpuid); + } + } +} + /* * Probe for other CPUs. */ void -cpu_mp_setmaxid(void) +cpu_mp_setmaxid() { - char buf[128]; - phandle_t child; - u_int cpus; all_cpus = 1 << curcpu; mp_ncpus = 1; + mp_maxid = 0; + + foreach_ap(OF_child(OF_peer(0)), ap_count); +} + +static void +ap_count(phandle_t node __unused, u_int mid __unused) +{ - cpus = 0; - for (child = OF_child(OF_peer(0)); child != 0; child = OF_peer(child)) - if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 && - strcmp(buf, "cpu") == 0) - cpus++; - mp_maxid = cpus - 1; + mp_maxid++; } int @@ -228,15 +263,6 @@ sun4u_startcpu(phandle_t cpu, void *func void cpu_mp_start(void) { - char buf[128]; - volatile struct cpu_start_args *csa; - struct pcpu *pc; - register_t s; - vm_offset_t va; - phandle_t child; - u_int mid; - u_int clock; - u_int cpuid; mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN); @@ -248,65 +274,68 @@ cpu_mp_start(void) cpuid_to_mid[curcpu] = PCPU_GET(mid); - csa = &cpu_start_args; - for (child = OF_child(OF_peer(0)); child != 0 && mp_ncpus <= MAXCPU; - child = OF_peer(child)) { - if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0 || - strcmp(buf, "cpu") != 0) - continue; - if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ? - "upa-portid" : "portid", &mid, sizeof(mid)) <= 0) - panic("%s: can't get module ID", __func__); - if (mid == PCPU_GET(mid)) - continue; - if (OF_getprop(child, "clock-frequency", &clock, - sizeof(clock)) <= 0) - panic("%s: can't get clock", __func__); - if (clock != PCPU_GET(clock)) - hardclock_use_stick = 1; + foreach_ap(OF_child(OF_peer(0)), ap_start); + KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, + ("%s: can only IPI a maximum of %d JBus-CPUs", + __func__, IDR_JALAPENO_MAX_BN_PAIRS)); + PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu)); + smp_active = 1; +} - csa->csa_state = 0; - sun4u_startcpu(child, (void *)mp_tramp, 0); - s = intr_disable(); - while (csa->csa_state != CPU_TICKSYNC) +static void +ap_start(phandle_t node, u_int mid) +{ + volatile struct cpu_start_args *csa; + struct pcpu *pc; + register_t s; + vm_offset_t va; + u_int clock; + u_int cpuid; + + if (mp_ncpus > MAXCPU) + return; + + if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) + panic("%s: can't get clock", __func__); + if (clock != PCPU_GET(clock)) + hardclock_use_stick = 1; + + csa = &cpu_start_args; + csa->csa_state = 0; + sun4u_startcpu(node, (void *)mp_tramp, 0); + s = intr_disable(); + while (csa->csa_state != CPU_TICKSYNC) + ; + membar(StoreLoad); + csa->csa_tick = rd(tick); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + while (csa->csa_state != CPU_STICKSYNC) ; membar(StoreLoad); - csa->csa_tick = rd(tick); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { - while (csa->csa_state != CPU_STICKSYNC) - ; - membar(StoreLoad); - csa->csa_stick = rdstick(); - } - while (csa->csa_state != CPU_INIT) - ; - csa->csa_tick = csa->csa_stick = 0; - intr_restore(s); + csa->csa_stick = rdstick(); + } + while (csa->csa_state != CPU_INIT) + ; + csa->csa_tick = csa->csa_stick = 0; + intr_restore(s); - cpuid = mp_ncpus++; - cpuid_to_mid[cpuid] = mid; - cpu_identify(csa->csa_ver, clock, cpuid); - - va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); - pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; - pcpu_init(pc, cpuid, sizeof(*pc)); - dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), - cpuid); - pc->pc_addr = va; - pc->pc_clock = clock; - pc->pc_mid = mid; - pc->pc_node = child; + cpuid = mp_ncpus++; + cpuid_to_mid[cpuid] = mid; + cpu_identify(csa->csa_ver, clock, cpuid); + + va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); + pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; + pcpu_init(pc, cpuid, sizeof(*pc)); + dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), cpuid); + pc->pc_addr = va; + pc->pc_clock = clock; + pc->pc_mid = mid; + pc->pc_node = node; - cache_init(pc); + cache_init(pc); - all_cpus |= 1 << cpuid; - intr_add_cpu(cpuid); - } - KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, - ("%s: can only IPI a maximum of %d JBus-CPUs", - __func__, IDR_JALAPENO_MAX_BN_PAIRS)); - PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu)); - smp_active = 1; + all_cpus |= 1 << cpuid; + intr_add_cpu(cpuid); } void From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:38:18 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEC4E106566B; Tue, 30 Mar 2010 20:38:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD1008FC17; Tue, 30 Mar 2010 20:38:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKcIH3088724; Tue, 30 Mar 2010 20:38:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKcIUU088722; Tue, 30 Mar 2010 20:38:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302038.o2UKcIUU088722@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205928 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:38:18 -0000 Author: marius Date: Tue Mar 30 20:38:18 2010 New Revision: 205928 URL: http://svn.freebsd.org/changeset/base/205928 Log: MFC: r203839 Style fixes Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Tue Mar 30 20:29:45 2010 (r205927) +++ stable/8/sys/sparc64/sparc64/pmap.c Tue Mar 30 20:38:18 2010 (r205928) @@ -241,6 +241,7 @@ PMAP_STATS_VAR(pmap_nnew_thread_oc); */ static int mr_cmp(const void *a, const void *b); static int om_cmp(const void *a, const void *b); + static int mr_cmp(const void *a, const void *b) { @@ -256,6 +257,7 @@ mr_cmp(const void *a, const void *b) else return (0); } + static int om_cmp(const void *a, const void *b) { @@ -1111,10 +1113,9 @@ pmap_release(pmap_t pm) * to a kernel thread, leaving the pmap pointer unchanged. */ mtx_lock_spin(&sched_lock); - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) if (pc->pc_pmap == pm) pc->pc_pmap = NULL; - } mtx_unlock_spin(&sched_lock); obj = pm->pm_tsb_obj; @@ -1150,7 +1151,7 @@ pmap_growkernel(vm_offset_t addr) int pmap_remove_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, - vm_offset_t va) + vm_offset_t va) { vm_page_t m; u_long data; @@ -1198,12 +1199,10 @@ pmap_remove(pmap_t pm, vm_offset_t start tsb_foreach(pm, NULL, start, end, pmap_remove_tte); tlb_context_demap(pm); } else { - for (va = start; va < end; va += PAGE_SIZE) { - if ((tp = tsb_tte_lookup(pm, va)) != NULL) { - if (!pmap_remove_tte(pm, NULL, tp, va)) - break; - } - } + for (va = start; va < end; va += PAGE_SIZE) + if ((tp = tsb_tte_lookup(pm, va)) != NULL && + !pmap_remove_tte(pm, NULL, tp, va)) + break; tlb_range_demap(pm, start, end - 1); } PMAP_UNLOCK(pm); @@ -1245,7 +1244,7 @@ pmap_remove_all(vm_page_t m) int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, - vm_offset_t va) + vm_offset_t va) { u_long data; vm_page_t m; @@ -1287,10 +1286,9 @@ pmap_protect(pmap_t pm, vm_offset_t sva, tsb_foreach(pm, NULL, sva, eva, pmap_protect_tte); tlb_context_demap(pm); } else { - for (va = sva; va < eva; va += PAGE_SIZE) { + for (va = sva; va < eva; va += PAGE_SIZE) if ((tp = tsb_tte_lookup(pm, va)) != NULL) pmap_protect_tte(pm, NULL, tp, va); - } tlb_range_demap(pm, sva, eva - 1); } PMAP_UNLOCK(pm); @@ -1386,21 +1384,18 @@ pmap_enter_locked(pmap_t pm, vm_offset_t */ if ((prot & VM_PROT_WRITE) != 0) { tp->tte_data |= TD_SW; - if (wired) { + if (wired) tp->tte_data |= TD_W; - } vm_page_flag_set(m, PG_WRITEABLE); - } else if ((data & TD_W) != 0) { + } else if ((data & TD_W) != 0) vm_page_dirty(m); - } /* * If we're turning on execute permissions, flush the icache. */ if ((prot & VM_PROT_EXECUTE) != 0) { - if ((data & TD_EXEC) == 0) { + if ((data & TD_EXEC) == 0) icache_page_inval(pa); - } tp->tte_data |= TD_EXEC; } @@ -1495,7 +1490,7 @@ pmap_enter_quick(pmap_t pm, vm_offset_t void pmap_object_init_pt(pmap_t pm, vm_offset_t addr, vm_object_t object, - vm_pindex_t pindex, vm_size_t size) + vm_pindex_t pindex, vm_size_t size) { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); @@ -1529,7 +1524,8 @@ pmap_change_wiring(pmap_t pm, vm_offset_ } static int -pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp, vm_offset_t va) +pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp, + vm_offset_t va) { vm_page_t m; u_long data; @@ -1567,10 +1563,9 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm pmap_copy_tte); tlb_context_demap(dst_pmap); } else { - for (va = src_addr; va < src_addr + len; va += PAGE_SIZE) { + for (va = src_addr; va < src_addr + len; va += PAGE_SIZE) if ((tp = tsb_tte_lookup(src_pmap, va)) != NULL) pmap_copy_tte(src_pmap, dst_pmap, tp, va); - } tlb_range_demap(dst_pmap, src_addr, src_addr + len - 1); } vm_page_unlock_queues(); @@ -1823,10 +1818,9 @@ pmap_page_is_mapped(vm_page_t m) if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) return (FALSE); mtx_assert(&vm_page_queue_mtx, MA_OWNED); - TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { + TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) if ((tp->tte_data & TD_PV) != 0) return (TRUE); - } return (FALSE); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:39:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F15A81065670; Tue, 30 Mar 2010 20:39:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6AD48FC12; Tue, 30 Mar 2010 20:39:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKdljE089147; Tue, 30 Mar 2010 20:39:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKdlNG089145; Tue, 30 Mar 2010 20:39:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302039.o2UKdlNG089145@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205930 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:39:48 -0000 Author: marius Date: Tue Mar 30 20:39:47 2010 New Revision: 205930 URL: http://svn.freebsd.org/changeset/base/205930 Log: MFC: r203843 Resurrect nexusvar.h from r167307. Added: stable/8/sys/sparc64/include/nexusvar.h - copied unchanged from r203843, head/sys/sparc64/include/nexusvar.h Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Copied: stable/8/sys/sparc64/include/nexusvar.h (from r203843, head/sys/sparc64/include/nexusvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/include/nexusvar.h Tue Mar 30 20:39:47 2010 (r205930, copy of r203843, head/sys/sparc64/include/nexusvar.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2001 by Thomas Moestl . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ + +enum nexus_ivars { + NEXUS_IVAR_NODE, + NEXUS_IVAR_NAME, + NEXUS_IVAR_DEVICE_TYPE, + NEXUS_IVAR_MODEL, + NEXUS_IVAR_REG, + NEXUS_IVAR_NREG, + NEXUS_IVAR_INTERRUPTS, + NEXUS_IVAR_NINTERRUPTS, + NEXUS_IVAR_DMATAG, +}; + +#define NEXUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(nexus, var, NEXUS, ivar, type) + +NEXUS_ACCESSOR(node, NODE, phandle_t) +NEXUS_ACCESSOR(name, NAME, char *) +NEXUS_ACCESSOR(device_type, DEVICE_TYPE, char *) +NEXUS_ACCESSOR(model, MODEL, char *) +NEXUS_ACCESSOR(reg, REG, struct upa_regs *) +NEXUS_ACCESSOR(nreg, NREG, int) +NEXUS_ACCESSOR(interrupts, INTERRUPTS, u_int *) +NEXUS_ACCESSOR(ninterrupts, NINTERRUPTS, int) +NEXUS_ACCESSOR(dmatag, DMATAG, bus_dma_tag_t) + +#undef NEXUS_ACCESSOR + +#endif /* _MACHINE_NEXUSVAR_H_ */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:44:04 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D4FB1065674; Tue, 30 Mar 2010 20:44:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7318FC23; Tue, 30 Mar 2010 20:44:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKi44l090226; Tue, 30 Mar 2010 20:44:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKi4fr090223; Tue, 30 Mar 2010 20:44:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302044.o2UKi4fr090223@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205933 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:44:04 -0000 Author: marius Date: Tue Mar 30 20:44:04 2010 New Revision: 205933 URL: http://svn.freebsd.org/changeset/base/205933 Log: MFC: r203845 - Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores to the exclusion lists as the CPU nodes aren't handled as regular devices either. Also add the pseudo-devices found in Sun Fire V1280. - Allow nexus_attach() and nexus_alloc_resource() to be used by drivers derived from nexus(4) for subordinate busses. - Don't add the zero-sized memory resources of glue devices to the resource lists. Modified: stable/8/sys/sparc64/include/nexusvar.h stable/8/sys/sparc64/sparc64/nexus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/nexusvar.h ============================================================================== --- stable/8/sys/sparc64/include/nexusvar.h Tue Mar 30 20:39:57 2010 (r205932) +++ stable/8/sys/sparc64/include/nexusvar.h Tue Mar 30 20:44:04 2010 (r205933) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 by Thomas Moestl . + * Copyright (c) 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,48 +11,24 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _MACHINE_NEXUSVAR_H_ -#define _MACHINE_NEXUSVAR_H_ +#define _MACHINE_NEXUSVAR_H_ -enum nexus_ivars { - NEXUS_IVAR_NODE, - NEXUS_IVAR_NAME, - NEXUS_IVAR_DEVICE_TYPE, - NEXUS_IVAR_MODEL, - NEXUS_IVAR_REG, - NEXUS_IVAR_NREG, - NEXUS_IVAR_INTERRUPTS, - NEXUS_IVAR_NINTERRUPTS, - NEXUS_IVAR_DMATAG, -}; - -#define NEXUS_ACCESSOR(var, ivar, type) \ - __BUS_ACCESSOR(nexus, var, NEXUS, ivar, type) - -NEXUS_ACCESSOR(node, NODE, phandle_t) -NEXUS_ACCESSOR(name, NAME, char *) -NEXUS_ACCESSOR(device_type, DEVICE_TYPE, char *) -NEXUS_ACCESSOR(model, MODEL, char *) -NEXUS_ACCESSOR(reg, REG, struct upa_regs *) -NEXUS_ACCESSOR(nreg, NREG, int) -NEXUS_ACCESSOR(interrupts, INTERRUPTS, u_int *) -NEXUS_ACCESSOR(ninterrupts, NINTERRUPTS, int) -NEXUS_ACCESSOR(dmatag, DMATAG, bus_dma_tag_t) - -#undef NEXUS_ACCESSOR +DECLARE_CLASS(nexus_driver); #endif /* _MACHINE_NEXUSVAR_H_ */ Modified: stable/8/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/nexus.c Tue Mar 30 20:39:57 2010 (r205932) +++ stable/8/sys/sparc64/sparc64/nexus.c Tue Mar 30 20:44:04 2010 (r205933) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -154,17 +155,22 @@ static const char *const nexus_excl_name "aliases", "associations", "chosen", + "cmp", "counter-timer", /* No separate device; handled by psycho/sbus */ + "failsafe", "memory", "openprom", "options", "packages", "rsc", + "sgcn", + "todsg", "virtual-memory", NULL }; static const char *const nexus_excl_type[] = { + "core", "cpu", NULL }; @@ -206,20 +212,24 @@ nexus_attach(device_t dev) device_t cdev; phandle_t node; - node = OF_peer(0); - if (node == -1) - panic("%s: OF_peer failed.", __func__); - - sc = device_get_softc(dev); - sc->sc_intr_rman.rm_type = RMAN_ARRAY; - sc->sc_intr_rman.rm_descr = "Interrupts"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "Device Memory"; - if (rman_init(&sc->sc_intr_rman) != 0 || - rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_intr_rman, 0, IV_MAX - 1) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) - panic("%s: failed to set up rmans.", __func__); + if (strcmp(device_get_name(device_get_parent(dev)), "root") == 0) { + node = OF_peer(0); + if (node == -1) + panic("%s: OF_peer failed.", __func__); + + sc = device_get_softc(dev); + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "Interrupts"; + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "Device Memory"; + if (rman_init(&sc->sc_intr_rman) != 0 || + rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_intr_rman, 0, + IV_MAX - 1) != 0 || + rman_manage_region(&sc->sc_mem_rman, 0ULL, ~0ULL) != 0) + panic("%s: failed to set up rmans.", __func__); + } else + node = ofw_bus_get_node(dev); /* * Allow devices to identify. @@ -347,12 +357,16 @@ nexus_alloc_resource(device_t bus, devic struct rman *rm; struct resource *rv; struct resource_list_entry *rle; + device_t nexus; int isdefault, needactivate, passthrough; isdefault = (start == 0UL && end == ~0UL); needactivate = flags & RF_ACTIVE; passthrough = (device_get_parent(child) != bus); - sc = device_get_softc(bus); + nexus = bus; + while (strcmp(device_get_name(device_get_parent(nexus)), "root") != 0) + nexus = device_get_parent(nexus); + sc = device_get_softc(nexus); rle = NULL; if (!passthrough) { @@ -498,8 +512,10 @@ nexus_setup_dinfo(device_t dev, phandle_ for (i = 0; i < nreg; i++) { phys = NEXUS_REG_PHYS(®[i]); size = NEXUS_REG_SIZE(®[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, phys, - phys + size - 1, size); + /* Skip the dummy reg property of glue devices like ssm(4). */ + if (size != 0) + resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, + phys, phys + size - 1, size); } free(reg, M_OFWPROP); From owner-svn-src-stable-8@FreeBSD.ORG Tue Mar 30 20:46:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FD5B106564A; Tue, 30 Mar 2010 20:46:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EFAB8FC16; Tue, 30 Mar 2010 20:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2UKkAJQ090837; Tue, 30 Mar 2010 20:46:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2UKkAq7090835; Tue, 30 Mar 2010 20:46:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003302046.o2UKkAq7090835@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Mar 2010 20:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205936 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 20:46:10 -0000 Author: marius Date: Tue Mar 30 20:46:10 2010 New Revision: 205936 URL: http://svn.freebsd.org/changeset/base/205936 Log: MFC: r203846 Predict KASSERTs to be true. Modified: stable/8/sys/sparc64/include/asmacros.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/asmacros.h ============================================================================== --- stable/8/sys/sparc64/include/asmacros.h Tue Mar 30 20:46:09 2010 (r205935) +++ stable/8/sys/sparc64/include/asmacros.h Tue Mar 30 20:46:10 2010 (r205936) @@ -107,7 +107,7 @@ #ifdef INVARIANTS #define KASSERT(r1, msg) \ - brnz r1, 8f ; \ + brnz,pt r1, 8f ; \ nop ; \ PANIC(msg, r1) ; \ 8: From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 00:41:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7F71065673; Wed, 31 Mar 2010 00:41:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3428FC18; Wed, 31 Mar 2010 00:41:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V0fX1N043464; Wed, 31 Mar 2010 00:41:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V0fXCP043462; Wed, 31 Mar 2010 00:41:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201003310041.o2V0fXCP043462@svn.freebsd.org> From: Xin LI Date: Wed, 31 Mar 2010 00:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205951 - stable/8/sys/dev/uart X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 00:41:33 -0000 Author: delphij Date: Wed Mar 31 00:41:32 2010 New Revision: 205951 URL: http://svn.freebsd.org/changeset/base/205951 Log: MFC r204533: Add PCI ID for MCS9901. Submitted by: gcooper PR: kern/144397 Modified: stable/8/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Wed Mar 31 00:27:49 2010 (r205950) +++ stable/8/sys/dev/uart/uart_bus_pci.c Wed Mar 31 00:41:32 2010 (r205951) @@ -112,6 +112,8 @@ static struct pci_id pci_ns8250_ids[] = { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, +{ 0x9710, 0x9901, 0xa000, 0x1000, + "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 01:51:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C8131065674; Wed, 31 Mar 2010 01:51:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC998FC12; Wed, 31 Mar 2010 01:51:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V1p8eb058663; Wed, 31 Mar 2010 01:51:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V1p8QW058661; Wed, 31 Mar 2010 01:51:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003310151.o2V1p8QW058661@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 31 Mar 2010 01:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205953 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 01:51:09 -0000 Author: luigi Date: Wed Mar 31 01:51:08 2010 New Revision: 205953 URL: http://svn.freebsd.org/changeset/base/205953 Log: A last-minute change in the previous commit broke rule deletion, so i am fixing it, this time with a more detailed description of what the code is supposed to do. Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Wed Mar 31 00:42:18 2010 (r205952) +++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Wed Mar 31 01:51:08 2010 (r205953) @@ -239,12 +239,12 @@ ipfw_reap_rules(struct ip_fw *head) * The argument is an u_int32_t. The low 16 bit are the rule or set number, * the next 8 bits are the new set, the top 8 bits are the command: * - * 0 delete rules with given number - * 1 delete rules with given set number - * 2 move rules with given number to new set - * 3 move rules with given set number to new set - * 4 swap sets with given numbers - * 5 delete rules with given number and with given set number + * 0 delete rules numbered "rulenum" + * 1 delete rules in set "rulenum" + * 2 move rules "rulenum" to set "new_set" + * 3 move rules from set "rulenum" to set "new_set" + * 4 swap sets "rulenum" and "new_set" + * 5 delete rules "rulenum" and set "new_set" */ static int del_entry(struct ip_fw_chain *chain, u_int32_t arg) @@ -274,7 +274,7 @@ del_entry(struct ip_fw_chain *chain, u_i chain->reap = NULL; /* prepare for deletions */ switch (cmd) { - case 0: /* delete rules number N (N == 0 means all) */ + case 0: /* delete rules "rulenum" (rulenum == 0 matches all) */ case 1: /* delete all rules in set N */ case 5: /* delete rules with number N and set "new_set". */ @@ -287,7 +287,7 @@ del_entry(struct ip_fw_chain *chain, u_i if (cmd == 1) { /* look for a specific set, must scan all */ new_set = rulenum; for (start = -1, i = 0; i < chain->n_rules; i++) { - if (chain->map[i]->set != rulenum) + if (chain->map[i]->set != new_set) continue; if (start < 0) start = i; @@ -321,16 +321,21 @@ del_entry(struct ip_fw_chain *chain, u_i * and then bcopy the final part. * Once we are done we can swap maps and clean up the * deleted rules (unfortunately we need to repeat a - * convoluted test). + * convoluted test). Rules to keep are + * (set == RESVD_SET || !match_set || !match_rule) + * where + * match_set ::= (cmd == 0 || rule->set == new_set) + * match_rule ::= (cmd == 1 || rule->rulenum == rulenum) */ if (start > 0) bcopy(chain->map, map, start * sizeof(struct ip_fw *)); for (i = ofs = start; i < end; i++) { rule = chain->map[i]; - if (rule->set == RESVD_SET || cmd == 0 || - (rule->set == new_set && - (cmd == 1 || rule->rulenum == rulenum))) + if (rule->set == RESVD_SET || + !(cmd == 0 || rule->set == new_set) || + !(cmd == 1 || rule->rulenum == rulenum) ) { map[ofs++] = chain->map[i]; + } } bcopy(chain->map + end, map + ofs, (chain->n_rules - end) * sizeof(struct ip_fw *)); @@ -341,9 +346,9 @@ del_entry(struct ip_fw_chain *chain, u_i int l; rule = map[i]; /* same test as above */ - if (rule->set == RESVD_SET || cmd == 0 || - (rule->set == new_set && - (cmd == 1 || rule->rulenum == rulenum))) + if (rule->set == RESVD_SET || + !(cmd == 0 || rule->set == new_set) || + !(cmd == 1 || rule->rulenum == rulenum) ) continue; l = RULESIZE(rule); From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 02:43:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23F3F106564A; Wed, 31 Mar 2010 02:43:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6398FC18; Wed, 31 Mar 2010 02:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V2hxHh070407; Wed, 31 Mar 2010 02:43:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V2hwa9070387; Wed, 31 Mar 2010 02:43:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003310243.o2V2hwa9070387@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 31 Mar 2010 02:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205956 - in stable/8/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 02:43:59 -0000 Author: marcel Date: Wed Mar 31 02:43:58 2010 New Revision: 205956 URL: http://svn.freebsd.org/changeset/base/205956 Log: MFC rev 198341 and 198342: o Introduce vm_sync_icache() for making the I-cache coherent with the memory or D-cache, depending on the semantics of the platform. vm_sync_icache() is basically a wrapper around pmap_sync_icache(), that translates the vm_map_t argumument to pmap_t. o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc it replaces the pmap_page_executable() function, added to solve the I-cache problem in uiomove_fromphys(). o In proc_rwmem() call vm_sync_icache() when writing to a page that has execute permissions. This assures that when breakpoints are written, the I-cache will be coherent and the process will actually hit the breakpoint. o This also fixes the Book-E PMAP implementation that was missing necessary locking while trying to deal with the I-cache coherency in pmap_enter() (read: mmu_booke_enter_locked). Modified: stable/8/sys/amd64/amd64/pmap.c stable/8/sys/arm/arm/pmap.c stable/8/sys/i386/i386/pmap.c stable/8/sys/i386/xen/pmap.c stable/8/sys/ia64/ia64/pmap.c stable/8/sys/kern/sys_process.c stable/8/sys/mips/mips/pmap.c stable/8/sys/powerpc/aim/mmu_oea.c stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/booke/pmap.c stable/8/sys/powerpc/include/pmap.h stable/8/sys/powerpc/powerpc/mmu_if.m stable/8/sys/powerpc/powerpc/pmap_dispatch.c stable/8/sys/powerpc/powerpc/uio_machdep.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sun4v/sun4v/pmap.c stable/8/sys/vm/pmap.h stable/8/sys/vm/vm_extern.h stable/8/sys/vm/vm_glue.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/amd64/amd64/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -4756,6 +4756,11 @@ if (oldpmap) /* XXX FIXME */ critical_exit(); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/arm/arm/pmap.c ============================================================================== --- stable/8/sys/arm/arm/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/arm/arm/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -2869,14 +2869,14 @@ pmap_kenter_internal(vm_offset_t va, vm_ if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa))) { vm_page_lock_queues(); if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva) { - /* release vm_page lock for pv_entry UMA */ + /* release vm_page lock for pv_entry UMA */ vm_page_unlock_queues(); if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); vm_page_lock_queues(); PMAP_LOCK(pmap_kernel()); pmap_enter_pv(m, pve, pmap_kernel(), va, - PVF_WRITE | PVF_UNMAN); + PVF_WRITE | PVF_UNMAN); pmap_fix_cache(m, pmap_kernel(), va); PMAP_UNLOCK(pmap_kernel()); } else { @@ -4573,6 +4573,12 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/i386/i386/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -4859,6 +4859,11 @@ pmap_activate(struct thread *td) critical_exit(); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/i386/xen/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -4175,6 +4175,11 @@ pmap_activate(struct thread *td) critical_exit(); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/ia64/ia64/pmap.c ============================================================================== --- stable/8/sys/ia64/ia64/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/ia64/ia64/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -2263,6 +2263,33 @@ out: return (prevpm); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ + pmap_t oldpm; + struct ia64_lpte *pte; + vm_offset_t lim; + vm_size_t len; + + sz += va & 31; + va &= ~31; + sz = (sz + 31) & ~31; + + PMAP_LOCK(pm); + oldpm = pmap_switch(pm); + while (sz > 0) { + lim = round_page(va); + len = MIN(lim - va, sz); + pte = pmap_find_vhpt(va); + if (pte != NULL && pmap_present(pte)) + ia64_sync_icache(va, len); + va += len; + sz -= len; + } + pmap_switch(oldpm); + PMAP_UNLOCK(pm); +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/kern/sys_process.c Wed Mar 31 02:43:58 2010 (r205956) @@ -341,6 +341,10 @@ proc_rwmem(struct proc *p, struct uio *u */ error = uiomove_fromphys(&m, page_offset, len, uio); + /* Make the I-cache coherent for breakpoints. */ + if (!error && writing && (out_prot & VM_PROT_EXECUTE)) + vm_sync_icache(map, uva, len); + /* * Release the page. */ Modified: stable/8/sys/mips/mips/pmap.c ============================================================================== --- stable/8/sys/mips/mips/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/mips/mips/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -2903,6 +2903,11 @@ pmap_activate(struct thread *td) critical_exit(); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/aim/mmu_oea.c Wed Mar 31 02:43:58 2010 (r205956) @@ -330,7 +330,7 @@ void moea_unmapdev(mmu_t, vm_offset_t, v vm_offset_t moea_kextract(mmu_t, vm_offset_t); void moea_kenter(mmu_t, vm_offset_t, vm_offset_t); boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); -boolean_t moea_page_executable(mmu_t, vm_page_t); +static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_change_wiring, moea_change_wiring), @@ -357,6 +357,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_remove, moea_remove), MMUMETHOD(mmu_remove_all, moea_remove_all), MMUMETHOD(mmu_remove_write, moea_remove_write), + MMUMETHOD(mmu_sync_icache, moea_sync_icache), MMUMETHOD(mmu_zero_page, moea_zero_page), MMUMETHOD(mmu_zero_page_area, moea_zero_page_area), MMUMETHOD(mmu_zero_page_idle, moea_zero_page_idle), @@ -371,7 +372,6 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_kextract, moea_kextract), MMUMETHOD(mmu_kenter, moea_kenter), MMUMETHOD(mmu_dev_direct_mapped,moea_dev_direct_mapped), - MMUMETHOD(mmu_page_executable, moea_page_executable), { 0, 0 } }; @@ -2361,12 +2361,6 @@ moea_dev_direct_mapped(mmu_t mmu, vm_off return (EFAULT); } -boolean_t -moea_page_executable(mmu_t mmu, vm_page_t pg) -{ - return ((moea_attr_fetch(pg) & PTE_EXEC) == PTE_EXEC); -} - /* * Map a set of physical memory pages into the kernel virtual * address space. Return a pointer to where it is mapped. This @@ -2426,3 +2420,27 @@ moea_unmapdev(mmu_t mmu, vm_offset_t va, kmem_free(kernel_map, base, size); } } + +static void +moea_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) +{ + struct pvo_entry *pvo; + vm_offset_t lim; + vm_paddr_t pa; + vm_size_t len; + + PMAP_LOCK(pm); + while (sz > 0) { + lim = round_page(va); + len = MIN(lim - va, sz); + pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL); + if (pvo != NULL) { + pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) | + (va & ADDR_POFF); + moea_syncicache(pa, len); + } + va += len; + sz -= len; + } + PMAP_UNLOCK(pm); +} Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Wed Mar 31 02:43:58 2010 (r205956) @@ -362,7 +362,7 @@ static boolean_t moea64_query_bit(vm_pag static u_int moea64_clear_bit(vm_page_t, u_int64_t, u_int64_t *); static void moea64_kremove(mmu_t, vm_offset_t); static void moea64_syncicache(pmap_t pmap, vm_offset_t va, - vm_offset_t pa); + vm_offset_t pa, vm_size_t sz); static void tlbia(void); /* @@ -403,7 +403,7 @@ void moea64_unmapdev(mmu_t, vm_offset_t, vm_offset_t moea64_kextract(mmu_t, vm_offset_t); void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t); boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); -boolean_t moea64_page_executable(mmu_t, vm_page_t); +static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea64_bridge_methods[] = { MMUMETHOD(mmu_change_wiring, moea64_change_wiring), @@ -430,6 +430,7 @@ static mmu_method_t moea64_bridge_method MMUMETHOD(mmu_remove, moea64_remove), MMUMETHOD(mmu_remove_all, moea64_remove_all), MMUMETHOD(mmu_remove_write, moea64_remove_write), + MMUMETHOD(mmu_sync_icache, moea64_sync_icache), MMUMETHOD(mmu_zero_page, moea64_zero_page), MMUMETHOD(mmu_zero_page_area, moea64_zero_page_area), MMUMETHOD(mmu_zero_page_idle, moea64_zero_page_idle), @@ -444,7 +445,6 @@ static mmu_method_t moea64_bridge_method MMUMETHOD(mmu_kextract, moea64_kextract), MMUMETHOD(mmu_kenter, moea64_kenter), MMUMETHOD(mmu_dev_direct_mapped,moea64_dev_direct_mapped), - MMUMETHOD(mmu_page_executable, moea64_page_executable), { 0, 0 } }; @@ -1256,12 +1256,12 @@ moea64_enter_locked(pmap_t pmap, vm_offs * mapped executable and cacheable. */ if ((pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { - moea64_syncicache(pmap, va, VM_PAGE_TO_PHYS(m)); + moea64_syncicache(pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); } } static void -moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa) +moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_size_t sz) { /* @@ -1278,16 +1278,16 @@ moea64_syncicache(pmap_t pmap, vm_offset * If PMAP is not bootstrapped, we are likely to be * in real mode. */ - __syncicache((void *)pa,PAGE_SIZE); + __syncicache((void *)pa, sz); } else if (pmap == kernel_pmap) { - __syncicache((void *)va,PAGE_SIZE); + __syncicache((void *)va, sz); } else { /* Use the scratch page to set up a temp mapping */ mtx_lock(&moea64_scratchpage_mtx); moea64_set_scratchpage_pa(1,pa); - __syncicache((void *)moea64_scratchpage_va[1],PAGE_SIZE); + __syncicache((void *)moea64_scratchpage_va[1], sz); mtx_unlock(&moea64_scratchpage_mtx); } @@ -1803,8 +1803,9 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ pvo->pvo_pmap, PVO_VADDR(pvo)); if ((pvo->pvo_pte.lpte.pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { - moea64_syncicache(pm, sva, - pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); + moea64_syncicache(pm, sva, + pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, + PAGE_SIZE); } } UNLOCK_TABLE(); @@ -2431,12 +2432,6 @@ moea64_dev_direct_mapped(mmu_t mmu, vm_o return (error); } -boolean_t -moea64_page_executable(mmu_t mmu, vm_page_t pg) -{ - return (!moea64_query_bit(pg, LPTE_NOEXEC)); -} - /* * Map a set of physical memory pages into the kernel virtual * address space. Return a pointer to where it is mapped. This @@ -2479,3 +2474,26 @@ moea64_unmapdev(mmu_t mmu, vm_offset_t v kmem_free(kernel_map, base, size); } +static void +moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) +{ + struct pvo_entry *pvo; + vm_offset_t lim; + vm_paddr_t pa; + vm_size_t len; + + PMAP_LOCK(pm); + while (sz > 0) { + lim = round_page(va); + len = MIN(lim - va, sz); + pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF, NULL); + if (pvo != NULL) { + pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) | + (va & ADDR_POFF); + moea64_syncicache(pm, va, pa, len); + } + va += len; + sz -= len; + } + PMAP_UNLOCK(pm); +} Modified: stable/8/sys/powerpc/booke/pmap.c ============================================================================== --- stable/8/sys/powerpc/booke/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/booke/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -319,7 +319,8 @@ static vm_offset_t mmu_booke_kextract(mm static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_offset_t); static void mmu_booke_kremove(mmu_t, vm_offset_t); static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); -static boolean_t mmu_booke_page_executable(mmu_t, vm_page_t); +static void mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t, + vm_size_t); static vm_offset_t mmu_booke_dumpsys_map(mmu_t, struct pmap_md *, vm_size_t, vm_size_t *); static void mmu_booke_dumpsys_unmap(mmu_t, struct pmap_md *, @@ -357,6 +358,7 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_remove, mmu_booke_remove), MMUMETHOD(mmu_remove_all, mmu_booke_remove_all), MMUMETHOD(mmu_remove_write, mmu_booke_remove_write), + MMUMETHOD(mmu_sync_icache, mmu_booke_sync_icache), MMUMETHOD(mmu_zero_page, mmu_booke_zero_page), MMUMETHOD(mmu_zero_page_area, mmu_booke_zero_page_area), MMUMETHOD(mmu_zero_page_idle, mmu_booke_zero_page_idle), @@ -370,7 +372,6 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_kenter, mmu_booke_kenter), MMUMETHOD(mmu_kextract, mmu_booke_kextract), /* MMUMETHOD(mmu_kremove, mmu_booke_kremove), */ - MMUMETHOD(mmu_page_executable, mmu_booke_page_executable), MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), /* dumpsys() support */ @@ -1682,21 +1683,6 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t __syncicache((void *)va, PAGE_SIZE); sync = 0; } - - if (sync) { - /* Create a temporary mapping. */ - pmap = PCPU_GET(curpmap); - - va = 0; - pte = pte_find(mmu, pmap, va); - KASSERT(pte == NULL, ("%s:%d", __func__, __LINE__)); - - flags = PTE_SR | PTE_VALID | PTE_UR | PTE_M; - - pte_enter(mmu, pmap, m, va, flags); - __syncicache((void *)va, PAGE_SIZE); - pte_remove(mmu, pmap, va, PTBL_UNHOLD); - } } /* @@ -1991,25 +1977,47 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag vm_page_flag_clear(m, PG_WRITEABLE); } -static boolean_t -mmu_booke_page_executable(mmu_t mmu, vm_page_t m) +static void +mmu_booke_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) { - pv_entry_t pv; pte_t *pte; - boolean_t executable; + pmap_t pmap; + vm_page_t m; + vm_offset_t addr; + vm_paddr_t pa; + int active, valid; + + va = trunc_page(va); + sz = round_page(sz); - executable = FALSE; - TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { - PMAP_LOCK(pv->pv_pmap); - pte = pte_find(mmu, pv->pv_pmap, pv->pv_va); - if (pte != NULL && PTE_ISVALID(pte) && (pte->flags & PTE_UX)) - executable = TRUE; - PMAP_UNLOCK(pv->pv_pmap); - if (executable) - break; + vm_page_lock_queues(); + pmap = PCPU_GET(curpmap); + active = (pm == kernel_pmap || pm == pmap) ? 1 : 0; + while (sz > 0) { + PMAP_LOCK(pm); + pte = pte_find(mmu, pm, va); + valid = (pte != NULL && PTE_ISVALID(pte)) ? 1 : 0; + if (valid) + pa = PTE_PA(pte); + PMAP_UNLOCK(pm); + if (valid) { + if (!active) { + /* Create a mapping in the active pmap. */ + addr = 0; + m = PHYS_TO_VM_PAGE(pa); + PMAP_LOCK(pmap); + pte_enter(mmu, pmap, m, addr, + PTE_SR | PTE_VALID | PTE_UR); + __syncicache((void *)addr, PAGE_SIZE); + pte_remove(mmu, pmap, addr, PTBL_UNHOLD); + PMAP_UNLOCK(pmap); + } else + __syncicache((void *)va, PAGE_SIZE); + } + va += PAGE_SIZE; + sz -= PAGE_SIZE; } - - return (executable); + vm_page_unlock_queues(); } /* Modified: stable/8/sys/powerpc/include/pmap.h ============================================================================== --- stable/8/sys/powerpc/include/pmap.h Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/include/pmap.h Wed Mar 31 02:43:58 2010 (r205956) @@ -171,7 +171,6 @@ void pmap_bootstrap(vm_offset_t, vm_off void pmap_kenter(vm_offset_t va, vm_offset_t pa); void pmap_kremove(vm_offset_t); void *pmap_mapdev(vm_offset_t, vm_size_t); -boolean_t pmap_page_executable(vm_page_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_deactivate(struct thread *); vm_offset_t pmap_kextract(vm_offset_t); Modified: stable/8/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- stable/8/sys/powerpc/powerpc/mmu_if.m Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/powerpc/mmu_if.m Wed Mar 31 02:43:58 2010 (r205956) @@ -789,15 +789,21 @@ METHOD boolean_t dev_direct_mapped { /** - * @brief Evaluate if a physical page has an executable mapping - * - * @param _pg physical page - * - * @retval bool TRUE if a physical mapping exists for the given page. + * @brief Enforce instruction cache coherency. Typically called after a + * region of memory has been modified and before execution of or within + * that region is attempted. Setting breakpoints in a process through + * ptrace(2) is one example of when the instruction cache needs to be + * made coherent. + * + * @param _pm the physical map of the virtual address + * @param _va the virtual address of the modified region + * @param _sz the size of the modified region */ -METHOD boolean_t page_executable { +METHOD void sync_icache { mmu_t _mmu; - vm_page_t _pg; + pmap_t _pm; + vm_offset_t _va; + vm_size_t _sz; }; Modified: stable/8/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- stable/8/sys/powerpc/powerpc/pmap_dispatch.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/powerpc/pmap_dispatch.c Wed Mar 31 02:43:58 2010 (r205956) @@ -457,12 +457,12 @@ pmap_dev_direct_mapped(vm_offset_t pa, v return (MMU_DEV_DIRECT_MAPPED(mmu_obj, pa, size)); } -boolean_t -pmap_page_executable(vm_page_t pg) +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) { - - CTR2(KTR_PMAP, "%s(%p)", __func__, pg); - return (MMU_PAGE_EXECUTABLE(mmu_obj, pg)); + + CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pm, va, sz); + return (MMU_SYNC_ICACHE(mmu_obj, pm, va, sz)); } vm_offset_t Modified: stable/8/sys/powerpc/powerpc/uio_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/uio_machdep.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/powerpc/powerpc/uio_machdep.c Wed Mar 31 02:43:58 2010 (r205956) @@ -107,9 +107,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offs sf_buf_free(sf); goto out; } - if (uio->uio_rw == UIO_WRITE && - pmap_page_executable(m)) - __syncicache(cp, cnt); break; case UIO_SYSSPACE: if (uio->uio_rw == UIO_READ) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -1995,6 +1995,11 @@ pmap_activate(struct thread *td) mtx_unlock_spin(&sched_lock); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/sun4v/sun4v/pmap.c ============================================================================== --- stable/8/sys/sun4v/sun4v/pmap.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/sun4v/sun4v/pmap.c Wed Mar 31 02:43:58 2010 (r205956) @@ -424,6 +424,11 @@ pmap_activate(struct thread *td) critical_exit(); } +void +pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) +{ +} + /* * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. Modified: stable/8/sys/vm/pmap.h ============================================================================== --- stable/8/sys/vm/pmap.h Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/vm/pmap.h Wed Mar 31 02:43:58 2010 (r205956) @@ -133,6 +133,7 @@ void pmap_remove(pmap_t, vm_offset_t, void pmap_remove_all(vm_page_t m); void pmap_remove_pages(pmap_t); void pmap_remove_write(vm_page_t m); +void pmap_sync_icache(pmap_t, vm_offset_t, vm_size_t); void pmap_zero_page(vm_page_t); void pmap_zero_page_area(vm_page_t, int off, int size); void pmap_zero_page_idle(vm_page_t); Modified: stable/8/sys/vm/vm_extern.h ============================================================================== --- stable/8/sys/vm/vm_extern.h Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/vm/vm_extern.h Wed Mar 31 02:43:58 2010 (r205956) @@ -63,6 +63,7 @@ int vm_forkproc(struct thread *, struct void vm_waitproc(struct proc *); int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t); void vm_set_page_size(void); +void vm_sync_icache(vm_map_t, vm_offset_t, vm_size_t); struct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t); struct vmspace *vmspace_fork(struct vmspace *, vm_ooffset_t *); int vmspace_exec(struct proc *, vm_offset_t, vm_offset_t); Modified: stable/8/sys/vm/vm_glue.c ============================================================================== --- stable/8/sys/vm/vm_glue.c Wed Mar 31 02:20:22 2010 (r205955) +++ stable/8/sys/vm/vm_glue.c Wed Mar 31 02:43:58 2010 (r205956) @@ -309,6 +309,13 @@ vm_imgact_unmap_page(struct sf_buf *sf) vm_page_unlock_queues(); } +void +vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset_t sz) +{ + + pmap_sync_icache(map->pmap, va, sz); +} + struct kstack_cache_entry { vm_object_t ksobj; struct kstack_cache_entry *next_ks_entry; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 03:14:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D728C1065676; Wed, 31 Mar 2010 03:14:40 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C573B8FC15; Wed, 31 Mar 2010 03:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V3EeKc077502; Wed, 31 Mar 2010 03:14:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V3EeVG077500; Wed, 31 Mar 2010 03:14:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003310314.o2V3EeVG077500@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 31 Mar 2010 03:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205957 - stable/8/sys/dev/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 03:14:41 -0000 Author: marcel Date: Wed Mar 31 03:14:40 2010 New Revision: 205957 URL: http://svn.freebsd.org/changeset/base/205957 Log: MFC rev 198431: Have the early USB takeover only enabled for i386 and amd64 by default. This also avoids a panic on PowerPC. Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Wed Mar 31 02:43:58 2010 (r205956) +++ stable/8/sys/dev/pci/pci.c Wed Mar 31 03:14:40 2010 (r205957) @@ -274,7 +274,11 @@ TUNABLE_INT("hw.pci.honor_msi_blacklist" SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RD, &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI"); +#if defined(__i386__) || defined(__amd64__) static int pci_usb_takeover = 1; +#else +static int pci_usb_takeover = 0; +#endif TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover); SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RD | CTLFLAG_TUN, &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 03:20:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537E5106566B; Wed, 31 Mar 2010 03:20:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4107D8FC08; Wed, 31 Mar 2010 03:20:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V3KFUk078840; Wed, 31 Mar 2010 03:20:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V3KFlG078836; Wed, 31 Mar 2010 03:20:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003310320.o2V3KFlG078836@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 31 Mar 2010 03:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205958 - stable/8/sys/ia64/ia64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 03:20:15 -0000 Author: marcel Date: Wed Mar 31 03:20:14 2010 New Revision: 205958 URL: http://svn.freebsd.org/changeset/base/205958 Log: MFC revs 199502, 199566 and 199574: Add a seatbelt to the Nested TLB Fault handler to give us a chance to panic when we have an unexpected TLB fault while interrupt collection is disabled. Modified: stable/8/sys/ia64/ia64/db_machdep.c stable/8/sys/ia64/ia64/exception.S stable/8/sys/ia64/ia64/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ia64/ia64/db_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/db_machdep.c Wed Mar 31 03:14:40 2010 (r205957) +++ stable/8/sys/ia64/ia64/db_machdep.c Wed Mar 31 03:20:14 2010 (r205958) @@ -29,7 +29,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "opt_xtrace.h" #include #include Modified: stable/8/sys/ia64/ia64/exception.S ============================================================================== --- stable/8/sys/ia64/ia64/exception.S Wed Mar 31 03:14:40 2010 (r205957) +++ stable/8/sys/ia64/ia64/exception.S Wed Mar 31 03:20:14 2010 (r205958) @@ -28,12 +28,20 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "opt_xtrace.h" #include #include /* + * Nested TLB restart tokens. These are used by the + * nested TLB handler for jumping back to the code + * where the nested TLB was caused. + */ +#define NTLBRT_SAVE 0x12c12c +#define NTLBRT_RESTORE 0x12c12d + +/* * ar.k7 = kernel memory stack * ar.k6 = kernel register stack * ar.k5 = EPC gateway page @@ -140,9 +148,10 @@ ENTRY_NOPROFILE(exception_save, 0) add r31=8,r30 ;; } -{ .mlx +{ .mib mov r22=cr.iip - movl r26=exception_save_restart + addl r29=NTLBRT_SAVE,r0 // 22-bit restart token. + nop 0 ;; } @@ -157,7 +166,7 @@ ENTRY_NOPROFILE(exception_save, 0) * that are currently alive: * r16,r17=arguments * r18=pr, r19=length, r20=unat, r21=rsc, r22=iip, r23=TOS - * r26=restart point + * r29=restart point * r30,r31=trapframe pointers * p14,p15=memory stack switch */ @@ -543,7 +552,7 @@ ENTRY_NOPROFILE(exception_restore, 0) ld8 r21=[r31],24 // rnat mov ar.pfs=r28 ;; - ld8.fill r29=[r30],16 // tp + ld8.fill r26=[r30],16 // tp ld8 r22=[r31],16 // rsc ;; { .mmi @@ -554,21 +563,21 @@ ENTRY_NOPROFILE(exception_restore, 0) } { .mmi ld8.fill r1=[r30],16 // gp - ld8 r25=[r31],16 // ndirty + ld8 r27=[r31],16 // ndirty cmp.le p14,p15=5,r28 ;; } { .mmb - ld8 r26=[r30] // cfm + ld8 r25=[r30] // cfm ld8 r19=[r31] // ip nop 0 ;; } -{ .mib +{ .mii // Switch register stack alloc r30=ar.pfs,0,0,0,0 // discard current frame - shl r31=r25,16 // value for ar.rsc - nop 0 + shl r31=r27,16 // value for ar.rsc +(p15) mov r13=r26 ;; } // The loadrs can fault if the backing store is not currently @@ -579,7 +588,7 @@ ENTRY_NOPROFILE(exception_restore, 0) { .mmi mov ar.rsc=r31 // setup for loadrs mov ar.k7=r16 -(p15) mov r13=r29 + addl r29=NTLBRT_RESTORE,r0 // 22-bit restart token ;; } exception_restore_restart: @@ -610,7 +619,7 @@ exception_restore_restart: } { .mmi mov cr.ipsr=r24 - mov cr.ifs=r26 + mov cr.ifs=r25 mov pr=r18,0x1ffff ;; } @@ -943,7 +952,7 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) } { .mii ld8 r27=[r27] // dir L0 page - extr.u r29=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3 // dir L1 index + extr.u r26=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3 // dir L1 index ;; dep r27=0,r27,61,3 ;; @@ -956,16 +965,16 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) ;; } { .mmi - shladd r27=r29,3,r27 + shladd r27=r26,3,r27 ;; - mov r29=rr[r30] + mov r26=rr[r30] dep r27=0,r27,61,3 ;; } { .mii ld8 r27=[r27] // pte page shl r28=r28,5 - dep r29=0,r29,0,2 + dep r26=0,r26,0,2 ;; } { .mmi @@ -978,28 +987,54 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) { .mmi ld8 r28=[r27] // pte ;; - mov cr.itir=r29 + mov cr.itir=r26 or r28=PTE_DIRTY+PTE_ACCESSED,r28 ;; } -{ .mlx +{ .mmi st8 [r27]=r28 - movl r29=exception_save_restart ;; + addl r26=NTLBRT_SAVE,r0 + addl r27=NTLBRT_RESTORE,r0 } { .mmi itc.d r28 ;; ssm psr.dt - cmp.eq p12,p13=r26,r29 + cmp.eq p12,p0=r29,r26 ;; } -{ .mbb +{ .mib srlz.d + cmp.eq p13,p0=r29,r27 (p12) br.sptk exception_save_restart + ;; +} +{ .mib + nop 0 + nop 0 (p13) br.sptk exception_restore_restart ;; } +{ .mlx + mov r26=ar.bsp + movl r27=kstack + ;; +} +{ .mib + mov r28=sp + addl r27=KSTACK_PAGES*PAGE_SIZE-16,r0 + nop 0 + ;; +} +{ .mmi + mov sp=r27 + ;; + mov r27=ar.bspstore + nop 0 + ;; +} + CALL(trap, 5, r30) IVT_END(Data_Nested_TLB) IVT_ENTRY(Instruction_Key_Miss, 0x1800) Modified: stable/8/sys/ia64/ia64/trap.c ============================================================================== --- stable/8/sys/ia64/ia64/trap.c Wed Mar 31 03:14:40 2010 (r205957) +++ stable/8/sys/ia64/ia64/trap.c Wed Mar 31 03:20:14 2010 (r205958) @@ -414,11 +414,9 @@ trap(int vector, struct trapframe *tf) case IA64_VEC_NESTED_DTLB: /* - * We never call trap() with this vector. We may want to - * do that in the future in case the nested TLB handler - * could not find the translation it needs. In that case - * we could switch to a special (hardwired) stack and - * come here to produce a nice panic(). + * When the nested TLB handler encounters an unexpected + * condition, it'll switch to the backup stack and transfer + * here. All we need to do is panic. */ trap_panic(vector, tf); break; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 05:05:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6AB106566B; Wed, 31 Mar 2010 05:05:28 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76EA28FC1D; Wed, 31 Mar 2010 05:05:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V55Sis002762; Wed, 31 Mar 2010 05:05:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V55S1V002750; Wed, 31 Mar 2010 05:05:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003310505.o2V55S1V002750@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 31 Mar 2010 05:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205960 - in stable/8/sys: cddl/contrib/opensolaris/common/atomic/ia64 conf ia64/conf ia64/ia64 ia64/include ia64/pci modules X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 05:05:28 -0000 Author: marcel Date: Wed Mar 31 05:05:28 2010 New Revision: 205960 URL: http://svn.freebsd.org/changeset/base/205960 Log: MFC rev 199727, 200888, 201031, 202904, 203054, 203106, 203572, 203884, 204183, 204184, 204185, 204425, 204904, 204905, 205172, 205234, 205357, 205428, 205429, 205431, 205432, 205433, 205434, 205435, 205454, 205665, 205713, 205723, 205726 and 205727: Bring ia64 machine-dependent changes from 9-current to 8-stable. Deleted: stable/8/sys/ia64/include/nexusvar.h stable/8/sys/ia64/include/sapicreg.h stable/8/sys/ia64/include/sapicvar.h Modified: stable/8/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S stable/8/sys/conf/files.ia64 stable/8/sys/ia64/conf/GENERIC stable/8/sys/ia64/ia64/autoconf.c stable/8/sys/ia64/ia64/clock.c stable/8/sys/ia64/ia64/context.S stable/8/sys/ia64/ia64/db_machdep.c stable/8/sys/ia64/ia64/exception.S stable/8/sys/ia64/ia64/highfp.c stable/8/sys/ia64/ia64/interrupt.c stable/8/sys/ia64/ia64/locore.S stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/mp_machdep.c stable/8/sys/ia64/ia64/nexus.c stable/8/sys/ia64/ia64/pmap.c stable/8/sys/ia64/ia64/sal.c stable/8/sys/ia64/ia64/sapic.c stable/8/sys/ia64/ia64/support.S stable/8/sys/ia64/ia64/syscall.S stable/8/sys/ia64/ia64/trap.c stable/8/sys/ia64/ia64/vm_machdep.c stable/8/sys/ia64/include/acpica_machdep.h stable/8/sys/ia64/include/clock.h stable/8/sys/ia64/include/cpufunc.h stable/8/sys/ia64/include/frame.h stable/8/sys/ia64/include/intr.h stable/8/sys/ia64/include/intrcnt.h stable/8/sys/ia64/include/mca.h stable/8/sys/ia64/include/pcb.h stable/8/sys/ia64/include/pci_cfgreg.h stable/8/sys/ia64/include/pcpu.h stable/8/sys/ia64/include/smp.h stable/8/sys/ia64/pci/pci_cfgreg.c stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S Wed Mar 31 05:05:28 2010 (r205960) @@ -76,7 +76,7 @@ ENTRY(atomic_or_8_nv, 2) END(atomic_or_8_nv) ENTRY(membar_producer, 0) - mf.a + mf ;; br.ret.sptk rp END(membar_producer) Modified: stable/8/sys/conf/files.ia64 ============================================================================== --- stable/8/sys/conf/files.ia64 Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/conf/files.ia64 Wed Mar 31 05:05:28 2010 (r205960) @@ -45,8 +45,6 @@ contrib/ia64/libuwx/src/uwx_uinfo.c sta contrib/ia64/libuwx/src/uwx_utable.c standard crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb -dev/advansys/adv_isa.c optional adv isa -dev/aic/aic_isa.c optional aic isa dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc dev/atkbdc/atkbdc.c optional atkbdc Modified: stable/8/sys/ia64/conf/GENERIC ============================================================================== --- stable/8/sys/ia64/conf/GENERIC Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/conf/GENERIC Wed Mar 31 05:05:28 2010 (r205960) @@ -20,7 +20,7 @@ # # $FreeBSD$ -cpu ITANIUM +cpu ITANIUM2 ident GENERIC makeoptions DEBUG=-g # Build kernel with debug information. @@ -28,10 +28,12 @@ makeoptions DEBUG=-g # Build kernel with options AUDIT # Security event auditing options CD9660 # ISO 9660 Filesystem options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) -options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options FFS # Berkeley Fast Filesystem +options FLOWTABLE # per-cpu routing cache +options GDB # Support remote GDB options GEOM_LABEL # Provides labelization +options INCLUDE_CONFIG_FILE # Include this file in kernel options INET # InterNETworking options INET6 # IPv6 communications protocols options INVARIANTS # Enable calls of extra sanity checking @@ -41,9 +43,11 @@ options MAC # TrustedBSD MAC Framework options MD_ROOT # MD usable as root device options MSDOSFS # MSDOS Filesystem options NFSCLIENT # Network Filesystem Client -options NFSSERVER # Network Filesystem Server options NFSLOCKD # Network Lock Manager +options NFSSERVER # Network Filesystem Server options NFS_ROOT # NFS usable as root device +options P1003_1B_SEMAPHORES # POSIX-style semaphores +options PREEMPTION # Enable kernel thread preemption options PRINTF_BUFR_SIZE=128 # Printf buffering to limit interspersion options PROCFS # Process filesystem (/proc) options PSEUDOFS # Pseudo-filesystem framework @@ -56,13 +60,10 @@ options STACK # stack(9) support options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options SYSVSHM # SYSV-style shared memory -options P1003_1B_SEMAPHORES # POSIX-style semaphores options UFS_ACL # Support for access control lists options UFS_DIRHASH # Hash-based directory lookup scheme options UFS_GJOURNAL # Enable gjournal-based UFS journaling options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions -options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) -options INCLUDE_CONFIG_FILE # Include this file in kernel # Various "busses" device firewire # FireWire bus code @@ -76,20 +77,25 @@ device ata # ATA controller device atadisk # ATA disk drives device atapicd # ATAPI CDROM drives device atapifd # ATAPI floppy drives +device atapist # ATAPI tape drives device ataraid # ATA RAID drives # SCSI Controllers device ahc # AHA2940 and AIC7xxx devices device ahd # AHA39320/29320 and AIC79xx devices +device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family device mpt # LSI-Logic MPT-Fusion device sym # NCR/Symbios Logic # RAID controllers interfaced to the SCSI subsystem +device amr # AMI MegaRAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID # SCSI peripherals device cd # CD-ROM, DVD-ROM etc. @@ -102,7 +108,6 @@ device ses # Environmental Services (a # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) -device amr # AMI MegaRAID device ida # Compaq Smart RAID device mlx # Mylex DAC960 family @@ -118,34 +123,58 @@ device ums # Mouse # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel PRO/1000 adapter Gigabit Ethernet Card -device le # AMD Am7900 LANCE and Am79C9xx PCnet +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ixgbe # Intel PRO/10GbE PCIE Ethernet Family device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. +device ae # Attansic/Atheros L2 FastEthernet +device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet +device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet -device dc # DEC/Intel 21143 and various workalikes +device et # Agere ET1310 10/100/Gigabit Ethernet +device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device nge # NatSemi DP83820 gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') -device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet +device tx # SMC EtherPower II (83c170 ``EPIC'') +device vge # VIA VT612x gigabit Ethernet device xl # 3Com 3c90x ("Boomerang", "Cyclone") # USB Ethernet device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet device cdce # Generic USB over Ethernet device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet +device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB + +# USB Serial +device uark # Technologies ARK3116 based serial adapters +device ubsa # Belkin F5U103 and compatible serial adapters +device uftdi # For FTDI usb serial adapters +device uipaq # Some WinCE based devices +device uplcom # Prolific PL-2303 serial adapters +device uslcom # SI Labs CP2101/CP2102 serial adapters +device uvisor # Visor and Palm devices +device uvscom # USB serial support for DDI pocket's PHS # FireWire support -#device sbp # SCSI over FireWire (need scbus & da) +device fwip # IP over FireWire (RFC 2734,3146) +device sbp # SCSI over FireWire (need scbus & da) # Various (pseudo) devices device ether # Ethernet support -device vlan # 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop # Network loopback @@ -155,6 +184,7 @@ device puc # Multi I/O cards and multi device random # Entropy device device tun # Packet tunnel. device uart # Serial port (UART) +device vlan # 802.1Q VLAN support device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. Modified: stable/8/sys/ia64/ia64/autoconf.c ============================================================================== --- stable/8/sys/ia64/ia64/autoconf.c Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/autoconf.c Wed Mar 31 05:05:28 2010 (r205960) @@ -39,15 +39,9 @@ #include #include -#include #include - -#include -#include -#include -#include -#include -#include +#include +#include static void configure_first(void *); static void configure(void *); @@ -97,12 +91,9 @@ static void configure_final(void *dummy) { - /* - * Now we're ready to handle (pending) interrupts. - * XXX this is slightly misplaced. - */ - enable_intr(); - cninit_finish(); + + ia64_enable_intr(); + cold = 0; } Modified: stable/8/sys/ia64/ia64/clock.c ============================================================================== --- stable/8/sys/ia64/ia64/clock.c Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/clock.c Wed Mar 31 05:05:28 2010 (r205960) @@ -29,19 +29,42 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include -#include #include #include -#include #include #include +#include +#include #include +#include + +SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); + +static int adjust_edges = 0; +SYSCTL_INT(_debug_clock, OID_AUTO, adjust_edges, CTLFLAG_RD, + &adjust_edges, 0, "Number of times ITC got more than 12.5% behind"); + +static int adjust_excess = 0; +SYSCTL_INT(_debug_clock, OID_AUTO, adjust_excess, CTLFLAG_RD, + &adjust_excess, 0, "Total number of ignored ITC interrupts"); -uint64_t ia64_clock_reload; +static int adjust_lost = 0; +SYSCTL_INT(_debug_clock, OID_AUTO, adjust_lost, CTLFLAG_RD, + &adjust_lost, 0, "Total number of lost ITC interrupts"); + +static int adjust_ticks = 0; +SYSCTL_INT(_debug_clock, OID_AUTO, adjust_ticks, CTLFLAG_RD, + &adjust_ticks, 0, "Total number of ITC interrupts with adjustment"); + +static u_int ia64_clock_xiv; +static uint64_t ia64_clock_reload; #ifndef SMP static timecounter_get_t ia64_get_timecount; @@ -54,26 +77,80 @@ static struct timecounter ia64_timecount "ITC" /* name */ }; -static unsigned +static u_int ia64_get_timecount(struct timecounter* tc) { return ia64_get_itc(); } #endif -void -pcpu_initclock(void) +static u_int +ia64_ih_clock(struct thread *td, u_int xiv, struct trapframe *tf) { + uint64_t adj, clk, itc; + int64_t delta; + int count; + + PCPU_INC(md.stats.pcs_nclks); + + if (PCPU_GET(cpuid) == 0) { + /* + * Clock processing on the BSP. + */ + intrcnt[INTRCNT_CLOCK]++; + + itc = ia64_get_itc(); + + adj = PCPU_GET(md.clockadj); + clk = PCPU_GET(md.clock); + + delta = itc - clk; + count = 0; + while (delta >= ia64_clock_reload) { +#ifdef SMP + ipi_all_but_self(ia64_clock_xiv); +#endif + hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); + if (profprocs != 0) + profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); + statclock(TRAPF_USERMODE(tf)); + delta -= ia64_clock_reload; + clk += ia64_clock_reload; + if (adj != 0) + adjust_ticks++; + count++; + } + ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj); + ia64_srlz_d(); + if (count > 0) { + adjust_lost += count - 1; + if (delta > (ia64_clock_reload >> 3)) { + if (adj == 0) + adjust_edges++; + adj = ia64_clock_reload >> 4; + } else + adj = 0; + } else { + adj = 0; + adjust_excess++; + } + PCPU_SET(md.clock, clk); + PCPU_SET(md.clockadj, adj); + } else { + /* + * Clock processing on the BSP. + */ + hardclock_cpu(TRAPF_USERMODE(tf)); + if (profprocs != 0) + profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); + statclock(TRAPF_USERMODE(tf)); + } - PCPU_SET(md.clockadj, 0); - PCPU_SET(md.clock, ia64_get_itc()); - ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload); - ia64_set_itv(CLOCK_VECTOR); /* highest priority class */ - ia64_srlz_d(); + return (0); } /* - * Start the real-time and statistics clocks. We use cr.itc and cr.itm + * Start the real-time and statistics clocks. We use ar.itc and cr.itm * to implement a 1000hz clock. */ void @@ -81,6 +158,11 @@ cpu_initclocks() { u_long itc_freq; + ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI, + ia64_ih_clock); + if (ia64_clock_xiv == 0) + panic("No XIV for clock interrupts"); + itc_freq = (u_long)ia64_itc_freq() * 1000000ul; stathz = hz; @@ -91,7 +173,11 @@ cpu_initclocks() tc_init(&ia64_timecounter); #endif - pcpu_initclock(); + PCPU_SET(md.clockadj, 0); + PCPU_SET(md.clock, ia64_get_itc()); + ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload); + ia64_set_itv(ia64_clock_xiv); + ia64_srlz_d(); } void Modified: stable/8/sys/ia64/ia64/context.S ============================================================================== --- stable/8/sys/ia64/ia64/context.S Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/context.S Wed Mar 31 05:05:28 2010 (r205960) @@ -86,18 +86,18 @@ ENTRY(restorectx, 1) { .mmi ld8.fill r6=[r14],16 // r6 ld8.fill r7=[r15],16 // r7 - nop 1 + nop 0 ;; } { .mmi mov ar.unat=r16 mov ar.rsc=3 - nop 2 + nop 0 } { .mmi ld8 r17=[r14],16 // b1 ld8 r18=[r15],16 // b2 - nop 3 + nop 0 ;; } { .mmi @@ -286,7 +286,7 @@ ENTRY(swapctx, 2) (p15) br.ret.sptk rp ;; } -{ .mfb +{ .mib mov r32=r33 nop 0 br.sptk restorectx @@ -338,10 +338,10 @@ ENTRY(save_callee_saved, 1) mov r17=b5 ;; } -{ .mfi +{ .mii st8 [r14]=r17,16 // b5 - nop 0 mov r16=ar.lc + nop 0 ;; } { .mmb @@ -363,13 +363,13 @@ ENTRY(restore_callee_saved, 1) add r31=-8,r32 ;; } -{ .mmb +{ .mmi ld8.fill r4=[r31],16 // r4 ld8.fill r5=[r32],16 // r5 nop 0 ;; } -{ .mmb +{ .mmi ld8.fill r6=[r31],16 // r6 ld8.fill r7=[r32],16 // r7 nop 0 Modified: stable/8/sys/ia64/ia64/db_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/db_machdep.c Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/db_machdep.c Wed Mar 31 05:05:28 2010 (r205960) @@ -577,6 +577,13 @@ db_write_bytes(vm_offset_t addr, size_t void db_show_mdpcpu(struct pcpu *pc) { + struct pcpu_md *md = &pc->pc_md; + + db_printf("MD: vhpt = %#lx\n", md->vhpt); + db_printf("MD: lid = %#lx\n", md->lid); + db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); + db_printf("MD: stats = %p\n", &md->stats); + db_printf("MD: pmap = %p\n", md->current_pmap); } void Modified: stable/8/sys/ia64/ia64/exception.S ============================================================================== --- stable/8/sys/ia64/ia64/exception.S Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/exception.S Wed Mar 31 05:05:28 2010 (r205960) @@ -89,10 +89,10 @@ xhead: data8 xtrace addl r29=1024*5*8,r0 ;; \ (p15) sub r27=r28,r29 ;; \ } ; \ -{ .mib ; \ +{ .mmi ; \ st8 [r28]=r27 ; \ - mov pr=r25,0x1ffff ; \ - nop 0 ;; \ + nop 0 ; \ + mov pr=r25,0x1ffff ;; \ } #else @@ -148,10 +148,10 @@ ENTRY_NOPROFILE(exception_save, 0) add r31=8,r30 ;; } -{ .mib +{ .mmi mov r22=cr.iip - addl r29=NTLBRT_SAVE,r0 // 22-bit restart token. nop 0 + addl r29=NTLBRT_SAVE,r0 // 22-bit restart token. ;; } @@ -235,7 +235,7 @@ exception_save_restart: nop 0 ;; } -{ .mmb +{ .mmi (p13) mov ar.rnat=r19 mov r18=ar.bsp nop 0 @@ -248,7 +248,7 @@ exception_save_restart: ;; } // r19=ifs, r22=iip -{ .mmb +{ .mmi st8 [r31]=r18,16 // ndirty st8 [r30]=r19,16 // cfm nop 0 @@ -260,7 +260,7 @@ exception_save_restart: add r29=16,r30 ;; } -{ .mmb +{ .mmi st8 [r30]=r17,24 // ifa st8 [r31]=r18,24 // isr nop 0 @@ -407,7 +407,7 @@ exception_save_restart: movl gp=__gp ;; } -{ .mfb +{ .mib srlz.d nop 0 br.sptk b7 @@ -567,7 +567,7 @@ ENTRY_NOPROFILE(exception_restore, 0) cmp.le p14,p15=5,r28 ;; } -{ .mmb +{ .mmi ld8 r25=[r30] // cfm ld8 r19=[r31] // ip nop 0 @@ -606,13 +606,13 @@ exception_restore_restart: dep r31=0,r31,0,13 // 8KB aligned ;; } -{ .mmb +{ .mmi mov ar.k6=r31 mov ar.rnat=r21 nop 0 ;; } -{ .mmb +{ .mmi mov ar.unat=r17 mov cr.iip=r19 nop 0 @@ -656,7 +656,7 @@ END(exception_restore) add out1=16,sp ; \ br.call.sptk rp=_func_ ;; \ } ; \ -{ .mfb ; \ +{ .mib ; \ nop 0 ; \ nop 0 ; \ br.sptk exception_restore ;; \ @@ -1021,10 +1021,10 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) movl r27=kstack ;; } -{ .mib +{ .mmi mov r28=sp - addl r27=KSTACK_PAGES*PAGE_SIZE-16,r0 nop 0 + addl r27=KSTACK_PAGES*PAGE_SIZE-16,r0 ;; } { .mmi @@ -1287,13 +1287,13 @@ IVT_ENTRY(Break_Instruction, 0x2c00) (p11) srlz.d add out1=16,sp } -{ .mfb +{ .mib nop 0 nop 0 br.call.sptk rp=trap ;; } -{ .mfb +{ .mib nop 0 nop 0 br.sptk exception_restore @@ -1303,24 +1303,24 @@ IVT_END(Break_Instruction) IVT_ENTRY(External_Interrupt, 0x3000) { .mib - mov r17=cr.ivr // Put the vector in the trap frame. + mov r17=ar.itc // Put the ITC in the trapframe. mov r16=ip br.sptk exception_save ;; } -{ .mfb +{ .mmi alloc r15=ar.pfs,0,0,1,0 nop 0 nop 0 ;; } -{ .mfb +{ .mib add out0=16,sp nop 0 - br.call.sptk rp=interrupt + br.call.sptk rp=ia64_handle_intr ;; } -{ .mfb +{ .mib nop 0 nop 0 br.sptk exception_restore Modified: stable/8/sys/ia64/ia64/highfp.c ============================================================================== --- stable/8/sys/ia64/ia64/highfp.c Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/highfp.c Wed Mar 31 05:05:28 2010 (r205960) @@ -53,7 +53,7 @@ ia64_highfp_ipi(struct pcpu *cpu) { int error; - ipi_send(cpu, IPI_HIGH_FP); + ipi_send(cpu, ia64_ipi_highfp); error = msleep_spin(&cpu->pc_fpcurthread, &ia64_highfp_mtx, "High FP", 0); return (error); @@ -92,8 +92,6 @@ ia64_highfp_enable(struct thread *td, st pcb = td->td_pcb; mtx_lock_spin(&ia64_highfp_mtx); - KASSERT((tf->tf_special.psr & IA64_PSR_DFH) != 0, - ("(tf->tf_special.psr & IA64_PSR_DFH) == 0")); cpu = pcb->pcb_fpcpu; #ifdef SMP if (cpu != NULL && cpu != pcpup) { Modified: stable/8/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/8/sys/ia64/ia64/interrupt.c Wed Mar 31 03:58:57 2010 (r205959) +++ stable/8/sys/ia64/ia64/interrupt.c Wed Mar 31 05:05:28 2010 (r205960) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -52,246 +53,141 @@ #include #include -#include #include #include #include #include +#include #include #include #include -#include #include -#ifdef EVCNT_COUNTERS -struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */ -#else -#include -#include -#endif - #ifdef DDB #include #endif -static void ia64_dispatch_intr(void *, u_int); - -static void -dummy_perf(unsigned long vector, struct trapframe *tf) -{ - printf("performance interrupt!\n"); -} - -void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf; - -SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); - -static int adjust_edges = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_edges, CTLFLAG_RD, - &adjust_edges, 0, "Number of times ITC got more than 12.5% behind"); +struct ia64_intr { + struct intr_event *event; /* interrupt event */ + volatile long *cntp; /* interrupt counter */ + struct sapic *sapic; + u_int irq; +}; -static int adjust_excess = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_excess, CTLFLAG_RD, - &adjust_excess, 0, "Total number of ignored ITC interrupts"); +ia64_ihtype *ia64_handler[IA64_NXIVS]; -static int adjust_lost = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_lost, CTLFLAG_RD, - &adjust_lost, 0, "Total number of lost ITC interrupts"); +static enum ia64_xiv_use ia64_xiv[IA64_NXIVS]; +static struct ia64_intr *ia64_intrs[IA64_NXIVS]; -static int adjust_ticks = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_ticks, CTLFLAG_RD, - &adjust_ticks, 0, "Total number of ITC interrupts with adjustment"); +static ia64_ihtype ia64_ih_invalid; +static ia64_ihtype ia64_ih_irq; void -interrupt(struct trapframe *tf) +ia64_xiv_init(void) { - struct thread *td; - uint64_t adj, clk, itc; - int64_t delta; - u_int vector; - int count; - uint8_t inta; + u_int xiv; - ia64_set_fpsr(IA64_FPSR_DEFAULT); + for (xiv = 0; xiv < IA64_NXIVS; xiv++) { + ia64_handler[xiv] = ia64_ih_invalid; + ia64_xiv[xiv] = IA64_XIV_FREE; + ia64_intrs[xiv] = NULL; + } + (void)ia64_xiv_reserve(15, IA64_XIV_ARCH, NULL); +} - td = curthread; +int +ia64_xiv_free(u_int xiv, enum ia64_xiv_use what) +{ - PCPU_INC(cnt.v_intr); + if (xiv >= IA64_NXIVS) + return (EINVAL); + if (what == IA64_XIV_FREE || what == IA64_XIV_ARCH) + return (EINVAL); + if (ia64_xiv[xiv] != what) + return (ENXIO); + ia64_xiv[xiv] = IA64_XIV_FREE; + ia64_handler[xiv] = ia64_ih_invalid; + return (0); +} - vector = tf->tf_special.ifa; +int +ia64_xiv_reserve(u_int xiv, enum ia64_xiv_use what, ia64_ihtype ih) +{ - next: - /* - * Handle ExtINT interrupts by generating an INTA cycle to - * read the vector. - * IPI_STOP_HARD is mapped to IPI_STOP so it is not necessary - * to add it to this switch-like construct. - */ - if (vector == 0) { - PCPU_INC(md.stats.pcs_nextints); - inta = ia64_ld1(&ia64_pib->ib_inta); - if (inta == 15) { - PCPU_INC(md.stats.pcs_nstrays); - __asm __volatile("mov cr.eoi = r0;; srlz.d"); - goto stray; - } - vector = (int)inta; - } else if (vector == 15) { - PCPU_INC(md.stats.pcs_nstrays); - goto stray; - } + if (xiv >= IA64_NXIVS) + return (EINVAL); + if (what == IA64_XIV_FREE) + return (EINVAL); + if (ia64_xiv[xiv] != IA64_XIV_FREE) + return (EBUSY); + ia64_xiv[xiv] = what; + ia64_handler[xiv] = (ih == NULL) ? ia64_ih_invalid: ih; + if (bootverbose) + printf("XIV %u: use=%u, IH=%p\n", xiv, what, ih); + return (0); +} - if (vector == CLOCK_VECTOR) {/* clock interrupt */ - /* CTR0(KTR_INTR, "clock interrupt"); */ +u_int +ia64_xiv_alloc(u_int prio, enum ia64_xiv_use what, ia64_ihtype ih) +{ + u_int hwprio; + u_int xiv0, xiv; - itc = ia64_get_itc(); + hwprio = prio >> 2; + if (hwprio > IA64_MAX_HWPRIO) + hwprio = IA64_MAX_HWPRIO; - PCPU_INC(md.stats.pcs_nclks); -#ifdef EVCNT_COUNTERS - clock_intr_evcnt.ev_count++; -#else - intrcnt[INTRCNT_CLOCK]++; -#endif + xiv0 = IA64_NXIVS - (hwprio + 1) * 16; - critical_enter(); + KASSERT(xiv0 >= IA64_MIN_XIV, ("%s: min XIV", __func__)); + KASSERT(xiv0 < IA64_NXIVS, ("%s: max XIV", __func__)); - adj = PCPU_GET(md.clockadj); - clk = PCPU_GET(md.clock); - delta = itc - clk; - count = 0; - while (delta >= ia64_clock_reload) { - /* Only the BSP runs the real clock */ - if (PCPU_GET(cpuid) == 0) - hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - else - hardclock_cpu(TRAPF_USERMODE(tf)); - if (profprocs != 0) - profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - statclock(TRAPF_USERMODE(tf)); - delta -= ia64_clock_reload; - clk += ia64_clock_reload; - if (adj != 0) - adjust_ticks++; - count++; - } - ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj); - if (count > 0) { - adjust_lost += count - 1; - if (delta > (ia64_clock_reload >> 3)) { - if (adj == 0) - adjust_edges++; - adj = ia64_clock_reload >> 4; - } else - adj = 0; - } else { - adj = 0; - adjust_excess++; - } - PCPU_SET(md.clock, clk); - PCPU_SET(md.clockadj, adj); - critical_exit(); - ia64_srlz_d(); + xiv = xiv0; + while (xiv < IA64_NXIVS && ia64_xiv_reserve(xiv, what, ih)) + xiv++; -#ifdef SMP - } else if (vector == ipi_vector[IPI_AST]) { - PCPU_INC(md.stats.pcs_nasts); - CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid)); - } else if (vector == ipi_vector[IPI_HIGH_FP]) { - PCPU_INC(md.stats.pcs_nhighfps); - ia64_highfp_save_ipi(); - } else if (vector == ipi_vector[IPI_RENDEZVOUS]) { - PCPU_INC(md.stats.pcs_nrdvs); - CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid)); - enable_intr(); - smp_rendezvous_action(); - disable_intr(); - } else if (vector == ipi_vector[IPI_STOP]) { - PCPU_INC(md.stats.pcs_nstops); - cpumask_t mybit = PCPU_GET(cpumask); - - savectx(PCPU_PTR(md.pcb)); - atomic_set_int(&stopped_cpus, mybit); - while ((started_cpus & mybit) == 0) - cpu_spinwait(); - atomic_clear_int(&started_cpus, mybit); - atomic_clear_int(&stopped_cpus, mybit); - } else if (vector == ipi_vector[IPI_PREEMPT]) { - PCPU_INC(md.stats.pcs_npreempts); - CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); - __asm __volatile("mov cr.eoi = r0;; srlz.d"); - enable_intr(); - sched_preempt(curthread); - disable_intr(); - goto stray; -#endif - } else { - PCPU_INC(md.stats.pcs_nhwints); - atomic_add_int(&td->td_intr_nesting_level, 1); - ia64_dispatch_intr(tf, vector); - atomic_subtract_int(&td->td_intr_nesting_level, 1); - } + if (xiv < IA64_NXIVS) + return (xiv); - __asm __volatile("mov cr.eoi = r0;; srlz.d"); - vector = ia64_get_ivr(); - if (vector != 15) - goto next; + xiv = xiv0; + while (xiv >= IA64_MIN_XIV && ia64_xiv_reserve(xiv, what, ih)) + xiv--; -stray: - if (TRAPF_USERMODE(tf)) { - enable_intr(); - userret(td, tf); - mtx_assert(&Giant, MA_NOTOWNED); - do_ast(tf); - } + return ((xiv >= IA64_MIN_XIV) ? xiv : 0); } -/* - * Hardware irqs have vectors starting at this offset. - */ -#define IA64_HARDWARE_IRQ_BASE 0x20 - -struct ia64_intr { - struct intr_event *event; /* interrupt event */ - volatile long *cntp; /* interrupt counter */ - struct sapic *sapic; - u_int irq; -}; - -static struct ia64_intr *ia64_intrs[256]; - static void ia64_intr_eoi(void *arg) { - u_int vector = (uintptr_t)arg; + u_int xiv = (uintptr_t)arg; struct ia64_intr *i; - i = ia64_intrs[vector]; - if (i != NULL) - sapic_eoi(i->sapic, vector); + i = ia64_intrs[xiv]; + KASSERT(i != NULL, ("%s", __func__)); + sapic_eoi(i->sapic, xiv); } static void ia64_intr_mask(void *arg) { - u_int vector = (uintptr_t)arg; + u_int xiv = (uintptr_t)arg; struct ia64_intr *i; - i = ia64_intrs[vector]; - if (i != NULL) { - sapic_mask(i->sapic, i->irq); - sapic_eoi(i->sapic, vector); - } + i = ia64_intrs[xiv]; + KASSERT(i != NULL, ("%s", __func__)); + sapic_mask(i->sapic, i->irq); + sapic_eoi(i->sapic, xiv); } static void ia64_intr_unmask(void *arg) { - u_int vector = (uintptr_t)arg; + u_int xiv = (uintptr_t)arg; struct ia64_intr *i; - i = ia64_intrs[vector]; - if (i != NULL) - sapic_unmask(i->sapic, i->irq); + i = ia64_intrs[xiv]; + KASSERT(i != NULL, ("%s", __func__)); + sapic_unmask(i->sapic, i->irq); } int @@ -301,57 +197,79 @@ ia64_setup_intr(const char *name, int ir struct ia64_intr *i; struct sapic *sa; char *intrname; - u_int vector; + u_int prio, xiv; int error; - /* Get the I/O SAPIC that corresponds to the IRQ. */ - sa = sapic_lookup(irq); - if (sa == NULL) + prio = intr_priority(flags); + if (prio > PRI_MAX_ITHD) return (EINVAL); + /* XXX lock */ + + /* Get the I/O SAPIC and XIV that corresponds to the IRQ. */ + sa = sapic_lookup(irq, &xiv); + if (sa == NULL) { + /* XXX unlock */ + return (EINVAL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 05:23:35 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8242A1065670; Wed, 31 Mar 2010 05:23:35 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70AC18FC17; Wed, 31 Mar 2010 05:23:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V5NZZA006810; Wed, 31 Mar 2010 05:23:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V5NZsV006808; Wed, 31 Mar 2010 05:23:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003310523.o2V5NZsV006808@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 31 Mar 2010 05:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205961 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 05:23:35 -0000 Author: marcel Date: Wed Mar 31 05:23:35 2010 New Revision: 205961 URL: http://svn.freebsd.org/changeset/base/205961 Log: , and removed on ia64. Modified: stable/8/ObsoleteFiles.inc Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Wed Mar 31 05:05:28 2010 (r205960) +++ stable/8/ObsoleteFiles.inc Wed Mar 31 05:23:35 2010 (r205961) @@ -14,6 +14,12 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100330: [ia64] Sync with 9-current +.if ${TARGET_ARCH} == "ia64" +OLD_FILES+=usr/include/machine/nexusvar.h +OLD_FILES+=usr/include/machine/sapicreg.h +OLD_FILES+=usr/include/machine/sapicvar.h +.endif # 20100329: gcpio removal OLD_FILES+=usr/bin/gcpio OLD_FILES+=usr/share/info/cpio.info.gz From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 07:10:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C02001065670; Wed, 31 Mar 2010 07:10:40 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE07B8FC12; Wed, 31 Mar 2010 07:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V7Aec7030381; Wed, 31 Mar 2010 07:10:40 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V7Ae14030379; Wed, 31 Mar 2010 07:10:40 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003310710.o2V7Ae14030379@svn.freebsd.org> From: Fabien Thomas Date: Wed, 31 Mar 2010 07:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205965 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 07:10:40 -0000 Author: fabient Date: Wed Mar 31 07:10:40 2010 New Revision: 205965 URL: http://svn.freebsd.org/changeset/base/205965 Log: MFC r205809: Wait for pmc name in the log before displaying data. This will solve an abort in case of low throughput PMCs. Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Wed Mar 31 06:50:25 2010 (r205964) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Wed Mar 31 07:10:40 2010 (r205965) @@ -1049,7 +1049,6 @@ pmcstat_pmcindex_to_name(int pmcin) if (pr->pr_pmcin == pmcin) return pmcstat_string_unintern(pr->pr_pmcname); - err(EX_SOFTWARE, "ERROR: cannot find pmcid name"); return NULL; } @@ -1789,19 +1788,23 @@ static void pmcstat_refresh_top(void) { char pmcname[40]; + const char *s; /* If in pause mode do not refresh display. */ if (pmcstat_pause) return; + /* Wait until PMC pop in the log. */ + s = pmcstat_pmcindex_to_name(pmcstat_pmcinfilter); + if (s == NULL) + return; + /* Format PMC name. */ if (pmcstat_mergepmc) - snprintf(pmcname, sizeof(pmcname), "[%s]", - pmcstat_pmcindex_to_name(pmcstat_pmcinfilter)); + snprintf(pmcname, sizeof(pmcname), "[%s]", s); else snprintf(pmcname, sizeof(pmcname), "%s.%d", - pmcstat_pmcindex_to_name(pmcstat_pmcinfilter), - pmcstat_pmcinfilter); + s, pmcstat_pmcinfilter); PMCSTAT_PRINTBEGIN(); PMCSTAT_PRINTW("PMC: %s Samples: %u processed, %u invalid\n\n", From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 07:49:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC470106564A; Wed, 31 Mar 2010 07:49:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFF208FC14; Wed, 31 Mar 2010 07:49:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V7nxgE039261; Wed, 31 Mar 2010 07:49:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V7nxjW039259; Wed, 31 Mar 2010 07:49:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310749.o2V7nxjW039259@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 07:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205968 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 07:50:00 -0000 Author: mav Date: Wed Mar 31 07:49:59 2010 New Revision: 205968 URL: http://svn.freebsd.org/changeset/base/205968 Log: MFC r205074: Mask disk_idx to avoid panic because of extra bits set. PR: kern/102211 Submitted by: yoichi Modified: stable/8/sys/dev/ata/ata-raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-raid.c ============================================================================== --- stable/8/sys/dev/ata/ata-raid.c Wed Mar 31 07:20:10 2010 (r205967) +++ stable/8/sys/dev/ata/ata-raid.c Wed Mar 31 07:49:59 2010 (r205968) @@ -2544,22 +2544,24 @@ ata_raid_intel_read_meta(device_t dev, s /* clear out any old info */ for (disk = 0; disk < raid->total_disks; disk++) { + u_int disk_idx = map->disk_idx[disk] & 0xffff; + raid->disks[disk].dev = NULL; - bcopy(meta->disk[map->disk_idx[disk]].serial, + bcopy(meta->disk[disk_idx].serial, raid->disks[disk].serial, sizeof(raid->disks[disk].serial)); raid->disks[disk].sectors = - meta->disk[map->disk_idx[disk]].sectors; + meta->disk[disk_idx].sectors; raid->disks[disk].flags = 0; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ONLINE) + if (meta->disk[disk_idx].flags & INTEL_F_ONLINE) raid->disks[disk].flags |= AR_DF_ONLINE; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ASSIGNED) + if (meta->disk[disk_idx].flags & INTEL_F_ASSIGNED) raid->disks[disk].flags |= AR_DF_ASSIGNED; - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_SPARE) { + if (meta->disk[disk_idx].flags & INTEL_F_SPARE) { raid->disks[disk].flags &= ~(AR_DF_ONLINE | AR_DF_ASSIGNED); raid->disks[disk].flags |= AR_DF_SPARE; } - if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_DOWN) + if (meta->disk[disk_idx].flags & INTEL_F_DOWN) raid->disks[disk].flags &= ~AR_DF_ONLINE; } } From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 07:56:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3BD11065670; Wed, 31 Mar 2010 07:56:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77C2F8FC12; Wed, 31 Mar 2010 07:56:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V7uW3Z040841; Wed, 31 Mar 2010 07:56:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V7uWb9040839; Wed, 31 Mar 2010 07:56:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310756.o2V7uWb9040839@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 07:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205970 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 07:56:32 -0000 Author: mav Date: Wed Mar 31 07:56:32 2010 New Revision: 205970 URL: http://svn.freebsd.org/changeset/base/205970 Log: MFC r205422: - Spec tells that CCC interrupt is edge triggered. Acknowledge it as such. - Do not try to enable CCC if it is not supported. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Wed Mar 31 07:52:48 2010 (r205969) +++ stable/8/sys/dev/ahci/ahci.c Wed Mar 31 07:56:32 2010 (r205970) @@ -66,6 +66,7 @@ static void ahci_ch_pm(void *arg); static void ahci_ch_intr_locked(void *data); static void ahci_ch_intr(void *data); static int ahci_ctlr_reset(device_t dev); +static int ahci_ctlr_setup(device_t dev); static void ahci_begin_transaction(device_t dev, union ccb *ccb); static void ahci_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void ahci_execute_transaction(struct ahci_slot *slot); @@ -372,6 +373,9 @@ ahci_attach(device_t dev) ctlr->caps &= ~AHCI_CAP_SPM; if (ctlr->quirks & AHCI_Q_NONCQ) ctlr->caps &= ~AHCI_CAP_SNCQ; + if ((ctlr->caps & AHCI_CAP_CCCS) == 0) + ctlr->ccc = 0; + ahci_ctlr_setup(dev); /* Setup interrupts. */ if (ahci_setup_interrupt(dev)) { bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); @@ -501,6 +505,13 @@ ahci_ctlr_reset(device_t dev) } /* Reenable AHCI mode */ ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE); + return (0); +} + +static int +ahci_ctlr_setup(device_t dev) +{ + struct ahci_controller *ctlr = device_get_softc(dev); /* Clear interrupts */ ATA_OUTL(ctlr->r_mem, AHCI_IS, ATA_INL(ctlr->r_mem, AHCI_IS)); /* Configure CCC */ @@ -543,6 +554,7 @@ ahci_resume(device_t dev) if ((res = ahci_ctlr_reset(dev)) != 0) return (res); + ahci_ctlr_setup(dev); return (bus_generic_resume(dev)); } @@ -609,7 +621,7 @@ ahci_intr(void *data) { struct ahci_controller_irq *irq = data; struct ahci_controller *ctlr = irq->ctlr; - u_int32_t is; + u_int32_t is, ise = 0; void *arg; int unit; @@ -623,9 +635,14 @@ ahci_intr(void *data) unit = irq->r_irq_rid - 1; is = ATA_INL(ctlr->r_mem, AHCI_IS); } + /* CCC interrupt is edge triggered. */ + if (ctlr->ccc) + ise = 1 << ctlr->cccv; /* Some controllers have edge triggered IS. */ if (ctlr->quirks & AHCI_Q_EDGEIS) - ATA_OUTL(ctlr->r_mem, AHCI_IS, is); + ise |= is; + if (ise != 0) + ATA_OUTL(ctlr->r_mem, AHCI_IS, ise); for (; unit < ctlr->channels; unit++) { if ((is & (1 << unit)) != 0 && (arg = ctlr->interrupt[unit].argument)) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 08:02:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF93106568A; Wed, 31 Mar 2010 08:02:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD7168FC24; Wed, 31 Mar 2010 08:02:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V82GeV042242; Wed, 31 Mar 2010 08:02:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V82GTq042240; Wed, 31 Mar 2010 08:02:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310802.o2V82GTq042240@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 08:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205971 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 08:02:17 -0000 Author: mav Date: Wed Mar 31 08:02:16 2010 New Revision: 205971 URL: http://svn.freebsd.org/changeset/base/205971 Log: MFC r205413: Add some more codec IDs. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Wed Mar 31 07:56:32 2010 (r205970) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Wed Mar 31 08:02:16 2010 (r205971) @@ -619,10 +619,14 @@ static const struct { #define HDA_CODEC_ALC267 HDA_CODEC_CONSTRUCT(REALTEK, 0x0267) #define HDA_CODEC_ALC268 HDA_CODEC_CONSTRUCT(REALTEK, 0x0268) #define HDA_CODEC_ALC269 HDA_CODEC_CONSTRUCT(REALTEK, 0x0269) +#define HDA_CODEC_ALC270 HDA_CODEC_CONSTRUCT(REALTEK, 0x0270) #define HDA_CODEC_ALC272 HDA_CODEC_CONSTRUCT(REALTEK, 0x0272) +#define HDA_CODEC_ALC273 HDA_CODEC_CONSTRUCT(REALTEK, 0x0273) +#define HDA_CODEC_ALC275 HDA_CODEC_CONSTRUCT(REALTEK, 0x0275) #define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660) #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) +#define HDA_CODEC_ALC665 HDA_CODEC_CONSTRUCT(REALTEK, 0x0665) #define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861) #define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862) #define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880) @@ -632,6 +636,7 @@ static const struct { #define HDA_CODEC_ALC887 HDA_CODEC_CONSTRUCT(REALTEK, 0x0887) #define HDA_CODEC_ALC888 HDA_CODEC_CONSTRUCT(REALTEK, 0x0888) #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) +#define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Analog Devices */ @@ -735,6 +740,7 @@ static const struct { #define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047) #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) #define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) +#define HDA_CODEC_CX20583 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -805,7 +811,8 @@ static const struct { #define HDA_CODEC_INTELG45_1 HDA_CODEC_CONSTRUCT(INTEL, 0x2801) #define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802) #define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803) -#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) +#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x2804) +#define HDA_CODEC_INTELG45_5 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELQ57 HDA_CODEC_CONSTRUCT(INTEL, 0x0054) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) @@ -821,10 +828,14 @@ static const struct { { HDA_CODEC_ALC267, "Realtek ALC267" }, { HDA_CODEC_ALC268, "Realtek ALC268" }, { HDA_CODEC_ALC269, "Realtek ALC269" }, + { HDA_CODEC_ALC270, "Realtek ALC270" }, { HDA_CODEC_ALC272, "Realtek ALC272" }, + { HDA_CODEC_ALC273, "Realtek ALC273" }, + { HDA_CODEC_ALC275, "Realtek ALC275" }, { HDA_CODEC_ALC660, "Realtek ALC660" }, { HDA_CODEC_ALC662, "Realtek ALC662" }, { HDA_CODEC_ALC663, "Realtek ALC663" }, + { HDA_CODEC_ALC665, "Realtek ALC665" }, { HDA_CODEC_ALC861, "Realtek ALC861" }, { HDA_CODEC_ALC861VD, "Realtek ALC861-VD" }, { HDA_CODEC_ALC880, "Realtek ALC880" }, @@ -834,6 +845,7 @@ static const struct { { HDA_CODEC_ALC887, "Realtek ALC887" }, { HDA_CODEC_ALC888, "Realtek ALC888" }, { HDA_CODEC_ALC889, "Realtek ALC889" }, + { HDA_CODEC_ALC892, "Realtek ALC892" }, { HDA_CODEC_AD1882, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, "Analog Devices AD1883" }, @@ -907,6 +919,7 @@ static const struct { { HDA_CODEC_CX20551, "Conexant CX20551 (Waikiki)" }, { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, + { HDA_CODEC_CX20583, "Conexant CX20583 (Pebble HSF)" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -966,6 +979,7 @@ static const struct { { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" }, + { HDA_CODEC_INTELG45_5, "Intel G45 HDMI" }, { HDA_CODEC_INTELQ57, "Intel Q57 HDMI" }, { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" }, { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" }, From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 08:03:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE72106564A; Wed, 31 Mar 2010 08:03:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE3818FC0C; Wed, 31 Mar 2010 08:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V83nR6042613; Wed, 31 Mar 2010 08:03:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V83nrN042611; Wed, 31 Mar 2010 08:03:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310803.o2V83nrN042611@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 08:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205972 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 08:03:50 -0000 Author: mav Date: Wed Mar 31 08:03:49 2010 New Revision: 205972 URL: http://svn.freebsd.org/changeset/base/205972 Log: MFC r205734: Fix lock leakage. PR: kern/145081 Modified: stable/8/sys/dev/sound/pcm/dsp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/8/sys/dev/sound/pcm/dsp.c Wed Mar 31 08:02:16 2010 (r205971) +++ stable/8/sys/dev/sound/pcm/dsp.c Wed Mar 31 08:03:49 2010 (r205972) @@ -1071,6 +1071,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd if (IOCGROUP(cmd) == 'M') { if (cmd == OSS_GETVERSION) { *arg_i = SOUND_VERSION; + PCM_GIANT_EXIT(d); return (0); } ret = dsp_ioctl_channel(i_dev, PCM_VOLCH(i_dev), cmd, arg); From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 08:12:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0312106566B; Wed, 31 Mar 2010 08:12:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE03D8FC20; Wed, 31 Mar 2010 08:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V8CMPP044641; Wed, 31 Mar 2010 08:12:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V8CMQP044639; Wed, 31 Mar 2010 08:12:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310812.o2V8CMQP044639@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 08:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205973 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 08:12:22 -0000 Author: mav Date: Wed Mar 31 08:12:22 2010 New Revision: 205973 URL: http://svn.freebsd.org/changeset/base/205973 Log: MFC r204655: Add some more supported controllers. Crosslink with CAM ATA man pages. Modified: stable/8/share/man/man4/ata.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ata.4 ============================================================================== --- stable/8/share/man/man4/ata.4 Wed Mar 31 08:03:49 2010 (r205972) +++ stable/8/share/man/man4/ata.4 Wed Mar 31 08:12:22 2010 (r205973) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2009 +.Dd March 3, 2010 .Dt ATA 4 .Os .Sh NAME @@ -81,6 +81,13 @@ To support ATAPI floppy drives: To support ATAPI tape drives: .Cd device atapist .Pp +To turn +.Xr ata 4 +subsystem controller drivers into cam(4) interface modules (disables all native +.Xr ata 4 +APIs and periperal drivers): +.Cd options ATA_CAM +.Pp The following tunables are settable from the loader: .Bl -ohang .It Va hw.ata.ata_dma @@ -125,7 +132,7 @@ The currently supported ATA/SATA control .It Acard: ATP850P, ATP860A, ATP860R, ATP865A, ATP865R. .It ALI: -M5229, M5281, M5287, M5288, M5289. +M5228, M5229, M5281, M5283, M5287, M5288, M5289. .It AMD: AMD756, AMD766, AMD768, AMD8111, CS5536. .It ATI: @@ -139,7 +146,8 @@ Cyrix 5530. .It HighPoint: HPT302, HPT366, HPT368, HPT370, HPT371, HPT372, HPT372N, HPT374. .It Intel: -6300ESB, 31244, PIIX, PIIX3, PIIX4, ESB2, ICH, ICH0, ICH2, ICH3, ICH4, ICH5, ICH6, ICH7, ICH8, ICH9, ICH10. +6300ESB, 31244, PIIX, PIIX3, PIIX4, ESB2, ICH, ICH0, ICH2, ICH3, ICH4, ICH5, +ICH6, ICH7, ICH8, ICH9, ICH10, SCH, PCH. .It ITE: IT8211F, IT8212F, IT8213F. .It JMicron: @@ -163,7 +171,9 @@ SiI0680, SiI3112, SiI3114, SiI3124, SiI3 .It SiS: SIS180, SIS181, SIS182, SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630, SIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962, SIS963, SIS964, SIS965. .It VIA: -VT6410, VT6420, VT6421, VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686, VT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237, VT8237A, VT8237S, VT8251. +VT6410, VT6420, VT6421, VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686, +VT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237, +VT8237A, VT8237S, VT8251, CX700, VX800, VX855. .El .Pp Unknown ATA chipsets are supported in PIO modes, and if the standard @@ -246,9 +256,12 @@ and not depend on attach order. .Pp Native Command Queuing (NCQ) on SATA drives is not yet supported. .Sh SEE ALSO +.Xr ahci 4 , +.Xr cam 4 , .Xr ataraid 4 , .Xr atacontrol 8 , -.Xr burncd 8 +.Xr burncd 8 , +.Xr siis 4 .Sh HISTORY The .Nm From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 08:14:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E0F81065672; Wed, 31 Mar 2010 08:14:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2768FC1B; Wed, 31 Mar 2010 08:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V8E7lp045076; Wed, 31 Mar 2010 08:14:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V8E7SO045074; Wed, 31 Mar 2010 08:14:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310814.o2V8E7SO045074@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 08:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205974 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 08:14:07 -0000 Author: mav Date: Wed Mar 31 08:14:07 2010 New Revision: 205974 URL: http://svn.freebsd.org/changeset/base/205974 Log: MFC r204704: Reflect added CAM ATA support. Modified: stable/8/share/man/man4/scsi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/scsi.4 ============================================================================== --- stable/8/share/man/man4/scsi.4 Wed Mar 31 08:12:22 2010 (r205973) +++ stable/8/share/man/man4/scsi.4 Wed Mar 31 08:14:07 2010 (r205974) @@ -24,15 +24,15 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd October 15, 1998 -.Dt SCSI 4 +.Dd March 4, 2010 +.Dt CAM 4 .Os .Sh NAME -.Nm SCSI , .Nm CAM -.Nd CAM SCSI subsystem +.Nd Common Access Method SCSI/ATA subsystem .Sh SYNOPSIS .Cd "device scbus" +.Cd "device ada" .Cd "device cd" .Cd "device ch" .Cd "device da" @@ -49,31 +49,32 @@ .Cd "options SCSI_NO_OP_STRINGS" .Cd "options SCSI_DELAY=8000" .Sh DESCRIPTION -The CAM -.Tn SCSI +The +.Nm subsystem provides a uniform and modular system for the implementation of drivers to control various .Tn SCSI +and +.Tn ATA devices, and to utilize different .Tn SCSI +and +.Tn ATA host adapters through host adapter drivers. -When the system probes the -.Tn SCSI -busses, it attaches any devices it finds to the appropriate -drivers. +When the system probes busses, it attaches any devices it finds to the +appropriate drivers. The .Xr pass 4 -driver, if it is configured in the kernel, will attach to all -.Tn SCSI -devices. +driver, if it is configured in the kernel, will attach to all devices. .Sh KERNEL CONFIGURATION There are a number of generic kernel configuration options for the -CAM -.Tn SCSI +.Nm subsystem: .Bl -tag -width SCSI_NO_SENSE_STRINGS .It Dv CAMDEBUG -This option enables the CAM debugging printf code. +This option enables the +.Nm +debugging printf code. This will not actually cause any debugging information to be printed out when included by itself. Enabling printouts requires additional configuration. @@ -82,12 +83,11 @@ See below for details. This sets the maximum allowable number of concurrent "high power" commands. A "high power" command is a command that takes more electrical power than most to complete. -An example of this (and the only command currently -tagged as "high power") is the +An example of this is the .Tn SCSI START UNIT command. -Starting a SCSI disk often takes significantly more -electrical power than normal operation of the disk. +Starting a disk often takes significantly more electrical power than normal +operation. This option allows the user to specify how many concurrent high power commands may be outstanding without overloading the power supply on his computer. @@ -120,7 +120,9 @@ problems. This is the .Tn SCSI "bus settle delay." -In CAM, it is specified in +In +.Nm , +it is specified in .Em milliseconds , not seconds like the old .Tn SCSI @@ -148,7 +150,7 @@ In that case, the will be reset to 100ms. .El .Pp -All devices and the SCSI busses support boot time allocation so that +All devices and busses support dynamic allocation so that an upper number of devices and controllers does not need to be configured; .Cd "device da" will suffice for any number of disk drivers. @@ -204,7 +206,9 @@ hint.da.0.unit="0" This assigns .Em da0 to target 0, unit (lun) 0 of scbus 0. -Omitting the target or unit hints will instruct CAM to treat them as wildcards +Omitting the target or unit hints will instruct +.Nm +to treat them as wildcards and use the first respective counted instances. These examples can be combined together to allow a peripheral device to be wired to any particular controller, bus, target, and/or unit instance. @@ -221,7 +225,9 @@ The system allows common device drivers types of adapters. The adapters take requests from the upper layers and do all IO between the -.Em SCSI +.Tn SCSI +or +.Tn ATA bus and the system. The maximum size of a transfer is governed by the adapter. @@ -233,7 +239,8 @@ Some adapters support in which the system is capable of operating as a device, responding to operations initiated by another system. Target mode is supported for -some adapters, but is not yet complete for this version of the CAM +some adapters, but is not yet complete for this version of the +.Nm .Tn SCSI subsystem. .Sh FILES @@ -278,7 +285,9 @@ Users can enable debugging from their ke the following kernel config options: .Bl -tag -width CAM_DEBUG_TARGET .It Dv CAMDEBUG -This enables CAM debugging. +This enables +.Nm +debugging. Without this option, users will not even be able to turn on debugging from userland via .Xr camcontrol 8 . @@ -313,9 +322,12 @@ See .Xr camcontrol 8 for details. .Sh SEE ALSO +.Xr ada 4 , .Xr aha 4 , .Xr ahb 4 , .Xr ahc 4 , +.Xr ahci 4 , +.Xr ata 4 , .Xr bt 4 , .Xr cd 4 , .Xr ch 4 , @@ -326,15 +338,26 @@ for details. .Xr xpt 4 , .Xr camcontrol 8 .Sh HISTORY -The CAM +The +.Nm .Tn SCSI subsystem first appeared in .Fx 3.0 . +The +.Nm +ATA support was added in +.Fx 8.0 . .Sh AUTHORS .An -nosplit -The CAM +The +.Nm .Tn SCSI subsystem was written by .An Justin Gibbs and .An Kenneth Merry . +The +.Nm +.Tn ATA +support was added by +.An Alexander Motin Aq mav@FreeBSD.org . From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 08:15:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 399EA106564A; Wed, 31 Mar 2010 08:15:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 278458FC12; Wed, 31 Mar 2010 08:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V8FX60045427; Wed, 31 Mar 2010 08:15:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V8FXXj045424; Wed, 31 Mar 2010 08:15:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310815.o2V8FXXj045424@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 08:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205975 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 08:15:33 -0000 Author: mav Date: Wed Mar 31 08:15:32 2010 New Revision: 205975 URL: http://svn.freebsd.org/changeset/base/205975 Log: MFC r204565: Some style and language improvements. Submitted by: ru Modified: stable/8/share/man/man4/ahci.4 stable/8/share/man/man4/siis.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ahci.4 ============================================================================== --- stable/8/share/man/man4/ahci.4 Wed Mar 31 08:14:07 2010 (r205974) +++ stable/8/share/man/man4/ahci.4 Wed Mar 31 08:15:32 2010 (r205975) @@ -48,9 +48,10 @@ module at boot time, place the following ahci_load="YES" .Ed .Pp -The following tunables are settable from the loader: +The following tunables are settable from the +.Xr loader 8 : .Bl -ohang -.It Va hint.ahci.X.msi +.It Va hint.ahci. Ns Ar X Ns Va .msi controls Message Signaled Interrupts (MSI) usage by the specified controller .Bl -tag -compact .It 0 @@ -60,15 +61,15 @@ single MSI vector used, if supported (de .It 2 multiple MSI vectors used, if supported; .El -.It Va hint.ahci.X.ccc +.It Va hint.ahci. Ns Ar X Ns Va .ccc controls Command Completion Coalescing (CCC) usage by the specified controller. Non-zero value enables CCC and defines maximum time (in ms), request can wait for interrupt, if there are some more requests present on controller queue. CCC reduces number of context switches on systems with many parallel requests, but it can decrease disk performance on some workloads due to additional command latency. -.It Va hint.ahcich.X.pm_level -controls SATA interface Power Management for specified channel, +.It Va hint.ahcich. Ns Ar X Ns Va .pm_level +controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. Possible values: @@ -92,18 +93,20 @@ Because of artificial entering latency, .Pp Note that interface Power Management is not compatible with device presence detection. -You will have to reset bus manually on device hot-plug. -.It Va hint.ahcich.X.sata_rev +A manual bus reset is needed on device hot-plug. +.It Va hint.ahcich. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El .Sh DESCRIPTION -This driver provides the CAM subsystem with native access to the +This driver provides the +.Xr CAM 4 +subsystem with native access to the .Tn SATA ports of AHCI-compatible controllers. Each SATA port found is represented to CAM as a separate bus with one target, or, if HBA supports Port Multipliers, 16 targets. -Most of the bus-management details are handled by the SATA-specific +Most of the bus-management details are handled by the SATA-specific transport of CAM. Connected ATA disks are handled by the ATA protocol disk peripheral driver .Xr ada 4 . @@ -121,7 +124,8 @@ and Message Signaled Interrupts. .Pp AHCI hardware is also supported by ataahci driver from .Xr ata 4 -subsystem. If both drivers are loaded at the same time, this one will be +subsystem. +If both drivers are loaded at the same time, this one will be given precedence as the more functional of the two. .Sh HARDWARE The @@ -134,11 +138,11 @@ it supports AHCI part of legacy-PATA + A such as JMicron JMB36x and Marvell 88SX61xx. .Sh SEE ALSO .Xr ada 4 , +.Xr ata 4 , .Xr cd 4 , .Xr da 4 , .Xr sa 4 , -.Xr scsi 4 , -.Xr ata 4 +.Xr scsi 4 .Sh HISTORY The .Nm Modified: stable/8/share/man/man4/siis.4 ============================================================================== --- stable/8/share/man/man4/siis.4 Wed Mar 31 08:14:07 2010 (r205974) +++ stable/8/share/man/man4/siis.4 Wed Mar 31 08:15:32 2010 (r205975) @@ -48,12 +48,13 @@ module at boot time, place the following siis_load="YES" .Ed .Pp -The following tunables are settable from the loader: +The following tunables are settable from the +.Xr loader 8 : .Bl -ohang -.It Va hint.siis.X.msi +.It Va hint.siis. Ns Ar X Ns Va .msi controls Message Signaled Interrupts (MSI) usage by the specified controller. -.It Va hint.siisch.X.pm_level -controls SATA interface Power Management for specified channel, +.It Va hint.siisch. Ns Ar X Ns Va .pm_level +controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. Possible values: @@ -65,13 +66,15 @@ device is allowed to initiate PM state c .El Note that interface Power Management is not compatible with device presence detection. -You will have to reset bus manually on device hot-plug. -.It Va hint.siisch.X.sata_rev +A manual bus reset is needed on device hot-plug. +.It Va hint.siisch. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El .Sh DESCRIPTION -This driver provides the CAM subsystem native access to the +This driver provides the +.Xr CAM 4 +subsystem with native access to the .Tn SATA ports of controller. Each SATA port is represented to CAM as a separate bus with 16 targets. @@ -90,14 +93,15 @@ Port Multipliers (including FIS-based sw (31 command per port), Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atasiliconimage driver from +Same hardware is also supported by the atasiliconimage driver from .Xr ata 4 -subsystem. If both drivers are loaded at the same time, this one will be +subsystem. +If both drivers are loaded at the same time, this one will be given precedence as the more functional of the two. .Sh HARDWARE The .Nm -driver supports following controllers: +driver supports the following controllers: .Bl -bullet -compact .It SiI3124 @@ -108,11 +112,11 @@ SiI3531 .El .Sh SEE ALSO .Xr ada 4 , +.Xr ata 4 , .Xr cd 4 , .Xr da 4 , .Xr sa 4 , -.Xr scsi 4 , -.Xr ata 4 +.Xr scsi 4 .Sh HISTORY The .Nm From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 08:17:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3CF1065674; Wed, 31 Mar 2010 08:17:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6FA8FC0A; Wed, 31 Mar 2010 08:17:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2V8HXIE045938; Wed, 31 Mar 2010 08:17:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2V8HXXS045928; Wed, 31 Mar 2010 08:17:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003310817.o2V8HXXS045928@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Mar 2010 08:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205976 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 08:17:33 -0000 Author: mav Date: Wed Mar 31 08:17:32 2010 New Revision: 205976 URL: http://svn.freebsd.org/changeset/base/205976 Log: MFC r204705: Add links to cam(4). Modified: stable/8/share/man/man4/ada.4 stable/8/share/man/man4/ahci.4 stable/8/share/man/man4/cd.4 stable/8/share/man/man4/ch.4 stable/8/share/man/man4/da.4 stable/8/share/man/man4/pass.4 stable/8/share/man/man4/pt.4 stable/8/share/man/man4/sa.4 stable/8/share/man/man4/siis.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ada.4 ============================================================================== --- stable/8/share/man/man4/ada.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/ada.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -127,6 +127,7 @@ ATA device nodes .Sh SEE ALSO .Xr ad 4 , .Xr ahci 4 , +.Xr cam 4 , .Xr da 4 , .Xr siis 4 .Sh HISTORY Modified: stable/8/share/man/man4/ahci.4 ============================================================================== --- stable/8/share/man/man4/ahci.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/ahci.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -139,10 +139,10 @@ such as JMicron JMB36x and Marvell 88SX6 .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , +.Xr cam 4 , .Xr cd 4 , .Xr da 4 , -.Xr sa 4 , -.Xr scsi 4 +.Xr sa 4 .Sh HISTORY The .Nm Modified: stable/8/share/man/man4/cd.4 ============================================================================== --- stable/8/share/man/man4/cd.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/cd.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -496,8 +496,8 @@ devices .Sh DIAGNOSTICS None. .Sh SEE ALSO +.Xr cam 4 , .Xr da 4 , -.Xr scsi 4 , .Xr disklabel 5 , .Xr disklabel 8 , .Xr cd 9 Modified: stable/8/share/man/man4/ch.4 ============================================================================== --- stable/8/share/man/man4/ch.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/ch.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -325,6 +325,7 @@ If the media changer does not support fe driver, it will produce both console error messages and failure return codes to the ioctls described here. .Sh SEE ALSO +.Xr cam 4 , .Xr chio 1 , .Xr cd 4 , .Xr da 4 , Modified: stable/8/share/man/man4/da.4 ============================================================================== --- stable/8/share/man/man4/da.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/da.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -196,6 +196,7 @@ SCSI disk device nodes None. .Sh SEE ALSO .Xr ad 4 , +.Xr cam 4 , .Xr geom 4 , .Xr bsdlabel 8 , .Xr fdisk 8 Modified: stable/8/share/man/man4/pass.4 ============================================================================== --- stable/8/share/man/man4/pass.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/pass.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -104,6 +104,7 @@ CAM subsystem. None. .Sh SEE ALSO .Xr cam 3 , +.Xr cam 4 , .Xr cam_cdbparse 3 , .Xr xpt 4 , .Xr camcontrol 8 Modified: stable/8/share/man/man4/pt.4 ============================================================================== --- stable/8/share/man/man4/pt.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/pt.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -84,7 +84,7 @@ the .Ar N Ns th processor device. .El .Sh SEE ALSO -.Xr scsi 4 +.Xr cam 4 .Sh HISTORY The .Nm Modified: stable/8/share/man/man4/sa.4 ============================================================================== --- stable/8/share/man/man4/sa.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/sa.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -200,8 +200,8 @@ accessing the device, e.g.). .Sh DIAGNOSTICS None. .Sh SEE ALSO -.Xr mt 1 , -.Xr scsi 4 +.Xr cam 4 , +.Xr mt 1 .Sh AUTHORS .An -nosplit The Modified: stable/8/share/man/man4/siis.4 ============================================================================== --- stable/8/share/man/man4/siis.4 Wed Mar 31 08:15:32 2010 (r205975) +++ stable/8/share/man/man4/siis.4 Wed Mar 31 08:17:32 2010 (r205976) @@ -113,10 +113,10 @@ SiI3531 .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , +.Xr cam 4 , .Xr cd 4 , .Xr da 4 , -.Xr sa 4 , -.Xr scsi 4 +.Xr sa 4 .Sh HISTORY The .Nm From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 09:32:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FEBC106566B; Wed, 31 Mar 2010 09:32:37 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BC7098FC13; Wed, 31 Mar 2010 09:32:35 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA15749; Wed, 31 Mar 2010 12:32:33 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1NwuHo-000Mp4-VI; Wed, 31 Mar 2010 12:32:33 +0300 Message-ID: <4BB316AE.7000503@freebsd.org> Date: Wed, 31 Mar 2010 12:32:30 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: Luigi Rizzo References: <201003310151.o2V1p8QW058661@svn.freebsd.org> In-Reply-To: <201003310151.o2V1p8QW058661@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r205953 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 09:32:37 -0000 on 31/03/2010 04:51 Luigi Rizzo said the following: > Author: luigi > Date: Wed Mar 31 01:51:08 2010 > New Revision: 205953 > URL: http://svn.freebsd.org/changeset/base/205953 > > Log: > A last-minute change in the previous commit broke rule deletion, > so i am fixing it, this time with a more detailed description > of what the code is supposed to do. > > Modified: > stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Is this a direct commit to a stable branch? -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 13:51:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E83106566B; Wed, 31 Mar 2010 13:51:32 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDB058FC08; Wed, 31 Mar 2010 13:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VDpVne025352; Wed, 31 Mar 2010 13:51:31 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VDpVvd025347; Wed, 31 Mar 2010 13:51:31 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201003311351.o2VDpVvd025347@svn.freebsd.org> From: Pietro Cerutti Date: Wed, 31 Mar 2010 13:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205979 - in stable/8: include lib/libc/gen libexec/rtld-elf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 13:51:32 -0000 Author: gahr (ports committer) Date: Wed Mar 31 13:51:31 2010 New Revision: 205979 URL: http://svn.freebsd.org/changeset/base/205979 Log: MFC r205606 Remove const'ness from dlerror(3) prototype, for consistency with POSIX. Approved by: cognet Modified: stable/8/include/dlfcn.h stable/8/lib/libc/gen/dlfcn.c stable/8/lib/libc/gen/dlopen.3 stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/include/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/include/dlfcn.h ============================================================================== --- stable/8/include/dlfcn.h Wed Mar 31 12:52:19 2010 (r205978) +++ stable/8/include/dlfcn.h Wed Mar 31 13:51:31 2010 (r205979) @@ -117,8 +117,7 @@ typedef struct dl_serinfo { __BEGIN_DECLS /* XSI functions first. */ int dlclose(void *); -const char * - dlerror(void); +char *dlerror(void); void *dlopen(const char *, int); void *dlsym(void * __restrict, const char * __restrict); Modified: stable/8/lib/libc/gen/dlfcn.c ============================================================================== --- stable/8/lib/libc/gen/dlfcn.c Wed Mar 31 12:52:19 2010 (r205978) +++ stable/8/lib/libc/gen/dlfcn.c Wed Mar 31 13:51:31 2010 (r205979) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include -static const char sorry[] = "Service unavailable"; +static char sorry[] = "Service unavailable"; /* * For ELF, the dynamic linker directly resolves references to its @@ -69,7 +69,7 @@ dlclose(void *handle) } #pragma weak dlerror -const char * +char * dlerror(void) { return sorry; Modified: stable/8/lib/libc/gen/dlopen.3 ============================================================================== --- stable/8/lib/libc/gen/dlopen.3 Wed Mar 31 12:52:19 2010 (r205978) +++ stable/8/lib/libc/gen/dlopen.3 Wed Mar 31 13:51:31 2010 (r205979) @@ -52,7 +52,7 @@ .Fn dlsym "void * restrict handle" "const char * restrict symbol" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" -.Ft const char * +.Ft char * .Fn dlerror "void" .Ft int .Fn dlclose "void *handle" Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Wed Mar 31 12:52:19 2010 (r205978) +++ stable/8/libexec/rtld-elf/rtld.c Wed Mar 31 13:51:31 2010 (r205979) @@ -1961,7 +1961,7 @@ dlclose(void *handle) return 0; } -const char * +char * dlerror(void) { char *msg = error_message; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 15:32:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD6A7106566B; Wed, 31 Mar 2010 15:32:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ACD28FC0C; Wed, 31 Mar 2010 15:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VFWatV047780; Wed, 31 Mar 2010 15:32:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VFWahr047778; Wed, 31 Mar 2010 15:32:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003311532.o2VFWahr047778@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 31 Mar 2010 15:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205981 - stable/8/sys/compat/x86bios X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 15:32:36 -0000 Author: jkim Date: Wed Mar 31 15:32:36 2010 New Revision: 205981 URL: http://svn.freebsd.org/changeset/base/205981 Log: MFC: r205297, r205347, r205452, r205455, r205649, r205650 Sync. x86bios with HEAD. - Detect illegal access to unmapped memory within real mode emulator. - Map EBDA if available and support memory wraparound above 1MB as VM86 does. - Set initial %ds to 0x40 as X.org int10 handler does. - Print the initial memory map when bootverbose is set. - Optimize real mode page table lookup. - Add strictly aligned memory access for distant future. - Update copyright date. Modified: stable/8/sys/compat/x86bios/x86bios.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/x86bios/x86bios.c ============================================================================== --- stable/8/sys/compat/x86bios/x86bios.c Wed Mar 31 14:42:07 2010 (r205980) +++ stable/8/sys/compat/x86bios/x86bios.c Wed Mar 31 15:32:36 2010 (r205981) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2009 Alex Keda - * Copyright (c) 2009 Jung-uk Kim + * Copyright (c) 2009-2010 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,9 +60,9 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_IVT_BASE 0x00000000 #define X86BIOS_RAM_BASE 0x00001000 -#define X86BIOS_ROM_BASE 0x000a0000 /* XXX EBDA? */ +#define X86BIOS_ROM_BASE 0x000a0000 -#define X86BIOS_ROM_SIZE (X86BIOS_MEM_SIZE - X86BIOS_ROM_BASE) +#define X86BIOS_ROM_SIZE (X86BIOS_MEM_SIZE - (uint32_t)x86bios_rom_phys) #define X86BIOS_PAGES (X86BIOS_MEM_SIZE / X86BIOS_PAGE_SIZE) @@ -79,8 +79,14 @@ static void *x86bios_seg; static vm_offset_t *x86bios_map; +static vm_paddr_t x86bios_rom_phys; static vm_paddr_t x86bios_seg_phys; +static int x86bios_fault; +static uint32_t x86bios_fault_addr; +static uint16_t x86bios_fault_cs; +static uint16_t x86bios_fault_ip; + SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); static int x86bios_trace_call; TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); @@ -91,18 +97,30 @@ TUNABLE_INT("debug.x86bios.int", &x86bio SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0, "Trace software interrupt handlers"); +static void +x86bios_set_fault(struct x86emu *emu, uint32_t addr) +{ + + x86bios_fault = 1; + x86bios_fault_addr = addr; + x86bios_fault_cs = emu->x86.R_CS; + x86bios_fault_ip = emu->x86.R_IP; + x86emu_halt_sys(emu); +} + static void * x86bios_get_pages(uint32_t offset, size_t size) { - int i; + vm_offset_t page; - if (offset + size > X86BIOS_MEM_SIZE) + if (offset + size > X86BIOS_MEM_SIZE + X86BIOS_IVT_SIZE) return (NULL); - i = offset / X86BIOS_PAGE_SIZE; - if (x86bios_map[i] != 0) - return ((void *)(x86bios_map[i] + offset - - i * X86BIOS_PAGE_SIZE)); + if (offset >= X86BIOS_MEM_SIZE) + offset -= X86BIOS_MEM_SIZE; + page = x86bios_map[offset / X86BIOS_PAGE_SIZE]; + if (page != 0) + return ((void *)(page + offset % X86BIOS_PAGE_SIZE)); return (NULL); } @@ -124,7 +142,7 @@ x86bios_emu_rdb(struct x86emu *emu, uint va = x86bios_get_pages(addr, sizeof(*va)); if (va == NULL) - x86emu_halt_sys(emu); + x86bios_set_fault(emu, addr); return (*va); } @@ -136,8 +154,13 @@ x86bios_emu_rdw(struct x86emu *emu, uint va = x86bios_get_pages(addr, sizeof(*va)); if (va == NULL) - x86emu_halt_sys(emu); + x86bios_set_fault(emu, addr); +#ifndef __NO_STRICT_ALIGNMENT + if ((addr & 1) != 0) + return (le16dec(va)); + else +#endif return (le16toh(*va)); } @@ -148,8 +171,13 @@ x86bios_emu_rdl(struct x86emu *emu, uint va = x86bios_get_pages(addr, sizeof(*va)); if (va == NULL) - x86emu_halt_sys(emu); + x86bios_set_fault(emu, addr); +#ifndef __NO_STRICT_ALIGNMENT + if ((addr & 3) != 0) + return (le32dec(va)); + else +#endif return (le32toh(*va)); } @@ -160,7 +188,7 @@ x86bios_emu_wrb(struct x86emu *emu, uint va = x86bios_get_pages(addr, sizeof(*va)); if (va == NULL) - x86emu_halt_sys(emu); + x86bios_set_fault(emu, addr); *va = val; } @@ -172,8 +200,13 @@ x86bios_emu_wrw(struct x86emu *emu, uint va = x86bios_get_pages(addr, sizeof(*va)); if (va == NULL) - x86emu_halt_sys(emu); + x86bios_set_fault(emu, addr); +#ifndef __NO_STRICT_ALIGNMENT + if ((addr & 1) != 0) + le16enc(va, val); + else +#endif *va = htole16(val); } @@ -184,8 +217,13 @@ x86bios_emu_wrl(struct x86emu *emu, uint va = x86bios_get_pages(addr, sizeof(*va)); if (va == NULL) - x86emu_halt_sys(emu); + x86bios_set_fault(emu, addr); +#ifndef __NO_STRICT_ALIGNMENT + if ((addr & 3) != 0) + le32enc(va, val); + else +#endif *va = htole32(val); } @@ -281,7 +319,7 @@ x86bios_alloc(uint32_t *offset, size_t s return (NULL); vaddr = contigmalloc(size, M_DEVBUF, M_NOWAIT, X86BIOS_RAM_BASE, - X86BIOS_ROM_BASE, X86BIOS_PAGE_SIZE, 0); + x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0); if (vaddr != NULL) { *offset = vtophys(vaddr); x86bios_set_pages((vm_offset_t)vaddr, *offset, size); @@ -299,7 +337,7 @@ x86bios_free(void *addr, size_t size) return; paddr = vtophys(addr); - if (paddr < X86BIOS_RAM_BASE || paddr >= X86BIOS_ROM_BASE || + if (paddr < X86BIOS_RAM_BASE || paddr >= x86bios_rom_phys || paddr % X86BIOS_PAGE_SIZE != 0) return; @@ -313,7 +351,8 @@ x86bios_init_regs(struct x86regs *regs) { bzero(regs, sizeof(*regs)); - regs->X86BIOS_R_DS = regs->X86BIOS_R_SS = x86bios_seg_phys >> 4; + regs->X86BIOS_R_DS = 0x40; + regs->X86BIOS_R_SS = x86bios_seg_phys >> 4; } void @@ -331,15 +370,21 @@ x86bios_call(struct x86regs *regs, uint1 mtx_lock_spin(&x86bios_lock); memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + x86bios_fault = 0; x86emu_exec_call(&x86bios_emu, seg, off); memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); - if (x86bios_trace_call) + if (x86bios_trace_call) { printf("Exiting 0x%05x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX, regs->R_ES, regs->R_DI); + if (x86bios_fault) + printf("Page fault at 0x%05x from 0x%04x:0x%04x.\n", + x86bios_fault_addr, x86bios_fault_cs, + x86bios_fault_ip); + } } uint32_t @@ -370,15 +415,21 @@ x86bios_intr(struct x86regs *regs, int i mtx_lock_spin(&x86bios_lock); memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + x86bios_fault = 0; x86emu_exec_intr(&x86bios_emu, intno); memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); mtx_unlock_spin(&x86bios_lock); - if (x86bios_trace_int) + if (x86bios_trace_int) { printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX, regs->R_ES, regs->R_DI); + if (x86bios_fault) + printf("Page fault at 0x%05x from 0x%04x:0x%04x.\n", + x86bios_fault_addr, x86bios_fault_cs, + x86bios_fault_ip); + } } void * @@ -433,6 +484,12 @@ x86bios_match_device(uint32_t offset, de return (1); } +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) +#define PROBE_EBDA 1 +#else +#define PROBE_EBDA 0 +#endif + static __inline int x86bios_map_mem(void) { @@ -440,18 +497,63 @@ x86bios_map_mem(void) x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); if (x86bios_ivt == NULL) return (1); - x86bios_rom = pmap_mapdev(X86BIOS_ROM_BASE, X86BIOS_ROM_SIZE); + +#if PROBE_EBDA + /* Probe EBDA via BDA. */ + x86bios_rom_phys = *(uint16_t *)((vm_offset_t)x86bios_ivt + 0x40e); + x86bios_rom_phys = le16toh(x86bios_rom_phys) << 4; + if (x86bios_rom_phys != 0 && x86bios_rom_phys < X86BIOS_ROM_BASE && + X86BIOS_ROM_BASE - x86bios_rom_phys <= 128 * 1024) + x86bios_rom_phys = + rounddown(x86bios_rom_phys, X86BIOS_PAGE_SIZE); + else +#endif + x86bios_rom_phys = X86BIOS_ROM_BASE; + x86bios_rom = pmap_mapdev(x86bios_rom_phys, X86BIOS_ROM_SIZE); if (x86bios_rom == NULL) { pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); return (1); } +#if PROBE_EBDA + /* Change attribute for EBDA. */ + if (x86bios_rom_phys < X86BIOS_ROM_BASE && + pmap_change_attr((vm_offset_t)x86bios_rom, + X86BIOS_ROM_BASE - x86bios_rom_phys, PAT_WRITE_BACK) != 0) { + pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); + return (1); + } +#endif + x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK, - X86BIOS_RAM_BASE, X86BIOS_ROM_BASE, X86BIOS_PAGE_SIZE, 0); + X86BIOS_RAM_BASE, x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0); x86bios_seg_phys = vtophys(x86bios_seg); + if (bootverbose) { + printf("x86bios: IVT 0x%06x-0x%06x at %p\n", + X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE + X86BIOS_IVT_BASE - 1, + x86bios_ivt); + printf("x86bios: SSEG 0x%06x-0x%06x at %p\n", + (uint32_t)x86bios_seg_phys, + X86BIOS_SEG_SIZE + (uint32_t)x86bios_seg_phys - 1, + x86bios_seg); +#if PROBE_EBDA + if (x86bios_rom_phys < X86BIOS_ROM_BASE) + printf("x86bios: EBDA 0x%06x-0x%06x at %p\n", + (uint32_t)x86bios_rom_phys, X86BIOS_ROM_BASE - 1, + x86bios_rom); +#endif + printf("x86bios: ROM 0x%06x-0x%06x at %p\n", + X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1, + (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE - + (vm_offset_t)x86bios_rom_phys)); + } + return (0); } +#undef PROBE_EBDA + static __inline void x86bios_unmap_mem(void) { @@ -475,7 +577,7 @@ x86bios_init(void *arg __unused) M_WAITOK | M_ZERO); x86bios_set_pages((vm_offset_t)x86bios_ivt, X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); - x86bios_set_pages((vm_offset_t)x86bios_rom, X86BIOS_ROM_BASE, + x86bios_set_pages((vm_offset_t)x86bios_rom, x86bios_rom_phys, X86BIOS_ROM_SIZE); x86bios_set_pages((vm_offset_t)x86bios_seg, x86bios_seg_phys, X86BIOS_SEG_SIZE); From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 15:39:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45111106566B; Wed, 31 Mar 2010 15:39:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 335C08FC14; Wed, 31 Mar 2010 15:39:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VFdl0K049400; Wed, 31 Mar 2010 15:39:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VFdlNx049396; Wed, 31 Mar 2010 15:39:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003311539.o2VFdlNx049396@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 31 Mar 2010 15:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205982 - stable/8/sys/dev/syscons X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 15:39:47 -0000 Author: jkim Date: Wed Mar 31 15:39:46 2010 New Revision: 205982 URL: http://svn.freebsd.org/changeset/base/205982 Log: MFC: r205550, r205605, r205865 Sync. pixel mode support for syscons(4) with HEAD. - Separate 24-bit pixel draw from 32-bit case. Although it is slower, we do not want to write a useless zero to inaccessible memory region. - We only want the dummy palette for direct color mode. Modified: stable/8/sys/dev/syscons/scvgarndr.c stable/8/sys/dev/syscons/scvidctl.c stable/8/sys/dev/syscons/syscons.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/syscons/scvgarndr.c ============================================================================== --- stable/8/sys/dev/syscons/scvgarndr.c Wed Mar 31 15:32:36 2010 (r205981) +++ stable/8/sys/dev/syscons/scvgarndr.c Wed Mar 31 15:39:46 2010 (r205982) @@ -181,9 +181,17 @@ static u_short mouse_or_mask[16] = { #define vga_drawpxl(pos, color) \ switch (scp->sc->adp->va_info.vi_depth) { \ case 32: \ - case 24: \ writel(pos, vga_palette32[color]); \ break; \ + case 24: \ + if (((pos) & 1) == 0) { \ + writew(pos, vga_palette32[color]); \ + writeb(pos + 2, vga_palette32[color] >> 16);\ + } else { \ + writeb(pos, vga_palette32[color]); \ + writew(pos + 1, vga_palette32[color] >> 8);\ + } \ + break; \ case 16: \ if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\ writew(pos, vga_palette15[color]); \ Modified: stable/8/sys/dev/syscons/scvidctl.c ============================================================================== --- stable/8/sys/dev/syscons/scvidctl.c Wed Mar 31 15:32:36 2010 (r205981) +++ stable/8/sys/dev/syscons/scvidctl.c Wed Mar 31 15:39:46 2010 (r205982) @@ -741,7 +741,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, #ifndef SC_NO_PALETTE_LOADING #ifdef SC_PIXEL_MODE - if ((adp->va_flags & V_ADP_DAC8) != 0) + if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) vidd_load_palette(adp, scp->sc->palette2); else #endif @@ -802,7 +802,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, if (scp == scp->sc->cur_scp) { set_mode(scp); #ifndef SC_NO_PALETTE_LOADING - if ((adp->va_flags & V_ADP_DAC8) != 0) + if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) vidd_load_palette(adp, scp->sc->palette2); else vidd_load_palette(adp, scp->sc->palette); Modified: stable/8/sys/dev/syscons/syscons.c ============================================================================== --- stable/8/sys/dev/syscons/syscons.c Wed Mar 31 15:32:36 2010 (r205981) +++ stable/8/sys/dev/syscons/syscons.c Wed Mar 31 15:39:46 2010 (r205982) @@ -2127,7 +2127,7 @@ restore_scrn_saver_mode(scr_stat *scp, i if (set_mode(scp) == 0) { #ifndef SC_NO_PALETTE_LOADING #ifdef SC_PIXEL_MODE - if ((scp->sc->adp->va_flags & V_ADP_DAC8) != 0) + if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) vidd_load_palette(scp->sc->adp, scp->sc->palette2); else #endif @@ -2536,7 +2536,7 @@ exchange_scr(sc_softc_t *sc) #ifndef SC_NO_PALETTE_LOADING if (ISGRAPHSC(sc->old_scp)) { #ifdef SC_PIXEL_MODE - if ((sc->adp->va_flags & V_ADP_DAC8) != 0) + if (sc->adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) vidd_load_palette(sc->adp, sc->palette2); else #endif From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 15:45:11 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98BF9106566C; Wed, 31 Mar 2010 15:45:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 821198FC14; Wed, 31 Mar 2010 15:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VFjBZn050607; Wed, 31 Mar 2010 15:45:11 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VFjBYL050604; Wed, 31 Mar 2010 15:45:11 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003311545.o2VFjBYL050604@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 31 Mar 2010 15:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205983 - stable/8/sys/dev/fb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 15:45:11 -0000 Author: jkim Date: Wed Mar 31 15:45:11 2010 New Revision: 205983 URL: http://svn.freebsd.org/changeset/base/205983 Log: MFC: r205557, r205558, r205564, r205566, r205604, r205653 Sync. pixel mode support for VESA and VGA frame buffers with HEAD. - Map entire video memory again. Although we do not use them all directly, it seems VGA renderer may access unmapped memory region and cause kernel panic. - Fall back to VGA palette functions if VESA function failed and DAC is still in 6-bit mode. Although we have to check non-VGA compatibility bit here, it seems there are too many broken VESA BIOSes out to rely on it. - Be careful when we determine bytes per scan line information. We compare mode table data against minimum value. If the mode table does not make sense, we set the minimum in the mode info. - Teach VGA framebuffer about 8-bit palette format for VESA. - Add my copyright here. Modified: stable/8/sys/dev/fb/vesa.c stable/8/sys/dev/fb/vga.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/fb/vesa.c ============================================================================== --- stable/8/sys/dev/fb/vesa.c Wed Mar 31 15:39:46 2010 (r205982) +++ stable/8/sys/dev/fb/vesa.c Wed Mar 31 15:45:11 2010 (r205983) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith + * Copyright (c) 2009-2010 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -188,7 +189,7 @@ static int vesa_bios_load_palette2(int s #define STATE_ALL (STATE_HW | STATE_DATA | STATE_DAC | STATE_REG) static ssize_t vesa_bios_state_buf_size(void); static int vesa_bios_save_restore(int code, void *p, size_t size); -#if 0 +#ifdef MODE_TABLE_BROKEN static int vesa_bios_get_line_length(void); #endif static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines); @@ -199,6 +200,7 @@ static int vesa_bios_set_start(int x, in static int vesa_map_gen_mode_num(int type, int color, int mode); static int vesa_translate_flags(u_int16_t vflags); static int vesa_translate_mmodel(u_int8_t vmodel); +static int vesa_get_bpscanline(struct vesa_mode *vmode); static int vesa_bios_init(void); static void vesa_clear_modes(video_info_t *info, int color); @@ -558,7 +560,7 @@ vesa_bios_save_restore(int code, void *p return (regs.R_AX != 0x004f); } -#if 0 +#ifdef MODE_TABLE_BROKEN static int vesa_bios_get_line_length(void) { @@ -709,6 +711,43 @@ vesa_translate_mmodel(u_int8_t vmodel) return (V_INFO_MM_OTHER); } +static int +vesa_get_bpscanline(struct vesa_mode *vmode) +{ + int bpsl; + + if ((vmode->v_modeattr & V_MODEGRAPHICS) != 0) { + /* Find the minimum length. */ + switch (vmode->v_bpp / vmode->v_planes) { + case 1: + bpsl = vmode->v_width / 8; + break; + case 2: + bpsl = vmode->v_width / 4; + break; + case 4: + bpsl = vmode->v_width / 2; + break; + default: + bpsl = vmode->v_width * ((vmode->v_bpp + 7) / 8); + bpsl /= vmode->v_planes; + break; + } + + /* Use VBE 3.0 information if it looks sane. */ + if ((vmode->v_modeattr & V_MODELFB) != 0 && + vesa_adp_info->v_version >= 0x0300 && + vmode->v_linbpscanline > bpsl) + return (vmode->v_linbpscanline); + + /* Return the minimum if the mode table looks absurd. */ + if (vmode->v_bpscanline < bpsl) + return (bpsl); + } + + return (vmode->v_bpscanline); +} + #define VESA_MAXSTR 256 #define VESA_STRCPY(dst, src) do { \ @@ -733,7 +772,6 @@ vesa_bios_init(void) void *vmbuf; uint32_t offs; uint16_t vers; - int bpsl; int is_via_cle266; int modes; int i; @@ -858,9 +896,7 @@ vesa_bios_init(void) } #endif - bpsl = (vmode.v_modeattr & V_MODELFB) != 0 && vers >= 0x0300 ? - vmode.v_linbpscanline : vmode.v_bpscanline; - bsize = bpsl * vmode.v_height; + bsize = vesa_get_bpscanline(&vmode) * vmode.v_height; if ((vmode.v_modeattr & V_MODEGRAPHICS) != 0) bsize *= vmode.v_planes; @@ -1209,7 +1245,7 @@ vesa_set_mode(video_adapter_t *adp, int int10_set_mode(adp->va_initial_bios_mode); if (adp->va_info.vi_flags & V_INFO_LINEAR) pmap_unmapdev(adp->va_buffer, - adp->va_buffer_size); + vesa_adp_info->v_memsize * 64 * 1024); /* * Once (*prevvidsw->get_info)() succeeded, * (*prevvidsw->set_mode)() below won't fail... @@ -1241,12 +1277,12 @@ vesa_set_mode(video_adapter_t *adp, int if ((vesa_adp_info->v_flags & V_DAC8) != 0 && (info.vi_flags & V_INFO_GRAPHICS) != 0 && - (info.vi_flags & V_INFO_NONVGA) != 0 && vesa_bios_set_dac(8) > 6) adp->va_flags |= V_ADP_DAC8; if (adp->va_info.vi_flags & V_INFO_LINEAR) - pmap_unmapdev(adp->va_buffer, adp->va_buffer_size); + pmap_unmapdev(adp->va_buffer, + vesa_adp_info->v_memsize * 64 * 1024); #if VESA_DEBUG > 0 printf("VESA: mode set!\n"); @@ -1257,13 +1293,31 @@ vesa_set_mode(video_adapter_t *adp, int (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0; vesa_adp->va_crtc_addr = (vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC; + + vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height; + if ((info.vi_flags & V_INFO_GRAPHICS) != 0) + vesa_adp->va_line_width /= info.vi_planes; + +#ifdef MODE_TABLE_BROKEN + /* If VBE function returns bigger bytes per scan line, use it. */ + { + int bpsl = vesa_bios_get_line_length(); + if (bpsl > vesa_adp->va_line_width) { + vesa_adp->va_line_width = bpsl; + info.vi_buffer_size = bpsl * info.vi_height; + if ((info.vi_flags & V_INFO_GRAPHICS) != 0) + info.vi_buffer_size *= info.vi_planes; + } + } +#endif + if (info.vi_flags & V_INFO_LINEAR) { #if VESA_DEBUG > 1 printf("VESA: setting up LFB\n"); #endif vesa_adp->va_buffer = (vm_offset_t)pmap_mapdev_attr(info.vi_buffer, - info.vi_buffer_size, PAT_WRITE_COMBINING); + vesa_adp_info->v_memsize * 64 * 1024, PAT_WRITE_COMBINING); vesa_adp->va_window = vesa_adp->va_buffer; vesa_adp->va_window_size = info.vi_buffer_size / info.vi_planes; vesa_adp->va_window_gran = info.vi_buffer_size / info.vi_planes; @@ -1275,9 +1329,6 @@ vesa_set_mode(video_adapter_t *adp, int } vesa_adp->va_buffer_size = info.vi_buffer_size; vesa_adp->va_window_orig = 0; - vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height; - if ((info.vi_flags & V_INFO_GRAPHICS) != 0) - vesa_adp->va_line_width /= info.vi_planes; vesa_adp->va_disp_start.x = 0; vesa_adp->va_disp_start.y = 0; #if VESA_DEBUG > 0 @@ -1322,10 +1373,10 @@ vesa_save_palette(video_adapter_t *adp, { int bits; - if (adp == vesa_adp && VESA_MODE(adp->va_mode) && - (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) { + if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; - return (vesa_bios_save_palette(0, 256, palette, bits)); + if (vesa_bios_save_palette(0, 256, palette, bits) == 0) + return (0); } return ((*prevvidsw->save_palette)(adp, palette)); @@ -1336,10 +1387,10 @@ vesa_load_palette(video_adapter_t *adp, { int bits; - if (adp == vesa_adp && VESA_MODE(adp->va_mode) && - (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) { + if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; - return (vesa_bios_load_palette(0, 256, palette, bits)); + if (vesa_bios_load_palette(0, 256, palette, bits) == 0) + return (0); } return ((*prevvidsw->load_palette)(adp, palette)); @@ -1544,8 +1595,6 @@ get_palette(video_adapter_t *adp, int ba return (1); if (!VESA_MODE(adp->va_mode)) return (1); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0) - return (1); bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; r = malloc(count * 3, M_DEVBUF, M_WAITOK); @@ -1582,8 +1631,6 @@ set_palette(video_adapter_t *adp, int ba return (1); if (!VESA_MODE(adp->va_mode)) return (1); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0) - return (1); bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6; r = malloc(count * 3, M_DEVBUF, M_WAITOK); Modified: stable/8/sys/dev/fb/vga.c ============================================================================== --- stable/8/sys/dev/fb/vga.c Wed Mar 31 15:39:46 2010 (r205982) +++ stable/8/sys/dev/fb/vga.c Wed Mar 31 15:45:11 2010 (r205983) @@ -1979,6 +1979,7 @@ vga_show_font(video_adapter_t *adp, int static int vga_save_palette(video_adapter_t *adp, u_char *palette) { + int bits; int i; prologue(adp, V_ADP_PALETTE, ENODEV); @@ -1988,8 +1989,9 @@ vga_save_palette(video_adapter_t *adp, u * VGA has 6 bit DAC . */ outb(PALRADR, 0x00); + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2; for (i = 0; i < 256*3; ++i) - palette[i] = inb(PALDATA) << 2; + palette[i] = inb(PALDATA) << bits; inb(adp->va_crtc_addr + 6); /* reset flip/flop */ return 0; } @@ -1998,15 +2000,17 @@ static int vga_save_palette2(video_adapter_t *adp, int base, int count, u_char *r, u_char *g, u_char *b) { + int bits; int i; prologue(adp, V_ADP_PALETTE, ENODEV); outb(PALRADR, base); + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2; for (i = 0; i < count; ++i) { - r[i] = inb(PALDATA) << 2; - g[i] = inb(PALDATA) << 2; - b[i] = inb(PALDATA) << 2; + r[i] = inb(PALDATA) << bits; + g[i] = inb(PALDATA) << bits; + b[i] = inb(PALDATA) << bits; } inb(adp->va_crtc_addr + 6); /* reset flip/flop */ return 0; @@ -2021,14 +2025,16 @@ vga_save_palette2(video_adapter_t *adp, static int vga_load_palette(video_adapter_t *adp, u_char *palette) { + int bits; int i; prologue(adp, V_ADP_PALETTE, ENODEV); outb(PIXMASK, 0xff); /* no pixelmask */ outb(PALWADR, 0x00); + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2; for (i = 0; i < 256*3; ++i) - outb(PALDATA, palette[i] >> 2); + outb(PALDATA, palette[i] >> bits); inb(adp->va_crtc_addr + 6); /* reset flip/flop */ outb(ATC, 0x20); /* enable palette */ return 0; @@ -2038,16 +2044,18 @@ static int vga_load_palette2(video_adapter_t *adp, int base, int count, u_char *r, u_char *g, u_char *b) { + int bits; int i; prologue(adp, V_ADP_PALETTE, ENODEV); outb(PIXMASK, 0xff); /* no pixelmask */ outb(PALWADR, base); + bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 0 : 2; for (i = 0; i < count; ++i) { - outb(PALDATA, r[i] >> 2); - outb(PALDATA, g[i] >> 2); - outb(PALDATA, b[i] >> 2); + outb(PALDATA, r[i] >> bits); + outb(PALDATA, g[i] >> bits); + outb(PALDATA, b[i] >> bits); } inb(adp->va_crtc_addr + 6); /* reset flip/flop */ outb(ATC, 0x20); /* enable palette */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 15:49:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA3C1065672; Wed, 31 Mar 2010 15:49:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7638FC0A; Wed, 31 Mar 2010 15:49:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VFnADF051566; Wed, 31 Mar 2010 15:49:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VFnAhG051564; Wed, 31 Mar 2010 15:49:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003311549.o2VFnAhG051564@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 31 Mar 2010 15:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205984 - stable/8/sys/dev/fb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 15:49:10 -0000 Author: jkim Date: Wed Mar 31 15:49:10 2010 New Revision: 205984 URL: http://svn.freebsd.org/changeset/base/205984 Log: MFC: r197185 Enable BIOS modes on amd64. Modified: stable/8/sys/dev/fb/vga.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/fb/vga.c ============================================================================== --- stable/8/sys/dev/fb/vga.c Wed Mar 31 15:45:11 2010 (r205983) +++ stable/8/sys/dev/fb/vga.c Wed Mar 31 15:49:10 2010 (r205984) @@ -177,7 +177,7 @@ vga_mmap(struct cdev *dev, vga_softc_t * #endif /* architecture dependent option */ -#ifndef __i386__ +#if !defined(__i386__) && !defined(__amd64__) #define VGA_NO_BIOS 1 #endif From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 16:01:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3647106564A; Wed, 31 Mar 2010 16:01:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80F9C8FC16; Wed, 31 Mar 2010 16:01:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VG1mxu054434; Wed, 31 Mar 2010 16:01:48 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VG1mkR054432; Wed, 31 Mar 2010 16:01:48 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003311601.o2VG1mkR054432@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 31 Mar 2010 16:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205985 - stable/8/usr.sbin/vidcontrol X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 16:01:49 -0000 Author: jkim Date: Wed Mar 31 16:01:48 2010 New Revision: 205985 URL: http://svn.freebsd.org/changeset/base/205985 Log: MFC: r205855 Print memory model of the video mode except for planar memory model. 'P', 'D', 'C', 'H', and 'V' mean packed pixel, direct color, CGA, Hercules, and VGA X memory models respectively where they have fixed number of planes. Modified: stable/8/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: stable/8/usr.sbin/vidcontrol/ (props changed) Modified: stable/8/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- stable/8/usr.sbin/vidcontrol/vidcontrol.c Wed Mar 31 15:49:10 2010 (r205984) +++ stable/8/usr.sbin/vidcontrol/vidcontrol.c Wed Mar 31 16:01:48 2010 (r205985) @@ -950,10 +950,11 @@ show_adapter_info(void) static void show_mode_info(void) { - struct video_info _info; char buf[80]; - int mode; + struct video_info _info; int c; + int mm; + int mode; printf(" mode# flags type size " "font window linear buffer\n"); @@ -972,9 +973,35 @@ show_mode_info(void) if (_info.vi_flags & V_INFO_GRAPHICS) { c = 'G'; - snprintf(buf, sizeof(buf), "%dx%dx%d %d", - _info.vi_width, _info.vi_height, - _info.vi_depth, _info.vi_planes); + if (_info.vi_mem_model == V_INFO_MM_PLANAR) + snprintf(buf, sizeof(buf), "%dx%dx%d %d", + _info.vi_width, _info.vi_height, + _info.vi_depth, _info.vi_planes); + else { + switch (_info.vi_mem_model) { + case V_INFO_MM_PACKED: + mm = 'P'; + break; + case V_INFO_MM_DIRECT: + mm = 'D'; + break; + case V_INFO_MM_CGA: + mm = 'C'; + break; + case V_INFO_MM_HGC: + mm = 'H'; + break; + case V_INFO_MM_VGAX: + mm = 'V'; + break; + default: + mm = ' '; + break; + } + snprintf(buf, sizeof(buf), "%dx%dx%d %c", + _info.vi_width, _info.vi_height, + _info.vi_depth, mm); + } } else { c = 'T'; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 21:32:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47252106566C; Wed, 31 Mar 2010 21:32:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 336068FC15; Wed, 31 Mar 2010 21:32:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VLWrHl028079; Wed, 31 Mar 2010 21:32:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VLWqJZ028051; Wed, 31 Mar 2010 21:32:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312132.o2VLWqJZ028051@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 21:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206005 - in stable/8/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 21:32:53 -0000 Author: marius Date: Wed Mar 31 21:32:52 2010 New Revision: 206005 URL: http://svn.freebsd.org/changeset/base/206005 Log: MFC: r204152, r204164 Some machines can not only consist of CPUs running at different speeds but also of different types, f.e. Sun Fire V890 can be equipped with a mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization and different workarounds for model specific errata. Therefore move the CPU implementation number from a global variable to the per-CPU data. Functions which are called before the latter is available are passed the implementation number as a parameter now. Modified: stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/sparc64/include/cache.h stable/8/sys/sparc64/include/cpu.h stable/8/sys/sparc64/include/md_var.h stable/8/sys/sparc64/include/pcpu.h stable/8/sys/sparc64/include/pmap.h stable/8/sys/sparc64/include/smp.h stable/8/sys/sparc64/include/tick.h stable/8/sys/sparc64/include/ver.h stable/8/sys/sparc64/sparc64/cache.c stable/8/sys/sparc64/sparc64/cheetah.c stable/8/sys/sparc64/sparc64/identcpu.c stable/8/sys/sparc64/sparc64/iommu.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/mp_locore.S stable/8/sys/sparc64/sparc64/mp_machdep.c stable/8/sys/sparc64/sparc64/nexus.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sparc64/sparc64/spitfire.c stable/8/sys/sparc64/sparc64/tick.c stable/8/sys/sparc64/sparc64/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/boot/sparc64/loader/main.c Wed Mar 31 21:32:52 2010 (r206005) @@ -137,7 +137,7 @@ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; u_int dtlb_slot; u_int itlb_slot; -int cpu_impl; +static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; Modified: stable/8/sys/sparc64/include/cache.h ============================================================================== --- stable/8/sys/sparc64/include/cache.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/cache.h Wed Mar 31 21:32:52 2010 (r206005) @@ -91,7 +91,7 @@ struct cacheinfo { struct pcpu; -typedef void cache_enable_t(void); +typedef void cache_enable_t(u_int cpu_impl); typedef void cache_flush_t(void); typedef void dcache_page_inval_t(vm_paddr_t pa); typedef void icache_page_inval_t(vm_paddr_t pa); Modified: stable/8/sys/sparc64/include/cpu.h ============================================================================== --- stable/8/sys/sparc64/include/cpu.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/cpu.h Wed Mar 31 21:32:52 2010 (r206005) @@ -52,7 +52,7 @@ extern char btext[]; extern char etext[]; -void cheetah_init(void); +void cheetah_init(u_int cpu_impl); void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); Modified: stable/8/sys/sparc64/include/md_var.h ============================================================================== --- stable/8/sys/sparc64/include/md_var.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/md_var.h Wed Mar 31 21:32:52 2010 (r206005) @@ -47,8 +47,8 @@ extern vm_paddr_t kstack0_phys; struct pcpu; struct md_utrap; -const char *cpu_cpuid_prop(void); -uint32_t cpu_get_mid(void); +const char *cpu_cpuid_prop(u_int cpu_impl); +uint32_t cpu_get_mid(u_int cpu_impl); void cpu_identify(u_long vers, u_int clock, u_int id); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); Modified: stable/8/sys/sparc64/include/pcpu.h ============================================================================== --- stable/8/sys/sparc64/include/pcpu.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/pcpu.h Wed Mar 31 21:32:52 2010 (r206005) @@ -54,6 +54,7 @@ struct pmap; u_long pc_tickref; \ u_long pc_tickadj; \ u_int pc_clock; \ + u_int pc_impl; \ u_int pc_mid; \ u_int pc_node; \ u_int pc_tlb_ctx; \ Modified: stable/8/sys/sparc64/include/pmap.h ============================================================================== --- stable/8/sys/sparc64/include/pmap.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/pmap.h Wed Mar 31 21:32:52 2010 (r206005) @@ -80,7 +80,7 @@ struct pmap { #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_set_memattr(m, ma) (void)0 -void pmap_bootstrap(void); +void pmap_bootstrap(u_int cpu_impl); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kenter(vm_offset_t va, vm_page_t m); void pmap_kremove(vm_offset_t); Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/smp.h Wed Mar 31 21:32:52 2010 (r206005) @@ -94,7 +94,7 @@ void cpu_mp_shutdown(void); typedef void cpu_ipi_selected_t(u_int, u_long, u_long, u_long); extern cpu_ipi_selected_t *cpu_ipi_selected; -void mp_init(void); +void mp_init(u_int cpu_impl); extern struct mtx ipi_mtx; extern struct ipi_cache_args ipi_cache_args; Modified: stable/8/sys/sparc64/include/tick.h ============================================================================== --- stable/8/sys/sparc64/include/tick.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/tick.h Wed Mar 31 21:32:52 2010 (r206005) @@ -31,8 +31,8 @@ extern u_int hardclock_use_stick; -void tick_clear(void); +void tick_clear(u_int cpu_impl); void tick_start(void); -void tick_stop(void); +void tick_stop(u_int cpu_impl); #endif Modified: stable/8/sys/sparc64/include/ver.h ============================================================================== --- stable/8/sys/sparc64/include/ver.h Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/include/ver.h Wed Mar 31 21:32:52 2010 (r206005) @@ -43,24 +43,28 @@ #ifndef LOCORE -#define VER_MANUF_MASK (((1L<> VER_MANUF_SHIFT) -#define VER_IMPL(ver) \ +#define VER_IMPL(ver) \ (((ver) & VER_IMPL_MASK) >> VER_IMPL_SHIFT) -#define VER_MASK(ver) \ +#define VER_MASK(ver) \ (((ver) & VER_MASK_MASK) >> VER_MASK_SHIFT) -#define VER_MAXTL(ver) \ +#define VER_MAXTL(ver) \ (((ver) & VER_MAXTL_MASK) >> VER_MAXTL_SHIFT) -#define VER_MAXWIN(ver) \ +#define VER_MAXWIN(ver) \ (((ver) & VER_MAXWIN_MASK) >> VER_MAXWIN_SHIFT) -extern int cpu_impl; extern char sparc64_model[]; #endif /* !LOCORE */ Modified: stable/8/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cache.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/cache.c Wed Mar 31 21:32:52 2010 (r206005) @@ -130,7 +130,7 @@ cache_init(struct pcpu *pcpu) if ((set & ~(1UL << (ffs(set) - 1))) != 0) panic("cache_init: E$ set size not a power of 2"); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCIII) { cache_enable = cheetah_cache_enable; cache_flush = cheetah_cache_flush; dcache_page_inval = cheetah_dcache_page_inval; Modified: stable/8/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cheetah.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/cheetah.c Wed Mar 31 21:32:52 2010 (r206005) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); * CPU-specific initialization */ void -cheetah_init(void) +cheetah_init(u_int cpu_impl) { register_t s; @@ -119,7 +119,7 @@ cheetah_init(void) * Enable level 1 caches. */ void -cheetah_cache_enable(void) +cheetah_cache_enable(u_int cpu_impl) { u_long lsu; Modified: stable/8/sys/sparc64/sparc64/identcpu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/identcpu.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/identcpu.c Wed Mar 31 21:32:52 2010 (r206005) @@ -15,7 +15,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -34,8 +33,6 @@ static u_int cpu_freq; SYSCTL_UINT(_hw_freq, OID_AUTO, cpu, CTLFLAG_RD, &cpu_freq, 0, "CPU clock frequency"); -int cpu_impl; - void cpu_identify(u_long vers, u_int freq, u_int id) { Modified: stable/8/sys/sparc64/sparc64/iommu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/iommu.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/iommu.c Wed Mar 31 21:32:52 2010 (r206005) @@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -377,7 +378,7 @@ iommu_init(const char *name, struct iomm printf("%s: PROM IOTSB size: %d (%d entries)\n", name, obptsbsize, obptsbentries); if ((is->is_flags & IOMMU_PRESERVE_PROM) != 0 && - !(cpu_impl == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { + !(PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { if (obptsbentries > tsbentries) panic("%s: PROM IOTSB entries exceed kernel", __func__); Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/machdep.c Wed Mar 31 21:32:52 2010 (r206005) @@ -146,7 +146,7 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; -static phandle_t find_bsp(phandle_t node, uint32_t bspid); +static phandle_t find_bsp(phandle_t node, uint32_t bspid, u_int cpu_impl); void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); static void sparc64_shutdown_final(void *dummy, int howto); @@ -241,7 +241,7 @@ spinlock_exit(void) } static phandle_t -find_bsp(phandle_t node, uint32_t bspid) +find_bsp(phandle_t node, uint32_t bspid, u_int cpu_impl) { char type[sizeof("cpu")]; phandle_t child; @@ -250,7 +250,7 @@ find_bsp(phandle_t node, uint32_t bspid) for (; node != 0; node = OF_peer(node)) { child = OF_child(node); if (child > 0) { - child = find_bsp(child, bspid); + child = find_bsp(child, bspid, cpu_impl); if (child > 0) return (child); } else { @@ -259,7 +259,7 @@ find_bsp(phandle_t node, uint32_t bspid) continue; if (strcmp(type, "cpu") != 0) continue; - if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + if (OF_getprop(node, cpu_cpuid_prop(cpu_impl), &cpuid, sizeof(cpuid)) <= 0) continue; if (cpuid == bspid) @@ -270,7 +270,7 @@ find_bsp(phandle_t node, uint32_t bspid) } const char * -cpu_cpuid_prop(void) +cpu_cpuid_prop(u_int cpu_impl) { switch (cpu_impl) { @@ -294,7 +294,7 @@ cpu_cpuid_prop(void) } uint32_t -cpu_get_mid(void) +cpu_get_mid(u_int cpu_impl) { switch (cpu_impl) { @@ -328,6 +328,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l vm_offset_t va; caddr_t kmdp; phandle_t root; + u_int cpu_impl; end = 0; kmdp = NULL; @@ -342,12 +343,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Do CPU-specific Initialization. */ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - cheetah_init(); + cheetah_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). */ - tick_clear(); + tick_clear(cpu_impl); /* * UltraSparc II[e,i] based systems come up with the tick interrupt @@ -357,7 +358,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * enabled, causing an interrupt storm on startup since they are not * handled. */ - tick_stop(); + tick_stop(cpu_impl); /* * Set up Open Firmware entry points. @@ -399,7 +400,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_mid = cpu_get_mid(); + pc->pc_impl = cpu_impl; + pc->pc_mid = cpu_get_mid(cpu_impl); pc->pc_tlb_ctx = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; @@ -409,7 +411,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * BSP is in the device tree in the first place). */ root = OF_peer(0); - pc->pc_node = find_bsp(root, pc->pc_mid); + pc->pc_node = find_bsp(root, pc->pc_mid, cpu_impl); if (pc->pc_node == 0) OF_exit(); if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, @@ -475,7 +477,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l panic("sparc64_init: cannot determine number of iTLB slots"); cache_init(pc); - cache_enable(); + cache_enable(cpu_impl); uma_set_align(pc->pc_cache.dc_linesize - 1); cpu_block_copy = bcopy; @@ -501,13 +503,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l } #ifdef SMP - mp_init(); + mp_init(cpu_impl); #endif /* * Initialize virtual memory and calculate physmem. */ - pmap_bootstrap(); + pmap_bootstrap(cpu_impl); /* * Initialize tunables. Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Wed Mar 31 21:32:52 2010 (r206005) @@ -202,17 +202,17 @@ ENTRY(mp_startup) cmp %l1, CPU_IMPL_ULTRASPARCIII bl %icc, 3f nop - mov CPU_STICKSYNC, %l1 + mov CPU_STICKSYNC, %l2 membar #StoreLoad - stw %l1, [%l0 + CSA_STATE] + stw %l2, [%l0 + CSA_STATE] -2: ldx [%l0 + CSA_STICK], %l1 - brz %l1, 2b +2: ldx [%l0 + CSA_STICK], %l2 + brz %l2, 2b nop - wr %l1, 0, %asr24 + wr %l2, 0, %asr24 3: call cpu_get_mid - nop + mov %l1, %o0 /* * Inform the boot processor we have inited. Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Wed Mar 31 21:32:52 2010 (r206005) @@ -119,11 +119,11 @@ static u_int cpuid_to_mid[MAXCPU]; static int isjbus; static volatile u_int shutdown_cpus; -static void ap_count(phandle_t node, u_int mid); -static void ap_start(phandle_t node, u_int mid); +static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); +static void ap_start(phandle_t node, u_int mid, u_int cpu_impl); static void cpu_mp_unleash(void *v); static void foreach_ap(phandle_t node, void (*func)(phandle_t node, - u_int mid)); + u_int mid, u_int cpu_impl)); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); @@ -137,7 +137,7 @@ CTASSERT(MAXCPU <= sizeof(u_int) * NBBY) CTASSERT(MAXCPU <= sizeof(int) * NBBY); void -mp_init(void) +mp_init(u_int cpu_impl) { struct tte *tp; int i; @@ -171,11 +171,13 @@ mp_init(void) } static void -foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid)) +foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid, + u_int cpu_impl)) { char type[sizeof("cpu")]; phandle_t child; u_int cpuid; + uint32_t cpu_impl; /* There's no need to traverse the whole OFW tree twice. */ if (mp_maxid > 0 && mp_ncpus >= mp_maxid + 1) @@ -191,12 +193,17 @@ foreach_ap(phandle_t node, void (*func)( continue; if (strcmp(type, "cpu") != 0) continue; - if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, - sizeof(cpuid)) <= 0) - panic("%s: can't get module ID", __func__); + if (OF_getprop(node, "implementation#", &cpu_impl, + sizeof(cpu_impl)) <= 0) + panic("%s: couldn't determine CPU " + "implementation", __func__); + if (OF_getprop(node, cpu_cpuid_prop(cpu_impl), &cpuid, + sizeof(cpuid)) <= 0) + panic("%s: couldn't determine CPU module ID", + __func__); if (cpuid == PCPU_GET(mid)) continue; - (*func)(node, cpuid); + (*func)(node, cpuid, cpu_impl); } } } @@ -216,7 +223,7 @@ cpu_mp_setmaxid() } static void -ap_count(phandle_t node __unused, u_int mid __unused) +ap_count(phandle_t node __unused, u_int mid __unused, u_int cpu_impl __unused) { mp_maxid++; @@ -283,20 +290,20 @@ cpu_mp_start(void) } static void -ap_start(phandle_t node, u_int mid) +ap_start(phandle_t node, u_int mid, u_int cpu_impl) { volatile struct cpu_start_args *csa; struct pcpu *pc; register_t s; vm_offset_t va; - u_int clock; u_int cpuid; + uint32_t clock; if (mp_ncpus > MAXCPU) return; if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) - panic("%s: can't get clock", __func__); + panic("%s: couldn't determine CPU frequency", __func__); if (clock != PCPU_GET(clock)) hardclock_use_stick = 1; @@ -329,6 +336,7 @@ ap_start(phandle_t node, u_int mid) dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), cpuid); pc->pc_addr = va; pc->pc_clock = clock; + pc->pc_impl = cpu_impl; pc->pc_mid = mid; pc->pc_node = node; @@ -401,9 +409,9 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - cheetah_init(); - cache_enable(); + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + cheetah_init(pc->pc_impl); + cache_enable(pc->pc_impl); pmap_map_tsb(); /* * Flush all non-locked TLB entries possibly left over by the Modified: stable/8/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/nexus.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/nexus.c Wed Mar 31 21:32:52 2010 (r206005) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -522,7 +523,7 @@ nexus_setup_dinfo(device_t dev, phandle_ nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { - if (OF_getprop(node, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + if (OF_getprop(node, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? "upa-portid" : "portid", &ign, sizeof(ign)) <= 0) { device_printf(dev, "<%s>: could not determine portid\n", ndi->ndi_obdinfo.obd_name); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:32:52 2010 (r206005) @@ -278,7 +278,7 @@ om_cmp(const void *a, const void *b) * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(void) +pmap_bootstrap(u_int cpu_impl) { struct pmap *pm; struct tte *tp; @@ -1543,7 +1543,7 @@ pmap_copy_tte(pmap_t src_pmap, pmap_t ds void pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, - vm_size_t len, vm_offset_t src_addr) + vm_size_t len, vm_offset_t src_addr) { struct tte *tp; vm_offset_t va; @@ -1998,6 +1998,7 @@ pmap_activate(struct thread *td) void pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) { + } /* Modified: stable/8/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/8/sys/sparc64/sparc64/spitfire.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/spitfire.c Wed Mar 31 21:32:52 2010 (r206005) @@ -56,7 +56,7 @@ PMAP_STATS_VAR(spitfire_icache_npage_inv * Enable the level 1 caches. */ void -spitfire_cache_enable(void) +spitfire_cache_enable(u_int cpu_impl __unused) { u_long lsu; Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/tick.c Wed Mar 31 21:32:52 2010 (r206005) @@ -120,7 +120,7 @@ cpu_initclocks(void) */ } else { clock = PCPU_GET(clock); - intr_setup(PIL_TICK, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + intr_setup(PIL_TICK, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? tick_hardclock_bbwar : tick_hardclock, -1, NULL, NULL); set_cputicker(tick_cputicks, clock, 0); } @@ -322,7 +322,7 @@ tick_start(void) } void -tick_clear(void) +tick_clear(u_int cpu_impl) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) @@ -331,7 +331,7 @@ tick_clear(void) } void -tick_stop(void) +tick_stop(u_int cpu_impl) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Wed Mar 31 21:32:52 2010 (r206004) +++ stable/8/sys/sparc64/sparc64/trap.c Wed Mar 31 21:32:52 2010 (r206005) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -391,7 +392,7 @@ trap(struct trapframe *tf) if (tf->tf_tpc > (u_long)fas_nofault_begin && tf->tf_tpc < (u_long)fas_nofault_end) { cache_flush(); - cache_enable(); + cache_enable(PCPU_GET(impl)); tf->tf_tpc = (u_long)fas_fault; tf->tf_tnpc = tf->tf_tpc + 4; error = 0; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 21:41:01 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA81106566B; Wed, 31 Mar 2010 21:41:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A1548FC16; Wed, 31 Mar 2010 21:41:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VLf1gM029973; Wed, 31 Mar 2010 21:41:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VLf1DA029971; Wed, 31 Mar 2010 21:41:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312141.o2VLf1DA029971@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 21:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206007 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 21:41:01 -0000 Author: marius Date: Wed Mar 31 21:41:00 2010 New Revision: 206007 URL: http://svn.freebsd.org/changeset/base/206007 Log: MFC: r204153 Starting with UltraSPARC IV CPUs the CPU caches are described with different OFW properties. Modified: stable/8/sys/sparc64/sparc64/cache.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cache.c Wed Mar 31 21:33:51 2010 (r206006) +++ stable/8/sys/sparc64/sparc64/cache.c Wed Mar 31 21:41:00 2010 (r206007) @@ -43,6 +43,7 @@ */ /*- * Copyright (c) 2001 by Thomas Moestl . + * Copyright (c) 2008, 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,32 +90,49 @@ icache_page_inval_t *icache_page_inval; #define OF_GET(h, n, v) OF_getprop((h), (n), &(v), sizeof(v)) +static u_int cache_new_prop(u_int cpu_impl); + +static u_int +cache_new_prop(u_int cpu_impl) +{ + + switch (cpu_impl) { + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (1); + default: + return (0); + } +} + /* - * Fill in the cache parameters using the cpu node. + * Fill in the cache parameters using the CPU node. */ void cache_init(struct pcpu *pcpu) { u_long set; + u_int use_new_prop; - if (OF_GET(pcpu->pc_node, "icache-size", - pcpu->pc_cache.ic_size) == -1 || - OF_GET(pcpu->pc_node, "icache-line-size", - pcpu->pc_cache.ic_linesize) == -1 || - OF_GET(pcpu->pc_node, "icache-associativity", - pcpu->pc_cache.ic_assoc) == -1 || - OF_GET(pcpu->pc_node, "dcache-size", - pcpu->pc_cache.dc_size) == -1 || - OF_GET(pcpu->pc_node, "dcache-line-size", - pcpu->pc_cache.dc_linesize) == -1 || - OF_GET(pcpu->pc_node, "dcache-associativity", - pcpu->pc_cache.dc_assoc) == -1 || - OF_GET(pcpu->pc_node, "ecache-size", - pcpu->pc_cache.ec_size) == -1 || - OF_GET(pcpu->pc_node, "ecache-line-size", - pcpu->pc_cache.ec_linesize) == -1 || - OF_GET(pcpu->pc_node, "ecache-associativity", - pcpu->pc_cache.ec_assoc) == -1) + use_new_prop = cache_new_prop(pcpu->pc_impl); + if (OF_GET(pcpu->pc_node, !use_new_prop ? "icache-size" : + "l1-icache-size", pcpu->pc_cache.ic_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "icache-line-size" : + "l1-icache-line-size", pcpu->pc_cache.ic_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "icache-associativity" : + "l1-icache-associativity", pcpu->pc_cache.ic_assoc) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-size" : + "l1-dcache-size", pcpu->pc_cache.dc_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-line-size" : + "l1-dcache-line-size", pcpu->pc_cache.dc_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-associativity" : + "l1-dcache-associativity", pcpu->pc_cache.dc_assoc) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-size" : + "l2-cache-size", pcpu->pc_cache.ec_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-line-size" : + "l2-cache-line-size", pcpu->pc_cache.ec_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-associativity" : + "l2-cache-associativity", pcpu->pc_cache.ec_assoc) == -1) panic("cache_init: could not retrieve cache parameters"); set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc; From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 21:57:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68E4E106566B; Wed, 31 Mar 2010 21:57:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55F558FC1C; Wed, 31 Mar 2010 21:57:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VLvnRq034213; Wed, 31 Mar 2010 21:57:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VLvnMF034206; Wed, 31 Mar 2010 21:57:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312157.o2VLvnMF034206@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 21:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206009 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 21:57:49 -0000 Author: marius Date: Wed Mar 31 21:57:48 2010 New Revision: 206009 URL: http://svn.freebsd.org/changeset/base/206009 Log: MFC: r205258 - Add TTE and context register bits for the additional page sizes supported by UltraSparc-IV and -IV+ as well as SPARC64 V, VI, VII and VIIIfx CPUs. - Replace TLB_PCXR_PGSZ_MASK and TLB_SCXR_PGSZ_MASK with TLB_CXR_PGSZ_MASK which just is the complement of TLB_CXR_CTX_MASK instead of trying to assemble it from the page size bits which vary across CPUs. - Add macros for the remainder of the SFSR bits, which are useful for at least debugging purposes. Modified: stable/8/sys/sparc64/include/tlb.h stable/8/sys/sparc64/include/tte.h stable/8/sys/sparc64/sparc64/genassym.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sparc64/sparc64/swtch.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/tlb.h ============================================================================== --- stable/8/sys/sparc64/include/tlb.h Wed Mar 31 21:41:03 2010 (r206008) +++ stable/8/sys/sparc64/include/tlb.h Wed Mar 31 21:57:48 2010 (r206009) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2008, 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,11 +36,11 @@ #define TLB_DIRECT_ADDRESS_MASK ((1UL << TLB_DIRECT_ADDRESS_BITS) - 1) #define TLB_DIRECT_PAGE_MASK ((1UL << TLB_DIRECT_PAGE_BITS) - 1) -#define TLB_PHYS_TO_DIRECT(pa) \ +#define TLB_PHYS_TO_DIRECT(pa) \ ((pa) | VM_MIN_DIRECT_ADDRESS) -#define TLB_DIRECT_TO_PHYS(va) \ +#define TLB_DIRECT_TO_PHYS(va) \ ((va) & TLB_DIRECT_ADDRESS_MASK) -#define TLB_DIRECT_TO_TTE_MASK \ +#define TLB_DIRECT_TO_TTE_MASK \ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) @@ -56,18 +57,21 @@ (((1UL << TLB_CXR_CTX_BITS) - 1) << TLB_CXR_CTX_SHIFT) #define TLB_CXR_CTX_SHIFT (0) #define TLB_CXR_PGSZ_BITS (3) -#define TLB_PCXR_PGSZ_MASK \ - ((((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_N_PGSZ0_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_N_PGSZ1_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_P_PGSZ0_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_PCXR_P_PGSZ1_SHIFT)) +#define TLB_CXR_PGSZ_MASK (~TLB_CXR_CTX_MASK) +#define TLB_PCXR_N_IPGSZ0_SHIFT (53) /* SPARC64 VI, VII, VIIIfx */ +#define TLB_PCXR_N_IPGSZ1_SHIFT (50) /* SPARC64 VI, VII, VIIIfx */ #define TLB_PCXR_N_PGSZ0_SHIFT (61) #define TLB_PCXR_N_PGSZ1_SHIFT (58) +#define TLB_PCXR_N_PGSZ_I_SHIFT (55) /* US-IV+ */ +#define TLB_PCXR_P_IPGSZ0_SHIFT (24) /* SPARC64 VI, VII, VIIIfx */ +#define TLB_PCXR_P_IPGSZ1_SHIFT (27) /* SPARC64 VI, VII, VIIIfx */ #define TLB_PCXR_P_PGSZ0_SHIFT (16) #define TLB_PCXR_P_PGSZ1_SHIFT (19) -#define TLB_SCXR_PGSZ_MASK \ - ((((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_SCXR_S_PGSZ0_SHIFT) | \ - (((1UL << TLB_CXR_PGSZ_BITS) - 1) << TLB_SCXR_S_PGSZ1_SHIFT)) +/* + * Note that the US-IV+ documentation appears to have TLB_PCXR_P_PGSZ_I_SHIFT + * and TLB_PCXR_P_PGSZ0_SHIFT erroneously inverted. + */ +#define TLB_PCXR_P_PGSZ_I_SHIFT (22) /* US-IV+ */ #define TLB_SCXR_S_PGSZ1_SHIFT (19) #define TLB_SCXR_S_PGSZ0_SHIFT (16) @@ -87,7 +91,7 @@ #define TLB_DEMAP_TYPE_SHIFT (6) #define TLB_DEMAP_TYPE_PAGE (0) #define TLB_DEMAP_TYPE_CONTEXT (1) -#define TLB_DEMAP_TYPE_ALL (2) /* USIII and beyond only */ +#define TLB_DEMAP_TYPE_ALL (2) /* US-III and beyond only */ #define TLB_DEMAP_VA(va) ((va) & ~PAGE_MASK) #define TLB_DEMAP_ID(id) ((id) << TLB_DEMAP_ID_SHIFT) @@ -118,9 +122,17 @@ #define MMU_SFSR_FT_SIZE (6) #define MMU_SFSR_CT_SIZE (2) -#define MMU_SFSR_GET_ASI(sfsr) \ +#define MMU_SFSR_GET_ASI(sfsr) \ (((sfsr) >> MMU_SFSR_ASI_SHIFT) & ((1UL << MMU_SFSR_ASI_SIZE) - 1)) +#define MMU_SFSR_GET_FT(sfsr) \ + (((sfsr) >> MMU_SFSR_FT_SHIFT) & ((1UL << MMU_SFSR_FT_SIZE) - 1)) +#define MMU_SFSR_GET_CT(sfsr) \ + (((sfsr) >> MMU_SFSR_CT_SHIFT) & ((1UL << MMU_SFSR_CT_SIZE) - 1)) + +#define MMU_SFSR_E (1UL << MMU_SFSR_E_SHIFT) +#define MMU_SFSR_PR (1UL << MMU_SFSR_PR_SHIFT) #define MMU_SFSR_W (1UL << MMU_SFSR_W_SHIFT) +#define MMU_SFSR_OW (1UL << MMU_SFSR_OW_SHIFT) #define MMU_SFSR_FV (1UL << MMU_SFSR_FV_SHIFT) typedef void tlb_flush_nonlocked_t(void); Modified: stable/8/sys/sparc64/include/tte.h ============================================================================== --- stable/8/sys/sparc64/include/tte.h Wed Mar 31 21:41:03 2010 (r206008) +++ stable/8/sys/sparc64/include/tte.h Wed Mar 31 21:57:48 2010 (r206009) @@ -36,25 +36,42 @@ #define TD_SIZE_SHIFT (61) #define TD_SOFT2_SHIFT (50) +#define TD_RSVD2_SHIFT (49) +#define TD_SIZE2_SHIFT (48) #define TD_DIAG_SF_SHIFT (41) #define TD_RSVD_CH_SHIFT (43) +#define TD_RSVD_OC_SHIFT (47) +#define TD_RSVD_PT_SHIFT TD_RSVD_CH_SHIFT +#define TD_RSVD_VE_SHIFT (41) #define TD_PA_SHIFT (13) #define TD_SOFT_SHIFT (7) #define TD_SIZE_BITS (2) #define TD_SOFT2_BITS (9) -#define TD_DIAG_SF_BITS (9) -#define TD_RSVD_CH_BITS (7) -#define TD_PA_CH_BITS (30) -#define TD_PA_SF_BITS (28) +#define TD_RSVD2_BITS (1) /* US-IV+, SPARC64 VI, VII, VIIIfx */ +#define TD_SIZE2_BITS (1) /* US-IV+, SPARC64 VI, VII, VIIIfx */ +#define TD_DIAG_SF_BITS (9) /* US-I, II{,e,i} */ +#define TD_RSVD_CH_BITS (7) /* US-III{,i,+}, US-IV, SPARC64 V */ +#define TD_RSVD_OC_BITS (1) /* SPARC64 VI, VII */ +#define TD_RSVD_PT_BITS (5) /* US-IV+, SPARC64 VI, VII */ +#define TD_RSVD_VE_BITS (7) /* SPARC64 VIIIfx */ +#define TD_PA_CH_BITS (30) /* US-III{,i,+}, US-IV{,+}, SPARC64 V */ +#define TD_PA_OC_BITS (34) /* SPARC64 VI, VII */ +#define TD_PA_SF_BITS (28) /* US-I, II{,e,i}, SPARC64 VIIIfx */ #define TD_PA_BITS TD_PA_CH_BITS #define TD_SOFT_BITS (6) #define TD_SIZE_MASK ((1UL << TD_SIZE_BITS) - 1) #define TD_SOFT2_MASK ((1UL << TD_SOFT2_BITS) - 1) +#define TD_RSVD2_MASK ((1UL << TD_RSVD2_BITS) - 1) +#define TD_SIZE2_MASK ((1UL << TD_SIZE2_BITS) - 1) #define TD_DIAG_SF_MASK ((1UL << TD_DIAG_SF_BITS) - 1) #define TD_RSVD_CH_MASK ((1UL << TD_RSVD_CH_BITS) - 1) +#define TD_RSVD_OC_MASK ((1UL << TD_RSVD_OC_BITS) - 1) +#define TD_RSVD_PT_MASK ((1UL << TD_RSVD_PT_BITS) - 1) +#define TD_RSVD_VE_MASK ((1UL << TD_RSVD_VE_BITS) - 1) #define TD_PA_CH_MASK ((1UL << TD_PA_CH_BITS) - 1) +#define TD_PA_OC_MASK ((1UL << TD_PA_OC_BITS) - 1) #define TD_PA_SF_MASK ((1UL << TD_PA_SF_BITS) - 1) #define TD_PA_MASK ((1UL << TD_PA_BITS) - 1) #define TD_SOFT_MASK ((1UL << TD_SOFT_BITS) - 1) @@ -63,6 +80,9 @@ #define TS_64K (1UL) #define TS_512K (2UL) #define TS_4M (3UL) +#define TS_32M (4UL) /* US-IV+, SPARC64 VI, VII only */ +#define TS_256M (5UL) /* US-IV+, SPARC64 VI, VII only */ +#define TS_2G (6UL) /* SPARC64 VIIIfx only */ #define TS_MIN TS_8K #define TS_MAX TS_4M @@ -72,6 +92,15 @@ #define TD_64K (TS_64K << TD_SIZE_SHIFT) #define TD_512K (TS_512K << TD_SIZE_SHIFT) #define TD_4M (TS_4M << TD_SIZE_SHIFT) +#define TD_32M \ + (((TS_32M & TD_SIZE_MASK) << TD_SIZE_SHIFT) | \ + (TD_SIZE2_MASK << TD_SIZE2_SHIFT)) +#define TD_256M \ + (((TS_256M & TD_SIZE_MASK) << TD_SIZE_SHIFT) | \ + (TD_SIZE2_MASK << TD_SIZE2_SHIFT)) +#define TD_2G \ + (((TS_2G & TD_SIZE_MASK) << TD_SIZE_SHIFT) | \ + (TD_SIZE2_MASK << TD_SIZE2_SHIFT)) #define TD_NFO (1UL << 60) #define TD_IE (1UL << 59) #define TD_PA(pa) ((pa) & (TD_PA_MASK << TD_PA_SHIFT)) @@ -94,29 +123,28 @@ #define TV_VPN(va, sz) ((((va) >> TTE_PAGE_SHIFT(sz)) << TV_SIZE_BITS) | sz) #define TTE_SIZE_SPREAD (3) -#define TTE_PAGE_SHIFT(sz) \ +#define TTE_PAGE_SHIFT(sz) \ (PAGE_SHIFT + ((sz) * TTE_SIZE_SPREAD)) -#define TTE_GET_SIZE(tp) \ +#define TTE_GET_SIZE(tp) \ (((tp)->tte_data >> TD_SIZE_SHIFT) & TD_SIZE_MASK) -#define TTE_GET_PAGE_SHIFT(tp) \ +#define TTE_GET_PAGE_SHIFT(tp) \ TTE_PAGE_SHIFT(TTE_GET_SIZE(tp)) -#define TTE_GET_PAGE_SIZE(tp) \ +#define TTE_GET_PAGE_SIZE(tp) \ (1 << TTE_GET_PAGE_SHIFT(tp)) -#define TTE_GET_PAGE_MASK(tp) \ +#define TTE_GET_PAGE_MASK(tp) \ (TTE_GET_PAGE_SIZE(tp) - 1) -#define TTE_GET_PA(tp) \ +#define TTE_GET_PA(tp) \ ((tp)->tte_data & (TD_PA_MASK << TD_PA_SHIFT)) -#define TTE_GET_VPN(tp) \ +#define TTE_GET_VPN(tp) \ ((tp)->tte_vpn >> TV_SIZE_BITS) -#define TTE_GET_VA(tp) \ +#define TTE_GET_VA(tp) \ (TTE_GET_VPN(tp) << TTE_GET_PAGE_SHIFT(tp)) -#define TTE_GET_PMAP(tp) \ - (((tp)->tte_data & TD_P) != 0 ? \ - (kernel_pmap) : \ - (PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)(tp)))->md.pmap)) -#define TTE_ZERO(tp) \ +#define TTE_GET_PMAP(tp) \ + (((tp)->tte_data & TD_P) != 0 ? (kernel_pmap) : \ + (PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)(tp)))->md.pmap)) +#define TTE_ZERO(tp) \ memset(tp, 0, sizeof(*tp)) struct pmap; @@ -130,6 +158,7 @@ struct tte { static __inline int tte_match(struct tte *tp, vm_offset_t va) { + return (((tp->tte_data & TD_V) != 0) && (tp->tte_vpn == TV_VPN(va, TTE_GET_SIZE(tp)))); } Modified: stable/8/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/8/sys/sparc64/sparc64/genassym.c Wed Mar 31 21:41:03 2010 (r206008) +++ stable/8/sys/sparc64/sparc64/genassym.c Wed Mar 31 21:57:48 2010 (r206009) @@ -139,7 +139,7 @@ ASSYM(TD_W, TD_W); ASSYM(TS_MIN, TS_MIN); ASSYM(TS_MAX, TS_MAX); ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT); -ASSYM(TLB_PCXR_PGSZ_MASK, TLB_PCXR_PGSZ_MASK); +ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); #endif Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:41:03 2010 (r206008) +++ stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 21:57:48 2010 (r206009) @@ -572,7 +572,7 @@ pmap_map_tsb(void) * FP block operations in the kernel). */ stxa(AA_DMMU_SCXR, ASI_DMMU, (ldxa(AA_DMMU_SCXR, ASI_DMMU) & - TLB_SCXR_PGSZ_MASK) | TLB_CTX_KERNEL); + TLB_CXR_PGSZ_MASK) | TLB_CTX_KERNEL); flush(KERNBASE); intr_restore(s); @@ -1989,7 +1989,7 @@ pmap_activate(struct thread *td) stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & - TLB_PCXR_PGSZ_MASK) | context); + TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); mtx_unlock_spin(&sched_lock); Modified: stable/8/sys/sparc64/sparc64/swtch.S ============================================================================== --- stable/8/sys/sparc64/sparc64/swtch.S Wed Mar 31 21:41:03 2010 (r206008) +++ stable/8/sys/sparc64/sparc64/swtch.S Wed Mar 31 21:57:48 2010 (r206009) @@ -237,7 +237,7 @@ ENTRY(cpu_switch) stxa %i4, [%i5] ASI_DMMU mov AA_IMMU_TSB, %i5 stxa %i4, [%i5] ASI_IMMU - setx TLB_PCXR_PGSZ_MASK, %i5, %i4 + setx TLB_CXR_PGSZ_MASK, %i5, %i4 mov AA_DMMU_PCXR, %i5 ldxa [%i5] ASI_DMMU, %l1 and %l1, %i4, %l1 From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 22:00:22 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61FB8106566B; Wed, 31 Mar 2010 22:00:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5041C8FC08; Wed, 31 Mar 2010 22:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VM0MgK034904; Wed, 31 Mar 2010 22:00:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VM0McW034902; Wed, 31 Mar 2010 22:00:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312200.o2VM0McW034902@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 22:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206011 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 22:00:22 -0000 Author: marius Date: Wed Mar 31 22:00:22 2010 New Revision: 206011 URL: http://svn.freebsd.org/changeset/base/206011 Log: MFC: r205263 Add macros for the VER.impl of SPARC64 II to VIIIfx. Modified: stable/8/sys/sparc64/include/ver.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/ver.h ============================================================================== --- stable/8/sys/sparc64/include/ver.h Wed Mar 31 21:57:49 2010 (r206010) +++ stable/8/sys/sparc64/include/ver.h Wed Mar 31 22:00:22 2010 (r206011) @@ -69,8 +69,15 @@ extern char sparc64_model[]; #endif /* !LOCORE */ -/* Known implementations. */ +/* Known implementations */ #define CPU_IMPL_SPARC64 0x01 +#define CPU_IMPL_SPARC64II 0x02 +#define CPU_IMPL_SPARC64III 0x03 +#define CPU_IMPL_SPARC64IV 0x04 +#define CPU_IMPL_SPARC64V 0x05 +#define CPU_IMPL_SPARC64VI 0x06 +#define CPU_IMPL_SPARC64VII 0x07 +#define CPU_IMPL_SPARC64VIIIfx 0x08 #define CPU_IMPL_ULTRASPARCI 0x10 #define CPU_IMPL_ULTRASPARCII 0x11 #define CPU_IMPL_ULTRASPARCIIi 0x12 From owner-svn-src-stable-8@FreeBSD.ORG Wed Mar 31 22:05:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09F7D1065672; Wed, 31 Mar 2010 22:05:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC1F58FC12; Wed, 31 Mar 2010 22:05:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2VM5nIF036216; Wed, 31 Mar 2010 22:05:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2VM5nt1036214; Wed, 31 Mar 2010 22:05:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201003312205.o2VM5nt1036214@svn.freebsd.org> From: Marius Strobl Date: Wed, 31 Mar 2010 22:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206013 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2010 22:05:50 -0000 Author: marius Date: Wed Mar 31 22:05:49 2010 New Revision: 206013 URL: http://svn.freebsd.org/changeset/base/206013 Log: MFC: r205399 Improve the KVA space sizing of r186682; on machines with large dTLBs we can actually use all of the available lockable entries of the tiny dTLB for the kernel TSB. With this change the KVA space sizing happens to be more in line with the MI one so up to at least 24GB machines KVA doesn't need to be limited manually. This is just another stopgap though, the real solution is to take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs providing it so we don't need to lock the kernel TSB pages into the dTLB in the first place. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 22:00:22 2010 (r206012) +++ stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 31 22:05:49 2010 (r206013) @@ -236,6 +236,8 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); +static inline u_long dtlb_get_data(u_int slot); + /* * Quick sort callout for comparing memory regions */ @@ -274,6 +276,18 @@ om_cmp(const void *a, const void *b) return (0); } +static inline u_long +dtlb_get_data(u_int slot) +{ + + /* + * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work + * around errata of USIII and beyond. + */ + (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); + return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); +} + /* * Bootstrap the system enough to run with virtual memory. */ @@ -287,11 +301,13 @@ pmap_bootstrap(u_int cpu_impl) vm_paddr_t pa; vm_size_t physsz; vm_size_t virtsz; + u_long data; phandle_t pmem; phandle_t vmem; - int sz; + u_int dtlb_slots_avail; int i; int j; + int sz; /* * Find out what physical memory is available from the PROM and @@ -336,22 +352,30 @@ pmap_bootstrap(u_int cpu_impl) /* * Calculate the size of kernel virtual memory, and the size and mask * for the kernel TSB based on the phsyical memory size but limited - * by letting the kernel TSB take up no more than half of the dTLB - * slots available for locked entries. - */ + * by the amount of dTLB slots available for locked entries (given + * that for spitfire-class CPUs all of the dt64 slots can hold locked + * entries but there is no large dTLB for unlocked ones, we don't use + * more than half of it for locked entries). + */ + dtlb_slots_avail = 0; + for (i = 0; i < dtlb_slots; i++) { + data = dtlb_get_data(i); + if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) + dtlb_slots_avail++; + } +#ifdef SMP + dtlb_slots_avail -= PCPU_PAGES; +#endif + if (cpu_impl >= CPU_IMPL_ULTRASPARCI && + cpu_impl < CPU_IMPL_ULTRASPARCIII) + dtlb_slots_avail /= 2; virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); virtsz = MIN(virtsz, - (dtlb_slots / 2 * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); + (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); vm_max_kernel_address = VM_MIN_KERNEL_ADDRESS + virtsz; tsb_kernel_size = virtsz >> (PAGE_SHIFT - TTE_SHIFT); tsb_kernel_mask = (tsb_kernel_size >> TTE_SHIFT) - 1; - if (kernel_tlb_slots + PCPU_PAGES + tsb_kernel_size / PAGE_SIZE_4M + - 1 /* PROM page */ + 1 /* spare */ > dtlb_slots) - panic("pmap_bootstrap: insufficient dTLB entries"); - if (kernel_tlb_slots + 1 /* PROM page */ + 1 /* spare */ > itlb_slots) - panic("pmap_bootstrap: insufficient iTLB entries"); - /* * Allocate the kernel TSB and lock it in the TLB. */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 00:36:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 073DD1065670; Thu, 1 Apr 2010 00:36:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7F798FC0C; Thu, 1 Apr 2010 00:36:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o310aeYo070173; Thu, 1 Apr 2010 00:36:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o310ae4T070170; Thu, 1 Apr 2010 00:36:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004010036.o310ae4T070170@svn.freebsd.org> From: Kip Macy Date: Thu, 1 Apr 2010 00:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206024 - in stable/8/sys: net netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 00:36:41 -0000 Author: kmacy Date: Thu Apr 1 00:36:40 2010 New Revision: 206024 URL: http://svn.freebsd.org/changeset/base/206024 Log: MFC 205066, 205069, 205093, 205097, 205488: r205066: Log: - restructure flowtable to support ipv6 - add a name argument to flowtable_alloc for printing with ddb commands - extend ddb commands to print destination address or 4-tuples - don't parse ports in ulp header if FL_HASH_ALL is not passed - add kern_flowtable_insert to enable more generic use of flowtable (e.g. system calls for adding entries) - don't hash loopback addresses - cleanup whitespace - keep statistics per-cpu for per-cpu flowtables to avoid cache line contention - add sysctls to accumulate stats and report aggregate r205069: Log: fix stats reporting sysctl r205093: Log: re-update copyright to 2010 pointed out by danfe@ r205097: Log: flowtable_get_hashkey is only used by a DDB function - move under #ifdef DDB pointed out by jkim@ r205488: Log: - boot-time size the ipv4 flowtable and the maximum number of flows - increase flow cleaning frequency and decrease flow caching time when near the flow limit - stop allocating new flows when within 3% of maxflows don't start allocating again until below 12.5% Modified: stable/8/sys/net/flowtable.c stable/8/sys/net/flowtable.h stable/8/sys/net/if_llatbl.c stable/8/sys/net/if_llatbl.h stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/ip_output.c Directory Properties: stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Wed Mar 31 23:24:42 2010 (r206023) +++ stable/8/sys/net/flowtable.c Thu Apr 1 00:36:40 2010 (r206024) @@ -1,6 +1,6 @@ /************************************************************************** -Copyright (c) 2008-2009, BitGravity Inc. +Copyright (c) 2008-2010, BitGravity Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. #include "opt_route.h" #include "opt_mpath.h" #include "opt_ddb.h" +#include "opt_inet.h" +#include "opt_inet6.h" #include __FBSDID("$FreeBSD$"); @@ -45,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,6 +66,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#endif #include #include #include @@ -140,31 +146,42 @@ union flentryp { struct flentry **pcpu[MAXCPU]; }; +struct flowtable_stats { + uint64_t ft_collisions; + uint64_t ft_allocated; + uint64_t ft_misses; + uint64_t ft_max_depth; + uint64_t ft_free_checks; + uint64_t ft_frees; + uint64_t ft_hits; + uint64_t ft_lookups; +} __aligned(CACHE_LINE_SIZE); + struct flowtable { + struct flowtable_stats ft_stats[MAXCPU]; int ft_size; int ft_lock_count; uint32_t ft_flags; - uint32_t ft_collisions; - uint32_t ft_allocated; - uint32_t ft_misses; - uint64_t ft_hits; - - uint32_t ft_udp_idle; - uint32_t ft_fin_wait_idle; - uint32_t ft_syn_idle; - uint32_t ft_tcp_idle; - + char *ft_name; fl_lock_t *ft_lock; fl_lock_t *ft_unlock; fl_rtalloc_t *ft_rtalloc; + /* + * XXX need to pad out + */ struct mtx *ft_locks; - - union flentryp ft_table; bitstr_t *ft_masks[MAXCPU]; bitstr_t *ft_tmpmask; struct flowtable *ft_next; -}; + + uint32_t ft_count __aligned(CACHE_LINE_SIZE); + uint32_t ft_udp_idle __aligned(CACHE_LINE_SIZE); + uint32_t ft_fin_wait_idle; + uint32_t ft_syn_idle; + uint32_t ft_tcp_idle; + boolean_t ft_full; +} __aligned(CACHE_LINE_SIZE); static struct proc *flowcleanerproc; static VNET_DEFINE(struct flowtable *, flow_list_head); @@ -177,16 +194,30 @@ static VNET_DEFINE(uma_zone_t, flow_ipv6 #define V_flow_ipv4_zone VNET(flow_ipv4_zone) #define V_flow_ipv6_zone VNET(flow_ipv6_zone) + static struct cv flowclean_cv; static struct mtx flowclean_lock; static uint32_t flowclean_cycles; +static uint32_t flowclean_freq; + +#ifdef FLOWTABLE_DEBUG +#define FLDPRINTF(ft, flags, fmt, ...) \ +do { \ + if ((ft)->ft_flags & (flags)) \ + printf((fmt), __VA_ARGS__); \ +} while (0); \ + +#else +#define FLDPRINTF(ft, flags, fmt, ...) + +#endif + /* * TODO: * - Make flowtable stats per-cpu, aggregated at sysctl call time, * to avoid extra cache evictions caused by incrementing a shared * counter - * - add IPv6 support to flow lookup * - add sysctls to resize && flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing @@ -200,29 +231,15 @@ static uint32_t flowclean_cycles; */ VNET_DEFINE(int, flowtable_enable) = 1; static VNET_DEFINE(int, flowtable_debug); -static VNET_DEFINE(int, flowtable_hits); -static VNET_DEFINE(int, flowtable_lookups); -static VNET_DEFINE(int, flowtable_misses); -static VNET_DEFINE(int, flowtable_frees); -static VNET_DEFINE(int, flowtable_free_checks); -static VNET_DEFINE(int, flowtable_max_depth); -static VNET_DEFINE(int, flowtable_collisions); static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; -static VNET_DEFINE(int, flowtable_nmbflows) = 4096; +static VNET_DEFINE(int, flowtable_nmbflows); static VNET_DEFINE(int, flowtable_ready) = 0; #define V_flowtable_enable VNET(flowtable_enable) #define V_flowtable_debug VNET(flowtable_debug) -#define V_flowtable_hits VNET(flowtable_hits) -#define V_flowtable_lookups VNET(flowtable_lookups) -#define V_flowtable_misses VNET(flowtable_misses) -#define V_flowtable_frees VNET(flowtable_frees) -#define V_flowtable_free_checks VNET(flowtable_free_checks) -#define V_flowtable_max_depth VNET(flowtable_max_depth) -#define V_flowtable_collisions VNET(flowtable_collisions) #define V_flowtable_syn_expire VNET(flowtable_syn_expire) #define V_flowtable_udp_expire VNET(flowtable_udp_expire) #define V_flowtable_fin_wait_expire VNET(flowtable_fin_wait_expire) @@ -235,20 +252,6 @@ SYSCTL_VNET_INT(_net_inet_flowtable, OID &VNET_NAME(flowtable_debug), 0, "print debug info."); SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(flowtable_enable), 0, "enable flowtable caching."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, hits, CTLFLAG_RD, - &VNET_NAME(flowtable_hits), 0, "# flowtable hits."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, lookups, CTLFLAG_RD, - &VNET_NAME(flowtable_lookups), 0, "# flowtable lookups."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, misses, CTLFLAG_RD, - &VNET_NAME(flowtable_misses), 0, "#flowtable misses."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, frees, CTLFLAG_RD, - &VNET_NAME(flowtable_frees), 0, "#flows freed."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, free_checks, CTLFLAG_RD, - &VNET_NAME(flowtable_free_checks), 0, "#flows free checks."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, max_depth, CTLFLAG_RD, - &VNET_NAME(flowtable_max_depth), 0, "max collision list length."); -SYSCTL_VNET_INT(_net_inet_flowtable, OID_AUTO, collisions, CTLFLAG_RD, - &VNET_NAME(flowtable_collisions), 0, "#flowtable collisions."); /* * XXX This does not end up updating timeouts at runtime @@ -298,6 +301,77 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_nmbflows, "IU", "Maximum number of flows allowed"); + + +#define FS_PRINT(sb, field) sbuf_printf((sb), "\t%s: %jd\n", #field, fs->ft_##field) + +static void +fs_print(struct sbuf *sb, struct flowtable_stats *fs) +{ + + FS_PRINT(sb, collisions); + FS_PRINT(sb, allocated); + FS_PRINT(sb, misses); + FS_PRINT(sb, max_depth); + FS_PRINT(sb, free_checks); + FS_PRINT(sb, frees); + FS_PRINT(sb, hits); + FS_PRINT(sb, lookups); +} + +static void +flowtable_show_stats(struct sbuf *sb, struct flowtable *ft) +{ + int i; + struct flowtable_stats fs, *pfs; + + if (ft->ft_flags & FL_PCPU) { + bzero(&fs, sizeof(fs)); + pfs = &fs; + for (i = 0; i <= mp_maxid; i++) { + if (CPU_ABSENT(i)) + continue; + pfs->ft_collisions += ft->ft_stats[i].ft_collisions; + pfs->ft_allocated += ft->ft_stats[i].ft_allocated; + pfs->ft_misses += ft->ft_stats[i].ft_misses; + pfs->ft_free_checks += ft->ft_stats[i].ft_free_checks; + pfs->ft_frees += ft->ft_stats[i].ft_frees; + pfs->ft_hits += ft->ft_stats[i].ft_hits; + pfs->ft_lookups += ft->ft_stats[i].ft_lookups; + if (ft->ft_stats[i].ft_max_depth > pfs->ft_max_depth) + pfs->ft_max_depth = ft->ft_stats[i].ft_max_depth; + } + } else { + pfs = &ft->ft_stats[0]; + } + fs_print(sb, pfs); +} + +static int +sysctl_flowtable_stats(SYSCTL_HANDLER_ARGS) +{ + struct flowtable *ft; + struct sbuf *sb; + int error; + + sb = sbuf_new(NULL, NULL, 64*1024, SBUF_FIXEDLEN); + + ft = V_flow_list_head; + while (ft != NULL) { + sbuf_printf(sb, "\ntable name: %s\n", ft->ft_name); + flowtable_show_stats(sb, ft); + ft = ft->ft_next; + } + sbuf_finish(sb); + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + + return (error); +} +SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats, CTLTYPE_STRING|CTLFLAG_RD, + NULL, 0, sysctl_flowtable_stats, "A", "flowtable statistics"); + + #ifndef RADIX_MPATH static void in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) @@ -342,52 +416,122 @@ flowtable_pcpu_unlock(struct flowtable * #define FL_ENTRY_LOCK(table, hash) (table)->ft_lock((table), (hash)) #define FL_ENTRY_UNLOCK(table, hash) (table)->ft_unlock((table), (hash)) -#define FL_STALE (1<<8) -#define FL_IPV6 (1<<9) +#define FL_STALE (1<<8) +#define FL_IPV6 (1<<9) +#define FL_OVERWRITE (1<<10) -static uint32_t -ipv4_flow_lookup_hash_internal(struct mbuf *m, struct route *ro, - uint32_t *key, uint16_t *flags, uint8_t *protop) +void +flow_invalidate(struct flentry *fle) { - uint16_t sport = 0, dport = 0; - struct ip *ip = NULL; - uint8_t proto = 0; + + fle->f_flags |= FL_STALE; +} + +static __inline int +proto_to_flags(uint8_t proto) +{ + int flag; + + switch (proto) { + case IPPROTO_TCP: + flag = FL_TCP; + break; + case IPPROTO_SCTP: + flag = FL_SCTP; + break; + case IPPROTO_UDP: + flag = FL_UDP; + break; + default: + flag = 0; + break; + } + + return (flag); +} + +static __inline int +flags_to_proto(int flags) +{ + int proto, protoflags; + + protoflags = flags & (FL_TCP|FL_SCTP|FL_UDP); + switch (protoflags) { + case FL_TCP: + proto = IPPROTO_TCP; + break; + case FL_SCTP: + proto = IPPROTO_SCTP; + break; + case FL_UDP: + proto = IPPROTO_UDP; + break; + default: + proto = 0; + break; + } + return (proto); +} + +#ifdef INET +#ifdef FLOWTABLE_DEBUG +static void +ipv4_flow_print_tuple(int flags, int proto, struct sockaddr_in *ssin, + struct sockaddr_in *dsin) +{ + char saddr[4*sizeof "123"], daddr[4*sizeof "123"]; + + if (flags & FL_HASH_ALL) { + inet_ntoa_r(ssin->sin_addr, saddr); + inet_ntoa_r(dsin->sin_addr, daddr); + printf("proto=%d %s:%d->%s:%d\n", + proto, saddr, ntohs(ssin->sin_port), daddr, + ntohs(dsin->sin_port)); + } else { + inet_ntoa_r(*(struct in_addr *) &dsin->sin_addr, daddr); + printf("proto=%d %s\n", proto, daddr); + } + +} +#endif + +static int +ipv4_mbuf_demarshal(struct flowtable *ft, struct mbuf *m, + struct sockaddr_in *ssin, struct sockaddr_in *dsin, uint16_t *flags) +{ + struct ip *ip; + uint8_t proto; int iphlen; - uint32_t hash; - struct sockaddr_in *sin; struct tcphdr *th; struct udphdr *uh; struct sctphdr *sh; + uint16_t sport, dport; - if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) - return (0); + proto = sport = dport = 0; + ip = mtod(m, struct ip *); + dsin->sin_family = AF_INET; + dsin->sin_len = sizeof(*dsin); + dsin->sin_addr = ip->ip_dst; + ssin->sin_family = AF_INET; + ssin->sin_len = sizeof(*ssin); + ssin->sin_addr = ip->ip_src; - key[1] = key[0] = 0; - sin = (struct sockaddr_in *)&ro->ro_dst; - if (m != NULL) { - ip = mtod(m, struct ip *); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(*sin); - sin->sin_addr = ip->ip_dst; - } else - *flags &= ~FL_HASH_PORTS; - - key[2] = sin->sin_addr.s_addr; - - if ((*flags & FL_HASH_PORTS) == 0) + proto = ip->ip_p; + if ((*flags & FL_HASH_ALL) == 0) { + FLDPRINTF(ft, FL_DEBUG_ALL, "skip port check flags=0x%x ", + *flags); goto skipports; + } - proto = ip->ip_p; iphlen = ip->ip_hl << 2; /* XXX options? */ - key[1] = ip->ip_src.s_addr; - + switch (proto) { case IPPROTO_TCP: th = (struct tcphdr *)((caddr_t)ip + iphlen); - sport = ntohs(th->th_sport); - dport = ntohs(th->th_dport); - *flags |= th->th_flags; - if (*flags & TH_RST) + sport = th->th_sport; + dport = th->th_dport; + if ((*flags & FL_HASH_ALL) && + (th->th_flags & (TH_RST|TH_FIN))) *flags |= FL_STALE; break; case IPPROTO_UDP: @@ -401,38 +545,288 @@ ipv4_flow_lookup_hash_internal(struct mb dport = sh->dest_port; break; default: - if (*flags & FL_HASH_PORTS) - goto noop; + FLDPRINTF(ft, FL_DEBUG_ALL, "proto=0x%x not supported\n", proto); + return (ENOTSUP); /* no port - hence not a protocol we care about */ break; } - *protop = proto; - /* - * If this is a transmit route cache then - * hash all flows to a given destination to - * the same bucket - */ - if ((*flags & FL_HASH_PORTS) == 0) - proto = sport = dport = 0; +skipports: + *flags |= proto_to_flags(proto); + ssin->sin_port = sport; + dsin->sin_port = dport; + return (0); +} - ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; +static uint32_t +ipv4_flow_lookup_hash_internal( + struct sockaddr_in *ssin, struct sockaddr_in *dsin, + uint32_t *key, uint16_t flags) +{ + uint16_t sport, dport; + uint8_t proto; + int offset = 0; -skipports: - hash = jenkins_hashword(key, 3, V_flow_hashjitter + proto); - if (m != NULL && (m->m_flags & M_FLOWID) == 0) { - m->m_flags |= M_FLOWID; - m->m_pkthdr.flowid = hash; + if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) + return (0); + proto = flags_to_proto(flags); + sport = dport = key[2] = key[1] = key[0] = 0; + if ((ssin != NULL) && (flags & FL_HASH_ALL)) { + key[1] = ssin->sin_addr.s_addr; + sport = ssin->sin_port; + } + if (dsin != NULL) { + key[2] = dsin->sin_addr.s_addr; + dport = dsin->sin_port; + } + if (flags & FL_HASH_ALL) { + ((uint16_t *)key)[0] = sport; + ((uint16_t *)key)[1] = dport; + } else + offset = V_flow_hashjitter + proto; + + return (jenkins_hashword(key, 3, offset)); +} + +static struct flentry * +flowtable_lookup_mbuf4(struct flowtable *ft, struct mbuf *m) +{ + struct sockaddr_storage ssa, dsa; + uint16_t flags; + struct sockaddr_in *dsin, *ssin; + + dsin = (struct sockaddr_in *)&dsa; + ssin = (struct sockaddr_in *)&ssa; + flags = ft->ft_flags; + if (ipv4_mbuf_demarshal(ft, m, ssin, dsin, &flags) != 0) + return (NULL); + + return (flowtable_lookup(ft, &ssa, &dsa, M_GETFIB(m), flags)); +} + +void +flow_to_route(struct flentry *fle, struct route *ro) +{ + uint32_t *hashkey = NULL; + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)&ro->ro_dst; + sin->sin_family = AF_INET; + sin->sin_len = sizeof(*sin); + hashkey = ((struct flentry_v4 *)fle)->fl_flow.ipf_key; + sin->sin_addr.s_addr = hashkey[2]; + ro->ro_rt = __DEVOLATILE(struct rtentry *, fle->f_rt); + ro->ro_lle = __DEVOLATILE(struct llentry *, fle->f_lle); +} +#endif /* INET */ + +#ifdef INET6 +/* + * PULLUP_TO(len, p, T) makes sure that len + sizeof(T) is contiguous, + * then it sets p to point at the offset "len" in the mbuf. WARNING: the + * pointer might become stale after other pullups (but we never use it + * this way). + */ +#define PULLUP_TO(_len, p, T) \ +do { \ + int x = (_len) + sizeof(T); \ + if ((m)->m_len < x) { \ + goto receive_failed; \ + } \ + p = (mtod(m, char *) + (_len)); \ +} while (0) + +#define TCP(p) ((struct tcphdr *)(p)) +#define SCTP(p) ((struct sctphdr *)(p)) +#define UDP(p) ((struct udphdr *)(p)) + +static int +ipv6_mbuf_demarshal(struct flowtable *ft, struct mbuf *m, + struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, uint16_t *flags) +{ + struct ip6_hdr *ip6; + uint8_t proto; + int hlen; + uint16_t src_port, dst_port; + u_short offset; + void *ulp; + + offset = hlen = src_port = dst_port = 0; + ulp = NULL; + ip6 = mtod(m, struct ip6_hdr *); + hlen = sizeof(struct ip6_hdr); + proto = ip6->ip6_nxt; + + if ((*flags & FL_HASH_ALL) == 0) + goto skipports; + + while (ulp == NULL) { + switch (proto) { + case IPPROTO_ICMPV6: + case IPPROTO_OSPFIGP: + case IPPROTO_PIM: + case IPPROTO_CARP: + case IPPROTO_ESP: + case IPPROTO_NONE: + ulp = ip6; + break; + case IPPROTO_TCP: + PULLUP_TO(hlen, ulp, struct tcphdr); + dst_port = TCP(ulp)->th_dport; + src_port = TCP(ulp)->th_sport; + if ((*flags & FL_HASH_ALL) && + (TCP(ulp)->th_flags & (TH_RST|TH_FIN))) + *flags |= FL_STALE; + break; + case IPPROTO_SCTP: + PULLUP_TO(hlen, ulp, struct sctphdr); + src_port = SCTP(ulp)->src_port; + dst_port = SCTP(ulp)->dest_port; + break; + case IPPROTO_UDP: + PULLUP_TO(hlen, ulp, struct udphdr); + dst_port = UDP(ulp)->uh_dport; + src_port = UDP(ulp)->uh_sport; + break; + case IPPROTO_HOPOPTS: /* RFC 2460 */ + PULLUP_TO(hlen, ulp, struct ip6_hbh); + hlen += (((struct ip6_hbh *)ulp)->ip6h_len + 1) << 3; + proto = ((struct ip6_hbh *)ulp)->ip6h_nxt; + ulp = NULL; + break; + case IPPROTO_ROUTING: /* RFC 2460 */ + PULLUP_TO(hlen, ulp, struct ip6_rthdr); + hlen += (((struct ip6_rthdr *)ulp)->ip6r_len + 1) << 3; + proto = ((struct ip6_rthdr *)ulp)->ip6r_nxt; + ulp = NULL; + break; + case IPPROTO_FRAGMENT: /* RFC 2460 */ + PULLUP_TO(hlen, ulp, struct ip6_frag); + hlen += sizeof (struct ip6_frag); + proto = ((struct ip6_frag *)ulp)->ip6f_nxt; + offset = ((struct ip6_frag *)ulp)->ip6f_offlg & + IP6F_OFF_MASK; + ulp = NULL; + break; + case IPPROTO_DSTOPTS: /* RFC 2460 */ + PULLUP_TO(hlen, ulp, struct ip6_hbh); + hlen += (((struct ip6_hbh *)ulp)->ip6h_len + 1) << 3; + proto = ((struct ip6_hbh *)ulp)->ip6h_nxt; + ulp = NULL; + break; + case IPPROTO_AH: /* RFC 2402 */ + PULLUP_TO(hlen, ulp, struct ip6_ext); + hlen += (((struct ip6_ext *)ulp)->ip6e_len + 2) << 2; + proto = ((struct ip6_ext *)ulp)->ip6e_nxt; + ulp = NULL; + break; + default: + PULLUP_TO(hlen, ulp, struct ip6_ext); + break; + } + } + + if (src_port == 0) { + receive_failed: + return (ENOTSUP); } - return (hash); -noop: - *protop = proto; +skipports: + dsin6->sin6_family = AF_INET6; + dsin6->sin6_len = sizeof(*dsin6); + dsin6->sin6_port = dst_port; + memcpy(&dsin6->sin6_addr, &ip6->ip6_dst, sizeof(struct in6_addr)); + + ssin6->sin6_family = AF_INET6; + ssin6->sin6_len = sizeof(*ssin6); + ssin6->sin6_port = src_port; + memcpy(&ssin6->sin6_addr, &ip6->ip6_src, sizeof(struct in6_addr)); + *flags |= proto_to_flags(proto); + return (0); } +#define zero_key(key) \ +do { \ + key[0] = 0; \ + key[1] = 0; \ + key[2] = 0; \ + key[3] = 0; \ + key[4] = 0; \ + key[5] = 0; \ + key[6] = 0; \ + key[7] = 0; \ + key[8] = 0; \ +} while (0) + +static uint32_t +ipv6_flow_lookup_hash_internal( + struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, + uint32_t *key, uint16_t flags) +{ + uint16_t sport, dport; + uint8_t proto; + int offset = 0; + + if ((V_flowtable_enable == 0) || (V_flowtable_ready == 0)) + return (0); + + proto = flags_to_proto(flags); + zero_key(key); + sport = dport = 0; + if (dsin6 != NULL) { + memcpy(&key[1], &dsin6->sin6_addr, sizeof(struct in6_addr)); + dport = dsin6->sin6_port; + } + if ((ssin6 != NULL) && (flags & FL_HASH_ALL)) { + memcpy(&key[5], &ssin6->sin6_addr, sizeof(struct in6_addr)); + sport = ssin6->sin6_port; + } + if (flags & FL_HASH_ALL) { + ((uint16_t *)key)[0] = sport; + ((uint16_t *)key)[1] = dport; + } else + offset = V_flow_hashjitter + proto; + + return (jenkins_hashword(key, 9, offset)); +} + +static struct flentry * +flowtable_lookup_mbuf6(struct flowtable *ft, struct mbuf *m) +{ + struct sockaddr_storage ssa, dsa; + struct sockaddr_in6 *dsin6, *ssin6; + uint16_t flags; + + dsin6 = (struct sockaddr_in6 *)&dsa; + ssin6 = (struct sockaddr_in6 *)&ssa; + flags = ft->ft_flags; + + if (ipv6_mbuf_demarshal(ft, m, ssin6, dsin6, &flags) != 0) + return (NULL); + + return (flowtable_lookup(ft, &ssa, &dsa, M_GETFIB(m), flags)); +} + +void +flow_to_route_in6(struct flentry *fle, struct route_in6 *ro) +{ + uint32_t *hashkey = NULL; + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&ro->ro_dst; + + sin6->sin6_family = AF_INET6; + sin6->sin6_len = sizeof(*sin6); + hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; + memcpy(&sin6->sin6_addr, &hashkey[5], sizeof (struct in6_addr)); + ro->ro_rt = __DEVOLATILE(struct rtentry *, fle->f_rt); + ro->ro_lle = __DEVOLATILE(struct llentry *, fle->f_lle); + +} +#endif /* INET6 */ + static bitstr_t * flowtable_mask(struct flowtable *ft) { @@ -511,22 +905,78 @@ flowtable_set_hashkey(struct flentry *fl hashkey[i] = key[i]; } +static struct flentry * +flow_alloc(struct flowtable *ft) +{ + struct flentry *newfle; + uma_zone_t zone; + + newfle = NULL; + zone = (ft->ft_flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone; + + newfle = uma_zalloc(zone, M_NOWAIT | M_ZERO); + if (newfle != NULL) + atomic_add_int(&ft->ft_count, 1); + return (newfle); +} + +static void +flow_free(struct flentry *fle, struct flowtable *ft) +{ + uma_zone_t zone; + + zone = (ft->ft_flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone; + atomic_add_int(&ft->ft_count, -1); + uma_zfree(zone, fle); +} + +static int +flow_full(struct flowtable *ft) +{ + boolean_t full; + uint32_t count; + + full = ft->ft_full; + count = ft->ft_count; + + if (full && (count < (V_flowtable_nmbflows - (V_flowtable_nmbflows >> 3)))) + ft->ft_full = FALSE; + else if (!full && (count > (V_flowtable_nmbflows - (V_flowtable_nmbflows >> 5)))) + ft->ft_full = TRUE; + + if (full && !ft->ft_full) { + flowclean_freq = 4*hz; + if ((ft->ft_flags & FL_HASH_ALL) == 0) + ft->ft_udp_idle = ft->ft_fin_wait_idle = + ft->ft_syn_idle = ft->ft_tcp_idle = 5; + cv_broadcast(&flowclean_cv); + } else if (!full && ft->ft_full) { + flowclean_freq = 20*hz; + if ((ft->ft_flags & FL_HASH_ALL) == 0) + ft->ft_udp_idle = ft->ft_fin_wait_idle = + ft->ft_syn_idle = ft->ft_tcp_idle = 30; + } + + return (ft->ft_full); +} + static int flowtable_insert(struct flowtable *ft, uint32_t hash, uint32_t *key, - uint8_t proto, uint32_t fibnum, struct route *ro, uint16_t flags) + uint32_t fibnum, struct route *ro, uint16_t flags) { struct flentry *fle, *fletail, *newfle, **flep; + struct flowtable_stats *fs = &ft->ft_stats[curcpu]; int depth; - uma_zone_t flezone; bitstr_t *mask; + uint8_t proto; - flezone = (flags & FL_IPV6) ? V_flow_ipv6_zone : V_flow_ipv4_zone; - newfle = uma_zalloc(flezone, M_NOWAIT | M_ZERO); + newfle = flow_alloc(ft); if (newfle == NULL) return (ENOMEM); newfle->f_flags |= (flags & FL_IPV6); - + proto = flags_to_proto(flags); + FL_ENTRY_LOCK(ft, hash); mask = flowtable_mask(ft); flep = flowtable_entry(ft, hash); @@ -539,7 +989,7 @@ flowtable_insert(struct flowtable *ft, u } depth = 0; - V_flowtable_collisions++; + fs->ft_collisions++; /* * find end of list and make sure that we were not * preempted by another thread handling this flow @@ -551,8 +1001,10 @@ flowtable_insert(struct flowtable *ft, u * or we lost a race to insert */ FL_ENTRY_UNLOCK(ft, hash); - uma_zfree((newfle->f_flags & FL_IPV6) ? - V_flow_ipv6_zone : V_flow_ipv4_zone, newfle); + flow_free(newfle, ft); + + if (flags & FL_OVERWRITE) + goto skip; return (EEXIST); } /* @@ -565,8 +1017,8 @@ flowtable_insert(struct flowtable *ft, u fle = fle->f_next; } - if (depth > V_flowtable_max_depth) - V_flowtable_max_depth = depth; + if (depth > fs->ft_max_depth) + fs->ft_max_depth = depth; fletail->f_next = newfle; fle = newfle; skip: @@ -582,6 +1034,35 @@ skip: return (0); } +int +kern_flowtable_insert(struct flowtable *ft, + struct sockaddr_storage *ssa, struct sockaddr_storage *dsa, + struct route *ro, uint32_t fibnum, int flags) +{ + uint32_t key[9], hash; + + flags = (ft->ft_flags | flags | FL_OVERWRITE); + hash = 0; + +#ifdef INET + if (ssa->ss_family == AF_INET) + hash = ipv4_flow_lookup_hash_internal((struct sockaddr_in *)ssa, + (struct sockaddr_in *)dsa, key, flags); +#endif +#ifdef INET6 + if (ssa->ss_family == AF_INET6) + hash = ipv6_flow_lookup_hash_internal((struct sockaddr_in6 *)ssa, + (struct sockaddr_in6 *)dsa, key, flags); +#endif + if (ro->ro_rt == NULL || ro->ro_lle == NULL) + return (EINVAL); + + FLDPRINTF(ft, FL_DEBUG, + "kern_flowtable_insert: key=%x:%x:%x hash=%x fibnum=%d flags=%x\n", + key[0], key[1], key[2], hash, fibnum, flags); + return (flowtable_insert(ft, hash, key, fibnum, ro, flags)); +} + static int flowtable_key_equal(struct flentry *fle, uint32_t *key) { @@ -595,7 +1076,7 @@ flowtable_key_equal(struct flentry *fle, nwords = 3; hashkey = ((struct flentry_v6 *)fle)->fl_flow.ipf_key; } - + for (i = 0; i < nwords; i++) if (hashkey[i] != key[i]) return (0); @@ -603,44 +1084,86 @@ flowtable_key_equal(struct flentry *fle, return (1); } -int -flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro, uint32_t fibnum) +struct flentry * +flowtable_lookup_mbuf(struct flowtable *ft, struct mbuf *m, int af) +{ + struct flentry *fle = NULL; + +#ifdef INET + if (af == AF_INET) + fle = flowtable_lookup_mbuf4(ft, m); +#endif +#ifdef INET6 + if (af == AF_INET6) + fle = flowtable_lookup_mbuf6(ft, m); +#endif + if (fle != NULL && m != NULL && (m->m_flags & M_FLOWID) == 0) { + m->m_flags |= M_FLOWID; + m->m_pkthdr.flowid = fle->f_fhash; + } + return (fle); +} + +struct flentry * +flowtable_lookup(struct flowtable *ft, struct sockaddr_storage *ssa, + struct sockaddr_storage *dsa, uint32_t fibnum, int flags) { uint32_t key[9], hash; struct flentry *fle; - uint16_t flags; + struct flowtable_stats *fs = &ft->ft_stats[curcpu]; uint8_t proto = 0; int error = 0; struct rtentry *rt; struct llentry *lle; + struct route sro, *ro; + struct route_in6 sro6; - flags = ft->ft_flags; - ro->ro_rt = NULL; - ro->ro_lle = NULL; + sro.ro_rt = sro6.ro_rt = NULL; + sro.ro_lle = sro6.ro_lle = NULL; + ro = NULL; + hash = 0; + flags |= ft->ft_flags; + proto = flags_to_proto(flags); +#ifdef INET + if (ssa->ss_family == AF_INET) { + struct sockaddr_in *ssin, *dsin; + + ro = &sro; + memcpy(&ro->ro_dst, dsa, sizeof(struct sockaddr_in)); + dsin = (struct sockaddr_in *)dsa; + ssin = (struct sockaddr_in *)ssa; + if ((dsin->sin_addr.s_addr == ssin->sin_addr.s_addr) || + (ntohl(dsin->sin_addr.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || + (ntohl(ssin->sin_addr.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) + return (NULL); - /* - * The internal hash lookup is the only IPv4 specific bit - * remaining - * - * XXX BZ: to add IPv6 support just add a check for the - * address type in m and ro and an equivalent ipv6 lookup - * function - the rest of the code should automatically - * handle an ipv6 flow (note that m can be NULL in which - * case ro will be set) - */ - hash = ipv4_flow_lookup_hash_internal(m, ro, key, - &flags, &proto); + hash = ipv4_flow_lookup_hash_internal(ssin, dsin, key, flags); + } +#endif +#ifdef INET6 + if (ssa->ss_family == AF_INET6) { + struct sockaddr_in6 *ssin6, *dsin6; + + ro = (struct route *)&sro6; + memcpy(&sro6.ro_dst, dsa, + sizeof(struct sockaddr_in6)); + dsin6 = (struct sockaddr_in6 *)dsa; + ssin6 = (struct sockaddr_in6 *)ssa; + flags |= FL_IPV6; + hash = ipv6_flow_lookup_hash_internal(ssin6, dsin6, key, flags); + } +#endif /* * Ports are zero and this isn't a transmit cache * - thus not a protocol for which we need to keep * state - * FL_HASH_PORTS => key[0] != 0 for TCP || UDP || SCTP + * FL_HASH_ALL => key[0] != 0 for TCP || UDP || SCTP */ - if (hash == 0 || (key[0] == 0 && (ft->ft_flags & FL_HASH_PORTS))) - return (ENOENT); + if (hash == 0 || (key[0] == 0 && (ft->ft_flags & FL_HASH_ALL))) + return (NULL); - V_flowtable_lookups++; + fs->ft_lookups++; FL_ENTRY_LOCK(ft, hash); if ((fle = FL_ENTRY(ft, hash)) == NULL) { FL_ENTRY_UNLOCK(ft, hash); @@ -656,21 +1179,21 @@ keycheck: && (fibnum == fle->f_fibnum) && (rt->rt_flags & RTF_UP) && (rt->rt_ifp != NULL)) { - V_flowtable_hits++; + fs->ft_hits++; fle->f_uptime = time_uptime; fle->f_flags |= flags; - ro->ro_rt = rt; - ro->ro_lle = lle; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 00:38:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E4701065670; Thu, 1 Apr 2010 00:38:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F02C38FC18; Thu, 1 Apr 2010 00:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o310cc78070704; Thu, 1 Apr 2010 00:38:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o310cc4O070702; Thu, 1 Apr 2010 00:38:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004010038.o310cc4O070702@svn.freebsd.org> From: Xin LI Date: Thu, 1 Apr 2010 00:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206025 - in stable: 6/libexec/ftpd 7/libexec/ftpd 8/libexec/ftpd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 00:38:39 -0000 Author: delphij Date: Thu Apr 1 00:38:38 2010 New Revision: 206025 URL: http://svn.freebsd.org/changeset/base/206025 Log: MFC r205656: Check that gl_pathc is bigger than zero before derefencing gl_pathv. When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD Obtained from: OpenBSD Modified: stable/8/libexec/ftpd/popen.c Directory Properties: stable/8/libexec/ftpd/ (props changed) Changes in other areas also in this revision: Modified: stable/6/libexec/ftpd/popen.c stable/7/libexec/ftpd/popen.c Directory Properties: stable/6/libexec/ftpd/ (props changed) stable/7/libexec/ftpd/ (props changed) Modified: stable/8/libexec/ftpd/popen.c ============================================================================== --- stable/8/libexec/ftpd/popen.c Thu Apr 1 00:36:40 2010 (r206024) +++ stable/8/libexec/ftpd/popen.c Thu Apr 1 00:38:38 2010 (r206025) @@ -110,10 +110,11 @@ ftpd_popen(char *program, char *type) flags |= GLOB_LIMIT; if (glob(argv[argc], flags, NULL, &gl)) gargv[gargc++] = strdup(argv[argc]); - else + else if (gl.gl_pathc > 0) { for (pop = gl.gl_pathv; *pop && gargc < (MAXGLOBARGS-1); pop++) gargv[gargc++] = strdup(*pop); + } globfree(&gl); } gargv[gargc] = NULL; From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 02:03:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE90C1065672; Thu, 1 Apr 2010 02:03:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A35C78FC08; Thu, 1 Apr 2010 02:03:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3123Ssp089449; Thu, 1 Apr 2010 02:03:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3123SWs089447; Thu, 1 Apr 2010 02:03:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004010203.o3123SWs089447@svn.freebsd.org> From: Warner Losh Date: Thu, 1 Apr 2010 02:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206030 - in stable/8/tools: regression/lib/msun regression/usr.bin/pkill tools/ath/common tools/nanobsd tools/termcap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 02:03:28 -0000 Author: imp Date: Thu Apr 1 02:03:28 2010 New Revision: 206030 URL: http://svn.freebsd.org/changeset/base/206030 Log: MFC: r197542: - When we run our trap cleanup handler, echo that we are running this handler to make it more clear why we are 'suddenly' running df, umount, and mdconfig. - Remove trap handler again after we have unconfigured the memory device etc. Before we could end up running the trap handler if a later stage failed, which was a bit confusing and not really useful. MFC after: 2 weeks Modified: stable/8/tools/tools/nanobsd/nanobsd.sh Directory Properties: stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/8/tools/tools/nanobsd/nanobsd.sh Thu Apr 1 01:49:43 2010 (r206029) +++ stable/8/tools/tools/nanobsd/nanobsd.sh Thu Apr 1 02:03:28 2010 (r206030) @@ -439,7 +439,7 @@ create_i386_diskimage ( ) ( -y ${NANO_HEADS}` fi - trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} fdisk ${MD} @@ -491,6 +491,9 @@ create_i386_diskimage ( ) ( echo "Writing out _.disk.image..." dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k mdconfig -d -u $MD + + trap - 1 2 15 EXIT + ) > ${NANO_OBJ}/_.di 2>&1 ) From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 02:41:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DFC106564A; Thu, 1 Apr 2010 02:41:51 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33AD08FC1F; Thu, 1 Apr 2010 02:41:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o312fpli098256; Thu, 1 Apr 2010 02:41:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o312fpYb098247; Thu, 1 Apr 2010 02:41:51 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004010241.o312fpYb098247@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 1 Apr 2010 02:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206031 - in stable/8/sys/powerpc: booke mpc85xx powerpc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 02:41:51 -0000 Author: marcel Date: Thu Apr 1 02:41:50 2010 New Revision: 206031 URL: http://svn.freebsd.org/changeset/base/206031 Log: MFC rev 199602, 200739, 203177, 203350, 203352, 205495, 205527, 205535 and 205569: Sync MPC85xx/Book-E with 9-current. Modified: stable/8/sys/powerpc/booke/clock.c stable/8/sys/powerpc/booke/interrupt.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/powerpc/booke/trap_subr.S stable/8/sys/powerpc/mpc85xx/ocpbus.c stable/8/sys/powerpc/mpc85xx/ocpbus.h stable/8/sys/powerpc/mpc85xx/pci_ocp.c stable/8/sys/powerpc/powerpc/cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/powerpc/booke/clock.c ============================================================================== --- stable/8/sys/powerpc/booke/clock.c Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/booke/clock.c Thu Apr 1 02:41:50 2010 (r206031) @@ -197,15 +197,8 @@ DELAY(int n) { u_quad_t start, end, now; -#define USECS_IN_SEC 1000000ULL - - if (n > USECS_IN_SEC) { - printf("WARNING: %s(%d) called from %p", __func__, n, - __builtin_return_address(0)); - } - start = mftb(); - end = start + (u_quad_t)ticks_per_sec / (USECS_IN_SEC / n); + end = start + (u_quad_t)ticks_per_sec / (1000000ULL / n); do { now = mftb(); } while (now < end || (now > start && end < start)); Modified: stable/8/sys/powerpc/booke/interrupt.c ============================================================================== --- stable/8/sys/powerpc/booke/interrupt.c Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/booke/interrupt.c Thu Apr 1 02:41:50 2010 (r206031) @@ -123,6 +123,7 @@ powerpc_decr_interrupt(struct trapframe decr_intr(framep); atomic_subtract_int(&td->td_intr_nesting_level, 1); critical_exit(); + framep->srr1 &= ~PSL_WE; } /* @@ -135,4 +136,5 @@ powerpc_extr_interrupt(struct trapframe critical_enter(); PIC_DISPATCH(pic, framep); critical_exit(); + framep->srr1 &= ~PSL_WE; } Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/booke/machdep.c Thu Apr 1 02:41:50 2010 (r206031) @@ -706,6 +706,7 @@ cpu_idle (int busy) register_t msr; msr = mfmsr(); + #ifdef INVARIANTS if ((msr & PSL_EE) != PSL_EE) { struct thread *td = curthread; @@ -713,19 +714,10 @@ cpu_idle (int busy) panic("ints disabled in idleproc!"); } #endif -#if 0 - /* - * Freescale E500 core RM section 6.4.1 - */ - msr = msr | PSL_WE; - __asm__(" msync;" - " mtmsr %0;" - " isync;" - "loop: b loop" : - /* no output */ : - "r" (msr)); -#endif + /* Freescale E500 core RM section 6.4.1. */ + msr = msr | PSL_WE; + __asm __volatile("msync; mtmsr %0; isync" :: "r" (msr)); } int Modified: stable/8/sys/powerpc/booke/trap_subr.S ============================================================================== --- stable/8/sys/powerpc/booke/trap_subr.S Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/booke/trap_subr.S Thu Apr 1 02:41:50 2010 (r206031) @@ -441,6 +441,7 @@ INTERRUPT(int_instr_storage) INTERRUPT(int_external_input) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_EXI) + addi %r3, %r1, 8 bl CNAME(powerpc_extr_interrupt) b trapexit Modified: stable/8/sys/powerpc/mpc85xx/ocpbus.c ============================================================================== --- stable/8/sys/powerpc/mpc85xx/ocpbus.c Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/mpc85xx/ocpbus.c Thu Apr 1 02:41:50 2010 (r206031) @@ -152,6 +152,10 @@ ocpbus_write_law(int trgt, int type, u_l addr = 0xA0000000; size = 0x10000000; break; + case OCP85XX_TGTIF_PCI3: + addr = 0xB0000000; + size = 0x10000000; + break; default: return (EINVAL); } @@ -170,6 +174,10 @@ ocpbus_write_law(int trgt, int type, u_l addr = 0xfee20000; size = 0x00010000; break; + case OCP85XX_TGTIF_PCI3: + addr = 0xfee30000; + size = 0x00010000; + break; default: return (EINVAL); } @@ -188,7 +196,7 @@ static int ocpbus_probe(device_t dev) { - device_set_desc(dev, "On-Chip Peripherals bus"); + device_set_desc(dev, "Freescale on-chip peripherals bus"); return (BUS_PROBE_DEFAULT); } @@ -210,6 +218,7 @@ ocpbus_attach(device_t dev) ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 0); ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 1); ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 2); + ocpbus_mk_child(dev, OCPBUS_DEVTYPE_PCIB, 3); ocpbus_mk_child(dev, OCPBUS_DEVTYPE_TSEC, 0); ocpbus_mk_child(dev, OCPBUS_DEVTYPE_TSEC, 1); ocpbus_mk_child(dev, OCPBUS_DEVTYPE_TSEC, 2); @@ -338,6 +347,10 @@ const struct ocp_resource mpc8555_resour OCP85XX_PCI_SIZE}, {OCPBUS_DEVTYPE_PCIB, 2, SYS_RES_MEMORY, 1, 0, OCP85XX_TGTIF_PCI2}, {OCPBUS_DEVTYPE_PCIB, 2, SYS_RES_IOPORT, 1, 0, OCP85XX_TGTIF_PCI2}, + {OCPBUS_DEVTYPE_PCIB, 3, SYS_RES_MEMORY, 0, OCP85XX_PCI3_OFF, + OCP85XX_PCI_SIZE}, + {OCPBUS_DEVTYPE_PCIB, 3, SYS_RES_MEMORY, 1, 0, OCP85XX_TGTIF_PCI3}, + {OCPBUS_DEVTYPE_PCIB, 3, SYS_RES_IOPORT, 1, 0, OCP85XX_TGTIF_PCI3}, {OCPBUS_DEVTYPE_LBC, 0, SYS_RES_MEMORY, 0, OCP85XX_LBC_OFF, OCP85XX_LBC_SIZE}, Modified: stable/8/sys/powerpc/mpc85xx/ocpbus.h ============================================================================== --- stable/8/sys/powerpc/mpc85xx/ocpbus.h Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/mpc85xx/ocpbus.h Thu Apr 1 02:41:50 2010 (r206031) @@ -50,6 +50,7 @@ #define OCP85XX_TGTIF_PCI0 0 #define OCP85XX_TGTIF_PCI1 1 #define OCP85XX_TGTIF_PCI2 2 +#define OCP85XX_TGTIF_PCI3 3 #define OCP85XX_TGTIF_LBC 4 #define OCP85XX_TGTIF_RAM_INTL 11 #define OCP85XX_TGTIF_RIO 12 @@ -86,6 +87,7 @@ #define OCP85XX_PCI0_OFF 0x08000 #define OCP85XX_PCI1_OFF 0x09000 #define OCP85XX_PCI2_OFF 0x0A000 +#define OCP85XX_PCI3_OFF 0x0B000 #define OCP85XX_PCI_SIZE 0x1000 #define OCP85XX_TSEC0_OFF 0x24000 #define OCP85XX_TSEC1_OFF 0x25000 Modified: stable/8/sys/powerpc/mpc85xx/pci_ocp.c ============================================================================== --- stable/8/sys/powerpc/mpc85xx/pci_ocp.c Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/mpc85xx/pci_ocp.c Thu Apr 1 02:41:50 2010 (r206031) @@ -76,6 +76,9 @@ __FBSDID("$FreeBSD$"); #define REG_PIWBEAR(n) (0x0e0c - 0x20 * (n)) #define REG_PIWAR(n) (0x0e10 - 0x20 * (n)) +#define PCIR_FSL_LTSSM 0x404 +#define FSL_LTSSM_L0 0x16 + #define DEVFN(b, s, f) ((b << 16) | (s << 8) | f) struct pci_ocp_softc { @@ -94,7 +97,7 @@ struct pci_ocp_softc { int sc_rid; int sc_busnr; - int sc_pcie:1; + uint8_t sc_pcie_cap; /* Devices that need special attention. */ int sc_devfn_tundra; @@ -168,7 +171,7 @@ pci_ocp_cfgread(struct pci_ocp_softc *sc addr |= (slot & 0x1f) << 11; addr |= (func & 0x7) << 8; addr |= reg & 0xfc; - if (sc->sc_pcie) + if (sc->sc_pcie_cap) addr |= (reg & 0xf00) << 16; bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_CFG_ADDR, addr); @@ -206,7 +209,7 @@ pci_ocp_cfgwrite(struct pci_ocp_softc *s addr |= (slot & 0x1f) << 11; addr |= (func & 0x7) << 8; addr |= reg & 0xfc; - if (sc->sc_pcie) + if (sc->sc_pcie_cap) addr |= (reg & 0xf00) << 16; bus_space_write_4(sc->sc_bst, sc->sc_bsh, REG_CFG_ADDR, addr); @@ -261,7 +264,7 @@ pci_ocp_maxslots(device_t dev) { struct pci_ocp_softc *sc = device_get_softc(dev); - return ((sc->sc_pcie) ? 0 : 30); + return ((sc->sc_pcie_cap) ? 0 : 31); } static uint32_t @@ -271,9 +274,21 @@ pci_ocp_read_config(device_t dev, u_int struct pci_ocp_softc *sc = device_get_softc(dev); u_int devfn; - if (bus == sc->sc_busnr && !sc->sc_pcie && slot < 10) + if (bus == sc->sc_busnr && !sc->sc_pcie_cap && slot < 10) return (~0); devfn = DEVFN(bus, slot, func); + /* + * For the host controller itself, pretend to be a standard + * PCI bridge, rather than a PowerPC processor. That way the + * generic PCI code will enumerate all subordinate busses + * and devices as usual. + */ + if (sc->sc_pcie_cap && devfn == 0) { + if (reg == PCIR_CLASS && bytes == 1) + return (PCIC_BRIDGE); + if (reg == PCIR_SUBCLASS && bytes == 1) + return (PCIS_BRIDGE_PCI); + } if (devfn == sc->sc_devfn_tundra) return (~0); if (devfn == sc->sc_devfn_via_ide && reg == PCIR_INTPIN) @@ -287,7 +302,7 @@ pci_ocp_write_config(device_t dev, u_int { struct pci_ocp_softc *sc = device_get_softc(dev); - if (bus == sc->sc_busnr && !sc->sc_pcie && slot < 10) + if (bus == sc->sc_busnr && !sc->sc_pcie_cap && slot < 10) return; pci_ocp_cfgwrite(sc, bus, slot, func, reg, val, bytes); } @@ -297,11 +312,12 @@ pci_ocp_probe(device_t dev) { char buf[128]; struct pci_ocp_softc *sc; - const char *mpcid, *type; + const char *type; device_t parent; u_long start, size; uintptr_t devtype; uint32_t cfgreg; + uint8_t capptr; int error; parent = device_get_parent(dev); @@ -312,6 +328,7 @@ pci_ocp_probe(device_t dev) return (ENXIO); sc = device_get_softc(dev); + sc->sc_dev = dev; sc->sc_rid = 0; sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, @@ -327,48 +344,33 @@ pci_ocp_probe(device_t dev) cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_VENDOR, 2); if (cfgreg != 0x1057 && cfgreg != 0x1957) goto out; - cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_DEVICE, 2); - switch (cfgreg) { - case 0x000a: - mpcid = "8555E"; - break; - case 0x0012: - mpcid = "8548E"; - break; - case 0x0013: - mpcid = "8548"; - break; - /* - * Documentation from Freescale is incorrect. - * Use right values after documentation is corrected. - */ - case 0x0030: - mpcid = "8544E"; - break; - case 0x0031: - mpcid = "8544"; - break; - case 0x0032: - mpcid = "8544"; - break; - default: + + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_CLASS, 1); + if (cfgreg != PCIC_PROCESSOR) + goto out; + + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_SUBCLASS, 1); + if (cfgreg != PCIS_PROCESSOR_POWERPC) + goto out; + + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_PROGIF, 1); + if (cfgreg != 0) /* RC mode = 0, EP mode = 1 */ goto out; - } type = "PCI"; - cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_CAP_PTR, 1); - while (cfgreg != 0) { - cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, cfgreg, 2); + capptr = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_CAP_PTR, 1); + while (capptr != 0) { + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, capptr, 2); switch (cfgreg & 0xff) { case PCIY_PCIX: /* PCI-X */ type = "PCI-X"; break; case PCIY_EXPRESS: /* PCI Express */ type = "PCI Express"; - sc->sc_pcie = 1; + sc->sc_pcie_cap = capptr; break; } - cfgreg = (cfgreg >> 8) & 0xff; + capptr = (cfgreg >> 8) & 0xff; } error = bus_get_resource(dev, SYS_RES_MEMORY, 1, &start, &size); @@ -376,7 +378,7 @@ pci_ocp_probe(device_t dev) goto out; snprintf(buf, sizeof(buf), - "Freescale MPC%s %s host controller", mpcid, type); + "Freescale on-chip %s host controller", type); device_set_desc_copy(dev, buf); error = BUS_PROBE_DEFAULT; @@ -491,7 +493,7 @@ pci_ocp_route_int(struct pci_ocp_softc * } static int -pci_ocp_init(struct pci_ocp_softc *sc, int bus, int maxslot) +pci_ocp_init(struct pci_ocp_softc *sc, int bus, int nslots) { int secbus, slot; int func, maxfunc; @@ -501,7 +503,7 @@ pci_ocp_init(struct pci_ocp_softc *sc, i uint8_t intline, intpin; secbus = bus; - for (slot = 0; slot < maxslot; slot++) { + for (slot = 0; slot < nslots; slot++) { maxfunc = 0; for (func = 0; func <= maxfunc; func++) { hdrtype = pci_ocp_read_config(sc->sc_dev, bus, slot, @@ -598,7 +600,7 @@ pci_ocp_init(struct pci_ocp_softc *sc, i PCIR_SUBBUS_1, 0xff, 1); secbus = pci_ocp_init(sc, secbus, - (subclass == PCIS_BRIDGE_PCI) ? 31 : 1); + (subclass == PCIS_BRIDGE_PCI) ? 32 : 1); pci_ocp_write_config(sc->sc_dev, bus, slot, func, PCIR_SUBBUS_1, secbus, 1); @@ -720,7 +722,7 @@ pci_ocp_attach(device_t dev) { struct pci_ocp_softc *sc; uint32_t cfgreg; - int error, maxslot; + int error, nslots; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -753,8 +755,19 @@ pci_ocp_attach(device_t dev) sc->sc_devfn_tundra = -1; sc->sc_devfn_via_ide = -1; - maxslot = (sc->sc_pcie) ? 1 : 31; - pci_ocp_init(sc, sc->sc_busnr, maxslot); + /* + * PCI Express host controllers require a link. We don't + * fail the attach if there's no link, but we also don't + * create a child pci(4) device. + */ + if (sc->sc_pcie_cap) { + cfgreg = pci_ocp_cfgread(sc, 0, 0, 0, PCIR_FSL_LTSSM, 4); + if (cfgreg < FSL_LTSSM_L0) + return (0); + } + + nslots = (sc->sc_pcie_cap) ? 1 : 32; + pci_ocp_init(sc, sc->sc_busnr, nslots); device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); @@ -783,6 +796,7 @@ pci_ocp_alloc_resource(device_t dev, dev device_printf(dev, "%s requested ISA interrupt %lu\n", device_get_nameunit(child), start); } + flags |= RF_SHAREABLE; return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); default: Modified: stable/8/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/8/sys/powerpc/powerpc/cpu.c Thu Apr 1 02:03:28 2010 (r206030) +++ stable/8/sys/powerpc/powerpc/cpu.c Thu Apr 1 02:41:50 2010 (r206031) @@ -433,6 +433,13 @@ cpu_e500_setup(int cpuid, uint16_t vers) register_t hid0; hid0 = mfspr(SPR_HID0); + + /* Programe power-management mode. */ + hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); + hid0 |= HID0_DOZE; + + mtspr(SPR_HID0, hid0); + printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 13:21:04 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A611A106566B; Thu, 1 Apr 2010 13:21:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 941C58FC08; Thu, 1 Apr 2010 13:21:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o31DL4vP042008; Thu, 1 Apr 2010 13:21:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o31DL4Y3042006; Thu, 1 Apr 2010 13:21:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201004011321.o31DL4Y3042006@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 1 Apr 2010 13:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206041 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 13:21:04 -0000 Author: nwhitehorn Date: Thu Apr 1 13:21:04 2010 New Revision: 206041 URL: http://svn.freebsd.org/changeset/base/206041 Log: MFC r205163: Fix two small bugs. The PowerPC 970 does not support non-coherent memory access, and reflects this by autonomously writing LPTE_M into PTE entries. As such, we should not panic if LPTE_M changes by itself. While here, fix a harmless typo in moea64_sync_icache(). Modified: stable/8/sys/powerpc/aim/mmu_oea64.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Thu Apr 1 13:16:32 2010 (r206040) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Thu Apr 1 13:21:04 2010 (r206041) @@ -2246,7 +2246,7 @@ moea64_pvo_to_pte(const struct pvo_entry } if (((pt->pte_lo ^ pvo->pvo_pte.lpte.pte_lo) & - ~(LPTE_CHG|LPTE_REF)) != 0) { + ~(LPTE_M|LPTE_CHG|LPTE_REF)) != 0) { panic("moea64_pvo_to_pte: pvo %p pte does not match " "pte %p in moea64_pteg_table difference is %#x", pvo, pt, @@ -2488,7 +2488,7 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, len = MIN(lim - va, sz); pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF, NULL); if (pvo != NULL) { - pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) | + pa = (pvo->pvo_pte.pte.pte_lo & LPTE_RPGN) | (va & ADDR_POFF); moea64_syncicache(pm, va, pa, len); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 13:27:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5169A1065672; Thu, 1 Apr 2010 13:27:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EAAA8FC19; Thu, 1 Apr 2010 13:27:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o31DRSI6043486; Thu, 1 Apr 2010 13:27:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o31DRSWm043484; Thu, 1 Apr 2010 13:27:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201004011327.o31DRSWm043484@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 1 Apr 2010 13:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206042 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 13:27:28 -0000 Author: nwhitehorn Date: Thu Apr 1 13:27:27 2010 New Revision: 206042 URL: http://svn.freebsd.org/changeset/base/206042 Log: MFC r204694,204719,205370 Update the page table locking for the 64-bit PMAP. One of these revisions largely reverted the other, so there is a small amount of churn and the addition of some mtx_assert()s. Modified: stable/8/sys/powerpc/aim/mmu_oea64.c Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Thu Apr 1 13:21:04 2010 (r206041) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Thu Apr 1 13:27:27 2010 (r206042) @@ -327,7 +327,6 @@ SYSCTL_INT(_machdep, OID_AUTO, moea64_pv &moea64_pvo_remove_calls, 0, ""); vm_offset_t moea64_scratchpage_va[2]; -struct pvo_entry *moea64_scratchpage_pvo[2]; struct lpte *moea64_scratchpage_pte[2]; struct mtx moea64_scratchpage_mtx; @@ -965,22 +964,36 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o PMAP_UNLOCK(kernel_pmap); /* - * Allocate some things for page zeroing + * Allocate some things for page zeroing. We put this directly + * in the page table, marked with LPTE_LOCKED, to avoid any + * of the PVO book-keeping or other parts of the VM system + * from even knowing that this hack exists. */ mtx_init(&moea64_scratchpage_mtx, "pvo zero page", NULL, MTX_DEF); for (i = 0; i < 2; i++) { + struct lpte pt; + uint64_t vsid; + int pteidx, ptegidx; + moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE; virtual_end -= PAGE_SIZE; - moea64_kenter(mmup,moea64_scratchpage_va[i],0); - LOCK_TABLE(); - moea64_scratchpage_pvo[i] = moea64_pvo_find_va(kernel_pmap, - moea64_scratchpage_va[i],&j); - moea64_scratchpage_pte[i] = moea64_pvo_to_pte( - moea64_scratchpage_pvo[i],j); - moea64_scratchpage_pte[i]->pte_hi |= LPTE_LOCKED; + + vsid = va_to_vsid(kernel_pmap, moea64_scratchpage_va[i]); + moea64_pte_create(&pt, vsid, moea64_scratchpage_va[i], + LPTE_NOEXEC); + pt.pte_hi |= LPTE_LOCKED; + + ptegidx = va_to_pteg(vsid, moea64_scratchpage_va[i]); + pteidx = moea64_pte_insert(ptegidx, &pt); + if (pt.pte_hi & LPTE_HID) + ptegidx ^= moea64_pteg_mask; + + moea64_scratchpage_pte[i] = + &moea64_pteg_table[ptegidx].pt[pteidx]; + UNLOCK_TABLE(); } @@ -1088,18 +1101,16 @@ moea64_change_wiring(mmu_t mmu, pmap_t p static __inline void moea64_set_scratchpage_pa(int which, vm_offset_t pa) { - mtx_assert(&moea64_scratchpage_mtx, MA_OWNED); - moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo &= - ~(LPTE_WIMG | LPTE_RPGN); - moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo |= - moea64_calc_wimg(pa) | (uint64_t)pa; + mtx_assert(&moea64_scratchpage_mtx, MA_OWNED); moea64_scratchpage_pte[which]->pte_hi &= ~LPTE_VALID; TLBIE(kernel_pmap, moea64_scratchpage_va[which]); - moea64_scratchpage_pte[which]->pte_lo = - moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo; + moea64_scratchpage_pte[which]->pte_lo &= + ~(LPTE_WIMG | LPTE_RPGN); + moea64_scratchpage_pte[which]->pte_lo |= + moea64_calc_wimg(pa) | (uint64_t)pa; EIEIO(); moea64_scratchpage_pte[which]->pte_hi |= LPTE_VALID; @@ -1498,8 +1509,8 @@ moea64_remove_write(mmu_t mmu, vm_page_t LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { pmap = pvo->pvo_pmap; PMAP_LOCK(pmap); + LOCK_TABLE(); if ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { - LOCK_TABLE(); pt = moea64_pvo_to_pte(pvo, -1); pvo->pvo_pte.lpte.pte_lo &= ~LPTE_PP; pvo->pvo_pte.lpte.pte_lo |= LPTE_BR; @@ -1510,8 +1521,8 @@ moea64_remove_write(mmu_t mmu, vm_page_t moea64_pte_change(pt, &pvo->pvo_pte.lpte, pvo->pvo_pmap, PVO_VADDR(pvo)); } - UNLOCK_TABLE(); } + UNLOCK_TABLE(); PMAP_UNLOCK(pmap); } if ((lo & LPTE_CHG) != 0) { @@ -1592,6 +1603,13 @@ moea64_kextract(mmu_t mmu, vm_offset_t v struct pvo_entry *pvo; vm_paddr_t pa; + /* + * Shortcut the direct-mapped case when applicable. We never put + * anything but 1:1 mappings below VM_MIN_KERNEL_ADDRESS. + */ + if (va < VM_MIN_KERNEL_ADDRESS) + return (va); + PMAP_LOCK(kernel_pmap); pvo = moea64_pvo_find_va(kernel_pmap, va & ~ADDR_POFF, NULL); KASSERT(pvo != NULL, ("moea64_kextract: no addr found")); @@ -1649,9 +1667,11 @@ moea64_page_exists_quick(mmu_t mmu, pmap if (!moea64_initialized || (m->flags & PG_FICTITIOUS)) return FALSE; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + loops = 0; LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { - if (pvo->pvo_pmap == pmap) + if (pvo->pvo_pmap == pmap) return (TRUE); if (++loops >= 16) break; @@ -2045,7 +2065,7 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z bootstrap = 1; } else { /* - * Note: drop the table around the UMA allocation in + * Note: drop the table lock around the UMA allocation in * case the UMA allocator needs to manipulate the page * table. The mapping we are working with is already * protected by the PMAP lock. @@ -2129,7 +2149,6 @@ moea64_pvo_remove(struct pvo_entry *pvo, } else { moea64_pte_overflow--; } - UNLOCK_TABLE(); /* * Update our statistics. @@ -2161,9 +2180,12 @@ moea64_pvo_remove(struct pvo_entry *pvo, * if we aren't going to reuse it. */ LIST_REMOVE(pvo, pvo_olink); + UNLOCK_TABLE(); + if (!(pvo->pvo_vaddr & PVO_BOOTSTRAP)) uma_zfree((pvo->pvo_vaddr & PVO_MANAGED) ? moea64_mpvo_zone : moea64_upvo_zone, pvo); + moea64_pvo_entries--; moea64_pvo_remove_calls++; } @@ -2312,6 +2334,8 @@ moea64_query_bit(vm_page_t m, u_int64_t if (moea64_attr_fetch(m) & ptebit) return (TRUE); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { MOEA_PVO_CHECK(pvo); /* sanity check */ @@ -2366,6 +2390,8 @@ moea64_clear_bit(vm_page_t m, u_int64_t struct lpte *pt; uint64_t rv; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + /* * Clear the cached value. */ @@ -2398,10 +2424,10 @@ moea64_clear_bit(vm_page_t m, u_int64_t moea64_pte_clear(pt, pvo->pvo_pmap, PVO_VADDR(pvo), ptebit); } } - UNLOCK_TABLE(); rv |= pvo->pvo_pte.lpte.pte_lo; pvo->pvo_pte.lpte.pte_lo &= ~ptebit; MOEA_PVO_CHECK(pvo); /* sanity check */ + UNLOCK_TABLE(); } if (origbit != NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 15:17:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E160B106566B; Thu, 1 Apr 2010 15:17:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDE898FC28; Thu, 1 Apr 2010 15:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o31FHo3s068026; Thu, 1 Apr 2010 15:17:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o31FHorZ068020; Thu, 1 Apr 2010 15:17:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004011517.o31FHorZ068020@svn.freebsd.org> From: Marius Strobl Date: Thu, 1 Apr 2010 15:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206044 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 15:17:51 -0000 Author: marius Date: Thu Apr 1 15:17:50 2010 New Revision: 206044 URL: http://svn.freebsd.org/changeset/base/206044 Log: MFC: r205409 - The firmware of Sun Fire V1280 has a misfeature of setting %wstate to 7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into it which totally screws us even when restoring %wstate afterwards as spill/fill traps can happen while in OFW. The rather hackish OpenBSD approach of just setting the equivalent of WSTATE_KERNEL to 7 also is no option as we treat %wstate as a bit field. So in order to deal with this problem actually implement spill/fill handlers for %wstate 7 which just act as the WSTATE_KERNEL ones except of theoretically also handling 32-bit, turn off interrupts completely so we don't even take IPIs while in OFW which should ensure we only take spill/fill traps at most and restore %wstate after calling into OFW once we have taken over the trap table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into OFW just like OpenSolaris does, which should at least help testing this change on non-V1280. - Remove comments referring to the %wstate usage in BSD/OS. - Remove the no longer used RSF_ALIGN_RETRY macro. - Correct some trap table addresses in comments. - Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table. - Ensure PSTATE_AM is off when entering or exiting to OFW as well as that interrupts are also completely off when exiting to OFW as the firmware trap table shouldn't be used to handle our interrupts. Modified: stable/8/sys/sparc64/include/wstate.h stable/8/sys/sparc64/sparc64/exception.S stable/8/sys/sparc64/sparc64/locore.S stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/support.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/sparc64/include/wstate.h ============================================================================== --- stable/8/sys/sparc64/include/wstate.h Thu Apr 1 14:27:29 2010 (r206043) +++ stable/8/sys/sparc64/include/wstate.h Thu Apr 1 15:17:50 2010 (r206044) @@ -33,7 +33,7 @@ #define _MACHINE_WSTATE_H_ /* - * Window state register bits. + * Window state register bits * * There really are no bits per se, just the two fields WSTATE.NORMAL * and WSTATE.OTHER. The rest is up to software. @@ -42,37 +42,8 @@ * (whichever is currently in effect) and WSTATE_OTHER to represent * user mode saves (only). * - * We use the low bit to suggest 32-bit mode, with the next bit set - * once we succeed in saving in some mode. That is, if the WSTATE_ASSUME - * bit is set, the spill or fill handler we use will be one that makes - * an assumption about the proper window-save mode. If the spill or - * fill fails with an alignment fault, the spill or fill op should - * take the `assume' bit away retry the instruction that caused the - * spill or fill. This will use the new %wstate, which will test for - * which mode to use. The alignment fault code helps us out here by - * resuming the spill vector at offset +70, where we are allowed to - * execute two instructions (i.e., write to %wstate and RETRY). - * - * If the ASSUME bit is not set when the alignment fault occurs, the - * given stack pointer is hopelessly wrong (and the spill, if it is a - * spill, should be done as a sort of "panic spill") -- so those two - * instructions will be a branch sequence. - * * Note that locore.s assumes this same bit layout (since the translation * from "bits" to "{spill,fill}_N_{normal,other}" is done in hardware). - * - * The value 0 is preferred for unknown to make it easy to start in - * unknown state and continue in whichever state unknown succeeds in -- - * a successful "other" save, for instance, can just set %wstate to - * ASSUMExx << USERSHIFT and thus leave the kernel state "unknown". - * - * We also need values for managing the somewhat tricky transition from - * user to kernel and back, so we use the one remaining free bit to mean - * "although this looks like kernel mode, the window(s) involved are - * user windows and should be saved ASI_AIUP". Everything else is - * otherwise the same, but we need not bother with assumptions in this - * mode (we expect it to apply to at most one window spill or fill), - * i.e., WSTATE_TRANSITION can ignore WSTATE_ASSUME if it likes. */ #define WSTATE_NORMAL_MASK 1 /* wstate normal minus transition */ @@ -88,4 +59,8 @@ #define WSTATE_NESTED /* if set, spill must not fault */ \ (WSTATE_TRANSITION << WSTATE_OTHER_SHIFT) +/* Values used by the PROM and (Open)Solaris */ +#define WSTATE_PROM_KMIX 7 +#define WSTATE_PROM_MASK 7 + #endif /* !_MACHINE_WSTATE_H_ */ Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Thu Apr 1 14:27:29 2010 (r206043) +++ stable/8/sys/sparc64/sparc64/exception.S Thu Apr 1 15:17:50 2010 (r206044) @@ -316,15 +316,6 @@ END(tl1_kstack_fault) #define RSF_FILL_INC tl0_ret_fill_end - tl0_ret_fill /* - * Retry a spill or fill with a different wstate due to an alignment fault. - * We may just be using the wrong stack offset. - */ -#define RSF_ALIGN_RETRY(ws) \ - wrpr %g0, (ws), %wstate ; \ - retry ; \ - .align 16 - -/* * Generate a T_SPILL or T_FILL trap if the window operation fails. */ #define RSF_TRAP(type) \ @@ -1716,6 +1707,19 @@ END(tl1_dmmu_prot_trap) RSF_SPILL_TOPCB .endm + .macro tl1_spill_7_n + btst 1, %sp + bnz,a,pn %xcc, tl1_spill_0_n + nop + srl %sp, 0, %sp + SPILL(stw, %sp, 4, EMPTY) + saved + retry + .align 32 + RSF_FATAL(T_SPILL) + RSF_FATAL(T_SPILL) + .endm + .macro tl1_spill_0_o wr %g0, ASI_AIUP, %asi SPILL(stxa, %sp + SPOFF, 8, %asi) @@ -1770,6 +1774,19 @@ END(tl1_dmmu_prot_trap) RSF_FILL_MAGIC .endm + .macro tl1_fill_7_n + btst 1, %sp + bnz,a,pt %xcc, tl1_fill_0_n + nop + srl %sp, 0, %sp + FILL(lduw, %sp, 4, EMPTY) + restored + retry + .align 32 + RSF_FATAL(T_FILL) + RSF_FATAL(T_FILL) + .endm + /* * This is used to spill windows that are still occupied with user * data on kernel entry to the pcb. @@ -2016,8 +2033,10 @@ tl1_spill_0_n: tl1_spill_2_n: tl1_spill_2_n ! 0x288 tl1_spill_3_n: - tl1_spill_3_n ! 0x29c - tl1_spill_bad 4 ! 0x290-0x29f + tl1_spill_3_n ! 0x28c + tl1_spill_bad 3 ! 0x290-0x29b +tl1_spill_7_n: + tl1_spill_7_n ! 0x29c tl1_spill_0_o: tl1_spill_0_o ! 0x2a0 tl1_spill_1_o: @@ -2029,10 +2048,13 @@ tl1_fill_0_n: tl1_fill_0_n ! 0x2c0 tl1_fill_bad 1 ! 0x2c4 tl1_fill_2_n: - tl1_fill_2_n ! 0x2d0 + tl1_fill_2_n ! 0x2c8 tl1_fill_3_n: - tl1_fill_3_n ! 0x2d4 - tl1_fill_bad 12 ! 0x2d8-0x2ff + tl1_fill_3_n ! 0x2cc + tl1_fill_bad 3 ! 0x2d0-0x2db +tl1_fill_7_n: + tl1_fill_7_n ! 0x2dc + tl1_fill_bad 8 ! 0x2e0-0x2ff tl1_reserved 1 ! 0x300 tl1_breakpoint: tl1_gen T_BREAKPOINT ! 0x301 @@ -2649,7 +2671,7 @@ END(tl0_ret) * Kernel trap entry point * * void tl1_trap(u_int type, u_long o1, u_long o2, u_long tar, u_long sfar, - * u_int sfsr) + * u_int sfsr) * * This is easy because the stack is already setup and the windows don't need * to be split. We build a trapframe and call trap(), the same as above, but Modified: stable/8/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/locore.S Thu Apr 1 14:27:29 2010 (r206043) +++ stable/8/sys/sparc64/sparc64/locore.S Thu Apr 1 15:17:50 2010 (r206044) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -139,8 +140,12 @@ ENTRY(cpu_setregs) * Force trap level 1 and take over the trap table. */ SET(tl0_base, %o2, %o1) + SET(tba_taken_over, %o3, %o2) + mov 1, %o3 + wrpr %g0, WSTATE_KERNEL, %wstate wrpr %g0, 1, %tl wrpr %o1, 0, %tba + stw %o3, [%o2] /* * Re-enable interrupts. Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Thu Apr 1 14:27:29 2010 (r206043) +++ stable/8/sys/sparc64/sparc64/machdep.c Thu Apr 1 15:17:50 2010 (r206044) @@ -138,6 +138,7 @@ struct kva_md_info kmi; u_long ofw_vec; u_long ofw_tba; +u_int tba_taken_over; char sparc64_model[32]; @@ -466,7 +467,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Determine the TLB slot maxima, which are expected to be * equal across all CPUs. - * NB: for Cheetah-class CPUs, these properties only refer + * NB: for cheetah-class CPUs, these properties only refer * to the t16s. */ if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, Modified: stable/8/sys/sparc64/sparc64/support.S ============================================================================== --- stable/8/sys/sparc64/sparc64/support.S Thu Apr 1 14:27:29 2010 (r206043) +++ stable/8/sys/sparc64/sparc64/support.S Thu Apr 1 15:17:50 2010 (r206044) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -751,11 +752,20 @@ ENTRY(ofw_entry) save %sp, -CCFSZ, %sp SET(ofw_vec, %l7, %l6) ldx [%l6], %l6 - rdpr %pil, %l7 - wrpr %g0, PIL_TICK, %pil - call %l6 + rdpr %pstate, %l7 + andn %l7, PSTATE_AM | PSTATE_IE, %l5 + wrpr %l5, 0, %pstate + SET(tba_taken_over, %l5, %l4) + brz,pn %l4, 1f + rdpr %wstate, %l5 + andn %l5, WSTATE_PROM_MASK, %l3 + wrpr %l3, WSTATE_PROM_KMIX, %wstate +1: call %l6 mov %i0, %o0 - wrpr %l7, 0, %pil + brz,pn %l4, 1f + nop + wrpr %g0, %l5, %wstate +1: wrpr %l7, 0, %pstate ret restore %o0, %g0, %o0 END(ofw_entry) @@ -766,9 +776,14 @@ END(ofw_entry) ENTRY(ofw_exit) save %sp, -CCFSZ, %sp flushw - wrpr %g0, PIL_TICK, %pil SET(ofw_tba, %l7, %l5) ldx [%l5], %l5 + rdpr %pstate, %l7 + andn %l7, PSTATE_AM | PSTATE_IE, %l7 + wrpr %l7, 0, %pstate + rdpr %wstate, %l7 + andn %l7, WSTATE_PROM_MASK, %l7 + wrpr %l7, WSTATE_PROM_KMIX, %wstate wrpr %l5, 0, %tba ! restore the OFW trap table SET(ofw_vec, %l7, %l6) ldx [%l6], %l6 From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 1 20:23:43 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D11CB1065679; Thu, 1 Apr 2010 20:23:43 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55FF8FC21; Thu, 1 Apr 2010 20:23:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o31KNhQZ035677; Thu, 1 Apr 2010 20:23:43 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o31KNhct035675; Thu, 1 Apr 2010 20:23:43 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201004012023.o31KNhct035675@svn.freebsd.org> From: Qing Li Date: Thu, 1 Apr 2010 20:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206055 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 20:23:43 -0000 Author: qingli Date: Thu Apr 1 20:23:43 2010 New Revision: 206055 URL: http://svn.freebsd.org/changeset/base/206055 Log: MFC 205077 The flow-table module retrieves the destination and source address as well as the transport protocol port information from the outbound packets. The routing code is generic and compares every byte in the given sockaddr object. Therefore the temporary sockaddr objects must be cleared due to padding bytes. In addition, the port information must be stripped or the route search will either fail or return the incorrect route entry. Unit testing is done using OpenVPN over the if_tun interface. Modified: stable/8/sys/net/flowtable.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Thu Apr 1 19:05:43 2010 (r206054) +++ stable/8/sys/net/flowtable.c Thu Apr 1 20:23:43 2010 (r206055) @@ -598,6 +598,8 @@ flowtable_lookup_mbuf4(struct flowtable dsin = (struct sockaddr_in *)&dsa; ssin = (struct sockaddr_in *)&ssa; + bzero(dsin, sizeof(*dsin)); + bzero(ssin, sizeof(*ssin)); flags = ft->ft_flags; if (ipv4_mbuf_demarshal(ft, m, ssin, dsin, &flags) != 0) return (NULL); @@ -801,6 +803,8 @@ flowtable_lookup_mbuf6(struct flowtable dsin6 = (struct sockaddr_in6 *)&dsa; ssin6 = (struct sockaddr_in6 *)&ssa; + bzero(dsin6, sizeof(*dsin6)); + bzero(ssin6, sizeof(*ssin6)); flags = ft->ft_flags; if (ipv6_mbuf_demarshal(ft, m, ssin6, dsin6, &flags) != 0) @@ -1130,6 +1134,14 @@ flowtable_lookup(struct flowtable *ft, s ro = &sro; memcpy(&ro->ro_dst, dsa, sizeof(struct sockaddr_in)); + /* + * The harvested source and destination addresses + * may contain port information if the packet is + * from a transport protocol (e.g. TCP/UDP). The + * port field must be cleared before performing + * a route lookup. + */ + ((struct sockaddr_in *)&ro->ro_dst)->sin_port = 0; dsin = (struct sockaddr_in *)dsa; ssin = (struct sockaddr_in *)ssa; if ((dsin->sin_addr.s_addr == ssin->sin_addr.s_addr) || @@ -1147,6 +1159,7 @@ flowtable_lookup(struct flowtable *ft, s ro = (struct route *)&sro6; memcpy(&sro6.ro_dst, dsa, sizeof(struct sockaddr_in6)); + ((struct sockaddr_in6 *)&ro->ro_dst)->sin6_port = 0; dsin6 = (struct sockaddr_in6 *)dsa; ssin6 = (struct sockaddr_in6 *)ssa; From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 04:58:18 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062F4106564A; Fri, 2 Apr 2010 04:58:18 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8A4E8FC13; Fri, 2 Apr 2010 04:58:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o324wHFU053680; Fri, 2 Apr 2010 04:58:17 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o324wHr2053678; Fri, 2 Apr 2010 04:58:17 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201004020458.o324wHr2053678@svn.freebsd.org> From: Qing Li Date: Fri, 2 Apr 2010 04:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206066 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 04:58:18 -0000 Author: qingli Date: Fri Apr 2 04:58:17 2010 New Revision: 206066 URL: http://svn.freebsd.org/changeset/base/206066 Log: MFC 201131 introduce a local variable rte acting as a cache of ro->ro_rt within ip_output, achieving (in random order of importance): - a reduction of the number of 'r's in the source code; - improved legibility; - a reduction of 64 bytes in the .text Modified: stable/8/sys/netinet/ip_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Fri Apr 2 04:42:02 2010 (r206065) +++ stable/8/sys/netinet/ip_output.c Fri Apr 2 04:58:17 2010 (r206066) @@ -128,6 +128,7 @@ ip_output(struct mbuf *m, struct mbuf *o struct in_ifaddr *ia = NULL; int isbroadcast, sw_csum; struct route iproute; + struct rtentry *rte; /* cache for ro->ro_rt */ struct in_addr odst; #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag = NULL; @@ -205,18 +206,19 @@ again: * The address family should also be checked in case of sharing the * cache with IPv6. */ - if (ro->ro_rt && ((ro->ro_rt->rt_flags & RTF_UP) == 0 || + rte = ro->ro_rt; + if (rte && ((rte->rt_flags & RTF_UP) == 0 || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { if (!nortfree) - RTFREE(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; + RTFREE(rte); + rte = ro->ro_rt = (struct rtentry *)NULL; ro->ro_lle = (struct llentry *)NULL; } #ifdef IPFIREWALL_FORWARD - if (ro->ro_rt == NULL && fwd_tag == NULL) { + if (rte == NULL && fwd_tag == NULL) { #else - if (ro->ro_rt == NULL) { + if (rte == NULL) { #endif bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; @@ -266,7 +268,7 @@ again: * as this is probably required in all cases for correct * operation (as it is for ARP). */ - if (ro->ro_rt == NULL) + if (rte == NULL) { #ifdef RADIX_MPATH rtalloc_mpath_fib(ro, ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), @@ -275,7 +277,9 @@ again: in_rtalloc_ign(ro, 0, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #endif - if (ro->ro_rt == NULL) { + rte = ro->ro_rt; + } + if (rte == NULL) { #ifdef IPSEC /* * There is no route for this packet, but it is @@ -289,14 +293,14 @@ again: error = EHOSTUNREACH; goto bad; } - ia = ifatoia(ro->ro_rt->rt_ifa); + ia = ifatoia(rte->rt_ifa); ifa_ref(&ia->ia_ifa); - ifp = ro->ro_rt->rt_ifp; - ro->ro_rt->rt_rmx.rmx_pksent++; - if (ro->ro_rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway; - if (ro->ro_rt->rt_flags & RTF_HOST) - isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST); + ifp = rte->rt_ifp; + rte->rt_rmx.rmx_pksent++; + if (rte->rt_flags & RTF_GATEWAY) + dst = (struct sockaddr_in *)rte->rt_gateway; + if (rte->rt_flags & RTF_HOST) + isbroadcast = (rte->rt_flags & RTF_BROADCAST); else isbroadcast = in_broadcast(dst->sin_addr, ifp); } @@ -304,7 +308,7 @@ again: * Calculate MTU. If we have a route that is up, use that, * otherwise use the interface's MTU. */ - if (ro->ro_rt != NULL && (ro->ro_rt->rt_flags & (RTF_UP|RTF_HOST))) { + if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) { /* * This case can happen if the user changed the MTU * of an interface after enabling IP on it. Because @@ -312,9 +316,9 @@ again: * them, there is no way for one to update all its * routes when the MTU is changed. */ - if (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu) - ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu; - mtu = ro->ro_rt->rt_rmx.rmx_mtu; + if (rte->rt_rmx.rmx_mtu > ifp->if_mtu) + rte->rt_rmx.rmx_mtu = ifp->if_mtu; + mtu = rte->rt_rmx.rmx_mtu; } else { mtu = ifp->if_mtu; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 05:02:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6166106566B; Fri, 2 Apr 2010 05:02:50 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3CDF8FC1A; Fri, 2 Apr 2010 05:02:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3252oN5054756; Fri, 2 Apr 2010 05:02:50 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3252otY054748; Fri, 2 Apr 2010 05:02:50 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201004020502.o3252otY054748@svn.freebsd.org> From: Qing Li Date: Fri, 2 Apr 2010 05:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206067 - in stable/8/sys: net netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 05:02:51 -0000 Author: qingli Date: Fri Apr 2 05:02:50 2010 New Revision: 206067 URL: http://svn.freebsd.org/changeset/base/206067 Log: MFC 204902 One of the advantages of enabling ECMP (a.k.a RADIX_MPATH) is to allow for connection load balancing across interfaces. Currently the address alias handling method is colliding with the ECMP code. For example, when two interfaces are configured on the same prefix, only one prefix route is installed. So connection load balancing among the available interfaces is not possible. The other advantage of ECMP is for failover. The issue with the current code, is that the interface link-state is not reflected in the route entry. For example, if there are two interfaces on the same prefix, the cable on one interface is unplugged, new and existing connections should switch over to the other interface. This is not done today and packets go into a black hole. Also, there is a small bug in the kernel where deleting ECMP routes in the userland will always return an error even though the command is successfully executed. Modified: stable/8/sys/net/flowtable.c stable/8/sys/net/radix.c stable/8/sys/net/radix_mpath.c stable/8/sys/net/route.c stable/8/sys/net/route.h stable/8/sys/netinet/in.c stable/8/sys/netinet/ip_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/net/flowtable.c Fri Apr 2 05:02:50 2010 (r206067) @@ -870,7 +870,8 @@ flow_stale(struct flowtable *ft, struct || ((fle->f_rt->rt_flags & RTF_HOST) && ((fle->f_rt->rt_flags & (RTF_UP)) != (RTF_UP))) - || (fle->f_rt->rt_ifp == NULL)) + || (fle->f_rt->rt_ifp == NULL) + || !RT_LINK_IS_UP(fle->f_rt->rt_ifp)) return (1); idle_time = time_uptime - fle->f_uptime; Modified: stable/8/sys/net/radix.c ============================================================================== --- stable/8/sys/net/radix.c Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/net/radix.c Fri Apr 2 05:02:50 2010 (r206067) @@ -761,8 +761,10 @@ on2: if (m->rm_flags & RNF_NORMAL) { mmask = m->rm_leaf->rn_mask; if (tt->rn_flags & RNF_NORMAL) { +#if !defined(RADIX_MPATH) log(LOG_ERR, "Non-unique normal route, mask not entered\n"); +#endif return tt; } } else Modified: stable/8/sys/net/radix_mpath.c ============================================================================== --- stable/8/sys/net/radix_mpath.c Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/net/radix_mpath.c Fri Apr 2 05:02:50 2010 (r206067) @@ -270,7 +270,8 @@ rtalloc_mpath_fib(struct route *ro, uint * XXX we don't attempt to lookup cached route again; what should * be done for sendto(3) case? */ - if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP)) + if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP) + && RT_LINK_IS_UP(ro->ro_rt->rt_ifp)) return; ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, 0, fibnum); Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/net/route.c Fri Apr 2 05:02:50 2010 (r206067) @@ -830,7 +830,13 @@ rt_getifa_fib(struct rt_addrinfo *info, int rtexpunge(struct rtentry *rt) { +#if !defined(RADIX_MPATH) struct radix_node *rn; +#else + struct rt_addrinfo info; + int fib; + struct rtentry *rt0; +#endif struct radix_node_head *rnh; struct ifaddr *ifa; int error = 0; @@ -843,14 +849,26 @@ rtexpunge(struct rtentry *rt) if (rnh == NULL) return (EAFNOSUPPORT); RADIX_NODE_HEAD_LOCK_ASSERT(rnh); -#if 0 - /* - * We cannot assume anything about the reference count - * because protocols call us in many situations; often - * before unwinding references to the table entry. - */ - KASSERT(rt->rt_refcnt <= 1, ("bogus refcnt %ld", rt->rt_refcnt)); -#endif + +#ifdef RADIX_MPATH + fib = rt->rt_fibnum; + bzero(&info, sizeof(info)); + info.rti_ifp = rt->rt_ifp; + info.rti_flags = RTF_RNH_LOCKED; + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_GATEWAY] = rt->rt_ifa->ifa_addr; + + RT_UNLOCK(rt); + error = rtrequest1_fib(RTM_DELETE, &info, &rt0, fib); + + if (error == 0 && rt0 != NULL) { + rt = rt0; + RT_LOCK(rt); + } else if (error != 0) { + RT_LOCK(rt); + return (error); + } +#else /* * Remove the item from the tree; it should be there, * but when callers invoke us blindly it may not (sigh). @@ -864,6 +882,7 @@ rtexpunge(struct rtentry *rt) ("unexpected flags 0x%x", rn->rn_flags)); KASSERT(rt == RNTORT(rn), ("lookup mismatch, rt %p rn %p", rt, rn)); +#endif /* RADIX_MPATH */ rt->rt_flags &= ~RTF_UP; @@ -886,7 +905,9 @@ rtexpunge(struct rtentry *rt) * linked to the routing table. */ V_rttrash++; +#if !defined(RADIX_MPATH) bad: +#endif return (error); } @@ -1044,6 +1065,7 @@ rtrequest1_fib(int req, struct rt_addrin */ if (error != ENOENT) goto bad; + error = 0; } #endif /* Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/net/route.h Fri Apr 2 05:02:50 2010 (r206067) @@ -319,6 +319,8 @@ struct rt_addrinfo { #ifdef _KERNEL +#define RT_LINK_IS_UP(ifp) ((ifp)->if_link_state == LINK_STATE_UP) + #define RT_LOCK_INIT(_rt) \ mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK) #define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/netinet/in.c Fri Apr 2 05:02:50 2010 (r206067) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_carp.h" +#include "opt_mpath.h" #include #include @@ -1040,6 +1041,13 @@ in_addprefix(struct in_ifaddr *target, i * interface address, we are done here. */ if (ia->ia_flags & IFA_ROUTE) { +#ifdef RADIX_MPATH + if (ia->ia_addr.sin_addr.s_addr == + target->ia_addr.sin_addr.s_addr) + return (EEXIST); + else + break; +#endif if (V_sameprefixcarponly && target->ia_ifp->if_type != IFT_CARP && ia->ia_ifp->if_type != IFT_CARP) { Modified: stable/8/sys/netinet/ip_output.c ============================================================================== --- stable/8/sys/netinet/ip_output.c Fri Apr 2 04:58:17 2010 (r206066) +++ stable/8/sys/netinet/ip_output.c Fri Apr 2 05:02:50 2010 (r206067) @@ -208,6 +208,8 @@ again: */ rte = ro->ro_rt; if (rte && ((rte->rt_flags & RTF_UP) == 0 || + rte->rt_ifp == NULL || + !RT_LINK_IS_UP(rte->rt_ifp) || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { if (!nortfree) @@ -279,7 +281,9 @@ again: #endif rte = ro->ro_rt; } - if (rte == NULL) { + if (rte == NULL || + rte->rt_ifp == NULL || + !RT_LINK_IS_UP(rte->rt_ifp)) { #ifdef IPSEC /* * There is no route for this packet, but it is From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 05:05:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4672106564A; Fri, 2 Apr 2010 05:05:51 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A30C08FC0C; Fri, 2 Apr 2010 05:05:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3255pXN055460; Fri, 2 Apr 2010 05:05:51 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3255pQL055457; Fri, 2 Apr 2010 05:05:51 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201004020505.o3255pQL055457@svn.freebsd.org> From: Qing Li Date: Fri, 2 Apr 2010 05:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206068 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 05:05:51 -0000 Author: qingli Date: Fri Apr 2 05:05:51 2010 New Revision: 206068 URL: http://svn.freebsd.org/changeset/base/206068 Log: MFC 205024 The if_tap interface is of IFT_ETHERNET type, but it does not set or update the if_link_state variable. As such RT_LINK_IS_UP() fails for the if_tap interface. Also, the RT_LINK_IS_UP() needs to bypass all loopback interfaces because loopback interfaces are considered up logically as long as the system is running. This patch fixes the above issues by setting and updating the if_link_state variable when the tap interface is opened or closed respectively. Similary approach is already done in the if_tun device. Modified: stable/8/sys/net/if_tap.c stable/8/sys/net/route.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/if_tap.c ============================================================================== --- stable/8/sys/net/if_tap.c Fri Apr 2 05:02:50 2010 (r206067) +++ stable/8/sys/net/if_tap.c Fri Apr 2 05:05:51 2010 (r206068) @@ -502,6 +502,7 @@ tapopen(struct cdev *dev, int flag, int ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (tapuponopen) ifp->if_flags |= IFF_UP; + if_link_state_change(ifp, LINK_STATE_UP); splx(s); TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -547,6 +548,7 @@ tapclose(struct cdev *dev, int foo, int } else mtx_unlock(&tp->tap_mtx); + if_link_state_change(ifp, LINK_STATE_DOWN); funsetown(&tp->tap_sigio); selwakeuppri(&tp->tap_rsel, PZERO+1); KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Fri Apr 2 05:02:50 2010 (r206067) +++ stable/8/sys/net/route.h Fri Apr 2 05:05:51 2010 (r206068) @@ -319,7 +319,9 @@ struct rt_addrinfo { #ifdef _KERNEL -#define RT_LINK_IS_UP(ifp) ((ifp)->if_link_state == LINK_STATE_UP) +#define RT_LINK_IS_UP(ifp) (((ifp)->if_flags & \ + (IFF_LOOPBACK | IFF_POINTOPOINT)) \ + || (ifp)->if_link_state == LINK_STATE_UP) #define RT_LOCK_INIT(_rt) \ mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK) From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 05:12:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 704571065679; Fri, 2 Apr 2010 05:12:46 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E4608FC12; Fri, 2 Apr 2010 05:12:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o325CkAn057031; Fri, 2 Apr 2010 05:12:46 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o325CkSn057025; Fri, 2 Apr 2010 05:12:46 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201004020512.o325CkSn057025@svn.freebsd.org> From: Qing Li Date: Fri, 2 Apr 2010 05:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206069 - in stable/8: sbin/ifconfig sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 05:12:46 -0000 Author: qingli Date: Fri Apr 2 05:12:46 2010 New Revision: 206069 URL: http://svn.freebsd.org/changeset/base/206069 Log: MFC 205222 Verify interface up status using its link state only if the interface has such capability. The interface capability flag indicates whether such capability exists. This approach is much more backward compatible. Physical device driver changes will be part of another commit. Also updated the ifconfig utility to show the LINKSTATE capability if present. Reviewed by: rwatson, imp, juli Modified: stable/8/sbin/ifconfig/ifconfig.c stable/8/sys/net/if.h stable/8/sys/net/if_tap.c stable/8/sys/net/if_tun.c stable/8/sys/net/route.h Directory Properties: stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.c Fri Apr 2 05:05:51 2010 (r206068) +++ stable/8/sbin/ifconfig/ifconfig.c Fri Apr 2 05:12:46 2010 (r206069) @@ -865,7 +865,7 @@ unsetifdescr(const char *val, int value, #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER\23VLAN_HWTSO" +"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE" /* * Print the status of the interface. If an address family was Modified: stable/8/sys/net/if.h ============================================================================== --- stable/8/sys/net/if.h Fri Apr 2 05:05:51 2010 (r206068) +++ stable/8/sys/net/if.h Fri Apr 2 05:12:46 2010 (r206069) @@ -219,6 +219,7 @@ struct if_data { #define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */ #define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */ #define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */ +#define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */ #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) #define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6) Modified: stable/8/sys/net/if_tap.c ============================================================================== --- stable/8/sys/net/if_tap.c Fri Apr 2 05:05:51 2010 (r206068) +++ stable/8/sys/net/if_tap.c Fri Apr 2 05:12:46 2010 (r206069) @@ -443,6 +443,8 @@ tapcreate(struct cdev *dev) ifp->if_mtu = ETHERMTU; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); ifp->if_snd.ifq_maxlen = ifqmaxlen; + ifp->if_capabilities |= IFCAP_LINKSTATE; + ifp->if_capenable |= IFCAP_LINKSTATE; dev->si_drv1 = tp; tp->tap_dev = dev; Modified: stable/8/sys/net/if_tun.c ============================================================================== --- stable/8/sys/net/if_tun.c Fri Apr 2 05:05:51 2010 (r206068) +++ stable/8/sys/net/if_tun.c Fri Apr 2 05:12:46 2010 (r206069) @@ -386,6 +386,8 @@ tuncreate(const char *name, struct cdev ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); knlist_init_mtx(&sc->tun_rsel.si_note, NULL); + ifp->if_capabilities |= IFCAP_LINKSTATE; + ifp->if_capenable |= IFCAP_LINKSTATE; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Fri Apr 2 05:05:51 2010 (r206068) +++ stable/8/sys/net/route.h Fri Apr 2 05:12:46 2010 (r206069) @@ -319,8 +319,7 @@ struct rt_addrinfo { #ifdef _KERNEL -#define RT_LINK_IS_UP(ifp) (((ifp)->if_flags & \ - (IFF_LOOPBACK | IFF_POINTOPOINT)) \ +#define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ || (ifp)->if_link_state == LINK_STATE_UP) #define RT_LOCK_INIT(_rt) \ From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 05:15:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA2E91065686; Fri, 2 Apr 2010 05:15:27 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8B518FC18; Fri, 2 Apr 2010 05:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o325FRpT057707; Fri, 2 Apr 2010 05:15:27 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o325FRLP057705; Fri, 2 Apr 2010 05:15:27 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201004020515.o325FRLP057705@svn.freebsd.org> From: Qing Li Date: Fri, 2 Apr 2010 05:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206071 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 05:15:28 -0000 Author: qingli Date: Fri Apr 2 05:15:27 2010 New Revision: 206071 URL: http://svn.freebsd.org/changeset/base/206071 Log: MFC 205268 Set the device capabilities to include dynamic link-state for those modern drivers. Reviewed by: imp (and suggested by imp) Modified: stable/8/sys/dev/mii/mii.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/dev/mii/mii.c ============================================================================== --- stable/8/sys/dev/mii/mii.c Fri Apr 2 05:14:57 2010 (r206070) +++ stable/8/sys/dev/mii/mii.c Fri Apr 2 05:15:27 2010 (r206071) @@ -180,6 +180,8 @@ miibus_attach(device_t dev) * XXX: EVIL HACK! */ mii->mii_ifp = *(struct ifnet**)device_get_softc(device_get_parent(dev)); + mii->mii_ifp->if_capabilities |= IFCAP_LINKSTATE; + mii->mii_ifp->if_capenable |= IFCAP_LINKSTATE; ivars = device_get_ivars(dev); ifmedia_init(&mii->mii_media, IFM_IMASK, ivars->ifmedia_upd, ivars->ifmedia_sts); From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 11:07:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE7C1065800; Fri, 2 Apr 2010 11:07:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F66D8FC18; Fri, 2 Apr 2010 11:07:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32B7t13037255; Fri, 2 Apr 2010 11:07:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32B7tSI037251; Fri, 2 Apr 2010 11:07:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201004021107.o32B7tSI037251@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 2 Apr 2010 11:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206088 - in stable/8: sys/netgraph usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 11:07:55 -0000 Author: glebius Date: Fri Apr 2 11:07:55 2010 New Revision: 206088 URL: http://svn.freebsd.org/changeset/base/206088 Log: Merge r205082, r205083 that fix 'netstat -f netgraph' functionality. Modified: stable/8/sys/netgraph/ng_socket.c stable/8/sys/netgraph/ng_socketvar.h stable/8/usr.bin/netstat/netgraph.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/sys/netgraph/ng_socket.c ============================================================================== --- stable/8/sys/netgraph/ng_socket.c Fri Apr 2 11:05:59 2010 (r206087) +++ stable/8/sys/netgraph/ng_socket.c Fri Apr 2 11:07:55 2010 (r206088) @@ -156,6 +156,11 @@ static u_long ngpdg_recvspace = 20 * 102 SYSCTL_INT(_net_graph, OID_AUTO, recvspace, CTLFLAG_RW, &ngpdg_recvspace , 0, "Maximum space for incoming Netgraph datagrams"); +/* List of all sockets (for netstat -f netgraph) */ +static LIST_HEAD(, ngpcb) ngsocklist; + +static struct mtx ngsocketlist_mtx; + #define sotongpcb(so) ((struct ngpcb *)(so)->so_pcb) /* If getting unexplained errors returned, set this to "kdb_enter("X"); */ @@ -547,6 +552,9 @@ ng_attach_cntl(struct socket *so) return (error); } + /* Store a hint for netstat(1). */ + priv->node_id = priv->node->nd_ID; + /* Link the node and the private data. */ NG_NODE_SET_PRIVATE(priv->node, priv); NG_NODE_REF(priv->node); @@ -584,6 +592,10 @@ ng_attach_common(struct socket *so, int so->so_pcb = (caddr_t)pcbp; pcbp->ng_socket = so; + /* Add the socket to linked list */ + mtx_lock(&ngsocketlist_mtx); + LIST_INSERT_HEAD(&ngsocklist, pcbp, socks); + mtx_unlock(&ngsocketlist_mtx); return (0); } @@ -617,6 +629,9 @@ ng_detach_common(struct ngpcb *pcbp, int } pcbp->ng_socket->so_pcb = NULL; + mtx_lock(&ngsocketlist_mtx); + LIST_REMOVE(pcbp, socks); + mtx_unlock(&ngsocketlist_mtx); free(pcbp, M_PCB); } @@ -1115,8 +1130,14 @@ ngs_mod_event(module_t mod, int event, v switch (event) { case MOD_LOAD: + mtx_init(&ngsocketlist_mtx, "ng_socketlist", NULL, MTX_DEF); break; case MOD_UNLOAD: + /* Ensure there are no open netgraph sockets. */ + if (!LIST_EMPTY(&ngsocklist)) { + error = EBUSY; + break; + } #ifdef NOTYET /* Unregister protocol domain XXX can't do this yet.. */ #endif Modified: stable/8/sys/netgraph/ng_socketvar.h ============================================================================== --- stable/8/sys/netgraph/ng_socketvar.h Fri Apr 2 11:05:59 2010 (r206087) +++ stable/8/sys/netgraph/ng_socketvar.h Fri Apr 2 11:07:55 2010 (r206088) @@ -61,6 +61,7 @@ struct ngsock { int refs; struct mtx mtx; /* mtx to wait on */ int error; /* place to store error */ + ng_ID_t node_id; /* a hint for netstat(1) to find the node */ }; #define NGS_FLAG_NOLINGER 1 /* close with last hook */ Modified: stable/8/usr.bin/netstat/netgraph.c ============================================================================== --- stable/8/usr.bin/netstat/netgraph.c Fri Apr 2 11:05:59 2010 (r206087) +++ stable/8/usr.bin/netstat/netgraph.c Fri Apr 2 11:07:55 2010 (r206088) @@ -166,14 +166,14 @@ netgraphprotopr(u_long off, const char * name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); /* Get ngsock structure */ - if (ngpcb.sockdata == 0) /* unconnected data socket */ + if (ngpcb.sockdata == NULL) /* unconnected data socket */ goto finish; kread((u_long)ngpcb.sockdata, (char *)&info, sizeof(info)); /* Get info on associated node */ - if (info.node == 0 || csock == -1) + if (info.node_id == 0 || csock == -1) goto finish; - snprintf(path, sizeof(path), "[%lx]:", (u_long) info.node); + snprintf(path, sizeof(path), "[%x]:", info.node_id); if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_NODEINFO, NULL, 0) < 0) goto finish; From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 13:39:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAF86106566B; Fri, 2 Apr 2010 13:39:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99E538FC20; Fri, 2 Apr 2010 13:39:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32DdUfX070796; Fri, 2 Apr 2010 13:39:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32DdUsk070794; Fri, 2 Apr 2010 13:39:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004021339.o32DdUsk070794@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 2 Apr 2010 13:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206091 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 13:39:30 -0000 Author: kib Date: Fri Apr 2 13:39:30 2010 New Revision: 206091 URL: http://svn.freebsd.org/changeset/base/206091 Log: MFC r205316: Fix two style issues. Modified: stable/8/sys/kern/uipc_syscalls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Fri Apr 2 13:34:28 2010 (r206090) +++ stable/8/sys/kern/uipc_syscalls.c Fri Apr 2 13:39:30 2010 (r206091) @@ -2528,7 +2528,7 @@ sctp_generic_sendmsg_iov(td, uap) goto sctp_bad; #endif /* MAC */ - auio.uio_iov = iov; + auio.uio_iov = iov; auio.uio_iovcnt = uap->iovlen; auio.uio_segflg = UIO_USERSPACE; auio.uio_rw = UIO_WRITE; @@ -2638,7 +2638,7 @@ sctp_generic_recvmsg(td, uap) } else { fromlen = 0; } - if(uap->msg_flags) { + if (uap->msg_flags) { error = copyin(uap->msg_flags, &msg_flags, sizeof (int)); if (error) { goto out; From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 13:43:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30BFF106566B; Fri, 2 Apr 2010 13:43:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FB398FC19; Fri, 2 Apr 2010 13:43:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32DhGo8071659; Fri, 2 Apr 2010 13:43:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32DhGo1071657; Fri, 2 Apr 2010 13:43:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004021343.o32DhGo1071657@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 2 Apr 2010 13:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206092 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 13:43:17 -0000 Author: kib Date: Fri Apr 2 13:43:16 2010 New Revision: 206092 URL: http://svn.freebsd.org/changeset/base/206092 Log: MFC r205317: Remove dead statement. Modified: stable/8/sys/kern/uipc_syscalls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Fri Apr 2 13:39:30 2010 (r206091) +++ stable/8/sys/kern/uipc_syscalls.c Fri Apr 2 13:43:16 2010 (r206092) @@ -2625,7 +2625,6 @@ sctp_generic_recvmsg(td, uap) error = mac_socket_check_receive(td->td_ucred, so); if (error) { goto out; - return (error); } #endif /* MAC */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 14:37:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60D2F1065673; Fri, 2 Apr 2010 14:37:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E7C08FC0C; Fri, 2 Apr 2010 14:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32EbtWM085535; Fri, 2 Apr 2010 14:37:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32EbtYU085534; Fri, 2 Apr 2010 14:37:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004021437.o32EbtYU085534@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 2 Apr 2010 14:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206096 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 14:37:55 -0000 Author: bz Date: Fri Apr 2 14:37:55 2010 New Revision: 206096 URL: http://svn.freebsd.org/changeset/base/206096 Log: Propagate merge-info from sys/net to sys for r206024. Also record mergeinfo for r206042. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 15:33:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D3D1065670; Fri, 2 Apr 2010 15:33:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B323A8FC13; Fri, 2 Apr 2010 15:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32FXOhB097919; Fri, 2 Apr 2010 15:33:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32FXOvj097918; Fri, 2 Apr 2010 15:33:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004021533.o32FXOvj097918@svn.freebsd.org> From: Andriy Gapon Date: Fri, 2 Apr 2010 15:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206099 - stable/8/usr.bin/calendar/calendars X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 15:33:24 -0000 Author: avg Date: Fri Apr 2 15:33:24 2010 New Revision: 206099 URL: http://svn.freebsd.org/changeset/base/206099 Log: MFC r205854: calendar.freebsd: add my entry Modified: stable/8/usr.bin/calendar/calendars/calendar.freebsd Directory Properties: stable/8/usr.bin/calendar/ (props changed) Modified: stable/8/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.freebsd Fri Apr 2 15:22:23 2010 (r206098) +++ stable/8/usr.bin/calendar/calendars/calendar.freebsd Fri Apr 2 15:33:24 2010 (r206099) @@ -205,6 +205,7 @@ 07/23 Sergey A. Osokin born in Krasnogorsky, Stepnogorsk, Akmolinskaya region, Kazakhstan, 1972 07/24 Alexander Nedotsukov born in Ulyanovsk, Russian Federation, 1974 07/24 Alberto Villa born in Vercelli, Italy, 1987 +07/27 Andriy Gapon born in Kyrykivka, Sumy region, Ukraine, 1976 07/28 Jim Mock born in Bethlehem, Pennsylvania, United States, 1974 07/28 Tom Hukins born in Manchester, United Kingdom, 1976 07/29 Dirk Meyer born in Kassel, Hessen, Germany, 1965 From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 17:48:02 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F89106564A; Fri, 2 Apr 2010 17:48:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB6FE8FC1A; Fri, 2 Apr 2010 17:48:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32Hm1Zc028316; Fri, 2 Apr 2010 17:48:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32Hm1H7028314; Fri, 2 Apr 2010 17:48:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004021748.o32Hm1H7028314@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 2 Apr 2010 17:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206108 - stable/8/sys/netipsec X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 17:48:02 -0000 Author: bz Date: Fri Apr 2 17:48:01 2010 New Revision: 206108 URL: http://svn.freebsd.org/changeset/base/206108 Log: MFC r205789: When tearing down IPsec as part of a (virtual) network stack, do not try to free the same list twice but free both the acquiring list and the security policy acquiring list. Reviewed by: anchie Modified: stable/8/sys/netipsec/key.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/key.c ============================================================================== --- stable/8/sys/netipsec/key.c Fri Apr 2 17:00:37 2010 (r206107) +++ stable/8/sys/netipsec/key.c Fri Apr 2 17:48:01 2010 (r206108) @@ -7787,7 +7787,8 @@ void key_destroy(void) { struct secpolicy *sp, *nextsp; - struct secspacq *acq, *nextacq; + struct secacq *acq, *nextacq; + struct secspacq *spacq, *nextspacq; struct secashead *sah, *nextsah; struct secreg *reg; int i; @@ -7828,7 +7829,7 @@ key_destroy(void) REGTREE_UNLOCK(); ACQ_LOCK(); - for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) { + for (acq = LIST_FIRST(&V_acqtree); acq != NULL; acq = nextacq) { nextacq = LIST_NEXT(acq, chain); if (__LIST_CHAINED(acq)) { LIST_REMOVE(acq, chain); @@ -7838,11 +7839,12 @@ key_destroy(void) ACQ_UNLOCK(); SPACQ_LOCK(); - for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) { - nextacq = LIST_NEXT(acq, chain); - if (__LIST_CHAINED(acq)) { - LIST_REMOVE(acq, chain); - free(acq, M_IPSEC_SAQ); + for (spacq = LIST_FIRST(&V_spacqtree); spacq != NULL; + spacq = nextspacq) { + nextspacq = LIST_NEXT(spacq, chain); + if (__LIST_CHAINED(spacq)) { + LIST_REMOVE(spacq, chain); + free(spacq, M_IPSEC_SAQ); } } SPACQ_UNLOCK(); From owner-svn-src-stable-8@FreeBSD.ORG Fri Apr 2 17:52:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B04E106566B; Fri, 2 Apr 2010 17:52:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09D638FC13; Fri, 2 Apr 2010 17:52:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32Hqo8S029460; Fri, 2 Apr 2010 17:52:50 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32HqoX1029458; Fri, 2 Apr 2010 17:52:50 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004021752.o32HqoX1029458@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 2 Apr 2010 17:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206110 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 17:52:51 -0000 Author: bz Date: Fri Apr 2 17:52:50 2010 New Revision: 206110 URL: http://svn.freebsd.org/changeset/base/206110 Log: MFC r205637: We are holding a write lock here so avoid aquiring it twice calling the "locked" version rather than the wrapper function. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Fri Apr 2 17:50:52 2010 (r206109) +++ stable/8/sys/netinet6/nd6.c Fri Apr 2 17:52:50 2010 (r206110) @@ -1167,7 +1167,7 @@ nd6_nud_hint(struct rtentry *rt, struct ln->ln_state = ND6_LLINFO_REACHABLE; if (!ND6_LLINFO_PERMANENT(ln)) { - nd6_llinfo_settimer(ln, + nd6_llinfo_settimer_locked(ln, (long)ND_IFINFO(rt->rt_ifp)->reachable * hz); } done: From owner-svn-src-stable-8@FreeBSD.ORG Sat Apr 3 07:12:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5142E106566B; Sat, 3 Apr 2010 07:12:36 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC2F8FC08; Sat, 3 Apr 2010 07:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o337Cahv013605; Sat, 3 Apr 2010 07:12:36 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o337Ca43013603; Sat, 3 Apr 2010 07:12:36 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201004030712.o337Ca43013603@svn.freebsd.org> From: Fabien Thomas Date: Sat, 3 Apr 2010 07:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206121 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 07:12:36 -0000 Author: fabient Date: Sat Apr 3 07:12:35 2010 New Revision: 206121 URL: http://svn.freebsd.org/changeset/base/206121 Log: MFC r205998: If there is multiple PMCs for the same interrupt ignore new post. This will indirectly fix a bug where the thread will be pinned forever if the assert is not compiled. Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Sat Apr 3 07:12:03 2010 (r206120) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Sat Apr 3 07:12:35 2010 (r206121) @@ -3972,9 +3972,11 @@ pmc_post_callchain_callback(void) td = curthread; - KASSERT((td->td_pflags & TDP_CALLCHAIN) == 0, - ("[pmc,%d] thread %p already marked for callchain capture", - __LINE__, (void *) td)); + /* + * If there is multiple PMCs for the same interrupt ignore new post + */ + if (td->td_pflags & TDP_CALLCHAIN) + return; /* * Mark this thread as needing callchain capture. From owner-svn-src-stable-8@FreeBSD.ORG Sat Apr 3 15:43:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8291065674; Sat, 3 Apr 2010 15:43:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9748FC1A; Sat, 3 Apr 2010 15:43:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o33FhSeK029189; Sat, 3 Apr 2010 15:43:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o33FhSAG029187; Sat, 3 Apr 2010 15:43:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004031543.o33FhSAG029187@svn.freebsd.org> From: Alan Cox Date: Sat, 3 Apr 2010 15:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206138 - stable/8/sys/i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 15:43:28 -0000 Author: alc Date: Sat Apr 3 15:43:28 2010 New Revision: 206138 URL: http://svn.freebsd.org/changeset/base/206138 Log: MFC r205652 A ptrace(2) by one process may trigger a page size promotion in the address space of another process. Modify pmap_promote_pde() to handle this. Modified: stable/8/sys/i386/i386/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Sat Apr 3 15:40:14 2010 (r206137) +++ stable/8/sys/i386/i386/pmap.c Sat Apr 3 15:43:28 2010 (r206138) @@ -2999,7 +2999,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t * either invalid, unused, or does not map the first 4KB physical page * within a 2- or 4MB page. */ - firstpte = vtopte(trunc_4mpage(va)); + firstpte = pmap_pte_quick(pmap, trunc_4mpage(va)); setpde: newpde = *firstpte; if ((newpde & ((PG_FRAME & PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V)) {