From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 4 12:22:18 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766951065670; Sun, 4 Jul 2010 12:22:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 653C88FC21; Sun, 4 Jul 2010 12:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CMIfD027176; Sun, 4 Jul 2010 12:22:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CMIhx027174; Sun, 4 Jul 2010 12:22:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007041222.o64CMIhx027174@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Jul 2010 12:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209691 - stable/8/sys/netipsec X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:22:18 -0000 Author: bz Date: Sun Jul 4 12:22:17 2010 New Revision: 209691 URL: http://svn.freebsd.org/changeset/base/209691 Log: MFC r208508: MFp4 @178283: Improve IPsec flow distribution for better netisr parallelism. Instead of using the pointer that would have the last bits masked in a % statement in netisr_select_cpuid() to select the queue, use the SPI. Reviewed by: rwatson Modified: stable/8/sys/netipsec/ipsec_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/ipsec_input.c ============================================================================== --- stable/8/sys/netipsec/ipsec_input.c Sun Jul 4 12:09:30 2010 (r209690) +++ stable/8/sys/netipsec/ipsec_input.c Sun Jul 4 12:22:17 2010 (r209691) @@ -489,7 +489,7 @@ ipsec4_common_input_cb(struct mbuf *m, s /* * Re-dispatch via software interrupt. */ - if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav, m))) { + if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { IPSEC_ISTAT(sproto, V_espstat.esps_qfull, V_ahstat.ahs_qfull, V_ipcompstat.ipcomps_qfull); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 4 12:27:19 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4661B106566B; Sun, 4 Jul 2010 12:27:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34A568FC12; Sun, 4 Jul 2010 12:27:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CRJvm028323; Sun, 4 Jul 2010 12:27:19 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CRJ2K028318; Sun, 4 Jul 2010 12:27:19 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007041227.o64CRJ2K028318@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Jul 2010 12:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209692 - in stable/8: share/man/man4 sys/ddb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:27:19 -0000 Author: bz Date: Sun Jul 4 12:27:18 2010 New Revision: 209692 URL: http://svn.freebsd.org/changeset/base/209692 Log: MFC r208509: MFp4 @178364: Implement an optional delay to the ddb reset/reboot command. This allows textdumps to be run automatically with unattended reboots after a resonable timeout, while still permitting an administrator to break into debugger if attached to the console at the time of the event for further debugging. Cap the maximum delay at 1 week to avoid highly accidental results, and default to 15s in case of problems parsing the timeout value. Move hex2dec helper function from db_thread.c to db_command.c to make it generally available and prefix it with a "db_" to avoid namespace collisions. Reviewed by: rwatson Modified: stable/8/share/man/man4/ddb.4 stable/8/sys/ddb/db_command.c stable/8/sys/ddb/db_command.h stable/8/sys/ddb/db_thread.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/ddb.4 ============================================================================== --- stable/8/share/man/man4/ddb.4 Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/share/man/man4/ddb.4 Sun Jul 4 12:27:18 2010 (r209692) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd May 24, 2010 .Dt DDB 4 .Os .Sh NAME @@ -1092,9 +1092,13 @@ for a list of signals. Note that the arguments are reversed relative to .Xr kill 2 . .Pp -.It Ic reboot -.It Ic reset +.It Ic reboot Op Ar seconds +.It Ic reset Op Ar seconds Hard reset the system. +If the optional argument +.Ar seconds +is given, the debugger will wait for this long, at most a week, +before rebooting. .Pp .It Ic help Print a short summary of the available commands and command Modified: stable/8/sys/ddb/db_command.c ============================================================================== --- stable/8/sys/ddb/db_command.c Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/sys/ddb/db_command.c Sun Jul 4 12:27:18 2010 (r209692) @@ -661,13 +661,42 @@ out: #undef DB_ERROR } +/* + * Reboot. In case there is an additional argument, take it as delay in + * seconds. Default to 15s if we cannot parse it and make sure we will + * never wait longer than 1 week. Some code is similar to + * kern_shutdown.c:shutdown_panic(). + */ +#ifndef DB_RESET_MAXDELAY +#define DB_RESET_MAXDELAY (3600 * 24 * 7) +#endif + static void -db_reset(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_reset(db_expr_t addr, boolean_t have_addr, db_expr_t count __unused, + char *modif __unused) { + int delay, loop; + + if (have_addr) { + delay = (int)db_hex2dec(addr); + + /* If we parse to fail, use 15s. */ + if (delay == -1) + delay = 15; + + /* Cap at one week. */ + if ((uintmax_t)delay > (uintmax_t)DB_RESET_MAXDELAY) + delay = DB_RESET_MAXDELAY; + + db_printf("Automatic reboot in %d seconds - " + "press a key on the console to abort\n", delay); + for (loop = delay * 10; loop > 0; --loop) { + DELAY(1000 * 100); /* 1/10th second */ + /* Did user type a key? */ + if (cncheckc() != -1) + return; + } + } cpu_reset(); } @@ -771,3 +800,28 @@ db_stack_trace_all(db_expr_t dummy, bool kdb_jmpbuf(prev_jb); } } + +/* + * Take the parsed expression value from the command line that was parsed + * as a hexadecimal value and convert it as if the expression was parsed + * as a decimal value. Returns -1 if the expression was not a valid + * decimal value. + */ +db_expr_t +db_hex2dec(db_expr_t expr) +{ + uintptr_t x, y; + db_expr_t val; + + y = 1; + val = 0; + x = expr; + while (x != 0) { + if (x % 16 > 9) + return (-1); + val += (x % 16) * (y); + x >>= 4; + y *= 10; + } + return (val); +} Modified: stable/8/sys/ddb/db_command.h ============================================================================== --- stable/8/sys/ddb/db_command.h Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/sys/ddb/db_command.h Sun Jul 4 12:27:18 2010 (r209692) @@ -33,6 +33,12 @@ * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ + +/* + * Helper functions. + */ +db_expr_t db_hex2dec(db_expr_t expr); + /* * Command loop declarations. */ Modified: stable/8/sys/ddb/db_thread.c ============================================================================== --- stable/8/sys/ddb/db_thread.c Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/sys/ddb/db_thread.c Sun Jul 4 12:27:18 2010 (r209692) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -static db_expr_t hex2dec(db_expr_t expr); - void db_print_thread(void) { @@ -108,31 +106,6 @@ db_show_threads(db_expr_t addr, boolean_ } /* - * Take the parsed expression value from the command line that was parsed - * as a hexadecimal value and convert it as if the expression was parsed - * as a decimal value. Returns -1 if the expression was not a valid - * decimal value. - */ -static db_expr_t -hex2dec(db_expr_t expr) -{ - uintptr_t x, y; - db_expr_t val; - - y = 1; - val = 0; - x = expr; - while (x != 0) { - if (x % 16 > 9) - return (-1); - val += (x % 16) * (y); - x >>= 4; - y *= 10; - } - return (val); -} - -/* * Lookup a thread based on a db expression address. We assume that the * address was parsed in hexadecimal. We reparse the address in decimal * first and try to treat it as a thread ID to find an associated thread. @@ -151,7 +124,7 @@ db_lookup_thread(db_expr_t addr, boolean * If the parsed address was not a valid decimal expression, * assume it is a thread pointer. */ - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr == -1) return ((struct thread *)addr); @@ -183,7 +156,7 @@ db_lookup_proc(db_expr_t addr) db_expr_t decaddr; struct proc *p; - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr != -1) { FOREACH_PROC_IN_SYSTEM(p) { if (p->p_pid == decaddr) From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 4 12:30:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E08C8106566B; Sun, 4 Jul 2010 12:30:55 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4C38FC12; Sun, 4 Jul 2010 12:30:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CUtVT029199; Sun, 4 Jul 2010 12:30:55 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CUt0K029197; Sun, 4 Jul 2010 12:30:55 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201007041230.o64CUt0K029197@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 4 Jul 2010 12:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209694 - stable/8/sys/dev/iwn X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:30:56 -0000 Author: bschmidt Date: Sun Jul 4 12:30:55 2010 New Revision: 209694 URL: http://svn.freebsd.org/changeset/base/209694 Log: MFC r209169: Fix TX retry rate handling. tx->linkq is an index to a rate table beginning with the highest available rate. Currently we always use 54m for the first retry no matter what AMRR has choosen. Fix this by setting the index to the next lower rate. Approved by: rpaulo (mentor) Tested by: Brandon Gooch Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sun Jul 4 12:28:02 2010 (r209693) +++ stable/8/sys/dev/iwn/if_iwn.c Sun Jul 4 12:30:55 2010 (r209694) @@ -3007,7 +3007,7 @@ iwn_tx_data(struct iwn_softc *sc, struct txant = IWN_LSB(sc->txchainmask); tx->rflags |= IWN_RFLAG_ANT(txant); } else { - tx->linkq = 0; + tx->linkq = IWN_RIDX_OFDM54 - ridx; flags |= IWN_TX_LINKQ; /* enable MRR */ } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 4 18:41:00 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D314106564A; Sun, 4 Jul 2010 18:41:00 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79ED28FC0C; Sun, 4 Jul 2010 18:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64If0OE012891; Sun, 4 Jul 2010 18:41:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64If0A1012889; Sun, 4 Jul 2010 18:41:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007041841.o64If0A1012889@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Jul 2010 18:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209698 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:41:00 -0000 Author: brueffer Date: Sun Jul 4 18:41:00 2010 New Revision: 209698 URL: http://svn.freebsd.org/changeset/base/209698 Log: MFC: r207946 The previous revision actually removed the bug being hinted at, so go ahead and remove the hint. Modified: stable/8/lib/libc/stdlib/strtod.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdlib/strtod.3 ============================================================================== --- stable/8/lib/libc/stdlib/strtod.3 Sun Jul 4 18:16:17 2010 (r209697) +++ stable/8/lib/libc/stdlib/strtod.3 Sun Jul 4 18:41:00 2010 (r209698) @@ -32,7 +32,7 @@ .\" @(#)strtod.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 2, 2003 +.Dd May 11, 2010 .Dt STRTOD 3 .Os .Sh NAME @@ -169,8 +169,7 @@ The .Fn strtod function conforms to -.St -isoC-99 , -with the exception of the bug noted below. +.St -isoC-99 . .Sh AUTHORS The author of this software is .An David M. Gay . From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 4 18:48:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7C2106564A; Sun, 4 Jul 2010 18:48:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E91F8FC0C; Sun, 4 Jul 2010 18:48:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64Imh2O014739; Sun, 4 Jul 2010 18:48:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64Imh6r014737; Sun, 4 Jul 2010 18:48:43 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007041848.o64Imh6r014737@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Jul 2010 18:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209700 - stable/8/usr.bin/make X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:48:44 -0000 Author: brueffer Date: Sun Jul 4 18:48:43 2010 New Revision: 209700 URL: http://svn.freebsd.org/changeset/base/209700 Log: MFC: r207948 - Missing full stops - Upper case the first character of an description - Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81 - Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61 - s/seperating/separating/ Modified: stable/8/usr.bin/make/make.1 Directory Properties: stable/8/usr.bin/make/ (props changed) Modified: stable/8/usr.bin/make/make.1 ============================================================================== --- stable/8/usr.bin/make/make.1 Sun Jul 4 18:44:32 2010 (r209699) +++ stable/8/usr.bin/make/make.1 Sun Jul 4 18:48:43 2010 (r209700) @@ -960,7 +960,7 @@ Otherwise is the substring of .Ar old_string to be replaced in -.Ar new_string +.Ar new_string . .It Cm T Replaces each word in the variable with its last component. .It Cm U @@ -1108,7 +1108,7 @@ The may be any one of the following: .Bl -tag -width "Cm XX" .It Cm || -logical +Logical .Tn OR .It Cm && Logical @@ -1298,7 +1298,7 @@ made before the sources that succeed it Loops are not being detected and targets that form loops will be silently ignored. .El -.Sh "SPECIAL TARGETS" +.Sh SPECIAL TARGETS Special targets may not be included with other targets, i.e., they must be the only target specified. .Bl -tag -width Ic @@ -1590,7 +1590,7 @@ command in the file. .It Ic .SUFFIXES Each source specifies a suffix to .Nm . -If no sources are specified, any previous specified suffices are deleted. +If no sources are specified, any previous specified suffixes are deleted. .It Ic .WARN Each source specifies a warning flag as previously described for the .Fl x @@ -1603,7 +1603,7 @@ environment variables so that a warning line will influence all sub-makes. Several flags can be specified on a single .Ic .WARN -target by seperating them with blanks. +target by separating them with blanks. .El .Sh REMAKING MAKEFILES If the special target @@ -1748,7 +1748,7 @@ The evaluation of .Ar expression in a test is very simple-minded. Currently, the only form that works is -.Ql .if ${VAR} op something +.Ql .if ${VAR} op something . For instance, you should write tests as .Ql .if ${VAR} == "string" not the other way around, which would give you an error. From owner-svn-src-stable-8@FreeBSD.ORG Tue Jul 6 16:58:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54A021065670; Tue, 6 Jul 2010 16:58:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440728FC12; Tue, 6 Jul 2010 16:58:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66GwPTs029044; Tue, 6 Jul 2010 16:58:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66GwPGi029042; Tue, 6 Jul 2010 16:58:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007061658.o66GwPGi029042@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 6 Jul 2010 16:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209732 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 16:58:25 -0000 Author: bz Date: Tue Jul 6 16:58:24 2010 New Revision: 209732 URL: http://svn.freebsd.org/changeset/base/209732 Log: MFC r207303 (originally by kmacy): need to initialize the lock before it is used Reported on: stable@ (MFC missing) Modified: stable/8/sys/net/flowtable.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Tue Jul 6 16:56:27 2010 (r209731) +++ stable/8/sys/net/flowtable.c Tue Jul 6 16:58:24 2010 (r209732) @@ -1626,7 +1626,7 @@ flowtable_init(const void *unused __unus EVENTHANDLER_PRI_ANY); flowclean_freq = 20*hz; } -SYSINIT(flowtable_init, SI_SUB_SMP, SI_ORDER_MIDDLE, +SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, flowtable_init, NULL); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jul 7 14:15:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D54C106564A; Wed, 7 Jul 2010 14:15:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CBEA8FC08; Wed, 7 Jul 2010 14:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67EFpjp013308; Wed, 7 Jul 2010 14:15:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67EFpdX013306; Wed, 7 Jul 2010 14:15:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071415.o67EFpdX013306@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209765 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:15:51 -0000 Author: nwhitehorn Date: Wed Jul 7 14:15:51 2010 New Revision: 209765 URL: http://svn.freebsd.org/changeset/base/209765 Log: MFC r209490,209492: Move default HZ from 100 to 1000 on powerpc, and rearrange the logic slightly, so that it is set to 100 on ARM and MIPS and defaults to 1000, instead of defaulting to 100, and setting it to 1000 on everything but ARM and MIPS. Reviewed by: marcel Modified: stable/8/sys/kern/subr_param.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Wed Jul 7 12:44:19 2010 (r209764) +++ stable/8/sys/kern/subr_param.c Wed Jul 7 14:15:51 2010 (r209765) @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); */ #ifndef HZ -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) -# define HZ 1000 -# else +# if defined(__mips__) || defined(__arm__) # define HZ 100 +# else +# define HZ 1000 # endif # ifndef HZ_VM # define HZ_VM 100 From owner-svn-src-stable-8@FreeBSD.ORG Wed Jul 7 14:19:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE274106566B; Wed, 7 Jul 2010 14:19:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3FD48FC1E; Wed, 7 Jul 2010 14:19:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67EJw2U014256; Wed, 7 Jul 2010 14:19:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67EJwjs014254; Wed, 7 Jul 2010 14:19:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071419.o67EJwjs014254@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209766 - stable/8/sys/powerpc/ofw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:19:59 -0000 Author: nwhitehorn Date: Wed Jul 7 14:19:58 2010 New Revision: 209766 URL: http://svn.freebsd.org/changeset/base/209766 Log: MFC r209222: Modify the console mouse pointer drawing routine to use single-byte writes instead of 4-byte ones. Because the mouse pointer can start part way through a character cell, 4-byte memory operations are not necessarily aligned, triggering a fatal alignment exception when the console pointer was moved on PowerPC G5 systems. Modified: stable/8/sys/powerpc/ofw/ofw_syscons.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- stable/8/sys/powerpc/ofw/ofw_syscons.c Wed Jul 7 14:15:51 2010 (r209765) +++ stable/8/sys/powerpc/ofw/ofw_syscons.c Wed Jul 7 14:19:58 2010 (r209766) @@ -856,16 +856,11 @@ ofwfb_putm8(video_adapter_t *adp, int x, { struct ofwfb_softc *sc; int i, j, k; - uint32_t *addr; + uint8_t *addr; u_char fg, bg; - union { - uint32_t l[2]; - uint8_t c[8]; - } ch; - sc = (struct ofwfb_softc *)adp; - addr = (u_int32_t *)((int)sc->sc_addr + addr = (u_int8_t *)((int)sc->sc_addr + (y + sc->sc_ymargin)*sc->sc_stride + x + sc->sc_xmargin); @@ -874,12 +869,6 @@ ofwfb_putm8(video_adapter_t *adp, int x, for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { /* - * Use the current values for the line - */ - ch.l[0] = addr[0]; - ch.l[1] = addr[1]; - - /* * Calculate 2 x 4-chars at a time, and then * write these out. */ @@ -888,12 +877,10 @@ ofwfb_putm8(video_adapter_t *adp, int x, continue; if (pixel_image[i] & (1 << k)) - ch.c[j] = (ch.c[j] == fg) ? bg : fg; + addr[j] = (addr[j] == fg) ? bg : fg; } - addr[0] = ch.l[0]; - addr[1] = ch.l[1]; - addr += (sc->sc_stride / sizeof(u_int32_t)); + addr += (sc->sc_stride / sizeof(u_int8_t)); } return (0); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jul 7 14:21:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D0C1106564A; Wed, 7 Jul 2010 14:21:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3A08FC1E; Wed, 7 Jul 2010 14:21:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67ELf3m014703; Wed, 7 Jul 2010 14:21:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67ELepC014700; Wed, 7 Jul 2010 14:21:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071421.o67ELepC014700@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209767 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:21:41 -0000 Author: nwhitehorn Date: Wed Jul 7 14:21:40 2010 New Revision: 209767 URL: http://svn.freebsd.org/changeset/base/209767 Log: MFC r209114: Make SMP work on MPC7400-based Apple desktops like the PowerMac3,3. Modified: stable/8/sys/powerpc/aim/mp_cpudep.c stable/8/sys/powerpc/aim/platform_chrp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/8/sys/powerpc/aim/mp_cpudep.c Wed Jul 7 14:19:58 2010 (r209766) +++ stable/8/sys/powerpc/aim/mp_cpudep.c Wed Jul 7 14:21:40 2010 (r209767) @@ -75,9 +75,21 @@ cpudep_ap_bootstrap(void) } static register_t -mpc745x_l2_enable(register_t l2cr_config) +mpc74xx_l2_enable(register_t l2cr_config) { - register_t ccr; + register_t ccr, bit; + uint16_t vers; + + vers = mfpvr() >> 16; + switch (vers) { + case MPC7400: + case MPC7410: + bit = L2CR_L2IP; + break; + default: + bit = L2CR_L2I; + break; + } ccr = mfspr(SPR_L2CR); if (ccr & L2CR_L2E) @@ -88,7 +100,7 @@ mpc745x_l2_enable(register_t l2cr_config mtspr(SPR_L2CR, ccr | L2CR_L2I); do { ccr = mfspr(SPR_L2CR); - } while (ccr & L2CR_L2I); + } while (ccr & bit); powerpc_sync(); mtspr(SPR_L2CR, l2cr_config); powerpc_sync(); @@ -129,7 +141,7 @@ mpc745x_l3_enable(register_t l3cr_config } static register_t -mpc745x_l1d_enable(void) +mpc74xx_l1d_enable(void) { register_t hid; @@ -147,7 +159,7 @@ mpc745x_l1d_enable(void) } static register_t -mpc745x_l1i_enable(void) +mpc74xx_l1i_enable(void) { register_t hid; @@ -267,9 +279,9 @@ cpudep_ap_setup() mtspr(SPR_HID0, bsp_state[0]); isync(); mtspr(SPR_HID1, bsp_state[1]); isync(); - reg = mpc745x_l2_enable(bsp_state[2]); - reg = mpc745x_l1d_enable(); - reg = mpc745x_l1i_enable(); + reg = mpc74xx_l2_enable(bsp_state[2]); + reg = mpc74xx_l1d_enable(); + reg = mpc74xx_l1i_enable(); break; default: Modified: stable/8/sys/powerpc/aim/platform_chrp.c ============================================================================== --- stable/8/sys/powerpc/aim/platform_chrp.c Wed Jul 7 14:19:58 2010 (r209766) +++ stable/8/sys/powerpc/aim/platform_chrp.c Wed Jul 7 14:21:40 2010 (r209767) @@ -228,8 +228,26 @@ chrp_smp_start_cpu(platform_t plat, stru cpu = pc->pc_hwref; res = OF_getprop(cpu, "soft-reset", &reset, sizeof(reset)); - if (res < 0) - return (ENXIO); + if (res < 0) { + reset = 0x58; + + switch (pc->pc_cpuid) { + case 0: + reset += 0x03; + break; + case 1: + reset += 0x04; + break; + case 2: + reset += 0x0f; + break; + case 4: + reset += 0x10; + break; + default: + return (ENXIO); + } + } ap_pcpu = pc; @@ -239,10 +257,12 @@ chrp_smp_start_cpu(platform_t plat, stru rstvec = rstvec_virtbase + reset; *rstvec = 4; + powerpc_sync(); (void)(*rstvec); powerpc_sync(); DELAY(1); *rstvec = 0; + powerpc_sync(); (void)(*rstvec); powerpc_sync(); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jul 7 17:05:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3601065673; Wed, 7 Jul 2010 17:05:32 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3338FC14; Wed, 7 Jul 2010 17:05:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67H5WEK050774; Wed, 7 Jul 2010 17:05:32 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67H5WHv050772; Wed, 7 Jul 2010 17:05:32 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201007071705.o67H5WHv050772@svn.freebsd.org> From: Ken Smith Date: Wed, 7 Jul 2010 17:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209770 - stable/8/release/scripts X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:05:32 -0000 Author: kensmith Date: Wed Jul 7 17:05:32 2010 New Revision: 209770 URL: http://svn.freebsd.org/changeset/base/209770 Log: Package set for 8.1-RELEASE. We still have a 2Gb maximum file size limit caused by cvsup still being used for some of our mirror system. That is being worked on. Reviewed by: re@, portmgr@ Modified: stable/8/release/scripts/package-split.py Modified: stable/8/release/scripts/package-split.py ============================================================================== --- stable/8/release/scripts/package-split.py Wed Jul 7 15:05:44 2010 (r209769) +++ stable/8/release/scripts/package-split.py Wed Jul 7 17:05:32 2010 (r209770) @@ -52,52 +52,21 @@ def disc1_packages(): if doing_dvd: pkgs.extend(['archivers/unzip', - 'astro/xearth', - 'devel/gmake', - 'devel/imake', - 'editors/emacs', - 'editors/vim-lite', 'emulators/linux_base-f10', - 'emulators/mtools', - 'graphics/png', - 'graphics/xv', - 'irc/xchat', - 'lang/perl5.8', - 'mail/alpine', - 'mail/exim', - 'mail/fetchmail', - 'mail/mutt', - 'mail/popd', - 'mail/postfix', - 'mail/xfmail', - 'net/cvsup-without-gui', + 'lang/perl5.10', + 'net/mpd5', 'net/rsync', - 'net/samba3', - 'news/slrn', - 'news/tin', 'ports-mgmt/p5-FreeBSD-Portindex', 'ports-mgmt/portaudit', 'ports-mgmt/portmaster', 'ports-mgmt/portupgrade', - 'print/a2ps-letter', - 'print/apsfilter', - 'print/ghostscript7-nox11', - 'print/psutils-letter', - 'print/gv', 'shells/bash', - 'shells/pdksh', 'shells/zsh', 'security/sudo', 'sysutils/screen', - 'www/links', - 'www/lynx', 'x11/gnome2', 'x11/kde4', - 'x11/rxvt', - 'x11/xorg', - 'x11-wm/afterstep', - 'x11-wm/fvwm2', - 'x11-wm/windowmaker']) + 'x11/xorg']) return pkgs # The list of desired packages From owner-svn-src-stable-8@FreeBSD.ORG Wed Jul 7 19:52:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB26E1065675; Wed, 7 Jul 2010 19:52:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D964D8FC1D; Wed, 7 Jul 2010 19:52:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67JqoGP088157; Wed, 7 Jul 2010 19:52:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67JqomM088155; Wed, 7 Jul 2010 19:52:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201007071952.o67JqomM088155@svn.freebsd.org> From: Marius Strobl Date: Wed, 7 Jul 2010 19:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209776 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 19:52:51 -0000 Author: marius Date: Wed Jul 7 19:52:50 2010 New Revision: 209776 URL: http://svn.freebsd.org/changeset/base/209776 Log: MFC: r209695 - Pin the IPI cache and TLB demap functions in order to prevent migration between determining the other CPUs and calling cpu_ipi_selected(), which apart from generally doing the wrong thing can lead to a panic when a CPU is told to IPI itself (which sun4u doesn't support). Reported and tested by: Nathaniel W Filardo - Add __unused where appropriate. Modified: stable/8/sys/sparc64/include/smp.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Wed Jul 7 19:34:48 2010 (r209775) +++ stable/8/sys/sparc64/include/smp.h Wed Jul 7 19:52:50 2010 (r209776) @@ -38,6 +38,9 @@ #ifndef LOCORE +#include +#include + #include #include #include @@ -139,6 +142,7 @@ ipi_dcache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -154,6 +158,7 @@ ipi_icache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -170,8 +175,11 @@ ipi_tlb_context_demap(struct pmap *pm) if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -189,8 +197,11 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -208,8 +219,11 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -230,6 +244,7 @@ ipi_wait(void *cookie) while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); + sched_unpin(); } } @@ -242,35 +257,36 @@ ipi_wait(void *cookie) #ifndef LOCORE static __inline void * -ipi_dcache_page_inval(void *func, vm_paddr_t pa) +ipi_dcache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_icache_page_inval(void *func, vm_paddr_t pa) +ipi_icache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_tlb_context_demap(struct pmap *pm) +ipi_tlb_context_demap(struct pmap *pm __unused) { return (NULL); } static __inline void * -ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) +ipi_tlb_page_demap(struct pmap *pm __unused, vm_offset_t va __unused) { return (NULL); } static __inline void * -ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) +ipi_tlb_range_demap(struct pmap *pm __unused, vm_offset_t start __unused, + __unused vm_offset_t end) { return (NULL); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 02:35:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C46E106564A; Thu, 8 Jul 2010 02:35:38 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38C9A8FC0C; Thu, 8 Jul 2010 02:35:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682Zca1077385; Thu, 8 Jul 2010 02:35:38 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682ZcKf077382; Thu, 8 Jul 2010 02:35:38 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080235.o682ZcKf077382@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209783 - in stable/8/sys: kern modules modules/alq X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:35:38 -0000 Author: lstewart Date: Thu Jul 8 02:35:37 2010 New Revision: 209783 URL: http://svn.freebsd.org/changeset/base/209783 Log: MFC r205959: Add support for ALQ(9) to be compiled and loaded as a kernel module. Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson Added: stable/8/sys/modules/alq/ - copied from r205959, head/sys/modules/alq/ Modified: stable/8/sys/kern/kern_alq.c stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Wed Jul 7 22:53:58 2010 (r209782) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:35:37 2010 (r209783) @@ -1,7 +1,13 @@ /*- * Copyright (c) 2002, Jeffrey Roberson + * Copyright (c) 2008-2009, Lawrence Stewart + * Copyright (c) 2009-2010, The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by Lawrence Stewart under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_mac.h" + #include #include #include @@ -180,9 +188,16 @@ ald_daemon(void) ALD_LOCK(); for (;;) { - while ((alq = LIST_FIRST(&ald_active)) == NULL) + while ((alq = LIST_FIRST(&ald_active)) == NULL && + !ald_shutingdown) msleep(&ald_active, &ald_mtx, PWAIT, "aldslp", 0); + /* Don't shutdown until all active ALQs are flushed. */ + if (ald_shutingdown && alq == NULL) { + ALD_UNLOCK(); + break; + } + ALQ_LOCK(alq); ald_deactivate(alq); ALD_UNLOCK(); @@ -192,6 +207,8 @@ ald_daemon(void) wakeup(alq); ALD_LOCK(); } + + kproc_exit(0); } static void @@ -200,14 +217,29 @@ ald_shutdown(void *arg, int howto) struct alq *alq; ALD_LOCK(); + + /* Ensure no new queues can be created. */ ald_shutingdown = 1; + /* Shutdown all ALQs prior to terminating the ald_daemon. */ while ((alq = LIST_FIRST(&ald_queues)) != NULL) { LIST_REMOVE(alq, aq_link); ALD_UNLOCK(); alq_shutdown(alq); ALD_LOCK(); } + + /* At this point, all ALQs are flushed and shutdown. */ + + /* + * Wake ald_daemon so that it exits. It won't be able to do + * anything until we msleep because we hold the ald_mtx. + */ + wakeup(&ald_active); + + /* Wait for ald_daemon to exit. */ + msleep(ald_proc, &ald_mtx, PWAIT, "aldslp", 0); + ALD_UNLOCK(); } @@ -510,3 +542,53 @@ alq_close(struct alq *alq) free(alq->aq_entbuf, M_ALD); free(alq, M_ALD); } + +static int +alq_load_handler(module_t mod, int what, void *arg) +{ + int ret; + + ret = 0; + + switch (what) { + case MOD_LOAD: + case MOD_SHUTDOWN: + break; + + case MOD_QUIESCE: + ALD_LOCK(); + /* Only allow unload if there are no open queues. */ + if (LIST_FIRST(&ald_queues) == NULL) { + ald_shutingdown = 1; + ALD_UNLOCK(); + ald_shutdown(NULL, 0); + mtx_destroy(&ald_mtx); + } else { + ALD_UNLOCK(); + ret = EBUSY; + } + break; + + case MOD_UNLOAD: + /* If MOD_QUIESCE failed we must fail here too. */ + if (ald_shutingdown == 0) + ret = EBUSY; + break; + + default: + ret = EINVAL; + break; + } + + return (ret); +} + +static moduledata_t alq_mod = +{ + "alq", + alq_load_handler, + NULL +}; + +DECLARE_MODULE(alq, alq_mod, SI_SUB_SMP, SI_ORDER_ANY); +MODULE_VERSION(alq, 1); Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Wed Jul 7 22:53:58 2010 (r209782) +++ stable/8/sys/modules/Makefile Thu Jul 8 02:35:37 2010 (r209783) @@ -20,6 +20,7 @@ SUBDIR= ${_3dfx} \ aio \ alc \ ale \ + alq \ ${_amd} \ ${_amdsbwd} \ ${_amdtemp} \ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 02:41:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23FB106566C; Thu, 8 Jul 2010 02:41:55 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 860EB8FC16; Thu, 8 Jul 2010 02:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682ftDR078775; Thu, 8 Jul 2010 02:41:55 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682ftZ6078773; Thu, 8 Jul 2010 02:41:55 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080241.o682ftZ6078773@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209784 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:41:55 -0000 Author: lstewart Date: Thu Jul 8 02:41:55 2010 New Revision: 209784 URL: http://svn.freebsd.org/changeset/base/209784 Log: MFC r206026: - Factor code to destroy an ALQ out of alq_close() into a private alq_destroy(). - Use the new alq_destroy() to properly handle a failure case in alq_open(). Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson (as part of a larger patch) Modified: stable/8/sys/kern/kern_alq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 02:35:37 2010 (r209783) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:41:55 2010 (r209784) @@ -103,6 +103,7 @@ static void ald_deactivate(struct alq *) /* Internal queue functions */ static void alq_shutdown(struct alq *); +static void alq_destroy(struct alq *); static int alq_doio(struct alq *); @@ -263,6 +264,18 @@ alq_shutdown(struct alq *alq) crfree(alq->aq_cred); } +void +alq_destroy(struct alq *alq) +{ + /* Drain all pending IO. */ + alq_shutdown(alq); + + mtx_destroy(&alq->aq_mtx); + free(alq->aq_first, M_ALD); + free(alq->aq_entbuf, M_ALD); + free(alq, M_ALD); +} + /* * Flush all pending data to disk. This operation will block. */ @@ -420,8 +433,11 @@ alq_open(struct alq **alqp, const char * alp->ae_next = alq->aq_first; - if ((error = ald_add(alq)) != 0) + if ((error = ald_add(alq)) != 0) { + alq_destroy(alq); return (error); + } + *alqp = alq; return (0); @@ -525,22 +541,9 @@ alq_flush(struct alq *alq) void alq_close(struct alq *alq) { - /* - * If we're already shuting down someone else will flush and close - * the vnode. - */ - if (ald_rem(alq) != 0) - return; - - /* - * Drain all pending IO. - */ - alq_shutdown(alq); - - mtx_destroy(&alq->aq_mtx); - free(alq->aq_first, M_ALD); - free(alq->aq_entbuf, M_ALD); - free(alq, M_ALD); + /* Only flush and destroy alq if not already shutting down. */ + if (ald_rem(alq) == 0) + alq_destroy(alq); } static int From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 02:43:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE32106566B; Thu, 8 Jul 2010 02:43:53 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF088FC13; Thu, 8 Jul 2010 02:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682hqFH079252; Thu, 8 Jul 2010 02:43:52 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682hqFO079250; Thu, 8 Jul 2010 02:43:52 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080243.o682hqFO079250@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209785 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:43:53 -0000 Author: lstewart Date: Thu Jul 8 02:43:52 2010 New Revision: 209785 URL: http://svn.freebsd.org/changeset/base/209785 Log: MFC r206027: According to SLEEP(9), msleep() is deprecated in favour of mtx_sleep(). Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson (as part of a larger patch) Modified: stable/8/sys/kern/kern_alq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 02:41:55 2010 (r209784) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:43:52 2010 (r209785) @@ -191,7 +191,7 @@ ald_daemon(void) for (;;) { while ((alq = LIST_FIRST(&ald_active)) == NULL && !ald_shutingdown) - msleep(&ald_active, &ald_mtx, PWAIT, "aldslp", 0); + mtx_sleep(&ald_active, &ald_mtx, PWAIT, "aldslp", 0); /* Don't shutdown until all active ALQs are flushed. */ if (ald_shutingdown && alq == NULL) { @@ -234,12 +234,12 @@ ald_shutdown(void *arg, int howto) /* * Wake ald_daemon so that it exits. It won't be able to do - * anything until we msleep because we hold the ald_mtx. + * anything until we mtx_sleep because we hold the ald_mtx. */ wakeup(&ald_active); /* Wait for ald_daemon to exit. */ - msleep(ald_proc, &ald_mtx, PWAIT, "aldslp", 0); + mtx_sleep(ald_proc, &ald_mtx, PWAIT, "aldslp", 0); ALD_UNLOCK(); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 02:46:43 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F1EE106566B; Thu, 8 Jul 2010 02:46:43 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA5288FC08; Thu, 8 Jul 2010 02:46:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682kgwu079950; Thu, 8 Jul 2010 02:46:42 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682kgad079948; Thu, 8 Jul 2010 02:46:42 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080246.o682kgad079948@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209786 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:46:43 -0000 Author: lstewart Date: Thu Jul 8 02:46:42 2010 New Revision: 209786 URL: http://svn.freebsd.org/changeset/base/209786 Log: MFC r206028: The ALQ should not be considered drained until it has been made inactive. Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson (as part of a larger patch) Modified: stable/8/sys/kern/kern_alq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 02:43:52 2010 (r209785) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:46:42 2010 (r209786) @@ -253,7 +253,7 @@ alq_shutdown(struct alq *alq) alq->aq_flags |= AQ_SHUTDOWN; /* Drain IO */ - while (alq->aq_flags & (AQ_FLUSHING|AQ_ACTIVE)) { + while (alq->aq_flags & AQ_ACTIVE) { alq->aq_flags |= AQ_WANTED; msleep_spin(alq, &alq->aq_mtx, "aldclose", 0); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 03:28:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC4491065670; Thu, 8 Jul 2010 03:28:25 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B737E8FC17; Thu, 8 Jul 2010 03:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o683SPbv089423; Thu, 8 Jul 2010 03:28:25 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o683SPZA089416; Thu, 8 Jul 2010 03:28:25 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080328.o683SPZA089416@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 03:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209788 - in stable/8: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 03:28:25 -0000 Author: lstewart Date: Thu Jul 8 03:28:25 2010 New Revision: 209788 URL: http://svn.freebsd.org/changeset/base/209788 Log: MFC r207223: - Rework the underlying ALQ storage to be a circular buffer, which amongst other things allows variable length messages to be easily supported. - Extend KPI with alq_writen() and alq_getn() to support variable length messages, which is enabled at ALQ creation time depending on the arguments passed to alq_open(). Also add variants of alq_open() and alq_post() that accept a flags argument. The KPI is still fully backwards compatible and shouldn't require any change in ALQ consumers unless they wish to utilise the new features. - Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers to have more control over IO scheduling and resource acquisition respectively. - Strengthen invariants checking. - Document ALQ changes in ALQ(9) man page. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jeff, rpaulo, rwatson Modified: stable/8/share/man/man9/alq.9 stable/8/sys/kern/kern_alq.c stable/8/sys/sys/alq.h Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man9/alq.9 ============================================================================== --- stable/8/share/man/man9/alq.9 Thu Jul 8 03:28:25 2010 (r209787) +++ stable/8/share/man/man9/alq.9 Thu Jul 8 03:28:25 2010 (r209788) @@ -1,7 +1,13 @@ .\" .\" Copyright (c) 2003 Hiten Pandya +.\" Copyright (c) 2009-2010 The FreeBSD Foundation .\" All rights reserved. .\" +.\" Portions of this software were developed at the Centre for Advanced +.\" Internet Architectures, Swinburne University of Technology, Melbourne, +.\" Australia by Lawrence Stewart under sponsorship from the FreeBSD +.\" Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -25,21 +31,34 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2003 +.Dd April 26, 2010 .Dt ALQ 9 .Os .Sh NAME .Nm alq , +.Nm alq_open_flags , .Nm alq_open , +.Nm alq_writen , .Nm alq_write , .Nm alq_flush , .Nm alq_close , +.Nm alq_getn , .Nm alq_get , +.Nm alq_post_flags , .Nm alq_post .Nd Asynchronous Logging Queues .Sh SYNOPSIS .In sys/alq.h .Ft int +.Fo alq_open_flags +.Fa "struct alq **app" +.Fa "const char *file" +.Fa "struct ucred *cred" +.Fa "int cmode" +.Fa "int size" +.Fa "int flags" +.Fc +.Ft int .Fo alq_open .Fa "struct alq **app" .Fa "const char *file" @@ -49,19 +68,25 @@ .Fa "int count" .Fc .Ft int -.Fn alq_write "struct alq *alq" "void *data" "int waitok" +.Fn alq_writen "struct alq *alq" "void *data" "int len" "int flags" +.Ft int +.Fn alq_write "struct alq *alq" "void *data" "int flags" .Ft void .Fn alq_flush "struct alq *alq" .Ft void .Fn alq_close "struct alq *alq" .Ft struct ale * -.Fn alq_get "struct alq *alq" "int waitok" +.Fn alq_getn "struct alq *alq" "int len" "int flags" +.Ft struct ale * +.Fn alq_get "struct alq *alq" "int flags" +.Ft void +.Fn alq_post_flags "struct alq *alq" "struct ale *ale" "int flags" .Ft void .Fn alq_post "struct alq *alq" "struct ale *ale" .Sh DESCRIPTION The .Nm -facility provides an asynchronous fixed length recording +facility provides an asynchronous fixed or variable length recording mechanism, known as Asynchronous Logging Queues. It can record to any .Xr vnode 9 , @@ -81,26 +106,37 @@ is defined as which has the following members: .Bd -literal -offset indent struct ale { - struct ale *ae_next; /* Next Entry */ - char *ae_data; /* Entry buffer */ - int ae_flags; /* Entry flags */ + intptr_t ae_bytesused; /* # bytes written to ALE. */ + char *ae_data; /* Write ptr. */ + int ae_pad; /* Unused, compat. */ }; .Ed .Pp -The -.Va ae_flags -field is for internal use, clients of the +An .Nm -interface should not modify this field. -Behaviour is undefined if this field is modified. +can be created in either fixed or variable length mode. +A variable length +.Nm +accommodates writes of varying length using +.Fn alq_writen +and +.Fn alq_getn . +A fixed length +.Nm +accommodates a fixed number of writes using +.Fn alq_write +and +.Fn alq_get , +each of fixed size (set at queue creation time). +Fixed length mode is deprecated in favour of variable length mode. .Sh FUNCTIONS The -.Fn alq_open -function creates a new logging queue. +.Fn alq_open_flags +function creates a new variable length asynchronous logging queue. The .Fa file -argument is the name of the file to open for logging; if the file does not -yet exist, +argument is the name of the file to open for logging. +If the file does not yet exist, .Fn alq_open will attempt to create it. The @@ -112,33 +148,99 @@ as the requested creation mode, to be us Consumers of this API may wish to pass .Dv ALQ_DEFAULT_CMODE , a default creation mode suitable for most applications. -The argument +The .Fa cred -specifies the credentials to use when opening and performing I/O on the file. -The size of each entry in the queue is determined by -.Fa size . +argument specifies the credentials to use when opening and performing I/O on the file. The +.Fa size +argument sets the size (in bytes) of the underlying queue. +The ALQ_ORDERED flag may be passed in via +.Fa flags +to indicate that the ordering of writer threads waiting for a busy +.Nm +to free up resources should be preserved. +.Pp +The deprecated +.Fn alq_open +function is implemented as a wrapper around +.Fn alq_open_flags +to provide backwards compatibility to consumers that have not been updated to +utilise the newer +.Fn alq_open_flags +function. +It passes all arguments through to +.Fn alq_open_flags +untouched except for +.Fa size +and +.Fa count , +and sets +.Fa flags +to 0. +To create a variable length mode +.Nm , +the +.Fa size +argument should be set to the size (in bytes) of the underlying queue and the +.Fa count +argument should be set to 0. +To create a fixed length mode +.Nm , +the +.Fa size +argument should be set to the size (in bytes) of each write and the .Fa count -argument determines the number of items to be stored in the -asynchronous queue over an approximate period of a disk -write operation. +argument should be set to the number of +.Fa size +byte chunks to reserve capacity for. .Pp The -.Fn alq_write +.Fn alq_writen function writes +.Fa len +bytes from .Fa data -to the designated queue, +to the designated variable length mode queue .Fa alq . -In the event that -.Fn alq_write -could not write the entry immediately, and +If +.Fn alq_writen +could not write the entry immediately and .Dv ALQ_WAITOK -is passed to -.Fa waitok , -then +is set in +.Fa flags , +the function will be allowed to +.Xr msleep_spin 9 +with the +.Dq Li alqwnord +or +.Dq Li alqwnres +wait message. +A write will automatically schedule the queue +.Fa alq +to be flushed to disk. +This behaviour can be controlled by passing ALQ_NOACTIVATE via +.Fa flags +to indicate that the write should not schedule +.Fa alq +to be flushed to disk. +.Pp +The deprecated +.Fn alq_write +function is implemented as a wrapper around +.Fn alq_writen +to provide backwards compatibility to consumers that have not been updated to +utilise variable length mode queues. +The function will write +.Fa size +bytes of data (where +.Fa size +was specified at queue creation time) from the +.Fa data +buffer to the +.Fa alq . +Note that it is an error to call .Fn alq_write -will be allowed to -.Xr tsleep 9 . +on a variable length mode queue. .Pp The .Fn alq_flush @@ -146,61 +248,136 @@ function is used for flushing .Fa alq to the log medium that was passed to .Fn alq_open . +If +.Fa alq +has data to flush and is not already in the process of being flushed, the +function will block doing IO. +Otherwise, the function will return immediately. .Pp The .Fn alq_close -function will close the asynchronous logging queue, -.Fa alq , +function will close the asynchronous logging queue +.Fa alq and flush all pending write requests to the log medium. It will free all resources that were previously allocated. .Pp The -.Fn alq_get -function returns the next available asynchronous logging entry -from the queue, -.Fa alq . -This function leaves the queue in a locked state, until a subsequent +.Fn alq_getn +function returns an asynchronous log entry from +.Fa alq , +initialised to point at a buffer capable of receiving +.Fa len +bytes of data. +This function leaves +.Fa alq +in a locked state, until a subsequent .Fn alq_post +or +.Fn alq_post_flags call is made. -In the event that -.Fn alq_get -could not retrieve an entry immediately, it will -.Xr tsleep 9 +If +.Fn alq_getn +could not obtain +.Fa len +bytes of buffer immediately and +.Dv ALQ_WAITOK +is set in +.Fa flags , +the function will be allowed to +.Xr msleep_spin 9 with the -.Dq Li alqget +.Dq Li alqgnord +or +.Dq Li alqgnres wait message. +The caller can choose to write less than +.Fa len +bytes of data to the returned asynchronous log entry by setting the entry's +ae_bytesused field to the number of bytes actually written. +This must be done prior to calling +.Fn alq_post . .Pp -The -.Fn alq_post -function schedules the asynchronous logging entry, -.Fa ale , -which is retrieved using the +The deprecated .Fn alq_get -function, -for writing to the asynchronous logging queue, +function is implemented as a wrapper around +.Fn alq_getn +to provide backwards compatibility to consumers that have not been updated to +utilise variable length mode queues. +The asynchronous log entry returned will be initialised to point at a buffer +capable of receiving +.Fa size +bytes of data (where +.Fa size +was specified at queue creation time). +Note that it is an error to call +.Fn alq_get +on a variable length mode queue. +.Pp +The +.Fn alq_post_flags +function schedules the asynchronous log entry +.Fa ale +(obtained from +.Fn alq_getn +or +.Fn alq_get ) +for writing to .Fa alq . -This function leaves the queue, -.Fa alq , +The ALQ_NOACTIVATE flag may be passed in via +.Fa flags +to indicate that the queue should not be immediately scheduled to be flushed to +disk. +This function leaves +.Fa alq in an unlocked state. +.Pp +The +.Fn alq_post +function is implemented as a wrapper around +.Fn alq_post_flags +to provide backwards compatibility to consumers that have not been updated to +utilise the newer +.Fn alq_post_flags +function. +It simply passes all arguments through to +.Fn alq_post_flags +untouched, and sets +.Fa flags +to 0. .Sh IMPLEMENTATION NOTES The +.Fn alq_writen +and .Fn alq_write -function is a wrapper around the +functions both perform a +.Xr bcopy 3 +from the supplied +.Fa data +buffer into the underlying +.Nm +buffer. +Performance critical code paths may wish to consider using +.Fn alq_getn +(variable length queues) or +.Fn alq_get +(fixed length queues) to avoid the extra memory copy. Note that a queue +remains locked between calls to +.Fn alq_getn +or .Fn alq_get and .Fn alq_post -functions; by using these functions separately, a call -to -.Fn bcopy -can be avoided for performance critical code paths. +or +.Fn alq_post_flags , +so this method of writing to a queue is unsuitable for situations where the +time between calls may be substantial. .Sh LOCKING -Each asynchronous queue is protected by a spin mutex. +Each asynchronous logging queue is protected by a spin mutex. .Pp Functions -.Fn alq_flush , -.Fn alq_open +.Fn alq_flush and -.Fn alq_post +.Fn alq_open may attempt to acquire an internal sleep mutex, and should consequently not be used in contexts where sleeping is not allowed. @@ -214,32 +391,36 @@ if it fails to open or else it returns 0. .Pp The +.Fn alq_writen +and .Fn alq_write -function returns +functions return .Er EWOULDBLOCK if .Dv ALQ_NOWAIT -was provided as a value to -.Fa waitok -and either the queue is full, or when the system is shutting down. +was set in +.Fa flags +and either the queue is full or the system is shutting down. .Pp The +.Fn alq_getn +and .Fn alq_get -function returns -.Dv NULL , +functions return +.Dv NULL if .Dv ALQ_NOWAIT -was provided as a value to -.Fa waitok -and either the queue is full, or when the system is shutting down. +was set in +.Fa flags +and either the queue is full or the system is shutting down. .Pp NOTE: invalid arguments to non-void functions will result in undefined behaviour. .Sh SEE ALSO -.Xr syslog 3 , -.Xr kthread 9 , +.Xr kproc 9 , .Xr ktr 9 , -.Xr tsleep 9 , +.Xr msleep_spin 9 , +.Xr syslog 3 , .Xr vnode 9 .Sh HISTORY The @@ -250,7 +431,11 @@ Asynchronous Logging Queues (ALQ) facili The .Nm facility was written by -.An Jeffrey Roberson Aq jeff@FreeBSD.org . +.An Jeffrey Roberson Aq jeff@FreeBSD.org +and extended by +.An Lawrence Stewart Aq lstewart@freebsd.org . .Pp This manual page was written by -.An Hiten Pandya Aq hmp@FreeBSD.org . +.An Hiten Pandya Aq hmp@FreeBSD.org +and revised by +.An Lawrence Stewart Aq lstewart@freebsd.org . Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 03:28:25 2010 (r209787) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 03:28:25 2010 (r209788) @@ -55,16 +55,23 @@ __FBSDID("$FreeBSD$"); /* Async. Logging Queue */ struct alq { + char *aq_entbuf; /* Buffer for stored entries */ int aq_entmax; /* Max entries */ int aq_entlen; /* Entry length */ - char *aq_entbuf; /* Buffer for stored entries */ + int aq_freebytes; /* Bytes available in buffer */ + int aq_buflen; /* Total length of our buffer */ + int aq_writehead; /* Location for next write */ + int aq_writetail; /* Flush starts at this location */ + int aq_wrapearly; /* # bytes left blank at end of buf */ int aq_flags; /* Queue flags */ + int aq_waiters; /* Num threads waiting for resources + * NB: Used as a wait channel so must + * not be first field in the alq struct + */ + struct ale aq_getpost; /* ALE for use by get/post */ struct mtx aq_mtx; /* Queue lock */ struct vnode *aq_vp; /* Open vnode handle */ struct ucred *aq_cred; /* Credentials of the opening thread */ - struct ale *aq_first; /* First ent */ - struct ale *aq_entfree; /* First free ent */ - struct ale *aq_entvalid; /* First ent valid for writing */ LIST_ENTRY(alq) aq_act; /* List of active queues */ LIST_ENTRY(alq) aq_link; /* List of all queues */ }; @@ -73,10 +80,14 @@ struct alq { #define AQ_ACTIVE 0x0002 /* on the active list */ #define AQ_FLUSHING 0x0004 /* doing IO */ #define AQ_SHUTDOWN 0x0008 /* Queue no longer valid */ +#define AQ_ORDERED 0x0010 /* Queue enforces ordered writes */ +#define AQ_LEGACY 0x0020 /* Legacy queue (fixed length writes) */ #define ALQ_LOCK(alq) mtx_lock_spin(&(alq)->aq_mtx) #define ALQ_UNLOCK(alq) mtx_unlock_spin(&(alq)->aq_mtx) +#define HAS_PENDING_DATA(alq) ((alq)->aq_freebytes != (alq)->aq_buflen) + static MALLOC_DEFINE(M_ALD, "ALD", "ALD"); /* @@ -205,7 +216,7 @@ ald_daemon(void) needwakeup = alq_doio(alq); ALQ_UNLOCK(alq); if (needwakeup) - wakeup(alq); + wakeup_one(alq); ALD_LOCK(); } @@ -252,6 +263,20 @@ alq_shutdown(struct alq *alq) /* Stop any new writers. */ alq->aq_flags |= AQ_SHUTDOWN; + /* + * If the ALQ isn't active but has unwritten data (possible if + * the ALQ_NOACTIVATE flag has been used), explicitly activate the + * ALQ here so that the pending data gets flushed by the ald_daemon. + */ + if (!(alq->aq_flags & AQ_ACTIVE) && HAS_PENDING_DATA(alq)) { + alq->aq_flags |= AQ_ACTIVE; + ALQ_UNLOCK(alq); + ALD_LOCK(); + ald_activate(alq); + ALD_UNLOCK(); + ALQ_LOCK(alq); + } + /* Drain IO */ while (alq->aq_flags & AQ_ACTIVE) { alq->aq_flags |= AQ_WANTED; @@ -271,7 +296,6 @@ alq_destroy(struct alq *alq) alq_shutdown(alq); mtx_destroy(&alq->aq_mtx); - free(alq->aq_first, M_ALD); free(alq->aq_entbuf, M_ALD); free(alq, M_ALD); } @@ -287,46 +311,54 @@ alq_doio(struct alq *alq) struct vnode *vp; struct uio auio; struct iovec aiov[2]; - struct ale *ale; - struct ale *alstart; int totlen; int iov; int vfslocked; + int wrapearly; + + KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue empty!", __func__)); vp = alq->aq_vp; td = curthread; totlen = 0; - iov = 0; - - alstart = ale = alq->aq_entvalid; - alq->aq_entvalid = NULL; + iov = 1; + wrapearly = alq->aq_wrapearly; bzero(&aiov, sizeof(aiov)); bzero(&auio, sizeof(auio)); - do { - if (aiov[iov].iov_base == NULL) - aiov[iov].iov_base = ale->ae_data; - aiov[iov].iov_len += alq->aq_entlen; - totlen += alq->aq_entlen; - /* Check to see if we're wrapping the buffer */ - if (ale->ae_data + alq->aq_entlen != ale->ae_next->ae_data) - iov++; - ale->ae_flags &= ~AE_VALID; - ale = ale->ae_next; - } while (ale->ae_flags & AE_VALID); + /* Start the write from the location of our buffer tail pointer. */ + aiov[0].iov_base = alq->aq_entbuf + alq->aq_writetail; + + if (alq->aq_writetail < alq->aq_writehead) { + /* Buffer not wrapped. */ + totlen = aiov[0].iov_len = alq->aq_writehead - alq->aq_writetail; + } else if (alq->aq_writehead == 0) { + /* Buffer not wrapped (special case to avoid an empty iov). */ + totlen = aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail - + wrapearly; + } else { + /* + * Buffer wrapped, requires 2 aiov entries: + * - first is from writetail to end of buffer + * - second is from start of buffer to writehead + */ + aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail - + wrapearly; + iov++; + aiov[1].iov_base = alq->aq_entbuf; + aiov[1].iov_len = alq->aq_writehead; + totlen = aiov[0].iov_len + aiov[1].iov_len; + } alq->aq_flags |= AQ_FLUSHING; ALQ_UNLOCK(alq); - if (iov == 2 || aiov[iov].iov_base == NULL) - iov--; - auio.uio_iov = &aiov[0]; auio.uio_offset = 0; auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; - auio.uio_iovcnt = iov + 1; + auio.uio_iovcnt = iov; auio.uio_resid = totlen; auio.uio_td = td; @@ -350,8 +382,28 @@ alq_doio(struct alq *alq) ALQ_LOCK(alq); alq->aq_flags &= ~AQ_FLUSHING; - if (alq->aq_entfree == NULL) - alq->aq_entfree = alstart; + /* Adjust writetail as required, taking into account wrapping. */ + alq->aq_writetail = (alq->aq_writetail + totlen + wrapearly) % + alq->aq_buflen; + alq->aq_freebytes += totlen + wrapearly; + + /* + * If we just flushed part of the buffer which wrapped, reset the + * wrapearly indicator. + */ + if (wrapearly) + alq->aq_wrapearly = 0; + + /* + * If we just flushed the buffer completely, reset indexes to 0 to + * minimise buffer wraps. + * This is also required to ensure alq_getn() can't wedge itself. + */ + if (!HAS_PENDING_DATA(alq)) + alq->aq_writehead = alq->aq_writetail = 0; + + KASSERT((alq->aq_writetail >= 0 && alq->aq_writetail < alq->aq_buflen), + ("%s: aq_writetail < 0 || aq_writetail >= aq_buflen", __func__)); if (alq->aq_flags & AQ_WANTED) { alq->aq_flags &= ~AQ_WANTED; @@ -376,27 +428,27 @@ SYSINIT(ald, SI_SUB_LOCK, SI_ORDER_ANY, /* * Create the queue data structure, allocate the buffer, and open the file. */ + int -alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, - int size, int count) +alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int flags) { struct thread *td; struct nameidata nd; - struct ale *ale; - struct ale *alp; struct alq *alq; - char *bufp; - int flags; + int oflags; int error; - int i, vfslocked; + int vfslocked; + + KASSERT((size > 0), ("%s: size <= 0", __func__)); *alqp = NULL; td = curthread; NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, file, td); - flags = FWRITE | O_NOFOLLOW | O_CREAT; + oflags = FWRITE | O_NOFOLLOW | O_CREAT; - error = vn_open_cred(&nd, &flags, cmode, 0, cred, NULL); + error = vn_open_cred(&nd, &oflags, cmode, 0, cred, NULL); if (error) return (error); @@ -407,31 +459,20 @@ alq_open(struct alq **alqp, const char * VFS_UNLOCK_GIANT(vfslocked); alq = malloc(sizeof(*alq), M_ALD, M_WAITOK|M_ZERO); - alq->aq_entbuf = malloc(count * size, M_ALD, M_WAITOK|M_ZERO); - alq->aq_first = malloc(sizeof(*ale) * count, M_ALD, M_WAITOK|M_ZERO); alq->aq_vp = nd.ni_vp; alq->aq_cred = crhold(cred); - alq->aq_entmax = count; - alq->aq_entlen = size; - alq->aq_entfree = alq->aq_first; mtx_init(&alq->aq_mtx, "ALD Queue", NULL, MTX_SPIN|MTX_QUIET); - bufp = alq->aq_entbuf; - ale = alq->aq_first; - alp = NULL; - - /* Match up entries with buffers */ - for (i = 0; i < count; i++) { - if (alp) - alp->ae_next = ale; - ale->ae_data = bufp; - alp = ale; - ale++; - bufp += size; - } - - alp->ae_next = alq->aq_first; + alq->aq_buflen = size; + alq->aq_entmax = 0; + alq->aq_entlen = 0; + + alq->aq_freebytes = alq->aq_buflen; + alq->aq_entbuf = malloc(alq->aq_buflen, M_ALD, M_WAITOK|M_ZERO); + alq->aq_writehead = alq->aq_writetail = 0; + if (flags & ALQ_ORDERED) + alq->aq_flags |= AQ_ORDERED; if ((error = ald_add(alq)) != 0) { alq_destroy(alq); @@ -443,77 +484,405 @@ alq_open(struct alq **alqp, const char * return (0); } +int +alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int count) +{ + int ret; + + KASSERT((count >= 0), ("%s: count < 0", __func__)); + + if (count > 0) { + ret = alq_open_flags(alqp, file, cred, cmode, size*count, 0); + (*alqp)->aq_flags |= AQ_LEGACY; + (*alqp)->aq_entmax = count; + (*alqp)->aq_entlen = size; + } else + ret = alq_open_flags(alqp, file, cred, cmode, size, 0); + + return (ret); +} + + /* * Copy a new entry into the queue. If the operation would block either * wait or return an error depending on the value of waitok. */ int -alq_write(struct alq *alq, void *data, int waitok) +alq_writen(struct alq *alq, void *data, int len, int flags) { - struct ale *ale; + int activate, copy, ret; + void *waitchan; + + KASSERT((len > 0 && len <= alq->aq_buflen), + ("%s: len <= 0 || len > aq_buflen", __func__)); - if ((ale = alq_get(alq, waitok)) == NULL) + activate = ret = 0; + copy = len; + waitchan = NULL; + + ALQ_LOCK(alq); + + /* + * Fail to perform the write and return EWOULDBLOCK if: + * - The message is larger than our underlying buffer. + * - The ALQ is being shutdown. + * - There is insufficient free space in our underlying buffer + * to accept the message and the user can't wait for space. + * - There is insufficient free space in our underlying buffer + * to accept the message and the alq is inactive due to prior + * use of the ALQ_NOACTIVATE flag (which would lead to deadlock). + */ + if (len > alq->aq_buflen || + alq->aq_flags & AQ_SHUTDOWN || + (((flags & ALQ_NOWAIT) || (!(alq->aq_flags & AQ_ACTIVE) && + HAS_PENDING_DATA(alq))) && alq->aq_freebytes < len)) { + ALQ_UNLOCK(alq); return (EWOULDBLOCK); + } - bcopy(data, ale->ae_data, alq->aq_entlen); - alq_post(alq, ale); + /* + * If we want ordered writes and there is already at least one thread + * waiting for resources to become available, sleep until we're woken. + */ + if (alq->aq_flags & AQ_ORDERED && alq->aq_waiters > 0) { + KASSERT(!(flags & ALQ_NOWAIT), + ("%s: ALQ_NOWAIT set but incorrectly ignored!", __func__)); + alq->aq_waiters++; + msleep_spin(&alq->aq_waiters, &alq->aq_mtx, "alqwnord", 0); + alq->aq_waiters--; + } - return (0); + /* + * (ALQ_WAITOK && aq_freebytes < len) or aq_freebytes >= len, either + * enter while loop and sleep until we have enough free bytes (former) + * or skip (latter). If AQ_ORDERED is set, only 1 thread at a time will + * be in this loop. Otherwise, multiple threads may be sleeping here + * competing for ALQ resources. + */ + while (alq->aq_freebytes < len && !(alq->aq_flags & AQ_SHUTDOWN)) { + KASSERT(!(flags & ALQ_NOWAIT), + ("%s: ALQ_NOWAIT set but incorrectly ignored!", __func__)); + alq->aq_flags |= AQ_WANTED; + alq->aq_waiters++; + if (waitchan) + wakeup(waitchan); + msleep_spin(alq, &alq->aq_mtx, "alqwnres", 0); + alq->aq_waiters--; + + /* + * If we're the first thread to wake after an AQ_WANTED wakeup + * but there isn't enough free space for us, we're going to loop + * and sleep again. If there are other threads waiting in this + * loop, schedule a wakeup so that they can see if the space + * they require is available. + */ + if (alq->aq_waiters > 0 && !(alq->aq_flags & AQ_ORDERED) && + alq->aq_freebytes < len && !(alq->aq_flags & AQ_WANTED)) + waitchan = alq; + else + waitchan = NULL; + } + + /* + * If there are waiters, we need to signal the waiting threads after we + * complete our work. The alq ptr is used as a wait channel for threads + * requiring resources to be freed up. In the AQ_ORDERED case, threads + * are not allowed to concurrently compete for resources in the above + * while loop, so we use a different wait channel in this case. + */ + if (alq->aq_waiters > 0) { + if (alq->aq_flags & AQ_ORDERED) + waitchan = &alq->aq_waiters; + else + waitchan = alq; + } else + waitchan = NULL; + + /* Bail if we're shutting down. */ + if (alq->aq_flags & AQ_SHUTDOWN) { + ret = EWOULDBLOCK; + goto unlock; + } + + /* + * If we need to wrap the buffer to accommodate the write, + * we'll need 2 calls to bcopy. + */ + if ((alq->aq_buflen - alq->aq_writehead) < len) + copy = alq->aq_buflen - alq->aq_writehead; + + /* Copy message (or part thereof if wrap required) to the buffer. */ + bcopy(data, alq->aq_entbuf + alq->aq_writehead, copy); + alq->aq_writehead += copy; + + if (alq->aq_writehead >= alq->aq_buflen) { + KASSERT((alq->aq_writehead == alq->aq_buflen), + ("%s: alq->aq_writehead (%d) > alq->aq_buflen (%d)", + __func__, + alq->aq_writehead, + alq->aq_buflen)); + alq->aq_writehead = 0; + } + + if (copy != len) { + /* + * Wrap the buffer by copying the remainder of our message + * to the start of the buffer and resetting aq_writehead. + */ + bcopy(((uint8_t *)data)+copy, alq->aq_entbuf, len - copy); + alq->aq_writehead = len - copy; + } + + KASSERT((alq->aq_writehead >= 0 && alq->aq_writehead < alq->aq_buflen), + ("%s: aq_writehead < 0 || aq_writehead >= aq_buflen", __func__)); + + alq->aq_freebytes -= len; + + if (!(alq->aq_flags & AQ_ACTIVE) && !(flags & ALQ_NOACTIVATE)) { + alq->aq_flags |= AQ_ACTIVE; + activate = 1; + } + + KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue empty!", __func__)); + +unlock: + ALQ_UNLOCK(alq); + + if (activate) { + ALD_LOCK(); + ald_activate(alq); + ALD_UNLOCK(); + } + + /* NB: We rely on wakeup_one waking threads in a FIFO manner. */ + if (waitchan != NULL) + wakeup_one(waitchan); + + return (ret); +} + +int +alq_write(struct alq *alq, void *data, int flags) +{ + /* Should only be called in fixed length message (legacy) mode. */ + KASSERT((alq->aq_flags & AQ_LEGACY), + ("%s: fixed length write on variable length queue", __func__)); + return (alq_writen(alq, data, alq->aq_entlen, flags)); } +/* + * Retrieve a pointer for the ALQ to write directly into, avoiding bcopy. + */ struct ale * -alq_get(struct alq *alq, int waitok) +alq_getn(struct alq *alq, int len, int flags) { - struct ale *ale; - struct ale *aln; + int contigbytes; + void *waitchan; + + KASSERT((len > 0 && len <= alq->aq_buflen), + ("%s: len <= 0 || len > alq->aq_buflen", __func__)); - ale = NULL; + waitchan = NULL; ALQ_LOCK(alq); - /* Loop until we get an entry or we're shutting down */ - while ((alq->aq_flags & AQ_SHUTDOWN) == 0 && - (ale = alq->aq_entfree) == NULL && - (waitok & ALQ_WAITOK)) { + /* + * Determine the number of free contiguous bytes. + * We ensure elsewhere that if aq_writehead == aq_writetail because + * the buffer is empty, they will both be set to 0 and therefore + * aq_freebytes == aq_buflen and is fully contiguous. + * If they are equal and the buffer is not empty, aq_freebytes will + * be 0 indicating the buffer is full. + */ + if (alq->aq_writehead <= alq->aq_writetail) + contigbytes = alq->aq_freebytes; + else { + contigbytes = alq->aq_buflen - alq->aq_writehead; + + if (contigbytes < len) { + /* + * Insufficient space at end of buffer to handle a + * contiguous write. Wrap early if there's space at + * the beginning. This will leave a hole at the end + * of the buffer which we will have to skip over when + * flushing the buffer to disk. + */ + if (alq->aq_writetail >= len || flags & ALQ_WAITOK) { + /* Keep track of # bytes left blank. */ + alq->aq_wrapearly = contigbytes; + /* Do the wrap and adjust counters. */ + contigbytes = alq->aq_freebytes = + alq->aq_writetail; + alq->aq_writehead = 0; + } + } + } + + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 03:41:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF0F1065672; Thu, 8 Jul 2010 03:41:57 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1E988FC17; Thu, 8 Jul 2010 03:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o683fvgd092592; Thu, 8 Jul 2010 03:41:57 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o683fvAH092590; Thu, 8 Jul 2010 03:41:57 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080341.o683fvAH092590@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 03:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209790 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 03:41:58 -0000 Author: lstewart Date: Thu Jul 8 03:41:57 2010 New Revision: 209790 URL: http://svn.freebsd.org/changeset/base/209790 Log: MFC r209119,209325: - Add a utility macro to simplify calculating an aggregate sum from a DPCPU counter variable. - Rename the internal for loop iterator to "_i" to avoid potential shadowing of external variables named "i". The "_" prefix is reserved for infrastructure type code and is therefore not expected to be used by normal code likely to call DPCPU_SUM(). [1] - Change DPCPU_SUM to return the sum rather than calculate and assign it internally. Usage is now: "sum = DPCPU_SUM(dpcpu_var, member_to_sum);" [2] - Fix some style nits. [3] Sponsored by: FreeBSD Foundation Suggested by: bde [3], mdf [1], kib [1,2], pjd [1,3] Reviewed by: jhb, rpaulo, rwatson (old version of r209119), kib (r209325) Modified: stable/8/sys/sys/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/pcpu.h ============================================================================== --- stable/8/sys/sys/pcpu.h Thu Jul 8 03:35:00 2010 (r209789) +++ stable/8/sys/sys/pcpu.h Thu Jul 8 03:41:57 2010 (r209790) @@ -109,6 +109,21 @@ extern uintptr_t dpcpu_off[]; #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) +/* + * Utility macros. + */ +#define DPCPU_SUM(n, var) __extension__ \ +({ \ + u_int _i; \ + __typeof((DPCPU_PTR(n))->var) sum; \ + \ + sum = 0; \ + CPU_FOREACH(_i) { \ + sum += (DPCPU_ID_PTR(_i, n))->var; \ + } \ + sum; \ +}) + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 12:20:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F5B106566B; Thu, 8 Jul 2010 12:20:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2CD68FC1A; Thu, 8 Jul 2010 12:20:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68CKF1w008461; Thu, 8 Jul 2010 12:20:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68CKF03008459; Thu, 8 Jul 2010 12:20:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007081220.o68CKF03008459@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Jul 2010 12:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209795 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 12:20:15 -0000 Author: glebius Date: Thu Jul 8 12:20:15 2010 New Revision: 209795 URL: http://svn.freebsd.org/changeset/base/209795 Log: Merge 209589 from head: After processing the O_SKIPTO opcode our cmd points to the next rule, and "match" processing at the end of inner loop would look ahead into the next rule, which is incorrect. Particularly, in the case when the next rule started with F_NOT opcode it was skipped blindly. To fix this, exit the inner loop with the continue operator forcibly and explicitly. PR: kern/147798 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 8 11:21:11 2010 (r209794) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 8 12:20:15 2010 (r209795) @@ -2012,14 +2012,15 @@ do { \ (1 << chain->map[f_pos]->set)); f_pos++) ; - /* prepare to enter the inner loop */ + /* Re-enter the inner loop at the skipto rule. */ f = chain->map[f_pos]; l = f->cmd_len; cmd = f->cmd; match = 1; cmdlen = 0; skip_or = 0; - break; + continue; + break; /* not reached */ case O_REJECT: /* From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 12:21:26 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08F38106566B; Thu, 8 Jul 2010 12:21:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC44A8FC23; Thu, 8 Jul 2010 12:21:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68CLPun008818; Thu, 8 Jul 2010 12:21:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68CLPOc008816; Thu, 8 Jul 2010 12:21:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007081221.o68CLPOc008816@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Jul 2010 12:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209796 - stable/8/sys/netgraph X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 12:21:26 -0000 Author: glebius Date: Thu Jul 8 12:21:25 2010 New Revision: 209796 URL: http://svn.freebsd.org/changeset/base/209796 Log: Merge 209633, 209722 from head: The struct ipfw_rule_ref follows the struct m_tag. Deal with this correctly. This fixes breakage of ng_ipfw(4) in r201527. Submitted by: Alexander Zagrebin Avoid double-free. In error cases ipfw(4) frees the mbuf(4), we don't need to. PR: kern/145462 Modified: stable/8/sys/netgraph/ng_ipfw.c Modified: stable/8/sys/netgraph/ng_ipfw.c ============================================================================== --- stable/8/sys/netgraph/ng_ipfw.c Thu Jul 8 12:20:15 2010 (r209795) +++ stable/8/sys/netgraph/ng_ipfw.c Thu Jul 8 12:21:25 2010 (r209796) @@ -221,20 +221,21 @@ ng_ipfw_findhook1(node_p node, u_int16_t static int ng_ipfw_rcvdata(hook_p hook, item_p item) { - struct ipfw_rule_ref *tag; + struct m_tag *tag; + struct ipfw_rule_ref *r; struct mbuf *m; NGI_GET_M(item, m); NG_FREE_ITEM(item); - tag = (struct ipfw_rule_ref *) - m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); + tag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); if (tag == NULL) { NG_FREE_M(m); return (EINVAL); /* XXX: find smth better */ }; - if (tag->info & IPFW_INFO_IN) { + r = (struct ipfw_rule_ref *)(tag + 1); + if (r->info & IPFW_INFO_IN) { ip_input(m); return (0); } else { @@ -264,11 +265,8 @@ ng_ipfw_input(struct mbuf **m0, int dir, * Node must be loaded and corresponding hook must be present. */ if (fw_node == NULL || - (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) { - if (tee == 0) - m_freem(*m0); + (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) return (ESRCH); /* no hook associated with this rule */ - } /* * We have two modes: in normal mode we add a tag to packet, which is From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 19:36:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233561065670; Thu, 8 Jul 2010 19:36:39 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 119D18FC0C; Thu, 8 Jul 2010 19:36:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JacpY006021; Thu, 8 Jul 2010 19:36:38 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JacsF006019; Thu, 8 Jul 2010 19:36:38 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007081936.o68JacsF006019@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 8 Jul 2010 19:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209821 - stable/8/sys/dev/bwi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:36:39 -0000 Author: weongyo Date: Thu Jul 8 19:36:38 2010 New Revision: 209821 URL: http://svn.freebsd.org/changeset/base/209821 Log: MFC r209597: Fixes NULL pointer reference that it's occurred when the state is changed to RUN because ic->ic_newassoc isn't set anywhere now. In the previous bwi_newassoc() is used to initialize AMRR rate routines. Tested by: Warren Block Modified: stable/8/sys/dev/bwi/if_bwi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:22:52 2010 (r209820) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:36:38 2010 (r209821) @@ -1769,7 +1769,6 @@ bwi_newstate(struct ieee80211vap *vap, e enum ieee80211_state ostate = vap->iv_state; struct bwi_softc *sc = ifp->if_softc; struct bwi_mac *mac; - struct ieee80211_node *ni = vap->iv_bss; int error; BWI_LOCK(sc); @@ -1817,10 +1816,6 @@ bwi_newstate(struct ieee80211vap *vap, e #else sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif - if (vap->iv_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - ic->ic_newassoc(ni, 1); - } callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 19:40:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FFB106566C; Thu, 8 Jul 2010 19:40:10 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 404E98FC0A; Thu, 8 Jul 2010 19:40:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JeA8P006859; Thu, 8 Jul 2010 19:40:10 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JeAGQ006857; Thu, 8 Jul 2010 19:40:10 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007081940.o68JeAGQ006857@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 8 Jul 2010 19:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209822 - stable/8/sys/dev/bwi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:40:10 -0000 Author: weongyo Date: Thu Jul 8 19:40:09 2010 New Revision: 209822 URL: http://svn.freebsd.org/changeset/base/209822 Log: MFC r209598: Initializes the ratectl for a node when the state is changed to RUN. This prevents a kernel fault by dividing with zero because the initial rate was 0 and didn't be initialized. Tested by: Warren Block Modified: stable/8/sys/dev/bwi/if_bwi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:36:38 2010 (r209821) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:40:09 2010 (r209822) @@ -1764,6 +1764,7 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); + const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1817,6 +1818,11 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif + /* Initializes ratectl for a node. */ + tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; + if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) + ieee80211_ratectl_node_init(vap->iv_bss); + callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 20:17:56 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C289106564A; Thu, 8 Jul 2010 20:17:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9EB8FC1E; Thu, 8 Jul 2010 20:17:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KHuhn015199; Thu, 8 Jul 2010 20:17:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68KHuLa015197; Thu, 8 Jul 2010 20:17:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082017.o68KHuLa015197@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209823 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:17:56 -0000 Author: avg Date: Thu Jul 8 20:17:56 2010 New Revision: 209823 URL: http://svn.freebsd.org/changeset/base/209823 Log: MFC r209056: vnode.h: expand debug macros to non-empty void statements when DEBUG_VFS_LOCKS is disabled Modified: stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Thu Jul 8 19:40:09 2010 (r209822) +++ stable/8/sys/sys/vnode.h Thu Jul 8 20:17:56 2010 (r209823) @@ -524,17 +524,17 @@ void assert_vop_unlocked(struct vnode *v #else /* !DEBUG_VFS_LOCKS */ -#define ASSERT_VI_LOCKED(vp, str) -#define ASSERT_VI_UNLOCKED(vp, str) -#define ASSERT_VOP_ELOCKED(vp, str) +#define ASSERT_VI_LOCKED(vp, str) ((void)0) +#define ASSERT_VI_UNLOCKED(vp, str) ((void)0) +#define ASSERT_VOP_ELOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_ELOCKED_OTHER(vp, str) #endif -#define ASSERT_VOP_LOCKED(vp, str) +#define ASSERT_VOP_LOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_SLOCKED(vp, str) #endif -#define ASSERT_VOP_UNLOCKED(vp, str) +#define ASSERT_VOP_UNLOCKED(vp, str) ((void)0) #endif /* DEBUG_VFS_LOCKS */ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 20:38:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309C2106566B; Thu, 8 Jul 2010 20:38:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB8C8FC08; Thu, 8 Jul 2010 20:38:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KcniU019943; Thu, 8 Jul 2010 20:38:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kcmui019934; Thu, 8 Jul 2010 20:38:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082038.o68Kcmui019934@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209825 - in stable/8/sys: dev/acpica dev/usb fs/procfs geom kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:38:49 -0000 Author: avg Date: Thu Jul 8 20:38:48 2010 New Revision: 209825 URL: http://svn.freebsd.org/changeset/base/209825 Log: MFC r209062: fix a few cases where a string is passed via format argument instead of via %s Note: no MFC to stable/7 Modified: stable/8/sys/dev/acpica/acpi_thermal.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_process.c stable/8/sys/fs/procfs/procfs_type.c stable/8/sys/geom/geom_dev.c stable/8/sys/kern/subr_kdb.c stable/8/sys/kern/subr_taskqueue.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_thermal.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_thermal.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/acpica/acpi_thermal.c Thu Jul 8 20:38:48 2010 (r209825) @@ -1171,7 +1171,6 @@ static int acpi_tz_cooling_thread_start(struct acpi_tz_softc *sc) { int error; - char name[16]; ACPI_LOCK(thermal); if (sc->tz_cooling_proc_running) { @@ -1182,10 +1181,9 @@ acpi_tz_cooling_thread_start(struct acpi ACPI_UNLOCK(thermal); error = 0; if (sc->tz_cooling_proc == NULL) { - snprintf(name, sizeof(name), "acpi_cooling%d", - device_get_unit(sc->tz_dev)); error = kproc_create(acpi_tz_cooling_thread, sc, - &sc->tz_cooling_proc, RFHIGHPID, 0, name); + &sc->tz_cooling_proc, RFHIGHPID, 0, "acpi_cooling%d", + device_get_unit(sc->tz_dev)); if (error != 0) { device_printf(sc->tz_dev, "could not create thread - %d", error); ACPI_LOCK(thermal); Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/usb/usb_dev.c Thu Jul 8 20:38:48 2010 (r209825) @@ -1733,7 +1733,7 @@ usb_fifo_attach(struct usb_device *udev, /* Now, create the device itself */ f_sc->dev = make_dev(&usb_devsw, 0, uid, gid, mode, - devname); + "%s", devname); /* XXX setting si_drv1 and creating the device is not atomic! */ f_sc->dev->si_drv1 = pd; } Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/usb/usb_device.c Thu Jul 8 20:38:48 2010 (r209825) @@ -1577,7 +1577,7 @@ usb_alloc_device(device_t parent_dev, st udev->ctrl_dev = usb_make_dev(udev, 0, FREAD|FWRITE); /* Create a link from /dev/ugenX.X to the default endpoint */ - make_dev_alias(udev->ctrl_dev, udev->ugen_name); + make_dev_alias(udev->ctrl_dev, "%s", udev->ugen_name); #endif if (udev->flags.usb_mode == USB_MODE_HOST) { Modified: stable/8/sys/dev/usb/usb_process.c ============================================================================== --- stable/8/sys/dev/usb/usb_process.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/usb/usb_process.c Thu Jul 8 20:38:48 2010 (r209825) @@ -221,7 +221,7 @@ usb_proc_create(struct usb_process *up, cv_init(&up->up_drain, "usbdrain"); if (USB_THREAD_CREATE(&usb_process, up, - &up->up_ptr, pmesg)) { + &up->up_ptr, "%s", pmesg)) { DPRINTFN(0, "Unable to create USB process."); up->up_ptr = NULL; goto error; Modified: stable/8/sys/fs/procfs/procfs_type.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_type.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/fs/procfs/procfs_type.c Thu Jul 8 20:38:48 2010 (r209825) @@ -48,9 +48,9 @@ procfs_doproctype(PFS_FILL_ARGS) static const char *none = "Not Available"; if (p != NULL && p->p_sysent && p->p_sysent->sv_name) - sbuf_printf(sb, p->p_sysent->sv_name); + sbuf_printf(sb, "%s", p->p_sysent->sv_name); else - sbuf_printf(sb, none); + sbuf_printf(sb, "%s", none); sbuf_putc(sb, '\n'); return (0); } Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/geom/geom_dev.c Thu Jul 8 20:38:48 2010 (r209825) @@ -127,7 +127,7 @@ g_dev_taste(struct g_class *mp, struct g KASSERT(error == 0, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); dev = make_dev(&g_dev_cdevsw, 0, - UID_ROOT, GID_OPERATOR, 0640, gp->name); + UID_ROOT, GID_OPERATOR, 0640, "%s", gp->name); if (pp->flags & G_PF_CANDELETE) dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/kern/subr_kdb.c Thu Jul 8 20:38:48 2010 (r209825) @@ -230,7 +230,7 @@ kdb_panic(const char *msg) stop_cpus_hard(PCPU_GET(other_cpus)); #endif printf("KDB: panic\n"); - panic(msg); + panic("%s", msg); } void Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/kern/subr_taskqueue.c Thu Jul 8 20:38:48 2010 (r209825) @@ -322,7 +322,7 @@ taskqueue_start_threads(struct taskqueue for (i = 0; i < count; i++) { if (count == 1) error = kthread_add(taskqueue_thread_loop, tqp, NULL, - &tq->tq_threads[i], RFSTOPPED, 0, ktname); + &tq->tq_threads[i], RFSTOPPED, 0, "%s", ktname); else error = kthread_add(taskqueue_thread_loop, tqp, NULL, &tq->tq_threads[i], RFSTOPPED, 0, From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 20:40:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1D1106564A; Thu, 8 Jul 2010 20:40:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCCA98FC14; Thu, 8 Jul 2010 20:40:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KevVd020511; Thu, 8 Jul 2010 20:40:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kevp7020509; Thu, 8 Jul 2010 20:40:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082040.o68Kevp7020509@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209826 - stable/8/sys/fs/udf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:40:57 -0000 Author: avg Date: Thu Jul 8 20:40:57 2010 New Revision: 209826 URL: http://svn.freebsd.org/changeset/base/209826 Log: MFC r209425: udf_vnops: cosmetic followup to r208671 Modified: stable/8/sys/fs/udf/udf_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/8/sys/fs/udf/udf_vnops.c Thu Jul 8 20:38:48 2010 (r209825) +++ stable/8/sys/fs/udf/udf_vnops.c Thu Jul 8 20:40:57 2010 (r209826) @@ -904,8 +904,8 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + buf = malloc(len, M_DEVBUF, M_WAITOK); iov[0].iov_len = len; - buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; uio.uio_iov = iov; uio.uio_iovcnt = 1; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 20:46:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1DC4106566B; Thu, 8 Jul 2010 20:46:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69E48FC08; Thu, 8 Jul 2010 20:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Kkt3b021911; Thu, 8 Jul 2010 20:46:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68KktMu021907; Thu, 8 Jul 2010 20:46:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082046.o68KktMu021907@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209828 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:46:56 -0000 Author: avg Date: Thu Jul 8 20:46:55 2010 New Revision: 209828 URL: http://svn.freebsd.org/changeset/base/209828 Log: MFC r209193: sound/pcm: use non-const string with SYSCTL_STRING Modified: stable/8/sys/dev/sound/pcm/feeder_eq.c stable/8/sys/dev/sound/pcm/feeder_rate.c stable/8/sys/dev/sound/pcm/sound.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pcm/feeder_eq.c ============================================================================== --- stable/8/sys/dev/sound/pcm/feeder_eq.c Thu Jul 8 20:43:20 2010 (r209827) +++ stable/8/sys/dev/sound/pcm/feeder_eq.c Thu Jul 8 20:46:55 2010 (r209828) @@ -93,7 +93,7 @@ SND_DECLARE_FILE("$FreeBSD$"); static int feeder_eq_exact_rate = 0; #ifdef _KERNEL -static const char feeder_eq_presets[] = FEEDER_EQ_PRESETS; +static char feeder_eq_presets[] = FEEDER_EQ_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_eq_presets, CTLFLAG_RD, &feeder_eq_presets, 0, "compile-time eq presets"); Modified: stable/8/sys/dev/sound/pcm/feeder_rate.c ============================================================================== --- stable/8/sys/dev/sound/pcm/feeder_rate.c Thu Jul 8 20:43:20 2010 (r209827) +++ stable/8/sys/dev/sound/pcm/feeder_rate.c Thu Jul 8 20:46:55 2010 (r209828) @@ -159,7 +159,7 @@ int feeder_rate_quality = Z_QUALITY_DEFA static int feeder_rate_polyphase_max = Z_POLYPHASE_MAX; #ifdef _KERNEL -static const char feeder_rate_presets[] = FEEDER_RATE_PRESETS; +static char feeder_rate_presets[] = FEEDER_RATE_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_rate_presets, CTLFLAG_RD, &feeder_rate_presets, 0, "compile-time rate presets"); Modified: stable/8/sys/dev/sound/pcm/sound.c ============================================================================== --- stable/8/sys/dev/sound/pcm/sound.c Thu Jul 8 20:43:20 2010 (r209827) +++ stable/8/sys/dev/sound/pcm/sound.c Thu Jul 8 20:46:55 2010 (r209828) @@ -68,7 +68,7 @@ SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_ * XXX I've had enough with people not telling proper version/arch * while reporting problems, not after 387397913213th questions/requests. */ -static const char snd_driver_version[] = +static char snd_driver_version[] = __XSTRING(SND_DRV_VERSION)"/"MACHINE_ARCH; SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, 0, "driver version/arch"); From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 20:57:08 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CDC1106564A; Thu, 8 Jul 2010 20:57:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6A58FC16; Thu, 8 Jul 2010 20:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Kv7Xo024880; Thu, 8 Jul 2010 20:57:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kv763024878; Thu, 8 Jul 2010 20:57:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082057.o68Kv763024878@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209829 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:57:08 -0000 Author: avg Date: Thu Jul 8 20:57:07 2010 New Revision: 209829 URL: http://svn.freebsd.org/changeset/base/209829 Log: MFC r209228: device.hints: do install when WITHOUT_BOOT is set Modified: stable/8/etc/Makefile Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/Makefile ============================================================================== --- stable/8/etc/Makefile Thu Jul 8 20:46:55 2010 (r209828) +++ stable/8/etc/Makefile Thu Jul 8 20:57:07 2010 (r209829) @@ -245,11 +245,13 @@ distribution: ${DESTDIR}/var/crash cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${FREEBSD} ${DESTDIR}/ +.if ${MK_BOOT} != "no" .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints) ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ ${DESTDIR}/boot/device.hints .endif +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 21:02:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 880F0106564A; Thu, 8 Jul 2010 21:02:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 762638FC12; Thu, 8 Jul 2010 21:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68L2WGM026588; Thu, 8 Jul 2010 21:02:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68L2WSR026586; Thu, 8 Jul 2010 21:02:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082102.o68L2WSR026586@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 21:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209831 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:02:32 -0000 Author: avg Date: Thu Jul 8 21:02:31 2010 New Revision: 209831 URL: http://svn.freebsd.org/changeset/base/209831 Log: MFC r209247: lock_profile_release_lock: do not compare unsigned with zero Note: no MFC to stable/7 Modified: stable/8/sys/kern/subr_lock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_lock.c ============================================================================== --- stable/8/sys/kern/subr_lock.c Thu Jul 8 20:57:37 2010 (r209830) +++ stable/8/sys/kern/subr_lock.c Thu Jul 8 21:02:31 2010 (r209831) @@ -600,7 +600,7 @@ lock_profile_release_lock(struct lock_ob struct lock_profile_object *l; struct lock_prof_type *type; struct lock_prof *lp; - u_int64_t holdtime; + u_int64_t curtime, holdtime; struct lpohead *head; int spin; @@ -628,9 +628,11 @@ lock_profile_release_lock(struct lock_ob lp = lock_profile_lookup(lo, spin, l->lpo_file, l->lpo_line); if (lp == NULL) goto release; - holdtime = nanoseconds() - l->lpo_acqtime; - if (holdtime < 0) + curtime = nanoseconds(); + if (curtime < l->lpo_acqtime) goto release; + holdtime = curtime - l->lpo_acqtime; + /* * Record if the lock has been held longer now than ever * before. From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 21:24:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFE5106566C; Thu, 8 Jul 2010 21:24:28 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9578FC13; Thu, 8 Jul 2010 21:24:26 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA04678; Fri, 09 Jul 2010 00:24:25 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OWya1-000489-1y; Fri, 09 Jul 2010 00:24:25 +0300 Message-ID: <4C364206.4070500@freebsd.org> Date: Fri, 09 Jul 2010 00:24:22 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Andriy Gapon References: <201007082057.o68Kv763024878@svn.freebsd.org> In-Reply-To: <201007082057.o68Kv763024878@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209829 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:24:28 -0000 on 08/07/2010 23:57 Andriy Gapon said the following: > Author: avg > Date: Thu Jul 8 20:57:07 2010 > New Revision: 209829 > URL: http://svn.freebsd.org/changeset/base/209829 > > Log: > MFC r209228: device.hints: do install when WITHOUT_BOOT is set "do NOT install" - stupid mistake in the original commit message got replicated. -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 21:34:18 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E201065670; Thu, 8 Jul 2010 21:34:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837068FC1D; Thu, 8 Jul 2010 21:34:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68LYIdZ033874; Thu, 8 Jul 2010 21:34:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68LYIZd033872; Thu, 8 Jul 2010 21:34:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082134.o68LYIZd033872@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 21:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209833 - stable/8/contrib/binutils/binutils/doc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:34:18 -0000 Author: avg Date: Thu Jul 8 21:34:18 2010 New Revision: 209833 URL: http://svn.freebsd.org/changeset/base/209833 Log: MFC r209413: readelf.1: remove duplicate -u/--unwind option description Modified: stable/8/contrib/binutils/binutils/doc/readelf.1 Directory Properties: stable/8/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/binutils/doc/readelf.1 ============================================================================== --- stable/8/contrib/binutils/binutils/doc/readelf.1 Thu Jul 8 21:26:26 2010 (r209832) +++ stable/8/contrib/binutils/binutils/doc/readelf.1 Thu Jul 8 21:34:18 2010 (r209833) @@ -247,14 +247,6 @@ Displays the contents of the file's relo .PD Displays the contents of the file's unwind section, if it has one. Only the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 21:56:05 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71E0A1065672; Thu, 8 Jul 2010 21:56:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4683A8FC13; Thu, 8 Jul 2010 21:56:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Lu5bq038683; Thu, 8 Jul 2010 21:56:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Lu5l4038681; Thu, 8 Jul 2010 21:56:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007082156.o68Lu5l4038681@svn.freebsd.org> From: John Baldwin Date: Thu, 8 Jul 2010 21:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209835 - stable/8/sys/i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:56:05 -0000 Author: jhb Date: Thu Jul 8 21:56:05 2010 New Revision: 209835 URL: http://svn.freebsd.org/changeset/base/209835 Log: MFC 208742: MFamd64: Add a new macro PCPU_XEN_FIELDS to hold XEN-specific per-CPU fields that is always included in PCPU_MD_FIELDS. The macro is empty for non-XEN kernels. This avoids duplicating non-XEN per-CPU fields in two places. While here, remove several unused fields from the XEN-specific structure. Modified: stable/8/sys/i386/include/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/include/pcpu.h ============================================================================== --- stable/8/sys/i386/include/pcpu.h Thu Jul 8 21:35:57 2010 (r209834) +++ stable/8/sys/i386/include/pcpu.h Thu Jul 8 21:56:05 2010 (r209835) @@ -62,35 +62,20 @@ struct shadow_time_info { uint32_t version; }; - -#define PCPU_MD_FIELDS \ - char pc_monitorbuf[128] __aligned(128); /* cache line */ \ - struct pcpu *pc_prvspace; /* Self-reference */ \ - struct pmap *pc_curpmap; \ - struct i386tss pc_common_tss; \ - struct segment_descriptor pc_common_tssd; \ - struct segment_descriptor *pc_tss_gdt; \ - struct segment_descriptor *pc_fsgs_gdt; \ - vm_paddr_t *pc_pdir_shadow; \ - int pc_currentldt; \ - u_int pc_acpi_id; /* ACPI CPU id */ \ - u_int pc_apic_id; \ - int pc_private_tss; /* Flag indicating private tss*/\ - u_int pc_cr3; /* track cr3 for R1/R3*/ \ - u_int pc_pdir; \ - u_int pc_lazypmap; \ - u_int pc_rendezvous; \ - u_int pc_cpuast; \ - uint64_t pc_processed_system_time; \ +#define PCPU_XEN_FIELDS \ + ; \ + u_int pc_cr3; /* track cr3 for R1/R3*/ \ + vm_paddr_t *pc_pdir_shadow; \ + uint64_t pc_processed_system_time; \ struct shadow_time_info pc_shadow_time; \ int pc_resched_irq; \ int pc_callfunc_irq; \ - int pc_virq_to_irq[NR_VIRQS]; \ - int pc_ipi_to_irq[NR_IPIS] - - - + int pc_virq_to_irq[NR_VIRQS]; \ + int pc_ipi_to_irq[NR_IPIS] #else +#define PCPU_XEN_FIELDS +#endif + #define PCPU_MD_FIELDS \ char pc_monitorbuf[128] __aligned(128); /* cache line */ \ struct pcpu *pc_prvspace; /* Self-reference */ \ @@ -102,9 +87,8 @@ struct shadow_time_info { int pc_currentldt; \ u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_apic_id; \ - int pc_private_tss /* Flag indicating private tss */ - -#endif + int pc_private_tss /* Flag indicating private tss */\ + PCPU_XEN_FIELDS #ifdef _KERNEL From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 23:25:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1AF91065670; Thu, 8 Jul 2010 23:25:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 961098FC0A; Thu, 8 Jul 2010 23:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68NPX2X058626; Thu, 8 Jul 2010 23:25:33 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68NPXvi058623; Thu, 8 Jul 2010 23:25:33 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201007082325.o68NPXvi058623@svn.freebsd.org> From: Attilio Rao Date: Thu, 8 Jul 2010 23:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209838 - in stable/8/sys: kern sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 23:25:33 -0000 Author: attilio Date: Thu Jul 8 23:25:33 2010 New Revision: 209838 URL: http://svn.freebsd.org/changeset/base/209838 Log: MFC r208587: Add the support for reporting the NOCOREDUMP flag from sysctl_kern_proc_vmmap(). Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/kern_proc.c stable/8/sys/sys/user.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Thu Jul 8 22:21:18 2010 (r209837) +++ stable/8/sys/kern/kern_proc.c Thu Jul 8 23:25:33 2010 (r209838) @@ -1576,6 +1576,8 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); @@ -1751,6 +1753,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); Modified: stable/8/sys/sys/user.h ============================================================================== --- stable/8/sys/sys/user.h Thu Jul 8 22:21:18 2010 (r209837) +++ stable/8/sys/sys/user.h Thu Jul 8 23:25:33 2010 (r209838) @@ -336,6 +336,7 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 +#define KVME_FLAG_NOCOREDUMP 0x00000004 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 From owner-svn-src-stable-8@FreeBSD.ORG Fri Jul 9 08:48:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9D561065674; Fri, 9 Jul 2010 08:48:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5EAB8FC1D; Fri, 9 Jul 2010 08:48:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o698mpaw083013; Fri, 9 Jul 2010 08:48:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o698mpda083004; Fri, 9 Jul 2010 08:48:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201007090848.o698mpda083004@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 9 Jul 2010 08:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209843 - in stable/8: share/man/man4 sys/conf sys/modules/netgraph sys/modules/netgraph/patch sys/netgraph X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 08:48:51 -0000 Author: ae Date: Fri Jul 9 08:48:51 2010 New Revision: 209843 URL: http://svn.freebsd.org/changeset/base/209843 Log: MFC r208946: New netgraph node ng_patch(4). It performs data modification of packets passing through. Modifications are restricted to a subset of C language operations on unsigned integers of 8, 16, 32 or 64 bit size. These are: set to new value (=), addition (+=), subtraction (-=), multiplication (*=), division (/=), negation (= -), bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=), shift right (>>=). Several operations are all applied to a packet sequentially in order they were specified by user. Submitted by: Maxim Ignatenko Vadim Goncharov Discussed with: net@ MFC r208947: Fix typo. MFC r208989: Style(9) fixes: * Sort includes * Replace #define to #define * Split declarations and initializations * Split long lines Requested by: kib MFC r209194: * Include sys/systm.h for KASSERT() * Remove unneeded includes and comment * Replace home made OFFSETOF() macro with standard offsetof() Pointed out by: bde Approved by: kib (mentor) Added: stable/8/share/man/man4/ng_patch.4 - copied unchanged from r208946, head/share/man/man4/ng_patch.4 stable/8/sys/modules/netgraph/patch/ - copied from r208946, head/sys/modules/netgraph/patch/ stable/8/sys/netgraph/ng_patch.c - copied, changed from r208946, head/sys/netgraph/ng_patch.c stable/8/sys/netgraph/ng_patch.h - copied, changed from r208946, head/sys/netgraph/ng_patch.h Modified: stable/8/share/man/man4/Makefile stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/conf/options stable/8/sys/modules/netgraph/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/share/man/man4/Makefile Fri Jul 9 08:48:51 2010 (r209843) @@ -272,6 +272,7 @@ MAN= aac.4 \ ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ + ng_patch.4 \ ng_ppp.4 \ ng_pppoe.4 \ ng_pptpgre.4 \ Copied: stable/8/share/man/man4/ng_patch.4 (from r208946, head/share/man/man4/ng_patch.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/ng_patch.4 Fri Jul 9 08:48:51 2010 (r209843, copy of r208946, head/share/man/man4/ng_patch.4) @@ -0,0 +1,235 @@ +.\" Copyright (c) 2010 Maxim Ignatenko +.\" Copyright (c) 2010 Vadim Goncharov +.\" 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$ +.\" +.Dd June 9, 2010 +.Dt NG_PATCH 4 +.Os +.Sh NAME +.Nm ng_patch +.Nd "trivial mbuf data modifying netgraph node type" +.Sh SYNOPSIS +.In netgraph/ng_patch.h +.Sh DESCRIPTION +The +.Nm patch +node performs data modification of packets passing through it. +Modifications are restricted to a subset of C language operations +on unsigned integers of 8, 16, 32 or 64 bit size. +These are: set to new value (=), addition (+=), subtraction (-=), +multiplication (*=), division (/=), negation (= -), +bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), +shift left (<<=), shift right (>>=). +A negation operation is the one exception: integer is treated as signed +and second operand (the +.Va value ) +is not used. +There may be several modification operations, they are all applied +to a packet sequentially in order they were specified by user. +Data payload of packet is viewed as array of bytes, with zero offset +corresponding to the very first byte of packet headers, and +.Va length +bytes beginning from +.Va offset +are taken as a single integer in network byte order. +.Sh HOOKS +This node type has two hooks: +.Bl -tag -width indent +.It Va in +Packets received on this hook are modified according to rules specified +in config and then forwarded to +.Ar out +hook, if it exists and connected. +Otherwise they are reflected back to the +.Ar in +hook. +.It Va out +Packets received on this hook are forwarded to +.Ar in +hook without any changes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width indent +.It Dv NGM_PATCH_SETCONFIG Pq Li setconfig +This command sets the sequence of modify operations +that will be applied to incoming data on a hook. +The following +.Vt "struct ng_patch_config" +must be supplied as an argument: +.Bd -literal -offset 4n +struct ng_patch_op { + uint64_t value; + uint32_t offset; + uint16_t length; /* 1,2,4 or 8 bytes */ + uint16_t mode; +}; +/* Patching modes */ +#define NG_PATCH_MODE_SET 1 +#define NG_PATCH_MODE_ADD 2 +#define NG_PATCH_MODE_SUB 3 +#define NG_PATCH_MODE_MUL 4 +#define NG_PATCH_MODE_DIV 5 +#define NG_PATCH_MODE_NEG 6 +#define NG_PATCH_MODE_AND 7 +#define NG_PATCH_MODE_OR 8 +#define NG_PATCH_MODE_XOR 9 +#define NG_PATCH_MODE_SHL 10 +#define NG_PATCH_MODE_SHR 11 + +struct ng_patch_config { + uint32_t count; + uint32_t csum_flags; + struct ng_patch_op ops[]; +}; +.Ed +.Pp +The +.Va csum_flags +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_SCTP and CSUM_UDP +(other values are ignored) for instructing the IP stack to recalculate the +corresponding checksum before transmitting packet on output interface. +The +.Nm +node does not do any checksum correction by itself. +.It Dv NGM_PATCH_GETCONFIG Pq Li getconfig +This control message obtains current set of modify operations, +returned as +.Vt "struct ng_patch_config" . +.It Dv NGM_PATCH_GET_STATS Pq Li getstats +Returns node statistics as a +.Vt "struct ng_patch_stats" . +.It Dv NGM_PATCH_CLR_STATS Pq Li clrstats +Clear node statistics. +.It Dv NGM_PATCH_GETCLR_STATS Pq Li getclrstats +This command is identical to +.Dv NGM_PATCH_GET_STATS , +except that the statistics are also atomically cleared. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh EXAMPLES +The +.Nm +node allows to modify TTL and TOS/DSCP fields in IP packets. +Suppose you have two adjacent simplex links to remote network +(e.g.\& satellite), so that the packets expiring in between +will generate unwanted ICMP-replies which have to go forth, not back. +Thus you need to raise TTL of every packet entering link link by 2 +to ensure the TTL will not reach zero there. +So you setup +.Xr ipfw 8 +rule with +.Cm netgraph +action to inject packets going to other end of simplex link by the +following +.Xr ngctl 8 +script: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 200 in + name ipfw:200 ttl_add + msg ttl_add: setconfig { count=1 csum_flags=1 ops=[ \e + { mode=2 value=3 length=1 offset=8 } ] } +SEQ +/sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net +.Ed +.Pp +Here +.Dq Li ttl_add +node of type +.Nm +configured to add (mode +.Dv NG_PATCH_MODE_ADD ) +a +.Va value +of 3 to a one-byte TTL field, which is 9th byte of IP packet header. +.Pp +Another example would be two consecutive modifications of packet TOS +field: say, you need to clear the +.Dv IPTOS_THROUGHPUT +bit and set the +.Dv IPTOS_MINCOST +bit. +So you do: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 300 in + name ipfw:300 tos_chg + msg tos_chg: setconfig { count=2 csum_flags=1 ops=[ \e + { mode=7 value=0xf7 length=1 offset=1 } \e + { mode=8 value=0x02 length=1 offset=1 } ] } +SEQ +/sbin/ipfw add 160 netgraph 600 ip from any to any not dst-port 80 +.Ed +.Pp +This first does +.Dv NG_PATCH_MODE_AND +clearing the fourth bit and then +.Dv NG_PATCH_MODE_OR +setting the third bit. +.Pp +In both examples the +.Va csum_flags +field indicates that IP checksum (but not TCP or UDP checksum) should be +recalculated before transmit. +.Pp +Note: one should ensure that packets are returned to ipfw after processing +inside +.Xr netgraph 4 , +by setting appropriate +.Xr sysctl 8 +variable: +.Bd -literal -offset 4n +sysctl net.inet.ip.fw.one_pass=0 +.Ed +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ipfw 4 , +.Xr ngctl 8 +.Sh HISTORY +The +.Nm +node type was implemented in +.Fx 8.1 . +.Sh AUTHORS +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +This manual page was written by +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . +.Sh BUGS +Node blindly tries to apply every patching operation to each packet +(except those which offset if greater than length of the packet), +so be sure that you supply only the right packets to it (e.g. changing +bytes in the ARP packets meant to be in IP header could corrupt +them and make your machine unreachable from the network). +.Pp +.Em !!! WARNING !!! +.Pp +Output path of the IP stack assumes correct fields and lengths in the +packets - changing them by mistake to incorrect values can cause +unpredictable results including kernel panics. Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/conf/NOTES Fri Jul 9 08:48:51 2010 (r209843) @@ -698,6 +698,7 @@ options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_NETFLOW options NETGRAPH_NAT options NETGRAPH_ONE2MANY +options NETGRAPH_PATCH options NETGRAPH_PIPE options NETGRAPH_PPP options NETGRAPH_PPPOE Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/conf/files Fri Jul 9 08:48:51 2010 (r209843) @@ -2457,6 +2457,7 @@ netgraph/ng_mppc.c optional netgraph_mp netgraph/ng_nat.c optional netgraph_nat inet libalias netgraph/ng_one2many.c optional netgraph_one2many netgraph/ng_parse.c optional netgraph +netgraph/ng_patch.c optional netgraph_patch netgraph/ng_pipe.c optional netgraph_pipe netgraph/ng_ppp.c optional netgraph_ppp netgraph/ng_pppoe.c optional netgraph_pppoe Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/conf/options Fri Jul 9 08:48:51 2010 (r209843) @@ -484,6 +484,7 @@ NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h NETGRAPH_NAT opt_netgraph.h NETGRAPH_NETFLOW opt_netgraph.h NETGRAPH_ONE2MANY opt_netgraph.h +NETGRAPH_PATCH opt_netgraph.h NETGRAPH_PIPE opt_netgraph.h NETGRAPH_PPP opt_netgraph.h NETGRAPH_PPPOE opt_netgraph.h Modified: stable/8/sys/modules/netgraph/Makefile ============================================================================== --- stable/8/sys/modules/netgraph/Makefile Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/modules/netgraph/Makefile Fri Jul 9 08:48:51 2010 (r209843) @@ -35,6 +35,7 @@ SUBDIR= async \ netflow \ netgraph \ one2many \ + patch \ pipe \ ppp \ pppoe \ Copied and modified: stable/8/sys/netgraph/ng_patch.c (from r208946, head/sys/netgraph/ng_patch.c) ============================================================================== --- head/sys/netgraph/ng_patch.c Wed Jun 9 12:25:57 2010 (r208946, copy source) +++ stable/8/sys/netgraph/ng_patch.c Fri Jul 9 08:48:51 2010 (r209843) @@ -29,12 +29,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include +#include #include -#include -#include -#include /* be64toh(), htobe64() */ +#include #include #include #include @@ -47,16 +46,14 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; -#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0)) - static int -ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, - const u_char *buf) +ng_patch_config_getlen(const struct ng_parse_type *type, + const u_char *start, const u_char *buf) { const struct ng_patch_config *p; p = (const struct ng_patch_config *)(buf - - OFFSETOF(struct ng_patch_config, ops)); + offsetof(struct ng_patch_config, ops)); return (p->count); } @@ -158,7 +155,7 @@ struct ng_patch_priv { }; typedef struct ng_patch_priv *priv_p; -#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ +#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ (count) * sizeof(struct ng_patch_op)) static void do_patch(priv_p conf, struct mbuf *m); @@ -195,12 +192,14 @@ static int ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook) { const priv_p privp = NG_NODE_PRIVATE(node); - struct ng_patch_config *conf; + struct ng_patch_config *conf, *newconf; + union patch_val *newval; struct ng_mesg *msg; - struct ng_mesg *resp = NULL; - int i, clear = 0; - int error = 0; + struct ng_mesg *resp; + int i, clear, error; + clear = error = 0; + resp = NULL; NGI_GET_MSG(item, msg); switch (msg->header.typecookie) { case NGM_PATCH_COOKIE: @@ -215,16 +214,15 @@ ng_patch_rcvmsg(node_p node, item_p item break; case NGM_PATCH_SETCONFIG: { - struct ng_patch_config *newconf; - union patch_val *newval; - - if (msg->header.arglen < sizeof(struct ng_patch_config)) { + if (msg->header.arglen < + sizeof(struct ng_patch_config)) { error = EINVAL; break; } conf = (struct ng_patch_config *)msg->data; - if (msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) { + if (msg->header.arglen < + NG_PATCH_CONF_SIZE(conf->count)) { error = EINVAL; break; } @@ -248,27 +246,34 @@ ng_patch_rcvmsg(node_p node, item_p item CSUM_SCTP; if (error == 0) { - newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), - M_NETGRAPH, M_WAIT); - newval = malloc(conf->count * sizeof(union patch_val), + newconf = malloc( + NG_PATCH_CONF_SIZE(conf->count), M_NETGRAPH, M_WAIT); + newval = malloc(conf->count * + sizeof(union patch_val), M_NETGRAPH, + M_WAIT); for(i = 0; i < conf->count; i++) { switch (conf->ops[i].length) { case 1: - newval[i].v1 = conf->ops[i].value; + newval[i].v1 = + conf->ops[i].value; break; case 2: - newval[i].v2 = conf->ops[i].value; + newval[i].v2 = + conf->ops[i].value; break; case 4: - newval[i].v4 = conf->ops[i].value; + newval[i].v4 = + conf->ops[i].value; break; case 8: - newval[i].v8 = conf->ops[i].value; + newval[i].v8 = + conf->ops[i].value; break; } } - bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + bcopy(conf, newconf, + NG_PATCH_CONF_SIZE(conf->count)); if (privp->val != NULL) free(privp->val, M_NETGRAPH); privp->val = newval; @@ -310,12 +315,15 @@ ng_patch_rcvmsg(node_p node, item_p item static void do_patch(priv_p privp, struct mbuf *m) { - struct ng_patch_config *conf = privp->config; + struct ng_patch_config *conf; uint64_t buf; - int i, patched = 0; + int i, patched; + conf = privp->config; + patched = 0; for(i = 0; i < conf->count; i++) { - if (conf->ops[i].offset + conf->ops[i].length > m->m_pkthdr.len) + if (conf->ops[i].offset + conf->ops[i].length > + m->m_pkthdr.len) continue; /* for "=" operation we don't need to copy data from mbuf */ @@ -323,7 +331,7 @@ do_patch(priv_p privp, struct mbuf *m) m_copydata(m, conf->ops[i].offset, conf->ops[i].length, (caddr_t)&buf); } - + switch (conf->ops[i].length) { case 1: switch (conf->ops[i].mode) { @@ -550,16 +558,17 @@ ng_patch_shutdown(node_p node) static int ng_patch_disconnect(hook_p hook) { - priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + priv_p priv; + priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); if (hook == priv->in) { priv->in = NULL; } if (hook == priv->out) { priv->out = NULL; } - if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) - && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) /* already shutting down? */ + if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0 && + NG_NODE_IS_VALID(NG_HOOK_NODE(hook))) /* already shutting down? */ ng_rmnode_self(NG_HOOK_NODE(hook)); return (0); } Copied and modified: stable/8/sys/netgraph/ng_patch.h (from r208946, head/sys/netgraph/ng_patch.h) ============================================================================== --- head/sys/netgraph/ng_patch.h Wed Jun 9 12:25:57 2010 (r208946, copy source) +++ stable/8/sys/netgraph/ng_patch.h Fri Jul 9 08:48:51 2010 (r209843) @@ -30,14 +30,14 @@ #define _NETGRAPH_NG_PATCH_H_ /* Node type name. */ -#define NG_PATCH_NODE_TYPE "patch" +#define NG_PATCH_NODE_TYPE "patch" /* Node type cookie. */ -#define NGM_PATCH_COOKIE 1262445509 +#define NGM_PATCH_COOKIE 1262445509 /* Hook names */ -#define NG_PATCH_HOOK_IN "in" -#define NG_PATCH_HOOK_OUT "out" +#define NG_PATCH_HOOK_IN "in" +#define NG_PATCH_HOOK_OUT "out" /* Netgraph commands understood by this node type */ enum { @@ -70,7 +70,7 @@ struct ng_patch_op { uint16_t mode; }; -#define NG_PATCH_OP_TYPE_INFO { \ +#define NG_PATCH_OP_TYPE_INFO { \ { "value", &ng_parse_uint64_type }, \ { "offset", &ng_parse_uint32_type }, \ { "length", &ng_parse_uint16_type }, \ @@ -84,7 +84,7 @@ struct ng_patch_config { struct ng_patch_op ops[]; }; -#define NG_PATCH_CONFIG_TYPE_INFO { \ +#define NG_PATCH_CONFIG_TYPE_INFO { \ { "count", &ng_parse_uint32_type }, \ { "csum_flags", &ng_parse_uint32_type }, \ { "ops", &ng_patch_confarr_type }, \ @@ -97,7 +97,7 @@ struct ng_patch_stats { uint64_t dropped; }; -#define NG_PATCH_STATS_TYPE_INFO { \ +#define NG_PATCH_STATS_TYPE_INFO { \ { "received", &ng_parse_uint64_type }, \ { "patched", &ng_parse_uint64_type }, \ { "dropped", &ng_parse_uint64_type }, \ From owner-svn-src-stable-8@FreeBSD.ORG Fri Jul 9 20:44:14 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9452110656C7; Fri, 9 Jul 2010 20:44:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6983F8FC1C; Fri, 9 Jul 2010 20:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69KiEY3043740; Fri, 9 Jul 2010 20:44:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69KiEbU043737; Fri, 9 Jul 2010 20:44:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201007092044.o69KiEbU043737@svn.freebsd.org> From: Xin LI Date: Fri, 9 Jul 2010 20:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209864 - stable/8/sys/dev/twa X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 20:44:14 -0000 Author: delphij Date: Fri Jul 9 20:44:14 2010 New Revision: 209864 URL: http://svn.freebsd.org/changeset/base/209864 Log: MFC r209860: Don't use pack() for structures that is used purely for software state. Otherwise the resulting, unaligned mutex structure would trigger panic. Submitted by: Tom Cough Reported/Tested by: jhb Modified: stable/8/sys/dev/twa/tw_cl.h stable/8/sys/dev/twa/tw_cl_share.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/twa/tw_cl.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl.h Fri Jul 9 20:43:57 2010 (r209863) +++ stable/8/sys/dev/twa/tw_cl.h Fri Jul 9 20:44:14 2010 (r209864) @@ -74,7 +74,6 @@ #define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */ #endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */ -#pragma pack(1) #ifdef TW_OSL_DEBUG struct tw_cli_q_stats { @@ -206,7 +205,6 @@ struct tw_cli_ctlr_context { #endif /* TW_OSL_DEBUG */ }; -#pragma pack() /* Modified: stable/8/sys/dev/twa/tw_cl_share.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl_share.h Fri Jul 9 20:43:57 2010 (r209863) +++ stable/8/sys/dev/twa/tw_cl_share.h Fri Jul 9 20:44:14 2010 (r209864) @@ -125,7 +125,6 @@ #define TW_CL_SEVERITY_DEBUG_STRING "DEBUG" -#pragma pack(1) /* * Structure, a pointer to which is used as the controller handle in @@ -190,6 +189,7 @@ struct tw_cl_req_packet { }; +#pragma pack(1) /* * Packet that describes an AEN/error generated by the controller, * Common Layer, or even the OS Layer. @@ -206,6 +206,7 @@ struct tw_cl_event_packet { TW_UINT32 event_src; TW_UINT8 severity_str[20]; }; +#pragma pack() /* Structure to link 2 adjacent elements in a list. */ @@ -215,6 +216,7 @@ struct tw_cl_link { }; +#pragma pack(1) /* Scatter/Gather list entry with 32 bit addresses. */ struct tw_cl_sg_desc32 { TW_UINT32 address; From owner-svn-src-stable-8@FreeBSD.ORG Sat Jul 10 09:29:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 532F7106566C; Sat, 10 Jul 2010 09:29:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 419F08FC08; Sat, 10 Jul 2010 09:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6A9Tnp2013070; Sat, 10 Jul 2010 09:29:49 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6A9Tnhn013069; Sat, 10 Jul 2010 09:29:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201007100929.o6A9Tnhn013069@svn.freebsd.org> From: Martin Matuska Date: Sat, 10 Jul 2010 09:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209870 - stable/8/cddl/compat/opensolaris/misc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 09:29:49 -0000 Author: mm Date: Sat Jul 10 09:29:48 2010 New Revision: 209870 URL: http://svn.freebsd.org/changeset/base/209870 Log: MFC r209757: - Add support for the "sec" option to "zfs set sharenfs" Submitted by: Dmitry Morozovsky Approved by: delphij (mentor) Modified: stable/8/cddl/compat/opensolaris/misc/fsshare.c Directory Properties: stable/8/cddl/compat/opensolaris/ (props changed) Modified: stable/8/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- stable/8/cddl/compat/opensolaris/misc/fsshare.c Sat Jul 10 03:45:55 2010 (r209869) +++ stable/8/cddl/compat/opensolaris/misc/fsshare.c Sat Jul 10 09:29:48 2010 (r209870) @@ -110,11 +110,11 @@ getline(FILE *fd, const char *skip) * * Recognized keywords: * - * ro, maproot, mapall, mask, network, alldirs, public, webnfs, index, quiet + * ro, maproot, mapall, mask, network, sec, alldirs, public, webnfs, index, quiet * */ static const char *known_opts[] = { "ro", "maproot", "mapall", "mask", - "network", "alldirs", "public", "webnfs", "index", "quiet", NULL }; + "network", "sec", "alldirs", "public", "webnfs", "index", "quiet", NULL }; static char * translate_opts(const char *shareopts) {