From owner-svn-src-user@FreeBSD.ORG Mon Jul 15 06:57:03 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D7511ED6; Mon, 15 Jul 2013 06:57:03 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9B32C4C; Mon, 15 Jul 2013 06:57:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6F6v3S3078519; Mon, 15 Jul 2013 06:57:03 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6F6v33d078518; Mon, 15 Jul 2013 06:57:03 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307150657.r6F6v33d078518@svn.freebsd.org> From: Peter Holm Date: Mon, 15 Jul 2013 06:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253353 - user/pho/stress2/testcases/swap X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 06:57:03 -0000 Author: pho Date: Mon Jul 15 06:57:03 2013 New Revision: 253353 URL: http://svnweb.freebsd.org/changeset/base/253353 Log: Fixed compiler warnings. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/testcases/swap/swap.c Modified: user/pho/stress2/testcases/swap/swap.c ============================================================================== --- user/pho/stress2/testcases/swap/swap.c Mon Jul 15 06:30:57 2013 (r253352) +++ user/pho/stress2/testcases/swap/swap.c Mon Jul 15 06:57:03 2013 (r253353) @@ -53,7 +53,7 @@ setup(int nb) if (nb == 0) { mem = usermem(); swapinfo = swap(); - if (swapinfo > mem) + if (swapinfo > (int64_t)mem) swapinfo = mem; if (op->hog == 0) @@ -79,7 +79,7 @@ setup(int nb) err(1,"getrlimit"); rlp.rlim_cur -= 1024 * 1024; - if (size > rlp.rlim_cur) + if (size > (unsigned long)rlp.rlim_cur) size = rlp.rlim_cur; putval(size); @@ -118,7 +118,7 @@ test(void) while (done_testing == 0 && (time(NULL) - start) < op->run_time) { i = 0; - while (i < (int)size && done_testing == 0) { + while (i < size && done_testing == 0) { c[i] = 0; i += page; } From owner-svn-src-user@FreeBSD.ORG Mon Jul 15 07:00:19 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA53BF3; Mon, 15 Jul 2013 07:00:19 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93119C68; Mon, 15 Jul 2013 07:00:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6F70JTg079100; Mon, 15 Jul 2013 07:00:19 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6F70JXO079099; Mon, 15 Jul 2013 07:00:19 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307150700.r6F70JXO079099@svn.freebsd.org> From: Peter Holm Date: Mon, 15 Jul 2013 07:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253354 - user/pho/stress2 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 07:00:19 -0000 Author: pho Date: Mon Jul 15 07:00:19 2013 New Revision: 253354 URL: http://svnweb.freebsd.org/changeset/base/253354 Log: All test in this scenario should have an equal opportunity to run. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/marcus.cfg Modified: user/pho/stress2/marcus.cfg ============================================================================== --- user/pho/stress2/marcus.cfg Mon Jul 15 06:57:03 2013 (r253353) +++ user/pho/stress2/marcus.cfg Mon Jul 15 07:00:19 2013 (r253354) @@ -9,6 +9,7 @@ export LOAD=80 export symlinkLOAD=80 +export rwLOAD=80 export TESTPROGS=" testcases/lockf2/lockf2 testcases/symlink/symlink From owner-svn-src-user@FreeBSD.ORG Mon Jul 15 07:26:41 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D13F57E8; Mon, 15 Jul 2013 07:26:41 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A974FD42; Mon, 15 Jul 2013 07:26:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6F7QfqB088011; Mon, 15 Jul 2013 07:26:41 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6F7Qfis088010; Mon, 15 Jul 2013 07:26:41 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307150726.r6F7Qfis088010@svn.freebsd.org> From: Peter Holm Date: Mon, 15 Jul 2013 07:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253356 - user/pho/stress2/lib X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 07:26:41 -0000 Author: pho Date: Mon Jul 15 07:26:41 2013 New Revision: 253356 URL: http://svnweb.freebsd.org/changeset/base/253356 Log: Fix compiler warnings. Remove local versions of err() and warn(), as they are no longer needed. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/lib/resources.c Modified: user/pho/stress2/lib/resources.c ============================================================================== --- user/pho/stress2/lib/resources.c Mon Jul 15 07:01:30 2013 (r253355) +++ user/pho/stress2/lib/resources.c Mon Jul 15 07:26:41 2013 (r253356) @@ -90,7 +90,7 @@ df(void) if (statfs(path, &buf) < 0) err(1, "statfs(%s)", path); - if (buf.f_bavail > buf.f_blocks || buf.f_bavail < 0) { + if (buf.f_bavail > (int64_t)buf.f_blocks || buf.f_bavail < 0) { warnx("Corrupt statfs(%s). f_bavail = %jd!", path, buf.f_bavail); buf.f_bavail = 100; } @@ -187,7 +187,7 @@ getdf(int64_t *block, int64_t *inode) *inode = inodes(); snprintf(buf, sizeof(buf), "%jd %jd", *block, *inode); - if (write(dffd, buf, strlen(buf) + 1) != strlen(buf) +1) + if (write(dffd, buf, strlen(buf) + 1) != (ssize_t)strlen(buf) +1) err(1, "write df. %s:%d", __FILE__, __LINE__); } else { if (read(dffd, buf, sizeof(buf)) < 1) { @@ -228,7 +228,7 @@ reservedf(int64_t blks, int64_t inos) printf("******************************** %s: %s\n", getprogname(), buf); if (lseek(dffd, 0, 0) == -1) err(1, "lseek. %s:%d", __FILE__, __LINE__); - if (write(dffd, buf, strlen(buf) + 1) != strlen(buf) +1) + if (write(dffd, buf, strlen(buf) + 1) != (ssize_t)strlen(buf) +1) warn("write df. %s:%d", __FILE__, __LINE__); err: close(dffd); @@ -236,62 +236,3 @@ err: if (unlink(lockpath) == -1) err(1, "unlink(%s)", lockpath); } - -/* The UFS2 soft update lag problem causes a lot of confusion, so for now add the err() function here */ - -static void -vpr(int code, const char *fmt, va_list ap) -{ - char path[MAXPATHLEN+1]; - char siz[5], ino[5]; - int64_t s, i; - - s = df(); - i = inodes(); - - if (errno == ENOSPC && (flags & MNT_SOFTDEP) && (flags & MNT_QUOTA) == 0 && - s > 100 && i > 100) { - if (getcwd(path, sizeof(path)) == NULL) - err(1, "getcwd()"); - - humanize_number(siz, sizeof(siz), s, "", - HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - humanize_number(ino, sizeof(ino), i, "", - HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - - printf("A syscall has failed with ENOSPC even though free disk " - "space for %s is reported as %s and %s inodes.\n", - path, siz, ino); - } - - - fprintf(stderr, "%s: ", getprogname()); - if (fmt != NULL) { - vfprintf(stderr, fmt, ap); - fprintf(stderr, ": "); - } - fprintf(stderr, "%s\n", strerror(code)); -} - -void -err(int eval, const char *fmt, ...) -{ - va_list ap; - int code = errno; - - va_start(ap, fmt); - vpr(code, fmt, ap); - va_end(ap); - exit(eval); -} - -void -warn(const char *fmt, ...) -{ - va_list ap; - int code = errno; - - va_start(ap, fmt); - vpr(code, fmt, ap); - va_end(ap); -} From owner-svn-src-user@FreeBSD.ORG Tue Jul 16 08:54:19 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BBED1B2B; Tue, 16 Jul 2013 08:54:19 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B02A6848; Tue, 16 Jul 2013 08:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6G8sJU8071718; Tue, 16 Jul 2013 08:54:19 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6G8sJj7071716; Tue, 16 Jul 2013 08:54:19 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307160854.r6G8sJj7071716@svn.freebsd.org> From: Peter Holm Date: Tue, 16 Jul 2013 08:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253383 - user/pho/stress2/testcases/badcode X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2013 08:54:19 -0000 Author: pho Date: Tue Jul 16 08:54:19 2013 New Revision: 253383 URL: http://svnweb.freebsd.org/changeset/base/253383 Log: Rework test case so it work as intended. Map text segment RW and turn off the optimizer. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/testcases/badcode/Makefile user/pho/stress2/testcases/badcode/badcode.c Modified: user/pho/stress2/testcases/badcode/Makefile ============================================================================== --- user/pho/stress2/testcases/badcode/Makefile Tue Jul 16 08:16:04 2013 (r253382) +++ user/pho/stress2/testcases/badcode/Makefile Tue Jul 16 08:54:19 2013 (r253383) @@ -3,3 +3,4 @@ PROG= badcode .include +CFLAGS =-g -Wall -Wextra -I../../include -I../include Modified: user/pho/stress2/testcases/badcode/badcode.c ============================================================================== --- user/pho/stress2/testcases/badcode/badcode.c Tue Jul 16 08:16:04 2013 (r253382) +++ user/pho/stress2/testcases/badcode/badcode.c Tue Jul 16 08:54:19 2013 (r253383) @@ -26,52 +26,59 @@ This code is based on crashme.c #include __FBSDID("$FreeBSD$"); -#include -#include -#include +#include +#include #include -#include #include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include +#include #include "stress.h" -#define BUFS 64 - -char buf [BUFS]; pid_t pid; +int failsafe; -void (*sub)(); +static int +tobemangled(void) { + volatile int i, j; -void -proto(void) { - int i = 2; - printf("Hello, world (%d)\n", i); - return; + j = 2; + for (i = 0; i < 100; i++) + j = j + 3; + j = j / 2; + + return (j); } -void -alter(void) { /* Change one byte in the code */ +static void +mangle(void) { /* Change one byte in the code */ int i; - i = random() % BUFS; - buf[i] = random() & 0xff; + char *p = (void *)tobemangled; + + i = arc4random() % 50; + p[i] = arc4random() & 0xff; } -void -hand(int i) { /* alarm handler */ +static void +hand(int i __unused) { /* handler */ + _exit(1); +} + +static void +ahand(int i __unused) { /* alarm handler */ if (pid != 0) { - kill(pid, SIGHUP); kill(pid, SIGKILL); } - exit(1); + _exit(EXIT_SUCCESS); } int -setup(int nb) +setup(int nb __unused) { return (0); } @@ -84,17 +91,25 @@ cleanup(void) int test(void) { - pid_t pid; - int i, status; + void *st; + struct rlimit rl; - for (i = 0; i < 512; i++) { - if (i % 10 == 0) - bcopy(proto, buf, BUFS); - alter(); + if (failsafe) + return (0); + while (done_testing == 0) { + signal(SIGALRM, ahand); + alarm(3); if ((pid = fork()) == 0) { + rl.rlim_max = rl.rlim_cur = 0; + if (setrlimit(RLIMIT_CORE, &rl) == -1) + warn("setrlimit"); + arc4random_stir(); + st = (void *)trunc_page((unsigned long)tobemangled); + if (mprotect(st, PAGE_SIZE, PROT_WRITE | PROT_READ | PROT_EXEC) == -1) + err(1, "mprotect()"); + signal(SIGALRM, hand); -#if 0 signal(SIGILL, hand); signal(SIGFPE, hand); signal(SIGSEGV, hand); @@ -102,20 +117,17 @@ test(void) signal(SIGURG, hand); signal(SIGSYS, hand); signal(SIGTRAP, hand); -#endif - alarm(2); - (*sub)(); + mangle(); + failsafe = 1; + (void)tobemangled(); - exit(EXIT_SUCCESS); + _exit(EXIT_SUCCESS); } else if (pid > 0) { - signal(SIGALRM, hand); - alarm(3); - if (waitpid(pid, &status, 0) == -1) + if (waitpid(pid, NULL, 0) == -1) warn("waitpid(%d)", pid); alarm(0); - kill(pid, SIGINT); } else err(1, "fork(), %s:%d", __FILE__, __LINE__); } From owner-svn-src-user@FreeBSD.ORG Tue Jul 16 11:54:45 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57B49665; Tue, 16 Jul 2013 11:54:45 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B410D6; Tue, 16 Jul 2013 11:54:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6GBsjjI025527; Tue, 16 Jul 2013 11:54:45 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6GBsj7w025526; Tue, 16 Jul 2013 11:54:45 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307161154.r6GBsj7w025526@svn.freebsd.org> From: Peter Holm Date: Tue, 16 Jul 2013 11:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253390 - user/pho/stress2/lib X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jul 2013 11:54:45 -0000 Author: pho Date: Tue Jul 16 11:54:44 2013 New Revision: 253390 URL: http://svnweb.freebsd.org/changeset/base/253390 Log: Check if test scenario terminate before time. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/lib/main.c Modified: user/pho/stress2/lib/main.c ============================================================================== --- user/pho/stress2/lib/main.c Tue Jul 16 11:54:25 2013 (r253389) +++ user/pho/stress2/lib/main.c Tue Jul 16 11:54:44 2013 (r253390) @@ -165,8 +165,11 @@ run_test(void) if (p < 0) err(1, "fork() in %s:%d", __FILE__, __LINE__); while (done_testing != 1 && - (time(NULL) - start) < op->run_time) + (time(NULL) - start) < op->run_time) { sleep(1); + if (waitpid(p, &status, WNOHANG) == p) + return (status); + } if (kill(p, SIGHUP) == -1) warn("kill(%d, SIGHUP), %s:%d", p, __FILE__, __LINE__); From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 06:11:44 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B270974B; Wed, 17 Jul 2013 06:11:44 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A624B7F5; Wed, 17 Jul 2013 06:11:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6H6BiIf062857; Wed, 17 Jul 2013 06:11:44 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6H6Bidc062855; Wed, 17 Jul 2013 06:11:44 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307170611.r6H6Bidc062855@svn.freebsd.org> From: Peter Holm Date: Wed, 17 Jul 2013 06:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253409 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 06:11:44 -0000 Author: pho Date: Wed Jul 17 06:11:43 2013 New Revision: 253409 URL: http://svnweb.freebsd.org/changeset/base/253409 Log: Added a fail safe test termination method. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/tcp.sh user/pho/stress2/misc/tcp2.sh Modified: user/pho/stress2/misc/tcp.sh ============================================================================== --- user/pho/stress2/misc/tcp.sh Wed Jul 17 04:53:53 2013 (r253408) +++ user/pho/stress2/misc/tcp.sh Wed Jul 17 06:11:43 2013 (r253409) @@ -44,6 +44,10 @@ n=`su $testuser -c "limits | grep maxpro export tcpINCARNATIONS=$((n / 2 - 10)) export TESTPROGS=" ./testcases/tcp/tcp" -su $testuser -c '(cd ..; ./testcases/run/run $TESTPROGS)' +su $testuser -c '(cd ..; ./testcases/run/run $TESTPROGS)' & -ps -U$testuser | sed 1d | awk '{print $1}' | xargs kill -9 +sleep $((15 * 60)) +while pkill -9 -U $testuser tcp; do + sleep .5 +done +wait Modified: user/pho/stress2/misc/tcp2.sh ============================================================================== --- user/pho/stress2/misc/tcp2.sh Wed Jul 17 04:53:53 2013 (r253408) +++ user/pho/stress2/misc/tcp2.sh Wed Jul 17 06:11:43 2013 (r253409) @@ -48,6 +48,10 @@ export TESTPROGS=" ./testcases/swap/swap " -su $testuser -c '(cd ..; ./testcases/run/run $TESTPROGS)' +su $testuser -c '(cd ..; ./testcases/run/run $TESTPROGS)' & -ps -U$testuser | sed 1d | awk '{print $1}' | xargs kill -9 +sleep $((15 * 60)) +while pkill -9 -U $testuser "tcp|swap"; do + sleep .5 +done +wait From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 06:29:42 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B15E2952; Wed, 17 Jul 2013 06:29:42 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9432985E; Wed, 17 Jul 2013 06:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6H6Tgtj066578; Wed, 17 Jul 2013 06:29:42 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6H6TgI7066576; Wed, 17 Jul 2013 06:29:42 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307170629.r6H6TgI7066576@svn.freebsd.org> From: Peter Holm Date: Wed, 17 Jul 2013 06:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253410 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 06:29:42 -0000 Author: pho Date: Wed Jul 17 06:29:41 2013 New Revision: 253410 URL: http://svnweb.freebsd.org/changeset/base/253410 Log: Added two regression test for r253189: "Never remove user-wired pages from an object when doing msync(MS_INVALIDATE)". Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/msync.sh (contents, props changed) user/pho/stress2/misc/wire_no_page.sh (contents, props changed) Added: user/pho/stress2/misc/msync.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/msync.sh Wed Jul 17 06:29:41 2013 (r253410) @@ -0,0 +1,201 @@ +#!/bin/sh + +# +# Copyright (c) 2013 Peter Holm +# 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$ +# + +# msync(2) / mlockall(2) test scenario. +# "panic: vm_fault_copy_wired: page missing" seen. +# http://people.freebsd.org/~pho/stress/log/msync.txt +# Fixed in r253189. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/msync.c +cc -o msync -Wall -Wextra msync.c -lpthread || exit 1 +rm -f msync.c +cd $odir + +/tmp/msync + +killall msync > /dev/null 2>&1 +rm -f /tmp/msync +exit + +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int syscallno = SYS_msync; +#define N (128 * 1024 / (int)sizeof(u_int32_t)) +u_int32_t r[N]; + +static void +hand(int i __unused) { /* handler */ + _exit(1); +} + +unsigned long +makearg(void) +{ + unsigned int i; + unsigned long val; + + val = arc4random(); + i = arc4random() % 100; + if (i < 20) + val = val & 0xff; + if (i >= 20 && i < 40) + val = val & 0xffff; + if (i >= 40 && i < 60) + val = (unsigned long)(r) | (val & 0xffff); +#if defined(__LP64__) + if (i >= 60) { + val = (val << 32) | arc4random(); + if (i > 80) + val = val & 0x00007fffffffffffUL; + } +#endif + + return(val); +} + +void * +calls(void *arg __unused) +{ + int i, num; + unsigned long arg1, arg2, arg3; + + usleep(1000); + num = syscallno; + for (i = 0; i < 500; i++) { + arg1 = makearg(); + arg2 = makearg(); +#if 0 + arg3 = makearg(); + arg3 = arg3 & ~MS_INVALIDATE; /* No problem seen */ +#else + arg3 = MS_INVALIDATE; /* panic */ +#endif + +#if 0 + fprintf(stderr, "%2d : syscall(%3d, 0x%lx, 0x%lx, 0x%lx)\n", + i, num, arg1, arg2, arg3); + usleep(50000); +#endif + alarm(1); + syscall(num, arg1, arg2, arg3); + num = 0; + } + + return (0); +} +void +wd(void) +{ + int i; + + if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) + err(1, "mlockall failed"); + + for (i = 0; i < 800; i++) { + if (fork() == 0) { + usleep(20000); + _exit(0); + } + wait(NULL); + usleep(100000); + } + + _exit(0); +} + +int +main(void) +{ + struct passwd *pw; + pthread_t cp[50]; + int i, j; + + if (fork() == 0) + wd(); + + if ((pw = getpwnam("nobody")) == NULL) + err(1, "no such user: nobody"); + + if (setgroups(1, &pw->pw_gid) || + setegid(pw->pw_gid) || setgid(pw->pw_gid) || + seteuid(pw->pw_uid) || setuid(pw->pw_uid)) + err(1, "Can't drop privileges to \"nobody\""); + endpwent(); + + signal(SIGALRM, hand); + signal(SIGILL, hand); + signal(SIGFPE, hand); + signal(SIGSEGV, hand); + signal(SIGBUS, hand); + signal(SIGURG, hand); + signal(SIGSYS, hand); + signal(SIGTRAP, hand); + + alarm(180); + for (i = 0; i < 8000; i++) { + if (fork() == 0) { + arc4random_stir(); + for (j = 0; j < N; j++) + r[j] = arc4random(); + for (j = 0; j < 50; j++) + if (pthread_create(&cp[j], NULL, calls, NULL) != 0) + perror("pthread_create"); + + for (j = 0; j < 50; j++) + pthread_join(cp[j], NULL); + _exit(0); + } + wait(NULL); + } + + return (0); +} Added: user/pho/stress2/misc/wire_no_page.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/wire_no_page.sh Wed Jul 17 06:29:41 2013 (r253410) @@ -0,0 +1,105 @@ +#!/bin/sh + +# +# Copyright (c) 2013 Peter Holm +# 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$ +# + +# Test scenario by kib@ + +# "panic: vm_page_set_invalid: page 0xc3dfe8c0 is busy" seen. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/wire_no_page.c +cc -o wire_no_page -Wall -Wextra wire_no_page.c -lpthread || exit 1 +rm -f wire_no_page.c +cd $odir + +cp /tmp/wire_no_page /tmp/wire_no_page2 +for i in `jot 100`; do + for j in `jot 50`; do + /tmp/wire_no_page /tmp/wire_no_page2 & + done + for j in `jot 50`; do + wait + done +done + +rm -f /tmp/wire_no_page /tmp/wire_no_page2 +exit + +EOF +/* $Id: wire_no_page.c,v 1.1 2013/05/17 07:50:30 kostik Exp kostik $ */ +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct stat st; + char *p1, *p2; + size_t len; + pid_t child; + int error, fd; + + if (argc < 2) + errx(1, "file name ?"); + fd = open(argv[1], O_RDWR); + if (fd == -1) + err(1, "open %s", argv[1]); + error = fstat(fd, &st); + if (error == -1) + err(1, "stat"); + len = round_page(st.st_size); + p1 = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if ((void *)p1 == MAP_FAILED) + err(1, "mmap"); + error = mlock(p1, len); + if (error == -1) + err(1, "mlock"); + p2 = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if ((void *)p2 == MAP_FAILED) + err(1, "mmap"); + error = msync(p2, len, MS_SYNC | MS_INVALIDATE); + if (error == -1) + err(1, "msync"); + child = fork(); + if (child == -1) + err(1, "fork"); + else if (child == 0) + _exit(0); + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 07:17:08 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7577C48A; Wed, 17 Jul 2013 07:17:08 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68892A30; Wed, 17 Jul 2013 07:17:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6H7H8Hc081712; Wed, 17 Jul 2013 07:17:08 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6H7H8mI081711; Wed, 17 Jul 2013 07:17:08 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307170717.r6H7H8mI081711@svn.freebsd.org> From: Peter Holm Date: Wed, 17 Jul 2013 07:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253412 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 07:17:08 -0000 Author: pho Date: Wed Jul 17 07:17:07 2013 New Revision: 253412 URL: http://svnweb.freebsd.org/changeset/base/253412 Log: Swap test scenario added. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/swap.sh (contents, props changed) Added: user/pho/stress2/misc/swap.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/swap.sh Wed Jul 17 07:17:07 2013 (r253412) @@ -0,0 +1,152 @@ +#!/bin/sh + +# +# Copyright (c) 2013 EMC Corp. +# 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$ +# + +# Swap test. Variation of testcases/swap. + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/swap.c +cc -o swap -Wall -Wextra -O2 swap.c || exit 1 +rm -f swap.c + +usermem=`sysctl hw.usermem | sed 's/.* //'` +swap=`sysctl vm.swap_total | sed 's/.* //'` + +if [ $swap -gt 0 ]; then + size=$((usermem/10*11)) +else + size=$((usermem/10*9)) +fi + +/tmp/swap $((size / 4096)) + +rm -f /tmp/swap +exit +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define RUNTIME (5 * 60) +#define INCARNATIONS 32 + +static unsigned long size, original; + +void +setup(void) +{ + struct rlimit rlp; + + size = size / INCARNATIONS; + original = size; + if (size == 0) + errx(1, "Argument too small"); + + if (getrlimit(RLIMIT_DATA, &rlp) < 0) + err(1,"getrlimit"); + rlp.rlim_cur -= 1024 * 1024; + + if (size > (unsigned long)rlp.rlim_cur) + size = rlp.rlim_cur; + +#if 0 + printf("setup: pid %d. Total %luMb\n", + getpid(), size / 1024 / 1024 * INCARNATIONS); +#endif + + if (size == 0) + errx(1, "Argument too small"); + + return; +} + +int +test(void) +{ + char *c; + int page; + unsigned long i, j; + time_t start; + + c = malloc(size); + while (c == NULL) { + size -= 1024 * 1024; + c = malloc(size); + } + if (size != original) + printf("Malloc size changed from %ld Mb to %ld Mb\n", + original / 1024 / 1024, size / 1024 / 1024); + page = getpagesize(); + start = time(NULL); + while ((time(NULL) - start) < RUNTIME) { + i = j = 0; + while (i < size) { + c[i] = 0; + i += page; + if (++j % 1024 == 0) { + if ((time(NULL) - start) >= RUNTIME) + break; + if (arc4random() % 100 < 5) + usleep(1000); + } + } + } + free(c); + + _exit(0); +} + +int +main(int argc, char **argv) +{ + int i; + + if (argc != 2) + errx(1, "Usage: %s bytes", argv[0]); + + size = atol(argv[1]) * 4096; + setup(); + + for (i = 0; i < INCARNATIONS; i++) + if (fork() == 0) + test(); + + for (i = 0; i < INCARNATIONS; i++) + wait(NULL); + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 11:03:56 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 398CC5C5; Wed, 17 Jul 2013 11:03:56 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBC5969; Wed, 17 Jul 2013 11:03:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6HB3u0H050209; Wed, 17 Jul 2013 11:03:56 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6HB3u4u050208; Wed, 17 Jul 2013 11:03:56 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307171103.r6HB3u4u050208@svn.freebsd.org> From: Peter Holm Date: Wed, 17 Jul 2013 11:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253418 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 11:03:56 -0000 Author: pho Date: Wed Jul 17 11:03:55 2013 New Revision: 253418 URL: http://svnweb.freebsd.org/changeset/base/253418 Log: Rewrote test to use libMicro from ports. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/libMicro.sh Modified: user/pho/stress2/misc/libMicro.sh ============================================================================== --- user/pho/stress2/misc/libMicro.sh Wed Jul 17 10:56:21 2013 (r253417) +++ user/pho/stress2/misc/libMicro.sh Wed Jul 17 11:03:55 2013 (r253418) @@ -28,44 +28,26 @@ # $FreeBSD$ # -# Test using OpenSolaris libmicro-0.4.0.tar.gz benchmark +# Test using the OpenSolaris libmicro benchmark # Has shown page fault with the cascade_lockf test -. ../default.cfg +if [ $# -eq 0 ]; then + . ../default.cfg -odir=`pwd` + [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 -cd $RUNDIR -ftp http://www.opensolaris.org/os/project/libmicro/files/libmicro-0.4.0.tar.gz -[ ! -r libmicro-0.4.0.tar.gz ] && exit 1 -tar zxfv libmicro-0.4.0.tar.gz -cat > $RUNDIR/libMicro-0.4.0/Makefile.FreeBSD <<2EOF -CC= gcc - -CFLAGS= -pthread -CPPFLAGS= -DUSE_SEMOP -D_REENTRANT -MATHLIB= -lm - -ELIDED_BENCHMARKS= \ - cachetocache \ - atomic - - -include ../Makefile.com -2EOF - -cd libMicro-0.4.0 -gmake -ed bench <<3EOF -/ARCH -s/arch -k/uname -m/ -w -q -3EOF -./bench > output & -for i in `jot $((30 * 60))`; do - ps | grep -q bench || break - sleep 1 -done -ps | grep bin/connection | grep -v grep | awk '{print $1}' | xargs kill # hack -cd ..;rm -rf libMicro-0.4.0 + [ -x /usr/local/bin/libmicro-bench ] || + { echo "ports/benchmarks/libmicro is not installed"; exit 1; } + + [ `id -un` = $testuser ] && + { echo "\$testuser is identical to current id"; exit 1; } + + rm -f /tmp/libmicro.log + su $testuser -c "$0 x" + echo "" +else + /usr/local/bin/libmicro-bench > /tmp/libmicro.log & + # Temp. work-around for hanging "c_lockf_10" test. + sleep 60 + kill 0 +fi From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 17:28:20 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B34C9D7; Wed, 17 Jul 2013 17:28:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD11EF15; Wed, 17 Jul 2013 17:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6HHSJqm066524; Wed, 17 Jul 2013 17:28:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6HHSGLO066508; Wed, 17 Jul 2013 17:28:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307171728.r6HHSGLO066508@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Jul 2013 17:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253430 - in user/attilio/vmcontention: . etc/rc.d lib/libc/gen lib/libc/stdlib lib/libusb lib/msun/src sbin/mount sbin/nvmecontrol sbin/route share/examples/kld/syscall/test share/man/... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 17:28:20 -0000 Author: attilio Date: Wed Jul 17 17:28:16 2013 New Revision: 253430 URL: http://svnweb.freebsd.org/changeset/base/253430 Log: MFC Added: user/attilio/vmcontention/share/monetdef/ca_ES.UTF-8.src - copied unchanged from r253429, head/share/monetdef/ca_ES.UTF-8.src user/attilio/vmcontention/share/monetdef/de_AT.UTF-8.src - copied unchanged from r253429, head/share/monetdef/de_AT.UTF-8.src user/attilio/vmcontention/share/monetdef/de_DE.UTF-8.src - copied unchanged from r253429, head/share/monetdef/de_DE.UTF-8.src user/attilio/vmcontention/share/monetdef/el_GR.UTF-8.src - copied unchanged from r253429, head/share/monetdef/el_GR.UTF-8.src user/attilio/vmcontention/share/monetdef/es_ES.UTF-8.src - copied unchanged from r253429, head/share/monetdef/es_ES.UTF-8.src user/attilio/vmcontention/share/monetdef/fi_FI.UTF-8.src - copied unchanged from r253429, head/share/monetdef/fi_FI.UTF-8.src user/attilio/vmcontention/share/monetdef/fr_BE.UTF-8.src - copied unchanged from r253429, head/share/monetdef/fr_BE.UTF-8.src user/attilio/vmcontention/share/monetdef/fr_FR.UTF-8.src - copied unchanged from r253429, head/share/monetdef/fr_FR.UTF-8.src user/attilio/vmcontention/share/monetdef/it_IT.UTF-8.src - copied unchanged from r253429, head/share/monetdef/it_IT.UTF-8.src user/attilio/vmcontention/share/monetdef/nl_BE.UTF-8.src - copied unchanged from r253429, head/share/monetdef/nl_BE.UTF-8.src user/attilio/vmcontention/share/monetdef/nl_NL.UTF-8.src - copied unchanged from r253429, head/share/monetdef/nl_NL.UTF-8.src user/attilio/vmcontention/sys/arm/broadcom/bcm2835/std.bcm2835 - copied unchanged from r253429, head/sys/arm/broadcom/bcm2835/std.bcm2835 user/attilio/vmcontention/sys/arm/broadcom/bcm2835/std.rpi - copied unchanged from r253429, head/sys/arm/broadcom/bcm2835/std.rpi user/attilio/vmcontention/tools/build/options/WITHOUT_ARM_EABI - copied unchanged from r253429, head/tools/build/options/WITHOUT_ARM_EABI Deleted: user/attilio/vmcontention/tools/build/options/WITH_ARM_EABI user/attilio/vmcontention/usr.bin/systat/mbufs.c Modified: user/attilio/vmcontention/UPDATING user/attilio/vmcontention/etc/rc.d/pfsync user/attilio/vmcontention/lib/libc/gen/sysctl.3 user/attilio/vmcontention/lib/libc/stdlib/getenv.c user/attilio/vmcontention/lib/libusb/Makefile user/attilio/vmcontention/lib/libusb/libusb20.c user/attilio/vmcontention/lib/libusb/libusb20_ugen20.c user/attilio/vmcontention/lib/libusb/libusb_global_linux.h user/attilio/vmcontention/lib/msun/src/math.h user/attilio/vmcontention/sbin/mount/mount.8 user/attilio/vmcontention/sbin/mount/mount.c user/attilio/vmcontention/sbin/nvmecontrol/firmware.c user/attilio/vmcontention/sbin/route/Makefile user/attilio/vmcontention/sbin/route/route.c user/attilio/vmcontention/share/examples/kld/syscall/test/call.c user/attilio/vmcontention/share/man/man4/mfi.4 user/attilio/vmcontention/share/man/man5/fstab.5 user/attilio/vmcontention/share/man/man5/src.conf.5 user/attilio/vmcontention/share/mk/bsd.own.mk user/attilio/vmcontention/share/monetdef/Makefile user/attilio/vmcontention/sys/amd64/amd64/machdep.c user/attilio/vmcontention/sys/arm/arm/vfp.c user/attilio/vmcontention/sys/arm/arm/vm_machdep.c user/attilio/vmcontention/sys/arm/conf/RPI-B user/attilio/vmcontention/sys/cam/cam_periph.c user/attilio/vmcontention/sys/cam/cam_xpt.c user/attilio/vmcontention/sys/cam/scsi/scsi_all.c user/attilio/vmcontention/sys/cam/scsi/scsi_all.h user/attilio/vmcontention/sys/cam/scsi/scsi_ch.c user/attilio/vmcontention/sys/cam/scsi/scsi_xpt.c user/attilio/vmcontention/sys/compat/linux/linux_ioctl.c user/attilio/vmcontention/sys/compat/linux/linux_ioctl.h user/attilio/vmcontention/sys/conf/Makefile.arm user/attilio/vmcontention/sys/conf/files user/attilio/vmcontention/sys/dev/acpica/acpi_resource.c user/attilio/vmcontention/sys/dev/ae/if_ae.c user/attilio/vmcontention/sys/dev/ae/if_aereg.h user/attilio/vmcontention/sys/dev/bge/if_bge.c user/attilio/vmcontention/sys/dev/bge/if_bgereg.h user/attilio/vmcontention/sys/dev/cxgbe/firmware/t5fw_cfg.txt user/attilio/vmcontention/sys/dev/isp/isp.c user/attilio/vmcontention/sys/dev/isp/ispreg.h user/attilio/vmcontention/sys/dev/usb/controller/xhci_pci.c user/attilio/vmcontention/sys/dev/usb/input/ukbd.c user/attilio/vmcontention/sys/dev/usb/wlan/if_rum.c user/attilio/vmcontention/sys/dev/usb/wlan/if_uath.c user/attilio/vmcontention/sys/dev/usb/wlan/if_upgt.c user/attilio/vmcontention/sys/dev/usb/wlan/if_ural.c user/attilio/vmcontention/sys/dev/usb/wlan/if_urtw.c user/attilio/vmcontention/sys/dev/usb/wlan/if_urtwn.c user/attilio/vmcontention/sys/dev/usb/wlan/if_zyd.c user/attilio/vmcontention/sys/fs/fuse/fuse_kernel.h user/attilio/vmcontention/sys/i386/i386/support.s user/attilio/vmcontention/sys/i386/i386/symbols.raw user/attilio/vmcontention/sys/i386/i386/uio_machdep.c user/attilio/vmcontention/sys/i386/i386/vm_machdep.c user/attilio/vmcontention/sys/kern/kern_mbuf.c user/attilio/vmcontention/sys/kern/kern_time.c user/attilio/vmcontention/sys/kern/subr_bus.c user/attilio/vmcontention/sys/kern/uipc_mbuf.c user/attilio/vmcontention/sys/kern/uipc_syscalls.c user/attilio/vmcontention/sys/kern/vfs_bio.c user/attilio/vmcontention/sys/kern/vfs_subr.c user/attilio/vmcontention/sys/mips/mips/uio_machdep.c user/attilio/vmcontention/sys/mips/mips/vm_machdep.c user/attilio/vmcontention/sys/modules/Makefile user/attilio/vmcontention/sys/modules/usb/Makefile user/attilio/vmcontention/sys/net/ieee8023ad_lacp.c user/attilio/vmcontention/sys/net/if.c user/attilio/vmcontention/sys/net/if_lagg.c user/attilio/vmcontention/sys/net/if_lagg.h user/attilio/vmcontention/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c user/attilio/vmcontention/sys/netgraph/bluetooth/socket/ng_btsocket.c user/attilio/vmcontention/sys/netgraph/ng_base.c user/attilio/vmcontention/sys/netinet/tcp_syncache.c user/attilio/vmcontention/sys/ofed/drivers/net/mlx4/main.c user/attilio/vmcontention/sys/powerpc/aim/vm_machdep.c user/attilio/vmcontention/sys/powerpc/booke/vm_machdep.c user/attilio/vmcontention/sys/powerpc/powerpc/uio_machdep.c user/attilio/vmcontention/sys/sparc64/sparc64/uio_machdep.c user/attilio/vmcontention/sys/sparc64/sparc64/vm_machdep.c user/attilio/vmcontention/sys/sys/mbuf.h user/attilio/vmcontention/sys/sys/param.h user/attilio/vmcontention/sys/sys/sf_buf.h user/attilio/vmcontention/sys/ufs/ffs/ffs_alloc.c user/attilio/vmcontention/tools/regression/aio/aiop/aiop.c user/attilio/vmcontention/tools/regression/lib/libc/gen/test-fpclassify.c user/attilio/vmcontention/tools/regression/lib/libc/gen/test-ftw.c user/attilio/vmcontention/tools/regression/priv/Makefile user/attilio/vmcontention/tools/regression/pthread/cv_cancel1/cv_cancel1.c user/attilio/vmcontention/tools/regression/sbin/dhclient/Makefile user/attilio/vmcontention/usr.bin/netstat/main.c user/attilio/vmcontention/usr.bin/netstat/mbuf.c user/attilio/vmcontention/usr.bin/systat/Makefile user/attilio/vmcontention/usr.bin/systat/cmdtab.c user/attilio/vmcontention/usr.bin/systat/extern.h user/attilio/vmcontention/usr.bin/systat/systat.1 user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/cdrom.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/common.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/directory.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/dos.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/floppy.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/ftp.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/http.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/httpproxy.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/nfs.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/ufs.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/media/usb.subr user/attilio/vmcontention/usr.sbin/bsdconfig/share/packages/packages.subr user/attilio/vmcontention/usr.sbin/rtsold/rtsol.c user/attilio/vmcontention/usr.sbin/ypserv/yp_access.c user/attilio/vmcontention/usr.sbin/ypserv/yp_dnslookup.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/share/man/man4/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/usr.sbin/rtsold/ (props changed) Modified: user/attilio/vmcontention/UPDATING ============================================================================== --- user/attilio/vmcontention/UPDATING Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/UPDATING Wed Jul 17 17:28:16 2013 (r253430) @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130716: + The default ARM ABI has changed to the ARM EABI. The old ABI is + incompatible with the ARM EABI and all programs and modules will + need to be rebuilt to work with a new kernel. + + To keep using the old ABI ensure the WITHOUT_ARM_EABI knob is set. + + NOTE: Support for the old ABI will be removed in the future and + users are advised to upgrade. + 20130709: pkg_install has been disconnected from the build if you really need it you should add WITH_PKGTOOLS in your src.conf(5). @@ -38,7 +48,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 20130709: Most of network statistics structures were changed to be able keep 64-bits counters. Thus all tools, that work with networking - statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.) + statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.) 20130629: Fix targets that run multiple make's to use && rather than ; Modified: user/attilio/vmcontention/etc/rc.d/pfsync ============================================================================== --- user/attilio/vmcontention/etc/rc.d/pfsync Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/etc/rc.d/pfsync Wed Jul 17 17:28:16 2013 (r253430) @@ -42,7 +42,7 @@ pfsync_start() pfsync_stop() { echo "Disabling pfsync." - ifconfig pfsync0 -syncdev down + ifconfig pfsync0 -syncdev -syncpeer down } load_rc_config $name Modified: user/attilio/vmcontention/lib/libc/gen/sysctl.3 ============================================================================== --- user/attilio/vmcontention/lib/libc/gen/sysctl.3 Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/libc/gen/sysctl.3 Wed Jul 17 17:28:16 2013 (r253430) @@ -548,13 +548,13 @@ The third level name is a protocol numbe The fourth level name is an address family, which may be set to 0 to select all address families. The fifth, sixth, and seventh level names are as follows: -.Bl -column "Fifth level " "Sixth level " -offset indent -.It Sy "Fifth level Sixth level Seventh level" -.It "NET_RT_FLAGS rtflags None" -.It "NET_RT_DUMP None None or fib number" -.It "NET_RT_IFLIST 0 or if_index None" -.It "NET_RT_IFMALIST 0 or if_index None" -.It "NET_RT_IFLISTL 0 or if_index None" +.Bl -column -offset indent "Fifth level Sixth level" "Seventh level" +.It Sy "Fifth level Sixth level" Ta Sy "Seventh level" +.It "NET_RT_FLAGS rtflags" Ta "None" +.It "NET_RT_DUMP None" Ta "None or fib number" +.It "NET_RT_IFLIST 0 or if_index" Ta None +.It "NET_RT_IFMALIST 0 or if_index" Ta None +.It "NET_RT_IFLISTL 0 or if_index" Ta None .El .Pp The Modified: user/attilio/vmcontention/lib/libc/stdlib/getenv.c ============================================================================== --- user/attilio/vmcontention/lib/libc/stdlib/getenv.c Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/libc/stdlib/getenv.c Wed Jul 17 17:28:16 2013 (r253430) @@ -505,9 +505,8 @@ __setenv(const char *name, size_t nameLe envVars[envNdx].valueSize = valueLen; /* Save name of name/value pair. */ - env = stpcpy(envVars[envNdx].name, name); - if ((envVars[envNdx].name)[nameLen] != '=') - env = stpcpy(env, "="); + env = stpncpy(envVars[envNdx].name, name, nameLen); + *env++ = '='; } else env = envVars[envNdx].value; Modified: user/attilio/vmcontention/lib/libusb/Makefile ============================================================================== --- user/attilio/vmcontention/lib/libusb/Makefile Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/libusb/Makefile Wed Jul 17 17:28:16 2013 (r253430) @@ -15,11 +15,12 @@ INCS+= libusb20_desc.h MAN= libusb.3 libusb20.3 MKLINT= no NOGCCERROR= +PTHREAD_LIBS?= -lpthread WARNS?= 2 DPADD= ${LIBPTHREAD} -LDADD= -lpthread +LDADD= ${PTHREAD_LIBS} MLINKS+= libusb.3 usb.3 @@ -42,7 +43,17 @@ CFLAGS+= -DCOMPAT_32BIT # # Examples: # make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h -# make COMPAT_32BIT=YES LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h +# make COMPAT_32BIT=YES \ +# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# DEBUG_FLAGS="-g" +# +# From Ubuntu 10.04: +# freebsd-make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# PTHREAD_LIBS="-lpthread -lrt" +# freebsd-make COMPAT32_BIT=YES \ +# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# PTHREAD_LIBS="-lpthread -lrt" +# # .if defined(LIBUSB_GLOBAL_INCLUDE_FILE) CFLAGS+= -DLIBUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\" Modified: user/attilio/vmcontention/lib/libusb/libusb20.c ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb20.c Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/libusb/libusb20.c Wed Jul 17 17:28:16 2013 (r253430) @@ -1202,27 +1202,13 @@ libusb20_be_alloc(const struct libusb20_ struct libusb20_backend * libusb20_be_alloc_linux(void) { - struct libusb20_backend *pbe; - -#ifdef __linux__ - pbe = libusb20_be_alloc(&libusb20_linux_backend); -#else - pbe = NULL; -#endif - return (pbe); + return (NULL); } struct libusb20_backend * libusb20_be_alloc_ugen20(void) { - struct libusb20_backend *pbe; - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - pbe = libusb20_be_alloc(&libusb20_ugen20_backend); -#else - pbe = NULL; -#endif - return (pbe); + return (libusb20_be_alloc(&libusb20_ugen20_backend)); } struct libusb20_backend * @@ -1230,10 +1216,12 @@ libusb20_be_alloc_default(void) { struct libusb20_backend *pbe; +#ifdef __linux__ pbe = libusb20_be_alloc_linux(); if (pbe) { return (pbe); } +#endif pbe = libusb20_be_alloc_ugen20(); if (pbe) { return (pbe); Modified: user/attilio/vmcontention/lib/libusb/libusb20_ugen20.c ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb20_ugen20.c Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:28:16 2013 (r253430) @@ -46,6 +46,10 @@ #include "libusb20_desc.h" #include "libusb20_int.h" +#ifndef IOUSB +#define IOUSB(a) a +#endif + static libusb20_init_backend_t ugen20_init_backend; static libusb20_open_device_t ugen20_open_device; static libusb20_close_device_t ugen20_close_device; @@ -145,14 +149,14 @@ ugen20_enumerate(struct libusb20_device if (f < 0) { return (LIBUSB20_ERROR_OTHER); } - if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_OTHER; goto done; } /* store when the device was plugged */ pdev->session_data.plugtime = plugtime; - if (ioctl(f, USB_GET_DEVICE_DESC, &ddesc)) { + if (ioctl(f, IOUSB(USB_GET_DEVICE_DESC), &ddesc)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -167,7 +171,7 @@ ugen20_enumerate(struct libusb20_device error = LIBUSB20_ERROR_OTHER; goto done; } - if (ioctl(f, USB_GET_DEVICEINFO, &devinfo)) { + if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -241,7 +245,7 @@ repeat: st->urd.urd_maxlen = sizeof(st->buf); st->nparsed = 0; - if (ioctl(st->f, USB_READ_DIR, &st->urd)) { + if (ioctl(st->f, IOUSB(USB_READ_DIR), &st->urd)) { return (EINVAL); } st->ptr = st->buf; @@ -313,7 +317,7 @@ ugen20_tr_release(struct libusb20_device /* release all pending USB transfers */ if (pdev->privBeData != NULL) { memset(&fs_uninit, 0, sizeof(fs_uninit)); - if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) { + if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) { /* ignore any errors of this kind */ } } @@ -353,7 +357,7 @@ ugen20_tr_renew(struct libusb20_device * fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData); fs_init.ep_index_max = nMaxTransfer; - if (ioctl(pdev->file, USB_FS_INIT, &fs_init)) { + if (ioctl(pdev->file, IOUSB(USB_FS_INIT), &fs_init)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -387,7 +391,7 @@ ugen20_open_device(struct libusb20_devic close(g); return (LIBUSB20_ERROR_NO_DEVICE); } - if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -430,7 +434,7 @@ ugen20_close_device(struct libusb20_devi if (pdev->privBeData) { memset(&fs_uninit, 0, sizeof(fs_uninit)); - if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) { + if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) { /* ignore this error */ } free(pdev->privBeData); @@ -468,7 +472,7 @@ ugen20_get_config_desc_full(struct libus gen_desc.ugd_maxlen = sizeof(cdesc); gen_desc.ugd_config_index = cfg_index; - error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); + error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); if (error) { return (LIBUSB20_ERROR_OTHER); } @@ -488,7 +492,7 @@ ugen20_get_config_desc_full(struct libus gen_desc.ugd_data = libusb20_pass_ptr(ptr); gen_desc.ugd_maxlen = len; - error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); + error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); if (error) { free(ptr); return (LIBUSB20_ERROR_OTHER); @@ -507,7 +511,7 @@ ugen20_get_config_index(struct libusb20_ { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_CONFIG, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_CONFIG), &temp)) { return (LIBUSB20_ERROR_OTHER); } *pindex = temp; @@ -523,7 +527,7 @@ ugen20_set_config_index(struct libusb20_ /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_SET_CONFIG, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_CONFIG), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -543,7 +547,7 @@ ugen20_set_alt_index(struct libusb20_dev /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_SET_ALTINTERFACE, &alt_iface)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_ALTINTERFACE), &alt_iface)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -557,7 +561,7 @@ ugen20_reset_device(struct libusb20_devi /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_DEVICEENUMERATE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_DEVICEENUMERATE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -569,7 +573,7 @@ ugen20_check_connected(struct libusb20_d uint32_t plugtime; int error = 0; - if (ioctl(pdev->file_ctrl, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_NO_DEVICE; goto done; } @@ -606,7 +610,7 @@ ugen20_set_power_mode(struct libusb20_de default: return (LIBUSB20_ERROR_INVALID_PARAM); } - if (ioctl(pdev->file_ctrl, USB_SET_POWER_MODE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_POWER_MODE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); @@ -617,7 +621,7 @@ ugen20_get_power_mode(struct libusb20_de { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_POWER_MODE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_MODE), &temp)) { return (LIBUSB20_ERROR_OTHER); } switch (temp) { @@ -649,7 +653,7 @@ ugen20_get_port_path(struct libusb20_dev { struct usb_device_port_path udpp; - if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp)) + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_DEV_PORT_PATH), &udpp)) return (LIBUSB20_ERROR_OTHER); if (udpp.udp_port_level > bufsize) @@ -665,7 +669,7 @@ ugen20_get_power_usage(struct libusb20_d { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_POWER_USAGE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_USAGE), &temp)) { return (LIBUSB20_ERROR_OTHER); } *power_usage = temp; @@ -678,7 +682,7 @@ ugen20_kernel_driver_active(struct libus { int temp = iface_index; - if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_ACTIVE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_ACTIVE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); /* kernel driver is active */ @@ -690,7 +694,7 @@ ugen20_detach_kernel_driver(struct libus { int temp = iface_index; - if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_DETACH, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_DETACH), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); /* kernel driver is active */ @@ -713,7 +717,7 @@ ugen20_do_request_sync(struct libusb20_d sizeof(req.ucr_request), setup)) { /* ignore */ } - if (ioctl(pdev->file_ctrl, USB_DO_REQUEST, &req)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_DO_REQUEST), &req)) { return (LIBUSB20_ERROR_OTHER); } if (pactlen) { @@ -732,7 +736,7 @@ ugen20_process(struct libusb20_device *p while (1) { - if (ioctl(pdev->file, USB_FS_COMPLETE, &temp)) { + if (ioctl(pdev->file, IOUSB(USB_FS_COMPLETE), &temp)) { if (errno == EBUSY) { break; } else { @@ -800,10 +804,10 @@ ugen20_tr_open(struct libusb20_transfer if (stream_id != 0) { temp.fs_open_stream.stream_id = stream_id; - if (ioctl(xfer->pdev->file, USB_FS_OPEN_STREAM, &temp.fs_open_stream)) + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN_STREAM), &temp.fs_open_stream)) return (LIBUSB20_ERROR_INVALID_PARAM); } else { - if (ioctl(xfer->pdev->file, USB_FS_OPEN, &temp.fs_open)) + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN), &temp.fs_open)) return (LIBUSB20_ERROR_INVALID_PARAM); } /* maximums might have changed - update */ @@ -829,7 +833,7 @@ ugen20_tr_close(struct libusb20_transfer temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_CLOSE, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLOSE), &temp)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); /* success */ @@ -846,7 +850,7 @@ ugen20_tr_clear_stall_sync(struct libusb temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_CLEAR_STALL_SYNC, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLEAR_STALL_SYNC), &temp)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); /* success */ @@ -885,7 +889,7 @@ ugen20_tr_submit(struct libusb20_transfe temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_START, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_START), &temp)) { /* ignore any errors - should never happen */ } return; /* success */ @@ -900,7 +904,7 @@ ugen20_tr_cancel_async(struct libusb20_t temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_STOP, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_STOP), &temp)) { /* ignore any errors - should never happen */ } return; @@ -939,7 +943,7 @@ ugen20_dev_get_iface_desc(struct libusb2 ugd.ugd_maxlen = len; ugd.ugd_iface_index = iface_index; - if (ioctl(pdev->file, USB_GET_IFACE_DRIVER, &ugd)) { + if (ioctl(pdev->file, IOUSB(USB_GET_IFACE_DRIVER), &ugd)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); @@ -949,7 +953,7 @@ static int ugen20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo) { - if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) { + if (ioctl(pdev->file, IOUSB(USB_GET_DEVICEINFO), pinfo)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); @@ -966,7 +970,7 @@ ugen20_root_get_dev_quirk(struct libusb2 q.index = quirk_index; - error = ugen20_be_ioctl(USB_DEV_QUIRK_GET, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_GET), &q); if (error) { if (errno == EINVAL) { @@ -993,7 +997,7 @@ ugen20_root_get_quirk_name(struct libusb q.index = quirk_index; - error = ugen20_be_ioctl(USB_QUIRK_NAME_GET, &q); + error = ugen20_be_ioctl(IOUSB(USB_QUIRK_NAME_GET), &q); if (error) { if (errno == EINVAL) { @@ -1020,7 +1024,7 @@ ugen20_root_add_dev_quirk(struct libusb2 q.bcdDeviceHigh = pq->bcdDeviceHigh; strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname)); - error = ugen20_be_ioctl(USB_DEV_QUIRK_ADD, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_ADD), &q); if (error) { if (errno == ENOMEM) { return (LIBUSB20_ERROR_NO_MEM); @@ -1044,7 +1048,7 @@ ugen20_root_remove_dev_quirk(struct libu q.bcdDeviceHigh = pq->bcdDeviceHigh; strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname)); - error = ugen20_be_ioctl(USB_DEV_QUIRK_REMOVE, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_REMOVE), &q); if (error) { if (errno == EINVAL) { return (LIBUSB20_ERROR_NOT_FOUND); @@ -1056,11 +1060,11 @@ ugen20_root_remove_dev_quirk(struct libu static int ugen20_root_set_template(struct libusb20_backend *pbe, int temp) { - return (ugen20_be_ioctl(USB_SET_TEMPLATE, &temp)); + return (ugen20_be_ioctl(IOUSB(USB_SET_TEMPLATE), &temp)); } static int ugen20_root_get_template(struct libusb20_backend *pbe, int *ptemp) { - return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp)); + return (ugen20_be_ioctl(IOUSB(USB_GET_TEMPLATE), ptemp)); } Modified: user/attilio/vmcontention/lib/libusb/libusb_global_linux.h ============================================================================== --- user/attilio/vmcontention/lib/libusb/libusb_global_linux.h Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/libusb/libusb_global_linux.h Wed Jul 17 17:28:16 2013 (r253430) @@ -29,7 +29,9 @@ #define _XOPEN_SOURCE #define _BSD_SOURCE +#ifdef __linux__ #define _POSIX_SOURCE +#endif #define _POSIX_C_SOURCE 200809 #include @@ -39,10 +41,13 @@ #include #include #include +#ifdef __linux__ #include +#endif #include #include #include +#include #include #include #include @@ -51,6 +56,10 @@ #include #include +#include + +#define IOUSB(a) FBSD_L##a + #ifndef __aligned #define __aligned(x) __attribute__((__aligned__(x))) #endif Modified: user/attilio/vmcontention/lib/msun/src/math.h ============================================================================== --- user/attilio/vmcontention/lib/msun/src/math.h Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/lib/msun/src/math.h Wed Jul 17 17:28:16 2013 (r253430) @@ -83,22 +83,22 @@ extern const union __nan_un { #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ __has_extension(c_generic_selections) -#define __fp_type_select(x, f, d, ld) _Generic((x), \ - float: f(x), \ - double: d(x), \ - long double: ld(x)) +#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ + float: f(x), \ + double: d(x), \ + long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) -#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), double), d(x), \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) +#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), double), d(x), \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) #else -#define __fp_type_select(x, f, d, ld) \ - ((sizeof(x) == sizeof(float)) ? f(x) \ - : (sizeof(x) == sizeof(double)) ? d(x) \ - : ld(x)) +#define __fp_type_select(x, f, d, ld) \ + ((sizeof(x) == sizeof(float)) ? f(x) \ + : (sizeof(x) == sizeof(double)) ? d(x) \ + : ld(x)) #endif #define fpclassify(x) \ @@ -189,21 +189,21 @@ int __signbitf(float) __pure2; int __signbitl(long double) __pure2; static __inline int -__inline_isnan(double __x) +__inline_isnan(__const double __x) { return (__x != __x); } static __inline int -__inline_isnanf(float __x) +__inline_isnanf(__const float __x) { return (__x != __x); } static __inline int -__inline_isnanl(long double __x) +__inline_isnanl(__const long double __x) { return (__x != __x); Modified: user/attilio/vmcontention/sbin/mount/mount.8 ============================================================================== --- user/attilio/vmcontention/sbin/mount/mount.8 Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/sbin/mount/mount.8 Wed Jul 17 17:28:16 2013 (r253430) @@ -118,6 +118,9 @@ When used in conjunction with the .Fl a option, also mount those file systems which are marked as .Dq Li late . +.It Fl n +For compatibility with some other implementations, this flag is +currently a no-op. .It Fl o Options are specified with a .Fl o Modified: user/attilio/vmcontention/sbin/mount/mount.c ============================================================================== --- user/attilio/vmcontention/sbin/mount/mount.c Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/sbin/mount/mount.c Wed Jul 17 17:28:16 2013 (r253430) @@ -253,7 +253,7 @@ main(int argc, char *argv[]) options = NULL; vfslist = NULL; vfstype = "ufs"; - while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1) + while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1) switch (ch) { case 'a': all = 1; @@ -274,6 +274,9 @@ main(int argc, char *argv[]) case 'l': late = 1; break; + case 'n': + /* For compatibility with the Linux version of mount. */ + break; case 'o': if (*optarg) { options = catopt(options, optarg); Modified: user/attilio/vmcontention/sbin/nvmecontrol/firmware.c ============================================================================== --- user/attilio/vmcontention/sbin/nvmecontrol/firmware.c Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/sbin/nvmecontrol/firmware.c Wed Jul 17 17:28:16 2013 (r253430) @@ -246,7 +246,7 @@ firmware(int argc, char *argv[]) "slot %d specified but controller only supports %d slots", slot, cdata.frmw.num_slots); - if (!slot_has_valid_firmware(fd, slot)) + if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot)) errx(1, "slot %d does not contain valid firmware,\n" "try 'nvmecontrol logpage -p 3 %s' to get a list " Modified: user/attilio/vmcontention/sbin/route/Makefile ============================================================================== --- user/attilio/vmcontention/sbin/route/Makefile Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/sbin/route/Makefile Wed Jul 17 17:28:16 2013 (r253430) @@ -7,24 +7,21 @@ PROG= route MAN= route.8 SRCS= route.c keywords.h WARNS?= 3 -CLEANFILES+=keywords.h _keywords.tmp +CLEANFILES+=keywords.h CFLAGS+= -DNS - +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif - CFLAGS+= -I. keywords.h: keywords - sed -e '/^#/d' -e '/^$$/d' ${.CURDIR}/keywords > _keywords.tmp - LC_ALL=C tr 'a-z' 'A-Z' < _keywords.tmp | paste _keywords.tmp - | \ - awk '{ \ - if (NF > 1) \ - printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ - $$2, NR, $$1, $$2 }' \ - > ${.TARGET} - rm -f _keywords.tmp + LC_ALL=C awk '!/^#|^$$/ { \ + printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ + toupper($$1), ++L, $$1, toupper($$1); \ + }' < ${.CURDIR}/keywords > ${.TARGET} || (rm -f ${.TARGET}; false) .include Modified: user/attilio/vmcontention/sbin/route/route.c ============================================================================== --- user/attilio/vmcontention/sbin/route/route.c Wed Jul 17 14:15:00 2013 (r253429) +++ user/attilio/vmcontention/sbin/route/route.c Wed Jul 17 17:28:16 2013 (r253430) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct keytab { +static struct keytab { const char *kt_cp; int kt_i; } keywords[] = { @@ -78,42 +78,33 @@ struct keytab { {0, 0} }; -union sockunion { - struct sockaddr sa; - struct sockaddr_in sin; -#ifdef INET6 - struct sockaddr_in6 sin6; -#endif - struct sockaddr_at sat; - struct sockaddr_dl sdl; - struct sockaddr_storage ss; /* added to avoid memory overrun */ -} so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; - -typedef union sockunion *sup; -int pid, rtm_addrs; -int s; -int forcehost, forcenet, doflush, nflag, af, qflag, tflag; -int verbose, aflen = sizeof (struct sockaddr_in); -int locking, lockrest, debugonly; -struct rt_metrics rt_metrics; -u_long rtm_inits; -uid_t uid; +static struct sockaddr_storage so[RTAX_MAX]; +static int pid, rtm_addrs; +static int s; +static int forcehost, forcenet, nflag, af, qflag, tflag; +static int verbose, aflen; +static int locking, lockrest, debugonly; +static struct rt_metrics rt_metrics; +static u_long rtm_inits; +static uid_t uid; static int defaultfib; static int numfibs; static int atalk_aton(const char *, struct at_addr *); static char *atalk_ntoa(struct at_addr); -static void bprintf(FILE *, int, u_char *); +static void printb(int, const char *); static void flushroutes(int argc, char *argv[]); static int flushroutes_fib(int); static int getaddr(int, char *, struct hostent **, int); static int keyword(const char *); -static void inet_makenetandmask(u_long, struct sockaddr_in *, u_long); +#ifdef INET +static void inet_makenetandmask(u_long, struct sockaddr_in *, + struct sockaddr_in *, u_long); +#endif #ifdef INET6 -static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); +static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); #endif static void interfaces(void); -static void mask_addr(void); static void monitor(int, char*[]); static const char *netname(struct sockaddr *); static void newroute(int, char **); @@ -127,9 +118,8 @@ static const char *routename(struct sock static int rtmsg(int, int, int); static void set_metric(char *, int); static int set_sofib(int); -static int set_procfib(int); -static void sockaddr(char *, struct sockaddr *); -static void sodump(sup, const char *); +static void sockaddr(char *, struct sockaddr *, size_t); +static void sodump(struct sockaddr *, const char *); extern char *iso_ntoa(void); struct fibl { @@ -139,7 +129,7 @@ struct fibl { int fl_error; int fl_errno; }; -TAILQ_HEAD(fibl_head_t, fibl) fibl_head; +static TAILQ_HEAD(fibl_head_t, fibl) fibl_head; static int fiboptlist_csv(const char *, struct fibl_head_t *); static int fiboptlist_range(const char *, struct fibl_head_t *); @@ -151,9 +141,7 @@ usage(const char *cp) { if (cp != NULL) warnx("bad keyword: %s", cp); - (void) fprintf(stderr, - "usage: route [-dnqtv] command [[modifiers] args]\n"); - exit(EX_USAGE); + errx(EX_USAGE, "usage: route [-dnqtv] command [[modifiers] args]"); /* NOTREACHED */ } @@ -247,15 +235,6 @@ set_sofib(int fib) } static int -set_procfib(int fib) -{ - - if (fib < 0) - return (0); - return (setfib(fib)); -} - -static int fiboptlist_range(const char *arg, struct fibl_head_t *flh) { struct fibl *fl; @@ -313,6 +292,7 @@ fiboptlist_csv(const char *arg, struct f char *str0, *str, *token, *endptr; int fib, error; + str0 = str = NULL; if (strcmp("all", arg) == 0) { str = calloc(1, ALLSTRLEN); if (str == NULL) { @@ -362,7 +342,8 @@ fiboptlist_csv(const char *arg, struct f } } fiboptlist_csv_ret: - free(str0); + if (str0 != NULL) + free(str0); return (error); } @@ -376,9 +357,8 @@ flushroutes(int argc, char *argv[]) struct fibl *fl; int error; - if (uid != 0 && !debugonly && !tflag) { + if (uid != 0 && !debugonly && !tflag) errx(EX_NOPERM, "must be root to alter routing table"); - } shutdown(s, SHUT_RD); /* Don't want to read back our messages */ TAILQ_INIT(&fibl_head); @@ -388,9 +368,11 @@ flushroutes(int argc, char *argv[]) if (**argv != '-') usage(*argv); switch (keyword(*argv + 1)) { +#ifdef INET case K_INET: af = AF_INET; break; +#endif #ifdef INET6 case K_INET6: af = AF_INET6; @@ -428,11 +410,10 @@ flushroutes_fib(int fib) struct rt_msghdr *rtm; size_t needed; char *buf, *next, *lim; - int mib[6], rlen, seqno, count = 0; + int mib[7], rlen, seqno, count = 0; int error; error = set_sofib(fib); - error += set_procfib(fib); if (error) { warn("fib number %d is ignored", fib); return (error); @@ -442,14 +423,15 @@ retry: mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; /* protocol */ - mib[3] = 0; /* wildcard address family */ + mib[3] = AF_UNSPEC; mib[4] = NET_RT_DUMP; mib[5] = 0; /* no flags */ - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + mib[6] = fib; + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(EX_OSERR, "malloc failed"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) { if (errno == ENOMEM && count++ < 10) { warnx("Routing table grew, retrying"); sleep(1); @@ -460,7 +442,7 @@ retry: } lim = buf + needed; if (verbose) - (void) printf("Examining routing table from sysctl\n"); + (void)printf("Examining routing table from sysctl\n"); seqno = 0; /* ??? */ for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; @@ -483,7 +465,7 @@ retry: err(1, "write to routing socket"); if (rlen < (int)rtm->rtm_msglen) { warn("write to routing socket"); - (void) printf("got only %d for rlen\n", rlen); + (void)printf("got only %d for rlen\n", rlen); free(buf); goto retry; break; @@ -513,7 +495,9 @@ routename(struct sockaddr *sa) { const char *cp; static char line[MAXHOSTNAMELEN + 1]; +#ifdef INET struct hostent *hp; +#endif static char domain[MAXHOSTNAMELEN + 1]; static int first = 1, n; @@ -522,19 +506,22 @@ routename(struct sockaddr *sa) if (gethostname(domain, MAXHOSTNAMELEN) == 0 && (cp = strchr(domain, '.'))) { domain[MAXHOSTNAMELEN] = '\0'; - (void) strcpy(domain, cp + 1); + (void)strcpy(domain, cp + 1); } else - domain[0] = 0; + domain[0] = '\0'; } - if (sa->sa_len == 0) + if (sa->sa_len == 0) { strcpy(line, "default"); - else switch (sa->sa_family) { - + return (line); + } + switch (sa->sa_family) { +#ifdef INET case AF_INET: - { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + { + struct in_addr in; + in = ((struct sockaddr_in *)sa)->sin_addr; cp = NULL; if (in.s_addr == INADDR_ANY || sa->sa_len < 4) cp = "default"; @@ -554,10 +541,11 @@ routename(struct sockaddr *sa) strncpy(line, cp, sizeof(line) - 1); line[sizeof(line) - 1] = '\0'; } else - (void) sprintf(line, "%s", inet_ntoa(in)); + (void)sprintf(line, "%s", inet_ntoa(in)); break; - } + } +#endif #ifdef INET6 case AF_INET6: { @@ -574,17 +562,18 @@ routename(struct sockaddr *sa) line, sizeof(line), NULL, 0, niflags) != 0) strncpy(line, "invalid", sizeof(line)); - return(line); + return (line); } #endif case AF_APPLETALK: - (void) snprintf(line, sizeof(line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); + (void)snprintf(line, sizeof(line), "atalk %s", + atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); break; case AF_LINK: return (link_ntoa((struct sockaddr_dl *)sa)); + break; default: { @@ -611,18 +600,21 @@ routename(struct sockaddr *sa) const char * netname(struct sockaddr *sa) { - const char *cp = NULL; static char line[MAXHOSTNAMELEN + 1]; + int n; +#ifdef INET struct netent *np = NULL; + const char *cp = NULL; u_long i; - int n; +#endif switch (sa->sa_family) { - +#ifdef INET case AF_INET: - { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + { + struct in_addr in; + in = ((struct sockaddr_in *)sa)->sin_addr; i = in.s_addr = ntohl(in.s_addr); if (in.s_addr == 0) cp = "default"; @@ -635,30 +627,30 @@ netname(struct sockaddr *sa) if (cp != NULL) strncpy(line, cp, sizeof(line)); else if ((in.s_addr & 0xffffff) == 0) - (void) sprintf(line, "%u", C(in.s_addr >> 24)); + (void)sprintf(line, "%u", C(in.s_addr >> 24)); else if ((in.s_addr & 0xffff) == 0) - (void) sprintf(line, "%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u", C(in.s_addr >> 24), C(in.s_addr >> 16)); else if ((in.s_addr & 0xff) == 0) - (void) sprintf(line, "%u.%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u.%u", C(in.s_addr >> 24), C(in.s_addr >> 16), C(in.s_addr >> 8)); else - (void) sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 17:35:50 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60017BF4; Wed, 17 Jul 2013 17:35:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4E92EF66; Wed, 17 Jul 2013 17:35:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6HHZohp069179; Wed, 17 Jul 2013 17:35:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6HHZlcU069163; Wed, 17 Jul 2013 17:35:47 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307171735.r6HHZlcU069163@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Jul 2013 17:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253431 - in user/attilio/vmobj-readlock: . etc/rc.d lib/libc/gen lib/libc/stdlib lib/libusb lib/msun/src sbin/mount sbin/nvmecontrol sbin/route share/examples/kld/syscall/test share/ma... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 17:35:50 -0000 Author: attilio Date: Wed Jul 17 17:35:46 2013 New Revision: 253431 URL: http://svnweb.freebsd.org/changeset/base/253431 Log: MFC Added: user/attilio/vmobj-readlock/share/monetdef/ca_ES.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/ca_ES.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/de_AT.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/de_AT.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/de_DE.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/de_DE.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/el_GR.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/el_GR.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/es_ES.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/es_ES.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/fi_FI.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/fi_FI.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/fr_BE.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/fr_BE.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/fr_FR.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/fr_FR.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/it_IT.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/it_IT.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/nl_BE.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/nl_BE.UTF-8.src user/attilio/vmobj-readlock/share/monetdef/nl_NL.UTF-8.src - copied unchanged from r253430, user/attilio/vmcontention/share/monetdef/nl_NL.UTF-8.src user/attilio/vmobj-readlock/sys/arm/broadcom/bcm2835/std.bcm2835 - copied unchanged from r253430, user/attilio/vmcontention/sys/arm/broadcom/bcm2835/std.bcm2835 user/attilio/vmobj-readlock/sys/arm/broadcom/bcm2835/std.rpi - copied unchanged from r253430, user/attilio/vmcontention/sys/arm/broadcom/bcm2835/std.rpi user/attilio/vmobj-readlock/tools/build/options/WITHOUT_ARM_EABI - copied unchanged from r253430, user/attilio/vmcontention/tools/build/options/WITHOUT_ARM_EABI Deleted: user/attilio/vmobj-readlock/tools/build/options/WITH_ARM_EABI user/attilio/vmobj-readlock/usr.bin/systat/mbufs.c Modified: user/attilio/vmobj-readlock/UPDATING user/attilio/vmobj-readlock/etc/rc.d/pfsync user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3 user/attilio/vmobj-readlock/lib/libc/stdlib/getenv.c user/attilio/vmobj-readlock/lib/libusb/Makefile user/attilio/vmobj-readlock/lib/libusb/libusb20.c user/attilio/vmobj-readlock/lib/libusb/libusb20_ugen20.c user/attilio/vmobj-readlock/lib/libusb/libusb_global_linux.h user/attilio/vmobj-readlock/lib/msun/src/math.h user/attilio/vmobj-readlock/sbin/mount/mount.8 user/attilio/vmobj-readlock/sbin/mount/mount.c user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c user/attilio/vmobj-readlock/sbin/route/Makefile user/attilio/vmobj-readlock/sbin/route/route.c user/attilio/vmobj-readlock/share/examples/kld/syscall/test/call.c user/attilio/vmobj-readlock/share/man/man4/mfi.4 user/attilio/vmobj-readlock/share/man/man5/fstab.5 user/attilio/vmobj-readlock/share/man/man5/src.conf.5 user/attilio/vmobj-readlock/share/mk/bsd.own.mk user/attilio/vmobj-readlock/share/monetdef/Makefile user/attilio/vmobj-readlock/sys/amd64/amd64/machdep.c user/attilio/vmobj-readlock/sys/arm/arm/vfp.c user/attilio/vmobj-readlock/sys/arm/arm/vm_machdep.c user/attilio/vmobj-readlock/sys/arm/conf/RPI-B user/attilio/vmobj-readlock/sys/cam/cam_periph.c user/attilio/vmobj-readlock/sys/cam/cam_xpt.c user/attilio/vmobj-readlock/sys/cam/scsi/scsi_all.c user/attilio/vmobj-readlock/sys/cam/scsi/scsi_all.h user/attilio/vmobj-readlock/sys/cam/scsi/scsi_ch.c user/attilio/vmobj-readlock/sys/cam/scsi/scsi_xpt.c user/attilio/vmobj-readlock/sys/compat/linux/linux_ioctl.c user/attilio/vmobj-readlock/sys/compat/linux/linux_ioctl.h user/attilio/vmobj-readlock/sys/conf/Makefile.arm user/attilio/vmobj-readlock/sys/conf/files user/attilio/vmobj-readlock/sys/dev/acpica/acpi_resource.c user/attilio/vmobj-readlock/sys/dev/ae/if_ae.c user/attilio/vmobj-readlock/sys/dev/ae/if_aereg.h user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c user/attilio/vmobj-readlock/sys/dev/bge/if_bgereg.h user/attilio/vmobj-readlock/sys/dev/cxgbe/firmware/t5fw_cfg.txt user/attilio/vmobj-readlock/sys/dev/isp/isp.c user/attilio/vmobj-readlock/sys/dev/isp/ispreg.h user/attilio/vmobj-readlock/sys/dev/usb/controller/xhci_pci.c user/attilio/vmobj-readlock/sys/dev/usb/input/ukbd.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_rum.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_uath.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_upgt.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_ural.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_urtw.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_urtwn.c user/attilio/vmobj-readlock/sys/dev/usb/wlan/if_zyd.c user/attilio/vmobj-readlock/sys/fs/fuse/fuse_kernel.h user/attilio/vmobj-readlock/sys/i386/i386/support.s user/attilio/vmobj-readlock/sys/i386/i386/symbols.raw user/attilio/vmobj-readlock/sys/i386/i386/uio_machdep.c user/attilio/vmobj-readlock/sys/i386/i386/vm_machdep.c user/attilio/vmobj-readlock/sys/kern/kern_mbuf.c user/attilio/vmobj-readlock/sys/kern/kern_time.c user/attilio/vmobj-readlock/sys/kern/subr_bus.c user/attilio/vmobj-readlock/sys/kern/uipc_mbuf.c user/attilio/vmobj-readlock/sys/kern/uipc_syscalls.c user/attilio/vmobj-readlock/sys/kern/vfs_bio.c user/attilio/vmobj-readlock/sys/kern/vfs_subr.c user/attilio/vmobj-readlock/sys/mips/mips/uio_machdep.c user/attilio/vmobj-readlock/sys/mips/mips/vm_machdep.c user/attilio/vmobj-readlock/sys/modules/Makefile user/attilio/vmobj-readlock/sys/modules/usb/Makefile user/attilio/vmobj-readlock/sys/net/ieee8023ad_lacp.c user/attilio/vmobj-readlock/sys/net/if.c user/attilio/vmobj-readlock/sys/net/if_lagg.c user/attilio/vmobj-readlock/sys/net/if_lagg.h user/attilio/vmobj-readlock/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c user/attilio/vmobj-readlock/sys/netgraph/bluetooth/socket/ng_btsocket.c user/attilio/vmobj-readlock/sys/netgraph/ng_base.c user/attilio/vmobj-readlock/sys/netinet/tcp_syncache.c user/attilio/vmobj-readlock/sys/ofed/drivers/net/mlx4/main.c user/attilio/vmobj-readlock/sys/powerpc/aim/vm_machdep.c user/attilio/vmobj-readlock/sys/powerpc/booke/vm_machdep.c user/attilio/vmobj-readlock/sys/powerpc/powerpc/uio_machdep.c user/attilio/vmobj-readlock/sys/sparc64/sparc64/uio_machdep.c user/attilio/vmobj-readlock/sys/sparc64/sparc64/vm_machdep.c user/attilio/vmobj-readlock/sys/sys/mbuf.h user/attilio/vmobj-readlock/sys/sys/param.h user/attilio/vmobj-readlock/sys/sys/sf_buf.h user/attilio/vmobj-readlock/sys/ufs/ffs/ffs_alloc.c user/attilio/vmobj-readlock/tools/regression/aio/aiop/aiop.c user/attilio/vmobj-readlock/tools/regression/lib/libc/gen/test-fpclassify.c user/attilio/vmobj-readlock/tools/regression/lib/libc/gen/test-ftw.c user/attilio/vmobj-readlock/tools/regression/priv/Makefile user/attilio/vmobj-readlock/tools/regression/pthread/cv_cancel1/cv_cancel1.c user/attilio/vmobj-readlock/tools/regression/sbin/dhclient/Makefile user/attilio/vmobj-readlock/usr.bin/netstat/main.c user/attilio/vmobj-readlock/usr.bin/netstat/mbuf.c user/attilio/vmobj-readlock/usr.bin/systat/Makefile user/attilio/vmobj-readlock/usr.bin/systat/cmdtab.c user/attilio/vmobj-readlock/usr.bin/systat/extern.h user/attilio/vmobj-readlock/usr.bin/systat/systat.1 user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/cdrom.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/common.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/directory.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/dos.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/floppy.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/ftp.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/http.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/httpproxy.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/nfs.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/ufs.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/media/usb.subr user/attilio/vmobj-readlock/usr.sbin/bsdconfig/share/packages/packages.subr user/attilio/vmobj-readlock/usr.sbin/rtsold/rtsol.c user/attilio/vmobj-readlock/usr.sbin/ypserv/yp_access.c user/attilio/vmobj-readlock/usr.sbin/ypserv/yp_dnslookup.c Directory Properties: user/attilio/vmobj-readlock/ (props changed) user/attilio/vmobj-readlock/lib/libc/ (props changed) user/attilio/vmobj-readlock/sbin/ (props changed) user/attilio/vmobj-readlock/share/man/man4/ (props changed) user/attilio/vmobj-readlock/sys/ (props changed) user/attilio/vmobj-readlock/sys/conf/ (props changed) user/attilio/vmobj-readlock/usr.sbin/rtsold/ (props changed) Modified: user/attilio/vmobj-readlock/UPDATING ============================================================================== --- user/attilio/vmobj-readlock/UPDATING Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/UPDATING Wed Jul 17 17:35:46 2013 (r253431) @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130716: + The default ARM ABI has changed to the ARM EABI. The old ABI is + incompatible with the ARM EABI and all programs and modules will + need to be rebuilt to work with a new kernel. + + To keep using the old ABI ensure the WITHOUT_ARM_EABI knob is set. + + NOTE: Support for the old ABI will be removed in the future and + users are advised to upgrade. + 20130709: pkg_install has been disconnected from the build if you really need it you should add WITH_PKGTOOLS in your src.conf(5). @@ -38,7 +48,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 20130709: Most of network statistics structures were changed to be able keep 64-bits counters. Thus all tools, that work with networking - statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.) + statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.) 20130629: Fix targets that run multiple make's to use && rather than ; Modified: user/attilio/vmobj-readlock/etc/rc.d/pfsync ============================================================================== --- user/attilio/vmobj-readlock/etc/rc.d/pfsync Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/etc/rc.d/pfsync Wed Jul 17 17:35:46 2013 (r253431) @@ -42,7 +42,7 @@ pfsync_start() pfsync_stop() { echo "Disabling pfsync." - ifconfig pfsync0 -syncdev down + ifconfig pfsync0 -syncdev -syncpeer down } load_rc_config $name Modified: user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3 ============================================================================== --- user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3 Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/libc/gen/sysctl.3 Wed Jul 17 17:35:46 2013 (r253431) @@ -548,13 +548,13 @@ The third level name is a protocol numbe The fourth level name is an address family, which may be set to 0 to select all address families. The fifth, sixth, and seventh level names are as follows: -.Bl -column "Fifth level " "Sixth level " -offset indent -.It Sy "Fifth level Sixth level Seventh level" -.It "NET_RT_FLAGS rtflags None" -.It "NET_RT_DUMP None None or fib number" -.It "NET_RT_IFLIST 0 or if_index None" -.It "NET_RT_IFMALIST 0 or if_index None" -.It "NET_RT_IFLISTL 0 or if_index None" +.Bl -column -offset indent "Fifth level Sixth level" "Seventh level" +.It Sy "Fifth level Sixth level" Ta Sy "Seventh level" +.It "NET_RT_FLAGS rtflags" Ta "None" +.It "NET_RT_DUMP None" Ta "None or fib number" +.It "NET_RT_IFLIST 0 or if_index" Ta None +.It "NET_RT_IFMALIST 0 or if_index" Ta None +.It "NET_RT_IFLISTL 0 or if_index" Ta None .El .Pp The Modified: user/attilio/vmobj-readlock/lib/libc/stdlib/getenv.c ============================================================================== --- user/attilio/vmobj-readlock/lib/libc/stdlib/getenv.c Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/libc/stdlib/getenv.c Wed Jul 17 17:35:46 2013 (r253431) @@ -505,9 +505,8 @@ __setenv(const char *name, size_t nameLe envVars[envNdx].valueSize = valueLen; /* Save name of name/value pair. */ - env = stpcpy(envVars[envNdx].name, name); - if ((envVars[envNdx].name)[nameLen] != '=') - env = stpcpy(env, "="); + env = stpncpy(envVars[envNdx].name, name, nameLen); + *env++ = '='; } else env = envVars[envNdx].value; Modified: user/attilio/vmobj-readlock/lib/libusb/Makefile ============================================================================== --- user/attilio/vmobj-readlock/lib/libusb/Makefile Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/libusb/Makefile Wed Jul 17 17:35:46 2013 (r253431) @@ -15,11 +15,12 @@ INCS+= libusb20_desc.h MAN= libusb.3 libusb20.3 MKLINT= no NOGCCERROR= +PTHREAD_LIBS?= -lpthread WARNS?= 2 DPADD= ${LIBPTHREAD} -LDADD= -lpthread +LDADD= ${PTHREAD_LIBS} MLINKS+= libusb.3 usb.3 @@ -42,7 +43,17 @@ CFLAGS+= -DCOMPAT_32BIT # # Examples: # make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h -# make COMPAT_32BIT=YES LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h +# make COMPAT_32BIT=YES \ +# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# DEBUG_FLAGS="-g" +# +# From Ubuntu 10.04: +# freebsd-make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# PTHREAD_LIBS="-lpthread -lrt" +# freebsd-make COMPAT32_BIT=YES \ +# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# PTHREAD_LIBS="-lpthread -lrt" +# # .if defined(LIBUSB_GLOBAL_INCLUDE_FILE) CFLAGS+= -DLIBUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\" Modified: user/attilio/vmobj-readlock/lib/libusb/libusb20.c ============================================================================== --- user/attilio/vmobj-readlock/lib/libusb/libusb20.c Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/libusb/libusb20.c Wed Jul 17 17:35:46 2013 (r253431) @@ -1202,27 +1202,13 @@ libusb20_be_alloc(const struct libusb20_ struct libusb20_backend * libusb20_be_alloc_linux(void) { - struct libusb20_backend *pbe; - -#ifdef __linux__ - pbe = libusb20_be_alloc(&libusb20_linux_backend); -#else - pbe = NULL; -#endif - return (pbe); + return (NULL); } struct libusb20_backend * libusb20_be_alloc_ugen20(void) { - struct libusb20_backend *pbe; - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - pbe = libusb20_be_alloc(&libusb20_ugen20_backend); -#else - pbe = NULL; -#endif - return (pbe); + return (libusb20_be_alloc(&libusb20_ugen20_backend)); } struct libusb20_backend * @@ -1230,10 +1216,12 @@ libusb20_be_alloc_default(void) { struct libusb20_backend *pbe; +#ifdef __linux__ pbe = libusb20_be_alloc_linux(); if (pbe) { return (pbe); } +#endif pbe = libusb20_be_alloc_ugen20(); if (pbe) { return (pbe); Modified: user/attilio/vmobj-readlock/lib/libusb/libusb20_ugen20.c ============================================================================== --- user/attilio/vmobj-readlock/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:35:46 2013 (r253431) @@ -46,6 +46,10 @@ #include "libusb20_desc.h" #include "libusb20_int.h" +#ifndef IOUSB +#define IOUSB(a) a +#endif + static libusb20_init_backend_t ugen20_init_backend; static libusb20_open_device_t ugen20_open_device; static libusb20_close_device_t ugen20_close_device; @@ -145,14 +149,14 @@ ugen20_enumerate(struct libusb20_device if (f < 0) { return (LIBUSB20_ERROR_OTHER); } - if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_OTHER; goto done; } /* store when the device was plugged */ pdev->session_data.plugtime = plugtime; - if (ioctl(f, USB_GET_DEVICE_DESC, &ddesc)) { + if (ioctl(f, IOUSB(USB_GET_DEVICE_DESC), &ddesc)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -167,7 +171,7 @@ ugen20_enumerate(struct libusb20_device error = LIBUSB20_ERROR_OTHER; goto done; } - if (ioctl(f, USB_GET_DEVICEINFO, &devinfo)) { + if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -241,7 +245,7 @@ repeat: st->urd.urd_maxlen = sizeof(st->buf); st->nparsed = 0; - if (ioctl(st->f, USB_READ_DIR, &st->urd)) { + if (ioctl(st->f, IOUSB(USB_READ_DIR), &st->urd)) { return (EINVAL); } st->ptr = st->buf; @@ -313,7 +317,7 @@ ugen20_tr_release(struct libusb20_device /* release all pending USB transfers */ if (pdev->privBeData != NULL) { memset(&fs_uninit, 0, sizeof(fs_uninit)); - if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) { + if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) { /* ignore any errors of this kind */ } } @@ -353,7 +357,7 @@ ugen20_tr_renew(struct libusb20_device * fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData); fs_init.ep_index_max = nMaxTransfer; - if (ioctl(pdev->file, USB_FS_INIT, &fs_init)) { + if (ioctl(pdev->file, IOUSB(USB_FS_INIT), &fs_init)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -387,7 +391,7 @@ ugen20_open_device(struct libusb20_devic close(g); return (LIBUSB20_ERROR_NO_DEVICE); } - if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -430,7 +434,7 @@ ugen20_close_device(struct libusb20_devi if (pdev->privBeData) { memset(&fs_uninit, 0, sizeof(fs_uninit)); - if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) { + if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) { /* ignore this error */ } free(pdev->privBeData); @@ -468,7 +472,7 @@ ugen20_get_config_desc_full(struct libus gen_desc.ugd_maxlen = sizeof(cdesc); gen_desc.ugd_config_index = cfg_index; - error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); + error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); if (error) { return (LIBUSB20_ERROR_OTHER); } @@ -488,7 +492,7 @@ ugen20_get_config_desc_full(struct libus gen_desc.ugd_data = libusb20_pass_ptr(ptr); gen_desc.ugd_maxlen = len; - error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); + error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); if (error) { free(ptr); return (LIBUSB20_ERROR_OTHER); @@ -507,7 +511,7 @@ ugen20_get_config_index(struct libusb20_ { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_CONFIG, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_CONFIG), &temp)) { return (LIBUSB20_ERROR_OTHER); } *pindex = temp; @@ -523,7 +527,7 @@ ugen20_set_config_index(struct libusb20_ /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_SET_CONFIG, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_CONFIG), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -543,7 +547,7 @@ ugen20_set_alt_index(struct libusb20_dev /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_SET_ALTINTERFACE, &alt_iface)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_ALTINTERFACE), &alt_iface)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -557,7 +561,7 @@ ugen20_reset_device(struct libusb20_devi /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_DEVICEENUMERATE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_DEVICEENUMERATE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -569,7 +573,7 @@ ugen20_check_connected(struct libusb20_d uint32_t plugtime; int error = 0; - if (ioctl(pdev->file_ctrl, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_NO_DEVICE; goto done; } @@ -606,7 +610,7 @@ ugen20_set_power_mode(struct libusb20_de default: return (LIBUSB20_ERROR_INVALID_PARAM); } - if (ioctl(pdev->file_ctrl, USB_SET_POWER_MODE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_POWER_MODE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); @@ -617,7 +621,7 @@ ugen20_get_power_mode(struct libusb20_de { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_POWER_MODE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_MODE), &temp)) { return (LIBUSB20_ERROR_OTHER); } switch (temp) { @@ -649,7 +653,7 @@ ugen20_get_port_path(struct libusb20_dev { struct usb_device_port_path udpp; - if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp)) + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_DEV_PORT_PATH), &udpp)) return (LIBUSB20_ERROR_OTHER); if (udpp.udp_port_level > bufsize) @@ -665,7 +669,7 @@ ugen20_get_power_usage(struct libusb20_d { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_POWER_USAGE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_USAGE), &temp)) { return (LIBUSB20_ERROR_OTHER); } *power_usage = temp; @@ -678,7 +682,7 @@ ugen20_kernel_driver_active(struct libus { int temp = iface_index; - if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_ACTIVE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_ACTIVE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); /* kernel driver is active */ @@ -690,7 +694,7 @@ ugen20_detach_kernel_driver(struct libus { int temp = iface_index; - if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_DETACH, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_DETACH), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); /* kernel driver is active */ @@ -713,7 +717,7 @@ ugen20_do_request_sync(struct libusb20_d sizeof(req.ucr_request), setup)) { /* ignore */ } - if (ioctl(pdev->file_ctrl, USB_DO_REQUEST, &req)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_DO_REQUEST), &req)) { return (LIBUSB20_ERROR_OTHER); } if (pactlen) { @@ -732,7 +736,7 @@ ugen20_process(struct libusb20_device *p while (1) { - if (ioctl(pdev->file, USB_FS_COMPLETE, &temp)) { + if (ioctl(pdev->file, IOUSB(USB_FS_COMPLETE), &temp)) { if (errno == EBUSY) { break; } else { @@ -800,10 +804,10 @@ ugen20_tr_open(struct libusb20_transfer if (stream_id != 0) { temp.fs_open_stream.stream_id = stream_id; - if (ioctl(xfer->pdev->file, USB_FS_OPEN_STREAM, &temp.fs_open_stream)) + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN_STREAM), &temp.fs_open_stream)) return (LIBUSB20_ERROR_INVALID_PARAM); } else { - if (ioctl(xfer->pdev->file, USB_FS_OPEN, &temp.fs_open)) + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN), &temp.fs_open)) return (LIBUSB20_ERROR_INVALID_PARAM); } /* maximums might have changed - update */ @@ -829,7 +833,7 @@ ugen20_tr_close(struct libusb20_transfer temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_CLOSE, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLOSE), &temp)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); /* success */ @@ -846,7 +850,7 @@ ugen20_tr_clear_stall_sync(struct libusb temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_CLEAR_STALL_SYNC, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLEAR_STALL_SYNC), &temp)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); /* success */ @@ -885,7 +889,7 @@ ugen20_tr_submit(struct libusb20_transfe temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_START, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_START), &temp)) { /* ignore any errors - should never happen */ } return; /* success */ @@ -900,7 +904,7 @@ ugen20_tr_cancel_async(struct libusb20_t temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_STOP, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_STOP), &temp)) { /* ignore any errors - should never happen */ } return; @@ -939,7 +943,7 @@ ugen20_dev_get_iface_desc(struct libusb2 ugd.ugd_maxlen = len; ugd.ugd_iface_index = iface_index; - if (ioctl(pdev->file, USB_GET_IFACE_DRIVER, &ugd)) { + if (ioctl(pdev->file, IOUSB(USB_GET_IFACE_DRIVER), &ugd)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); @@ -949,7 +953,7 @@ static int ugen20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo) { - if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) { + if (ioctl(pdev->file, IOUSB(USB_GET_DEVICEINFO), pinfo)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); @@ -966,7 +970,7 @@ ugen20_root_get_dev_quirk(struct libusb2 q.index = quirk_index; - error = ugen20_be_ioctl(USB_DEV_QUIRK_GET, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_GET), &q); if (error) { if (errno == EINVAL) { @@ -993,7 +997,7 @@ ugen20_root_get_quirk_name(struct libusb q.index = quirk_index; - error = ugen20_be_ioctl(USB_QUIRK_NAME_GET, &q); + error = ugen20_be_ioctl(IOUSB(USB_QUIRK_NAME_GET), &q); if (error) { if (errno == EINVAL) { @@ -1020,7 +1024,7 @@ ugen20_root_add_dev_quirk(struct libusb2 q.bcdDeviceHigh = pq->bcdDeviceHigh; strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname)); - error = ugen20_be_ioctl(USB_DEV_QUIRK_ADD, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_ADD), &q); if (error) { if (errno == ENOMEM) { return (LIBUSB20_ERROR_NO_MEM); @@ -1044,7 +1048,7 @@ ugen20_root_remove_dev_quirk(struct libu q.bcdDeviceHigh = pq->bcdDeviceHigh; strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname)); - error = ugen20_be_ioctl(USB_DEV_QUIRK_REMOVE, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_REMOVE), &q); if (error) { if (errno == EINVAL) { return (LIBUSB20_ERROR_NOT_FOUND); @@ -1056,11 +1060,11 @@ ugen20_root_remove_dev_quirk(struct libu static int ugen20_root_set_template(struct libusb20_backend *pbe, int temp) { - return (ugen20_be_ioctl(USB_SET_TEMPLATE, &temp)); + return (ugen20_be_ioctl(IOUSB(USB_SET_TEMPLATE), &temp)); } static int ugen20_root_get_template(struct libusb20_backend *pbe, int *ptemp) { - return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp)); + return (ugen20_be_ioctl(IOUSB(USB_GET_TEMPLATE), ptemp)); } Modified: user/attilio/vmobj-readlock/lib/libusb/libusb_global_linux.h ============================================================================== --- user/attilio/vmobj-readlock/lib/libusb/libusb_global_linux.h Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/libusb/libusb_global_linux.h Wed Jul 17 17:35:46 2013 (r253431) @@ -29,7 +29,9 @@ #define _XOPEN_SOURCE #define _BSD_SOURCE +#ifdef __linux__ #define _POSIX_SOURCE +#endif #define _POSIX_C_SOURCE 200809 #include @@ -39,10 +41,13 @@ #include #include #include +#ifdef __linux__ #include +#endif #include #include #include +#include #include #include #include @@ -51,6 +56,10 @@ #include #include +#include + +#define IOUSB(a) FBSD_L##a + #ifndef __aligned #define __aligned(x) __attribute__((__aligned__(x))) #endif Modified: user/attilio/vmobj-readlock/lib/msun/src/math.h ============================================================================== --- user/attilio/vmobj-readlock/lib/msun/src/math.h Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/lib/msun/src/math.h Wed Jul 17 17:35:46 2013 (r253431) @@ -83,22 +83,22 @@ extern const union __nan_un { #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ __has_extension(c_generic_selections) -#define __fp_type_select(x, f, d, ld) _Generic((x), \ - float: f(x), \ - double: d(x), \ - long double: ld(x)) +#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ + float: f(x), \ + double: d(x), \ + long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) -#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), double), d(x), \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) +#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), double), d(x), \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) #else -#define __fp_type_select(x, f, d, ld) \ - ((sizeof(x) == sizeof(float)) ? f(x) \ - : (sizeof(x) == sizeof(double)) ? d(x) \ - : ld(x)) +#define __fp_type_select(x, f, d, ld) \ + ((sizeof(x) == sizeof(float)) ? f(x) \ + : (sizeof(x) == sizeof(double)) ? d(x) \ + : ld(x)) #endif #define fpclassify(x) \ @@ -189,21 +189,21 @@ int __signbitf(float) __pure2; int __signbitl(long double) __pure2; static __inline int -__inline_isnan(double __x) +__inline_isnan(__const double __x) { return (__x != __x); } static __inline int -__inline_isnanf(float __x) +__inline_isnanf(__const float __x) { return (__x != __x); } static __inline int -__inline_isnanl(long double __x) +__inline_isnanl(__const long double __x) { return (__x != __x); Modified: user/attilio/vmobj-readlock/sbin/mount/mount.8 ============================================================================== --- user/attilio/vmobj-readlock/sbin/mount/mount.8 Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/sbin/mount/mount.8 Wed Jul 17 17:35:46 2013 (r253431) @@ -118,6 +118,9 @@ When used in conjunction with the .Fl a option, also mount those file systems which are marked as .Dq Li late . +.It Fl n +For compatibility with some other implementations, this flag is +currently a no-op. .It Fl o Options are specified with a .Fl o Modified: user/attilio/vmobj-readlock/sbin/mount/mount.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/mount/mount.c Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/sbin/mount/mount.c Wed Jul 17 17:35:46 2013 (r253431) @@ -253,7 +253,7 @@ main(int argc, char *argv[]) options = NULL; vfslist = NULL; vfstype = "ufs"; - while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1) + while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1) switch (ch) { case 'a': all = 1; @@ -274,6 +274,9 @@ main(int argc, char *argv[]) case 'l': late = 1; break; + case 'n': + /* For compatibility with the Linux version of mount. */ + break; case 'o': if (*optarg) { options = catopt(options, optarg); Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/sbin/nvmecontrol/firmware.c Wed Jul 17 17:35:46 2013 (r253431) @@ -246,7 +246,7 @@ firmware(int argc, char *argv[]) "slot %d specified but controller only supports %d slots", slot, cdata.frmw.num_slots); - if (!slot_has_valid_firmware(fd, slot)) + if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot)) errx(1, "slot %d does not contain valid firmware,\n" "try 'nvmecontrol logpage -p 3 %s' to get a list " Modified: user/attilio/vmobj-readlock/sbin/route/Makefile ============================================================================== --- user/attilio/vmobj-readlock/sbin/route/Makefile Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/sbin/route/Makefile Wed Jul 17 17:35:46 2013 (r253431) @@ -7,24 +7,21 @@ PROG= route MAN= route.8 SRCS= route.c keywords.h WARNS?= 3 -CLEANFILES+=keywords.h _keywords.tmp +CLEANFILES+=keywords.h CFLAGS+= -DNS - +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif - CFLAGS+= -I. keywords.h: keywords - sed -e '/^#/d' -e '/^$$/d' ${.CURDIR}/keywords > _keywords.tmp - LC_ALL=C tr 'a-z' 'A-Z' < _keywords.tmp | paste _keywords.tmp - | \ - awk '{ \ - if (NF > 1) \ - printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ - $$2, NR, $$1, $$2 }' \ - > ${.TARGET} - rm -f _keywords.tmp + LC_ALL=C awk '!/^#|^$$/ { \ + printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ + toupper($$1), ++L, $$1, toupper($$1); \ + }' < ${.CURDIR}/keywords > ${.TARGET} || (rm -f ${.TARGET}; false) .include Modified: user/attilio/vmobj-readlock/sbin/route/route.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/route/route.c Wed Jul 17 17:28:16 2013 (r253430) +++ user/attilio/vmobj-readlock/sbin/route/route.c Wed Jul 17 17:35:46 2013 (r253431) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct keytab { +static struct keytab { const char *kt_cp; int kt_i; } keywords[] = { @@ -78,42 +78,33 @@ struct keytab { {0, 0} }; -union sockunion { - struct sockaddr sa; - struct sockaddr_in sin; -#ifdef INET6 - struct sockaddr_in6 sin6; -#endif - struct sockaddr_at sat; - struct sockaddr_dl sdl; - struct sockaddr_storage ss; /* added to avoid memory overrun */ -} so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; - -typedef union sockunion *sup; -int pid, rtm_addrs; -int s; -int forcehost, forcenet, doflush, nflag, af, qflag, tflag; -int verbose, aflen = sizeof (struct sockaddr_in); -int locking, lockrest, debugonly; -struct rt_metrics rt_metrics; -u_long rtm_inits; -uid_t uid; +static struct sockaddr_storage so[RTAX_MAX]; +static int pid, rtm_addrs; +static int s; +static int forcehost, forcenet, nflag, af, qflag, tflag; +static int verbose, aflen; +static int locking, lockrest, debugonly; +static struct rt_metrics rt_metrics; +static u_long rtm_inits; +static uid_t uid; static int defaultfib; static int numfibs; static int atalk_aton(const char *, struct at_addr *); static char *atalk_ntoa(struct at_addr); -static void bprintf(FILE *, int, u_char *); +static void printb(int, const char *); static void flushroutes(int argc, char *argv[]); static int flushroutes_fib(int); static int getaddr(int, char *, struct hostent **, int); static int keyword(const char *); -static void inet_makenetandmask(u_long, struct sockaddr_in *, u_long); +#ifdef INET +static void inet_makenetandmask(u_long, struct sockaddr_in *, + struct sockaddr_in *, u_long); +#endif #ifdef INET6 -static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); +static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); #endif static void interfaces(void); -static void mask_addr(void); static void monitor(int, char*[]); static const char *netname(struct sockaddr *); static void newroute(int, char **); @@ -127,9 +118,8 @@ static const char *routename(struct sock static int rtmsg(int, int, int); static void set_metric(char *, int); static int set_sofib(int); -static int set_procfib(int); -static void sockaddr(char *, struct sockaddr *); -static void sodump(sup, const char *); +static void sockaddr(char *, struct sockaddr *, size_t); +static void sodump(struct sockaddr *, const char *); extern char *iso_ntoa(void); struct fibl { @@ -139,7 +129,7 @@ struct fibl { int fl_error; int fl_errno; }; -TAILQ_HEAD(fibl_head_t, fibl) fibl_head; +static TAILQ_HEAD(fibl_head_t, fibl) fibl_head; static int fiboptlist_csv(const char *, struct fibl_head_t *); static int fiboptlist_range(const char *, struct fibl_head_t *); @@ -151,9 +141,7 @@ usage(const char *cp) { if (cp != NULL) warnx("bad keyword: %s", cp); - (void) fprintf(stderr, - "usage: route [-dnqtv] command [[modifiers] args]\n"); - exit(EX_USAGE); + errx(EX_USAGE, "usage: route [-dnqtv] command [[modifiers] args]"); /* NOTREACHED */ } @@ -247,15 +235,6 @@ set_sofib(int fib) } static int -set_procfib(int fib) -{ - - if (fib < 0) - return (0); - return (setfib(fib)); -} - -static int fiboptlist_range(const char *arg, struct fibl_head_t *flh) { struct fibl *fl; @@ -313,6 +292,7 @@ fiboptlist_csv(const char *arg, struct f char *str0, *str, *token, *endptr; int fib, error; + str0 = str = NULL; if (strcmp("all", arg) == 0) { str = calloc(1, ALLSTRLEN); if (str == NULL) { @@ -362,7 +342,8 @@ fiboptlist_csv(const char *arg, struct f } } fiboptlist_csv_ret: - free(str0); + if (str0 != NULL) + free(str0); return (error); } @@ -376,9 +357,8 @@ flushroutes(int argc, char *argv[]) struct fibl *fl; int error; - if (uid != 0 && !debugonly && !tflag) { + if (uid != 0 && !debugonly && !tflag) errx(EX_NOPERM, "must be root to alter routing table"); - } shutdown(s, SHUT_RD); /* Don't want to read back our messages */ TAILQ_INIT(&fibl_head); @@ -388,9 +368,11 @@ flushroutes(int argc, char *argv[]) if (**argv != '-') usage(*argv); switch (keyword(*argv + 1)) { +#ifdef INET case K_INET: af = AF_INET; break; +#endif #ifdef INET6 case K_INET6: af = AF_INET6; @@ -428,11 +410,10 @@ flushroutes_fib(int fib) struct rt_msghdr *rtm; size_t needed; char *buf, *next, *lim; - int mib[6], rlen, seqno, count = 0; + int mib[7], rlen, seqno, count = 0; int error; error = set_sofib(fib); - error += set_procfib(fib); if (error) { warn("fib number %d is ignored", fib); return (error); @@ -442,14 +423,15 @@ retry: mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; /* protocol */ - mib[3] = 0; /* wildcard address family */ + mib[3] = AF_UNSPEC; mib[4] = NET_RT_DUMP; mib[5] = 0; /* no flags */ - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + mib[6] = fib; + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(EX_OSERR, "malloc failed"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) { if (errno == ENOMEM && count++ < 10) { warnx("Routing table grew, retrying"); sleep(1); @@ -460,7 +442,7 @@ retry: } lim = buf + needed; if (verbose) - (void) printf("Examining routing table from sysctl\n"); + (void)printf("Examining routing table from sysctl\n"); seqno = 0; /* ??? */ for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; @@ -483,7 +465,7 @@ retry: err(1, "write to routing socket"); if (rlen < (int)rtm->rtm_msglen) { warn("write to routing socket"); - (void) printf("got only %d for rlen\n", rlen); + (void)printf("got only %d for rlen\n", rlen); free(buf); goto retry; break; @@ -513,7 +495,9 @@ routename(struct sockaddr *sa) { const char *cp; static char line[MAXHOSTNAMELEN + 1]; +#ifdef INET struct hostent *hp; +#endif static char domain[MAXHOSTNAMELEN + 1]; static int first = 1, n; @@ -522,19 +506,22 @@ routename(struct sockaddr *sa) if (gethostname(domain, MAXHOSTNAMELEN) == 0 && (cp = strchr(domain, '.'))) { domain[MAXHOSTNAMELEN] = '\0'; - (void) strcpy(domain, cp + 1); + (void)strcpy(domain, cp + 1); } else - domain[0] = 0; + domain[0] = '\0'; } - if (sa->sa_len == 0) + if (sa->sa_len == 0) { strcpy(line, "default"); - else switch (sa->sa_family) { - + return (line); + } + switch (sa->sa_family) { +#ifdef INET case AF_INET: - { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + { + struct in_addr in; + in = ((struct sockaddr_in *)sa)->sin_addr; cp = NULL; if (in.s_addr == INADDR_ANY || sa->sa_len < 4) cp = "default"; @@ -554,10 +541,11 @@ routename(struct sockaddr *sa) strncpy(line, cp, sizeof(line) - 1); line[sizeof(line) - 1] = '\0'; } else - (void) sprintf(line, "%s", inet_ntoa(in)); + (void)sprintf(line, "%s", inet_ntoa(in)); break; - } + } +#endif #ifdef INET6 case AF_INET6: { @@ -574,17 +562,18 @@ routename(struct sockaddr *sa) line, sizeof(line), NULL, 0, niflags) != 0) strncpy(line, "invalid", sizeof(line)); - return(line); + return (line); } #endif case AF_APPLETALK: - (void) snprintf(line, sizeof(line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); + (void)snprintf(line, sizeof(line), "atalk %s", + atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); break; case AF_LINK: return (link_ntoa((struct sockaddr_dl *)sa)); + break; default: { @@ -611,18 +600,21 @@ routename(struct sockaddr *sa) const char * netname(struct sockaddr *sa) { - const char *cp = NULL; static char line[MAXHOSTNAMELEN + 1]; + int n; +#ifdef INET struct netent *np = NULL; + const char *cp = NULL; u_long i; - int n; +#endif switch (sa->sa_family) { - +#ifdef INET case AF_INET: - { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + { + struct in_addr in; + in = ((struct sockaddr_in *)sa)->sin_addr; i = in.s_addr = ntohl(in.s_addr); if (in.s_addr == 0) cp = "default"; @@ -635,30 +627,30 @@ netname(struct sockaddr *sa) if (cp != NULL) strncpy(line, cp, sizeof(line)); else if ((in.s_addr & 0xffffff) == 0) - (void) sprintf(line, "%u", C(in.s_addr >> 24)); + (void)sprintf(line, "%u", C(in.s_addr >> 24)); else if ((in.s_addr & 0xffff) == 0) - (void) sprintf(line, "%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u", C(in.s_addr >> 24), C(in.s_addr >> 16)); else if ((in.s_addr & 0xff) == 0) - (void) sprintf(line, "%u.%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u.%u", C(in.s_addr >> 24), C(in.s_addr >> 16), C(in.s_addr >> 8)); else - (void) sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Jul 17 17:40:40 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50902E2E; Wed, 17 Jul 2013 17:40:40 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4027AF9B; Wed, 17 Jul 2013 17:40:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6HHee97071474; Wed, 17 Jul 2013 17:40:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6HHeb4x071453; Wed, 17 Jul 2013 17:40:37 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307171740.r6HHeb4x071453@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Jul 2013 17:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253432 - in user/attilio/vmobj-fullread: . etc/rc.d lib/libc/gen lib/libc/stdlib lib/libusb lib/msun/src sbin/mount sbin/nvmecontrol sbin/route share/examples/kld/syscall/test share/ma... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 17:40:40 -0000 Author: attilio Date: Wed Jul 17 17:40:36 2013 New Revision: 253432 URL: http://svnweb.freebsd.org/changeset/base/253432 Log: MFC Added: user/attilio/vmobj-fullread/share/monetdef/ca_ES.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/ca_ES.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/de_AT.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/de_AT.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/de_DE.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/de_DE.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/el_GR.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/el_GR.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/es_ES.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/es_ES.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/fi_FI.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/fi_FI.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/fr_BE.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/fr_BE.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/fr_FR.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/fr_FR.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/it_IT.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/it_IT.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/nl_BE.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/nl_BE.UTF-8.src user/attilio/vmobj-fullread/share/monetdef/nl_NL.UTF-8.src - copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/nl_NL.UTF-8.src user/attilio/vmobj-fullread/sys/arm/broadcom/bcm2835/std.bcm2835 - copied unchanged from r253431, user/attilio/vmobj-readlock/sys/arm/broadcom/bcm2835/std.bcm2835 user/attilio/vmobj-fullread/sys/arm/broadcom/bcm2835/std.rpi - copied unchanged from r253431, user/attilio/vmobj-readlock/sys/arm/broadcom/bcm2835/std.rpi user/attilio/vmobj-fullread/tools/build/options/WITHOUT_ARM_EABI - copied unchanged from r253431, user/attilio/vmobj-readlock/tools/build/options/WITHOUT_ARM_EABI Deleted: user/attilio/vmobj-fullread/tools/build/options/WITH_ARM_EABI user/attilio/vmobj-fullread/usr.bin/systat/mbufs.c Modified: user/attilio/vmobj-fullread/UPDATING user/attilio/vmobj-fullread/etc/rc.d/pfsync user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3 user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c user/attilio/vmobj-fullread/lib/libusb/Makefile user/attilio/vmobj-fullread/lib/libusb/libusb20.c user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h user/attilio/vmobj-fullread/lib/msun/src/math.h user/attilio/vmobj-fullread/sbin/mount/mount.8 user/attilio/vmobj-fullread/sbin/mount/mount.c user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c user/attilio/vmobj-fullread/sbin/route/Makefile user/attilio/vmobj-fullread/sbin/route/route.c user/attilio/vmobj-fullread/share/examples/kld/syscall/test/call.c user/attilio/vmobj-fullread/share/man/man4/mfi.4 user/attilio/vmobj-fullread/share/man/man5/fstab.5 user/attilio/vmobj-fullread/share/man/man5/src.conf.5 user/attilio/vmobj-fullread/share/mk/bsd.own.mk user/attilio/vmobj-fullread/share/monetdef/Makefile user/attilio/vmobj-fullread/sys/amd64/amd64/machdep.c user/attilio/vmobj-fullread/sys/arm/arm/vfp.c user/attilio/vmobj-fullread/sys/arm/arm/vm_machdep.c user/attilio/vmobj-fullread/sys/arm/conf/RPI-B user/attilio/vmobj-fullread/sys/cam/cam_periph.c user/attilio/vmobj-fullread/sys/cam/cam_xpt.c user/attilio/vmobj-fullread/sys/cam/scsi/scsi_all.c user/attilio/vmobj-fullread/sys/cam/scsi/scsi_all.h user/attilio/vmobj-fullread/sys/cam/scsi/scsi_ch.c user/attilio/vmobj-fullread/sys/cam/scsi/scsi_xpt.c user/attilio/vmobj-fullread/sys/compat/linux/linux_ioctl.c user/attilio/vmobj-fullread/sys/compat/linux/linux_ioctl.h user/attilio/vmobj-fullread/sys/conf/Makefile.arm user/attilio/vmobj-fullread/sys/conf/files user/attilio/vmobj-fullread/sys/dev/acpica/acpi_resource.c user/attilio/vmobj-fullread/sys/dev/ae/if_ae.c user/attilio/vmobj-fullread/sys/dev/ae/if_aereg.h user/attilio/vmobj-fullread/sys/dev/bge/if_bge.c user/attilio/vmobj-fullread/sys/dev/bge/if_bgereg.h user/attilio/vmobj-fullread/sys/dev/cxgbe/firmware/t5fw_cfg.txt user/attilio/vmobj-fullread/sys/dev/isp/isp.c user/attilio/vmobj-fullread/sys/dev/isp/ispreg.h user/attilio/vmobj-fullread/sys/dev/usb/controller/xhci_pci.c user/attilio/vmobj-fullread/sys/dev/usb/input/ukbd.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_rum.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_uath.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_upgt.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_ural.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_urtw.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_urtwn.c user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_zyd.c user/attilio/vmobj-fullread/sys/fs/fuse/fuse_kernel.h user/attilio/vmobj-fullread/sys/i386/i386/support.s user/attilio/vmobj-fullread/sys/i386/i386/symbols.raw user/attilio/vmobj-fullread/sys/i386/i386/uio_machdep.c user/attilio/vmobj-fullread/sys/i386/i386/vm_machdep.c user/attilio/vmobj-fullread/sys/kern/kern_mbuf.c user/attilio/vmobj-fullread/sys/kern/kern_time.c user/attilio/vmobj-fullread/sys/kern/subr_bus.c user/attilio/vmobj-fullread/sys/kern/uipc_mbuf.c user/attilio/vmobj-fullread/sys/kern/uipc_syscalls.c user/attilio/vmobj-fullread/sys/kern/vfs_bio.c user/attilio/vmobj-fullread/sys/kern/vfs_subr.c user/attilio/vmobj-fullread/sys/mips/mips/uio_machdep.c user/attilio/vmobj-fullread/sys/mips/mips/vm_machdep.c user/attilio/vmobj-fullread/sys/modules/Makefile user/attilio/vmobj-fullread/sys/modules/usb/Makefile user/attilio/vmobj-fullread/sys/net/ieee8023ad_lacp.c user/attilio/vmobj-fullread/sys/net/if.c user/attilio/vmobj-fullread/sys/net/if_lagg.c user/attilio/vmobj-fullread/sys/net/if_lagg.h user/attilio/vmobj-fullread/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c user/attilio/vmobj-fullread/sys/netgraph/bluetooth/socket/ng_btsocket.c user/attilio/vmobj-fullread/sys/netgraph/ng_base.c user/attilio/vmobj-fullread/sys/netinet/tcp_syncache.c user/attilio/vmobj-fullread/sys/ofed/drivers/net/mlx4/main.c user/attilio/vmobj-fullread/sys/powerpc/aim/vm_machdep.c user/attilio/vmobj-fullread/sys/powerpc/booke/vm_machdep.c user/attilio/vmobj-fullread/sys/powerpc/powerpc/uio_machdep.c user/attilio/vmobj-fullread/sys/sparc64/sparc64/uio_machdep.c user/attilio/vmobj-fullread/sys/sparc64/sparc64/vm_machdep.c user/attilio/vmobj-fullread/sys/sys/mbuf.h user/attilio/vmobj-fullread/sys/sys/param.h user/attilio/vmobj-fullread/sys/sys/sf_buf.h user/attilio/vmobj-fullread/sys/ufs/ffs/ffs_alloc.c user/attilio/vmobj-fullread/tools/regression/aio/aiop/aiop.c user/attilio/vmobj-fullread/tools/regression/lib/libc/gen/test-fpclassify.c user/attilio/vmobj-fullread/tools/regression/lib/libc/gen/test-ftw.c user/attilio/vmobj-fullread/tools/regression/priv/Makefile user/attilio/vmobj-fullread/tools/regression/pthread/cv_cancel1/cv_cancel1.c user/attilio/vmobj-fullread/tools/regression/sbin/dhclient/Makefile user/attilio/vmobj-fullread/usr.bin/netstat/main.c user/attilio/vmobj-fullread/usr.bin/netstat/mbuf.c user/attilio/vmobj-fullread/usr.bin/systat/Makefile user/attilio/vmobj-fullread/usr.bin/systat/cmdtab.c user/attilio/vmobj-fullread/usr.bin/systat/extern.h user/attilio/vmobj-fullread/usr.bin/systat/systat.1 user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/cdrom.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/common.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/directory.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/dos.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/floppy.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/ftp.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/http.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/httpproxy.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/nfs.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/ufs.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/usb.subr user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/packages/packages.subr user/attilio/vmobj-fullread/usr.sbin/rtsold/rtsol.c user/attilio/vmobj-fullread/usr.sbin/ypserv/yp_access.c user/attilio/vmobj-fullread/usr.sbin/ypserv/yp_dnslookup.c Directory Properties: user/attilio/vmobj-fullread/ (props changed) user/attilio/vmobj-fullread/lib/libc/ (props changed) user/attilio/vmobj-fullread/sbin/ (props changed) user/attilio/vmobj-fullread/share/man/man4/ (props changed) user/attilio/vmobj-fullread/sys/ (props changed) user/attilio/vmobj-fullread/sys/conf/ (props changed) user/attilio/vmobj-fullread/usr.sbin/rtsold/ (props changed) Modified: user/attilio/vmobj-fullread/UPDATING ============================================================================== --- user/attilio/vmobj-fullread/UPDATING Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/UPDATING Wed Jul 17 17:40:36 2013 (r253432) @@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130716: + The default ARM ABI has changed to the ARM EABI. The old ABI is + incompatible with the ARM EABI and all programs and modules will + need to be rebuilt to work with a new kernel. + + To keep using the old ABI ensure the WITHOUT_ARM_EABI knob is set. + + NOTE: Support for the old ABI will be removed in the future and + users are advised to upgrade. + 20130709: pkg_install has been disconnected from the build if you really need it you should add WITH_PKGTOOLS in your src.conf(5). @@ -38,7 +48,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 20130709: Most of network statistics structures were changed to be able keep 64-bits counters. Thus all tools, that work with networking - statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.) + statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.) 20130629: Fix targets that run multiple make's to use && rather than ; Modified: user/attilio/vmobj-fullread/etc/rc.d/pfsync ============================================================================== --- user/attilio/vmobj-fullread/etc/rc.d/pfsync Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/etc/rc.d/pfsync Wed Jul 17 17:40:36 2013 (r253432) @@ -42,7 +42,7 @@ pfsync_start() pfsync_stop() { echo "Disabling pfsync." - ifconfig pfsync0 -syncdev down + ifconfig pfsync0 -syncdev -syncpeer down } load_rc_config $name Modified: user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3 ============================================================================== --- user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3 Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3 Wed Jul 17 17:40:36 2013 (r253432) @@ -548,13 +548,13 @@ The third level name is a protocol numbe The fourth level name is an address family, which may be set to 0 to select all address families. The fifth, sixth, and seventh level names are as follows: -.Bl -column "Fifth level " "Sixth level " -offset indent -.It Sy "Fifth level Sixth level Seventh level" -.It "NET_RT_FLAGS rtflags None" -.It "NET_RT_DUMP None None or fib number" -.It "NET_RT_IFLIST 0 or if_index None" -.It "NET_RT_IFMALIST 0 or if_index None" -.It "NET_RT_IFLISTL 0 or if_index None" +.Bl -column -offset indent "Fifth level Sixth level" "Seventh level" +.It Sy "Fifth level Sixth level" Ta Sy "Seventh level" +.It "NET_RT_FLAGS rtflags" Ta "None" +.It "NET_RT_DUMP None" Ta "None or fib number" +.It "NET_RT_IFLIST 0 or if_index" Ta None +.It "NET_RT_IFMALIST 0 or if_index" Ta None +.It "NET_RT_IFLISTL 0 or if_index" Ta None .El .Pp The Modified: user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c ============================================================================== --- user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c Wed Jul 17 17:40:36 2013 (r253432) @@ -505,9 +505,8 @@ __setenv(const char *name, size_t nameLe envVars[envNdx].valueSize = valueLen; /* Save name of name/value pair. */ - env = stpcpy(envVars[envNdx].name, name); - if ((envVars[envNdx].name)[nameLen] != '=') - env = stpcpy(env, "="); + env = stpncpy(envVars[envNdx].name, name, nameLen); + *env++ = '='; } else env = envVars[envNdx].value; Modified: user/attilio/vmobj-fullread/lib/libusb/Makefile ============================================================================== --- user/attilio/vmobj-fullread/lib/libusb/Makefile Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/libusb/Makefile Wed Jul 17 17:40:36 2013 (r253432) @@ -15,11 +15,12 @@ INCS+= libusb20_desc.h MAN= libusb.3 libusb20.3 MKLINT= no NOGCCERROR= +PTHREAD_LIBS?= -lpthread WARNS?= 2 DPADD= ${LIBPTHREAD} -LDADD= -lpthread +LDADD= ${PTHREAD_LIBS} MLINKS+= libusb.3 usb.3 @@ -42,7 +43,17 @@ CFLAGS+= -DCOMPAT_32BIT # # Examples: # make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h -# make COMPAT_32BIT=YES LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h +# make COMPAT_32BIT=YES \ +# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# DEBUG_FLAGS="-g" +# +# From Ubuntu 10.04: +# freebsd-make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# PTHREAD_LIBS="-lpthread -lrt" +# freebsd-make COMPAT32_BIT=YES \ +# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ +# PTHREAD_LIBS="-lpthread -lrt" +# # .if defined(LIBUSB_GLOBAL_INCLUDE_FILE) CFLAGS+= -DLIBUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\" Modified: user/attilio/vmobj-fullread/lib/libusb/libusb20.c ============================================================================== --- user/attilio/vmobj-fullread/lib/libusb/libusb20.c Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/libusb/libusb20.c Wed Jul 17 17:40:36 2013 (r253432) @@ -1202,27 +1202,13 @@ libusb20_be_alloc(const struct libusb20_ struct libusb20_backend * libusb20_be_alloc_linux(void) { - struct libusb20_backend *pbe; - -#ifdef __linux__ - pbe = libusb20_be_alloc(&libusb20_linux_backend); -#else - pbe = NULL; -#endif - return (pbe); + return (NULL); } struct libusb20_backend * libusb20_be_alloc_ugen20(void) { - struct libusb20_backend *pbe; - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - pbe = libusb20_be_alloc(&libusb20_ugen20_backend); -#else - pbe = NULL; -#endif - return (pbe); + return (libusb20_be_alloc(&libusb20_ugen20_backend)); } struct libusb20_backend * @@ -1230,10 +1216,12 @@ libusb20_be_alloc_default(void) { struct libusb20_backend *pbe; +#ifdef __linux__ pbe = libusb20_be_alloc_linux(); if (pbe) { return (pbe); } +#endif pbe = libusb20_be_alloc_ugen20(); if (pbe) { return (pbe); Modified: user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c ============================================================================== --- user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:40:36 2013 (r253432) @@ -46,6 +46,10 @@ #include "libusb20_desc.h" #include "libusb20_int.h" +#ifndef IOUSB +#define IOUSB(a) a +#endif + static libusb20_init_backend_t ugen20_init_backend; static libusb20_open_device_t ugen20_open_device; static libusb20_close_device_t ugen20_close_device; @@ -145,14 +149,14 @@ ugen20_enumerate(struct libusb20_device if (f < 0) { return (LIBUSB20_ERROR_OTHER); } - if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_OTHER; goto done; } /* store when the device was plugged */ pdev->session_data.plugtime = plugtime; - if (ioctl(f, USB_GET_DEVICE_DESC, &ddesc)) { + if (ioctl(f, IOUSB(USB_GET_DEVICE_DESC), &ddesc)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -167,7 +171,7 @@ ugen20_enumerate(struct libusb20_device error = LIBUSB20_ERROR_OTHER; goto done; } - if (ioctl(f, USB_GET_DEVICEINFO, &devinfo)) { + if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -241,7 +245,7 @@ repeat: st->urd.urd_maxlen = sizeof(st->buf); st->nparsed = 0; - if (ioctl(st->f, USB_READ_DIR, &st->urd)) { + if (ioctl(st->f, IOUSB(USB_READ_DIR), &st->urd)) { return (EINVAL); } st->ptr = st->buf; @@ -313,7 +317,7 @@ ugen20_tr_release(struct libusb20_device /* release all pending USB transfers */ if (pdev->privBeData != NULL) { memset(&fs_uninit, 0, sizeof(fs_uninit)); - if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) { + if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) { /* ignore any errors of this kind */ } } @@ -353,7 +357,7 @@ ugen20_tr_renew(struct libusb20_device * fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData); fs_init.ep_index_max = nMaxTransfer; - if (ioctl(pdev->file, USB_FS_INIT, &fs_init)) { + if (ioctl(pdev->file, IOUSB(USB_FS_INIT), &fs_init)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -387,7 +391,7 @@ ugen20_open_device(struct libusb20_devic close(g); return (LIBUSB20_ERROR_NO_DEVICE); } - if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_OTHER; goto done; } @@ -430,7 +434,7 @@ ugen20_close_device(struct libusb20_devi if (pdev->privBeData) { memset(&fs_uninit, 0, sizeof(fs_uninit)); - if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) { + if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) { /* ignore this error */ } free(pdev->privBeData); @@ -468,7 +472,7 @@ ugen20_get_config_desc_full(struct libus gen_desc.ugd_maxlen = sizeof(cdesc); gen_desc.ugd_config_index = cfg_index; - error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); + error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); if (error) { return (LIBUSB20_ERROR_OTHER); } @@ -488,7 +492,7 @@ ugen20_get_config_desc_full(struct libus gen_desc.ugd_data = libusb20_pass_ptr(ptr); gen_desc.ugd_maxlen = len; - error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); + error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); if (error) { free(ptr); return (LIBUSB20_ERROR_OTHER); @@ -507,7 +511,7 @@ ugen20_get_config_index(struct libusb20_ { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_CONFIG, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_CONFIG), &temp)) { return (LIBUSB20_ERROR_OTHER); } *pindex = temp; @@ -523,7 +527,7 @@ ugen20_set_config_index(struct libusb20_ /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_SET_CONFIG, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_CONFIG), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -543,7 +547,7 @@ ugen20_set_alt_index(struct libusb20_dev /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_SET_ALTINTERFACE, &alt_iface)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_ALTINTERFACE), &alt_iface)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -557,7 +561,7 @@ ugen20_reset_device(struct libusb20_devi /* release all active USB transfers */ ugen20_tr_release(pdev); - if (ioctl(pdev->file_ctrl, USB_DEVICEENUMERATE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_DEVICEENUMERATE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (ugen20_tr_renew(pdev)); @@ -569,7 +573,7 @@ ugen20_check_connected(struct libusb20_d uint32_t plugtime; int error = 0; - if (ioctl(pdev->file_ctrl, USB_GET_PLUGTIME, &plugtime)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_PLUGTIME), &plugtime)) { error = LIBUSB20_ERROR_NO_DEVICE; goto done; } @@ -606,7 +610,7 @@ ugen20_set_power_mode(struct libusb20_de default: return (LIBUSB20_ERROR_INVALID_PARAM); } - if (ioctl(pdev->file_ctrl, USB_SET_POWER_MODE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_POWER_MODE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); @@ -617,7 +621,7 @@ ugen20_get_power_mode(struct libusb20_de { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_POWER_MODE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_MODE), &temp)) { return (LIBUSB20_ERROR_OTHER); } switch (temp) { @@ -649,7 +653,7 @@ ugen20_get_port_path(struct libusb20_dev { struct usb_device_port_path udpp; - if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp)) + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_DEV_PORT_PATH), &udpp)) return (LIBUSB20_ERROR_OTHER); if (udpp.udp_port_level > bufsize) @@ -665,7 +669,7 @@ ugen20_get_power_usage(struct libusb20_d { int temp; - if (ioctl(pdev->file_ctrl, USB_GET_POWER_USAGE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_USAGE), &temp)) { return (LIBUSB20_ERROR_OTHER); } *power_usage = temp; @@ -678,7 +682,7 @@ ugen20_kernel_driver_active(struct libus { int temp = iface_index; - if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_ACTIVE, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_ACTIVE), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); /* kernel driver is active */ @@ -690,7 +694,7 @@ ugen20_detach_kernel_driver(struct libus { int temp = iface_index; - if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_DETACH, &temp)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_DETACH), &temp)) { return (LIBUSB20_ERROR_OTHER); } return (0); /* kernel driver is active */ @@ -713,7 +717,7 @@ ugen20_do_request_sync(struct libusb20_d sizeof(req.ucr_request), setup)) { /* ignore */ } - if (ioctl(pdev->file_ctrl, USB_DO_REQUEST, &req)) { + if (ioctl(pdev->file_ctrl, IOUSB(USB_DO_REQUEST), &req)) { return (LIBUSB20_ERROR_OTHER); } if (pactlen) { @@ -732,7 +736,7 @@ ugen20_process(struct libusb20_device *p while (1) { - if (ioctl(pdev->file, USB_FS_COMPLETE, &temp)) { + if (ioctl(pdev->file, IOUSB(USB_FS_COMPLETE), &temp)) { if (errno == EBUSY) { break; } else { @@ -800,10 +804,10 @@ ugen20_tr_open(struct libusb20_transfer if (stream_id != 0) { temp.fs_open_stream.stream_id = stream_id; - if (ioctl(xfer->pdev->file, USB_FS_OPEN_STREAM, &temp.fs_open_stream)) + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN_STREAM), &temp.fs_open_stream)) return (LIBUSB20_ERROR_INVALID_PARAM); } else { - if (ioctl(xfer->pdev->file, USB_FS_OPEN, &temp.fs_open)) + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN), &temp.fs_open)) return (LIBUSB20_ERROR_INVALID_PARAM); } /* maximums might have changed - update */ @@ -829,7 +833,7 @@ ugen20_tr_close(struct libusb20_transfer temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_CLOSE, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLOSE), &temp)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); /* success */ @@ -846,7 +850,7 @@ ugen20_tr_clear_stall_sync(struct libusb temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_CLEAR_STALL_SYNC, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLEAR_STALL_SYNC), &temp)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); /* success */ @@ -885,7 +889,7 @@ ugen20_tr_submit(struct libusb20_transfe temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_START, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_START), &temp)) { /* ignore any errors - should never happen */ } return; /* success */ @@ -900,7 +904,7 @@ ugen20_tr_cancel_async(struct libusb20_t temp.ep_index = xfer->trIndex; - if (ioctl(xfer->pdev->file, USB_FS_STOP, &temp)) { + if (ioctl(xfer->pdev->file, IOUSB(USB_FS_STOP), &temp)) { /* ignore any errors - should never happen */ } return; @@ -939,7 +943,7 @@ ugen20_dev_get_iface_desc(struct libusb2 ugd.ugd_maxlen = len; ugd.ugd_iface_index = iface_index; - if (ioctl(pdev->file, USB_GET_IFACE_DRIVER, &ugd)) { + if (ioctl(pdev->file, IOUSB(USB_GET_IFACE_DRIVER), &ugd)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); @@ -949,7 +953,7 @@ static int ugen20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo) { - if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) { + if (ioctl(pdev->file, IOUSB(USB_GET_DEVICEINFO), pinfo)) { return (LIBUSB20_ERROR_INVALID_PARAM); } return (0); @@ -966,7 +970,7 @@ ugen20_root_get_dev_quirk(struct libusb2 q.index = quirk_index; - error = ugen20_be_ioctl(USB_DEV_QUIRK_GET, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_GET), &q); if (error) { if (errno == EINVAL) { @@ -993,7 +997,7 @@ ugen20_root_get_quirk_name(struct libusb q.index = quirk_index; - error = ugen20_be_ioctl(USB_QUIRK_NAME_GET, &q); + error = ugen20_be_ioctl(IOUSB(USB_QUIRK_NAME_GET), &q); if (error) { if (errno == EINVAL) { @@ -1020,7 +1024,7 @@ ugen20_root_add_dev_quirk(struct libusb2 q.bcdDeviceHigh = pq->bcdDeviceHigh; strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname)); - error = ugen20_be_ioctl(USB_DEV_QUIRK_ADD, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_ADD), &q); if (error) { if (errno == ENOMEM) { return (LIBUSB20_ERROR_NO_MEM); @@ -1044,7 +1048,7 @@ ugen20_root_remove_dev_quirk(struct libu q.bcdDeviceHigh = pq->bcdDeviceHigh; strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname)); - error = ugen20_be_ioctl(USB_DEV_QUIRK_REMOVE, &q); + error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_REMOVE), &q); if (error) { if (errno == EINVAL) { return (LIBUSB20_ERROR_NOT_FOUND); @@ -1056,11 +1060,11 @@ ugen20_root_remove_dev_quirk(struct libu static int ugen20_root_set_template(struct libusb20_backend *pbe, int temp) { - return (ugen20_be_ioctl(USB_SET_TEMPLATE, &temp)); + return (ugen20_be_ioctl(IOUSB(USB_SET_TEMPLATE), &temp)); } static int ugen20_root_get_template(struct libusb20_backend *pbe, int *ptemp) { - return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp)); + return (ugen20_be_ioctl(IOUSB(USB_GET_TEMPLATE), ptemp)); } Modified: user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h ============================================================================== --- user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h Wed Jul 17 17:40:36 2013 (r253432) @@ -29,7 +29,9 @@ #define _XOPEN_SOURCE #define _BSD_SOURCE +#ifdef __linux__ #define _POSIX_SOURCE +#endif #define _POSIX_C_SOURCE 200809 #include @@ -39,10 +41,13 @@ #include #include #include +#ifdef __linux__ #include +#endif #include #include #include +#include #include #include #include @@ -51,6 +56,10 @@ #include #include +#include + +#define IOUSB(a) FBSD_L##a + #ifndef __aligned #define __aligned(x) __attribute__((__aligned__(x))) #endif Modified: user/attilio/vmobj-fullread/lib/msun/src/math.h ============================================================================== --- user/attilio/vmobj-fullread/lib/msun/src/math.h Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/lib/msun/src/math.h Wed Jul 17 17:40:36 2013 (r253432) @@ -83,22 +83,22 @@ extern const union __nan_un { #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ __has_extension(c_generic_selections) -#define __fp_type_select(x, f, d, ld) _Generic((x), \ - float: f(x), \ - double: d(x), \ - long double: ld(x)) +#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ + float: f(x), \ + double: d(x), \ + long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) -#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), double), d(x), \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) +#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), double), d(x), \ + __builtin_choose_expr( \ + __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) #else -#define __fp_type_select(x, f, d, ld) \ - ((sizeof(x) == sizeof(float)) ? f(x) \ - : (sizeof(x) == sizeof(double)) ? d(x) \ - : ld(x)) +#define __fp_type_select(x, f, d, ld) \ + ((sizeof(x) == sizeof(float)) ? f(x) \ + : (sizeof(x) == sizeof(double)) ? d(x) \ + : ld(x)) #endif #define fpclassify(x) \ @@ -189,21 +189,21 @@ int __signbitf(float) __pure2; int __signbitl(long double) __pure2; static __inline int -__inline_isnan(double __x) +__inline_isnan(__const double __x) { return (__x != __x); } static __inline int -__inline_isnanf(float __x) +__inline_isnanf(__const float __x) { return (__x != __x); } static __inline int -__inline_isnanl(long double __x) +__inline_isnanl(__const long double __x) { return (__x != __x); Modified: user/attilio/vmobj-fullread/sbin/mount/mount.8 ============================================================================== --- user/attilio/vmobj-fullread/sbin/mount/mount.8 Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/sbin/mount/mount.8 Wed Jul 17 17:40:36 2013 (r253432) @@ -118,6 +118,9 @@ When used in conjunction with the .Fl a option, also mount those file systems which are marked as .Dq Li late . +.It Fl n +For compatibility with some other implementations, this flag is +currently a no-op. .It Fl o Options are specified with a .Fl o Modified: user/attilio/vmobj-fullread/sbin/mount/mount.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/mount/mount.c Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/sbin/mount/mount.c Wed Jul 17 17:40:36 2013 (r253432) @@ -253,7 +253,7 @@ main(int argc, char *argv[]) options = NULL; vfslist = NULL; vfstype = "ufs"; - while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1) + while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1) switch (ch) { case 'a': all = 1; @@ -274,6 +274,9 @@ main(int argc, char *argv[]) case 'l': late = 1; break; + case 'n': + /* For compatibility with the Linux version of mount. */ + break; case 'o': if (*optarg) { options = catopt(options, optarg); Modified: user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c Wed Jul 17 17:40:36 2013 (r253432) @@ -246,7 +246,7 @@ firmware(int argc, char *argv[]) "slot %d specified but controller only supports %d slots", slot, cdata.frmw.num_slots); - if (!slot_has_valid_firmware(fd, slot)) + if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot)) errx(1, "slot %d does not contain valid firmware,\n" "try 'nvmecontrol logpage -p 3 %s' to get a list " Modified: user/attilio/vmobj-fullread/sbin/route/Makefile ============================================================================== --- user/attilio/vmobj-fullread/sbin/route/Makefile Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/sbin/route/Makefile Wed Jul 17 17:40:36 2013 (r253432) @@ -7,24 +7,21 @@ PROG= route MAN= route.8 SRCS= route.c keywords.h WARNS?= 3 -CLEANFILES+=keywords.h _keywords.tmp +CLEANFILES+=keywords.h CFLAGS+= -DNS - +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DINET +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif - CFLAGS+= -I. keywords.h: keywords - sed -e '/^#/d' -e '/^$$/d' ${.CURDIR}/keywords > _keywords.tmp - LC_ALL=C tr 'a-z' 'A-Z' < _keywords.tmp | paste _keywords.tmp - | \ - awk '{ \ - if (NF > 1) \ - printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ - $$2, NR, $$1, $$2 }' \ - > ${.TARGET} - rm -f _keywords.tmp + LC_ALL=C awk '!/^#|^$$/ { \ + printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \ + toupper($$1), ++L, $$1, toupper($$1); \ + }' < ${.CURDIR}/keywords > ${.TARGET} || (rm -f ${.TARGET}; false) .include Modified: user/attilio/vmobj-fullread/sbin/route/route.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/route/route.c Wed Jul 17 17:35:46 2013 (r253431) +++ user/attilio/vmobj-fullread/sbin/route/route.c Wed Jul 17 17:40:36 2013 (r253432) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct keytab { +static struct keytab { const char *kt_cp; int kt_i; } keywords[] = { @@ -78,42 +78,33 @@ struct keytab { {0, 0} }; -union sockunion { - struct sockaddr sa; - struct sockaddr_in sin; -#ifdef INET6 - struct sockaddr_in6 sin6; -#endif - struct sockaddr_at sat; - struct sockaddr_dl sdl; - struct sockaddr_storage ss; /* added to avoid memory overrun */ -} so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; - -typedef union sockunion *sup; -int pid, rtm_addrs; -int s; -int forcehost, forcenet, doflush, nflag, af, qflag, tflag; -int verbose, aflen = sizeof (struct sockaddr_in); -int locking, lockrest, debugonly; -struct rt_metrics rt_metrics; -u_long rtm_inits; -uid_t uid; +static struct sockaddr_storage so[RTAX_MAX]; +static int pid, rtm_addrs; +static int s; +static int forcehost, forcenet, nflag, af, qflag, tflag; +static int verbose, aflen; +static int locking, lockrest, debugonly; +static struct rt_metrics rt_metrics; +static u_long rtm_inits; +static uid_t uid; static int defaultfib; static int numfibs; static int atalk_aton(const char *, struct at_addr *); static char *atalk_ntoa(struct at_addr); -static void bprintf(FILE *, int, u_char *); +static void printb(int, const char *); static void flushroutes(int argc, char *argv[]); static int flushroutes_fib(int); static int getaddr(int, char *, struct hostent **, int); static int keyword(const char *); -static void inet_makenetandmask(u_long, struct sockaddr_in *, u_long); +#ifdef INET +static void inet_makenetandmask(u_long, struct sockaddr_in *, + struct sockaddr_in *, u_long); +#endif #ifdef INET6 -static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); +static int inet6_makenetandmask(struct sockaddr_in6 *, const char *); #endif static void interfaces(void); -static void mask_addr(void); static void monitor(int, char*[]); static const char *netname(struct sockaddr *); static void newroute(int, char **); @@ -127,9 +118,8 @@ static const char *routename(struct sock static int rtmsg(int, int, int); static void set_metric(char *, int); static int set_sofib(int); -static int set_procfib(int); -static void sockaddr(char *, struct sockaddr *); -static void sodump(sup, const char *); +static void sockaddr(char *, struct sockaddr *, size_t); +static void sodump(struct sockaddr *, const char *); extern char *iso_ntoa(void); struct fibl { @@ -139,7 +129,7 @@ struct fibl { int fl_error; int fl_errno; }; -TAILQ_HEAD(fibl_head_t, fibl) fibl_head; +static TAILQ_HEAD(fibl_head_t, fibl) fibl_head; static int fiboptlist_csv(const char *, struct fibl_head_t *); static int fiboptlist_range(const char *, struct fibl_head_t *); @@ -151,9 +141,7 @@ usage(const char *cp) { if (cp != NULL) warnx("bad keyword: %s", cp); - (void) fprintf(stderr, - "usage: route [-dnqtv] command [[modifiers] args]\n"); - exit(EX_USAGE); + errx(EX_USAGE, "usage: route [-dnqtv] command [[modifiers] args]"); /* NOTREACHED */ } @@ -247,15 +235,6 @@ set_sofib(int fib) } static int -set_procfib(int fib) -{ - - if (fib < 0) - return (0); - return (setfib(fib)); -} - -static int fiboptlist_range(const char *arg, struct fibl_head_t *flh) { struct fibl *fl; @@ -313,6 +292,7 @@ fiboptlist_csv(const char *arg, struct f char *str0, *str, *token, *endptr; int fib, error; + str0 = str = NULL; if (strcmp("all", arg) == 0) { str = calloc(1, ALLSTRLEN); if (str == NULL) { @@ -362,7 +342,8 @@ fiboptlist_csv(const char *arg, struct f } } fiboptlist_csv_ret: - free(str0); + if (str0 != NULL) + free(str0); return (error); } @@ -376,9 +357,8 @@ flushroutes(int argc, char *argv[]) struct fibl *fl; int error; - if (uid != 0 && !debugonly && !tflag) { + if (uid != 0 && !debugonly && !tflag) errx(EX_NOPERM, "must be root to alter routing table"); - } shutdown(s, SHUT_RD); /* Don't want to read back our messages */ TAILQ_INIT(&fibl_head); @@ -388,9 +368,11 @@ flushroutes(int argc, char *argv[]) if (**argv != '-') usage(*argv); switch (keyword(*argv + 1)) { +#ifdef INET case K_INET: af = AF_INET; break; +#endif #ifdef INET6 case K_INET6: af = AF_INET6; @@ -428,11 +410,10 @@ flushroutes_fib(int fib) struct rt_msghdr *rtm; size_t needed; char *buf, *next, *lim; - int mib[6], rlen, seqno, count = 0; + int mib[7], rlen, seqno, count = 0; int error; error = set_sofib(fib); - error += set_procfib(fib); if (error) { warn("fib number %d is ignored", fib); return (error); @@ -442,14 +423,15 @@ retry: mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; /* protocol */ - mib[3] = 0; /* wildcard address family */ + mib[3] = AF_UNSPEC; mib[4] = NET_RT_DUMP; mib[5] = 0; /* no flags */ - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + mib[6] = fib; + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(EX_OSERR, "malloc failed"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) { if (errno == ENOMEM && count++ < 10) { warnx("Routing table grew, retrying"); sleep(1); @@ -460,7 +442,7 @@ retry: } lim = buf + needed; if (verbose) - (void) printf("Examining routing table from sysctl\n"); + (void)printf("Examining routing table from sysctl\n"); seqno = 0; /* ??? */ for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; @@ -483,7 +465,7 @@ retry: err(1, "write to routing socket"); if (rlen < (int)rtm->rtm_msglen) { warn("write to routing socket"); - (void) printf("got only %d for rlen\n", rlen); + (void)printf("got only %d for rlen\n", rlen); free(buf); goto retry; break; @@ -513,7 +495,9 @@ routename(struct sockaddr *sa) { const char *cp; static char line[MAXHOSTNAMELEN + 1]; +#ifdef INET struct hostent *hp; +#endif static char domain[MAXHOSTNAMELEN + 1]; static int first = 1, n; @@ -522,19 +506,22 @@ routename(struct sockaddr *sa) if (gethostname(domain, MAXHOSTNAMELEN) == 0 && (cp = strchr(domain, '.'))) { domain[MAXHOSTNAMELEN] = '\0'; - (void) strcpy(domain, cp + 1); + (void)strcpy(domain, cp + 1); } else - domain[0] = 0; + domain[0] = '\0'; } - if (sa->sa_len == 0) + if (sa->sa_len == 0) { strcpy(line, "default"); - else switch (sa->sa_family) { - + return (line); + } + switch (sa->sa_family) { +#ifdef INET case AF_INET: - { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + { + struct in_addr in; + in = ((struct sockaddr_in *)sa)->sin_addr; cp = NULL; if (in.s_addr == INADDR_ANY || sa->sa_len < 4) cp = "default"; @@ -554,10 +541,11 @@ routename(struct sockaddr *sa) strncpy(line, cp, sizeof(line) - 1); line[sizeof(line) - 1] = '\0'; } else - (void) sprintf(line, "%s", inet_ntoa(in)); + (void)sprintf(line, "%s", inet_ntoa(in)); break; - } + } +#endif #ifdef INET6 case AF_INET6: { @@ -574,17 +562,18 @@ routename(struct sockaddr *sa) line, sizeof(line), NULL, 0, niflags) != 0) strncpy(line, "invalid", sizeof(line)); - return(line); + return (line); } #endif case AF_APPLETALK: - (void) snprintf(line, sizeof(line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); + (void)snprintf(line, sizeof(line), "atalk %s", + atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr)); break; case AF_LINK: return (link_ntoa((struct sockaddr_dl *)sa)); + break; default: { @@ -611,18 +600,21 @@ routename(struct sockaddr *sa) const char * netname(struct sockaddr *sa) { - const char *cp = NULL; static char line[MAXHOSTNAMELEN + 1]; + int n; +#ifdef INET struct netent *np = NULL; + const char *cp = NULL; u_long i; - int n; +#endif switch (sa->sa_family) { - +#ifdef INET case AF_INET: - { struct in_addr in; - in = ((struct sockaddr_in *)sa)->sin_addr; + { + struct in_addr in; + in = ((struct sockaddr_in *)sa)->sin_addr; i = in.s_addr = ntohl(in.s_addr); if (in.s_addr == 0) cp = "default"; @@ -635,30 +627,30 @@ netname(struct sockaddr *sa) if (cp != NULL) strncpy(line, cp, sizeof(line)); else if ((in.s_addr & 0xffffff) == 0) - (void) sprintf(line, "%u", C(in.s_addr >> 24)); + (void)sprintf(line, "%u", C(in.s_addr >> 24)); else if ((in.s_addr & 0xffff) == 0) - (void) sprintf(line, "%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u", C(in.s_addr >> 24), C(in.s_addr >> 16)); else if ((in.s_addr & 0xff) == 0) - (void) sprintf(line, "%u.%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u.%u", C(in.s_addr >> 24), C(in.s_addr >> 16), C(in.s_addr >> 8)); else - (void) sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24), + (void)sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Jul 18 06:31:12 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3CBF43FA; Thu, 18 Jul 2013 06:31:12 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17911945; Thu, 18 Jul 2013 06:31:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6I6VBQ7006562; Thu, 18 Jul 2013 06:31:11 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6I6VBGn006561; Thu, 18 Jul 2013 06:31:11 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307180631.r6I6VBGn006561@svn.freebsd.org> From: Peter Holm Date: Thu, 18 Jul 2013 06:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253446 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2013 06:31:12 -0000 Author: pho Date: Thu Jul 18 06:31:11 2013 New Revision: 253446 URL: http://svnweb.freebsd.org/changeset/base/253446 Log: Added a new test case. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/marcus2.sh (contents, props changed) Added: user/pho/stress2/misc/marcus2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/marcus2.sh Thu Jul 18 06:31:11 2013 (r253446) @@ -0,0 +1,62 @@ +#!/bin/sh + +# +# Copyright (c) 2013 Peter Holm +# 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$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Run with marcus.cfg on a 2g swap backed MD with UFS SU fs. +# Copy of marcus.sh, but with maximum load. + +# "panic: vm_radix_remove: invalid key found" seen. + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 2g -u $mdstart +bsdlabel -w md$mdstart auto +newfs -U md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +export runRUNTIME=20m +export RUNDIR=$mntpoint/stressX + +n=`find ../testcases -perm -1 -type f | wc -l` +m=`su $testuser -c "limits | grep maxprocesses | awk '{print \\$NF}'"` +export INCARNATIONS=$((m / n)) +export swapINCARNATIONS=$INCARNATIONS + +su $testuser -c 'cd ..; ./run.sh marcus.cfg' + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +checkfs /dev/md${mdstart}$part +mdconfig -d -u $mdstart From owner-svn-src-user@FreeBSD.ORG Thu Jul 18 07:43:56 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 17A75DD0; Thu, 18 Jul 2013 07:43:56 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B436C9D; Thu, 18 Jul 2013 07:43:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6I7htTo027759; Thu, 18 Jul 2013 07:43:55 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6I7ht8T027758; Thu, 18 Jul 2013 07:43:55 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201307180743.r6I7ht8T027758@svn.freebsd.org> From: Peter Holm Date: Thu, 18 Jul 2013 07:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253448 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2013 07:43:56 -0000 Author: pho Date: Thu Jul 18 07:43:55 2013 New Revision: 253448 URL: http://svnweb.freebsd.org/changeset/base/253448 Log: Added a new mlockall(2) regression test. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/mlockall3.sh (contents, props changed) Added: user/pho/stress2/misc/mlockall3.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mlockall3.sh Thu Jul 18 07:43:55 2013 (r253448) @@ -0,0 +1,165 @@ +#!/bin/sh + +# +# Copyright (c) 2013 Peter Holm +# 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$ +# + +# mlockall(2) test scenario. +# "panic: vm_page_unwire: page xxx's wire count is zero" seen. +# http://people.freebsd.org/~pho/stress/log/mlockall.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/mlockall3.c +cc -o mlockall3 -Wall -Wextra mlockall3.c -lpthread || exit 1 +rm -f mlockall3.c +cd $odir + +/tmp/mlockall3 + +killall mlockall3 > /dev/null 2>&1 +rm -f /tmp/mlockall3 +exit + +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define N (128 * 1024 / (int)sizeof(u_int32_t)) +u_int32_t r[N]; + +static void +hand(int i __unused) { /* handler */ + _exit(1); +} + +unsigned long +makearg(void) +{ + unsigned int i; + unsigned long val; + + val = arc4random(); + i = arc4random() % 100; + if (i < 20) + val = val & 0xff; + if (i >= 20 && i < 40) + val = val & 0xffff; + if (i >= 40 && i < 60) + val = (unsigned long)(r) | (val & 0xffff); +#if defined(__LP64__) + if (i >= 60) { + val = (val << 32) | arc4random(); + if (i > 80) + val = val & 0x00007fffffffffffUL; + } +#endif + + return(val); +} + +void * +calls(void *arg __unused) +{ + int i; + unsigned long arg1, arg2, arg3; + + usleep(1000); + for (i = 0; i < 500; i++) { + arg1 = makearg(); + arg2 = makearg(); + arg3 = makearg(); + + alarm(1); + syscall(SYS_mlockall, arg1, arg2, arg3); + } + + return (0); +} + +int +main(void) +{ + struct passwd *pw; + pthread_t cp[50]; + int i, j; + + if ((pw = getpwnam("nobody")) == NULL) + err(1, "no such user: nobody"); + + if (setgroups(1, &pw->pw_gid) || + setegid(pw->pw_gid) || setgid(pw->pw_gid) || + seteuid(pw->pw_uid) || setuid(pw->pw_uid)) + err(1, "Can't drop privileges to \"nobody\""); + endpwent(); + + signal(SIGALRM, hand); + signal(SIGILL, hand); + signal(SIGFPE, hand); + signal(SIGSEGV, hand); + signal(SIGBUS, hand); + signal(SIGURG, hand); + signal(SIGSYS, hand); + signal(SIGTRAP, hand); + + alarm(180); + for (i = 0; i < 8000; i++) { + if (fork() == 0) { + arc4random_stir(); + for (j = 0; j < N; j++) + r[j] = arc4random(); + for (j = 0; j < 50; j++) + if (pthread_create(&cp[j], NULL, calls, NULL) != 0) + perror("pthread_create"); + + for (j = 0; j < 50; j++) + pthread_join(cp[j], NULL); + _exit(0); + } + wait(NULL); + } + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 08:14:14 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC984E20; Sat, 20 Jul 2013 08:14:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD00996E; Sat, 20 Jul 2013 08:14:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6K8EEp8065790; Sat, 20 Jul 2013 08:14:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6K8EAOU065756; Sat, 20 Jul 2013 08:14:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307200814.r6K8EAOU065756@svn.freebsd.org> From: Attilio Rao Date: Sat, 20 Jul 2013 08:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253484 - in user/attilio/vmcontention: cddl/contrib/opensolaris/cmd/zpool contrib/binutils/binutils contrib/binutils/include/elf etc lib/libgeom sbin/mount sbin/nvmecontrol sbin/route ... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 08:14:15 -0000 Author: attilio Date: Sat Jul 20 08:14:09 2013 New Revision: 253484 URL: http://svnweb.freebsd.org/changeset/base/253484 Log: MFC Added: user/attilio/vmcontention/sbin/mount/mount.conf.8 - copied unchanged from r253483, head/sbin/mount/mount.conf.8 user/attilio/vmcontention/sys/dev/nvme/nvme_util.c - copied unchanged from r253483, head/sys/dev/nvme/nvme_util.c user/attilio/vmcontention/usr.sbin/bhyve/virtio.c - copied unchanged from r253483, head/usr.sbin/bhyve/virtio.c Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/attilio/vmcontention/contrib/binutils/binutils/readelf.c user/attilio/vmcontention/contrib/binutils/include/elf/common.h user/attilio/vmcontention/etc/network.subr user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c user/attilio/vmcontention/lib/libgeom/libgeom.h user/attilio/vmcontention/sbin/mount/Makefile (contents, props changed) user/attilio/vmcontention/sbin/nvmecontrol/Makefile user/attilio/vmcontention/sbin/nvmecontrol/devlist.c user/attilio/vmcontention/sbin/nvmecontrol/identify.c user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c user/attilio/vmcontention/sbin/route/route.c user/attilio/vmcontention/share/man/man9/bus_dma.9 user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c user/attilio/vmcontention/sys/conf/files.amd64 user/attilio/vmcontention/sys/conf/files.i386 user/attilio/vmcontention/sys/dev/ahci/ahci.c user/attilio/vmcontention/sys/dev/ata/ata-pci.h user/attilio/vmcontention/sys/dev/ata/chipsets/ata-intel.c user/attilio/vmcontention/sys/dev/bge/if_bge.c user/attilio/vmcontention/sys/dev/bge/if_bgereg.h user/attilio/vmcontention/sys/dev/drm2/i915/i915_gem.c user/attilio/vmcontention/sys/dev/ichsmb/ichsmb_pci.c user/attilio/vmcontention/sys/dev/ichwd/ichwd.c user/attilio/vmcontention/sys/dev/ichwd/ichwd.h user/attilio/vmcontention/sys/dev/mii/brgphy.c user/attilio/vmcontention/sys/dev/mii/miidevs user/attilio/vmcontention/sys/dev/mps/mps.c user/attilio/vmcontention/sys/dev/mps/mps_mapping.c user/attilio/vmcontention/sys/dev/mps/mps_pci.c user/attilio/vmcontention/sys/dev/mps/mps_sas.c user/attilio/vmcontention/sys/dev/mps/mps_sas_lsi.c user/attilio/vmcontention/sys/dev/mps/mps_table.c user/attilio/vmcontention/sys/dev/mps/mps_user.c user/attilio/vmcontention/sys/dev/mps/mpsvar.h user/attilio/vmcontention/sys/dev/nvd/nvd.c user/attilio/vmcontention/sys/dev/nvme/nvme.c user/attilio/vmcontention/sys/dev/nvme/nvme.h user/attilio/vmcontention/sys/dev/nvme/nvme_ctrlr.c user/attilio/vmcontention/sys/dev/nvme/nvme_ns.c user/attilio/vmcontention/sys/dev/nvme/nvme_ns_cmd.c user/attilio/vmcontention/sys/dev/pci/pci.c user/attilio/vmcontention/sys/dev/pci/pci_pci.c user/attilio/vmcontention/sys/dev/pci/pci_private.h user/attilio/vmcontention/sys/dev/pci/pcib_private.h user/attilio/vmcontention/sys/dev/syscons/syscons.c user/attilio/vmcontention/sys/dev/usb/usb_pf.c user/attilio/vmcontention/sys/fs/fuse/fuse_kernel.h user/attilio/vmcontention/sys/kern/sysv_shm.c user/attilio/vmcontention/sys/modules/nvme/Makefile user/attilio/vmcontention/sys/netinet/sctp_output.c user/attilio/vmcontention/sys/ofed/drivers/net/mlx4/main.c user/attilio/vmcontention/sys/ofed/include/linux/sysfs.h user/attilio/vmcontention/sys/vm/vm_map.c user/attilio/vmcontention/sys/vm/vm_map.h user/attilio/vmcontention/sys/vm/vm_mmap.c user/attilio/vmcontention/tools/regression/aio/aiop/aiop.c user/attilio/vmcontention/usr.bin/kdump/kdump.c user/attilio/vmcontention/usr.bin/uniq/uniq.c user/attilio/vmcontention/usr.sbin/bhyve/Makefile user/attilio/vmcontention/usr.sbin/bhyve/bhyverun.c user/attilio/vmcontention/usr.sbin/bhyve/pci_virtio_block.c user/attilio/vmcontention/usr.sbin/bhyve/pci_virtio_net.c user/attilio/vmcontention/usr.sbin/bhyve/virtio.h user/attilio/vmcontention/usr.sbin/pciconf/cap.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/binutils/ (props changed) user/attilio/vmcontention/contrib/ipfilter/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/sys/contrib/ipfilter/ (props changed) user/attilio/vmcontention/usr.sbin/bhyve/ (props changed) Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 20 08:14:09 2013 (r253484) @@ -3997,7 +3997,7 @@ print_dedup_stats(nvlist_t *config) /* * If the pool was faulted then we may not have been able to - * obtain the config. Otherwise, if have anything in the dedup + * obtain the config. Otherwise, if we have anything in the dedup * table continue processing the stats. */ if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, Modified: user/attilio/vmcontention/contrib/binutils/binutils/readelf.c ============================================================================== --- user/attilio/vmcontention/contrib/binutils/binutils/readelf.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/contrib/binutils/binutils/readelf.c Sat Jul 20 08:14:09 2013 (r253484) @@ -9103,8 +9103,6 @@ get_note_type (unsigned e_type) return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); - case NT_THRMISC: - return _("NT_THRMISC (thrmisc structure)"); case NT_LWPSTATUS: return _("NT_LWPSTATUS (lwpstatus_t structure)"); case NT_LWPSINFO: @@ -9130,6 +9128,52 @@ get_note_type (unsigned e_type) } static const char * +get_freebsd_note_type (unsigned e_type) +{ + static char buff[64]; + + if (elf_header.e_type == ET_CORE) + switch (e_type) + { + case NT_THRMISC: + return _("NT_THRMISC (thrmisc structure)"); + case NT_PROCSTAT_PROC: + return _("NT_PROCSTAT_PROC (proc data)"); + case NT_PROCSTAT_FILES: + return _("NT_PROCSTAT_FILES (files data)"); + case NT_PROCSTAT_VMMAP: + return _("NT_PROCSTAT_VMMAP (vmmap data)"); + case NT_PROCSTAT_GROUPS: + return _("NT_PROCSTAT_GROUPS (groups data)"); + case NT_PROCSTAT_UMASK: + return _("NT_PROCSTAT_UMASK (umask data)"); + case NT_PROCSTAT_RLIMIT: + return _("NT_PROCSTAT_RLIMIT (rlimit data)"); + case NT_PROCSTAT_OSREL: + return _("NT_PROCSTAT_OSREL (osreldate data)"); + case NT_PROCSTAT_PSSTRINGS: + return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)"); + case NT_PROCSTAT_AUXV: + return _("NT_PROCSTAT_AUXV (auxv data)"); + default: + return get_note_type(e_type); + } + else + switch (e_type) + { + case NT_FREEBSD_ABI_TAG: + return _("NT_FREEBSD_ABI_TAG"); + case NT_FREEBSD_NOINIT_TAG: + return _("NT_FREEBSD_NOINIT_TAG"); + default: + break; + } + + snprintf (buff, sizeof(buff), _("Unknown note type: (0x%08x)"), e_type); + return buff; +} + +static const char * get_netbsd_elfcore_note_type (unsigned e_type) { static char buff[64]; @@ -9206,6 +9250,10 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "FreeBSD")) + /* FreeBSD-specific core file notes. */ + nt = get_freebsd_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */ nt = get_netbsd_elfcore_note_type (pnote->type); @@ -9215,7 +9263,7 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); - printf (" %s\t\t0x%08lx\t%s\n", + printf (" %-13s 0x%08lx\t%s\n", pnote->namesz ? pnote->namedata : "(NONE)", pnote->descsz, nt); return 1; Modified: user/attilio/vmcontention/contrib/binutils/include/elf/common.h ============================================================================== --- user/attilio/vmcontention/contrib/binutils/include/elf/common.h Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/contrib/binutils/include/elf/common.h Sat Jul 20 08:14:09 2013 (r253484) @@ -388,7 +388,6 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ -#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ @@ -401,6 +400,19 @@ #define NT_LWPSINFO 17 /* Has a struct lwpsinfo_t */ #define NT_WIN32PSTATUS 18 /* Has a struct win32_pstatus */ +/* Note segments for core files on FreeBSD systems. Note name + must start with "FreeBSD". */ +#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ +#define NT_PROCSTAT_PROC 8 +#define NT_PROCSTAT_FILES 9 +#define NT_PROCSTAT_VMMAP 10 +#define NT_PROCSTAT_GROUPS 11 +#define NT_PROCSTAT_UMASK 12 +#define NT_PROCSTAT_RLIMIT 13 +#define NT_PROCSTAT_OSREL 14 +#define NT_PROCSTAT_PSSTRINGS 15 +#define NT_PROCSTAT_AUXV 16 + /* Note segments for core files on NetBSD systems. Note name must start with "NetBSD-CORE". */ Modified: user/attilio/vmcontention/etc/network.subr ============================================================================== --- user/attilio/vmcontention/etc/network.subr Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/etc/network.subr Sat Jul 20 08:14:09 2013 (r253484) @@ -1052,16 +1052,12 @@ ifalias_af_common() # ipv6_prefix_hostid_addr_common() { - local _if _action prefix laddr hostid j address + local _if _action prefix j _if=$1 _action=$2 prefix=`get_if_var ${_if} ipv6_prefix_IF` if [ -n "${prefix}" ]; then - laddr=`network6_getladdr ${_if}` - hostid=${laddr#fe80::} - hostid=${hostid%\%*} - for j in ${prefix}; do # The default prefixlen is 64. plen=${j#*/} @@ -1071,18 +1067,10 @@ ipv6_prefix_hostid_addr_common() esac # Normalize the last part by removing ":" - j=${j%:*} + j=${j%::*} j=${j%:} - OIFS=$IFS; IFS=":"; set -- $j; nj=$#; IFS=$OIFS - OIFS=$IFS; IFS=":"; set -- $hostid; nh=$#; IFS=$OIFS - if [ $(($nj + $nh)) -eq 8 ]; then - address=$j\:$hostid - else - address=$j\::$hostid - fi - - ${IFCONFIG_CMD} ${_if} inet6 ${address} \ - prefixlen $plen ${_action} + ${IFCONFIG_CMD} ${_if} inet6 $j:: \ + prefixlen $plen eui64 ${_action} # if I am a router, add subnet router # anycast address (RFC 2373). Modified: user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c ============================================================================== --- user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/lib/libgeom/geom_xml2tree.c Sat Jul 20 08:14:09 2013 (r253484) @@ -282,7 +282,9 @@ EndElement(void *userData, const char *n } if (p != NULL) { +#if DEBUG_LIBGEOM > 0 printf("Unexpected XML: name=%s data=\"%s\"\n", name, p); +#endif free(p); } Modified: user/attilio/vmcontention/lib/libgeom/libgeom.h ============================================================================== --- user/attilio/vmcontention/lib/libgeom/libgeom.h Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/lib/libgeom/libgeom.h Sat Jul 20 08:14:09 2013 (r253484) @@ -40,6 +40,10 @@ __BEGIN_DECLS +#ifndef DEBUG_LIBGEOM +#define DEBUG_LIBGEOM 0 +#endif + void geom_stats_close(void); void geom_stats_resync(void); int geom_stats_open(void); Modified: user/attilio/vmcontention/sbin/mount/Makefile ============================================================================== --- user/attilio/vmcontention/sbin/mount/Makefile Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sbin/mount/Makefile Sat Jul 20 08:14:09 2013 (r253484) @@ -3,7 +3,7 @@ PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -MAN= mount.8 +MAN= mount.8 mount.conf.8 # We do NOT install the getmntopts.3 man page. DPADD= ${LIBUTIL} Copied: user/attilio/vmcontention/sbin/mount/mount.conf.8 (from r253483, head/sbin/mount/mount.conf.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/sbin/mount/mount.conf.8 Sat Jul 20 08:14:09 2013 (r253484, copy of r253483, head/sbin/mount/mount.conf.8) @@ -0,0 +1,252 @@ +.\" Copyright (c) 2013 Marcel Moolenaar +.\" Copyright (c) 2013 Craig Rodrigues +.\" 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 AUTHORS 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 AUTHORS 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$ +.\" +.\" +.Dd July 7, 2013 +.Dt MOUNT.CONF 8 +.Os +.Sh NAME +.Nm mount.conf +.Nd root file system mount configuration file +.Sh SYNOPSIS +.Pa /.mount.conf +.Sh DESCRIPTION +During the bootup process, the +.Fx +kernel will try to mount the root file system +using the logic in the +.Fn vfs_mountroot +function in +.Pa src/sys/kern/vfs_mountroot.c . +The root mount logic can be described as follows: +.Bl -enum +.It +The kernel will synthesize in memory a config file +with default directives for mounting +the root file system. +The logic for this is in +.Fn vfs_mountroot_conf0 . +.It +The kernel will first mount +.Xr devfs 8 +as the root file system. +.It +Next, the kernel will parse the in-memory config file created in step 1 +and try to mount the actual root file system. +See +.Sx FILE FORMAT +for the format of the config file. +.It +When the actual root file system is mounted, +.Xr devfs +will be re-mounted on the +.Pa /dev +directory. +.It +If a +.Pa /.mount.conf +file does not exist in the root file system which was +just mounted, the root mount logic stops here. +.It +If a +.Pa /.mount.conf +file exists in the root file system which was just mounted, +this file will be parsed, and the kernel will use this new config +file to try to re-mount the root file system. +See +.Sx FILE FORMAT +for the format of the config file. +.It +If the new root file system has a +.Pa /.mount +directory, the old root file system will be re-mounted +on +.Pa /.mount . +.It +The root mount logic will go back to step 4. +.El +.Pp +The root mount logic is recursive, and step 8 will +be repeated as long as each new root file system +which is mounted has a +.Pa /.mount.conf +file. +.Sh FILE FORMAT +The kernel parses each line in +.Pa .mount.conf +and then tries to perform the action specified on that line as soon as it is parsed. +.Bl -tag -width "XXXXXXXXXX" +.It Ic # +A line beginning with a # is a comment and is ignored. +.It Ic {FS}:{MOUNTPOINT} {OPTIONS} +The kernel will try to mount this in an +operation equivalent to: +.Bd -literal -offset indent +mount -t {FS} -o {OPTIONS} {MOUNTPOINT} / +.Ed +.Pp +If this is successfully mounted, +further lines in +.Pa .mount.conf +are ignored. +If all lines in +.Pa .mount.conf +have been processed and no root file system has been successfully +mounted, then the action specified by +.Ic .onfail +is performed. +.It Ic .ask +When the kernel processes this line, a +.Li mountroot> +command-line prompt is displayed. +At this prompt, the operator can enter the +the root mount. +.It Ic .md Ar file +Create a memory backed +.Xr md 4 +virtual disk, using +.Ar file +as the backing store. +.It Ic .onfail Ar [panic|reboot|retry|continue] +If after parsing all the lines in +.Pa .mount.conf +the kernel is unable to mount a root file system, +the +.Ic .onfail +directive tells the kernel what action to perform. +.It Ic .timeout Ar N +Before trying to mount a root file system, +if the root mount device does not exist, wait at most +.Ar N +seconds for the device to appear before trying to mount it. +If +.Ic .timeout +is not specified, the default timeout is 3 seconds. +.El +.Sh EXAMPLES +The following example +.Pa .mount.conf +will direct the kernel to try mounting the root file system +first as an ISO CD9660 file system on +.Pa /dev/cd0 , +then if that does not work, as an ISO CD9660 file system on +.Pa /dev/acd0 , +and then if that does not work, as a UFS file system on +.Pa /dev/ada0s1a . +If that does not work, a +.Li mountroot> +command-line prompt will be displayed where the operator +can manually enter the root file system to mount. +Finally if that does not work, the kernel will panic. +.Bd -literal -offset indent +.Li .onfail panic +.Li .timeout 3 +cd9660:/dev/cd0 ro +.Li .timeout 0 +cd9660:/dev/acd0 ro +.Li .timeout 3 +ufs:/dev/ada0s1a +.Li .ask +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to create a +.Xr md 4 +memory disk attached to the file +.Pa /data/OS-1.0.iso +and then mount the ISO CD9660 file system +on the md device which was just created. +The last line is a comment which is ignored. +.Bd -literal -offset indent +.Li .timeout 3 +.Li .md /data/OS-1.0.iso +.Li cd9600:/dev/md# ro +.Li # Can also use cd9660:/dev/md0 ro +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to create a +.Xr md 4 +memory disk attached to the file +.Pa /data/base.ufs.uzip +and then mount the UFS file system +on the md uzip device which was just created +by the +.Xr geom_uzip 4 +driver. +.Bd -literal -offset indent +.Li .md /data/base.ufs.uzip +.Li ufs:/dev/md#.uzip ro +.Li # Can also use ufs:/dev/md0.uzip ro +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to do a unionfs +mount on a directory +.Pa /jail/freebsd-8-stable +which has a +.Xr chroot 2 +environment. +.Bd -literal -offset indent +.Li .timeout 3 +.Li unionfs:/jail/freebsd-8-stable +.Ed +.Sh NOTES +For each root file system which is mounted, a +.Pa /dev +directory +.Em must +exist so that the root mount logic can properly re-mount +.Xr devfs 8 . +If this directory does not exist, the system +may hang during the bootup process. +.Sh SEE ALSO +.Xr nmount 2 , +.Xr md 4 , +.Xr boot.config 5 , +.Xr fstab 5 , +.Xr boot 8 , +.Xr loader 8 , +.Xr mount 8 +.Sh HISTORY +The +.Nm +file first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The root mount logic in the +.Fx +kernel which parses +.Pa /.mount.conf +was written by +.An Marcel Moolenaar Aq marcel@FreeBSD.org . +This man page was written by +.An Craig Rodrigues Aq rodrigc@FreeBSD.org . Modified: user/attilio/vmcontention/sbin/nvmecontrol/Makefile ============================================================================== --- user/attilio/vmcontention/sbin/nvmecontrol/Makefile Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sbin/nvmecontrol/Makefile Sat Jul 20 08:14:09 2013 (r253484) @@ -2,7 +2,9 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c + perftest.c reset.c nvme_util.c MAN= nvmecontrol.8 +.PATH: ${.CURDIR}/../../sys/dev/nvme + .include Modified: user/attilio/vmcontention/sbin/nvmecontrol/devlist.c ============================================================================== --- user/attilio/vmcontention/sbin/nvmecontrol/devlist.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sbin/nvmecontrol/devlist.c Sat Jul 20 08:14:09 2013 (r253484) @@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -51,7 +53,7 @@ static inline uint32_t ns_get_sector_size(struct nvme_namespace_data *nsdata) { - return (1 << nsdata->lbaf[0].lbads); + return (1 << nsdata->lbaf[nsdata->flbas.format].lbads); } void @@ -60,6 +62,7 @@ devlist(int argc, char *argv[]) struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; char name[64]; + uint8_t mn[64]; uint32_t i; int ch, ctrlr, fd, found, ret; @@ -80,8 +83,8 @@ devlist(int argc, char *argv[]) ret = open_dev(name, &fd, 0, 0); if (ret != 0) { - if (fd < 0) { - warnx("could not open /dev/%s\n", name); + if (ret == EACCES) { + warnx("could not open "_PATH_DEV"%s\n", name); continue; } else break; @@ -89,7 +92,8 @@ devlist(int argc, char *argv[]) found++; read_controller_data(fd, &cdata); - printf("%6s: %s\n", name, cdata.mn); + nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); + printf("%6s: %s\n", name, mn); for (i = 0; i < cdata.nn; i++) { sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, Modified: user/attilio/vmcontention/sbin/nvmecontrol/identify.c ============================================================================== --- user/attilio/vmcontention/sbin/nvmecontrol/identify.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sbin/nvmecontrol/identify.c Sat Jul 20 08:14:09 2013 (r253484) @@ -43,13 +43,18 @@ __FBSDID("$FreeBSD$"); static void print_controller(struct nvme_controller_data *cdata) { + uint8_t str[128]; + printf("Controller Capabilities/Features\n"); printf("================================\n"); printf("Vendor ID: %04x\n", cdata->vid); printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - printf("Serial Number: %s\n", cdata->sn); - printf("Model Number: %s\n", cdata->mn); - printf("Firmware Version: %s\n", cdata->fr); + nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); + printf("Serial Number: %s\n", str); + nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); + printf("Model Number: %s\n", str); + nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); + printf("Firmware Version: %s\n", str); printf("Recommended Arb Burst: %d\n", cdata->rab); printf("IEEE OUI Identifier: %02x %02x %02x\n", cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); Modified: user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c Sat Jul 20 08:14:09 2013 (r253484) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -163,7 +164,6 @@ read_namespace_data(int fd, int nsid, st int open_dev(const char *str, int *fd, int show_error, int exit_on_error) { - struct stat devstat; char full_path[64]; if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { @@ -173,19 +173,10 @@ open_dev(const char *str, int *fd, int s if (exit_on_error) exit(1); else - return (1); - } - - snprintf(full_path, sizeof(full_path), "/dev/%s", str); - if (stat(full_path, &devstat) != 0) { - if (show_error) - warn("could not stat %s", full_path); - if (exit_on_error) - exit(1); - else - return (1); + return (EINVAL); } + snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); *fd = open(full_path, O_RDWR); if (*fd < 0) { if (show_error) @@ -193,7 +184,7 @@ open_dev(const char *str, int *fd, int s if (exit_on_error) exit(1); else - return (1); + return (errno); } return (0); Modified: user/attilio/vmcontention/sbin/route/route.c ============================================================================== --- user/attilio/vmcontention/sbin/route/route.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sbin/route/route.c Sat Jul 20 08:14:09 2013 (r253484) @@ -1457,7 +1457,10 @@ rtmsg(int cmd, int flags, int fib) #define NEXTADDR(w, u) \ if (rtm_addrs & (w)) { \ - l = SA_SIZE((struct sockaddr *)&(u)); \ + l = (((struct sockaddr *)&(u))->sa_len == 0) ? \ + sizeof(long) : \ + 1 + ((((struct sockaddr *)&(u))->sa_len - 1) \ + | (sizeof(long) - 1)); \ memmove(cp, (char *)&(u), l); \ cp += l; \ if (verbose) \ Modified: user/attilio/vmcontention/share/man/man9/bus_dma.9 ============================================================================== --- user/attilio/vmcontention/share/man/man9/bus_dma.9 Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/share/man/man9/bus_dma.9 Sat Jul 20 08:14:09 2013 (r253484) @@ -60,7 +60,7 @@ .\" $FreeBSD$ .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ .\" -.Dd May 12, 2009 +.Dd July 17, 2013 .Dt BUS_DMA 9 .Os .Sh NAME @@ -70,6 +70,8 @@ .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , +.Nm bus_dmamap_load_bio , +.Nm bus_dmamap_load_ccb , .Nm bus_dmamap_load_mbuf , .Nm bus_dmamap_load_mbuf_sg , .Nm bus_dmamap_load_uio , @@ -97,6 +99,14 @@ "bus_size_t buflen" "bus_dmamap_callback_t *callback" "void *callback_arg" \ "int flags" .Ft int +.Fn bus_dmamap_load_bio "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"struct bio *bio" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int +.Fn bus_dmamap_load_ccb "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"union ccb *ccb" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int .Fn bus_dmamap_load_mbuf "bus_dma_tag_t dmat" "bus_dmamap_t map" \ "struct mbuf *mbuf" "bus_dmamap_callback2_t *callback" "void *callback_arg" \ "int flags" @@ -199,7 +209,10 @@ Client specified callback for receiving the load of a .Vt bus_dmamap_t via -.Fn bus_dmamap_load . +.Fn bus_dmamap_load , +.Fn bus_dmamap_load_bio +or +.Fn bus_dmamap_load_ccb . Callbacks are of the format: .Bl -tag -width indent .It Ft void @@ -624,6 +637,49 @@ This array is only valid during the scop A mapping could not be achieved within the segment constraints provided in the tag even though the requested allocation size was less than maxsize. .El +.It Fn bus_dmamap_load_bio "dmat" "map" "bio" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps buffers pointed to by +.Fa bio +for DMA transfers. +.Fa bio +may point to either a mapped or unmapped buffer. +.It Fn bus_dmamap_load_ccb "dmat" "map" "ccb" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps data pointed to by +.Fa ccb +for DMA transfers. +The data for +.Fa ccb +may be any of the following types: +.Bl -tag -width ".Er CAM_DATA_SG_PADDR" +.It CAM_DATA_VADDR +The data is a single KVA buffer. +.It CAM_DATA_PADDR +The data is a single bus address range. +.It CAM_DATA_SG +The data is a scatter/gather list of KVA buffers. +.It CAM_DATA_SG_PADDR +The data is a scatter/gather list of bus address ranges. +.It CAM_DATA_BIO +The data is contained in a +.Vt struct bio +attached to the CCB. +.El +.Pp +.Fn bus_dmamap_load_ccb +supports the following CCB XPT function codes: +.Pp +.Bl -item -offset indent -compact +.It +XPT_ATA_IO +.It +XPT_CONT_TARGET_IO +.It +XPT_SCSI_IO +.El .It Fn bus_dmamap_load_mbuf "dmat" "map" "mbuf" "callback2" "callback_arg" \ "flags" This is a variation of @@ -898,12 +954,16 @@ These functions include: .It .Fn bus_dmamap_load .It -.Fn bus_dmamap_load_uio +.Fn bus_dmamap_load_bio +.It +.Fn bus_dmamap_load_ccb .It .Fn bus_dmamap_load_mbuf .It .Fn bus_dmamap_load_mbuf_sg .It +.Fn bus_dmamap_load_uio +.It .Fn bus_dmamap_unload .It .Fn bus_dmamap_sync Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Jul 20 08:14:09 2013 (r253484) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (ashift > vd->vdev_top->vdev_ashift && + vd->vdev_ops->vdev_op_leaf) { + cmn_err(CE_WARN, + "Disk, '%s', has a block alignment that is " + "larger than the pool's alignment\n", + vd->vdev_path); } vd->vdev_max_asize = max_asize; } Modified: user/attilio/vmcontention/sys/conf/files.amd64 ============================================================================== --- user/attilio/vmcontention/sys/conf/files.amd64 Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/conf/files.amd64 Sat Jul 20 08:14:09 2013 (r253484) @@ -234,6 +234,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional random rdrand_rng dev/random/nehemiah.c optional random padlock_rng Modified: user/attilio/vmcontention/sys/conf/files.i386 ============================================================================== --- user/attilio/vmcontention/sys/conf/files.i386 Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/conf/files.i386 Sat Jul 20 08:14:09 2013 (r253484) @@ -243,6 +243,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional random rdrand_rng Modified: user/attilio/vmcontention/sys/dev/ahci/ahci.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ahci/ahci.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/dev/ahci/ahci.c Sat Jul 20 08:14:09 2013 (r253484) @@ -196,6 +196,7 @@ static struct { {0x1e078086, 0x00, "Intel Panther Point", 0}, {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x23a38086, 0x00, "Intel Coleto Creek", 0}, {0x8c028086, 0x00, "Intel Lynx Point", 0}, {0x8c038086, 0x00, "Intel Lynx Point", 0}, {0x8c048086, 0x00, "Intel Lynx Point", 0}, Modified: user/attilio/vmcontention/sys/dev/ata/ata-pci.h ============================================================================== --- user/attilio/vmcontention/sys/dev/ata/ata-pci.h Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/dev/ata/ata-pci.h Sat Jul 20 08:14:09 2013 (r253484) @@ -274,6 +274,10 @@ struct ata_pci_controller { #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 +#define ATA_COLETOCRK_AH1 0x23a38086 +#define ATA_COLETOCRK_S1 0x23a18086 +#define ATA_COLETOCRK_S2 0x23a68086 + #define ATA_ITE_ID 0x1283 #define ATA_IT8211F 0x82111283 #define ATA_IT8212F 0x82121283 Modified: user/attilio/vmcontention/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ata/chipsets/ata-intel.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/dev/ata/chipsets/ata-intel.c Sat Jul 20 08:14:09 2013 (r253484) @@ -226,6 +226,9 @@ ata_intel_probe(device_t dev) { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, + { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_INTEL_ID) Modified: user/attilio/vmcontention/sys/dev/bge/if_bge.c ============================================================================== --- user/attilio/vmcontention/sys/dev/bge/if_bge.c Sat Jul 20 07:58:03 2013 (r253483) +++ user/attilio/vmcontention/sys/dev/bge/if_bge.c Sat Jul 20 08:14:09 2013 (r253484) @@ -176,6 +176,8 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5725 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5727 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -195,6 +197,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5762 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, @@ -310,6 +313,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5762_A0, "BCM5762 A0" }, { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ @@ -354,6 +358,7 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { BGE_ASICREV_BCM5720, "unknown BCM5720" }, + { BGE_ASICREV_BCM5762, "unknown BCM5762" }, { 0, NULL } }; @@ -1796,6 +1801,20 @@ bge_chipinit(struct bge_softc *sc) pci_write_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, val, 2); } + if (sc->bge_asicrev == BGE_ASICREV_BCM57765 || + sc->bge_asicrev == BGE_ASICREV_BCM57766) { + /* + * For the 57766 and non Ax versions of 57765, bootcode + * needs to setup the PCIE Fast Training Sequence (FTS) + * value to prevent transmit hangs. + */ + if (sc->bge_chiprev != BGE_CHIPREV_57765_AX) { + CSR_WRITE_4(sc, BGE_CPMU_PADRNG_CTL, + CSR_READ_4(sc, BGE_CPMU_PADRNG_CTL) | + BGE_CPMU_PADRNG_CTL_RDIV2); + } + } + /* * Set up the PCI DMA control register. */ @@ -1871,8 +1890,9 @@ bge_chipinit(struct bge_softc *sc) * a status tag update and leave interrupts permanently * disabled. */ - if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM57765) + if (!BGE_IS_57765_PLUS(sc) && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5762) dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1881,7 +1901,8 @@ bge_chipinit(struct bge_softc *sc) * Set up general mode register. */ mode_ctl = bge_dma_swap_options(sc); - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { /* Retain Host-2-BMC settings written by APE firmware. */ mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & (BGE_MODECTL_BYTESWAP_B2HRX_DATA | @@ -1939,7 +1960,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t dmactl, val; + uint32_t dmactl, rdmareg, val; int i, limit; /* @@ -2210,6 +2231,11 @@ bge_blockinit(struct bge_softc *sc) if (!BGE_IS_5705_PLUS(sc)) /* 5700 to 5704 had 16 send rings. */ limit = BGE_TX_RINGS_EXTSSRAM_MAX; + else if (BGE_IS_57765_PLUS(sc) || + sc->bge_asicrev == BGE_ASICREV_BCM5762) + limit = 2; + else if (BGE_IS_5717_PLUS(sc)) + limit = 4; else limit = 1; vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB; @@ -2248,6 +2274,7 @@ bge_blockinit(struct bge_softc *sc) } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5762 || BGE_IS_57765_PLUS(sc)) limit = 4; else @@ -2287,7 +2314,8 @@ bge_blockinit(struct bge_softc *sc) /* Set inter-packet gap */ val = 0x2620; - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) val |= CSR_READ_4(sc, BGE_TX_LENGTHS) & (BGE_TXLEN_JMB_FRM_LEN_MSK | BGE_TXLEN_CNT_DN_VAL_MSK); CSR_WRITE_4(sc, BGE_TX_LENGTHS, val); @@ -2451,7 +2479,8 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; /* @@ -2465,14 +2494,18 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || - BGE_IS_5717_PLUS(sc)) { - dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + BGE_IS_5717_PLUS(sc) || BGE_IS_57765_PLUS(sc)) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5762) + rdmareg = BGE_RDMA_RSRVCTRL_REG2; + else + rdmareg = BGE_RDMA_RSRVCTRL; + dmactl = CSR_READ_4(sc, rdmareg); /* * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && - sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + if (sc->bge_chipid == BGE_CHIPID_BCM5719_A0 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2485,7 +2518,7 @@ bge_blockinit(struct bge_softc *sc) * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | + CSR_WRITE_4(sc, rdmareg, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } @@ -2503,6 +2536,11 @@ bge_blockinit(struct bge_softc *sc) CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5762) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2652,6 +2690,9 @@ bge_chipid(device_t dev) case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: + case BCOM_DEVICEID_BCM5725: + case BCOM_DEVICEID_BCM5727: + case BCOM_DEVICEID_BCM5762: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -3327,6 +3368,7 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5762: case BGE_ASICREV_BCM57765: case BGE_ASICREV_BCM57766: sc->bge_flags |= BGE_FLAG_57765_PLUS; @@ -3387,6 +3429,7 @@ bge_attach(device_t dev) case BGE_ASICREV_BCM5719: case BGE_ASICREV_BCM5720: case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5762: sc->bge_flags |= BGE_FLAG_APE; break; } @@ -5451,7 +5494,8 @@ bge_init_locked(struct bge_softc *sc) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 08:19:05 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 730F99D; Sat, 20 Jul 2013 08:19:05 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63CCA988; Sat, 20 Jul 2013 08:19:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6K8J5Cu066881; Sat, 20 Jul 2013 08:19:05 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6K8J1q3066842; Sat, 20 Jul 2013 08:19:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307200819.r6K8J1q3066842@svn.freebsd.org> From: Attilio Rao Date: Sat, 20 Jul 2013 08:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253485 - in user/attilio/vmobj-readlock: cddl/contrib/opensolaris/cmd/zpool contrib/binutils/binutils contrib/binutils/include/elf etc lib/libgeom sbin/mount sbin/nvmecontrol sbin/rout... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 08:19:05 -0000 Author: attilio Date: Sat Jul 20 08:19:00 2013 New Revision: 253485 URL: http://svnweb.freebsd.org/changeset/base/253485 Log: MFC Added: user/attilio/vmobj-readlock/sbin/mount/mount.conf.8 - copied unchanged from r253484, user/attilio/vmcontention/sbin/mount/mount.conf.8 user/attilio/vmobj-readlock/sys/dev/nvme/nvme_util.c - copied unchanged from r253484, user/attilio/vmcontention/sys/dev/nvme/nvme_util.c user/attilio/vmobj-readlock/usr.sbin/bhyve/virtio.c - copied unchanged from r253484, user/attilio/vmcontention/usr.sbin/bhyve/virtio.c Modified: user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h user/attilio/vmobj-readlock/etc/network.subr user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c user/attilio/vmobj-readlock/lib/libgeom/libgeom.h user/attilio/vmobj-readlock/sbin/mount/Makefile (contents, props changed) user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c user/attilio/vmobj-readlock/sbin/route/route.c user/attilio/vmobj-readlock/share/man/man9/bus_dma.9 user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c user/attilio/vmobj-readlock/sys/conf/files.amd64 user/attilio/vmobj-readlock/sys/conf/files.i386 user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c user/attilio/vmobj-readlock/sys/dev/bge/if_bgereg.h user/attilio/vmobj-readlock/sys/dev/drm2/i915/i915_gem.c user/attilio/vmobj-readlock/sys/dev/ichsmb/ichsmb_pci.c user/attilio/vmobj-readlock/sys/dev/ichwd/ichwd.c user/attilio/vmobj-readlock/sys/dev/ichwd/ichwd.h user/attilio/vmobj-readlock/sys/dev/mii/brgphy.c user/attilio/vmobj-readlock/sys/dev/mii/miidevs user/attilio/vmobj-readlock/sys/dev/mps/mps.c user/attilio/vmobj-readlock/sys/dev/mps/mps_mapping.c user/attilio/vmobj-readlock/sys/dev/mps/mps_pci.c user/attilio/vmobj-readlock/sys/dev/mps/mps_sas.c user/attilio/vmobj-readlock/sys/dev/mps/mps_sas_lsi.c user/attilio/vmobj-readlock/sys/dev/mps/mps_table.c user/attilio/vmobj-readlock/sys/dev/mps/mps_user.c user/attilio/vmobj-readlock/sys/dev/mps/mpsvar.h user/attilio/vmobj-readlock/sys/dev/nvd/nvd.c user/attilio/vmobj-readlock/sys/dev/nvme/nvme.c user/attilio/vmobj-readlock/sys/dev/nvme/nvme.h user/attilio/vmobj-readlock/sys/dev/nvme/nvme_ctrlr.c user/attilio/vmobj-readlock/sys/dev/nvme/nvme_ns.c user/attilio/vmobj-readlock/sys/dev/nvme/nvme_ns_cmd.c user/attilio/vmobj-readlock/sys/dev/pci/pci.c user/attilio/vmobj-readlock/sys/dev/pci/pci_pci.c user/attilio/vmobj-readlock/sys/dev/pci/pci_private.h user/attilio/vmobj-readlock/sys/dev/pci/pcib_private.h user/attilio/vmobj-readlock/sys/dev/syscons/syscons.c user/attilio/vmobj-readlock/sys/dev/usb/usb_pf.c user/attilio/vmobj-readlock/sys/fs/fuse/fuse_kernel.h user/attilio/vmobj-readlock/sys/kern/sysv_shm.c user/attilio/vmobj-readlock/sys/modules/nvme/Makefile user/attilio/vmobj-readlock/sys/netinet/sctp_output.c user/attilio/vmobj-readlock/sys/ofed/drivers/net/mlx4/main.c user/attilio/vmobj-readlock/sys/ofed/include/linux/sysfs.h user/attilio/vmobj-readlock/sys/vm/vm_map.c user/attilio/vmobj-readlock/sys/vm/vm_map.h user/attilio/vmobj-readlock/sys/vm/vm_mmap.c user/attilio/vmobj-readlock/tools/regression/aio/aiop/aiop.c user/attilio/vmobj-readlock/usr.bin/kdump/kdump.c user/attilio/vmobj-readlock/usr.bin/uniq/uniq.c user/attilio/vmobj-readlock/usr.sbin/bhyve/Makefile user/attilio/vmobj-readlock/usr.sbin/bhyve/bhyverun.c user/attilio/vmobj-readlock/usr.sbin/bhyve/pci_virtio_block.c user/attilio/vmobj-readlock/usr.sbin/bhyve/pci_virtio_net.c user/attilio/vmobj-readlock/usr.sbin/bhyve/virtio.h user/attilio/vmobj-readlock/usr.sbin/pciconf/cap.c Directory Properties: user/attilio/vmobj-readlock/ (props changed) user/attilio/vmobj-readlock/cddl/ (props changed) user/attilio/vmobj-readlock/cddl/contrib/opensolaris/ (props changed) user/attilio/vmobj-readlock/contrib/binutils/ (props changed) user/attilio/vmobj-readlock/contrib/ipfilter/ (props changed) user/attilio/vmobj-readlock/sbin/ (props changed) user/attilio/vmobj-readlock/sys/ (props changed) user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmobj-readlock/sys/conf/ (props changed) user/attilio/vmobj-readlock/sys/contrib/ipfilter/ (props changed) user/attilio/vmobj-readlock/usr.sbin/bhyve/ (props changed) Modified: user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 20 08:19:00 2013 (r253485) @@ -3997,7 +3997,7 @@ print_dedup_stats(nvlist_t *config) /* * If the pool was faulted then we may not have been able to - * obtain the config. Otherwise, if have anything in the dedup + * obtain the config. Otherwise, if we have anything in the dedup * table continue processing the stats. */ if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, Modified: user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c ============================================================================== --- user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c Sat Jul 20 08:19:00 2013 (r253485) @@ -9103,8 +9103,6 @@ get_note_type (unsigned e_type) return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); - case NT_THRMISC: - return _("NT_THRMISC (thrmisc structure)"); case NT_LWPSTATUS: return _("NT_LWPSTATUS (lwpstatus_t structure)"); case NT_LWPSINFO: @@ -9130,6 +9128,52 @@ get_note_type (unsigned e_type) } static const char * +get_freebsd_note_type (unsigned e_type) +{ + static char buff[64]; + + if (elf_header.e_type == ET_CORE) + switch (e_type) + { + case NT_THRMISC: + return _("NT_THRMISC (thrmisc structure)"); + case NT_PROCSTAT_PROC: + return _("NT_PROCSTAT_PROC (proc data)"); + case NT_PROCSTAT_FILES: + return _("NT_PROCSTAT_FILES (files data)"); + case NT_PROCSTAT_VMMAP: + return _("NT_PROCSTAT_VMMAP (vmmap data)"); + case NT_PROCSTAT_GROUPS: + return _("NT_PROCSTAT_GROUPS (groups data)"); + case NT_PROCSTAT_UMASK: + return _("NT_PROCSTAT_UMASK (umask data)"); + case NT_PROCSTAT_RLIMIT: + return _("NT_PROCSTAT_RLIMIT (rlimit data)"); + case NT_PROCSTAT_OSREL: + return _("NT_PROCSTAT_OSREL (osreldate data)"); + case NT_PROCSTAT_PSSTRINGS: + return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)"); + case NT_PROCSTAT_AUXV: + return _("NT_PROCSTAT_AUXV (auxv data)"); + default: + return get_note_type(e_type); + } + else + switch (e_type) + { + case NT_FREEBSD_ABI_TAG: + return _("NT_FREEBSD_ABI_TAG"); + case NT_FREEBSD_NOINIT_TAG: + return _("NT_FREEBSD_NOINIT_TAG"); + default: + break; + } + + snprintf (buff, sizeof(buff), _("Unknown note type: (0x%08x)"), e_type); + return buff; +} + +static const char * get_netbsd_elfcore_note_type (unsigned e_type) { static char buff[64]; @@ -9206,6 +9250,10 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "FreeBSD")) + /* FreeBSD-specific core file notes. */ + nt = get_freebsd_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */ nt = get_netbsd_elfcore_note_type (pnote->type); @@ -9215,7 +9263,7 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); - printf (" %s\t\t0x%08lx\t%s\n", + printf (" %-13s 0x%08lx\t%s\n", pnote->namesz ? pnote->namedata : "(NONE)", pnote->descsz, nt); return 1; Modified: user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h ============================================================================== --- user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h Sat Jul 20 08:19:00 2013 (r253485) @@ -388,7 +388,6 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ -#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ @@ -401,6 +400,19 @@ #define NT_LWPSINFO 17 /* Has a struct lwpsinfo_t */ #define NT_WIN32PSTATUS 18 /* Has a struct win32_pstatus */ +/* Note segments for core files on FreeBSD systems. Note name + must start with "FreeBSD". */ +#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ +#define NT_PROCSTAT_PROC 8 +#define NT_PROCSTAT_FILES 9 +#define NT_PROCSTAT_VMMAP 10 +#define NT_PROCSTAT_GROUPS 11 +#define NT_PROCSTAT_UMASK 12 +#define NT_PROCSTAT_RLIMIT 13 +#define NT_PROCSTAT_OSREL 14 +#define NT_PROCSTAT_PSSTRINGS 15 +#define NT_PROCSTAT_AUXV 16 + /* Note segments for core files on NetBSD systems. Note name must start with "NetBSD-CORE". */ Modified: user/attilio/vmobj-readlock/etc/network.subr ============================================================================== --- user/attilio/vmobj-readlock/etc/network.subr Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/etc/network.subr Sat Jul 20 08:19:00 2013 (r253485) @@ -1052,16 +1052,12 @@ ifalias_af_common() # ipv6_prefix_hostid_addr_common() { - local _if _action prefix laddr hostid j address + local _if _action prefix j _if=$1 _action=$2 prefix=`get_if_var ${_if} ipv6_prefix_IF` if [ -n "${prefix}" ]; then - laddr=`network6_getladdr ${_if}` - hostid=${laddr#fe80::} - hostid=${hostid%\%*} - for j in ${prefix}; do # The default prefixlen is 64. plen=${j#*/} @@ -1071,18 +1067,10 @@ ipv6_prefix_hostid_addr_common() esac # Normalize the last part by removing ":" - j=${j%:*} + j=${j%::*} j=${j%:} - OIFS=$IFS; IFS=":"; set -- $j; nj=$#; IFS=$OIFS - OIFS=$IFS; IFS=":"; set -- $hostid; nh=$#; IFS=$OIFS - if [ $(($nj + $nh)) -eq 8 ]; then - address=$j\:$hostid - else - address=$j\::$hostid - fi - - ${IFCONFIG_CMD} ${_if} inet6 ${address} \ - prefixlen $plen ${_action} + ${IFCONFIG_CMD} ${_if} inet6 $j:: \ + prefixlen $plen eui64 ${_action} # if I am a router, add subnet router # anycast address (RFC 2373). Modified: user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c ============================================================================== --- user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c Sat Jul 20 08:19:00 2013 (r253485) @@ -282,7 +282,9 @@ EndElement(void *userData, const char *n } if (p != NULL) { +#if DEBUG_LIBGEOM > 0 printf("Unexpected XML: name=%s data=\"%s\"\n", name, p); +#endif free(p); } Modified: user/attilio/vmobj-readlock/lib/libgeom/libgeom.h ============================================================================== --- user/attilio/vmobj-readlock/lib/libgeom/libgeom.h Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/lib/libgeom/libgeom.h Sat Jul 20 08:19:00 2013 (r253485) @@ -40,6 +40,10 @@ __BEGIN_DECLS +#ifndef DEBUG_LIBGEOM +#define DEBUG_LIBGEOM 0 +#endif + void geom_stats_close(void); void geom_stats_resync(void); int geom_stats_open(void); Modified: user/attilio/vmobj-readlock/sbin/mount/Makefile ============================================================================== --- user/attilio/vmobj-readlock/sbin/mount/Makefile Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sbin/mount/Makefile Sat Jul 20 08:19:00 2013 (r253485) @@ -3,7 +3,7 @@ PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -MAN= mount.8 +MAN= mount.8 mount.conf.8 # We do NOT install the getmntopts.3 man page. DPADD= ${LIBUTIL} Copied: user/attilio/vmobj-readlock/sbin/mount/mount.conf.8 (from r253484, user/attilio/vmcontention/sbin/mount/mount.conf.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmobj-readlock/sbin/mount/mount.conf.8 Sat Jul 20 08:19:00 2013 (r253485, copy of r253484, user/attilio/vmcontention/sbin/mount/mount.conf.8) @@ -0,0 +1,252 @@ +.\" Copyright (c) 2013 Marcel Moolenaar +.\" Copyright (c) 2013 Craig Rodrigues +.\" 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 AUTHORS 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 AUTHORS 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$ +.\" +.\" +.Dd July 7, 2013 +.Dt MOUNT.CONF 8 +.Os +.Sh NAME +.Nm mount.conf +.Nd root file system mount configuration file +.Sh SYNOPSIS +.Pa /.mount.conf +.Sh DESCRIPTION +During the bootup process, the +.Fx +kernel will try to mount the root file system +using the logic in the +.Fn vfs_mountroot +function in +.Pa src/sys/kern/vfs_mountroot.c . +The root mount logic can be described as follows: +.Bl -enum +.It +The kernel will synthesize in memory a config file +with default directives for mounting +the root file system. +The logic for this is in +.Fn vfs_mountroot_conf0 . +.It +The kernel will first mount +.Xr devfs 8 +as the root file system. +.It +Next, the kernel will parse the in-memory config file created in step 1 +and try to mount the actual root file system. +See +.Sx FILE FORMAT +for the format of the config file. +.It +When the actual root file system is mounted, +.Xr devfs +will be re-mounted on the +.Pa /dev +directory. +.It +If a +.Pa /.mount.conf +file does not exist in the root file system which was +just mounted, the root mount logic stops here. +.It +If a +.Pa /.mount.conf +file exists in the root file system which was just mounted, +this file will be parsed, and the kernel will use this new config +file to try to re-mount the root file system. +See +.Sx FILE FORMAT +for the format of the config file. +.It +If the new root file system has a +.Pa /.mount +directory, the old root file system will be re-mounted +on +.Pa /.mount . +.It +The root mount logic will go back to step 4. +.El +.Pp +The root mount logic is recursive, and step 8 will +be repeated as long as each new root file system +which is mounted has a +.Pa /.mount.conf +file. +.Sh FILE FORMAT +The kernel parses each line in +.Pa .mount.conf +and then tries to perform the action specified on that line as soon as it is parsed. +.Bl -tag -width "XXXXXXXXXX" +.It Ic # +A line beginning with a # is a comment and is ignored. +.It Ic {FS}:{MOUNTPOINT} {OPTIONS} +The kernel will try to mount this in an +operation equivalent to: +.Bd -literal -offset indent +mount -t {FS} -o {OPTIONS} {MOUNTPOINT} / +.Ed +.Pp +If this is successfully mounted, +further lines in +.Pa .mount.conf +are ignored. +If all lines in +.Pa .mount.conf +have been processed and no root file system has been successfully +mounted, then the action specified by +.Ic .onfail +is performed. +.It Ic .ask +When the kernel processes this line, a +.Li mountroot> +command-line prompt is displayed. +At this prompt, the operator can enter the +the root mount. +.It Ic .md Ar file +Create a memory backed +.Xr md 4 +virtual disk, using +.Ar file +as the backing store. +.It Ic .onfail Ar [panic|reboot|retry|continue] +If after parsing all the lines in +.Pa .mount.conf +the kernel is unable to mount a root file system, +the +.Ic .onfail +directive tells the kernel what action to perform. +.It Ic .timeout Ar N +Before trying to mount a root file system, +if the root mount device does not exist, wait at most +.Ar N +seconds for the device to appear before trying to mount it. +If +.Ic .timeout +is not specified, the default timeout is 3 seconds. +.El +.Sh EXAMPLES +The following example +.Pa .mount.conf +will direct the kernel to try mounting the root file system +first as an ISO CD9660 file system on +.Pa /dev/cd0 , +then if that does not work, as an ISO CD9660 file system on +.Pa /dev/acd0 , +and then if that does not work, as a UFS file system on +.Pa /dev/ada0s1a . +If that does not work, a +.Li mountroot> +command-line prompt will be displayed where the operator +can manually enter the root file system to mount. +Finally if that does not work, the kernel will panic. +.Bd -literal -offset indent +.Li .onfail panic +.Li .timeout 3 +cd9660:/dev/cd0 ro +.Li .timeout 0 +cd9660:/dev/acd0 ro +.Li .timeout 3 +ufs:/dev/ada0s1a +.Li .ask +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to create a +.Xr md 4 +memory disk attached to the file +.Pa /data/OS-1.0.iso +and then mount the ISO CD9660 file system +on the md device which was just created. +The last line is a comment which is ignored. +.Bd -literal -offset indent +.Li .timeout 3 +.Li .md /data/OS-1.0.iso +.Li cd9600:/dev/md# ro +.Li # Can also use cd9660:/dev/md0 ro +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to create a +.Xr md 4 +memory disk attached to the file +.Pa /data/base.ufs.uzip +and then mount the UFS file system +on the md uzip device which was just created +by the +.Xr geom_uzip 4 +driver. +.Bd -literal -offset indent +.Li .md /data/base.ufs.uzip +.Li ufs:/dev/md#.uzip ro +.Li # Can also use ufs:/dev/md0.uzip ro +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to do a unionfs +mount on a directory +.Pa /jail/freebsd-8-stable +which has a +.Xr chroot 2 +environment. +.Bd -literal -offset indent +.Li .timeout 3 +.Li unionfs:/jail/freebsd-8-stable +.Ed +.Sh NOTES +For each root file system which is mounted, a +.Pa /dev +directory +.Em must +exist so that the root mount logic can properly re-mount +.Xr devfs 8 . +If this directory does not exist, the system +may hang during the bootup process. +.Sh SEE ALSO +.Xr nmount 2 , +.Xr md 4 , +.Xr boot.config 5 , +.Xr fstab 5 , +.Xr boot 8 , +.Xr loader 8 , +.Xr mount 8 +.Sh HISTORY +The +.Nm +file first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The root mount logic in the +.Fx +kernel which parses +.Pa /.mount.conf +was written by +.An Marcel Moolenaar Aq marcel@FreeBSD.org . +This man page was written by +.An Craig Rodrigues Aq rodrigc@FreeBSD.org . Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile ============================================================================== --- user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile Sat Jul 20 08:19:00 2013 (r253485) @@ -2,7 +2,9 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c + perftest.c reset.c nvme_util.c MAN= nvmecontrol.8 +.PATH: ${.CURDIR}/../../sys/dev/nvme + .include Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c Sat Jul 20 08:19:00 2013 (r253485) @@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -51,7 +53,7 @@ static inline uint32_t ns_get_sector_size(struct nvme_namespace_data *nsdata) { - return (1 << nsdata->lbaf[0].lbads); + return (1 << nsdata->lbaf[nsdata->flbas.format].lbads); } void @@ -60,6 +62,7 @@ devlist(int argc, char *argv[]) struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; char name[64]; + uint8_t mn[64]; uint32_t i; int ch, ctrlr, fd, found, ret; @@ -80,8 +83,8 @@ devlist(int argc, char *argv[]) ret = open_dev(name, &fd, 0, 0); if (ret != 0) { - if (fd < 0) { - warnx("could not open /dev/%s\n", name); + if (ret == EACCES) { + warnx("could not open "_PATH_DEV"%s\n", name); continue; } else break; @@ -89,7 +92,8 @@ devlist(int argc, char *argv[]) found++; read_controller_data(fd, &cdata); - printf("%6s: %s\n", name, cdata.mn); + nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); + printf("%6s: %s\n", name, mn); for (i = 0; i < cdata.nn; i++) { sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c Sat Jul 20 08:19:00 2013 (r253485) @@ -43,13 +43,18 @@ __FBSDID("$FreeBSD$"); static void print_controller(struct nvme_controller_data *cdata) { + uint8_t str[128]; + printf("Controller Capabilities/Features\n"); printf("================================\n"); printf("Vendor ID: %04x\n", cdata->vid); printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - printf("Serial Number: %s\n", cdata->sn); - printf("Model Number: %s\n", cdata->mn); - printf("Firmware Version: %s\n", cdata->fr); + nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); + printf("Serial Number: %s\n", str); + nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); + printf("Model Number: %s\n", str); + nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); + printf("Firmware Version: %s\n", str); printf("Recommended Arb Burst: %d\n", cdata->rab); printf("IEEE OUI Identifier: %02x %02x %02x\n", cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c Sat Jul 20 08:19:00 2013 (r253485) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -163,7 +164,6 @@ read_namespace_data(int fd, int nsid, st int open_dev(const char *str, int *fd, int show_error, int exit_on_error) { - struct stat devstat; char full_path[64]; if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { @@ -173,19 +173,10 @@ open_dev(const char *str, int *fd, int s if (exit_on_error) exit(1); else - return (1); - } - - snprintf(full_path, sizeof(full_path), "/dev/%s", str); - if (stat(full_path, &devstat) != 0) { - if (show_error) - warn("could not stat %s", full_path); - if (exit_on_error) - exit(1); - else - return (1); + return (EINVAL); } + snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); *fd = open(full_path, O_RDWR); if (*fd < 0) { if (show_error) @@ -193,7 +184,7 @@ open_dev(const char *str, int *fd, int s if (exit_on_error) exit(1); else - return (1); + return (errno); } return (0); Modified: user/attilio/vmobj-readlock/sbin/route/route.c ============================================================================== --- user/attilio/vmobj-readlock/sbin/route/route.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sbin/route/route.c Sat Jul 20 08:19:00 2013 (r253485) @@ -1457,7 +1457,10 @@ rtmsg(int cmd, int flags, int fib) #define NEXTADDR(w, u) \ if (rtm_addrs & (w)) { \ - l = SA_SIZE((struct sockaddr *)&(u)); \ + l = (((struct sockaddr *)&(u))->sa_len == 0) ? \ + sizeof(long) : \ + 1 + ((((struct sockaddr *)&(u))->sa_len - 1) \ + | (sizeof(long) - 1)); \ memmove(cp, (char *)&(u), l); \ cp += l; \ if (verbose) \ Modified: user/attilio/vmobj-readlock/share/man/man9/bus_dma.9 ============================================================================== --- user/attilio/vmobj-readlock/share/man/man9/bus_dma.9 Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/share/man/man9/bus_dma.9 Sat Jul 20 08:19:00 2013 (r253485) @@ -60,7 +60,7 @@ .\" $FreeBSD$ .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ .\" -.Dd May 12, 2009 +.Dd July 17, 2013 .Dt BUS_DMA 9 .Os .Sh NAME @@ -70,6 +70,8 @@ .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , +.Nm bus_dmamap_load_bio , +.Nm bus_dmamap_load_ccb , .Nm bus_dmamap_load_mbuf , .Nm bus_dmamap_load_mbuf_sg , .Nm bus_dmamap_load_uio , @@ -97,6 +99,14 @@ "bus_size_t buflen" "bus_dmamap_callback_t *callback" "void *callback_arg" \ "int flags" .Ft int +.Fn bus_dmamap_load_bio "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"struct bio *bio" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int +.Fn bus_dmamap_load_ccb "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"union ccb *ccb" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int .Fn bus_dmamap_load_mbuf "bus_dma_tag_t dmat" "bus_dmamap_t map" \ "struct mbuf *mbuf" "bus_dmamap_callback2_t *callback" "void *callback_arg" \ "int flags" @@ -199,7 +209,10 @@ Client specified callback for receiving the load of a .Vt bus_dmamap_t via -.Fn bus_dmamap_load . +.Fn bus_dmamap_load , +.Fn bus_dmamap_load_bio +or +.Fn bus_dmamap_load_ccb . Callbacks are of the format: .Bl -tag -width indent .It Ft void @@ -624,6 +637,49 @@ This array is only valid during the scop A mapping could not be achieved within the segment constraints provided in the tag even though the requested allocation size was less than maxsize. .El +.It Fn bus_dmamap_load_bio "dmat" "map" "bio" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps buffers pointed to by +.Fa bio +for DMA transfers. +.Fa bio +may point to either a mapped or unmapped buffer. +.It Fn bus_dmamap_load_ccb "dmat" "map" "ccb" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps data pointed to by +.Fa ccb +for DMA transfers. +The data for +.Fa ccb +may be any of the following types: +.Bl -tag -width ".Er CAM_DATA_SG_PADDR" +.It CAM_DATA_VADDR +The data is a single KVA buffer. +.It CAM_DATA_PADDR +The data is a single bus address range. +.It CAM_DATA_SG +The data is a scatter/gather list of KVA buffers. +.It CAM_DATA_SG_PADDR +The data is a scatter/gather list of bus address ranges. +.It CAM_DATA_BIO +The data is contained in a +.Vt struct bio +attached to the CCB. +.El +.Pp +.Fn bus_dmamap_load_ccb +supports the following CCB XPT function codes: +.Pp +.Bl -item -offset indent -compact +.It +XPT_ATA_IO +.It +XPT_CONT_TARGET_IO +.It +XPT_SCSI_IO +.El .It Fn bus_dmamap_load_mbuf "dmat" "map" "mbuf" "callback2" "callback_arg" \ "flags" This is a variation of @@ -898,12 +954,16 @@ These functions include: .It .Fn bus_dmamap_load .It -.Fn bus_dmamap_load_uio +.Fn bus_dmamap_load_bio +.It +.Fn bus_dmamap_load_ccb .It .Fn bus_dmamap_load_mbuf .It .Fn bus_dmamap_load_mbuf_sg .It +.Fn bus_dmamap_load_uio +.It .Fn bus_dmamap_unload .It .Fn bus_dmamap_sync Modified: user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Jul 20 08:19:00 2013 (r253485) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (ashift > vd->vdev_top->vdev_ashift && + vd->vdev_ops->vdev_op_leaf) { + cmn_err(CE_WARN, + "Disk, '%s', has a block alignment that is " + "larger than the pool's alignment\n", + vd->vdev_path); } vd->vdev_max_asize = max_asize; } Modified: user/attilio/vmobj-readlock/sys/conf/files.amd64 ============================================================================== --- user/attilio/vmobj-readlock/sys/conf/files.amd64 Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/conf/files.amd64 Sat Jul 20 08:19:00 2013 (r253485) @@ -234,6 +234,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional random rdrand_rng dev/random/nehemiah.c optional random padlock_rng Modified: user/attilio/vmobj-readlock/sys/conf/files.i386 ============================================================================== --- user/attilio/vmobj-readlock/sys/conf/files.i386 Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/conf/files.i386 Sat Jul 20 08:19:00 2013 (r253485) @@ -243,6 +243,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional random rdrand_rng Modified: user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c ============================================================================== --- user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c Sat Jul 20 08:19:00 2013 (r253485) @@ -196,6 +196,7 @@ static struct { {0x1e078086, 0x00, "Intel Panther Point", 0}, {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x23a38086, 0x00, "Intel Coleto Creek", 0}, {0x8c028086, 0x00, "Intel Lynx Point", 0}, {0x8c038086, 0x00, "Intel Lynx Point", 0}, {0x8c048086, 0x00, "Intel Lynx Point", 0}, Modified: user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h ============================================================================== --- user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h Sat Jul 20 08:19:00 2013 (r253485) @@ -274,6 +274,10 @@ struct ata_pci_controller { #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 +#define ATA_COLETOCRK_AH1 0x23a38086 +#define ATA_COLETOCRK_S1 0x23a18086 +#define ATA_COLETOCRK_S2 0x23a68086 + #define ATA_ITE_ID 0x1283 #define ATA_IT8211F 0x82111283 #define ATA_IT8212F 0x82121283 Modified: user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c Sat Jul 20 08:19:00 2013 (r253485) @@ -226,6 +226,9 @@ ata_intel_probe(device_t dev) { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, + { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_INTEL_ID) Modified: user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c ============================================================================== --- user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c Sat Jul 20 08:14:09 2013 (r253484) +++ user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c Sat Jul 20 08:19:00 2013 (r253485) @@ -176,6 +176,8 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5725 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5727 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -195,6 +197,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5762 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, @@ -310,6 +313,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5762_A0, "BCM5762 A0" }, { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ @@ -354,6 +358,7 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { BGE_ASICREV_BCM5720, "unknown BCM5720" }, + { BGE_ASICREV_BCM5762, "unknown BCM5762" }, { 0, NULL } }; @@ -1796,6 +1801,20 @@ bge_chipinit(struct bge_softc *sc) pci_write_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, val, 2); } + if (sc->bge_asicrev == BGE_ASICREV_BCM57765 || + sc->bge_asicrev == BGE_ASICREV_BCM57766) { + /* + * For the 57766 and non Ax versions of 57765, bootcode + * needs to setup the PCIE Fast Training Sequence (FTS) + * value to prevent transmit hangs. + */ + if (sc->bge_chiprev != BGE_CHIPREV_57765_AX) { + CSR_WRITE_4(sc, BGE_CPMU_PADRNG_CTL, + CSR_READ_4(sc, BGE_CPMU_PADRNG_CTL) | + BGE_CPMU_PADRNG_CTL_RDIV2); + } + } + /* * Set up the PCI DMA control register. */ @@ -1871,8 +1890,9 @@ bge_chipinit(struct bge_softc *sc) * a status tag update and leave interrupts permanently * disabled. */ - if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM57765) + if (!BGE_IS_57765_PLUS(sc) && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5762) dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1881,7 +1901,8 @@ bge_chipinit(struct bge_softc *sc) * Set up general mode register. */ mode_ctl = bge_dma_swap_options(sc); - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { /* Retain Host-2-BMC settings written by APE firmware. */ mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & (BGE_MODECTL_BYTESWAP_B2HRX_DATA | @@ -1939,7 +1960,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t dmactl, val; + uint32_t dmactl, rdmareg, val; int i, limit; /* @@ -2210,6 +2231,11 @@ bge_blockinit(struct bge_softc *sc) if (!BGE_IS_5705_PLUS(sc)) /* 5700 to 5704 had 16 send rings. */ limit = BGE_TX_RINGS_EXTSSRAM_MAX; + else if (BGE_IS_57765_PLUS(sc) || + sc->bge_asicrev == BGE_ASICREV_BCM5762) + limit = 2; + else if (BGE_IS_5717_PLUS(sc)) + limit = 4; else limit = 1; vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB; @@ -2248,6 +2274,7 @@ bge_blockinit(struct bge_softc *sc) } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5762 || BGE_IS_57765_PLUS(sc)) limit = 4; else @@ -2287,7 +2314,8 @@ bge_blockinit(struct bge_softc *sc) /* Set inter-packet gap */ val = 0x2620; - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) val |= CSR_READ_4(sc, BGE_TX_LENGTHS) & (BGE_TXLEN_JMB_FRM_LEN_MSK | BGE_TXLEN_CNT_DN_VAL_MSK); CSR_WRITE_4(sc, BGE_TX_LENGTHS, val); @@ -2451,7 +2479,8 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; /* @@ -2465,14 +2494,18 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || - BGE_IS_5717_PLUS(sc)) { - dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + BGE_IS_5717_PLUS(sc) || BGE_IS_57765_PLUS(sc)) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5762) + rdmareg = BGE_RDMA_RSRVCTRL_REG2; + else + rdmareg = BGE_RDMA_RSRVCTRL; + dmactl = CSR_READ_4(sc, rdmareg); /* * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && - sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + if (sc->bge_chipid == BGE_CHIPID_BCM5719_A0 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2485,7 +2518,7 @@ bge_blockinit(struct bge_softc *sc) * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | + CSR_WRITE_4(sc, rdmareg, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } @@ -2503,6 +2536,11 @@ bge_blockinit(struct bge_softc *sc) CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5762) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2652,6 +2690,9 @@ bge_chipid(device_t dev) case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: + case BCOM_DEVICEID_BCM5725: + case BCOM_DEVICEID_BCM5727: + case BCOM_DEVICEID_BCM5762: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -3327,6 +3368,7 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5762: case BGE_ASICREV_BCM57765: case BGE_ASICREV_BCM57766: sc->bge_flags |= BGE_FLAG_57765_PLUS; @@ -3387,6 +3429,7 @@ bge_attach(device_t dev) case BGE_ASICREV_BCM5719: case BGE_ASICREV_BCM5720: case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5762: sc->bge_flags |= BGE_FLAG_APE; break; } @@ -5451,7 +5494,8 @@ bge_init_locked(struct bge_softc *sc) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 08:25:08 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8A849267; Sat, 20 Jul 2013 08:25:08 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7AF959B5; Sat, 20 Jul 2013 08:25:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6K8P8p9069771; Sat, 20 Jul 2013 08:25:08 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6K8P4v7069737; Sat, 20 Jul 2013 08:25:04 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307200825.r6K8P4v7069737@svn.freebsd.org> From: Attilio Rao Date: Sat, 20 Jul 2013 08:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253486 - in user/attilio/vmobj-fullread: cddl/contrib/opensolaris/cmd/zpool contrib/binutils/binutils contrib/binutils/include/elf etc lib/libgeom sbin/mount sbin/nvmecontrol sbin/rout... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 08:25:08 -0000 Author: attilio Date: Sat Jul 20 08:25:03 2013 New Revision: 253486 URL: http://svnweb.freebsd.org/changeset/base/253486 Log: MFC Added: user/attilio/vmobj-fullread/sbin/mount/mount.conf.8 - copied unchanged from r253485, user/attilio/vmobj-readlock/sbin/mount/mount.conf.8 user/attilio/vmobj-fullread/sys/dev/nvme/nvme_util.c - copied unchanged from r253485, user/attilio/vmobj-readlock/sys/dev/nvme/nvme_util.c user/attilio/vmobj-fullread/usr.sbin/bhyve/virtio.c - copied unchanged from r253485, user/attilio/vmobj-readlock/usr.sbin/bhyve/virtio.c Modified: user/attilio/vmobj-fullread/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/attilio/vmobj-fullread/contrib/binutils/binutils/readelf.c user/attilio/vmobj-fullread/contrib/binutils/include/elf/common.h user/attilio/vmobj-fullread/etc/network.subr user/attilio/vmobj-fullread/lib/libgeom/geom_xml2tree.c user/attilio/vmobj-fullread/lib/libgeom/libgeom.h user/attilio/vmobj-fullread/sbin/mount/Makefile (contents, props changed) user/attilio/vmobj-fullread/sbin/nvmecontrol/Makefile user/attilio/vmobj-fullread/sbin/nvmecontrol/devlist.c user/attilio/vmobj-fullread/sbin/nvmecontrol/identify.c user/attilio/vmobj-fullread/sbin/nvmecontrol/nvmecontrol.c user/attilio/vmobj-fullread/sbin/route/route.c user/attilio/vmobj-fullread/share/man/man9/bus_dma.9 user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c user/attilio/vmobj-fullread/sys/conf/files.amd64 user/attilio/vmobj-fullread/sys/conf/files.i386 user/attilio/vmobj-fullread/sys/dev/ahci/ahci.c user/attilio/vmobj-fullread/sys/dev/ata/ata-pci.h user/attilio/vmobj-fullread/sys/dev/ata/chipsets/ata-intel.c user/attilio/vmobj-fullread/sys/dev/bge/if_bge.c user/attilio/vmobj-fullread/sys/dev/bge/if_bgereg.h user/attilio/vmobj-fullread/sys/dev/drm2/i915/i915_gem.c user/attilio/vmobj-fullread/sys/dev/ichsmb/ichsmb_pci.c user/attilio/vmobj-fullread/sys/dev/ichwd/ichwd.c user/attilio/vmobj-fullread/sys/dev/ichwd/ichwd.h user/attilio/vmobj-fullread/sys/dev/mii/brgphy.c user/attilio/vmobj-fullread/sys/dev/mii/miidevs user/attilio/vmobj-fullread/sys/dev/mps/mps.c user/attilio/vmobj-fullread/sys/dev/mps/mps_mapping.c user/attilio/vmobj-fullread/sys/dev/mps/mps_pci.c user/attilio/vmobj-fullread/sys/dev/mps/mps_sas.c user/attilio/vmobj-fullread/sys/dev/mps/mps_sas_lsi.c user/attilio/vmobj-fullread/sys/dev/mps/mps_table.c user/attilio/vmobj-fullread/sys/dev/mps/mps_user.c user/attilio/vmobj-fullread/sys/dev/mps/mpsvar.h user/attilio/vmobj-fullread/sys/dev/nvd/nvd.c user/attilio/vmobj-fullread/sys/dev/nvme/nvme.c user/attilio/vmobj-fullread/sys/dev/nvme/nvme.h user/attilio/vmobj-fullread/sys/dev/nvme/nvme_ctrlr.c user/attilio/vmobj-fullread/sys/dev/nvme/nvme_ns.c user/attilio/vmobj-fullread/sys/dev/nvme/nvme_ns_cmd.c user/attilio/vmobj-fullread/sys/dev/pci/pci.c user/attilio/vmobj-fullread/sys/dev/pci/pci_pci.c user/attilio/vmobj-fullread/sys/dev/pci/pci_private.h user/attilio/vmobj-fullread/sys/dev/pci/pcib_private.h user/attilio/vmobj-fullread/sys/dev/syscons/syscons.c user/attilio/vmobj-fullread/sys/dev/usb/usb_pf.c user/attilio/vmobj-fullread/sys/fs/fuse/fuse_kernel.h user/attilio/vmobj-fullread/sys/kern/sysv_shm.c user/attilio/vmobj-fullread/sys/modules/nvme/Makefile user/attilio/vmobj-fullread/sys/netinet/sctp_output.c user/attilio/vmobj-fullread/sys/ofed/drivers/net/mlx4/main.c user/attilio/vmobj-fullread/sys/ofed/include/linux/sysfs.h user/attilio/vmobj-fullread/sys/vm/vm_map.c user/attilio/vmobj-fullread/sys/vm/vm_map.h user/attilio/vmobj-fullread/sys/vm/vm_mmap.c user/attilio/vmobj-fullread/tools/regression/aio/aiop/aiop.c user/attilio/vmobj-fullread/usr.bin/kdump/kdump.c user/attilio/vmobj-fullread/usr.bin/uniq/uniq.c user/attilio/vmobj-fullread/usr.sbin/bhyve/Makefile user/attilio/vmobj-fullread/usr.sbin/bhyve/bhyverun.c user/attilio/vmobj-fullread/usr.sbin/bhyve/pci_virtio_block.c user/attilio/vmobj-fullread/usr.sbin/bhyve/pci_virtio_net.c user/attilio/vmobj-fullread/usr.sbin/bhyve/virtio.h user/attilio/vmobj-fullread/usr.sbin/pciconf/cap.c Directory Properties: user/attilio/vmobj-fullread/ (props changed) user/attilio/vmobj-fullread/cddl/ (props changed) user/attilio/vmobj-fullread/cddl/contrib/opensolaris/ (props changed) user/attilio/vmobj-fullread/contrib/binutils/ (props changed) user/attilio/vmobj-fullread/contrib/ipfilter/ (props changed) user/attilio/vmobj-fullread/sbin/ (props changed) user/attilio/vmobj-fullread/sys/ (props changed) user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmobj-fullread/sys/conf/ (props changed) user/attilio/vmobj-fullread/sys/contrib/ipfilter/ (props changed) user/attilio/vmobj-fullread/usr.sbin/bhyve/ (props changed) Modified: user/attilio/vmobj-fullread/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/attilio/vmobj-fullread/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 20 08:25:03 2013 (r253486) @@ -3997,7 +3997,7 @@ print_dedup_stats(nvlist_t *config) /* * If the pool was faulted then we may not have been able to - * obtain the config. Otherwise, if have anything in the dedup + * obtain the config. Otherwise, if we have anything in the dedup * table continue processing the stats. */ if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, Modified: user/attilio/vmobj-fullread/contrib/binutils/binutils/readelf.c ============================================================================== --- user/attilio/vmobj-fullread/contrib/binutils/binutils/readelf.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/contrib/binutils/binutils/readelf.c Sat Jul 20 08:25:03 2013 (r253486) @@ -9103,8 +9103,6 @@ get_note_type (unsigned e_type) return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); - case NT_THRMISC: - return _("NT_THRMISC (thrmisc structure)"); case NT_LWPSTATUS: return _("NT_LWPSTATUS (lwpstatus_t structure)"); case NT_LWPSINFO: @@ -9130,6 +9128,52 @@ get_note_type (unsigned e_type) } static const char * +get_freebsd_note_type (unsigned e_type) +{ + static char buff[64]; + + if (elf_header.e_type == ET_CORE) + switch (e_type) + { + case NT_THRMISC: + return _("NT_THRMISC (thrmisc structure)"); + case NT_PROCSTAT_PROC: + return _("NT_PROCSTAT_PROC (proc data)"); + case NT_PROCSTAT_FILES: + return _("NT_PROCSTAT_FILES (files data)"); + case NT_PROCSTAT_VMMAP: + return _("NT_PROCSTAT_VMMAP (vmmap data)"); + case NT_PROCSTAT_GROUPS: + return _("NT_PROCSTAT_GROUPS (groups data)"); + case NT_PROCSTAT_UMASK: + return _("NT_PROCSTAT_UMASK (umask data)"); + case NT_PROCSTAT_RLIMIT: + return _("NT_PROCSTAT_RLIMIT (rlimit data)"); + case NT_PROCSTAT_OSREL: + return _("NT_PROCSTAT_OSREL (osreldate data)"); + case NT_PROCSTAT_PSSTRINGS: + return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)"); + case NT_PROCSTAT_AUXV: + return _("NT_PROCSTAT_AUXV (auxv data)"); + default: + return get_note_type(e_type); + } + else + switch (e_type) + { + case NT_FREEBSD_ABI_TAG: + return _("NT_FREEBSD_ABI_TAG"); + case NT_FREEBSD_NOINIT_TAG: + return _("NT_FREEBSD_NOINIT_TAG"); + default: + break; + } + + snprintf (buff, sizeof(buff), _("Unknown note type: (0x%08x)"), e_type); + return buff; +} + +static const char * get_netbsd_elfcore_note_type (unsigned e_type) { static char buff[64]; @@ -9206,6 +9250,10 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "FreeBSD")) + /* FreeBSD-specific core file notes. */ + nt = get_freebsd_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */ nt = get_netbsd_elfcore_note_type (pnote->type); @@ -9215,7 +9263,7 @@ process_note (Elf_Internal_Note *pnote) note type strings. */ nt = get_note_type (pnote->type); - printf (" %s\t\t0x%08lx\t%s\n", + printf (" %-13s 0x%08lx\t%s\n", pnote->namesz ? pnote->namedata : "(NONE)", pnote->descsz, nt); return 1; Modified: user/attilio/vmobj-fullread/contrib/binutils/include/elf/common.h ============================================================================== --- user/attilio/vmobj-fullread/contrib/binutils/include/elf/common.h Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/contrib/binutils/include/elf/common.h Sat Jul 20 08:25:03 2013 (r253486) @@ -388,7 +388,6 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ -#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ @@ -401,6 +400,19 @@ #define NT_LWPSINFO 17 /* Has a struct lwpsinfo_t */ #define NT_WIN32PSTATUS 18 /* Has a struct win32_pstatus */ +/* Note segments for core files on FreeBSD systems. Note name + must start with "FreeBSD". */ +#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ +#define NT_PROCSTAT_PROC 8 +#define NT_PROCSTAT_FILES 9 +#define NT_PROCSTAT_VMMAP 10 +#define NT_PROCSTAT_GROUPS 11 +#define NT_PROCSTAT_UMASK 12 +#define NT_PROCSTAT_RLIMIT 13 +#define NT_PROCSTAT_OSREL 14 +#define NT_PROCSTAT_PSSTRINGS 15 +#define NT_PROCSTAT_AUXV 16 + /* Note segments for core files on NetBSD systems. Note name must start with "NetBSD-CORE". */ Modified: user/attilio/vmobj-fullread/etc/network.subr ============================================================================== --- user/attilio/vmobj-fullread/etc/network.subr Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/etc/network.subr Sat Jul 20 08:25:03 2013 (r253486) @@ -1052,16 +1052,12 @@ ifalias_af_common() # ipv6_prefix_hostid_addr_common() { - local _if _action prefix laddr hostid j address + local _if _action prefix j _if=$1 _action=$2 prefix=`get_if_var ${_if} ipv6_prefix_IF` if [ -n "${prefix}" ]; then - laddr=`network6_getladdr ${_if}` - hostid=${laddr#fe80::} - hostid=${hostid%\%*} - for j in ${prefix}; do # The default prefixlen is 64. plen=${j#*/} @@ -1071,18 +1067,10 @@ ipv6_prefix_hostid_addr_common() esac # Normalize the last part by removing ":" - j=${j%:*} + j=${j%::*} j=${j%:} - OIFS=$IFS; IFS=":"; set -- $j; nj=$#; IFS=$OIFS - OIFS=$IFS; IFS=":"; set -- $hostid; nh=$#; IFS=$OIFS - if [ $(($nj + $nh)) -eq 8 ]; then - address=$j\:$hostid - else - address=$j\::$hostid - fi - - ${IFCONFIG_CMD} ${_if} inet6 ${address} \ - prefixlen $plen ${_action} + ${IFCONFIG_CMD} ${_if} inet6 $j:: \ + prefixlen $plen eui64 ${_action} # if I am a router, add subnet router # anycast address (RFC 2373). Modified: user/attilio/vmobj-fullread/lib/libgeom/geom_xml2tree.c ============================================================================== --- user/attilio/vmobj-fullread/lib/libgeom/geom_xml2tree.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/lib/libgeom/geom_xml2tree.c Sat Jul 20 08:25:03 2013 (r253486) @@ -282,7 +282,9 @@ EndElement(void *userData, const char *n } if (p != NULL) { +#if DEBUG_LIBGEOM > 0 printf("Unexpected XML: name=%s data=\"%s\"\n", name, p); +#endif free(p); } Modified: user/attilio/vmobj-fullread/lib/libgeom/libgeom.h ============================================================================== --- user/attilio/vmobj-fullread/lib/libgeom/libgeom.h Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/lib/libgeom/libgeom.h Sat Jul 20 08:25:03 2013 (r253486) @@ -40,6 +40,10 @@ __BEGIN_DECLS +#ifndef DEBUG_LIBGEOM +#define DEBUG_LIBGEOM 0 +#endif + void geom_stats_close(void); void geom_stats_resync(void); int geom_stats_open(void); Modified: user/attilio/vmobj-fullread/sbin/mount/Makefile ============================================================================== --- user/attilio/vmobj-fullread/sbin/mount/Makefile Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sbin/mount/Makefile Sat Jul 20 08:25:03 2013 (r253486) @@ -3,7 +3,7 @@ PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -MAN= mount.8 +MAN= mount.8 mount.conf.8 # We do NOT install the getmntopts.3 man page. DPADD= ${LIBUTIL} Copied: user/attilio/vmobj-fullread/sbin/mount/mount.conf.8 (from r253485, user/attilio/vmobj-readlock/sbin/mount/mount.conf.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmobj-fullread/sbin/mount/mount.conf.8 Sat Jul 20 08:25:03 2013 (r253486, copy of r253485, user/attilio/vmobj-readlock/sbin/mount/mount.conf.8) @@ -0,0 +1,252 @@ +.\" Copyright (c) 2013 Marcel Moolenaar +.\" Copyright (c) 2013 Craig Rodrigues +.\" 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 AUTHORS 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 AUTHORS 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$ +.\" +.\" +.Dd July 7, 2013 +.Dt MOUNT.CONF 8 +.Os +.Sh NAME +.Nm mount.conf +.Nd root file system mount configuration file +.Sh SYNOPSIS +.Pa /.mount.conf +.Sh DESCRIPTION +During the bootup process, the +.Fx +kernel will try to mount the root file system +using the logic in the +.Fn vfs_mountroot +function in +.Pa src/sys/kern/vfs_mountroot.c . +The root mount logic can be described as follows: +.Bl -enum +.It +The kernel will synthesize in memory a config file +with default directives for mounting +the root file system. +The logic for this is in +.Fn vfs_mountroot_conf0 . +.It +The kernel will first mount +.Xr devfs 8 +as the root file system. +.It +Next, the kernel will parse the in-memory config file created in step 1 +and try to mount the actual root file system. +See +.Sx FILE FORMAT +for the format of the config file. +.It +When the actual root file system is mounted, +.Xr devfs +will be re-mounted on the +.Pa /dev +directory. +.It +If a +.Pa /.mount.conf +file does not exist in the root file system which was +just mounted, the root mount logic stops here. +.It +If a +.Pa /.mount.conf +file exists in the root file system which was just mounted, +this file will be parsed, and the kernel will use this new config +file to try to re-mount the root file system. +See +.Sx FILE FORMAT +for the format of the config file. +.It +If the new root file system has a +.Pa /.mount +directory, the old root file system will be re-mounted +on +.Pa /.mount . +.It +The root mount logic will go back to step 4. +.El +.Pp +The root mount logic is recursive, and step 8 will +be repeated as long as each new root file system +which is mounted has a +.Pa /.mount.conf +file. +.Sh FILE FORMAT +The kernel parses each line in +.Pa .mount.conf +and then tries to perform the action specified on that line as soon as it is parsed. +.Bl -tag -width "XXXXXXXXXX" +.It Ic # +A line beginning with a # is a comment and is ignored. +.It Ic {FS}:{MOUNTPOINT} {OPTIONS} +The kernel will try to mount this in an +operation equivalent to: +.Bd -literal -offset indent +mount -t {FS} -o {OPTIONS} {MOUNTPOINT} / +.Ed +.Pp +If this is successfully mounted, +further lines in +.Pa .mount.conf +are ignored. +If all lines in +.Pa .mount.conf +have been processed and no root file system has been successfully +mounted, then the action specified by +.Ic .onfail +is performed. +.It Ic .ask +When the kernel processes this line, a +.Li mountroot> +command-line prompt is displayed. +At this prompt, the operator can enter the +the root mount. +.It Ic .md Ar file +Create a memory backed +.Xr md 4 +virtual disk, using +.Ar file +as the backing store. +.It Ic .onfail Ar [panic|reboot|retry|continue] +If after parsing all the lines in +.Pa .mount.conf +the kernel is unable to mount a root file system, +the +.Ic .onfail +directive tells the kernel what action to perform. +.It Ic .timeout Ar N +Before trying to mount a root file system, +if the root mount device does not exist, wait at most +.Ar N +seconds for the device to appear before trying to mount it. +If +.Ic .timeout +is not specified, the default timeout is 3 seconds. +.El +.Sh EXAMPLES +The following example +.Pa .mount.conf +will direct the kernel to try mounting the root file system +first as an ISO CD9660 file system on +.Pa /dev/cd0 , +then if that does not work, as an ISO CD9660 file system on +.Pa /dev/acd0 , +and then if that does not work, as a UFS file system on +.Pa /dev/ada0s1a . +If that does not work, a +.Li mountroot> +command-line prompt will be displayed where the operator +can manually enter the root file system to mount. +Finally if that does not work, the kernel will panic. +.Bd -literal -offset indent +.Li .onfail panic +.Li .timeout 3 +cd9660:/dev/cd0 ro +.Li .timeout 0 +cd9660:/dev/acd0 ro +.Li .timeout 3 +ufs:/dev/ada0s1a +.Li .ask +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to create a +.Xr md 4 +memory disk attached to the file +.Pa /data/OS-1.0.iso +and then mount the ISO CD9660 file system +on the md device which was just created. +The last line is a comment which is ignored. +.Bd -literal -offset indent +.Li .timeout 3 +.Li .md /data/OS-1.0.iso +.Li cd9600:/dev/md# ro +.Li # Can also use cd9660:/dev/md0 ro +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to create a +.Xr md 4 +memory disk attached to the file +.Pa /data/base.ufs.uzip +and then mount the UFS file system +on the md uzip device which was just created +by the +.Xr geom_uzip 4 +driver. +.Bd -literal -offset indent +.Li .md /data/base.ufs.uzip +.Li ufs:/dev/md#.uzip ro +.Li # Can also use ufs:/dev/md0.uzip ro +.Ed +.Pp +The following example +.Pa .mount.conf +will direct the kernel to do a unionfs +mount on a directory +.Pa /jail/freebsd-8-stable +which has a +.Xr chroot 2 +environment. +.Bd -literal -offset indent +.Li .timeout 3 +.Li unionfs:/jail/freebsd-8-stable +.Ed +.Sh NOTES +For each root file system which is mounted, a +.Pa /dev +directory +.Em must +exist so that the root mount logic can properly re-mount +.Xr devfs 8 . +If this directory does not exist, the system +may hang during the bootup process. +.Sh SEE ALSO +.Xr nmount 2 , +.Xr md 4 , +.Xr boot.config 5 , +.Xr fstab 5 , +.Xr boot 8 , +.Xr loader 8 , +.Xr mount 8 +.Sh HISTORY +The +.Nm +file first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The root mount logic in the +.Fx +kernel which parses +.Pa /.mount.conf +was written by +.An Marcel Moolenaar Aq marcel@FreeBSD.org . +This man page was written by +.An Craig Rodrigues Aq rodrigc@FreeBSD.org . Modified: user/attilio/vmobj-fullread/sbin/nvmecontrol/Makefile ============================================================================== --- user/attilio/vmobj-fullread/sbin/nvmecontrol/Makefile Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sbin/nvmecontrol/Makefile Sat Jul 20 08:25:03 2013 (r253486) @@ -2,7 +2,9 @@ PROG= nvmecontrol SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ - perftest.c reset.c + perftest.c reset.c nvme_util.c MAN= nvmecontrol.8 +.PATH: ${.CURDIR}/../../sys/dev/nvme + .include Modified: user/attilio/vmobj-fullread/sbin/nvmecontrol/devlist.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/nvmecontrol/devlist.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sbin/nvmecontrol/devlist.c Sat Jul 20 08:25:03 2013 (r253486) @@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -51,7 +53,7 @@ static inline uint32_t ns_get_sector_size(struct nvme_namespace_data *nsdata) { - return (1 << nsdata->lbaf[0].lbads); + return (1 << nsdata->lbaf[nsdata->flbas.format].lbads); } void @@ -60,6 +62,7 @@ devlist(int argc, char *argv[]) struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; char name[64]; + uint8_t mn[64]; uint32_t i; int ch, ctrlr, fd, found, ret; @@ -80,8 +83,8 @@ devlist(int argc, char *argv[]) ret = open_dev(name, &fd, 0, 0); if (ret != 0) { - if (fd < 0) { - warnx("could not open /dev/%s\n", name); + if (ret == EACCES) { + warnx("could not open "_PATH_DEV"%s\n", name); continue; } else break; @@ -89,7 +92,8 @@ devlist(int argc, char *argv[]) found++; read_controller_data(fd, &cdata); - printf("%6s: %s\n", name, cdata.mn); + nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); + printf("%6s: %s\n", name, mn); for (i = 0; i < cdata.nn; i++) { sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, Modified: user/attilio/vmobj-fullread/sbin/nvmecontrol/identify.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/nvmecontrol/identify.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sbin/nvmecontrol/identify.c Sat Jul 20 08:25:03 2013 (r253486) @@ -43,13 +43,18 @@ __FBSDID("$FreeBSD$"); static void print_controller(struct nvme_controller_data *cdata) { + uint8_t str[128]; + printf("Controller Capabilities/Features\n"); printf("================================\n"); printf("Vendor ID: %04x\n", cdata->vid); printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - printf("Serial Number: %s\n", cdata->sn); - printf("Model Number: %s\n", cdata->mn); - printf("Firmware Version: %s\n", cdata->fr); + nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH); + printf("Serial Number: %s\n", str); + nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH); + printf("Model Number: %s\n", str); + nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH); + printf("Firmware Version: %s\n", str); printf("Recommended Arb Burst: %d\n", cdata->rab); printf("IEEE OUI Identifier: %02x %02x %02x\n", cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); Modified: user/attilio/vmobj-fullread/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/nvmecontrol/nvmecontrol.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sbin/nvmecontrol/nvmecontrol.c Sat Jul 20 08:25:03 2013 (r253486) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -163,7 +164,6 @@ read_namespace_data(int fd, int nsid, st int open_dev(const char *str, int *fd, int show_error, int exit_on_error) { - struct stat devstat; char full_path[64]; if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { @@ -173,19 +173,10 @@ open_dev(const char *str, int *fd, int s if (exit_on_error) exit(1); else - return (1); - } - - snprintf(full_path, sizeof(full_path), "/dev/%s", str); - if (stat(full_path, &devstat) != 0) { - if (show_error) - warn("could not stat %s", full_path); - if (exit_on_error) - exit(1); - else - return (1); + return (EINVAL); } + snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str); *fd = open(full_path, O_RDWR); if (*fd < 0) { if (show_error) @@ -193,7 +184,7 @@ open_dev(const char *str, int *fd, int s if (exit_on_error) exit(1); else - return (1); + return (errno); } return (0); Modified: user/attilio/vmobj-fullread/sbin/route/route.c ============================================================================== --- user/attilio/vmobj-fullread/sbin/route/route.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sbin/route/route.c Sat Jul 20 08:25:03 2013 (r253486) @@ -1457,7 +1457,10 @@ rtmsg(int cmd, int flags, int fib) #define NEXTADDR(w, u) \ if (rtm_addrs & (w)) { \ - l = SA_SIZE((struct sockaddr *)&(u)); \ + l = (((struct sockaddr *)&(u))->sa_len == 0) ? \ + sizeof(long) : \ + 1 + ((((struct sockaddr *)&(u))->sa_len - 1) \ + | (sizeof(long) - 1)); \ memmove(cp, (char *)&(u), l); \ cp += l; \ if (verbose) \ Modified: user/attilio/vmobj-fullread/share/man/man9/bus_dma.9 ============================================================================== --- user/attilio/vmobj-fullread/share/man/man9/bus_dma.9 Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/share/man/man9/bus_dma.9 Sat Jul 20 08:25:03 2013 (r253486) @@ -60,7 +60,7 @@ .\" $FreeBSD$ .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $ .\" -.Dd May 12, 2009 +.Dd July 17, 2013 .Dt BUS_DMA 9 .Os .Sh NAME @@ -70,6 +70,8 @@ .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , +.Nm bus_dmamap_load_bio , +.Nm bus_dmamap_load_ccb , .Nm bus_dmamap_load_mbuf , .Nm bus_dmamap_load_mbuf_sg , .Nm bus_dmamap_load_uio , @@ -97,6 +99,14 @@ "bus_size_t buflen" "bus_dmamap_callback_t *callback" "void *callback_arg" \ "int flags" .Ft int +.Fn bus_dmamap_load_bio "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"struct bio *bio" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int +.Fn bus_dmamap_load_ccb "bus_dma_tag_t dmat" "bus_dmamap_t map" \ +"union ccb *ccb" "bus_dmamap_callback_t *callback" "void *callback_arg" \ +"int flags" +.Ft int .Fn bus_dmamap_load_mbuf "bus_dma_tag_t dmat" "bus_dmamap_t map" \ "struct mbuf *mbuf" "bus_dmamap_callback2_t *callback" "void *callback_arg" \ "int flags" @@ -199,7 +209,10 @@ Client specified callback for receiving the load of a .Vt bus_dmamap_t via -.Fn bus_dmamap_load . +.Fn bus_dmamap_load , +.Fn bus_dmamap_load_bio +or +.Fn bus_dmamap_load_ccb . Callbacks are of the format: .Bl -tag -width indent .It Ft void @@ -624,6 +637,49 @@ This array is only valid during the scop A mapping could not be achieved within the segment constraints provided in the tag even though the requested allocation size was less than maxsize. .El +.It Fn bus_dmamap_load_bio "dmat" "map" "bio" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps buffers pointed to by +.Fa bio +for DMA transfers. +.Fa bio +may point to either a mapped or unmapped buffer. +.It Fn bus_dmamap_load_ccb "dmat" "map" "ccb" "callback" "callback_arg" "flags" +This is a variation of +.Fn bus_dmamap_load +which maps data pointed to by +.Fa ccb +for DMA transfers. +The data for +.Fa ccb +may be any of the following types: +.Bl -tag -width ".Er CAM_DATA_SG_PADDR" +.It CAM_DATA_VADDR +The data is a single KVA buffer. +.It CAM_DATA_PADDR +The data is a single bus address range. +.It CAM_DATA_SG +The data is a scatter/gather list of KVA buffers. +.It CAM_DATA_SG_PADDR +The data is a scatter/gather list of bus address ranges. +.It CAM_DATA_BIO +The data is contained in a +.Vt struct bio +attached to the CCB. +.El +.Pp +.Fn bus_dmamap_load_ccb +supports the following CCB XPT function codes: +.Pp +.Bl -item -offset indent -compact +.It +XPT_ATA_IO +.It +XPT_CONT_TARGET_IO +.It +XPT_SCSI_IO +.El .It Fn bus_dmamap_load_mbuf "dmat" "map" "mbuf" "callback2" "callback_arg" \ "flags" This is a variation of @@ -898,12 +954,16 @@ These functions include: .It .Fn bus_dmamap_load .It -.Fn bus_dmamap_load_uio +.Fn bus_dmamap_load_bio +.It +.Fn bus_dmamap_load_ccb .It .Fn bus_dmamap_load_mbuf .It .Fn bus_dmamap_load_mbuf_sg .It +.Fn bus_dmamap_load_uio +.It .Fn bus_dmamap_unload .It .Fn bus_dmamap_sync Modified: user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Sat Jul 20 08:25:03 2013 (r253486) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (ashift > vd->vdev_top->vdev_ashift && + vd->vdev_ops->vdev_op_leaf) { + cmn_err(CE_WARN, + "Disk, '%s', has a block alignment that is " + "larger than the pool's alignment\n", + vd->vdev_path); } vd->vdev_max_asize = max_asize; } Modified: user/attilio/vmobj-fullread/sys/conf/files.amd64 ============================================================================== --- user/attilio/vmobj-fullread/sys/conf/files.amd64 Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/conf/files.amd64 Sat Jul 20 08:25:03 2013 (r253486) @@ -234,6 +234,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional random rdrand_rng dev/random/nehemiah.c optional random padlock_rng Modified: user/attilio/vmobj-fullread/sys/conf/files.i386 ============================================================================== --- user/attilio/vmobj-fullread/sys/conf/files.i386 Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/conf/files.i386 Sat Jul 20 08:25:03 2013 (r253486) @@ -243,6 +243,7 @@ dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional random rdrand_rng Modified: user/attilio/vmobj-fullread/sys/dev/ahci/ahci.c ============================================================================== --- user/attilio/vmobj-fullread/sys/dev/ahci/ahci.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/dev/ahci/ahci.c Sat Jul 20 08:25:03 2013 (r253486) @@ -196,6 +196,7 @@ static struct { {0x1e078086, 0x00, "Intel Panther Point", 0}, {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x23a38086, 0x00, "Intel Coleto Creek", 0}, {0x8c028086, 0x00, "Intel Lynx Point", 0}, {0x8c038086, 0x00, "Intel Lynx Point", 0}, {0x8c048086, 0x00, "Intel Lynx Point", 0}, Modified: user/attilio/vmobj-fullread/sys/dev/ata/ata-pci.h ============================================================================== --- user/attilio/vmobj-fullread/sys/dev/ata/ata-pci.h Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/dev/ata/ata-pci.h Sat Jul 20 08:25:03 2013 (r253486) @@ -274,6 +274,10 @@ struct ata_pci_controller { #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 +#define ATA_COLETOCRK_AH1 0x23a38086 +#define ATA_COLETOCRK_S1 0x23a18086 +#define ATA_COLETOCRK_S2 0x23a68086 + #define ATA_ITE_ID 0x1283 #define ATA_IT8211F 0x82111283 #define ATA_IT8212F 0x82121283 Modified: user/attilio/vmobj-fullread/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- user/attilio/vmobj-fullread/sys/dev/ata/chipsets/ata-intel.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/dev/ata/chipsets/ata-intel.c Sat Jul 20 08:25:03 2013 (r253486) @@ -226,6 +226,9 @@ ata_intel_probe(device_t dev) { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, + { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" }, + { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_INTEL_ID) Modified: user/attilio/vmobj-fullread/sys/dev/bge/if_bge.c ============================================================================== --- user/attilio/vmobj-fullread/sys/dev/bge/if_bge.c Sat Jul 20 08:19:00 2013 (r253485) +++ user/attilio/vmobj-fullread/sys/dev/bge/if_bge.c Sat Jul 20 08:25:03 2013 (r253486) @@ -176,6 +176,8 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5725 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5727 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -195,6 +197,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5762 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, @@ -310,6 +313,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5762_A0, "BCM5762 A0" }, { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ @@ -354,6 +358,7 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { BGE_ASICREV_BCM5720, "unknown BCM5720" }, + { BGE_ASICREV_BCM5762, "unknown BCM5762" }, { 0, NULL } }; @@ -1796,6 +1801,20 @@ bge_chipinit(struct bge_softc *sc) pci_write_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, val, 2); } + if (sc->bge_asicrev == BGE_ASICREV_BCM57765 || + sc->bge_asicrev == BGE_ASICREV_BCM57766) { + /* + * For the 57766 and non Ax versions of 57765, bootcode + * needs to setup the PCIE Fast Training Sequence (FTS) + * value to prevent transmit hangs. + */ + if (sc->bge_chiprev != BGE_CHIPREV_57765_AX) { + CSR_WRITE_4(sc, BGE_CPMU_PADRNG_CTL, + CSR_READ_4(sc, BGE_CPMU_PADRNG_CTL) | + BGE_CPMU_PADRNG_CTL_RDIV2); + } + } + /* * Set up the PCI DMA control register. */ @@ -1871,8 +1890,9 @@ bge_chipinit(struct bge_softc *sc) * a status tag update and leave interrupts permanently * disabled. */ - if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM57765) + if (!BGE_IS_57765_PLUS(sc) && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5762) dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1881,7 +1901,8 @@ bge_chipinit(struct bge_softc *sc) * Set up general mode register. */ mode_ctl = bge_dma_swap_options(sc); - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { /* Retain Host-2-BMC settings written by APE firmware. */ mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) & (BGE_MODECTL_BYTESWAP_B2HRX_DATA | @@ -1939,7 +1960,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t dmactl, val; + uint32_t dmactl, rdmareg, val; int i, limit; /* @@ -2210,6 +2231,11 @@ bge_blockinit(struct bge_softc *sc) if (!BGE_IS_5705_PLUS(sc)) /* 5700 to 5704 had 16 send rings. */ limit = BGE_TX_RINGS_EXTSSRAM_MAX; + else if (BGE_IS_57765_PLUS(sc) || + sc->bge_asicrev == BGE_ASICREV_BCM5762) + limit = 2; + else if (BGE_IS_5717_PLUS(sc)) + limit = 4; else limit = 1; vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB; @@ -2248,6 +2274,7 @@ bge_blockinit(struct bge_softc *sc) } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5762 || BGE_IS_57765_PLUS(sc)) limit = 4; else @@ -2287,7 +2314,8 @@ bge_blockinit(struct bge_softc *sc) /* Set inter-packet gap */ val = 0x2620; - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) val |= CSR_READ_4(sc, BGE_TX_LENGTHS) & (BGE_TXLEN_JMB_FRM_LEN_MSK | BGE_TXLEN_CNT_DN_VAL_MSK); CSR_WRITE_4(sc, BGE_TX_LENGTHS, val); @@ -2451,7 +2479,8 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5720 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; /* @@ -2465,14 +2494,18 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || - BGE_IS_5717_PLUS(sc)) { - dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + BGE_IS_5717_PLUS(sc) || BGE_IS_57765_PLUS(sc)) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5762) + rdmareg = BGE_RDMA_RSRVCTRL_REG2; + else + rdmareg = BGE_RDMA_RSRVCTRL; + dmactl = CSR_READ_4(sc, rdmareg); /* * Adjust tx margin to prevent TX data corruption and * fix internal FIFO overflow. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && - sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + if (sc->bge_chipid == BGE_CHIPID_BCM5719_A0 || + sc->bge_asicrev == BGE_ASICREV_BCM5762) { dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | BGE_RDMA_RSRVCTRL_TXMRGN_MASK); @@ -2485,7 +2518,7 @@ bge_blockinit(struct bge_softc *sc) * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | + CSR_WRITE_4(sc, rdmareg, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } @@ -2503,6 +2536,11 @@ bge_blockinit(struct bge_softc *sc) CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5762) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2652,6 +2690,9 @@ bge_chipid(device_t dev) case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: + case BCOM_DEVICEID_BCM5725: + case BCOM_DEVICEID_BCM5727: + case BCOM_DEVICEID_BCM5762: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -3327,6 +3368,7 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5762: case BGE_ASICREV_BCM57765: case BGE_ASICREV_BCM57766: sc->bge_flags |= BGE_FLAG_57765_PLUS; @@ -3387,6 +3429,7 @@ bge_attach(device_t dev) case BGE_ASICREV_BCM5719: case BGE_ASICREV_BCM5720: case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5762: sc->bge_flags |= BGE_FLAG_APE; break; } @@ -5451,7 +5494,8 @@ bge_init_locked(struct bge_softc *sc) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 08:38:36 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E26653BC; Sat, 20 Jul 2013 08:38:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D41019F8; Sat, 20 Jul 2013 08:38:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6K8cacx073960; Sat, 20 Jul 2013 08:38:36 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6K8cYhv073944; Sat, 20 Jul 2013 08:38:34 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307200838.r6K8cYhv073944@svn.freebsd.org> From: Attilio Rao Date: Sat, 20 Jul 2013 08:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253487 - in user/attilio/vmobj-fullread/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/drm2/i915 fs/tmpfs kern vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 08:38:37 -0000 Author: attilio Date: Sat Jul 20 08:38:34 2013 New Revision: 253487 URL: http://svnweb.freebsd.org/changeset/base/253487 Log: Rework vm_page_sleep_if_busy() and vm_page_grab() to be possibly called with the object lock in read-mode. With the object lock held in read-mode the busy operation must be time-invariant, which means VM_ALLOC_NOBUSY cannot be really passed. Also, in the vm_page_sleep_if_busy() the VM_ALLOC_* flags don't make much sense, maybe these 2 interfaces should grow their own set of flags (and vm_page_grab() internally can play with VM_ALLOC_* flags as appropriate). Sponsored by: EMC / Isilon storage division Tested by: pho Modified: user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/attilio/vmobj-fullread/sys/dev/drm2/i915/i915_gem.c user/attilio/vmobj-fullread/sys/fs/tmpfs/tmpfs_subr.c user/attilio/vmobj-fullread/sys/kern/subr_uio.c user/attilio/vmobj-fullread/sys/kern/uipc_shm.c user/attilio/vmobj-fullread/sys/kern/vfs_bio.c user/attilio/vmobj-fullread/sys/vm/vm_fault.c user/attilio/vmobj-fullread/sys/vm/vm_object.c user/attilio/vmobj-fullread/sys/vm/vm_object.h user/attilio/vmobj-fullread/sys/vm/vm_page.c user/attilio/vmobj-fullread/sys/vm/vm_page.h Modified: user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 20 08:38:34 2013 (r253487) @@ -336,19 +336,9 @@ page_busy(vnode_t *vp, int64_t start, in for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && pp->valid) { - if (vm_page_busy_wlocked(pp)) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_reference(pp); - vm_page_lock(pp); - zfs_vmobject_wunlock(obj); - vm_page_busy_sleep(pp, "zfsmwb"); - zfs_vmobject_wlock(obj); + if (vm_page_sleep_if_busy(pp, "zfsmwb", + VM_ALLOC_NOBUSY, TRUE)) continue; - } vm_page_busy_rlock(pp); } else if (pp == NULL) { if (!alloc) Modified: user/attilio/vmobj-fullread/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- user/attilio/vmobj-fullread/sys/dev/drm2/i915/i915_gem.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/dev/drm2/i915/i915_gem.c Sat Jul 20 08:38:34 2013 (r253487) @@ -2333,7 +2333,8 @@ retry: m = vm_page_lookup(devobj, i); if (m == NULL) continue; - if (vm_page_sleep_if_busy(m, "915unm")) + if (vm_page_sleep_if_busy(m, "915unm", VM_ALLOC_NOBUSY, + FALSE)) goto retry; cdev_pager_free_page(devobj, m); } Modified: user/attilio/vmobj-fullread/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- user/attilio/vmobj-fullread/sys/fs/tmpfs/tmpfs_subr.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/fs/tmpfs/tmpfs_subr.c Sat Jul 20 08:38:34 2013 (r253487) @@ -1331,7 +1331,8 @@ tmpfs_reg_resize(struct vnode *vp, off_t retry: m = vm_page_lookup(uobj, idx); if (m != NULL) { - if (vm_page_sleep_if_busy(m, "tmfssz")) + if (vm_page_sleep_if_busy(m, "tmfssz", + VM_ALLOC_NOBUSY, FALSE)) goto retry; MPASS(m->valid == VM_PAGE_BITS_ALL); } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) { Modified: user/attilio/vmobj-fullread/sys/kern/subr_uio.c ============================================================================== --- user/attilio/vmobj-fullread/sys/kern/subr_uio.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/kern/subr_uio.c Sat Jul 20 08:38:34 2013 (r253487) @@ -107,7 +107,8 @@ vm_pgmoveco(vm_map_t mapa, vm_offset_t k VM_OBJECT_WLOCK(uobject); retry: if ((user_pg = vm_page_lookup(uobject, upindex)) != NULL) { - if (vm_page_sleep_if_busy(user_pg, "vm_pgmoveco")) + if (vm_page_sleep_if_busy(user_pg, "vm_pgmoveco", + VM_ALLOC_NOBUSY, FALSE)) goto retry; vm_page_lock(user_pg); pmap_remove_all(user_pg); Modified: user/attilio/vmobj-fullread/sys/kern/uipc_shm.c ============================================================================== --- user/attilio/vmobj-fullread/sys/kern/uipc_shm.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/kern/uipc_shm.c Sat Jul 20 08:38:34 2013 (r253487) @@ -281,7 +281,8 @@ shm_dotruncate(struct shmfd *shmfd, off_ retry: m = vm_page_lookup(object, idx); if (m != NULL) { - if (vm_page_sleep_if_busy(m, "shmtrc")) + if (vm_page_sleep_if_busy(m, "shmtrc", + VM_ALLOC_NOBUSY, FALSE)) goto retry; } else if (vm_pager_has_page(object, idx, NULL, NULL)) { m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL); Modified: user/attilio/vmobj-fullread/sys/kern/vfs_bio.c ============================================================================== --- user/attilio/vmobj-fullread/sys/kern/vfs_bio.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/kern/vfs_bio.c Sat Jul 20 08:38:34 2013 (r253487) @@ -3444,7 +3444,7 @@ allocbuf(struct buf *bp, int size) KASSERT(m != bogus_page, ("allocbuf: bogus page found")); while (vm_page_sleep_if_busy(m, - "biodep")) + "biodep", VM_ALLOC_NOBUSY, FALSE)) continue; bp->b_pages[i] = NULL; Modified: user/attilio/vmobj-fullread/sys/vm/vm_fault.c ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_fault.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/vm/vm_fault.c Sat Jul 20 08:38:34 2013 (r253487) @@ -392,7 +392,8 @@ RetryFault:; unlock_map(&fs); if (fs.m == vm_page_lookup(fs.object, fs.pindex)) { - vm_page_sleep_if_busy(fs.m, "vmpfw"); + vm_page_sleep_if_busy(fs.m, "vmpfw", + VM_ALLOC_NOBUSY, FALSE); } vm_object_pip_wakeup(fs.object); VM_OBJECT_WUNLOCK(fs.object); Modified: user/attilio/vmobj-fullread/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_object.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/vm/vm_object.c Sat Jul 20 08:38:34 2013 (r253487) @@ -870,7 +870,8 @@ rescan: np = TAILQ_NEXT(p, listq); if (p->valid == 0) continue; - if (vm_page_sleep_if_busy(p, "vpcwai")) { + if (vm_page_sleep_if_busy(p, "vpcwai", VM_ALLOC_NOBUSY, + FALSE)) { if (object->generation != curgeneration) { if ((flags & OBJPC_SYNC) != 0) goto rescan; Modified: user/attilio/vmobj-fullread/sys/vm/vm_object.h ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_object.h Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/vm/vm_object.h Sat Jul 20 08:38:34 2013 (r253487) @@ -226,6 +226,8 @@ extern struct vm_object kmem_object_stor rw_assert(&(object)->lock, RA_WLOCKED) #define VM_OBJECT_LOCK_DOWNGRADE(object) \ rw_downgrade(&(object)->lock) +#define VM_OBJECT_LOCK_TRYUPGRADE(object) \ + rw_try_upgrade(&(object)->lock) #define VM_OBJECT_RLOCK(object) \ rw_rlock(&(object)->lock) #define VM_OBJECT_RUNLOCK(object) \ @@ -238,6 +240,8 @@ extern struct vm_object kmem_object_stor rw_try_wlock(&(object)->lock) #define VM_OBJECT_WLOCK(object) \ rw_wlock(&(object)->lock) +#define VM_OBJECT_WOWNED(object) \ + rw_wowned(&(object)->lock) #define VM_OBJECT_WUNLOCK(object) \ rw_wunlock(&(object)->lock) Modified: user/attilio/vmobj-fullread/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_page.c Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/vm/vm_page.c Sat Jul 20 08:38:34 2013 (r253487) @@ -869,26 +869,53 @@ vm_page_readahead_finish(vm_page_t m) * be locked. */ int -vm_page_sleep_if_busy(vm_page_t m, const char *msg) +vm_page_sleep_if_busy(vm_page_t m, const char *msg, int busyflags, + boolean_t pref) { vm_object_t obj; + int cond, iswowned; vm_page_lock_assert(m, MA_NOTOWNED); - VM_OBJECT_ASSERT_WLOCKED(m->object); - if (vm_page_busy_locked(m)) { + /* + * The page-specific object must be cached because page + * identity can change during the sleep, causing the + * re-lock of a different object. + * It is assumed that a reference to the object is already + * held by the callers. + */ + obj = m->object; + VM_OBJECT_ASSERT_LOCKED(obj); + iswowned = VM_OBJECT_WOWNED(obj); + KASSERT((busyflags & VM_ALLOC_NOBUSY) == 0 || iswowned, + ("vm_page_sleep_if_busy: VM_ALLOC_NOBUSY with read object lock")); + + if ((busyflags & VM_ALLOC_NOBUSY) != 0) { + cond = (busyflags & VM_ALLOC_IGN_RBUSY) != 0 ? + vm_page_busy_wlocked(m) : vm_page_busy_locked(m); + } else if ((busyflags & VM_ALLOC_RBUSY) != 0) + cond = !vm_page_busy_tryrlock(m); + else + cond = !vm_page_busy_trywlock(m); + if (cond) { + /* - * The page-specific object must be cached because page - * identity can change during the sleep, causing the - * re-lock of a different object. - * It is assumed that a reference to the object is already - * held by the callers. + * Some consumers may want to reference the page before + * unlocking and sleeping so that the page daemon is less + * likely to reclaim it. */ - obj = m->object; + if (pref) + vm_page_aflag_set(m, PGA_REFERENCED); vm_page_lock(m); - VM_OBJECT_WUNLOCK(obj); + if (iswowned) + VM_OBJECT_WUNLOCK(obj); + else + VM_OBJECT_RUNLOCK(obj); vm_page_busy_sleep(m, msg); - VM_OBJECT_WLOCK(obj); + if (iswowned) + VM_OBJECT_WLOCK(obj); + else + VM_OBJECT_RLOCK(obj); return (TRUE); } return (FALSE); @@ -2500,44 +2527,44 @@ vm_page_t vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags) { vm_page_t m; - int sleep; + int origwlock; VM_OBJECT_ASSERT_WLOCKED(object); + origwlock = VM_OBJECT_WOWNED(object); KASSERT((allocflags & VM_ALLOC_RETRY) != 0, ("vm_page_grab: VM_ALLOC_RETRY is required")); KASSERT((allocflags & VM_ALLOC_RBUSY) == 0 || (allocflags & VM_ALLOC_IGN_RBUSY) != 0, ("vm_page_grab: VM_ALLOC_RBUSY/VM_ALLOC_IGN_RBUSY mismatch")); + KASSERT((allocflags & VM_ALLOC_NOBUSY) == 0 || origwlock != 0, + ("vm_page_grab: VM_ALLOC_NOBUSY with object read lock")); retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { - sleep = (allocflags & VM_ALLOC_IGN_RBUSY) != 0 ? - vm_page_busy_wlocked(m) : vm_page_busy_locked(m); - if (sleep) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_aflag_set(m, PGA_REFERENCED); - vm_page_lock(m); - VM_OBJECT_WUNLOCK(object); - vm_page_busy_sleep(m, "pgrbwt"); - VM_OBJECT_WLOCK(object); + if (vm_page_sleep_if_busy(m, "pgrbwt", allocflags & + (VM_ALLOC_NOBUSY | VM_ALLOC_RBUSY | VM_ALLOC_IGN_RBUSY), + TRUE)) goto retrylookup; - } else { + else { if ((allocflags & VM_ALLOC_WIRED) != 0) { vm_page_lock(m); vm_page_wire(m); vm_page_unlock(m); } - if ((allocflags & - (VM_ALLOC_NOBUSY | VM_ALLOC_RBUSY)) == 0) - vm_page_busy_wlock(m); - if ((allocflags & VM_ALLOC_RBUSY) != 0) - vm_page_busy_rlock(m); + + /* + * If the lock state changed in the meanwhile, + * unwind back. + */ + if (VM_OBJECT_WOWNED(object) != origwlock) + VM_OBJECT_LOCK_DOWNGRADE(object); return (m); } } + if (!VM_OBJECT_WOWNED(object) && !VM_OBJECT_LOCK_TRYUPGRADE(object)) { + VM_OBJECT_RUNLOCK(object); + VM_OBJECT_WLOCK(object); + goto retrylookup; + } m = vm_page_alloc(object, pindex, allocflags & ~(VM_ALLOC_RETRY | VM_ALLOC_IGN_RBUSY)); if (m == NULL) { @@ -2545,7 +2572,12 @@ retrylookup: VM_WAIT; VM_OBJECT_WLOCK(object); goto retrylookup; - } else if (m->valid != 0) + } + + /* If the lock state changed in the meanwhile, unwind back. */ + if (VM_OBJECT_WOWNED(object) != origwlock) + VM_OBJECT_LOCK_DOWNGRADE(object); + if (m->valid != 0) return (m); if (allocflags & VM_ALLOC_ZERO && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); Modified: user/attilio/vmobj-fullread/sys/vm/vm_page.h ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_page.h Sat Jul 20 08:25:03 2013 (r253486) +++ user/attilio/vmobj-fullread/sys/vm/vm_page.h Sat Jul 20 08:38:34 2013 (r253487) @@ -439,7 +439,8 @@ void vm_page_rename (vm_page_t, vm_objec void vm_page_requeue(vm_page_t m); void vm_page_requeue_locked(vm_page_t m); void vm_page_set_valid_range(vm_page_t m, int base, int size); -int vm_page_sleep_if_busy(vm_page_t m, const char *msg); +int vm_page_sleep_if_busy(vm_page_t m, const char *msg, int busyflags, + boolean_t pref); vm_offset_t vm_page_startup(vm_offset_t vaddr); void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unwire (vm_page_t, int); From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 09:18:49 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C5ED704; Sat, 20 Jul 2013 09:18:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E91EAF4; Sat, 20 Jul 2013 09:18:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6K9ImPL091380; Sat, 20 Jul 2013 09:18:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6K9ImD2091375; Sat, 20 Jul 2013 09:18:48 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201307200918.r6K9ImD2091375@svn.freebsd.org> From: Attilio Rao Date: Sat, 20 Jul 2013 09:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253488 - in user/attilio/vmobj-fullread/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 09:18:49 -0000 Author: attilio Date: Sat Jul 20 09:18:47 2013 New Revision: 253488 URL: http://svnweb.freebsd.org/changeset/base/253488 Log: Remove VM_ALLOC_IGN_RBUSY. Sponsored by: EMC / Isilon storage division Modified: user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/attilio/vmobj-fullread/sys/kern/vfs_bio.c user/attilio/vmobj-fullread/sys/vm/vm_page.c user/attilio/vmobj-fullread/sys/vm/vm_page.h Modified: user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 20 08:38:34 2013 (r253487) +++ user/attilio/vmobj-fullread/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 20 09:18:47 2013 (r253488) @@ -488,7 +488,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u int bytes = MIN(PAGESIZE, len); pp = vm_page_grab(obj, OFF_TO_IDX(start), VM_ALLOC_RBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_IGN_RBUSY); + VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (pp->valid == 0) { zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); Modified: user/attilio/vmobj-fullread/sys/kern/vfs_bio.c ============================================================================== --- user/attilio/vmobj-fullread/sys/kern/vfs_bio.c Sat Jul 20 08:38:34 2013 (r253487) +++ user/attilio/vmobj-fullread/sys/kern/vfs_bio.c Sat Jul 20 09:18:47 2013 (r253488) @@ -3488,9 +3488,9 @@ allocbuf(struct buf *bp, int size) * pages are vfs_busy_pages(). */ m = vm_page_grab(obj, OFF_TO_IDX(bp->b_offset) + - bp->b_npages, VM_ALLOC_NOBUSY | + bp->b_npages, VM_ALLOC_RBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED | - VM_ALLOC_RETRY | VM_ALLOC_IGN_RBUSY | + VM_ALLOC_RETRY | VM_ALLOC_COUNT(desiredpages - bp->b_npages)); if (m->valid == 0) bp->b_flags &= ~B_CACHE; @@ -3535,6 +3535,11 @@ allocbuf(struct buf *bp, int size) toff += tinc; tinc = PAGE_SIZE; } + while ((bp->b_npages - onpages) != 0) { + m = bp->b_pages[onpages]; + vm_page_busy_runlock(m); + ++onpages; + } VM_OBJECT_WUNLOCK(obj); /* Modified: user/attilio/vmobj-fullread/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_page.c Sat Jul 20 08:38:34 2013 (r253487) +++ user/attilio/vmobj-fullread/sys/vm/vm_page.c Sat Jul 20 09:18:47 2013 (r253488) @@ -891,8 +891,7 @@ vm_page_sleep_if_busy(vm_page_t m, const ("vm_page_sleep_if_busy: VM_ALLOC_NOBUSY with read object lock")); if ((busyflags & VM_ALLOC_NOBUSY) != 0) { - cond = (busyflags & VM_ALLOC_IGN_RBUSY) != 0 ? - vm_page_busy_wlocked(m) : vm_page_busy_locked(m); + cond = vm_page_busy_locked(m); } else if ((busyflags & VM_ALLOC_RBUSY) != 0) cond = !vm_page_busy_tryrlock(m); else @@ -2533,16 +2532,12 @@ vm_page_grab(vm_object_t object, vm_pind origwlock = VM_OBJECT_WOWNED(object); KASSERT((allocflags & VM_ALLOC_RETRY) != 0, ("vm_page_grab: VM_ALLOC_RETRY is required")); - KASSERT((allocflags & VM_ALLOC_RBUSY) == 0 || - (allocflags & VM_ALLOC_IGN_RBUSY) != 0, - ("vm_page_grab: VM_ALLOC_RBUSY/VM_ALLOC_IGN_RBUSY mismatch")); KASSERT((allocflags & VM_ALLOC_NOBUSY) == 0 || origwlock != 0, ("vm_page_grab: VM_ALLOC_NOBUSY with object read lock")); retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { if (vm_page_sleep_if_busy(m, "pgrbwt", allocflags & - (VM_ALLOC_NOBUSY | VM_ALLOC_RBUSY | VM_ALLOC_IGN_RBUSY), - TRUE)) + (VM_ALLOC_NOBUSY | VM_ALLOC_RBUSY), TRUE)) goto retrylookup; else { if ((allocflags & VM_ALLOC_WIRED) != 0) { @@ -2565,8 +2560,7 @@ retrylookup: VM_OBJECT_WLOCK(object); goto retrylookup; } - m = vm_page_alloc(object, pindex, allocflags & ~(VM_ALLOC_RETRY | - VM_ALLOC_IGN_RBUSY)); + m = vm_page_alloc(object, pindex, allocflags & ~VM_ALLOC_RETRY); if (m == NULL) { VM_OBJECT_WUNLOCK(object); VM_WAIT; Modified: user/attilio/vmobj-fullread/sys/vm/vm_page.h ============================================================================== --- user/attilio/vmobj-fullread/sys/vm/vm_page.h Sat Jul 20 08:38:34 2013 (r253487) +++ user/attilio/vmobj-fullread/sys/vm/vm_page.h Sat Jul 20 09:18:47 2013 (r253488) @@ -368,7 +368,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa) #define VM_ALLOC_NOBUSY 0x0200 /* Do not busy the page */ #define VM_ALLOC_IFCACHED 0x0400 /* Fail if the page is not cached */ #define VM_ALLOC_IFNOTCACHED 0x0800 /* Fail if the page is cached */ -#define VM_ALLOC_IGN_RBUSY 0x1000 /* vm_page_grab() only */ +#define VM_ALLOC_UNUSED13 0x1000 /* -- available -- */ #define VM_ALLOC_NODUMP 0x2000 /* don't include in dump */ #define VM_ALLOC_RBUSY 0x4000 /* Read busy the page */ From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 13:10:25 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 767DF347; Sat, 20 Jul 2013 13:10:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6984B13C; Sat, 20 Jul 2013 13:10:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KDAP9q075569; Sat, 20 Jul 2013 13:10:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KDAOqH075558; Sat, 20 Jul 2013 13:10:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201310.r6KDAOqH075558@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 13:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253490 - user/nwhitehorn X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 13:10:25 -0000 Author: nwhitehorn Date: Sat Jul 20 13:10:23 2013 New Revision: 253490 URL: http://svnweb.freebsd.org/changeset/base/253490 Log: Experimental scripts for building packages using a cluster set up with sysutils/condor. Core package building should be integrated with poudriere eventually. Added: user/nwhitehorn/buildport.sh (contents, props changed) user/nwhitehorn/buildportsdag.sh (contents, props changed) user/nwhitehorn/fetchandlinks.sh (contents, props changed) user/nwhitehorn/package.sub user/nwhitehorn/prepbuildjail (contents, props changed) user/nwhitehorn/reapbuildjail (contents, props changed) user/nwhitehorn/sudoers Added: user/nwhitehorn/buildport.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/buildport.sh Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,21 @@ +#!/bin/sh + +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin + +port=$1 +pkg=$2 +release=$3 + +scratchdir=$(pwd) + +# Some settings must go in make.conf: +# USE_PACKAGE_DEPENDS=true + +set -e +sudo /pkgscripts/prepbuildjail $_CONDOR_SLOT $release +sudo jexec $_CONDOR_SLOT make -C $port install USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true +sudo jexec $_CONDOR_SLOT make -C $port package PKGREPOSITORY=/packages BATCH=true WRKDIRPREFIX=/obj NO_LATEST_LINK=true PKGFILE=/packages/$pkg +cp /scratch/$_CONDOR_SLOT/packages/$pkg $scratchdir/$pkg +sudo /pkgscripts/reapbuildjail $_CONDOR_SLOT +set +e + Added: user/nwhitehorn/buildportsdag.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/buildportsdag.sh Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,26 @@ +#!/bin/sh +PORTSDIR=/usr/ports +PKGSDIR=/usr/ports/packages +#(cd $PORTSDIR && make index) +ports="$(cut -f 2 -d '|' $PORTSDIR/INDEX-`uname -r | cut -f 1 -d .`)" +ports="/usr/ports/games/sl /usr/ports/ports-mgmt/pkg /usr/ports/japanese/nkf" +dagjobs=$(pwd)/ports.dagjobs +dagdeps=$(pwd)/ports.dagdeps +dag=$(pwd)/ports.dag +rm -f $dagjobs $dagdeps +for job in $ports; do + cd $job + echo JOB $job package.sub >> $dagjobs + # One fetch for all archs with dummy fetch job? UNAME_p etc. + echo SCRIPT PRE $job fetchandlinks.sh $job $PKGSDIR >> $dagjobs + echo VARS $job port=\"$job\" >> $dagjobs + echo VARS $job pkg=\"`make package-name`.txz\" >> $dagjobs + echo VARS $job pkgdir=\"$PKGSDIR/All\" >> $dagjobs + deps=$(make all-depends-list) + if [ ! -z "$deps" ]; then + echo PARENT $deps CHILD $job >> $dagdeps + fi +done + +cat $dagjobs $dagdeps > $dag +rm -f $dagjobs $dagdeps Added: user/nwhitehorn/fetchandlinks.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/fetchandlinks.sh Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e +cd $1 +make fetch +make package-links PACKAGES=$2 +mkdir -p $2/All +set +e + Added: user/nwhitehorn/package.sub ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/package.sub Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,18 @@ +executable = buildport.sh +universe = vanilla +notification = never # failure? + +requirements = Arch == "X86_64" && OpSys == "FREEBSD" +#requirements = Arch == "powerpc" && OpSys == "FREEBSD" + +log=/tmp/condorlog +output=logs/$(pkg).out +error=logs/$(pkg).err + +should_transfer_files=YES +when_to_transfer_output=ON_EXIT +#transfer_output_files=$(pkg) +transfer_output_remaps="$(pkg)=$(pkgdir)/$(pkg)" + +arguments= $(port) $(pkg) release +queue Added: user/nwhitehorn/prepbuildjail ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/prepbuildjail Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,41 @@ +#!/bin/sh +slot=$1 +release=$2 + +#Audit slot and release names +case $slot in + *[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1 +esac +case $release in + *[^a-zA-Z0-9]* ) echo "Non-alphanumeric release $release"; exit 1 +esac +if [ -z "$slot" -o -z "$release" ]; then + echo "Zero-length slot or release" + exit 1 +fi + +if [ -d /scratch/$slot ]; then + echo "Pre-existing file system for this slot!" + /pkgscripts/reapbuildjail $slot +fi + +cleanup() { + /pkgscripts/reapbuildjail $slot +} + +set -e +trap cleanup EXIT + +. /etc/rc.subr + +mkdir -p /scratch/$slot +#mount_unionfs -o below /releases/$release /scratch/$slot +#mount_nullfs -o ro /ports /scratch/$slot/ports +mount_unionfs -o below /scratch/$release /scratch/$slot +mount_nullfs -o ro /usr/ports /scratch/$slot/usr/ports +ls /scratch/$slot/usr/ports > /dev/null # Hack around bug in nullfs +devfs_mount_jail /scratch/$slot/dev 4 && mounts="/scratch/$slot/dev $mounts" + +jail -c name=$slot path=/scratch/$slot host.hostname=$slot.`hostname` persist=true +trap true EXIT + Added: user/nwhitehorn/reapbuildjail ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/reapbuildjail Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,27 @@ +#!/bin/sh +slot=$1 + +#Audit slot and release names +case $slot in + *[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1 +esac +if [ -z "$slot" ]; then + echo "Zero-length slot or release" + exit 1 +fi + +if [ ! -d /scratch/$slot ]; then + echo "No file system for slot!" + exit 1 +fi + +set +e +jail -r $slot +umount -f /scratch/$slot/dev +#umount -f /scratch/$slot/ports +umount -f /scratch/$slot/usr/ports +umount -f /scratch/$slot +chflags -R noschg /scratch/$slot +rm -rf /scratch/$slot +set +e + Added: user/nwhitehorn/sudoers ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/sudoers Sat Jul 20 13:10:23 2013 (r253490) @@ -0,0 +1,4 @@ +# User privilege specification +root ALL=(ALL) ALL + +pkgbuild ALL=NOPASSWD: /pkgscripts/prepbuildjail,/pkgscripts/reapbuildjail,/usr/sbin/jexec From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 13:12:15 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CB09B42F; Sat, 20 Jul 2013 13:12:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2E83144; Sat, 20 Jul 2013 13:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KDCFDS077526; Sat, 20 Jul 2013 13:12:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KDCFsc077525; Sat, 20 Jul 2013 13:12:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201312.r6KDCFsc077525@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 13:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253491 - user/nwhitehorn/ps3 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 13:12:15 -0000 Author: nwhitehorn Date: Sat Jul 20 13:12:15 2013 New Revision: 253491 URL: http://svnweb.freebsd.org/changeset/base/253491 Log: Garbage-collect long-merged branch. Deleted: user/nwhitehorn/ps3/ From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 13:13:30 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C65A86A0; Sat, 20 Jul 2013 13:13:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A903A14A; Sat, 20 Jul 2013 13:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KDDUlj077836; Sat, 20 Jul 2013 13:13:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KDDTZt077825; Sat, 20 Jul 2013 13:13:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201313.r6KDDTZt077825@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 13:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253492 - in user/nwhitehorn: . condorports X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 13:13:30 -0000 Author: nwhitehorn Date: Sat Jul 20 13:13:28 2013 New Revision: 253492 URL: http://svnweb.freebsd.org/changeset/base/253492 Log: Hoist condorports up a directory since I screwed up the svn import. Added: user/nwhitehorn/condorports/ user/nwhitehorn/condorports/buildport.sh - copied unchanged from r253491, user/nwhitehorn/buildport.sh user/nwhitehorn/condorports/buildportsdag.sh - copied unchanged from r253491, user/nwhitehorn/buildportsdag.sh user/nwhitehorn/condorports/fetchandlinks.sh - copied unchanged from r253491, user/nwhitehorn/fetchandlinks.sh user/nwhitehorn/condorports/package.sub - copied unchanged from r253491, user/nwhitehorn/package.sub user/nwhitehorn/condorports/prepbuildjail - copied unchanged from r253491, user/nwhitehorn/prepbuildjail user/nwhitehorn/condorports/reapbuildjail - copied unchanged from r253491, user/nwhitehorn/reapbuildjail user/nwhitehorn/condorports/sudoers - copied unchanged from r253491, user/nwhitehorn/sudoers Deleted: user/nwhitehorn/buildport.sh user/nwhitehorn/buildportsdag.sh user/nwhitehorn/fetchandlinks.sh user/nwhitehorn/package.sub user/nwhitehorn/prepbuildjail user/nwhitehorn/reapbuildjail user/nwhitehorn/sudoers Copied: user/nwhitehorn/condorports/buildport.sh (from r253491, user/nwhitehorn/buildport.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/buildport.sh Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/buildport.sh) @@ -0,0 +1,21 @@ +#!/bin/sh + +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin + +port=$1 +pkg=$2 +release=$3 + +scratchdir=$(pwd) + +# Some settings must go in make.conf: +# USE_PACKAGE_DEPENDS=true + +set -e +sudo /pkgscripts/prepbuildjail $_CONDOR_SLOT $release +sudo jexec $_CONDOR_SLOT make -C $port install USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true +sudo jexec $_CONDOR_SLOT make -C $port package PKGREPOSITORY=/packages BATCH=true WRKDIRPREFIX=/obj NO_LATEST_LINK=true PKGFILE=/packages/$pkg +cp /scratch/$_CONDOR_SLOT/packages/$pkg $scratchdir/$pkg +sudo /pkgscripts/reapbuildjail $_CONDOR_SLOT +set +e + Copied: user/nwhitehorn/condorports/buildportsdag.sh (from r253491, user/nwhitehorn/buildportsdag.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/buildportsdag.sh Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/buildportsdag.sh) @@ -0,0 +1,26 @@ +#!/bin/sh +PORTSDIR=/usr/ports +PKGSDIR=/usr/ports/packages +#(cd $PORTSDIR && make index) +ports="$(cut -f 2 -d '|' $PORTSDIR/INDEX-`uname -r | cut -f 1 -d .`)" +ports="/usr/ports/games/sl /usr/ports/ports-mgmt/pkg /usr/ports/japanese/nkf" +dagjobs=$(pwd)/ports.dagjobs +dagdeps=$(pwd)/ports.dagdeps +dag=$(pwd)/ports.dag +rm -f $dagjobs $dagdeps +for job in $ports; do + cd $job + echo JOB $job package.sub >> $dagjobs + # One fetch for all archs with dummy fetch job? UNAME_p etc. + echo SCRIPT PRE $job fetchandlinks.sh $job $PKGSDIR >> $dagjobs + echo VARS $job port=\"$job\" >> $dagjobs + echo VARS $job pkg=\"`make package-name`.txz\" >> $dagjobs + echo VARS $job pkgdir=\"$PKGSDIR/All\" >> $dagjobs + deps=$(make all-depends-list) + if [ ! -z "$deps" ]; then + echo PARENT $deps CHILD $job >> $dagdeps + fi +done + +cat $dagjobs $dagdeps > $dag +rm -f $dagjobs $dagdeps Copied: user/nwhitehorn/condorports/fetchandlinks.sh (from r253491, user/nwhitehorn/fetchandlinks.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/fetchandlinks.sh Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/fetchandlinks.sh) @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e +cd $1 +make fetch +make package-links PACKAGES=$2 +mkdir -p $2/All +set +e + Copied: user/nwhitehorn/condorports/package.sub (from r253491, user/nwhitehorn/package.sub) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/package.sub Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/package.sub) @@ -0,0 +1,18 @@ +executable = buildport.sh +universe = vanilla +notification = never # failure? + +requirements = Arch == "X86_64" && OpSys == "FREEBSD" +#requirements = Arch == "powerpc" && OpSys == "FREEBSD" + +log=/tmp/condorlog +output=logs/$(pkg).out +error=logs/$(pkg).err + +should_transfer_files=YES +when_to_transfer_output=ON_EXIT +#transfer_output_files=$(pkg) +transfer_output_remaps="$(pkg)=$(pkgdir)/$(pkg)" + +arguments= $(port) $(pkg) release +queue Copied: user/nwhitehorn/condorports/prepbuildjail (from r253491, user/nwhitehorn/prepbuildjail) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/prepbuildjail Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/prepbuildjail) @@ -0,0 +1,41 @@ +#!/bin/sh +slot=$1 +release=$2 + +#Audit slot and release names +case $slot in + *[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1 +esac +case $release in + *[^a-zA-Z0-9]* ) echo "Non-alphanumeric release $release"; exit 1 +esac +if [ -z "$slot" -o -z "$release" ]; then + echo "Zero-length slot or release" + exit 1 +fi + +if [ -d /scratch/$slot ]; then + echo "Pre-existing file system for this slot!" + /pkgscripts/reapbuildjail $slot +fi + +cleanup() { + /pkgscripts/reapbuildjail $slot +} + +set -e +trap cleanup EXIT + +. /etc/rc.subr + +mkdir -p /scratch/$slot +#mount_unionfs -o below /releases/$release /scratch/$slot +#mount_nullfs -o ro /ports /scratch/$slot/ports +mount_unionfs -o below /scratch/$release /scratch/$slot +mount_nullfs -o ro /usr/ports /scratch/$slot/usr/ports +ls /scratch/$slot/usr/ports > /dev/null # Hack around bug in nullfs +devfs_mount_jail /scratch/$slot/dev 4 && mounts="/scratch/$slot/dev $mounts" + +jail -c name=$slot path=/scratch/$slot host.hostname=$slot.`hostname` persist=true +trap true EXIT + Copied: user/nwhitehorn/condorports/reapbuildjail (from r253491, user/nwhitehorn/reapbuildjail) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/reapbuildjail Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/reapbuildjail) @@ -0,0 +1,27 @@ +#!/bin/sh +slot=$1 + +#Audit slot and release names +case $slot in + *[^a-zA-Z0-9]* ) echo "Non-alphanumeric slot $slot"; exit 1 +esac +if [ -z "$slot" ]; then + echo "Zero-length slot or release" + exit 1 +fi + +if [ ! -d /scratch/$slot ]; then + echo "No file system for slot!" + exit 1 +fi + +set +e +jail -r $slot +umount -f /scratch/$slot/dev +#umount -f /scratch/$slot/ports +umount -f /scratch/$slot/usr/ports +umount -f /scratch/$slot +chflags -R noschg /scratch/$slot +rm -rf /scratch/$slot +set +e + Copied: user/nwhitehorn/condorports/sudoers (from r253491, user/nwhitehorn/sudoers) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/sudoers Sat Jul 20 13:13:28 2013 (r253492, copy of r253491, user/nwhitehorn/sudoers) @@ -0,0 +1,4 @@ +# User privilege specification +root ALL=(ALL) ALL + +pkgbuild ALL=NOPASSWD: /pkgscripts/prepbuildjail,/pkgscripts/reapbuildjail,/usr/sbin/jexec From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 13:41:26 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A9B6D90; Sat, 20 Jul 2013 13:41:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CB02241; Sat, 20 Jul 2013 13:41:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KDfQEA089474; Sat, 20 Jul 2013 13:41:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KDfQh6089472; Sat, 20 Jul 2013 13:41:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201341.r6KDfQh6089472@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 13:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253496 - user/nwhitehorn/condorports X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 13:41:26 -0000 Author: nwhitehorn Date: Sat Jul 20 13:41:25 2013 New Revision: 253496 URL: http://svnweb.freebsd.org/changeset/base/253496 Log: Add some notes on improvements to make. Modified: user/nwhitehorn/condorports/package.sub user/nwhitehorn/condorports/prepbuildjail Modified: user/nwhitehorn/condorports/package.sub ============================================================================== --- user/nwhitehorn/condorports/package.sub Sat Jul 20 13:40:03 2013 (r253495) +++ user/nwhitehorn/condorports/package.sub Sat Jul 20 13:41:25 2013 (r253496) @@ -2,6 +2,11 @@ executable = buildport.sh universe = vanilla notification = never # failure? +# TODO: Set architecture using custom classad for uname -p values that each +# build host can execute +# Build host example: START= TARGET.UnameP=="amd64" || TARGET.UnameP=="i386" +# Job classad example: UnameP="amd64" + requirements = Arch == "X86_64" && OpSys == "FREEBSD" #requirements = Arch == "powerpc" && OpSys == "FREEBSD" @@ -11,8 +16,11 @@ error=logs/$(pkg).err should_transfer_files=YES when_to_transfer_output=ON_EXIT -#transfer_output_files=$(pkg) transfer_output_remaps="$(pkg)=$(pkgdir)/$(pkg)" +# TODO: transfer input files? package dependencies and distfiles allow flocking +# A restricted segment of the ports tree (just this, depends, Mk, and distfiles)# would also totally eliminate the need for a shared file system of any kind +# File system tarball could be built by fetchandlinks.sh + arguments= $(port) $(pkg) release queue Modified: user/nwhitehorn/condorports/prepbuildjail ============================================================================== --- user/nwhitehorn/condorports/prepbuildjail Sat Jul 20 13:40:03 2013 (r253495) +++ user/nwhitehorn/condorports/prepbuildjail Sat Jul 20 13:41:25 2013 (r253496) @@ -28,6 +28,8 @@ trap cleanup EXIT . /etc/rc.subr +#TODO: localhost networking + mkdir -p /scratch/$slot #mount_unionfs -o below /releases/$release /scratch/$slot #mount_nullfs -o ro /ports /scratch/$slot/ports From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 14:54:21 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7B218BA1; Sat, 20 Jul 2013 14:54:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E696630; Sat, 20 Jul 2013 14:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KEsKB3014998; Sat, 20 Jul 2013 14:54:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KEsKmr014997; Sat, 20 Jul 2013 14:54:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201454.r6KEsKmr014997@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 14:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253499 - user/nwhitehorn/condorports X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 14:54:21 -0000 Author: nwhitehorn Date: Sat Jul 20 14:54:20 2013 New Revision: 253499 URL: http://svnweb.freebsd.org/changeset/base/253499 Log: Add example worker node config. Added: user/nwhitehorn/condorports/condor_config.local Added: user/nwhitehorn/condorports/condor_config.local ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/nwhitehorn/condorports/condor_config.local Sat Jul 20 14:54:20 2013 (r253499) @@ -0,0 +1,12 @@ +CONDOR_HOST = cluster_manager.freebsd.org + +SupportedABIs = "amd64 i386" +STARTD_ATTRS = $(STARTD_ATTRS) SupportedABIs + +DAEMON_LIST = MASTER, STARTD + +# Probably wise to replace this with certificates +ALLOW_ADMINISTRATOR = $(CONDOR_HOST), $(FULL_HOSTNAME) +ALLOW_READ = $(CONDOR_HOST), $(FULL_HOSTNAME) +ALLOW_WRITE = $(CONDOR_HOST), $(FULL_HOSTNAME) + From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 14:54:44 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12224C7B; Sat, 20 Jul 2013 14:54:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF6B5633; Sat, 20 Jul 2013 14:54:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KEshqN015076; Sat, 20 Jul 2013 14:54:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KEshcd015073; Sat, 20 Jul 2013 14:54:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201454.r6KEshcd015073@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 14:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253500 - user/nwhitehorn/condorports X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 14:54:44 -0000 Author: nwhitehorn Date: Sat Jul 20 14:54:43 2013 New Revision: 253500 URL: http://svnweb.freebsd.org/changeset/base/253500 Log: Add infrastructure for real multi-arch support. Modified: user/nwhitehorn/condorports/buildportsdag.sh user/nwhitehorn/condorports/fetchandlinks.sh user/nwhitehorn/condorports/package.sub Modified: user/nwhitehorn/condorports/buildportsdag.sh ============================================================================== --- user/nwhitehorn/condorports/buildportsdag.sh Sat Jul 20 14:54:20 2013 (r253499) +++ user/nwhitehorn/condorports/buildportsdag.sh Sat Jul 20 14:54:43 2013 (r253500) @@ -1,6 +1,7 @@ #!/bin/sh -PORTSDIR=/usr/ports -PKGSDIR=/usr/ports/packages +: ${PORTSDIR=/usr/ports} +: ${PKGSDIR=/usr/ports/packages} +: ${ARCH=`uname -p`} #(cd $PORTSDIR && make index) ports="$(cut -f 2 -d '|' $PORTSDIR/INDEX-`uname -r | cut -f 1 -d .`)" ports="/usr/ports/games/sl /usr/ports/ports-mgmt/pkg /usr/ports/japanese/nkf" @@ -11,8 +12,11 @@ rm -f $dagjobs $dagdeps for job in $ports; do cd $job echo JOB $job package.sub >> $dagjobs - # One fetch for all archs with dummy fetch job? UNAME_p etc. - echo SCRIPT PRE $job fetchandlinks.sh $job $PKGSDIR >> $dagjobs + # One fetch for all archs with dummy fetch job? + echo SCRIPT PRE $job fetchandlinks.sh $job $PKGSDIR $ARCH >> $dagjobs + + export UNAME_p=$ARCH + echo VARS $job BuildArch=\"$ARCH\" >> $dagjobs echo VARS $job port=\"$job\" >> $dagjobs echo VARS $job pkg=\"`make package-name`.txz\" >> $dagjobs echo VARS $job pkgdir=\"$PKGSDIR/All\" >> $dagjobs Modified: user/nwhitehorn/condorports/fetchandlinks.sh ============================================================================== --- user/nwhitehorn/condorports/fetchandlinks.sh Sat Jul 20 14:54:20 2013 (r253499) +++ user/nwhitehorn/condorports/fetchandlinks.sh Sat Jul 20 14:54:43 2013 (r253500) @@ -1,6 +1,10 @@ #!/bin/sh +# Build tarball of interesting subset of ports tree, relevant distfiles, +# dependent packages? + set -e +export UNAME_p=$3 cd $1 make fetch make package-links PACKAGES=$2 Modified: user/nwhitehorn/condorports/package.sub ============================================================================== --- user/nwhitehorn/condorports/package.sub Sat Jul 20 14:54:20 2013 (r253499) +++ user/nwhitehorn/condorports/package.sub Sat Jul 20 14:54:43 2013 (r253500) @@ -2,13 +2,7 @@ executable = buildport.sh universe = vanilla notification = never # failure? -# TODO: Set architecture using custom classad for uname -p values that each -# build host can execute -# Build host example: START= TARGET.UnameP=="amd64" || TARGET.UnameP=="i386" -# Job classad example: UnameP="amd64" - -requirements = Arch == "X86_64" && OpSys == "FREEBSD" -#requirements = Arch == "powerpc" && OpSys == "FREEBSD" +requirements = stringListMember($(BuildArch), SupportedABIs) log=/tmp/condorlog output=logs/$(pkg).out From owner-svn-src-user@FreeBSD.ORG Sat Jul 20 15:09:28 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6AA05D4; Sat, 20 Jul 2013 15:09:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDF2694; Sat, 20 Jul 2013 15:09:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KF9SpR020151; Sat, 20 Jul 2013 15:09:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6KF9SSg020150; Sat, 20 Jul 2013 15:09:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201307201509.r6KF9SSg020150@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Jul 2013 15:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r253501 - user/nwhitehorn/condorports X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 15:09:28 -0000 Author: nwhitehorn Date: Sat Jul 20 15:09:27 2013 New Revision: 253501 URL: http://svnweb.freebsd.org/changeset/base/253501 Log: Make multi-arch submissions actually work. Modified: user/nwhitehorn/condorports/package.sub Modified: user/nwhitehorn/condorports/package.sub ============================================================================== --- user/nwhitehorn/condorports/package.sub Sat Jul 20 14:54:43 2013 (r253500) +++ user/nwhitehorn/condorports/package.sub Sat Jul 20 15:09:27 2013 (r253501) @@ -2,7 +2,9 @@ executable = buildport.sh universe = vanilla notification = never # failure? -requirements = stringListMember($(BuildArch), SupportedABIs) +# Require that the job run on a machine that supports our build architecture +# The "potemkin" is to suppress Condor's implicit Arch requirement +requirements = Arch=="potemkin" || stringListMember("$(BuildArch)", TARGET.SupportedABIs) log=/tmp/condorlog output=logs/$(pkg).out